Skip to content

Commit

Permalink
Removed moodle internal check
Browse files Browse the repository at this point in the history
  • Loading branch information
mkassaei committed Oct 24, 2023
2 parents 4de5986 + 0efa243 commit 650446b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

/**
* Execute qtype_oumatrix upgrade from the given old version.
*
Expand Down
6 changes: 3 additions & 3 deletions questiontype.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function save_rows(stdClass $question, array $columnslist) {
$answerslist[] = $c + 1;
}
}
$questionrow->correctanswers = implode(',',$answerslist);
$questionrow->correctanswers = implode(',', $answerslist);
$questionrow->feedback = $question->feedback[$i]['text'];
$questionrow->feedbackformat = FORMAT_HTML;
$questionrow->id = $DB->insert_record('qtype_oumatrix_rows', $questionrow);
Expand Down Expand Up @@ -225,7 +225,7 @@ protected function initialise_question_rows(question_definition $question, stdCl
$anslabel = 'a' . $column->number;
$correctanswers[$column->number] = $anslabel;
} else {
$correctanswers[$column->number] = '1';
$correctanswers[$column->number] = '1';
}
}
}
Expand Down Expand Up @@ -288,7 +288,7 @@ public function get_total_number_of_choices(object $questiondata):? int {
public function get_num_correct_choices($questiondata) {
$numright = 0;
foreach ($questiondata->rows as $row) {
$numright += count((array)$row->correctanswers);
$numright += count((array)$row->correctanswers);
}
return $numright;
}
Expand Down

0 comments on commit 650446b

Please sign in to comment.