} else { $statusicon = $OUTPUT->pix_icon("i/flagged", get_string('sent', 'mod_emarking')); } $regradecomment = emarking_view_more(get_string("justification", "mod_emarking"), $record->comment, "comment", $record->id); $motive = emarking_get_regrade_type_string($record->motive) . '<br/>' . $regradecomment; // Student info $url = new moodle_url('/user/view.php', array('id' => $record->userid, 'course' => $course->id)); $studentcriterion = $OUTPUT->action_link($url, $record->firstname . ' ' . $record->lastname); $studentcriterion .= '<br/>' . $record->criterion; $studentcriterion .= '<br/>' . emarking_time_ago($record->timecreated, true); // Original grade $original = ' [' . round($record->originalscore, 2) . '/' . round($record->maxscore, 2) . ']'; // After regrade $current = $record->accepted ? '[' . round($record->currentscore, 2) . '/' . round($record->maxscore, 2) . '] ' : ''; $current .= ' ' . $statusicon; $current .= $record->accepted ? '<br/>' . $record->markercomment : ''; $current .= ' ' . emarking_time_ago($record->timemodified, true); // Actions $urlsub = new moodle_url('/mod/emarking/marking/index.php', array('id' => $record->ids)); $actions = $OUTPUT->action_link($urlsub, get_string('annotatesubmission', 'mod_emarking'), new popup_action('click', $urlsub, 'emarking' . $record->ids, array('menubar' => 'no', 'titlebar' => 'no', 'status' => 'no', 'toolbar' => 'no', 'width' => 860, 'height' => 600)), array("class" => "rowactions")); $array = array(); $array[] = $studentcriterion; $array[] = $motive; $array[] = $original; $array[] = $current; $array[] = $actions; $data[] = $array; } $table->data = $data; echo html_writer::table($table); echo $OUTPUT->footer();
$feedback = ''; // Last modified. $timemodified = ''; // Markers pictures. $markersstring = ''; // Select checkbox. $selectdraft = ''; foreach ($submissiondrafts as $d) { $pctmarked .= emarking_get_draft_status_info($exam, $d, $numcriteria, $numcriteriauser, $emarking, $rubriccriteria); $finalgrade .= emarking_get_finalgrade($d, $usercangrade, $issupervisor, $draft, $rubricscores, $emarking); $actions .= emarking_get_actions($d, $emarking, $context, $draft, $usercangrade, $issupervisor, $usercanpublishgrades, $numcriteria, $scan, $cm, $rubriccriteria); $feedback .= strlen($d->feedback) > 0 ? $d->feedback : ''; $timemodified .= html_writer::start_div("timemodified"); $timemodified .= get_string('lastmodification', 'mod_emarking'); $timemodified .= " "; $timemodified .= $d->timemodified > 0 ? core_text::strtolower(emarking_time_ago($d->timemodified)) : ''; $timemodified .= html_writer::end_div(); // Checkbox for publishing grade. if ($usercanpublishgrades && $d->qc == 0 && $d->status >= EMARKING_STATUS_SUBMITTED && $d->status < EMARKING_STATUS_PUBLISHED && $rubriccriteria) { $selectdraft .= "<input type=\"checkbox\" name=\"publish[]\" value=\"{$d->id}\" title=\"" . get_string("select") . "\">"; } if ($emarking->type == EMARKING_TYPE_PEER_REVIEW) { $marker = $DB->get_record("user", array("id" => $d->marker)); $markersstring .= $OUTPUT->user_picture($marker) . ' ' . $marker->lastname . ', ' . $marker->firstname; } else { if ($emarking->type == EMARKING_TYPE_MARKER_TRAINING) { foreach ($markers as $marker) { if ($d->marker == $marker->id) { $markersstring .= $OUTPUT->user_picture($marker) . ' '; } }
} if ($exam->printlist) { $details .= html_writer::div($OUTPUT->pix_icon("i/grades", get_string("printlist", "mod_emarking"))); } if ($exam->printrandom) { $details .= html_writer::div($OUTPUT->pix_icon("shuffle", get_string("printrandom", "mod_emarking"), "mod_emarking")); } $details .= emarking_enrolments_div($exam); $details .= html_writer::end_tag("div"); $examstable->data[] = array(get_string("examdate", "mod_emarking"), date("l jS F Y, g:ia", usertime($exam->examdate))); if ($usercangrade) { $examstatus = emarking_exam_status_string($exam); $examstable->data[] = array(get_string("comment", "mod_emarking"), $exam->comment); $examstable->data[] = array(get_string("status", "mod_emarking"), $examstatus); $examstable->data[] = array(get_string("details", "mod_emarking"), $details); $examstable->data[] = array(get_string("sent", "mod_emarking"), emarking_time_ago($exam->timecreated)); $originals = $exam->totalpages + $exam->extrasheets; $copies = $exam->totalstudents + $exam->extraexams; $totalsheets = $originals * $copies; $examstable->data[] = array(get_string('originals', 'mod_emarking'), $originals); $examstable->data[] = array(get_string('copies', 'mod_emarking'), $copies); $examstable->data[] = array(get_string('totalpagesprint', 'mod_emarking'), $totalsheets); $user = $DB->get_record("user", array("id" => $exam->requestedby)); $examstable->data[] = array(get_string('requestedby', 'mod_emarking'), $user->firstname . ' ' . $user->lastname); $examstable->data[] = array(get_string("multicourse", "mod_emarking"), $multicourse ? $multicourse : get_string("no")); } echo html_writer::table($examstable); // Show download button if the user has capability for downloading within // the category or if she is a teacher and has download capability for the // course and teacher downloads are allowed in the system. if (has_capability("mod/emarking:downloadexam", $context)) {
$actions .= html_writer::end_tag("div"); // Calculating date differences to identify exams that are late, are for today and so on if (date("d/m/y", $exam->examdate) === date("d/m/y", $currentdate)) { $examstable->rowclasses[$current] = 'examtoday'; } else { if ($currentdate < $exam->examdate) { $examstable->rowclasses[$current] = 'examisok'; } else { $examstable->rowclasses[$current] = 'examislate'; } } $notification = $exam->notified ? $OUTPUT->pix_icon('t/approve', get_string('printnotificationsent', 'mod_emarking')) : '<a href="' . $CFG->wwwroot . '/mod/emarking/print/sendprintnotification.php?id=' . $exam->id . '">' . $OUTPUT->pix_icon('i/email', get_string('printsendnotification', 'mod_emarking')) . '</a>'; $enrolments = html_writer::start_tag("div", array("class" => "printdetails")); $enrolments .= emarking_enrolments_div($exam); $enrolments .= html_writer::end_tag("div"); $examstable->data[] = array(date("l jS F g:ia", $exam->examdate), $exam->name, $OUTPUT->action_link($urlcourse, $exam->coursefullname), $exam->category . '<br/>' . $enrolments, $OUTPUT->action_link($urlprofile, $exam->userfullname), $statusicon == 1 ? emarking_time_ago($exam->timecreated) : emarking_time_ago($exam->printdate), $statusicon == 1 ? $pagestoprint : $actions, $statusicon == 1 ? $actions : $notification); $current++; } echo $OUTPUT->header(); $activetab = $statusicon == 1 ? 'printorders' : 'printordershistory'; echo $OUTPUT->tabtree(emarking_printoders_tabs($category), $activetab); echo $OUTPUT->heading($pagetitle . ' ' . $category->name); if (count($exams) > 0) { echo html_writer::table($examstable); // print the table echo $OUTPUT->paging_bar($examscount, $page, $perpage, $CFG->wwwroot . '/mod/emarking/print/printorders.php?category=' . $categoryid . '&status=' . $statusicon . '&page='); } else { echo $OUTPUT->notification(get_string('noexamsforprinting', 'mod_emarking'), 'notifyproblem'); } $downloadurl = new moodle_url('/mod/emarking/print/download.php'); if ($CFG->emarking_usesms) {
$actions .= html_writer::end_tag("div"); // Calculating date differences to identify exams that are late, are for today and so on. if (date("d/m/y", $exam->examdate) === date("d/m/y", $currentdate)) { $examstable->rowclasses[$current] = 'examtoday'; } else { if ($currentdate < $exam->examdate) { $examstable->rowclasses[$current] = 'examisok'; } else { $examstable->rowclasses[$current] = 'examislate'; } } $notification = $exam->notified ? $OUTPUT->pix_icon('t/approve', get_string('printnotificationsent', 'mod_emarking')) : '<a href="' . $CFG->wwwroot . '/mod/emarking/print/sendprintnotification.php?id=' . $exam->id . '">' . $OUTPUT->pix_icon('i/email', get_string('printsendnotification', 'mod_emarking')) . '</a>'; $enrolments = html_writer::start_tag("div", array("class" => "printdetails")); $enrolments .= emarking_enrolments_div($exam); $enrolments .= html_writer::end_tag("div"); $examstable->data[] = array(date("l jS F g:ia", $exam->examdate), $exam->name, $OUTPUT->action_link($urlcourse, $exam->coursefullname), $exam->category . '<br/>' . $enrolments, $OUTPUT->action_link($urlprofile, $exam->userfullname), '$' . number_format($exam->cost) . $OUTPUT->action_icon($urlcost, new pix_icon("i/edit", get_string("downloadform", "mod_emarking"))), $statusicon == 1 ? emarking_time_ago($exam->timecreated) : emarking_time_ago($exam->printdate), $statusicon == 1 ? $pagestoprint : $actions, $statusicon == 1 ? $actions : $notification); $current++; } echo $OUTPUT->header(); echo $OUTPUT->heading($pagetitle . ' ' . $category->name); $activetab = $statusicon == 1 ? 'printorders' : 'printordershistory'; echo $OUTPUT->tabtree(emarking_printoders_tabs($category), $activetab); if (count($exams) > 0) { echo core_text::strtotitle(get_string("filter")) . " "; echo html_writer::tag("input", null, array("id" => "searchInput")); echo html_writer::table($examstable); // Print the table. echo $OUTPUT->paging_bar($examscount, $page, $perpage, $CFG->wwwroot . '/mod/emarking/print/printorders.php?category=' . $categoryid . '&status=' . $statusicon . '&page='); } else { echo $OUTPUT->notification(get_string('noexamsforprinting', 'mod_emarking'), 'notifyproblem'); }
$actions = html_writer::start_tag("div", array("class" => "printactions")); $actions .= html_writer::end_tag("div"); // Calculating date differences to identify exams that are late, are for today and so on. if (date("d/m/y", $exam->examdate) === date("d/m/y", $currentdate)) { $examstable->rowclasses[$current] = 'examtoday'; } else { if ($currentdate < $exam->examdate) { $examstable->rowclasses[$current] = 'examisok'; } else { $examstable->rowclasses[$current] = 'examislate'; } } $notification = $exam->notified ? $OUTPUT->pix_icon('t/approve', get_string('printnotificationsent', 'mod_emarking')) : '<a href="' . $CFG->wwwroot . '/mod/emarking/print/sendprintnotification.php?id=' . $exam->id . '">' . $OUTPUT->pix_icon('i/email', get_string('printsendnotification', 'mod_emarking')) . '</a>'; $enrolments = html_writer::start_tag("div", array("class" => "printdetails")); $enrolments .= emarking_enrolments_div($exam); $enrolments .= html_writer::end_tag("div"); if ($statusicon == 1) { $examstable->data[] = array(date("l jS F g:ia", $exam->examdate), $exam->name, $OUTPUT->action_link($urlcourse, $exam->coursefullname), $exam->category . '<br/>' . $enrolments, $OUTPUT->action_link($urlprofile, $exam->userfullname), '$' . number_format($exam->cost), emarking_time_ago($exam->timecreated), $pagestoprint); } else { $examstable->data[] = array(date("l jS F g:ia", $exam->examdate), $exam->name, $OUTPUT->action_link($urlcourse, $exam->coursefullname), $exam->category . '<br/>' . $enrolments, $OUTPUT->action_link($urlprofile, $exam->userfullname), '$' . $exam->cost, emarking_time_ago($exam->printdate), $pagestoprint); } $current++; } // If there is no data or is it not cancelled show the header, the tabs and the form. echo $OUTPUT->header(); echo $OUTPUT->heading($pagetitle . ' ' . $category->name); echo html_writer::table($examstable); // Print the table. // Display the form. $addform->display(); echo $OUTPUT->footer();
} $details .= emarking_enrolments_div($exam); $details .= html_writer::end_tag("div"); $examstatus = ""; switch ($exam->status) { case 1: $examstatus = get_string("examstatussent", "mod_emarking"); break; case 2: $examstatus = get_string("examstatusdownloaded", "mod_emarking"); break; case 3: $examstatus = get_string("examstatusprinted", "mod_emarking"); break; } $examstable->data[] = array($exam->name, date("l jS F g:ia", $exam->examdate), $details, emarking_time_ago($exam->timecreated), $examstatus, $multicourse, $actions); } echo html_writer::table($examstable); if (!has_capability("mod/emarking:downloadexam", $context)) { echo $OUTPUT->footer(); die; } $downloadurl = new moodle_url("/mod/emarking/print/download.php"); if ($CFG->emarking_usesms) { $message = get_string("smsinstructions", "mod_emarking", $USER); } else { $message = get_string("emailinstructions", "mod_emarking", $USER); } ?> <script type="text/javascript"> var messages = {
$current++; } // Feedback $feedbacks = explode('#', $draft->feedback); $feedback = ''; foreach ($feedbacks as $f) { $feedback = strlen($f) > 0 ? $f : ''; } // Last modified $timesmodified = explode('#', $draft->timemodified); $timemodified = ''; foreach ($timesmodified as $t) { $timemodified .= html_writer::start_div("timemodified"); $timemodified .= get_string('lastmodification', 'mod_emarking'); $timemodified .= " "; $timemodified .= $t > 0 ? core_text::strtolower(emarking_time_ago($t)) : ''; $timemodified .= html_writer::end_div(); } // If there's a draft show total pages if ($draft->status >= EMARKING_STATUS_SUBMITTED) { $totalpages = $emarking->totalpages > 0 ? ' / ' . $emarking->totalpages . ' ' : ' '; } // Markers pictures if ($emarking->type == EMARKING_TYPE_MARKER_TRAINING) { $markersids = explode('#', $draft->markerid); $markersstring = ''; foreach ($markersids as $mids) { foreach ($markers as $marker) { if ($mids == $marker->id) { $markersstring .= $OUTPUT->user_picture($marker) . ' '; }
$table->attributes['style'] = 'display:table;'; $table->head = array(get_string('filename', 'repository'), get_string('size'), 'Mime type', get_string('uploaded', 'hub'), get_string('status', 'mod_emarking'), get_string('actions', 'mod_emarking')); foreach ($digitizedanswersfiles as $file) { $actions = array(); $deleteurl = new moodle_url('/mod/emarking/print/uploadanswers.php', array('id' => $cm->id, 'action' => 'delete', 'did' => $file->id)); $processurl = new moodle_url('/mod/emarking/print/uploadanswers.php', array('id' => $cm->id, 'action' => 'process', 'did' => $file->id)); $changetouploadedurl = new moodle_url('/mod/emarking/print/uploadanswers.php', array('id' => $cm->id, 'action' => 'changetouploaded', 'did' => $file->id)); if (($file->status == EMARKING_DIGITIZED_ANSWER_ERROR_PROCESSING || $file->status <= EMARKING_DIGITIZED_ANSWER_UPLOADED) && $usercanmanageanswersfiles) { $actions[] = $OUTPUT->action_icon($deleteurl, new pix_icon('i/delete', 'delete', null, array('style' => 'width:1.5em;'))); } elseif ($file->status != EMARKING_DIGITIZED_ANSWER_BEING_PROCESSED && $usercanmanageanswersfiles) { $actions[] = $OUTPUT->action_icon($processurl, new pix_icon('i/reload', 'reload', null, array('style' => 'width:1.5em;'))); } elseif (($file->status == EMARKING_DIGITIZED_ANSWER_PROCESSED || $file->status == EMARKING_DIGITIZED_ANSWER_ERROR_PROCESSING) && $usercanmanageanswersfiles) { $actions[] = $OUTPUT->action_icon($changetouploadedurl, new pix_icon('i/scheduled', 'scheduled', null, array('style' => 'width:1.5em;'))); } elseif ($file->status == EMARKING_DIGITIZED_ANSWER_BEING_PROCESSED && is_siteadmin()) { $actions[] = $OUTPUT->action_icon($processurl, new pix_icon('i/reload', 'reload', null, array('style' => 'width:1.5em;'))); } $table->data[] = array($file->filename, display_size($file->filesize), $file->mimetype, emarking_time_ago($file->timecreated), emarking_get_string_for_status_digitized($file->status), implode(' ', $actions)); } echo html_writer::table($table); } // Show orphan pages button $orphanpages = emarking_get_digitized_answer_orphan_pages($context); $numorphanpages = count($orphanpages); if ($numorphanpages > 0) { $orphanpagesurl = new moodle_url('/mod/emarking/print/orphanpages.php', array('id' => $cm->id)); echo $OUTPUT->single_button($orphanpagesurl, get_string('thereareorphanpages', 'mod_emarking', $numorphanpages), 'GET'); } if (has_capability('mod/emarking:uploadexam', $context)) { $mform->display(); } echo $OUTPUT->footer();
if ($exam->printlist) { $details .= html_writer::div($OUTPUT->pix_icon("i/grades", get_string("printlist", "mod_emarking"))); } if ($exam->printrandom) { $details .= html_writer::div($OUTPUT->pix_icon("shuffle", get_string("printrandom", "mod_emarking"), "mod_emarking")); } $details .= emarking_enrolments_div($exam); $examstatus = emarking_exam_status_string($exam); $details .= $examstatus; $details .= html_writer::end_tag("div"); // The marking process course module. if (!($cm = get_coursemodule_from_instance("emarking", $exam->emarking, $course->id))) { print_error('Invalid emarking course module'); } $link = new moodle_url("/mod/emarking/view.php", array("id" => $cm->id)); $examstable->data[] = array(html_writer::link($link, $exam->name), date("d/m/y g:ia", $exam->examdate), emarking_time_ago($exam->timecreated), $details, $multicourse); } echo html_writer::table($examstable); if (!has_capability("mod/emarking:downloadexam", $context)) { echo $OUTPUT->footer(); die; } $downloadurl = new moodle_url("/mod/emarking/print/download.php"); if ($CFG->emarking_usesms) { $message = get_string("smsinstructions", "mod_emarking", $USER); } else { $message = get_string("emailinstructions", "mod_emarking", $USER); } ?> <script type="text/javascript"> var messages = {