Definition at line 6 of file XapiProxy.php.
◆ __construct()
XapiProxy\XapiProxy::__construct |
( |
|
$client, |
|
|
|
$token, |
|
|
|
$plugin = false |
|
) |
| |
◆ blockSubStatements()
XapiProxy\XapiProxy::blockSubStatements |
( |
| ) |
|
◆ client()
XapiProxy\XapiProxy::client |
( |
| ) |
|
◆ cmdParts()
XapiProxy\XapiProxy::cmdParts |
( |
| ) |
|
◆ getDefaultLrsEndpoint()
XapiProxy\XapiProxy::getDefaultLrsEndpoint |
( |
| ) |
|
◆ getDefaultLrsKey()
XapiProxy\XapiProxy::getDefaultLrsKey |
( |
| ) |
|
◆ getDefaultLrsSecret()
XapiProxy\XapiProxy::getDefaultLrsSecret |
( |
| ) |
|
◆ getFallbackLrsEndpoint()
XapiProxy\XapiProxy::getFallbackLrsEndpoint |
( |
| ) |
|
◆ getFallbackLrsKey()
XapiProxy\XapiProxy::getFallbackLrsKey |
( |
| ) |
|
◆ getFallbackLrsSecret()
XapiProxy\XapiProxy::getFallbackLrsSecret |
( |
| ) |
|
◆ getXapiProxyRequest()
XapiProxy\XapiProxy::getXapiProxyRequest |
( |
| ) |
|
◆ getXapiProxyResponse()
XapiProxy\XapiProxy::getXapiProxyResponse |
( |
| ) |
|
◆ handleStatementEvaluation()
XapiProxy\XapiProxy::handleStatementEvaluation |
( |
|
$xapiStatement | ) |
|
|
private |
Definition at line 189 of file XapiProxy.php.
References $DIC, ilLPStatusWrapper\_updateStatus(), ilObjectFactory\getInstanceByObjId(), and ilObjCmiXapi\LAUNCH_MODE_NORMAL.
193 require_once __DIR__.
'/../class.ilObjXapiCmi5.php';
202 $statementEvaluation = new \ilXapiStatementEvaluation($this->
log(), $object);
203 $statementEvaluation->evaluateStatement($xapiStatement, $this->authToken->getUsrId());
206 $this->authToken->getObjId(),
207 $this->authToken->getUsrId()
210 if ($xapiStatement->verb->id == self::TERMINATED_VERB) {
212 $this->authToken->delete();
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
◆ isSubStatementCheck()
XapiProxy\XapiProxy::isSubStatementCheck |
( |
|
$obj | ) |
|
|
private |
Definition at line 250 of file XapiProxy.php.
References ilObjectFactory\getInstanceByObjId().
252 $objActivityId = $object->getActivityId();
253 $statementActivityId = $obj->object->id;
254 if ($statementActivityId != $objActivityId) {
255 $this->
log()->debug($this->
msg(
"statement object id " . $statementActivityId .
" != activityId " . $objActivityId));
256 $this->
log()->debug($this->
msg(
"is Substatement"));
260 $this->
log()->debug($this->
msg(
"is not Substatement"));
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
◆ lrsType()
XapiProxy\XapiProxy::lrsType |
( |
| ) |
|
◆ method()
XapiProxy\XapiProxy::method |
( |
| ) |
|
◆ modifyBody()
XapiProxy\XapiProxy::modifyBody |
( |
|
$body | ) |
|
Definition at line 156 of file XapiProxy.php.
References $i.
158 $obj = json_decode($body,
false);
160 if (json_last_error() != JSON_ERROR_NONE) {
162 $this->
log()->error($this->
msg(json_last_error_msg()));
167 if (is_object($obj)) {
176 if (is_array($obj)) {
177 for (
$i = 0;
$i < count($obj);
$i++) {
186 return json_encode($obj);
setValue(&$obj, $path, $value)
handleStatementEvaluation($xapiStatement)
◆ processStatements()
XapiProxy\XapiProxy::processStatements |
( |
|
$request, |
|
|
|
$body |
|
) |
| |
Definition at line 92 of file XapiProxy.php.
References $i, and $ret.
95 $this->
log()->debug($this->
msg(
"all statement are allowed"));
98 $obj = json_decode($body,
false);
100 if (is_object($obj) && isset($obj->verb)) {
101 $this->
log()->debug($this->
msg(
"json is object and statement"));
103 $verb = $obj->verb->id;
105 $this->
log()->debug($this->
msg(
"sub-statement is NOT allowed, fake response - " . $verb));
106 $this->xapiProxyResponse->fakeResponseBlocked(NULL);
113 $this->
log()->debug($this->
msg(
"statement is allowed, do nothing - " . $verb));
117 $this->
log()->debug($this->
msg(
"statement is NOT allowed, fake response - " . $verb));
118 $this->xapiProxyResponse->fakeResponseBlocked(NULL);
122 if (is_array($obj) && count($obj) > 0 && isset($obj[0]->verb)) {
123 $this->
log()->debug($this->
msg(
"json is array of statements"));
126 for (
$i=0;
$i<count($obj);
$i++) {
127 array_push(
$ret,$obj[
$i]->
id);
129 $verb = $obj[
$i]->verb->id;
131 $this->
log()->debug($this->
msg(
"sub-statement is NOT allowed - " .$verb));
135 $this->
log()->debug($this->
msg(
"statement is allowed - " . $verb));
136 array_push($up,$obj[
$i]);
140 if (count($up) === 0) {
141 $this->
log()->debug($this->
msg(
"no allowed statements in array - fake response..."));
142 $this->xapiProxyResponse->fakeResponseBlocked(
$ret);
144 elseif (count($up) !== count(
$ret)) {
145 $this->
log()->debug($this->
msg(
"mixed with allowed and unallowed statements"));
146 return array($up,
$ret);
specificAllowedStatements()
isSubStatementCheck($obj)
◆ replacedValues()
XapiProxy\XapiProxy::replacedValues |
( |
| ) |
|
◆ setRequestParams()
XapiProxy\XapiProxy::setRequestParams |
( |
|
$request | ) |
|
◆ setStatus()
XapiProxy\XapiProxy::setStatus |
( |
|
$obj | ) |
|
|
private |
Definition at line 231 of file XapiProxy.php.
232 if (isset($obj->verb) && isset($obj->actor) && isset($obj->object)) {
233 $verb = $obj->verb->id;
235 if (array_key_exists($verb, $this->sniffVerbs)) {
238 $this->
log()->debug($this->
msg(
"statement is sub-statement, ignore status verb " . $verb));
241 if (isset($obj->result) && isset($obj->result->score) && isset($obj->result->score->scaled)) {
242 $score = $obj->result->score->scaled;
244 $this->
log()->debug($this->
msg(
"handleLPStatus: " . $this->sniffVerbs[$verb] .
" : " . $score));
245 \ilObjXapiCmi5::handleLPStatusFromProxy($this->
client, $this->
token, $this->sniffVerbs[$verb], $score);
isSubStatementCheck($obj)
◆ setValue()
XapiProxy\XapiProxy::setValue |
( |
& |
$obj, |
|
|
|
$path, |
|
|
|
$value |
|
) |
| |
|
private |
Definition at line 217 of file XapiProxy.php.
218 $path_components = explode(
'.', $path);
219 if (count($path_components) == 1) {
220 if (property_exists($obj,$path_components[0])) {
221 $obj->{$path_components[0]} = $value;
225 if (property_exists($obj, $path_components[0])) {
226 $this->
setValue($obj->{array_shift($path_components)}, implode(
'.', $path_components), $value);
setValue(&$obj, $path, $value)
◆ setXapiProxyRequest()
XapiProxy\XapiProxy::setXapiProxyRequest |
( |
|
$xapiProxyRequest | ) |
|
◆ setXapiProxyResponse()
XapiProxy\XapiProxy::setXapiProxyResponse |
( |
|
$xapiProxyResponse | ) |
|
◆ specificAllowedStatements()
XapiProxy\XapiProxy::specificAllowedStatements |
( |
| ) |
|
◆ token()
XapiProxy\XapiProxy::token |
( |
| ) |
|
◆ $xapiProxyRequest
XapiProxy\XapiProxy::$xapiProxyRequest |
|
private |
◆ $xapiProxyResponse
XapiProxy\XapiProxy::$xapiProxyResponse |
|
private |
The documentation for this class was generated from the following file: