diff --git a/mod/survey/lib.php b/mod/survey/lib.php
index 3e97da96570..11dd4d99cc5 100644
--- a/mod/survey/lib.php
+++ b/mod/survey/lib.php
@@ -348,8 +348,7 @@ function survey_shorten_name ($name, $numwords) {
function survey_print_multi($question) {
- GLOBAL $db, $qnum, $checklist;
-
+ GLOBAL $USER, $db, $qnum, $checklist;
$stripreferthat = get_string("ipreferthat", "survey");
$strifoundthat = get_string("ifoundthat", "survey");
@@ -380,33 +379,35 @@ function survey_print_multi($question) {
echo "
| \n";
$subquestions = get_records_list("survey_questions", "id", $question->multi);
-
+
foreach ($subquestions as $q) {
$qnum++;
$rowclass = survey_question_rowclass($qnum);
-
if ($q->text) {
$q->text = get_string($q->text, "survey");
}
echo "";
if ($oneanswer) {
+
echo "| $qnum | ";
echo "$q->text | ";
- for ($i=1;$i<=$numoptions;$i++) {
- echo "id\" value=\"$i\" alt=\"$i\" /> | ";
+ for ($i=1;$i<=$numoptions;$i++) {
+ $screenreader = !empty($USER->screenreader)?"
":'';
+ echo "".$screenreader."id\" id=\"q$P$q->id".$i."\" value=\"$i\" alt=\"$i\" /> | ";
}
echo "id\" value=\"0\" checked=\"checked\" alt=\"0\" /> | ";
$checklist["q$P$q->id"] = $numoptions;
- } else {
+ } else {
// yu : fix for MDL-7501, possibly need to use user flag as this is quite ugly.
echo "$qnum | ";
$qnum++;
echo "$stripreferthat | ";
echo "$q->text | ";
for ($i=1;$i<=$numoptions;$i++) {
- echo "id\" value=\"$i\" alt=\"$i\"/> | ";
+ $screenreader = !empty($USER->screenreader)?"
":'';
+ echo "".$screenreader."id\" id=\"qP$q->id".$i."\" value=\"$i\" alt=\"$i\"/> | ";
}
echo "id\" value=\"0\" checked=\"checked\" alt=\"0\" /> | ";
echo "
";
@@ -416,13 +417,15 @@ function survey_print_multi($question) {
echo "$strifoundthat | ";
echo "$q->text | ";
for ($i=1;$i<=$numoptions;$i++) {
- echo "id\" value=\"$i\" alt=\"$i\" /> | ";
+ $screenreader = !empty($USER->screenreader)?"
":'';
+ echo "".$screenreader."id\" id=\"q$q->id".$i."\" value=\"$i\" alt=\"$i\" /> | ";
}
echo "id\" value=\"0\" checked=\"checked\" alt=\"0\" /> | ";
$checklist["qP$q->id"] = $numoptions;
$checklist["q$q->id"] = $numoptions;
}
echo "\n";
+
}
echo "";
}