Merge branch '1.9.x' of github.com:chamilo/chamilo-lms into 1.9.x

1.9.x
jmontoyaa 10 years ago
commit f0d9fbc04c
  1. 2
      main/exercice/exercise.class.php
  2. 56
      main/exercice/exercise_submit.php

@ -1307,7 +1307,7 @@ class Exercise
// @todo improve this query
$sql = "SELECT e.question_id
FROM $TBL_EXERCISE_QUESTION e INNER JOIN $TBL_QUESTIONS q
ON (e.question_id= q.iid)
ON (e.question_id= q.id)
WHERE e.c_id = {$this->course_id} AND e.exercice_id = '".Database::escape_string($this->id)."'
ORDER BY RAND()
$randomLimit ";

@ -250,33 +250,6 @@ $exercise_stat_info = $objExercise->get_stat_track_exercise_info(
$learnpath_item_view_id
);
//if (1) {
$questionListInSession = Session::read('questionList');
if (!isset($questionListInSession)) {
// Selects the list of question ID
$questionList = $objExercise->getQuestionList();
// Media questions.
$media_is_activated = $objExercise->mediaIsActivated();
//Getting order from random
if ($media_is_activated == false &&
$objExercise->isRandom() &&
isset($exercise_stat_info) &&
!empty($exercise_stat_info['data_tracking'])
) {
$questionList = explode(',', $exercise_stat_info['data_tracking']);
}
Session::write('questionList', $questionList);
if ($debug > 0) {
error_log('$_SESSION[questionList] was set');
}
} else {
if (isset($objExercise) && isset($exerciseInSession)) {
$questionList = Session::read('questionList');
}
}
// Fix in order to get the correct question list.
$questionListUncompressed = $objExercise->getQuestionListWithMediasUncompressed();
@ -346,6 +319,35 @@ if (empty($exercise_stat_info)) {
if ($debug) error_log("5 exercise_stat_info[] exists getting exe_id $exe_id ");
}
$questionListInSession = Session::read('questionList');
if (!isset($questionListInSession)) {
// Selects the list of question ID
$questionList = $objExercise->getQuestionList();
// Media questions.
$media_is_activated = $objExercise->mediaIsActivated();
//Getting order from random
if ($media_is_activated == false &&
$objExercise->isRandom() &&
isset($exercise_stat_info) &&
!empty($exercise_stat_info['data_tracking'])
) {
$questionList = explode(',', $exercise_stat_info['data_tracking']);
}
Session::write('questionList', $questionList);
if ($debug > 0) {
error_log('$_SESSION[questionList] was set');
}
} else {
if (isset($objExercise) && isset($exerciseInSession)) {
$questionList = Session::read('questionList');
}
}
// Array to check in order to block the chat
create_chat_exercise_session($exe_id);

Loading…
Cancel
Save