From 795b56b3f1d6d319a3edc651f2fb0e81425499e3 Mon Sep 17 00:00:00 2001 From: toyomoyo Date: Mon, 8 Jan 2007 05:47:12 +0000 Subject: [PATCH] MDL-7861, xhtml strict for survey --- mod/survey/lib.php | 41 ++++++++++---------- mod/survey/report.php | 28 +++++++------- mod/survey/view.php | 17 +++++---- theme/standard/styles_layout.css | 65 +++++++++++++++++++++++++++++++- 4 files changed, 109 insertions(+), 42 deletions(-) diff --git a/mod/survey/lib.php b/mod/survey/lib.php index cf5fd689de..c14dbe087a 100644 --- a/mod/survey/lib.php +++ b/mod/survey/lib.php @@ -353,9 +353,9 @@ function survey_print_multi($question) { $stripreferthat = get_string("ipreferthat", "survey"); $strifoundthat = get_string("ifoundthat", "survey"); echo "
\n"; - echo "$question->text
"; - - echo ""; + echo "$question->text
"; + echo "
"; + echo "
"; $options = explode( ",", $question->options); $numoptions = count($options); @@ -374,7 +374,7 @@ function survey_print_multi($question) { } while (list ($key, $val) = each ($options)) { - echo "\n"; + echo "\n"; } echo "\n"; @@ -390,37 +390,37 @@ function survey_print_multi($question) { echo ""; if ($oneanswer) { - echo ""; + echo ""; echo ""; for ($i=1;$i<=$numoptions;$i++) { $screenreader = !empty($USER->screenreader)?"
":''; - echo ""; + echo ""; } echo ""; $checklist["q$P$q->id"] = $numoptions; } else { // yu : fix for MDL-7501, possibly need to use user flag as this is quite ugly. - echo ""; + echo ""; $qnum++; - echo ""; - echo ""; + echo ""; + echo ""; for ($i=1;$i<=$numoptions;$i++) { $screenreader = !empty($USER->screenreader)?"
":''; - echo ""; + echo ""; } echo ""; echo ""; echo ""; - echo ""; - echo ""; - echo ""; + echo ""; + echo ""; + echo ""; for ($i=1;$i<=$numoptions;$i++) { $screenreader = !empty($USER->screenreader)?"
":''; - echo ""; + echo ""; } - echo ""; + echo ""; $checklist["qP$q->id"] = $numoptions; $checklist["q$q->id"] = $numoptions; } @@ -428,6 +428,7 @@ function survey_print_multi($question) { } echo "
$val$val 
$qnum$qnum$q->text".$screenreader."id\" id=\"q$P$q->id".$i."\" value=\"$i\" alt=\"$i\" />".$screenreader."id\" id=\"q$P$q->id".$i."\" value=\"$i\" alt=\"$i\" />id\" value=\"0\" checked=\"checked\" alt=\"0\" />$qnum$qnum$stripreferthat $q->text$stripreferthat $q->text".$screenreader."id\" id=\"qP$q->id".$i."\" value=\"$i\" alt=\"$i\"/>".$screenreader."id\" id=\"qP$q->id".$i."\" value=\"$i\" alt=\"$i\"/>id\" value=\"0\" checked=\"checked\" alt=\"0\" />
$qnum$strifoundthat $q->text$qnum$strifoundthat $q->text".$screenreader."id\" id=\"q$q->id".$i."\" value=\"$i\" alt=\"$i\" />".$screenreader."id\" id=\"q$q->id".$i."\" value=\"$i\" alt=\"$i\" />id\" value=\"0\" checked=\"checked\" alt=\"0\" />id\" value=\"0\" checked=\"checked\" alt=\"0\" />
"; + echo ""; } @@ -440,11 +441,11 @@ function survey_print_single($question) { $qnum++; echo "
\n"; - echo "\n"; + echo "
\n"; echo ""; echo ""; - echo "\n"; - echo "\n"; + echo "
$qnum$question->text\n"; + echo "$question->text\n"; if ($question->type == 0) { // Plain text field @@ -466,7 +467,7 @@ function survey_print_single($question) { notify("This question type not supported yet"); } - echo "
"; + echo ""; } @@ -486,7 +487,7 @@ function survey_print_graph($url) { echo "(".get_string("gdneed").")"; } else { - echo "wwwroot/mod/survey/graph.php?$url\" alt=\"".get_string("surveygraph", "survey")."\" />"; } } diff --git a/mod/survey/report.php b/mod/survey/report.php index 21f5056dc0..f2abe247e7 100644 --- a/mod/survey/report.php +++ b/mod/survey/report.php @@ -121,9 +121,9 @@ print_heading($strsummary); if (survey_count_responses($survey->id, $currentgroup)) { - echo "
"; + echo "
"; + echo ""; } else { notify(get_string("nobodyyet","survey")); } @@ -154,7 +154,7 @@ if (!empty($virtualscales) && $question->type > 0) { // Don't show non-virtual scales if virtual continue; } - echo "

multi\">"; + echo "

multi\">"; survey_print_graph("id=$id&qid=$question->id&group=$currentgroup&type=multiquestion.png"); echo "


"; } @@ -212,14 +212,14 @@ foreach ($subquestionorder as $key => $val) { $subquestion = $subquestions[$val]; if ($subquestion->type > 0) { - echo "

"; + echo "

"; echo "id\">"; survey_print_graph("id=$id&qid=$subquestion->id&group=$currentgroup&type=question.png"); echo "

"; } } } else if ($question->type > 0 ) { - echo "

"; + echo "

"; echo "id\">"; survey_print_graph("id=$id&qid=$question->id&group=$currentgroup&type=question.png"); echo "

"; @@ -234,7 +234,7 @@ if ($aaa = survey_get_user_answers($survey->id, $question->id, $currentgroup, "sa.time ASC")) { foreach ($aaa as $a) { $contents .= ""; - $contents .= ''.fullname($a).''; + $contents .= ''.fullname($a).''; $contents .= ''.$a->answer1.''; $contents .= ""; } @@ -334,7 +334,7 @@ } } - echo "

"; + echo "

"; print_user_picture($user->id, $course->id, $user->picture, true); echo "

"; @@ -343,7 +343,7 @@ if ($showscales) { // Print overall summary - echo "

"; + echo "

>"; survey_print_graph("id=$id&sid=$student&type=student.png"); echo "

"; @@ -363,7 +363,7 @@ if ($virtualscales && $question->type > 0) { // Don't show non-virtual scales if virtual continue; } - echo "

"; + echo "

"; echo "multi\">"; survey_print_graph("id=$id&qid=$question->id&sid=$student&type=studentmultiquestion.png"); echo "


"; @@ -393,7 +393,7 @@ $notes = ""; } echo "
"; - echo "
"; + echo "
"; echo "
"; echo "

$strnotes:

"; echo "
"; @@ -407,7 +407,7 @@ echo ""; echo "
"; echo "
"; - echo "
"; + echo ""; break; @@ -417,9 +417,9 @@ require_capability('mod/survey:download', $context); - echo '

'.get_string("downloadinfo", "survey").'

'; + echo '

'.get_string("downloadinfo", "survey").'

'; - echo '
'; + echo '
'; $optons = array(); $options["id"] = "$cm->id"; $options["group"] = $currentgroup; @@ -432,7 +432,7 @@ $options["type"] = "txt"; print_single_button("download.php", $options, get_string("downloadtext")); - echo '
'; + echo ''; break; diff --git a/mod/survey/view.php b/mod/survey/view.php index 942056b3aa..6345827db1 100644 --- a/mod/survey/view.php +++ b/mod/survey/view.php @@ -70,9 +70,9 @@ if ($showscales) { print_heading(get_string("surveycompleted", "survey")); print_heading(get_string("peoplecompleted", "survey", $numusers)); - echo "
"; + echo '
'; survey_print_graph("id=$cm->id&sid=$USER->id&group=$currentgroup&type=student.png"); - echo "
"; + echo ''; } else { @@ -104,6 +104,7 @@ add_to_log($course->id, "survey", "view form", "view.php?id=$cm->id", $survey->id, $cm->id); echo "
"; + echo '
'; echo ""; print_simple_box(format_text($survey->intro), 'center', '70%', '', 5, 'generalbox', 'intro'); @@ -148,6 +149,7 @@ } if (isguest()) { + echo '
'; echo "
"; print_footer($course); exit; @@ -155,10 +157,9 @@ ?> -

-
- '; echo ""; print_footer($course); diff --git a/theme/standard/styles_layout.css b/theme/standard/styles_layout.css index ef29c2385e..6652bf703a 100644 --- a/theme/standard/styles_layout.css +++ b/theme/standard/styles_layout.css @@ -1971,7 +1971,7 @@ body#user-index .rolesform { .userpicture, .picture user, .picture teacher { - width:35; + width:35px; vertical-align:top; } .modform { @@ -2466,7 +2466,70 @@ body#mod-quiz-report .controls { /*** *** Modules: Survey ***/ +.resultgraph { + text-align:center; + border:1px solid; +} + +.reportsummary, +.studentreport, +.reportbuttons { + text-align:center; +} + +.centerpara { + text-align:center; +} + +.fullnamecell { + width:10%; + vertical-align:top; + white-space: nowrap; +} + +.questiontext { + font-size:1em; +} + +.smalltext { + font-size:0.6em; +} + +.smalltextcell, +.screenreadertext { + width:10%; + text-align:center; +} + +.foundthat, +.preferthat { + width:10%; + white-space: nowrap; +} + +.qnumtopcell { + width:10px; + vertical-align:top; +} + +.qnummiddlecell { + width:10px; + vertical-align:middle; +} + +.optioncell { + width:40%; + vertical-align:middle; +} +.buttoncell { + width:5%; +} + +.questioncell { + width:50%; + vertical-align:top; +} /*** *** Modules: Wiki ***/ -- 2.39.5