This commit is contained in:
Andrew Nicols 2016-01-18 09:33:36 +08:00
commit 8d9b6ec254
2 changed files with 16 additions and 11 deletions

View File

@ -30,9 +30,10 @@ require_once($CFG->dirroot.'/grade/lib.php');
$download = optional_param('download', '', PARAM_ALPHA);
$courseid = required_param('id', PARAM_INT); // Course id.
$page = optional_param('page', 0, PARAM_INT); // Active page.
$showreport = optional_param('showreport', 0, PARAM_INT);
$PAGE->set_pagelayout('report');
$url = new moodle_url('/grade/report/history/index.php', array('id' => $courseid));
$url = new moodle_url('/grade/report/history/index.php', array('id' => $courseid, 'showreport' => 1));
$PAGE->set_url($url);
$course = $DB->get_record('course', array('id' => $courseid), '*', MUST_EXIST);
@ -105,15 +106,18 @@ if ($table->is_downloading()) {
print_grade_page_head($COURSE->id, 'report', 'history', get_string('pluginname', 'gradereport_history'), false, '');
$mform->display();
// Render table.
echo $output->render($table);
// MDL-52309: Display report after form has been submitted.
if ($showreport) {
// Render table.
echo $output->render($table);
$event = \gradereport_history\event\grade_report_viewed::create(
array(
'context' => $context,
'courseid' => $courseid
)
);
$event->trigger();
$event = \gradereport_history\event\grade_report_viewed::create(
array(
'context' => $context,
'courseid' => $courseid
)
);
$event->trigger();
}
echo $OUTPUT->footer();

View File

@ -47,7 +47,8 @@ Feature: A teacher checks the grade history report in a course
And I give the grade "70.00" to the user "Student 2" for the grade item "The greatest assignment ever"
And I give the grade "80.00" to the user "Student 2" for the grade item "Rewarding assignment"
And I press "Save changes"
When I follow "Grade history"
And I follow "Grade history"
When I press "Submit"
Then the following should exist in the "gradereport_history" table:
| First name/Surname | Grade item | Original grade | Revised grade | Grader |
| Student 1 | The greatest assignment ever | | 50.00 | Teacher 1 |