|
|
@ -5857,8 +5857,12 @@ class Exercise |
|
|
|
* @param string $ip Optional. The user IP |
|
|
|
* @param string $ip Optional. The user IP |
|
|
|
* @return string |
|
|
|
* @return string |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function show_exercise_result_header($user_data, $start_date = null, $duration = null, $ip = null) |
|
|
|
public function show_exercise_result_header( |
|
|
|
{ |
|
|
|
$user_data, |
|
|
|
|
|
|
|
$start_date = null, |
|
|
|
|
|
|
|
$duration = null, |
|
|
|
|
|
|
|
$ip = null |
|
|
|
|
|
|
|
) { |
|
|
|
$array = array(); |
|
|
|
$array = array(); |
|
|
|
|
|
|
|
|
|
|
|
if (!empty($user_data)) { |
|
|
|
if (!empty($user_data)) { |
|
|
@ -6435,13 +6439,14 @@ class Exercise |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* |
|
|
|
|
|
|
|
* @params array question list |
|
|
|
* @params array question list |
|
|
|
* @params bool expand or not question list (true show all questions, false show media question id instead of the question ids) |
|
|
|
* @params bool expand or not question list (true show all questions, |
|
|
|
* |
|
|
|
* false show media question id instead of the question ids) |
|
|
|
**/ |
|
|
|
**/ |
|
|
|
public function transformQuestionListWithMedias($question_list, $expand_media_questions = false) |
|
|
|
public function transformQuestionListWithMedias( |
|
|
|
{ |
|
|
|
$question_list, |
|
|
|
|
|
|
|
$expand_media_questions = false |
|
|
|
|
|
|
|
) { |
|
|
|
$new_question_list = array(); |
|
|
|
$new_question_list = array(); |
|
|
|
if (!empty($question_list)) { |
|
|
|
if (!empty($question_list)) { |
|
|
|
$media_questions = $this->getMediaList(); |
|
|
|
$media_questions = $this->getMediaList(); |
|
|
@ -6646,7 +6651,9 @@ class Exercise |
|
|
|
|
|
|
|
|
|
|
|
if (empty($exercise_info['questions_to_check'])) { |
|
|
|
if (empty($exercise_info['questions_to_check'])) { |
|
|
|
if ($action == 'add') { |
|
|
|
if ($action == 'add') { |
|
|
|
$sql = "UPDATE $track_exercises SET questions_to_check = '$question_id' WHERE exe_id = $exe_id "; |
|
|
|
$sql = "UPDATE $track_exercises |
|
|
|
|
|
|
|
SET questions_to_check = '$question_id' |
|
|
|
|
|
|
|
WHERE exe_id = $exe_id "; |
|
|
|
Database::query($sql); |
|
|
|
Database::query($sql); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -6678,7 +6685,9 @@ class Exercise |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
$remind_list_string = Database::escape_string($remind_list_string); |
|
|
|
$remind_list_string = Database::escape_string($remind_list_string); |
|
|
|
$sql = "UPDATE $track_exercises SET questions_to_check = '$remind_list_string' WHERE exe_id = $exe_id "; |
|
|
|
$sql = "UPDATE $track_exercises |
|
|
|
|
|
|
|
SET questions_to_check = '$remind_list_string' |
|
|
|
|
|
|
|
WHERE exe_id = $exe_id "; |
|
|
|
Database::query($sql); |
|
|
|
Database::query($sql); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -7050,8 +7059,9 @@ class Exercise |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// The $questionList contains the media id we check if this questionId is a media question type |
|
|
|
// The $questionList contains the media id we check if this questionId is a media question type |
|
|
|
|
|
|
|
if (isset($mediaQuestions[$questionId]) && |
|
|
|
if (isset($mediaQuestions[$questionId]) && $mediaQuestions[$questionId] != 999) { |
|
|
|
$mediaQuestions[$questionId] != 999 |
|
|
|
|
|
|
|
) { |
|
|
|
// The question belongs to a media |
|
|
|
// The question belongs to a media |
|
|
|
$mediaQuestionList = $mediaQuestions[$questionId]; |
|
|
|
$mediaQuestionList = $mediaQuestions[$questionId]; |
|
|
|
$objQuestionTmp = Question::read($questionId); |
|
|
|
$objQuestionTmp = Question::read($questionId); |
|
|
@ -7122,7 +7132,7 @@ class Exercise |
|
|
|
|
|
|
|
|
|
|
|
if ($this->type == ALL_ON_ONE_PAGE) { |
|
|
|
if ($this->type == ALL_ON_ONE_PAGE) { |
|
|
|
$exercise_actions = $this->show_button($questionId, $currentQuestion); |
|
|
|
$exercise_actions = $this->show_button($questionId, $currentQuestion); |
|
|
|
echo Display::div($exercise_actions, array('class'=>'exercise_actions')); |
|
|
|
echo Display::div($exercise_actions, ['class' => 'exercise_actions']); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -7230,7 +7240,12 @@ class Exercise |
|
|
|
// Button save and continue |
|
|
|
// Button save and continue |
|
|
|
switch ($this->type) { |
|
|
|
switch ($this->type) { |
|
|
|
case ONE_PER_PAGE: |
|
|
|
case ONE_PER_PAGE: |
|
|
|
$exercise_actions .= $this->show_button($questionId, $current_question, null, $remindList); |
|
|
|
$exercise_actions .= $this->show_button( |
|
|
|
|
|
|
|
$questionId, |
|
|
|
|
|
|
|
$current_question, |
|
|
|
|
|
|
|
null, |
|
|
|
|
|
|
|
$remindList |
|
|
|
|
|
|
|
); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case ALL_ON_ONE_PAGE: |
|
|
|
case ALL_ON_ONE_PAGE: |
|
|
|
$button = [ |
|
|
|
$button = [ |
|
|
@ -7271,7 +7286,9 @@ class Exercise |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Checkbox review answers |
|
|
|
// Checkbox review answers |
|
|
|
if ($this->review_answers && !in_array($question_obj->type, Question::question_type_no_review())) { |
|
|
|
if ($this->review_answers && |
|
|
|
|
|
|
|
!in_array($question_obj->type, Question::question_type_no_review()) |
|
|
|
|
|
|
|
) { |
|
|
|
$remind_question_div = Display::tag( |
|
|
|
$remind_question_div = Display::tag( |
|
|
|
'label', |
|
|
|
'label', |
|
|
|
Display::input( |
|
|
|
Display::input( |
|
|
|