$stripreferthat = get_string("ipreferthat", "survey");
$strifoundthat = get_string("ifoundthat", "survey");
echo "<br />\n";
- echo "<font size=\"4\"><b>$question->text</b></font><br />";
-
- echo "<table align=\"center\" width=\"90%\" cellpadding=\"4\" cellspacing=\"1\" border=\"0\">";
+ echo "<span class='questiontext'><b>$question->text</b></span><br />";
+ echo "<div style=\"text-align:center\">";
+ echo "<table width=\"90%\" cellpadding=\"4\" cellspacing=\"1\" border=\"0\">";
$options = explode( ",", $question->options);
$numoptions = count($options);
}
while (list ($key, $val) = each ($options)) {
- echo "<td width=\"10%\" align=\"center\"><font size=\"1\">$val</font></td>\n";
+ echo "<td class=\"smalltextcell\"><span class='smalltext'>$val</span></td>\n";
}
echo "<td align=\"center\"> </td></tr>\n";
echo "<tr class=\"$rowclass\">";
if ($oneanswer) {
- echo "<td width=\"10\" valign=\"top\"><b>$qnum</b></td>";
+ echo "<td class=\"qnumtopcell\"><b>$qnum</b></td>";
echo "<td valign=\"top\">$q->text</td>";
for ($i=1;$i<=$numoptions;$i++) {
$screenreader = !empty($USER->screenreader)?"<label for=\"q$P$q->id".$i."\">".$options[$i-1]."</label><br/>":'';
- echo "<td width=\"10%\" align=\"center\">".$screenreader."<input type=\"radio\" name=\"q$P$q->id\" id=\"q$P$q->id".$i."\" value=\"$i\" alt=\"$i\" /></td>";
+ echo "<td class=\"screenreadertext\">".$screenreader."<input type=\"radio\" name=\"q$P$q->id\" id=\"q$P$q->id".$i."\" value=\"$i\" alt=\"$i\" /></td>";
}
echo "<td bgcolor=\"white\"><input type=\"radio\" name=\"q$P$q->id\" value=\"0\" checked=\"checked\" alt=\"0\" /></td>";
$checklist["q$P$q->id"] = $numoptions;
} else {
// yu : fix for MDL-7501, possibly need to use user flag as this is quite ugly.
- echo "<td width=\"10\" valign=\"middle\"><b>$qnum</b></td>";
+ echo "<td class=\"qnummiddlecell\"><b>$qnum</b></td>";
$qnum++;
- echo "<td width=\"10%\" nowrap=\"nowrap\"><font size=\"1\">$stripreferthat </font></td>";
- echo "<td width=\"40%\" valign=\"middle\">$q->text</td>";
+ echo "<td class=\"preferthat\"><span class='smalltext'>$stripreferthat </span></td>";
+ echo "<td class=\"optioncell\">$q->text</td>";
for ($i=1;$i<=$numoptions;$i++) {
$screenreader = !empty($USER->screenreader)?"<label for=\"qP$q->id".$i."\">".$options[$i-1]."</label><br/>":'';
- echo "<td width=\"10%\" align=\"center\">".$screenreader."<input type=\"radio\" name=\"qP$q->id\" id=\"qP$q->id".$i."\" value=\"$i\" alt=\"$i\"/></td>";
+ echo "<td class=\"screenreadertext\">".$screenreader."<input type=\"radio\" name=\"qP$q->id\" id=\"qP$q->id".$i."\" value=\"$i\" alt=\"$i\"/></td>";
}
echo "<td><input type=\"radio\" name=\"qP$q->id\" value=\"0\" checked=\"checked\" alt=\"0\" /></td>";
echo "</tr>";
echo "<tr class=\"$rowclass\">";
- echo "<td width=\"10\" valign=\"middle\"><b>$qnum</b></td>";
- echo "<td width=\"10%\" nowrap=\"nowrap\"><font size=\"1\">$strifoundthat </font></td>";
- echo "<td width=\"40%\" valign=\"middle\">$q->text</td>";
+ echo "<td class=\"qnumtopcell\"><b>$qnum</b></td>";
+ echo "<td class=\"foundthat\"><span class='smalltext'>$strifoundthat </span></td>";
+ echo "<td class=\"optioncell\">$q->text</td>";
for ($i=1;$i<=$numoptions;$i++) {
$screenreader = !empty($USER->screenreader)?"<label for=\"q$q->id".$i."\">".$options[$i-1]."</label><br/>":'';
- echo "<td width=\"10%\" align=\"center\">".$screenreader."<input type=\"radio\" name=\"q$q->id\" id=\"q$q->id".$i."\" value=\"$i\" alt=\"$i\" /></td>";
+ echo "<td class=\"screenreadertext\">".$screenreader."<input type=\"radio\" name=\"q$q->id\" id=\"q$q->id".$i."\" value=\"$i\" alt=\"$i\" /></td>";
}
- echo "<td width=\"5%\"><input type=\"radio\" name=\"q$q->id\" value=\"0\" checked=\"checked\" alt=\"0\" /></td>";
+ echo "<td class=\"buttoncell\"><input type=\"radio\" name=\"q$q->id\" value=\"0\" checked=\"checked\" alt=\"0\" /></td>";
$checklist["qP$q->id"] = $numoptions;
$checklist["q$q->id"] = $numoptions;
}
}
echo "</table>";
+ echo "</div>";
}
$qnum++;
echo "<br />\n";
- echo "<table align=\"center\" width=\"90%\" cellpadding=\"4\" cellspacing=\"0\">\n";
+ echo "<table width=\"90%\" cellpadding=\"4\" cellspacing=\"0\">\n";
echo "<tr class=\"$rowclass\">";
echo "<td valign=\"top\"><b>$qnum</b></td>";
- echo "<td width=\"50%\" valign=\"top\">$question->text</td>\n";
- echo "<td width=\"50%\" valign=\"top\"><font size=\"+1\">\n";
+ echo "<td class=\"questioncell\">$question->text</td>\n";
+ echo "<td class=\"questioncell\"><span class='smalltext'>\n";
if ($question->type == 0) { // Plain text field
notify("This question type not supported yet");
}
- echo "</font></td></tr></table>";
+ echo "</span></td></tr></table>";
}
echo "(".get_string("gdneed").")";
} else {
- echo "<img height=\"$SURVEY_GHEIGHT\" width=\"$SURVEY_GWIDTH\" border=\"1\"".
+ echo "<img class='resultgraph' height=\"$SURVEY_GHEIGHT\" width=\"$SURVEY_GWIDTH\"".
" src=\"$CFG->wwwroot/mod/survey/graph.php?$url\" alt=\"".get_string("surveygraph", "survey")."\" />";
}
}
print_heading($strsummary);
if (survey_count_responses($survey->id, $currentgroup)) {
- echo "<center><a href=\"report.php?action=scales&id=$id\">";
+ echo "<div class='reportsummary'><a href=\"report.php?action=scales&id=$id\">";
survey_print_graph("id=$id&group=$currentgroup&type=overall.png");
- echo "</a></center>";
+ echo "</a></div>";
} else {
notify(get_string("nobodyyet","survey"));
}
if (!empty($virtualscales) && $question->type > 0) { // Don't show non-virtual scales if virtual
continue;
}
- echo "<p align=\"center\"><a title=\"$strseemoredetail\" href=\"report.php?action=questions&id=$id&qid=$question->multi\">";
+ echo "<p class=\"centerpara\"><a title=\"$strseemoredetail\" href=\"report.php?action=questions&id=$id&qid=$question->multi\">";
survey_print_graph("id=$id&qid=$question->id&group=$currentgroup&type=multiquestion.png");
echo "</a></p><br />";
}
foreach ($subquestionorder as $key => $val) {
$subquestion = $subquestions[$val];
if ($subquestion->type > 0) {
- echo "<p align=\"center\">";
+ echo "<p class=\"centerpara\">";
echo "<a title=\"$strseemoredetail\" href=\"report.php?action=question&id=$id&qid=$subquestion->id\">";
survey_print_graph("id=$id&qid=$subquestion->id&group=$currentgroup&type=question.png");
echo "</a></p>";
}
}
} else if ($question->type > 0 ) {
- echo "<p align=\"center\">";
+ echo "<p class=\"centerpara\">";
echo "<a title=\"$strseemoredetail\" href=\"report.php?action=question&id=$id&qid=$question->id\">";
survey_print_graph("id=$id&qid=$question->id&group=$currentgroup&type=question.png");
echo "</a></p>";
if ($aaa = survey_get_user_answers($survey->id, $question->id, $currentgroup, "sa.time ASC")) {
foreach ($aaa as $a) {
$contents .= "<tr>";
- $contents .= '<td nowrap="nowrap" width="10%" valign="top">'.fullname($a).'</td>';
+ $contents .= '<td class="fullnamecell">'.fullname($a).'</td>';
$contents .= '<td valign="top">'.$a->answer1.'</td>';
$contents .= "</tr>";
}
}
}
- echo "<p align=\"center\">";
+ echo "<p <p class=\"centerpara\">";
print_user_picture($user->id, $course->id, $user->picture, true);
echo "</p>";
if ($showscales) {
// Print overall summary
- echo "<p align=\"center\">";
+ echo "<p <p class=\"centerpara\">>";
survey_print_graph("id=$id&sid=$student&type=student.png");
echo "</p>";
if ($virtualscales && $question->type > 0) { // Don't show non-virtual scales if virtual
continue;
}
- echo "<p align=\"center\">";
+ echo "<p class=\"centerpara\">";
echo "<a title=\"$strseemoredetail\" href=\"report.php?action=questions&id=$id&qid=$question->multi\">";
survey_print_graph("id=$id&qid=$question->id&sid=$student&type=studentmultiquestion.png");
echo "</a></p><br />";
$notes = "";
}
echo "<hr noshade=\"noshade\" size=\"1\" />";
- echo "<center>";
+ echo "<div class='studentreport'>";
echo "<form action=\"report.php\" method=\"post\">";
echo "<h3>$strnotes:</h3>";
echo "<blockquote>";
echo "<input type=\"submit\" value=\"".get_string("savechanges")."\" />";
echo "</blockquote>";
echo "</form>";
- echo "</center>";
+ echo "</div>";
break;
require_capability('mod/survey:download', $context);
- echo '<p align="center">'.get_string("downloadinfo", "survey").'</p>';
+ echo '<p class="centerpara">'.get_string("downloadinfo", "survey").'</p>';
- echo '<center>';
+ echo '<div class="reportbuttons">';
$optons = array();
$options["id"] = "$cm->id";
$options["group"] = $currentgroup;
$options["type"] = "txt";
print_single_button("download.php", $options, get_string("downloadtext"));
- echo '</center>';
+ echo '</div>';
break;
if ($showscales) {
print_heading(get_string("surveycompleted", "survey"));
print_heading(get_string("peoplecompleted", "survey", $numusers));
- echo "<center>";
+ echo '<div class="resultgraph">';
survey_print_graph("id=$cm->id&sid=$USER->id&group=$currentgroup&type=student.png");
- echo "</center>";
+ echo '</div>';
} else {
add_to_log($course->id, "survey", "view form", "view.php?id=$cm->id", $survey->id, $cm->id);
echo "<form method=\"post\" action=\"save.php\">";
+ echo '<div>';
echo "<input type=\"hidden\" name=\"id\" value=\"$id\" />";
print_simple_box(format_text($survey->intro), 'center', '70%', '', 5, 'generalbox', 'intro');
}
if (isguest()) {
+ echo '</div>';
echo "</form>";
print_footer($course);
exit;
?>
-<center>
<br />
<script type="text/javascript">
-<!-- // BEGIN
+<![CDATA[
function checkform() {
var error=false;
<?php echo "document.write('<input type=\"button\" value=\"".get_string("clicktocontinuecheck", "survey")."\" onClick=\"checkform()\" />');"; ?>
-// END -->
+// END -->
+]]>
</script>
<noscript>
<!-- Without Javascript, no checking is done -->
+ <div>
<input type="submit" value="<?php get_string("clicktocontinue", "survey") ?>" />
+ </div>
</noscript>
-</center>
-
<?php
+ echo '</div>';
echo "</form>";
print_footer($course);
.userpicture,
.picture user,
.picture teacher {
- width:35;
+ width:35px;
vertical-align:top;
}
.modform {
/***
*** 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
***/