From 95aa949b72529bc3f570b861a9ae2f4cd64d46fa Mon Sep 17 00:00:00 2001 From: toyomoyo Date: Tue, 9 Jan 2007 03:14:34 +0000 Subject: [PATCH] MDL-7861, xhtml strict fixes for choice --- mod/choice/lib.php | 24 ++++++++++++++---------- mod/choice/report.php | 2 +- theme/standard/styles_layout.css | 25 +++++++++++++++++++++++-- 3 files changed, 38 insertions(+), 13 deletions(-) diff --git a/mod/choice/lib.php b/mod/choice/lib.php index bc13adc526..ebd1118071 100644 --- a/mod/choice/lib.php +++ b/mod/choice/lib.php @@ -350,7 +350,6 @@ function choice_show_results($choice, $course, $cm, $forcepublish='') { } } ksort($useranswer); - switch ($forcepublish) { case CHOICE_PUBLISH_NAMES: @@ -358,6 +357,7 @@ function choice_show_results($choice, $course, $cm, $forcepublish='') { if (has_capability('mod/choice:readresponses', $context)) { echo '
'; echo '
'; + echo '
'; echo ''; echo ''; } @@ -382,14 +382,17 @@ function choice_show_results($choice, $course, $cm, $forcepublish='') { $count = 0; foreach ($useranswer as $optionid => $userlist) { if ($optionid) { - echo ""; + echo ""; } else if ($choice->showunanswered) { - echo ""; + echo ""; } else { continue; } - echo ""; + // added empty row so that when the next iteration is empty, + // we do not get
erro from w3c validator + // MDL-7861 + echo ""; foreach ($userlist as $user) { // this needs to be fixed // hide admin/editting teacher (users with editting privilages) @@ -399,9 +402,9 @@ function choice_show_results($choice, $course, $cm, $forcepublish='') { if (has_capability('mod/choice:readresponses', $context) && $optionid!=0) { echo ''; } - echo "'; } echo "
"; + echo ""; print_user_picture($user->id, $course->id, $user->picture); - echo ""; + echo ""; echo "wwwroot/user/view.php?id=$user->id&course=$course->id\">"; echo fullname($user, has_capability('moodle/site:viewfullnames', $context)); echo ""; @@ -451,14 +454,15 @@ function choice_show_results($choice, $course, $cm, $forcepublish='') { $options = array('delete' => get_string('delete')); echo choose_from_menu($options, 'action', '', get_string('withselected', 'quiz'), 'if(this.selectedIndex > 0) submitFormById(\'attemptsform\');', '', true); echo ''; + echo '
'; + echo '
'; echo ''; echo '
"; if (has_capability('mod/choice:readresponses', $context)) { - echo "
"; + echo "
"; } break; @@ -482,7 +486,7 @@ function choice_show_results($choice, $course, $cm, $forcepublish='') { echo ""; $count++; } - echo ""; + echo ""; $maxcolumn = 0; foreach ($useranswer as $optionid => $userlist) { @@ -500,7 +504,7 @@ function choice_show_results($choice, $course, $cm, $forcepublish='') { } } - echo ""; + echo ""; $count = 0; foreach ($useranswer as $optionid => $userlist) { if (!$optionid and !$choice->showunanswered) { diff --git a/mod/choice/report.php b/mod/choice/report.php index f54a7a4fdd..ac9355175d 100644 --- a/mod/choice/report.php +++ b/mod/choice/report.php @@ -248,7 +248,7 @@ //now give links for downloading spreadsheets. echo "
\n"; - echo "\n"; + echo "
\n"; echo "
"; $options = array(); $options["id"] = "$cm->id"; diff --git a/theme/standard/styles_layout.css b/theme/standard/styles_layout.css index ad146fde7a..a7164f7f72 100644 --- a/theme/standard/styles_layout.css +++ b/theme/standard/styles_layout.css @@ -2086,16 +2086,37 @@ body#user-index .rolesform { white-space: nowrap; } -.anonymous { +.anonymous, +.names { margin-left:auto; margin-right:auto; } -.names { +.downloadreport { + border:0px; margin-left:auto; margin-right:auto; } +.choiceresponse { + width:100%; +} +.choiceresponse .picture { + width:10px; + white-space: nowrap; +} + +.choiceresponse .fullname { + width:100%; + white-space: nowrap; +} + + +.results.data { + vertical-align:top; + white-space: nowrap; +} + /*** *** Modules: Data ***/ -- 2.39.5