Skip to content

Commit

Permalink
MDL-66259 quiz responses: fix unrealistic test setup
Browse files Browse the repository at this point in the history
  • Loading branch information
timhunt authored and stronk7 committed Apr 24, 2020
1 parent 15ffdf7 commit d37c613
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mod/quiz/report/responses/tests/fixtures/questions00.csv
Expand Up @@ -4,4 +4,4 @@ slot,type,which,cat,mark,overrides.hint.0.text,overrides.hint.0.format,overrides
,numerical,,rand,1,"Hint 1",0,"Hint 2",0,"Hint 3",0,"Hint 4",0,0
2,calculatedsimple,sumwithvariants,maincat,1,"Hint 1",0,"Hint 2",0,"Hint 3",0,"Hint 4",0,0
3,match,,maincat,1,"Hint 1",0,"Hint 2",0,"Hint 3",0,"Hint 4",0,0
4,truefalse,,maincat,1,"Hint 1",0,"Hint 2",0,"Hint 3",0,"Hint 4",0,0
4,truefalse,,maincat,1,"",0,"",0,"",0,"",0,0
5 changes: 5 additions & 0 deletions mod/quiz/tests/attempt_walkthrough_from_csv_test.php
Expand Up @@ -94,6 +94,11 @@ public function create_quiz($quizsettings, $qs) {
if ($q['type'] !== 'random') {
// Don't actually create random questions here.
$overrides = array('category' => $cat->id, 'defaultmark' => $q['mark']) + $q['overrides'];
if ($q['type'] === 'truefalse') {
// True/false question can never have hints, but sometimes we need to put them
// in the CSV file, to keep it rectangular.
unset($overrides['hint']);
}
$question = $questiongenerator->create_question($q['type'], $q['which'], $overrides);
$q['id'] = $question->id;

Expand Down

0 comments on commit d37c613

Please sign in to comment.