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 206 of file XapiProxy.php.
References $DIC, ilLPStatusWrapper\_updateStatus(), ANONYMOUS_USER_ID, ilObjectFactory\getInstanceByObjId(), and ilObjCmiXapi\LAUNCH_MODE_NORMAL.
210 require_once __DIR__ .
'/../class.ilObjXapiCmi5.php';
218 $statementEvaluation = new \ilXapiStatementEvaluation($this->
log(), $object);
219 $statementEvaluation->evaluateStatement($xapiStatement, $this->authToken->getUsrId());
223 $this->authToken->getObjId(),
224 $this->authToken->getUsrId()
228 if ($xapiStatement->verb->id == self::TERMINATED_VERB) {
230 $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 269 of file XapiProxy.php.
References ilObjectFactory\getInstanceByObjId().
272 $objActivityId = $object->getActivityId();
273 $statementActivityId = $obj->object->id;
274 if ($statementActivityId != $objActivityId) {
275 $this->
log()->debug($this->
msg(
"statement object id " . $statementActivityId .
" != activityId " . $objActivityId));
276 $this->
log()->debug($this->
msg(
"is Substatement"));
279 $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 173 of file XapiProxy.php.
References $i.
175 $obj = json_decode($body,
false);
177 if (json_last_error() != JSON_ERROR_NONE) {
179 $this->
log()->error($this->
msg(json_last_error_msg()));
184 if (is_object($obj)) {
187 $this->
setValue($obj, $key, $value);
193 if (is_array($obj)) {
194 for (
$i = 0;
$i < count($obj);
$i++) {
203 return json_encode($obj);
setValue(&$obj, $path, $value)
handleStatementEvaluation($xapiStatement)
◆ processStatements()
XapiProxy\XapiProxy::processStatements |
( |
|
$request, |
|
|
|
$body |
|
) |
| |
Definition at line 112 of file XapiProxy.php.
References $i, and $ret.
116 $this->
log()->debug($this->
msg(
"all statement are allowed"));
119 $obj = json_decode($body,
false);
121 if (is_object($obj) && isset($obj->verb)) {
122 $this->
log()->debug($this->
msg(
"json is object and statement"));
124 $verb = $obj->verb->id;
126 $this->
log()->debug($this->
msg(
"sub-statement is NOT allowed, fake response - " . $verb));
127 $this->xapiProxyResponse->fakeResponseBlocked(null);
134 $this->
log()->debug($this->
msg(
"statement is allowed, do nothing - " . $verb));
137 $this->
log()->debug($this->
msg(
"statement is NOT allowed, fake response - " . $verb));
138 $this->xapiProxyResponse->fakeResponseBlocked(null);
142 if (is_array($obj) && count($obj) > 0 && isset($obj[0]->verb)) {
143 $this->
log()->debug($this->
msg(
"json is array of statements"));
146 for (
$i = 0;
$i < count($obj);
$i++) {
147 array_push(
$ret, $obj[
$i]->
id);
149 $verb = $obj[
$i]->verb->id;
151 $this->
log()->debug($this->
msg(
"sub-statement is NOT allowed - " . $verb));
154 $this->
log()->debug($this->
msg(
"statement is allowed - " . $verb));
155 array_push($up, $obj[
$i]);
159 if (count($up) === 0) {
160 $this->
log()->debug($this->
msg(
"no allowed statements in array - fake response..."));
161 $this->xapiProxyResponse->fakeResponseBlocked(
$ret);
162 } elseif (count($up) !== count(
$ret)) {
163 $this->
log()->debug($this->
msg(
"mixed with allowed and unallowed statements"));
164 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 249 of file XapiProxy.php.
251 if (isset($obj->verb) && isset($obj->actor) && isset($obj->object)) {
252 $verb = $obj->verb->id;
254 if (array_key_exists($verb, $this->sniffVerbs)) {
257 $this->
log()->debug($this->
msg(
"statement is sub-statement, ignore status verb " . $verb));
260 if (isset($obj->result) && isset($obj->result->score) && isset($obj->result->score->scaled)) {
261 $score = $obj->result->score->scaled;
263 $this->
log()->debug($this->
msg(
"handleLPStatus: " . $this->sniffVerbs[$verb] .
" : " . $score));
264 \ilObjXapiCmi5::handleLPStatusFromProxy($this->
client, $this->
token, $this->sniffVerbs[$verb], $score);
isSubStatementCheck($obj)
◆ setValue()
XapiProxy\XapiProxy::setValue |
( |
& |
$obj, |
|
|
|
$path, |
|
|
|
$value |
|
) |
| |
|
private |
Definition at line 235 of file XapiProxy.php.
237 $path_components = explode(
'.', $path);
238 if (count($path_components) == 1) {
239 if (property_exists($obj, $path_components[0])) {
240 $obj->{$path_components[0]} = $value;
243 if (property_exists($obj, $path_components[0])) {
244 $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: