|
|
|
|
@ -103,6 +103,7 @@ class Exercise |
|
|
|
|
public $globalCategoryId = null; |
|
|
|
|
public $distributionId = 0; |
|
|
|
|
public $loadDistributions = false; |
|
|
|
|
public $trackExercise = array(); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Constructor of the class |
|
|
|
|
@ -238,6 +239,9 @@ class Exercise |
|
|
|
|
// Control time |
|
|
|
|
$this->expired_time = $object->expired_time; |
|
|
|
|
|
|
|
|
|
// 5. Getting user exercise info (if the user took the exam before) - generating exe_id |
|
|
|
|
$this->trackExercise = $this->getStatTrackExerciseInfo(); |
|
|
|
|
|
|
|
|
|
if ($parseQuestionList) { |
|
|
|
|
$this->setQuestionList($this->loadDistributions); |
|
|
|
|
} |
|
|
|
|
@ -5600,6 +5604,12 @@ class Exercise |
|
|
|
|
$sessionId = api_get_session_id(); |
|
|
|
|
if (!empty($sessionId)) { |
|
|
|
|
|
|
|
|
|
$dataExists = !empty($this->trackExercise) && isset($this->trackExercise['data_tracking']) && !empty($this->trackExercise['data_tracking']) ? true : false; |
|
|
|
|
|
|
|
|
|
if ($dataExists) { |
|
|
|
|
$questionList = explode(',', $this->trackExercise['data_tracking']); |
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
// Counting how many attempts from session are in the DB |
|
|
|
|
$trackExercises = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCICES); |
|
|
|
|
$sql = "SELECT count(exe_id) as count FROM $trackExercises WHERE session_id = $sessionId"; |
|
|
|
|
@ -5664,6 +5674,7 @@ class Exercise |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$this->setMediaList($questionList, $this->course_id); |
|
|
|
|
|
|
|
|
|
|