Skip to content
Browse files

allow empty JQuiz questions (which have at least one answer)

  • Loading branch information...
1 parent e8dc4c6 commit 47e1151f92787ee322920a23ff7667c074946c79 gbateson committed Feb 3, 2007
Showing with 6 additions and 3 deletions.
  1. +6 −3 mod/hotpot/template/v6.php
View
9 mod/hotpot/template/v6.php
@@ -402,7 +402,8 @@ function v6_expand_QsToShow() {
$i = count($values);
break;
case 'jquiz':
- while ($this->parent->xml_value('data,questions,question-record', "[$i]['#']['question'][0]['#']")) {
+ $tags = 'data,questions,question-record';
+ while (($question="[$i]['#']") && $this->parent->xml_value($tags, $question)) {
$i++;
}
break;
@@ -1244,8 +1245,10 @@ function v6_expand_QuestionOutput() {
$question_text = $this->parent->xml_value($tags, $question."['question'][0]['#']");
$question_type = $this->parent->xml_value($tags, $question."['question-type'][0]['#']");
- // check we have a question
- if ($question_text && $question_type) {
+ $first_answer_text = $this->parent->xml_value($tags, $question."['answers'][0]['#']['answer'][0]['#']['text'][0]['#']");
+
+ // check we have a question (or at least one answer)
+ if (($question_text || $first_answer_text) && $question_type) {
$str .= '<li class="QuizQuestion" id="Q_'.$q.'" style="display: none;">';
$str .= '<p class="QuestionText">'.$question_text.'</p>';

0 comments on commit 47e1151

Please sign in to comment.
Something went wrong with that request. Please try again.