Skip to content

Commit

Permalink
Merge branch 'MDL-62366-master' of git://github.com/zig-moodle/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
David Monllao committed May 10, 2018
2 parents 4033c2a + 0139b88 commit 1f000f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions mod/assign/classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ protected static function export_grade_data(\stdClass $grade, \context $context,
'timemodified' => transform::datetime($grade->timemodified),
'grader' => transform::user($grade->grader),
'grade' => $grade->grade,
'attemptnumber' => $grade->attemptnumber
'attemptnumber' => ($grade->attemptnumber + 1)
];
writer::with_context($context)
->export_data(array_merge($currentpath, [get_string('privacy:gradepath', 'mod_assign')]), $gradedata);
Expand All @@ -395,7 +395,7 @@ protected static function export_submission_data(\stdClass $submission, \context
'timemodified' => transform::datetime($submission->timemodified),
'status' => get_string('submissionstatus_' . $submission->status, 'mod_assign'),
'groupid' => $submission->groupid,
'attemptnumber' => $submission->attemptnumber,
'attemptnumber' => ($submission->attemptnumber + 1),
'latest' => transform::yesno($submission->latest)
];
writer::with_context($context)
Expand Down
4 changes: 2 additions & 2 deletions mod/assign/tests/privacy_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ public function test_export_user_data_student() {
// Check Submissions.
$this->assertEquals($submissiontext, $writer->get_data(['attempt 1', 'Submission Text'])->text);
$this->assertEquals($submissiontext2, $writer->get_data(['attempt 2', 'Submission Text'])->text);
$this->assertEquals(0, $writer->get_data(['attempt 1', 'submission'])->attemptnumber);
$this->assertEquals(1, $writer->get_data(['attempt 2', 'submission'])->attemptnumber);
$this->assertEquals(1, $writer->get_data(['attempt 1', 'submission'])->attemptnumber);
$this->assertEquals(2, $writer->get_data(['attempt 2', 'submission'])->attemptnumber);
// Check grades.
$this->assertEquals($grade1, $writer->get_data(['attempt 1', 'grade'])->grade);
$this->assertEquals($grade2, $writer->get_data(['attempt 2', 'grade'])->grade);
Expand Down

0 comments on commit 1f000f0

Please sign in to comment.