~ubuntu-branches/ubuntu/jaunty/moodle/jaunty

« back to all changes in this revision

Viewing changes to mod/hotpot/review.php

  • Committer: Bazaar Package Importer
  • Author(s): Jordan Mantha, Matt Oquist
  • Date: 2009-02-25 15:16:22 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20090225151622-0ekt1liwhv2obfza
Tags: 1.9.4.dfsg-0ubuntu1
* Merge with Debian git (Closes LP: #322961, #239481, #334611):
  - use Ubuntu's smarty lib directory for linking
  - use internal yui library 
  - add update-notifier support back in

[Matt Oquist]
  * renamed prerm script
  * significantly rewrote postinst and other maintainer scripts to improve
    user experience and package maintainability
    (Closes LP: #225662, #325450, #327843, #303078, #234609)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?PHP // $Id: review.php,v 1.11.2.1 2007/02/28 05:36:24 nicolasconnault Exp $
 
1
<?PHP // $Id: review.php,v 1.17.2.4 2008/04/02 06:10:04 dongsheng Exp $
2
2
// This page prints a review of a particular quiz attempt
3
3
    require_once("../../config.php");
4
4
    require_once("lib.php");
31
31
    if (! $attempt = get_record("hotpot_attempts", "id", $attempt)) {
32
32
        error("Attempt ID was incorrect");
33
33
    }
34
 
    
 
34
 
 
35
    require_login($course);
 
36
 
 
37
    // check user can access this hotpot activity
 
38
    if (!hotpot_is_visible($cm)) {
 
39
        print_error("activityiscurrentlyhidden");
 
40
    }
 
41
 
35
42
    $context = get_context_instance(CONTEXT_MODULE, $cm->id);
36
 
    require_login($course->id);
37
43
    if (!has_capability('mod/hotpot:viewreport',$context)) {
38
44
        if (!$hotpot->review) {
39
 
            error(get_string("noreview", "quiz"));
 
45
            print_error("noreview", "quiz");
40
46
        }
41
47
        //if (time() < $hotpot->timeclose) {
42
 
        //  error(get_string("noreviewuntil", "quiz", userdate($hotpot->timeclose)));
 
48
        //  print_error("noreviewuntil", "quiz", '', userdate($hotpot->timeclose));
43
49
        //}
44
50
        if ($attempt->userid != $USER->id) {
45
51
            error("This is not your attempt!");
52
58
    // print header
53
59
    $title = format_string($course->shortname) . ": $hotpot->name";
54
60
    $heading = $course->fullname;
55
 
    $navigation = "<a href=\"index.php?id=$course->id\">$strmodulenameplural</a> -> ".get_string("review", "quiz");
56
 
    if ($course->id != SITEID) {
57
 
        $navigation = "<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> -> $navigation";
58
 
    }
 
61
 
 
62
    $navigation = build_navigation('', $cm);
59
63
    $button = update_module_button($cm->id, $course->id, $strmodulename);
60
64
    print_header($title, $heading, $navigation, "", "", true, $button, navmenu($course, $cm));
61
65
    print '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>'; // for overlib
103
107
                $value = hotpot_format_status($attempt);
104
108
                break;
105
109
            case 'timerecorded':
106
 
                $value = empty($attempt->timefinish) ? '-' : userdate($attempt->timefinish); 
 
110
                $value = empty($attempt->timefinish) ? '-' : userdate($attempt->timefinish);
107
111
                break;
108
112
            case 'timetaken':
109
 
                $value = empty($attempt->timefinish) ? '-' : format_time($attempt->timefinish - $attempt->timestart); 
 
113
                $value = empty($attempt->timefinish) ? '-' : format_time($attempt->timefinish - $attempt->timestart);
110
114
                break;
111
115
            default:
112
116
                $value = isset($attempt->$field) ? $attempt->$field : NULL;