Skip to content

Commit

Permalink
MDL-56638 assign: Don't check sesskey using submit_grading_form from WS
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyserver committed Oct 28, 2016
1 parent 577bd70 commit 1f84c2c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mod/assign/externallib.php
Expand Up @@ -1506,7 +1506,7 @@ public static function submit_grading_form_parameters() {
* @param int $userid The id of the user the submission belongs to.
* @param string $jsonformdata The data from the form, encoded as a json array.
* @return array of warnings to indicate any errors.
* @since Moodle 2.6
* @since Moodle 3.1
*/
public static function submit_grading_form($assignmentid, $userid, $jsonformdata) {
global $CFG, $USER;
Expand Down Expand Up @@ -1537,6 +1537,12 @@ public static function submit_grading_form($assignmentid, $userid, $jsonformdata
'gradingpanel' => true
);

if (WS_SERVER) {
// Assume form submission if coming from WS.
$USER->ignoresesskey = true;
$data['_qf__mod_assign_grade_form_'.$params['userid']] = 1;
}

$customdata = (object) $data;
$formparams = array($assignment, $customdata, $options);

Expand Down

0 comments on commit 1f84c2c

Please sign in to comment.