Skip to content

Commit

Permalink
MDL-33499: Display final grade on the grading form with a link to the…
Browse files Browse the repository at this point in the history
… grader report

AMOS BEGIN
 CPY [currentgrade,mod_assignment],[currentgrade,mod_assign]
AMOS END
  • Loading branch information
Damyon Wiese authored and stronk7 committed Jul 3, 2012
1 parent cf5b51a commit 8ad459e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions mod/assign/lang/en/assign.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
$string['couldnotcreatecoursemodule'] = 'Could not create course module.';
$string['couldnotcreatenewassignmentinstance'] = 'Could not create new assignment instance.';
$string['couldnotfindassignmenttoupgrade'] = 'Could not find old assignment instance to upgrade.';
$string['currentgrade'] = 'Current grade in gradebook';
$string['defaultplugins'] = 'Default assignment settings';
$string['defaultplugins_help'] = 'These settings define the defaults for all new assignments.';
$string['deletepluginareyousure'] = 'Delete assignment plugin {$a}: are you sure?';
Expand Down
10 changes: 10 additions & 0 deletions mod/assign/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2898,6 +2898,16 @@ public function add_grade_form_elements(MoodleQuickForm $mform, stdClass $data,
}
}

if (has_all_capabilities(array('gradereport/grader:view', 'moodle/grade:viewall'), $this->get_course_context())) {
$grade = $this->output->action_link(new moodle_url('/grade/report/grader/index.php',
array('id'=>$this->get_course()->id)),
$gradinginfo->items[0]->grades[$userid]->str_grade);
} else {
$grade = $gradinginfo->items[0]->grades[$userid]->str_grade;
}
$mform->addElement('static', 'finalgrade', get_string('currentgrade', 'assign').':' ,$grade);


$mform->addElement('static', 'progress', '', get_string('gradingstudentprogress', 'assign', array('index'=>$rownum+1, 'count'=>count($useridlist))));

// plugins
Expand Down

0 comments on commit 8ad459e

Please sign in to comment.