From fe465d1d5bd2f470bdf310d9bcc31f18fcf23432 Mon Sep 17 00:00:00 2001 From: Mark Nielsen Date: Tue, 26 Aug 2014 09:10:34 -0700 Subject: [PATCH] MDL-46451 mod_lti: Fix restoring old float grades LTI's activity table used to have a float field for the grade. Now it is an integer so we must restore the grade as an integer so it matches the table schema. --- mod/lti/backup/moodle2/restore_lti_stepslib.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mod/lti/backup/moodle2/restore_lti_stepslib.php b/mod/lti/backup/moodle2/restore_lti_stepslib.php index eef676be87f..c8fd8554902 100644 --- a/mod/lti/backup/moodle2/restore_lti_stepslib.php +++ b/mod/lti/backup/moodle2/restore_lti_stepslib.php @@ -74,6 +74,9 @@ class restore_lti_activity_structure_step extends restore_activity_structure_ste $data->course = $this->get_courseid(); $data->servicesalt = uniqid('', true); + // Grade used to be a float (whole numbers only), restore as int. + $data->grade = (int) $data->grade; + // Clean any course or site typeid. All modules // are restored as self-contained. Note this is // an interim solution until the issue below is implemented.