include_once("$CFG->dirroot/files/mimetypes.php");
+// reset error reporting
+error_reporting($CFG->debug);
+
/*** Constants **********************************/
$WORKSHOP_TYPE = array (0 => get_string("notgraded", "workshop"),
function workshop_print_assessment($workshop, $assessment, $allowchanges, $showcommentlinks)
function workshop_print_assessments_by_user_for_admin($workshop, $user) {
function workshop_print_assessments_for_admin($workshop, $submission) {
-function workshop_print_assignment_info($workshop) {
+function workshop_print_assignment_info($cm, $workshop) {
function workshop_print_difference($time) {
function workshop_print_feedback($course, $submission) {
function workshop_print_league_table($workshop) {
function workshop_print_assignment_info($workshop) {
+
+ if (! $course = get_record("course", "id", $workshop->course)) {
+ error("Course is misconfigured");
+ }
+ if (! $cm = get_coursemodule_from_instance("workshop", $workshop->id, $course->id)) {
+ error("Course Module ID was incorrect");
+ }
+ // print standard assignment heading
+ $strdifference = format_time($workshop->deadline - time());
+ if (($workshop->deadline - time()) < 0) {
+ $strdifference = "<font color=\"red\">$strdifference</font>";
+ }
+ $strduedate = userdate($workshop->deadline)." ($strdifference)";
print_simple_box_start("center");
- print_heading($workshop->name);
+ print_heading($workshop->name, "center");
print_simple_box_start("center");
echo "<b>".get_string("duedate", "assignment")."</b>: $strduedate<br />";
echo "<b>".get_string("maximumgrade")."</b>: $workshop->grade<br />";
echo "<br />";
echo format_text($workshop->description, $workshop->format);
print_simple_box_end();
- echo "<br />";
+ echo "<br />";
}
"", "", true, update_module_button($cm->id, $course->id, $strworkshop), navmenu($course, $cm));
// ...and if necessary set default action
+
optional_variable($action);
if (isteacher($course->id)) {
if (empty($action)) { // no action specified, either go straight to elements page else the admin page
/*********************** student's view could be in 1 of 4 stages ***********************/
elseif ($action == 'studentsview') {
- // print standard assignment heading
- $strdifference = format_time($workshop->deadline - time());
- if (($workshop->deadline - time()) < 0) {
- $strdifference = "<font color=\"red\">$strdifference</font>";
- }
- $strduedate = userdate($workshop->deadline)." ($strdifference)";
- print_simple_box_start("CENTER");
- print_heading($workshop->name, "CENTER");
- print_simple_box_start("CENTER");
- echo "<b>".get_string("duedate", "assignment")."</b>: $strduedate<br />";
- echo "<b>".get_string("maximumgrade")."</b>: $workshop->grade<br />";
- echo "<b>".get_string("detailsofassessment", "workshop")."</b>:
- <a href=\"assessments.php?id=$cm->id&action=displaygradingform\">".
- get_string("specimenassessmentform", "workshop")."</a><br />";
- print_simple_box_end();
- echo "<br />";
- echo format_text($workshop->description, $workshop->format);
- print_simple_box_end();
- echo "<br />";
+ workshop_print_assignment_info($workshop);
// in Stage 1? - are there any teacher's submissions? and...
// ...has student assessed the required number of the teacher's submissions ("satisfactory level" dropped 14/8/03)
if ($workshop->ntassessments and (!workshop_test_user_assessments($workshop, $USER))) {