Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

omit empty answers from JQuiz import

  • Loading branch information...
commit 3f4df7071b6015aa899d9b92d437a0f659e0ffea 1 parent fc35fab
gbateson authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 question/format/hotpot/format.php
View
9 question/format/hotpot/format.php
@@ -433,9 +433,12 @@ function process_jquiz(&$xml, &$questions) {
$fraction = 1;
}
}
- $question->fraction[] = $fraction;
- $question->feedback[] = $this->hotpot_prepare_str($xml->xml_value($tags, $answer."['feedback'][0]['#']"));
- $question->answer[] = $this->hotpot_prepare_str($xml->xml_value($tags, $answer."['text'][0]['#']"));
+ $answertext = $this->hotpot_prepare_str($xml->xml_value($tags, $answer."['text'][0]['#']"));
+ if ($answertext!='') {
+ $question->answer[] = $answertext;
+ $question->fraction[] = $fraction;
+ $question->feedback[] = $this->hotpot_prepare_str($xml->xml_value($tags, $answer."['feedback'][0]['#']"));
+ }
$a++;
}
$questions[] = $question;
Please sign in to comment.
Something went wrong with that request. Please try again.