~ubuntu-branches/ubuntu/hoary/moodle/hoary

« back to all changes in this revision

Viewing changes to mod/survey/index.php

  • Committer: Bazaar Package Importer
  • Author(s): Isaac Clerencia
  • Date: 2004-12-29 00:49:52 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20041229004952-gliyqzpj2w3e7clx
Tags: 1.4.3-1
* Urgency high as upstream release fixes several security bugs
* New upstream release
* Write database creation errors and warn the user about it, 
closes: #285842, #285842

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?PHP // $Id: index.php,v 1.13 2004/01/26 12:29:02 moodler Exp $
 
1
<?PHP // $Id: index.php,v 1.15 2004/08/22 14:38:45 gustav_delius Exp $
2
2
 
3
3
    require_once("../../config.php");
4
4
    require_once("lib.php");
9
9
        error("Course ID is incorrect");
10
10
    }
11
11
 
12
 
    require_login($course->id);
 
12
    require_course_login($course);
13
13
 
14
14
    add_to_log($course->id, "survey", "view all", "index.php?id=$course->id", "");
15
15
 
16
 
    if ($course->category) {
17
 
        $navigation = "<A HREF=\"../../course/view.php?id=$course->id\">$course->shortname</A> ->";
18
 
    }
19
 
 
20
16
    $strsurveys = get_string("modulenameplural", "survey");
21
17
    $strweek = get_string("week");
22
18
    $strtopic = get_string("topic");
25
21
    $strdone  = get_string("done", "survey");
26
22
    $strnotdone  = get_string("notdone", "survey");
27
23
 
28
 
    print_header("$course->shortname: $strsurveys", "$course->fullname", "$navigation $strsurveys", 
 
24
    print_header_simple("$strsurveys", "", "$strsurveys", 
29
25
                 "", "", true, "", navmenu($course));
30
26
 
31
27
    if (! $surveys = get_all_instances_in_course("survey", $course)) {
46
42
    $currentsection = '';
47
43
 
48
44
    foreach ($surveys as $survey) {
49
 
        if (survey_already_done($survey->id, $USER->id)) {
 
45
        if (isset($USER->id) and survey_already_done($survey->id, $USER->id)) {
50
46
            $ss = $strdone;
51
47
        } else {
52
48
            $ss = $strnotdone;