Skip to content

Commit

Permalink
MDL-29378 Fix the form display in the Survey/COLLES P+A module
Browse files Browse the repository at this point in the history
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
mudrd8mz committed Sep 4, 2013
1 parent 597f4ac commit b46b093
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion mod/survey/lang/en/survey.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
$string['clicktocontinuecheck'] = 'Click here to check and continue'; $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. $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. 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.
Expand Down
11 changes: 7 additions & 4 deletions mod/survey/lib.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -542,7 +542,11 @@ function survey_print_multi($question) {


foreach ($subquestions as $q) { foreach ($subquestions as $q) {
$qnum++; $qnum++;
$rowclass = survey_question_rowclass($qnum); if ($oneanswer) {
$rowclass = survey_question_rowclass($qnum);
} else {
$rowclass = survey_question_rowclass(round($qnum / 2));
}
if ($q->text) { if ($q->text) {
$q->text = get_string($q->text, "survey"); $q->text = get_string($q->text, "survey");
} }
Expand All @@ -564,11 +568,10 @@ function survey_print_multi($question) {
$checklist["q$P$q->id"] = 0; $checklist["q$P$q->id"] = 0;


} else { } else {
// yu : fix for MDL-7501, possibly need to use user flag as this is quite ugly.
echo "<th scope=\"row\" class=\"optioncell\">"; echo "<th scope=\"row\" class=\"optioncell\">";
echo "<b class=\"qnumtopcell\">$qnum</b> &nbsp; "; echo "<b class=\"qnumtopcell\">$qnum</b> &nbsp; ";
$qnum++; $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"; echo "<span class=\"option\">$q->text</span></th>\n";


$default = get_accesshide($strdefault); $default = get_accesshide($strdefault);
Expand All @@ -585,7 +588,7 @@ function survey_print_multi($question) {
echo "<tr class=\"$rowclass rblock\">"; echo "<tr class=\"$rowclass rblock\">";
echo "<th scope=\"row\" class=\"optioncell\">"; echo "<th scope=\"row\" class=\"optioncell\">";
echo "<b class=\"qnumtopcell\">$qnum</b> &nbsp; "; 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"; echo "<span class=\"option\">$q->text</span></th>\n";


$default = get_accesshide($strdefault); $default = get_accesshide($strdefault);
Expand Down

0 comments on commit b46b093

Please sign in to comment.