Fix random questions - refs BT#11186 #8229

1.9.x
Angel Fernando Quiroz Campos 10 years ago
parent bea1e20d82
commit 0338b8a76a
  1. 56
      main/exercice/exercise_submit.php

@ -250,33 +250,6 @@ $exercise_stat_info = $objExercise->get_stat_track_exercise_info(
$learnpath_item_view_id $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. // Fix in order to get the correct question list.
$questionListUncompressed = $objExercise->getQuestionListWithMediasUncompressed(); $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 "); 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 // Array to check in order to block the chat
create_chat_exercise_session($exe_id); create_chat_exercise_session($exe_id);

Loading…
Cancel
Save