|
@@ -494,8 +494,7 @@ class Event
|
|
|
'position' => $position,
|
|
|
'tms' => $now,
|
|
|
'filename' => !empty($fileName) ? basename($fileName) : $fileName,
|
|
|
- 'teacher_comment' => '',
|
|
|
- 'course_code' => ''
|
|
|
+ 'teacher_comment' => ''
|
|
|
);
|
|
|
|
|
|
// Check if attempt exists.
|
|
@@ -532,6 +531,10 @@ class Event
|
|
|
if ($updateResults == false) {
|
|
|
$attempt_id = Database::insert($TBL_TRACK_ATTEMPT, $attempt);
|
|
|
|
|
|
+ if ($debug) {
|
|
|
+ error_log("Insert attempt with id #$attempt_id");
|
|
|
+ }
|
|
|
+
|
|
|
if (defined('ENABLED_LIVE_EXERCISE_TRACKING')) {
|
|
|
if ($debug) {
|
|
|
error_log("Saving e attempt recording ");
|
|
@@ -547,11 +550,13 @@ class Event
|
|
|
Database::insert($recording_table, $attempt_recording);
|
|
|
}
|
|
|
} else {
|
|
|
- Database::update($TBL_TRACK_ATTEMPT, $attempt,
|
|
|
- array('exe_id = ? AND question_id = ? AND user_id = ? ' => array($exe_id, $question_id, $user_id)));
|
|
|
+ Database::update(
|
|
|
+ $TBL_TRACK_ATTEMPT,
|
|
|
+ $attempt,
|
|
|
+ array('exe_id = ? AND question_id = ? AND user_id = ? ' => array($exe_id, $question_id, $user_id))
|
|
|
+ );
|
|
|
|
|
|
if (defined('ENABLED_LIVE_EXERCISE_TRACKING')) {
|
|
|
-
|
|
|
$attempt_recording = array(
|
|
|
'exe_id' => $exe_id,
|
|
|
'question_id' => $question_id,
|
|
@@ -561,7 +566,9 @@ class Event
|
|
|
'session_id' => $session_id,
|
|
|
);
|
|
|
|
|
|
- Database::update($recording_table, $attempt_recording,
|
|
|
+ Database::update(
|
|
|
+ $recording_table,
|
|
|
+ $attempt_recording,
|
|
|
array('exe_id = ? AND question_id = ? AND session_id = ? ' => array($exe_id, $question_id, $session_id))
|
|
|
);
|
|
|
}
|
|
@@ -570,7 +577,6 @@ class Event
|
|
|
|
|
|
return $attempt_id;
|
|
|
} else {
|
|
|
-
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
@@ -1790,7 +1796,7 @@ class Event
|
|
|
WHERE user_from = '.$user_from.' AND user_to = '.$user_to.' AND event_type_name = "'.$event_name.'"';
|
|
|
}
|
|
|
$result = Database::store_result(Database::query($sql), 'ASSOC');
|
|
|
-
|
|
|
+
|
|
|
return $result[0]["total"];
|
|
|
}
|
|
|
|