Skip to content

Commit

Permalink
More graceful behaviour when there are not enough questions for the r…
Browse files Browse the repository at this point in the history
…andom questions.
  • Loading branch information
gustav_delius committed Jun 4, 2005
1 parent fba559d commit 3c76674
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mod/quiz/questiontypes/random/questiontype.php
Expand Up @@ -97,8 +97,11 @@ function create_session_and_responses(&$question, &$state, $quiz, $attempt) {
return true;
}
}
notify(get_string('toomanyrandom', 'quiz', $question->category));
return false;
$question->questiontext = '<span class="notifyproblem">'.
get_string('toomanyrandom', 'quiz', $question->category). '</span>';
$question->qtype = DESCRIPTION;
$state->responses = array('' => '');
return true;
}

function restore_session_and_responses(&$question, &$state) {
Expand Down

0 comments on commit 3c76674

Please sign in to comment.