Permalink
Browse files

MDL-20184 use $this->error() to print error message if no questions f…

…ound importing from a Hot Potatoes XML file into Moodle's question bank / Quiz module
  • Loading branch information...
1 parent 10369c9 commit edb3ed1ebb743dcdc6d28826f9e24739f917d3f0 gbateson committed Sep 1, 2009
Showing with 3 additions and 2 deletions.
  1. +3 −2 question/format/hotpot/format.php
@@ -106,6 +106,9 @@ function readquestions ($lines) {
if (count($questions)) {
return $questions;
} else {
+ if (method_exists($this, 'error')) { // Moodle >= 1.8
+ $this->error(get_string('giftnovalidquestion', 'quiz'));
+ }
return false;
}
}
@@ -231,8 +234,6 @@ function process_jcloze(&$xml, &$questions) {
} else {
// no gaps found in this text so don't add this question
// import will fail and error message will be displayed:
- // "There are no questions in the import file"
- unset($question);
}
$x++;

0 comments on commit edb3ed1

Please sign in to comment.