Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-44701 gradereport_grader: Display warning on navigation if unsave…

…d grades are present
  • Loading branch information...
commit ca27069762b2d0fa766bd3124e1b80fe41248dd3 1 parent c2066a0
@aolley aolley authored
Showing with 10 additions and 1 deletion.
  1. +1 −1  grade/report/grader/index.php
  2. +9 −0 grade/report/grader/lib.php
View
2  grade/report/grader/index.php
@@ -156,7 +156,7 @@
// print submit button
if ($USER->gradeediting[$course->id] && ($report->get_pref('showquickfeedback') || $report->get_pref('quickgrading'))) {
- echo '<form action="index.php" enctype="application/x-www-form-urlencoded" method="post">'; // Enforce compatibility with our max_input_vars hack.
+ echo '<form action="index.php" enctype="application/x-www-form-urlencoded" method="post" id="gradereport_grader">'; // Enforce compatibility with our max_input_vars hack.
echo '<div>';
echo '<input type="hidden" value="'.s($courseid).'" name="id" />';
echo '<input type="hidden" value="'.sesskey().'" name="sesskey" />';
View
9 grade/report/grader/lib.php
@@ -1136,6 +1136,15 @@ public function get_right_rows() {
$PAGE->requires->js_init_call('M.gradereport_grader.init_report', $jsarguments, false, $module);
$PAGE->requires->strings_for_js(array('addfeedback','feedback', 'grade'), 'grades');
$PAGE->requires->strings_for_js(array('ajaxchoosescale','ajaxclicktoclose','ajaxerror','ajaxfailedupdate', 'ajaxfieldchanged'), 'gradereport_grader');
+ if (!$this->get_pref('enableajax') && $USER->gradeediting[$this->courseid]) {
+ $PAGE->requires->yui_module('moodle-core-formchangechecker',
+ 'M.core_formchangechecker.init',
+ array(array(
+ 'formid' => 'gradereport_grader'
+ ))
+ );
+ $PAGE->requires->string_for_js('changesmadereallygoaway', 'moodle');
+ }
$rows = $this->get_right_range_row($rows);
$rows = $this->get_right_avg_row($rows, true);
Please sign in to comment.
Something went wrong with that request. Please try again.