diff --git a/main/inc/lib/events.lib.php b/main/inc/lib/events.lib.php index 8e3b2c65d0..3da5f66362 100644 --- a/main/inc/lib/events.lib.php +++ b/main/inc/lib/events.lib.php @@ -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"]; } diff --git a/src/Chamilo/CoreBundle/Entity/TrackEAttempt.php b/src/Chamilo/CoreBundle/Entity/TrackEAttempt.php index b7bc7e0a20..3ba6950548 100644 --- a/src/Chamilo/CoreBundle/Entity/TrackEAttempt.php +++ b/src/Chamilo/CoreBundle/Entity/TrackEAttempt.php @@ -64,13 +64,6 @@ class TrackEAttempt */ private $marks; - /** - * @var string - * - * @ORM\Column(name="course_code", type="string", length=40, nullable=false) - */ - private $courseCode; - /** * @var integer * @@ -255,29 +248,6 @@ class TrackEAttempt return $this->marks; } - /** - * Set courseCode - * - * @param string $courseCode - * @return TrackEAttempt - */ - public function setCourseCode($courseCode) - { - $this->courseCode = $courseCode; - - return $this; - } - - /** - * Get courseCode - * - * @return string - */ - public function getCourseCode() - { - return $this->courseCode; - } - /** * Set cId *