Just a couple of changes
[moodle.git] / mod / choice / lib.php
CommitLineData
0d22e7cc 1<?PHP // $Id$
2
3function choice_user_summary($course, $user, $mod, $choice) {
4 global $CFG;
5}
6
7
8function choice_user_outline($course, $user, $mod, $choice) {
9 if ($current = get_record_sql("SELECT * FROM choice_answers
10 WHERE choice='$choice->id' AND user='$user->id'")) {
11 if ($current->answer == "1") {
12 $result->info = "'$choice->answer1'";
13 } else if ($current->answer == "2") {
14 $result->info = "'$choice->answer2'";
15 }
16 $result->time = $current->timemodified;
17 return $result;
18 }
19 return NULL;
20}
21
22
23function choice_user_complete($course, $user, $mod, $choice) {
24 if ($current = get_record_sql("SELECT * FROM choice_answers
25 WHERE choice='$choice->id' AND user='$user->id'")) {
26 if ($current->answer == "1") {
27 $result->info = "'$choice->answer1'";
28 } else if ($current->answer == "2") {
29 $result->info = "'$choice->answer2'";
30 }
31 $result->time = $current->timemodified;
32 echo "Answered: $result->info , last updated ".userdate($result->time);
33 } else {
34 echo "Not answered yet";
35 }
36}
37
38?>
39