Refactored Assignment Module
[moodle.git] / mod / assignment / type / offline / assignment.class.php
CommitLineData
b0f2597e 1<?php // $Id$
2
3/**
4 * Extend the base assignment class for offline assignments
5 *
6 */
7class assignment_offline extends assignment_base {
8
9 function assignment_offline($cmid=0) {
10 parent::assignment_base($cmid);
11 }
12
13 function setup($form) {
14 global $CFG, $usehtmleditor;
15
16 parent::setup($form);
17 include("$CFG->dirroot/mod/assignment/type/offline/mod.html");
18 parent::setup_end();
19 }
20
21 function submittedlink() {
22 global $USER;
23
24 $submitted = '';
25
26 if (isteacher($this->course->id)) {
27 $submitted = '<a href="submissions.php?id='.$this->cm->id.'">' .
28 get_string('viewfeedback', 'assignment') . '</a>';
29 } else {
30 if (isset($USER->id)) {
31 if ($submission = $this->get_submission($USER->id)) {
32 if ($submission->timemodified <= $assignment->timedue) {
33 $submitted = userdate($submission->timemodified);
34 } else {
35 $submitted = '<span class="late">'.userdate($submission->timemodified).'</span>';
36 }
37 }
38 }
39 }
40
41 return $submitted;
42 }
43
44
45
46}
47
48?>