|
@@ -248,8 +248,14 @@ function save_item(
|
|
) {
|
|
) {
|
|
if ($score >= $masteryScore) {
|
|
if ($score >= $masteryScore) {
|
|
$myLPI->set_status('passed');
|
|
$myLPI->set_status('passed');
|
|
|
|
+ if ($debug) {
|
|
|
|
+ error_log('Set status: passed');
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
$myLPI->set_status('failed');
|
|
$myLPI->set_status('failed');
|
|
|
|
+ if ($debug) {
|
|
|
|
+ error_log('Set status: failed');
|
|
|
|
+ }
|
|
}
|
|
}
|
|
$statusIsSet = true;
|
|
$statusIsSet = true;
|
|
}
|
|
}
|
|
@@ -261,6 +267,9 @@ function save_item(
|
|
*/
|
|
*/
|
|
if (!$statusIsSet && !$masteryScore && !$statusSignalReceived) {
|
|
if (!$statusIsSet && !$masteryScore && !$statusSignalReceived) {
|
|
if (!empty($status)) {
|
|
if (!empty($status)) {
|
|
|
|
+ if ($debug) {
|
|
|
|
+ error_log("Set status: $status because: statusSignalReceived ");
|
|
|
|
+ }
|
|
$myLPI->set_status($status);
|
|
$myLPI->set_status($status);
|
|
$statusIsSet = true;
|
|
$statusIsSet = true;
|
|
}
|
|
}
|
|
@@ -276,6 +285,9 @@ function save_item(
|
|
if (!$statusIsSet && $credit == 'no-credit' && !$statusSignalReceived) {
|
|
if (!$statusIsSet && $credit == 'no-credit' && !$statusSignalReceived) {
|
|
$mode = $myLPI->get_lesson_mode();
|
|
$mode = $myLPI->get_lesson_mode();
|
|
if ($mode == 'browse' && $status == 'browsed') {
|
|
if ($mode == 'browse' && $status == 'browsed') {
|
|
|
|
+ if ($debug) {
|
|
|
|
+ error_log("Set status: $status because mode browse");
|
|
|
|
+ }
|
|
$myLPI->set_status($status);
|
|
$myLPI->set_status($status);
|
|
$statusIsSet = true;
|
|
$statusIsSet = true;
|
|
}
|
|
}
|
|
@@ -319,6 +331,9 @@ function save_item(
|
|
$myStatus = 'failed';
|
|
$myStatus = 'failed';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if ($debug) {
|
|
|
|
+ error_log("Set status: $myStatus because lmsFinish || userNavigatesAway");
|
|
|
|
+ }
|
|
$myLPI->set_status($myStatus);
|
|
$myLPI->set_status($myStatus);
|
|
$statusIsSet = true;
|
|
$statusIsSet = true;
|
|
}
|
|
}
|
|
@@ -410,6 +425,10 @@ function save_item(
|
|
$myStatusInDB != 'failed'
|
|
$myStatusInDB != 'failed'
|
|
) {
|
|
) {
|
|
$myStatusInMemory = $myLPI->get_status(false);
|
|
$myStatusInMemory = $myLPI->get_status(false);
|
|
|
|
+ if ($debug) {
|
|
|
|
+ error_log("myStatusInMemory: $myStatusInMemory");
|
|
|
|
+ }
|
|
|
|
+
|
|
if ($myStatusInMemory != $myStatusInDB) {
|
|
if ($myStatusInMemory != $myStatusInDB) {
|
|
$myStatus = $myStatusInMemory;
|
|
$myStatus = $myStatusInMemory;
|
|
} else {
|
|
} else {
|