|
|
|
@ -16,7 +16,7 @@ class ExerciseLib |
|
|
|
|
/** |
|
|
|
|
* Shows a question |
|
|
|
|
* |
|
|
|
|
* @param int $questionId question id |
|
|
|
|
* @param int $questionId $questionId question id |
|
|
|
|
* @param bool $only_questions if true only show the questions, no exercise title |
|
|
|
|
* @param bool $origin i.e = learnpath |
|
|
|
|
* @param string $current_item current item from the list of questions |
|
|
|
@ -24,9 +24,10 @@ class ExerciseLib |
|
|
|
|
* @param bool $freeze |
|
|
|
|
* @param array $user_choice |
|
|
|
|
* @param bool $show_comment |
|
|
|
|
* @param bool $exercise_feedback |
|
|
|
|
* @param null $exercise_feedback |
|
|
|
|
* @param bool $show_answers |
|
|
|
|
* */ |
|
|
|
|
* @return bool|int |
|
|
|
|
*/ |
|
|
|
|
public static function showQuestion( |
|
|
|
|
$questionId, |
|
|
|
|
$only_questions = false, |
|
|
|
@ -38,7 +39,8 @@ class ExerciseLib |
|
|
|
|
$show_comment = false, |
|
|
|
|
$exercise_feedback = null, |
|
|
|
|
$show_answers = false |
|
|
|
|
) { |
|
|
|
|
) |
|
|
|
|
{ |
|
|
|
|
$course_id = api_get_course_int_id(); |
|
|
|
|
// Change false to true in the following line to enable answer hinting |
|
|
|
|
$debug_mark_answer = $show_answers; |
|
|
|
@ -89,13 +91,6 @@ class ExerciseLib |
|
|
|
|
$objAnswerTmp = new Answer($questionId); |
|
|
|
|
$nbrAnswers = $objAnswerTmp->selectNbrAnswers(); |
|
|
|
|
|
|
|
|
|
if ($answerType == FREE_ANSWER || |
|
|
|
|
$answerType == ORAL_EXPRESSION || |
|
|
|
|
$answerType == CALCULATED_ANSWER |
|
|
|
|
) { |
|
|
|
|
$nbrAnswers = 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$quiz_question_options = Question::readQuestionOption( |
|
|
|
|
$questionId, |
|
|
|
|
$course_id |
|
|
|
@ -277,9 +272,14 @@ class ExerciseLib |
|
|
|
|
|
|
|
|
|
$attributes = array(); |
|
|
|
|
|
|
|
|
|
// Unique answer |
|
|
|
|
if (in_array($answerType, [UNIQUE_ANSWER, UNIQUE_ANSWER_NO_OPTION, UNIQUE_ANSWER_IMAGE])) { |
|
|
|
|
switch ($answerType) { |
|
|
|
|
case UNIQUE_ANSWER: |
|
|
|
|
//no break |
|
|
|
|
case UNIQUE_ANSWER_NO_OPTION: |
|
|
|
|
//no break |
|
|
|
|
case UNIQUE_ANSWER_IMAGE: |
|
|
|
|
$input_id = 'choice-' . $questionId . '-' . $answerId; |
|
|
|
|
|
|
|
|
|
if (isset($user_choice[0]['answer']) && $user_choice[0]['answer'] == $numAnswer) { |
|
|
|
|
$attributes = array( |
|
|
|
|
'id' => $input_id, |
|
|
|
@ -354,12 +354,12 @@ class ExerciseLib |
|
|
|
|
} else { |
|
|
|
|
$s .= $answer_input; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} elseif ( |
|
|
|
|
$answerType == MULTIPLE_ANSWER || |
|
|
|
|
$answerType == MULTIPLE_ANSWER_TRUE_FALSE || |
|
|
|
|
$answerType == GLOBAL_MULTIPLE_ANSWER |
|
|
|
|
) { |
|
|
|
|
break; |
|
|
|
|
case MULTIPLE_ANSWER: |
|
|
|
|
//no break |
|
|
|
|
case MULTIPLE_ANSWER_TRUE_FALSE: |
|
|
|
|
//no break |
|
|
|
|
case GLOBAL_MULTIPLE_ANSWER: |
|
|
|
|
$input_id = 'choice-' . $questionId . '-' . $answerId; |
|
|
|
|
$answer = Security::remove_XSS($answer, STUDENT); |
|
|
|
|
|
|
|
|
@ -455,7 +455,8 @@ class ExerciseLib |
|
|
|
|
} |
|
|
|
|
$s .= '</tr>'; |
|
|
|
|
} |
|
|
|
|
} elseif ($answerType == MULTIPLE_ANSWER_COMBINATION) { |
|
|
|
|
break; |
|
|
|
|
case MULTIPLE_ANSWER_COMBINATION: |
|
|
|
|
// multiple answers |
|
|
|
|
$input_id = 'choice-' . $questionId . '-' . $answerId; |
|
|
|
|
|
|
|
|
@ -500,8 +501,8 @@ class ExerciseLib |
|
|
|
|
} else { |
|
|
|
|
$s .= $answer_input; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} elseif ($answerType == MULTIPLE_ANSWER_COMBINATION_TRUE_FALSE) { |
|
|
|
|
break; |
|
|
|
|
case MULTIPLE_ANSWER_COMBINATION_TRUE_FALSE: |
|
|
|
|
$s .= '<input type="hidden" name="choice2[' . $questionId . ']" value="0" />'; |
|
|
|
|
|
|
|
|
|
$my_choice = array(); |
|
|
|
@ -550,7 +551,8 @@ class ExerciseLib |
|
|
|
|
$s .= '</td>'; |
|
|
|
|
} |
|
|
|
|
$s .= '</tr>'; |
|
|
|
|
} elseif ($answerType == FILL_IN_BLANKS) { |
|
|
|
|
break; |
|
|
|
|
case FILL_IN_BLANKS: |
|
|
|
|
// display the question, with field empty, for student to fill it, |
|
|
|
|
// or filled to display the answer in the Question preview of the exercice/admin.php page |
|
|
|
|
$displayForStudent = true; |
|
|
|
@ -618,9 +620,8 @@ class ExerciseLib |
|
|
|
|
$answer .= $listAnswerInformations["commonwords"][$i]; |
|
|
|
|
} |
|
|
|
|
$s .= $answer; |
|
|
|
|
|
|
|
|
|
} elseif ($answerType == CALCULATED_ANSWER) { |
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
case CALCULATED_ANSWER: |
|
|
|
|
/* |
|
|
|
|
* In the CALCULATED_ANSWER test |
|
|
|
|
* you mustn't have [ and ] in the textarea |
|
|
|
@ -629,20 +630,17 @@ class ExerciseLib |
|
|
|
|
* the text to find mustn't contains HTML tags |
|
|
|
|
* the text to find mustn't contains char " |
|
|
|
|
*/ |
|
|
|
|
global $exerciseId; |
|
|
|
|
if ($origin !== null) { |
|
|
|
|
global $exe_id; |
|
|
|
|
$trackAttempts = Database::get_main_table( |
|
|
|
|
TABLE_STATISTIC_TRACK_E_ATTEMPT |
|
|
|
|
); |
|
|
|
|
$sql = 'SELECT answer FROM ' . $trackAttempts . ' |
|
|
|
|
WHERE exe_id=' . $exerciseId . ' AND question_id=' . $questionId; |
|
|
|
|
WHERE exe_id=' . $exe_id . ' AND question_id=' . $questionId; |
|
|
|
|
$rsLastAttempt = Database::query($sql); |
|
|
|
|
$rowLastAttempt = Database::fetch_array($rsLastAttempt); |
|
|
|
|
$answer = $rowLastAttempt['answer']; |
|
|
|
|
|
|
|
|
|
$calculatedAnswerId = Session::read('calculatedAnswerId'); |
|
|
|
|
$calculatedAnswerInfo = Session::read('calculatedAnswerInfo'); |
|
|
|
|
if (empty($answer)) { |
|
|
|
|
if (empty($calculatedAnswerId)) { |
|
|
|
|
$_SESSION['calculatedAnswerId'][$questionId] = mt_rand( |
|
|
|
|
1, |
|
|
|
|
$nbrAnswers |
|
|
|
@ -650,14 +648,6 @@ class ExerciseLib |
|
|
|
|
$answer = $objAnswerTmp->selectAnswer( |
|
|
|
|
$_SESSION['calculatedAnswerId'][$questionId] |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
Session::write('calculatedAnswerInfo', [$questionId => $answer]); |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
$calculatedAnswerInfo = Session::read('calculatedAnswerInfo'); |
|
|
|
|
if (isset($calculatedAnswerInfo[$questionId])) { |
|
|
|
|
$answer = $calculatedAnswerInfo[$questionId]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -669,7 +659,6 @@ class ExerciseLib |
|
|
|
|
$correctAnswerList |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// get student answer to display it if student go back to previous calculated answer question in a test |
|
|
|
|
if (isset($user_choice[0]['answer'])) { |
|
|
|
|
api_preg_match_all( |
|
|
|
@ -778,7 +767,8 @@ class ExerciseLib |
|
|
|
|
} else { |
|
|
|
|
$s .= $answer; |
|
|
|
|
} |
|
|
|
|
} elseif ($answerType == MATCHING) { |
|
|
|
|
break; |
|
|
|
|
case MATCHING: |
|
|
|
|
// matching type, showing suggestions and answers |
|
|
|
|
// TODO: replace $answerId by $numAnswer |
|
|
|
|
|
|
|
|
@ -839,7 +829,8 @@ class ExerciseLib |
|
|
|
|
} // end if() |
|
|
|
|
$matching_correct_answer++; |
|
|
|
|
} |
|
|
|
|
} elseif ($answerType == DRAGGABLE) { |
|
|
|
|
break; |
|
|
|
|
case DRAGGABLE: |
|
|
|
|
if ($answerCorrect != 0) { |
|
|
|
|
$parsed_answer = $answer; |
|
|
|
|
/*$lines_count = ''; |
|
|
|
@ -931,7 +922,8 @@ JAVASCRIPT; |
|
|
|
|
|
|
|
|
|
$s .= '</li>'; |
|
|
|
|
} |
|
|
|
|
} elseif ($answerType == MATCHING_DRAGGABLE) { |
|
|
|
|
break; |
|
|
|
|
case MATCHING_DRAGGABLE: |
|
|
|
|
if ($answerId == 1) { |
|
|
|
|
echo $objAnswerTmp->getJs(); |
|
|
|
|
} |
|
|
|
@ -1046,6 +1038,7 @@ HTML; |
|
|
|
|
} |
|
|
|
|
$matching_correct_answer++; |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} // end for() |
|
|
|
|
|
|
|
|
@ -1108,11 +1101,11 @@ HTML; |
|
|
|
|
// destruction of the Question object |
|
|
|
|
unset($objQuestionTmp); |
|
|
|
|
|
|
|
|
|
if ($origin != 'export') { |
|
|
|
|
echo $s; |
|
|
|
|
} else { |
|
|
|
|
if ($origin == 'export') { |
|
|
|
|
return $s; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
echo $s; |
|
|
|
|
} elseif ($answerType == HOT_SPOT || $answerType == HOT_SPOT_DELINEATION) { |
|
|
|
|
global $exerciseId, $exe_id; |
|
|
|
|
// Question is a HOT_SPOT |
|
|
|
@ -1216,7 +1209,6 @@ HTML; |
|
|
|
|
HOTSPOT; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$canClick = isset($_GET['editQuestion']) ? '0' : (isset($_GET['modifyAnswers']) ? '0' : '1'); |
|
|
|
|
$relPath = api_get_path(REL_PATH); |
|
|
|
|
$s .= " |
|
|
|
|
<div class=\"col-sm-8 col-md-9\"> |
|
|
|
@ -1284,7 +1276,8 @@ HOTSPOT; |
|
|
|
|
$exercise_id, |
|
|
|
|
$lp_id = 0, |
|
|
|
|
$lp_item_id = 0 |
|
|
|
|
) { |
|
|
|
|
) |
|
|
|
|
{ |
|
|
|
|
$course_id = api_get_course_int_id(); |
|
|
|
|
$exercise_id = intval($exercise_id); |
|
|
|
|
$TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST); |
|
|
|
@ -1324,7 +1317,8 @@ HOTSPOT; |
|
|
|
|
$exercise_id, |
|
|
|
|
$lp_id = 0, |
|
|
|
|
$lp_item_id = 0 |
|
|
|
|
) { |
|
|
|
|
) |
|
|
|
|
{ |
|
|
|
|
$current_expired_time_key = self::get_time_control_key( |
|
|
|
|
$exercise_id, |
|
|
|
|
$lp_id, |
|
|
|
@ -1357,7 +1351,8 @@ HOTSPOT; |
|
|
|
|
$exercise_id, |
|
|
|
|
$lp_id = 0, |
|
|
|
|
$lp_item_id = 0 |
|
|
|
|
) { |
|
|
|
|
) |
|
|
|
|
{ |
|
|
|
|
$return_value = 0; |
|
|
|
|
$time_control_key = self::get_time_control_key( |
|
|
|
|
$exercise_id, |
|
|
|
@ -1423,7 +1418,8 @@ HOTSPOT; |
|
|
|
|
$in_hotpot_path, |
|
|
|
|
$in_get_count = false, |
|
|
|
|
$where_condition = null |
|
|
|
|
) { |
|
|
|
|
) |
|
|
|
|
{ |
|
|
|
|
$courseId = api_get_course_int_id(); |
|
|
|
|
/* by default in_column = 1 If parameters given, |
|
|
|
|
it is the name of the column witch is the bdd field name*/ |
|
|
|
@ -1502,7 +1498,8 @@ HOTSPOT; |
|
|
|
|
$userId, |
|
|
|
|
$courseId, |
|
|
|
|
$sessionId |
|
|
|
|
) { |
|
|
|
|
) |
|
|
|
|
{ |
|
|
|
|
$table = Database:: get_main_table( |
|
|
|
|
TABLE_STATISTIC_TRACK_E_HOTPOTATOES |
|
|
|
|
); |
|
|
|
@ -1546,7 +1543,8 @@ HOTSPOT; |
|
|
|
|
$exercise_id, |
|
|
|
|
$extra_where_conditions = null, |
|
|
|
|
$get_count = false |
|
|
|
|
) { |
|
|
|
|
) |
|
|
|
|
{ |
|
|
|
|
//@todo replace all this globals |
|
|
|
|
global $documentPath, $filter; |
|
|
|
|
|
|
|
|
@ -1851,8 +1849,7 @@ HOTSPOT; |
|
|
|
|
if ($lp_obj) { |
|
|
|
|
$url = api_get_path( |
|
|
|
|
WEB_CODE_PATH |
|
|
|
|
) . 'newscorm/lp_controller.php?' . api_get_cidreq( |
|
|
|
|
) . '&action=view&lp_id=' . $results[$i]['orig_lp_id']; |
|
|
|
|
) . 'newscorm/lp_controller.php?' . api_get_cidreq() . '&action=view&lp_id=' . $results[$i]['orig_lp_id']; |
|
|
|
|
$lp_name = Display::url( |
|
|
|
|
$lp_obj['lp_name'], |
|
|
|
|
$url, |
|
|
|
@ -1926,8 +1923,7 @@ HOTSPOT; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if ($revised) { |
|
|
|
|
$actions .= "<a href='exercise_show.php?" . api_get_cidreq( |
|
|
|
|
) . "&action=edit&id=$id'>" . |
|
|
|
|
$actions .= "<a href='exercise_show.php?" . api_get_cidreq() . "&action=edit&id=$id'>" . |
|
|
|
|
Display:: return_icon( |
|
|
|
|
'edit.png', |
|
|
|
|
get_lang('Edit'), |
|
|
|
@ -1936,8 +1932,7 @@ HOTSPOT; |
|
|
|
|
); |
|
|
|
|
$actions .= ' '; |
|
|
|
|
} else { |
|
|
|
|
$actions .= "<a href='exercise_show.php?" . api_get_cidreq( |
|
|
|
|
) . "&action=qualify&id=$id'>" . |
|
|
|
|
$actions .= "<a href='exercise_show.php?" . api_get_cidreq() . "&action=qualify&id=$id'>" . |
|
|
|
|
Display:: return_icon( |
|
|
|
|
'quiz.gif', |
|
|
|
|
get_lang('Qualify') |
|
|
|
@ -1947,8 +1942,7 @@ HOTSPOT; |
|
|
|
|
$actions .= "</a>"; |
|
|
|
|
|
|
|
|
|
if ($filter == 2) { |
|
|
|
|
$actions .= ' <a href="exercise_history.php?' . api_get_cidreq( |
|
|
|
|
) . '&exe_id=' . $id . '">' . |
|
|
|
|
$actions .= ' <a href="exercise_history.php?' . api_get_cidreq() . '&exe_id=' . $id . '">' . |
|
|
|
|
Display:: return_icon( |
|
|
|
|
'history.gif', |
|
|
|
|
get_lang('ViewHistoryChange') |
|
|
|
@ -1956,8 +1950,7 @@ HOTSPOT; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//Admin can always delete the attempt |
|
|
|
|
if (($locked == false || api_is_platform_admin( |
|
|
|
|
)) && !api_is_student_boss() |
|
|
|
|
if (($locked == false || api_is_platform_admin()) && !api_is_student_boss() |
|
|
|
|
) { |
|
|
|
|
$ip = TrackingUserLog::get_ip_from_user_event( |
|
|
|
|
$results[$i]['exe_user_id'], |
|
|
|
@ -1988,8 +1981,7 @@ HOTSPOT; |
|
|
|
|
} else { |
|
|
|
|
$attempt_url = api_get_path( |
|
|
|
|
WEB_CODE_PATH |
|
|
|
|
) . 'exercice/result.php?' . api_get_cidreq( |
|
|
|
|
) . '&id=' . $results[$i]['exe_id'] . '&id_session=' . $sessionId; |
|
|
|
|
) . 'exercice/result.php?' . api_get_cidreq() . '&id=' . $results[$i]['exe_id'] . '&id_session=' . $sessionId; |
|
|
|
|
$attempt_link = Display::url( |
|
|
|
|
get_lang('Show'), |
|
|
|
|
$attempt_url, |
|
|
|
@ -2092,7 +2084,8 @@ HOTSPOT; |
|
|
|
|
$show_percentage = true, |
|
|
|
|
$use_platform_settings = true, |
|
|
|
|
$show_only_percentage = false |
|
|
|
|
) { |
|
|
|
|
) |
|
|
|
|
{ |
|
|
|
|
if (is_null($score) && is_null($weight)) { |
|
|
|
|
return '-'; |
|
|
|
|
} |
|
|
|
@ -2271,7 +2264,8 @@ HOTSPOT; |
|
|
|
|
$search = '', |
|
|
|
|
$search_all_sessions = false, |
|
|
|
|
$active = 2 |
|
|
|
|
) { |
|
|
|
|
) |
|
|
|
|
{ |
|
|
|
|
$course_id = api_get_course_int_id(); |
|
|
|
|
|
|
|
|
|
if (!empty($course_info) && !empty($course_info['real_id'])) { |
|
|
|
@ -2391,7 +2385,8 @@ HOTSPOT; |
|
|
|
|
$session_id = 0, |
|
|
|
|
$course_id = 0, |
|
|
|
|
$only_active_exercises = true |
|
|
|
|
) { |
|
|
|
|
) |
|
|
|
|
{ |
|
|
|
|
$TBL_EXERCISES = Database:: get_course_table(TABLE_QUIZ_TEST); |
|
|
|
|
|
|
|
|
|
if ($only_active_exercises) { |
|
|
|
@ -2453,7 +2448,8 @@ HOTSPOT; |
|
|
|
|
$session_id = 0, |
|
|
|
|
$user_list = array(), |
|
|
|
|
$return_string = true |
|
|
|
|
) { |
|
|
|
|
) |
|
|
|
|
{ |
|
|
|
|
//No score given we return |
|
|
|
|
if (is_null($my_score)) { |
|
|
|
|
return '-'; |
|
|
|
@ -2541,7 +2537,8 @@ HOTSPOT; |
|
|
|
|
$courseId, |
|
|
|
|
$session_id = 0, |
|
|
|
|
$return_string = true |
|
|
|
|
) { |
|
|
|
|
) |
|
|
|
|
{ |
|
|
|
|
if (empty($session_id)) { |
|
|
|
|
$session_id = 0; |
|
|
|
|
} |
|
|
|
@ -2650,7 +2647,8 @@ HOTSPOT; |
|
|
|
|
$exercise_id, |
|
|
|
|
$courseId, |
|
|
|
|
$session_id |
|
|
|
|
) { |
|
|
|
|
) |
|
|
|
|
{ |
|
|
|
|
$user_results = Event::get_all_exercise_results( |
|
|
|
|
$exercise_id, |
|
|
|
|
$courseId, |
|
|
|
@ -2750,7 +2748,8 @@ HOTSPOT; |
|
|
|
|
$user_id, |
|
|
|
|
$courseId, |
|
|
|
|
$session_id |
|
|
|
|
) { |
|
|
|
|
) |
|
|
|
|
{ |
|
|
|
|
$user_results = Event::get_all_exercise_results_by_user( |
|
|
|
|
$user_id, |
|
|
|
|
$courseId, |
|
|
|
@ -2787,7 +2786,8 @@ HOTSPOT; |
|
|
|
|
$courseId, |
|
|
|
|
$session_id, |
|
|
|
|
$user_count |
|
|
|
|
) { |
|
|
|
|
) |
|
|
|
|
{ |
|
|
|
|
$user_results = Event::get_best_exercise_results_by_user( |
|
|
|
|
$exercise_id, |
|
|
|
|
$courseId, |
|
|
|
@ -2851,7 +2851,8 @@ HOTSPOT; |
|
|
|
|
$exercise_id, |
|
|
|
|
$course_code, |
|
|
|
|
$session_id |
|
|
|
|
) { |
|
|
|
|
) |
|
|
|
|
{ |
|
|
|
|
$track_exercises = Database::get_main_table( |
|
|
|
|
TABLE_STATISTIC_TRACK_E_EXERCISES |
|
|
|
|
); |
|
|
|
@ -2899,7 +2900,8 @@ HOTSPOT; |
|
|
|
|
public static function getNumberStudentsFillBlanksAnwserCount( |
|
|
|
|
$question_id, |
|
|
|
|
$exercise_id |
|
|
|
|
) { |
|
|
|
|
) |
|
|
|
|
{ |
|
|
|
|
$listStudentsId = []; |
|
|
|
|
$listAllStudentInfo = CourseManager::get_student_list_from_course_code( |
|
|
|
|
api_get_course_id(), |
|
|
|
@ -2950,7 +2952,8 @@ HOTSPOT; |
|
|
|
|
$course_code, |
|
|
|
|
$session_id, |
|
|
|
|
$questionType = '' |
|
|
|
|
) { |
|
|
|
|
) |
|
|
|
|
{ |
|
|
|
|
$track_exercises = Database::get_main_table( |
|
|
|
|
TABLE_STATISTIC_TRACK_E_EXERCISES |
|
|
|
|
); |
|
|
|
@ -3044,7 +3047,8 @@ HOTSPOT; |
|
|
|
|
$exercise_id, |
|
|
|
|
$course_code, |
|
|
|
|
$session_id |
|
|
|
|
) { |
|
|
|
|
) |
|
|
|
|
{ |
|
|
|
|
$track_exercises = Database::get_main_table( |
|
|
|
|
TABLE_STATISTIC_TRACK_E_EXERCISES |
|
|
|
|
); |
|
|
|
@ -3122,7 +3126,8 @@ HOTSPOT; |
|
|
|
|
$question_type = null, |
|
|
|
|
$correct_answer = null, |
|
|
|
|
$current_answer = null |
|
|
|
|
) { |
|
|
|
|
) |
|
|
|
|
{ |
|
|
|
|
$track_exercises = Database::get_main_table( |
|
|
|
|
TABLE_STATISTIC_TRACK_E_EXERCISES |
|
|
|
|
); |
|
|
|
@ -3361,7 +3366,8 @@ HOTSPOT; |
|
|
|
|
$exercise_id, |
|
|
|
|
$course_code, |
|
|
|
|
$session_id |
|
|
|
|
) { |
|
|
|
|
) |
|
|
|
|
{ |
|
|
|
|
$track_exercises = Database::get_main_table( |
|
|
|
|
TABLE_STATISTIC_TRACK_E_EXERCISES |
|
|
|
|
); |
|
|
|
@ -3455,7 +3461,8 @@ HOTSPOT; |
|
|
|
|
$objExercise, |
|
|
|
|
$exe_id, |
|
|
|
|
$save_user_result = false |
|
|
|
|
) { |
|
|
|
|
) |
|
|
|
|
{ |
|
|
|
|
global $origin; |
|
|
|
|
|
|
|
|
|
// Getting attempt info |
|
|
|
@ -3641,8 +3648,7 @@ HOTSPOT; |
|
|
|
|
$category_list['none']['total'] += $my_total_weight; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($objExercise->selectPropagateNeg( |
|
|
|
|
) == 0 && $my_total_score < 0 |
|
|
|
|
if ($objExercise->selectPropagateNeg() == 0 && $my_total_score < 0 |
|
|
|
|
) { |
|
|
|
|
$my_total_score = 0; |
|
|
|
|
} |
|
|
|
@ -3807,7 +3813,8 @@ HOTSPOT; |
|
|
|
|
$score, |
|
|
|
|
$weight, |
|
|
|
|
$check_pass_percentage = false |
|
|
|
|
) { |
|
|
|
|
) |
|
|
|
|
{ |
|
|
|
|
$ribbon = '<div class="title-score">'; |
|
|
|
|
if ($check_pass_percentage) { |
|
|
|
|
$is_success = self::is_success_exercise_result( |
|
|
|
@ -3819,7 +3826,8 @@ HOTSPOT; |
|
|
|
|
$ribbon_total_success_or_error = ""; |
|
|
|
|
if (self::is_pass_pourcentage_enabled( |
|
|
|
|
$objExercise->selectPassPercentage() |
|
|
|
|
)) { |
|
|
|
|
) |
|
|
|
|
) { |
|
|
|
|
if ($is_success) { |
|
|
|
|
$ribbon_total_success_or_error = ' ribbon-total-success'; |
|
|
|
|
} else { |
|
|
|
|