-<?php notify('This question is of a type that has not been installed on your Moodle yet.<br />Please alert your Moodle administrator.'); ?>
<div class="qtext">
<?php echo $questiontext; ?>
</div>
<img class="qimage" src="<?php echo $image; ?>" alt="" />
<?php } ?>
-<div class="ablock clearfix">
- <div class="prompt">
- <?php print_string('answers', 'quiz'); ?>
+<?php if ($anss) { ?>
+ <div class="ablock clearfix">
+ <div class="prompt">
+ <?php print_string('answers', 'quiz'); ?>
+ </div>
+ <table class="answer">
+ <?php $row = 1; foreach ($anss as $answer) { ?>
+ <tr class="<?php echo 'r'.$row = $row ? 0 : 1; ?>">
+ <td class="c1 text">
+ <?php echo $answer->text; ?>
+ </td>
+ </tr>
+ <?php } ?>
+ </table>
</div>
-
- <table class="answer">
- <?php $row = 1; foreach ($anss as $answer) { ?>
- <tr class="<?php echo 'r'.$row = $row ? 0 : 1; ?>">
- <td class="c1 text">
- <?php echo $answer->text; ?>
- </td>
- </tr>
- <?php } ?>
- </table>
-</div>
+<?php } ?>
\ No newline at end of file
$formatoptions, $cmoptions->course);
$image = get_question_image($question, $cmoptions->course);
- // Print each answer in a separate row
- foreach ($answers as $answer) {
- $a->text = format_text("$answer->answer", FORMAT_MOODLE, $formatoptions, $cmoptions->course);
-
- $anss[] = clone($a);
+ // Print each answer in a separate row if there are any
+ $anss = array();
+ if ($answers) {
+ foreach ($answers as $answer) {
+ $a->text = format_text("$answer->answer", FORMAT_MOODLE, $formatoptions, $cmoptions->course);
+
+ $anss[] = clone($a);
+ }
}
include("$CFG->dirroot/question/type/missingtype/display.html");
}