* @param object $submission The submission object or NULL in which case it will be loaded
*/
function view_feedback($submission=NULL) {
- global $USER, $CFG, $DB;
+ global $USER, $CFG, $DB, $OUTPUT;
require_once($CFG->libdir.'/gradelib.php');
if (!has_capability('mod/assignment:submit', $this->context, $USER->id, false)) {
}
/// Print the feedback
- print_heading(get_string('feedbackfromteacher', 'assignment', fullname($teacher)));
+ echo $OUTPUT->heading(get_string('feedbackfromteacher', 'assignment', fullname($teacher)));
echo '<table cellspacing="0" class="feedback">';
///3) Save and Skip to the next one on the popup
//make user global so we can use the id
- global $USER;
+ global $USER, $OUTPUT;
$mailinfo = optional_param('mailinfo', null, PARAM_BOOL);
if (is_null($mailinfo)) {
if ($submission = $this->process_feedback()) {
//IE needs proper header with encoding
print_header(get_string('feedback', 'assignment').':'.format_string($this->assignment->name));
- print_heading(get_string('changessaved'));
+ echo $OUTPUT->heading(get_string('changessaved'));
print $this->update_main_listing($submission);
}
close_window();
* @return bool|void
*/
function display_submissions($message='') {
- global $CFG, $DB, $USER, $DB;
+ global $CFG, $DB, $USER, $DB, $OUTPUT;
require_once($CFG->libdir.'/gradelib.php');
/* first we check to see if the form has just been submitted
$table->setup();
if (empty($users)) {
- print_heading(get_string('nosubmitusers','assignment'));
+ echo $OUTPUT->heading(get_string('nosubmitusers','assignment'));
return true;
}
}
function view() {
- global $USER;
+ global $USER, $OUTPUT;
require_capability('mod/assignment:view', $this->context);
$this->view_feedback();
if (!$this->drafts_tracked() or !$this->isopen() or $this->is_finalized($submission)) {
- print_heading(get_string('submission', 'assignment'), '', 3);
+ echo $OUTPUT->heading(get_string('submission', 'assignment'), 3);
} else {
- print_heading(get_string('submissiondraft', 'assignment'), '', 3);
+ echo $OUTPUT->heading(get_string('submissiondraft', 'assignment'), 3);
}
if ($filecount and $submission) {
$this->view_upload_form();
if ($this->notes_allowed()) {
- print_heading(get_string('notes', 'assignment'), '', 3);
+ echo $OUTPUT->heading(get_string('notes', 'assignment'), 3);
$this->view_notes();
}
function view_feedback($submission=NULL) {
- global $USER, $CFG, $DB;
+ global $USER, $CFG, $DB, $OUTPUT;
require_once($CFG->libdir.'/gradelib.php');
if (!$submission) { /// Get submission for this assignment
if (empty($submission->timemarked)) { /// Nothing to show, so print nothing
if ($this->count_responsefiles($USER->id)) {
- print_heading(get_string('responsefiles', 'assignment'), '', 3);
+ echo $OUTPUT->heading(get_string('responsefiles', 'assignment'), 3);
$responsefiles = $this->print_responsefiles($USER->id, true);
print_simple_box($responsefiles, 'center');
}
}
/// Print the feedback
- print_heading(get_string('submissionfeedback', 'assignment'), '', 3);
+ echo $OUTPUT->heading(get_string('submissionfeedback', 'assignment'), 3);
echo '<table cellspacing="0" class="feedback">';
}
function view_final_submission() {
- global $CFG, $USER;
+ global $CFG, $USER, $OUTPUT;
$submission = $this->get_submission($USER->id);
if ($this->isopen() and $this->can_finalize($submission)) {
//print final submit button
- print_heading(get_string('submitformarking','assignment'), '', 3);
+ echo $OUTPUT->heading(get_string('submitformarking','assignment'), 3);
echo '<div style="text-align:center">';
echo '<form method="post" action="upload.php">';
echo '<fieldset class="invisiblefieldset">';
echo '</form>';
echo '</div>';
} else if (!$this->isopen()) {
- print_heading(get_string('nomoresubmissions','assignment'), '', 3);
+ echo $OUTPUT->heading(get_string('nomoresubmissions','assignment'), 3);
} else if ($this->drafts_tracked() and $state = $this->is_finalized($submission)) {
if ($state == ASSIGNMENT_STATUS_SUBMITTED) {
- print_heading(get_string('submitedformarking','assignment'), '', 3);
+ echo $OUTPUT->heading(get_string('submitedformarking','assignment'), 3);
} else {
- print_heading(get_string('nomoresubmissions','assignment'), '', 3);
+ echo $OUTPUT->heading(get_string('nomoresubmissions','assignment'), 3);
}
} else {
//no submission yet
}
function upload_notes() {
- global $CFG, $USER;
+ global $CFG, $USER, $OUTPUT;
$action = required_param('action', PARAM_ALPHA);
/// show notes edit form
$this->view_header(get_string('notes', 'assignment'));
- print_heading(get_string('notes', 'assignment'), '');
+ echo $OUTPUT->heading(get_string('notes', 'assignment'));
$mform->display();
}
function finalize() {
- global $USER, $DB;
+ global $USER, $DB, $OUTPUT;
$confirm = optional_param('confirm', 0, PARAM_BOOL);
$returnurl = 'view.php?id='.$this->cm->id;
$optionsno = array('id'=>$this->cm->id);
$optionsyes = array ('id'=>$this->cm->id, 'confirm'=>1, 'action'=>'finalize');
$this->view_header(get_string('submitformarking', 'assignment'));
- print_heading(get_string('submitformarking', 'assignment'));
+ echo $OUTPUT->heading(get_string('submitformarking', 'assignment'));
notice_yesno(get_string('onceassignmentsent', 'assignment'), 'upload.php', 'view.php', $optionsyes, $optionsno, 'post', 'get');
$this->view_footer();
die;
function delete_responsefile() {
- global $CFG;
+ global $CFG, $OUTPUT;
$file = required_param('file', PARAM_FILE);
$userid = required_param('userid', PARAM_INT);
if (!data_submitted() or !$confirm) {
$optionsyes = array ('id'=>$this->cm->id, 'file'=>$file, 'userid'=>$userid, 'confirm'=>1, 'action'=>'response', 'mode'=>$mode, 'offset'=>$offset);
print_header(get_string('delete'));
- print_heading(get_string('delete'));
+ echo $OUTPUT->heading(get_string('delete'));
notice_yesno(get_string('confirmdeletefile', 'assignment', $file), 'delete.php', $urlreturn, $optionsyes, $optionsreturn, 'post', 'get');
print_footer('none');
die;
function delete_file() {
- global $CFG, $DB;
+ global $CFG, $DB, $OUTPUT;
$file = required_param('file', PARAM_FILE);
$userid = required_param('userid', PARAM_INT);
} else {
print_header(get_string('delete'));
}
- print_heading(get_string('delete'));
+ echo $OUTPUT->heading(get_string('delete'));
notice_yesno(get_string('confirmdeletefile', 'assignment', $file), 'delete.php', $urlreturn, $optionsyes, $optionsreturn, 'post', 'get');
if (empty($mode)) {
$this->view_footer();