Línea 888... |
Línea 888... |
888 |
public function load_and_initialise_questions_for_calculations($quiz) {
|
888 |
public function load_and_initialise_questions_for_calculations($quiz) {
|
889 |
// Load the questions.
|
889 |
// Load the questions.
|
890 |
$questions = quiz_report_get_significant_questions($quiz);
|
890 |
$questions = quiz_report_get_significant_questions($quiz);
|
891 |
$questiondata = [];
|
891 |
$questiondata = [];
|
892 |
foreach ($questions as $qs => $question) {
|
892 |
foreach ($questions as $qs => $question) {
|
- |
|
893 |
$displaynumber = $question->displaynumber;
|
893 |
if ($question->qtype === 'random') {
|
894 |
if ($question->qtype === 'random') {
|
894 |
$question->id = 0;
|
895 |
$question->id = 0;
|
895 |
$question->name = get_string('random', 'quiz');
|
896 |
$question->name = get_string('random', 'quiz');
|
896 |
$question->questiontext = get_string('random', 'quiz');
|
897 |
$question->questiontext = get_string('random', 'quiz');
|
897 |
$question->parenttype = 'random';
|
898 |
$question->parenttype = 'random';
|
- |
|
899 |
$question->number = $displaynumber;
|
898 |
$questiondata[$question->slot] = $question;
|
900 |
$questiondata[$question->slot] = $question;
|
899 |
} else if ($question->qtype === 'missingtype') {
|
901 |
} else if ($question->qtype === 'missingtype') {
|
900 |
$question->id = is_numeric($question->id) ? (int) $question->id : 0;
|
902 |
$question->id = is_numeric($question->id) ? (int) $question->id : 0;
|
901 |
$questiondata[$question->slot] = $question;
|
903 |
$questiondata[$question->slot] = $question;
|
902 |
$question->name = get_string('deletedquestion', 'qtype_missingtype');
|
904 |
$question->name = get_string('deletedquestion', 'qtype_missingtype');
|
903 |
$question->questiontext = get_string('deletedquestiontext', 'qtype_missingtype');
|
905 |
$question->questiontext = get_string('deletedquestiontext', 'qtype_missingtype');
|
904 |
} else {
|
906 |
} else {
|
905 |
$q = question_bank::load_question_data($question->id);
|
907 |
$q = question_bank::load_question_data($question->id);
|
906 |
$q->maxmark = $question->maxmark;
|
908 |
$q->maxmark = $question->maxmark;
|
907 |
$q->slot = $question->slot;
|
909 |
$q->slot = $question->slot;
|
908 |
$q->number = $question->number;
|
910 |
$q->number = $displaynumber;
|
909 |
$q->parenttype = null;
|
911 |
$q->parenttype = null;
|
910 |
$questiondata[$question->slot] = $q;
|
912 |
$questiondata[$question->slot] = $q;
|
911 |
}
|
913 |
}
|
912 |
}
|
914 |
}
|