diff --git a/mod/hotpot/template/v6.php b/mod/hotpot/template/v6.php
index 9f6606aab8f..842a64e9bf7 100644
--- a/mod/hotpot/template/v6.php
+++ b/mod/hotpot/template/v6.php
@@ -841,6 +841,7 @@ class hotpot_xml_quiz_template extends hotpot_xml_template_default {
function v6_expand_ClozeBody() {
$str = '';
+ // get drop down list of words, if required
$dropdownlist = '';
if ($this->v6_use_DropDownList()) {
$this->v6_set_WordList();
@@ -849,9 +850,15 @@ class hotpot_xml_quiz_template extends hotpot_xml_template_default {
}
}
+ // cache clues flag and caption
+ $includeclues = $this->v6_expand_Clues();
+ $cluecaption = $this->v6_expand_ClueCaption();
+
+ // initialize loop values
$q = 0;
$tags = 'data,gap-fill';
+ // loop through text and gaps
while ($text = $this->parent->xml_value($tags, "[0]['#'][$q]")) {
$str .= $text;
if (($question="[$q]['#']") && $this->parent->xml_value("$tags,question-record", $question)) {
@@ -861,9 +868,11 @@ class hotpot_xml_quiz_template extends hotpot_xml_template_default {
} else {
$str .= '';
}
- if ($this->v6_expand_Clues()) {
- $caption = $this->v6_expand_ClueCaption();
- $str .= '';
+ if ($includeclues) {
+ $clue = $this->parent->xml_value("$tags,question-record", $question."['clue'][0]['#']");
+ if (strlen($clue)) {
+ $str .= '';
+ }
}
$str .= '';
}