Permalink
Browse files

MDL-29378 Fix the form display in the Survey/COLLES P+A module

In MDL-7501, we stopped using rowspanning cells in the form table due to
accessibility. That had introduced a regression so in the COLLES P+A survey,
all the rows were displayed with the same background colour. This patch returns
the previous behaviour that each couple of items can be distinguished by the
background colour.

Also, there is no need to display "I prefer that" and "I found that" as a small
text any more. It had made sense in rowspanning layout but not after MDL-7501
was fixed.

And finally, as all items are enumerated now sequentially, there are actually
48 lines, each couple covering one question in two variants. I think it's
correct to reflect this in the description of the form so the text was slightly
amended.
  • Loading branch information...
1 parent 597f4ac commit b46b093e5c4c764063c38e6cbd303b67a19787c8 @mudrd8mz mudrd8mz committed Sep 4, 2013
Showing with 8 additions and 5 deletions.
  1. +1 −1 mod/survey/lang/en/survey.php
  2. +7 −4 mod/survey/lib.php
@@ -98,7 +98,7 @@
$string['clicktocontinuecheck'] = 'Click here to check and continue';
$string['collesaintro'] = 'The purpose of this survey is to help us understand how well the online delivery of this unit enabled you to learn.
-Each one of the 24 statements below asks about your experience in this unit.
+Each couple of the 24 statements below asks about your experience in this unit.
There are no \'right\' or \'wrong\' answers; we are interested only in your opinion. Please be assured that your responses will be treated with a high degree of confidentiality, and will not affect your assessment.
View
@@ -542,7 +542,11 @@ function survey_print_multi($question) {
foreach ($subquestions as $q) {
$qnum++;
- $rowclass = survey_question_rowclass($qnum);
+ if ($oneanswer) {
+ $rowclass = survey_question_rowclass($qnum);
+ } else {
+ $rowclass = survey_question_rowclass(round($qnum / 2));
+ }
if ($q->text) {
$q->text = get_string($q->text, "survey");
}
@@ -564,11 +568,10 @@ function survey_print_multi($question) {
$checklist["q$P$q->id"] = 0;
} else {
- // yu : fix for MDL-7501, possibly need to use user flag as this is quite ugly.
echo "<th scope=\"row\" class=\"optioncell\">";
echo "<b class=\"qnumtopcell\">$qnum</b> &nbsp; ";
$qnum++;
- echo "<span class=\"preferthat smalltext\">$stripreferthat</span> &nbsp; ";
+ echo "<span class=\"preferthat\">$stripreferthat</span> &nbsp; ";
echo "<span class=\"option\">$q->text</span></th>\n";
$default = get_accesshide($strdefault);
@@ -585,7 +588,7 @@ function survey_print_multi($question) {
echo "<tr class=\"$rowclass rblock\">";
echo "<th scope=\"row\" class=\"optioncell\">";
echo "<b class=\"qnumtopcell\">$qnum</b> &nbsp; ";
- echo "<span class=\"foundthat smalltext\">$strifoundthat</span> &nbsp; ";
+ echo "<span class=\"foundthat\">$strifoundthat</span> &nbsp; ";
echo "<span class=\"option\">$q->text</span></th>\n";
$default = get_accesshide($strdefault);

0 comments on commit b46b093

Please sign in to comment.