Preview how many responses have been made (for teacher)

This commit is contained in:
martin
2002-08-18 09:52:51 +00:00
parent 66062dd310
commit ac1b97570b
2 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -14,5 +14,5 @@ $string[notanswered] = "Not answered yet";
$string[responses] = "Responses";
$string[responsesto] = "Responses to \$a";
$string[savemychoice] = "Save my choice";
$string[viewallresponses] = "View all responses";
$string[viewallresponses] = "View \$a responses";
?>
+6 -1
View File
@@ -66,7 +66,12 @@
update_module_icon($cm->id, $course->id));
if (isteacher($course->id)) {
echo "<P align=right><A HREF=\"report.php?id=$cm->id\">".get_string("viewallresponses", "choice")."</A></P>";
if ( $allanswers = get_records("choice_answers", "choice", $choice->id)) {
$responsecount = count($allanswers);
} else {
$responsecount = 0;
}
echo "<P align=right><A HREF=\"report.php?id=$cm->id\">".get_string("viewallresponses", "choice", $responsecount)."</A></P>";
}
print_simple_box( text_to_html($choice->text) , "center");