Applied fixes from FlintCI

pull/2458/head
Julio Montoya 8 years ago
parent f07c8088f2
commit 276b1e238d
  1. 1
      main/exercise/Hpdownload.php
  2. 14
      main/exercise/exercise.class.php
  3. 15
      main/exercise/exercise_show.php
  4. 1
      main/exercise/export/qti2/qti2_classes.php
  5. 2
      main/exercise/fill_blanks.class.php
  6. 1
      main/exercise/stats.php
  7. 11
      main/inc/lib/exercise.lib.php
  8. 3
      main/inc/lib/exercise_show_functions.lib.php

@ -144,4 +144,3 @@ if ($content_type == 'text/html') {
$fp = fopen($full_file_name, 'rb');
fpassthru($fp);
fclose($fp);

@ -4208,9 +4208,7 @@ class Exercise
}
break;
case DRAGGABLE:
//no break
case MATCHING_DRAGGABLE:
//no break
case MATCHING:
if ($from_database) {
$sql = "SELECT id, answer, id_auto
@ -4332,7 +4330,7 @@ class Exercise
if ($showTotalScoreAndUserChoicesInLastAttempt === false) {
$user_answer = '';
}
switch ($answerType) {
switch ($answerType) {
case MATCHING:
case MATCHING_DRAGGABLE:
echo '<tr>';
@ -4939,17 +4937,11 @@ class Exercise
switch ($answerType) {
case UNIQUE_ANSWER:
//no break
case UNIQUE_ANSWER_IMAGE:
//no break
case UNIQUE_ANSWER_NO_OPTION:
//no break
case MULTIPLE_ANSWER:
//no break
case GLOBAL_MULTIPLE_ANSWER:
//no break
case MULTIPLE_ANSWER_COMBINATION:
//no break
case READING_COMPREHENSION:
if ($answerId == 1) {
ExerciseShowFunctions::display_unique_or_multiple_answer(
@ -5275,9 +5267,7 @@ class Exercise
);
break;
case DRAGGABLE:
//no break
case MATCHING_DRAGGABLE:
//no break
case MATCHING:
echo '<tr>';
echo Display::tag('td', $answerMatching[$answerId]);
@ -7957,9 +7947,7 @@ class Exercise
$isCorrect = FillBlanks::isCorrect($answer['answer']);
break;
case MATCHING:
//no break
case DRAGGABLE:
//no break
case MATCHING_DRAGGABLE:
$isCorrect = Matching::isCorrect(
$answer['position'],

@ -396,35 +396,20 @@ foreach ($questionList as $questionId) {
$relPath = api_get_path(WEB_CODE_PATH);
switch ($answerType) {
case MULTIPLE_ANSWER_COMBINATION:
//no break
case MULTIPLE_ANSWER_COMBINATION_TRUE_FALSE:
//no break
case UNIQUE_ANSWER:
//no break;
case UNIQUE_ANSWER_NO_OPTION:
//no break
case UNIQUE_ANSWER_IMAGE:
//no break
case MULTIPLE_ANSWER:
//no break
case MULTIPLE_ANSWER_TRUE_FALSE:
//no break
case FILL_IN_BLANKS:
//no break
case CALCULATED_ANSWER:
//no break
case GLOBAL_MULTIPLE_ANSWER:
//no break
case FREE_ANSWER:
//no break
case ORAL_EXPRESSION:
//no break
case MATCHING:
//no break
case DRAGGABLE:
//no break
case READING_COMPREHENSION:
//no break
case MATCHING_DRAGGABLE:
$question_result = $objExercise->manage_answer(
$id,

@ -33,7 +33,6 @@ class Ims2Question extends Question
return $answer;
case MATCHING:
//no break
case MATCHING_DRAGGABLE:
$answer = new ImsAnswerMatching($this->id);

@ -554,7 +554,6 @@ class FillBlanks extends Question
);
break;
case self::FILL_THE_BLANK_SEVERAL_ANSWER:
//no break
case self::FILL_THE_BLANK_STANDARD:
default:
$attributes['id'] = 'choice_id_'.$currentQuestion.'_'.$inBlankNumber;
@ -1273,7 +1272,6 @@ class FillBlanks extends Question
$correctAnswerHtml = "<span class='feedback-red'>".$firstCorrect."</span>";
break;
case self::FILL_THE_BLANK_STANDARD:
// no break
default:
$correctAnswerHtml = "<span class='feedback-green'>".$correct."</span>";
}

@ -185,7 +185,6 @@ if (!empty($question_list)) {
}
break;
case MATCHING:
//no break
case MATCHING_DRAGGABLE:
if ($is_correct == 0) {
if ($answer_id == 1) {

@ -310,11 +310,8 @@ class ExerciseLib
switch ($answerType) {
case UNIQUE_ANSWER:
//no break
case UNIQUE_ANSWER_NO_OPTION:
//no break
case UNIQUE_ANSWER_IMAGE:
//no break
case READING_COMPREHENSION:
$input_id = 'choice-'.$questionId.'-'.$answerId;
if (isset($user_choice[0]['answer']) && $user_choice[0]['answer'] == $numAnswer) {
@ -394,9 +391,7 @@ class ExerciseLib
}
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);
@ -3648,9 +3643,7 @@ EOT;
$select_condition = " e.exe_id, answer ";
break;
case MATCHING:
//no break
case MATCHING_DRAGGABLE:
//no break
default:
$answer_condition = " answer = $answer_id AND ";
$select_condition = " DISTINCT exe_user_id ";
@ -3707,9 +3700,7 @@ EOT;
return $good_answers;
break;
case MATCHING:
//no break
case MATCHING_DRAGGABLE:
//no break
default:
$return = Database::num_rows($result);
}
@ -4290,7 +4281,7 @@ EOT;
// Ofaj change BT#11784
if (!empty($objExercise->description)) {
echo Display::div($objExercise->description, array('class'=>'exercise_description'));
echo Display::div($objExercise->description, ['class'=>'exercise_description']);
}
echo $exercise_content;

@ -117,9 +117,8 @@ class ExerciseShowFunctions
echo Security::remove_XSS($answer);
if (!api_is_allowed_to_edit(null, true) && $feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) {
echo '<td>';
$comm = Event::get_comments($id, $questionId);
$comm = Event::get_comments($id, $questionId);
echo '</td>';
}
echo '</tr>';
}

Loading…
Cancel
Save