Permalink
Browse files

Preview how many responses have been made (for teacher)

  • Loading branch information...
1 parent 66062dd commit ac1b97570b6e2f476dd1e1708e383c0ea2d34d47 martin committed Aug 18, 2002
Showing with 7 additions and 2 deletions.
  1. +1 −1 lang/en/choice.php
  2. +6 −1 mod/choice/view.php
View
@@ -14,5 +14,5 @@
$string[responses] = "Responses";
$string[responsesto] = "Responses to \$a";
$string[savemychoice] = "Save my choice";
-$string[viewallresponses] = "View all responses";
+$string[viewallresponses] = "View \$a responses";
?>
View
@@ -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");

0 comments on commit ac1b975

Please sign in to comment.