diff --git a/grade/grading/form/rubric/backup/moodle2/backup_gradingform_rubric_plugin.class.php b/grade/grading/form/rubric/backup/moodle2/backup_gradingform_rubric_plugin.class.php
index 945d6f82f43..78741ec2a57 100644
--- a/grade/grading/form/rubric/backup/moodle2/backup_gradingform_rubric_plugin.class.php
+++ b/grade/grading/form/rubric/backup/moodle2/backup_gradingform_rubric_plugin.class.php
@@ -107,7 +107,7 @@ class backup_gradingform_rubric_plugin extends backup_gradingform_plugin {
// Set sources to populate the data
$filling->set_source_table('gradingform_rubric_fillings',
- array('forminstanceid' => backup::VAR_PARENTID));
+ array('instanceid' => backup::VAR_PARENTID));
// no need to annotate ids or files yet (one day when remark field supports
// embedded fileds, they must be annotated here)
diff --git a/grade/grading/form/rubric/backup/moodle2/restore_gradingform_rubric_plugin.class.php b/grade/grading/form/rubric/backup/moodle2/restore_gradingform_rubric_plugin.class.php
index 643607e38d1..62b5c96d9da 100644
--- a/grade/grading/form/rubric/backup/moodle2/restore_gradingform_rubric_plugin.class.php
+++ b/grade/grading/form/rubric/backup/moodle2/restore_gradingform_rubric_plugin.class.php
@@ -105,7 +105,7 @@ class restore_gradingform_rubric_plugin extends restore_gradingform_plugin {
global $DB;
$data = (object)$data;
- $data->forminstanceid = $this->get_new_parentid('grading_instance');
+ $data->instanceid = $this->get_new_parentid('grading_instance');
$data->criterionid = $this->get_mappingid('gradingform_rubric_criterion', $data->criterionid);
$data->levelid = $this->get_mappingid('gradingform_rubric_level', $data->levelid);
diff --git a/grade/grading/form/rubric/db/install.xml b/grade/grading/form/rubric/db/install.xml
index 09edf0e04f0..01ea46e3971 100644
--- a/grade/grading/form/rubric/db/install.xml
+++ b/grade/grading/form/rubric/db/install.xml
@@ -32,18 +32,18 @@
-
-
-
+
+
+
-
-
-
-
+
+
+
+
diff --git a/grade/grading/form/rubric/lib.php b/grade/grading/form/rubric/lib.php
index 509894db507..ec43cac09e7 100644
--- a/grade/grading/form/rubric/lib.php
+++ b/grade/grading/form/rubric/lib.php
@@ -472,7 +472,7 @@ class gradingform_rubric_controller extends gradingform_controller {
// get the list of instances
$instances = array_keys($DB->get_records('grading_instances', array('definitionid' => $this->definition->id), '', 'id'));
// delete all fillings
- $DB->delete_records_list('gradingform_rubric_fillings', 'forminstanceid', $instances);
+ $DB->delete_records_list('gradingform_rubric_fillings', 'instanceid', $instances);
// delete instances
$DB->delete_records_list('grading_instances', 'id', $instances);
// get the list of criteria records
@@ -585,7 +585,7 @@ class gradingform_rubric_instance extends gradingform_instance {
public function cancel() {
global $DB;
parent::cancel();
- $DB->delete_records('gradingform_rubric_fillings', array('forminstanceid' => $this->get_id()));
+ $DB->delete_records('gradingform_rubric_fillings', array('instanceid' => $this->get_id()));
}
/**
@@ -601,7 +601,7 @@ class gradingform_rubric_instance extends gradingform_instance {
$instanceid = parent::copy($raterid, $itemid);
$currentgrade = $this->get_rubric_filling();
foreach ($currentgrade['criteria'] as $criterionid => $record) {
- $params = array('forminstanceid' => $instanceid, 'criterionid' => $criterionid,
+ $params = array('instanceid' => $instanceid, 'criterionid' => $criterionid,
'levelid' => $record['levelid'], 'remark' => $record['remark'], 'remarkformat' => $record['remarkformat']);
$DB->insert_record('gradingform_rubric_fillings', $params);
}
@@ -635,7 +635,7 @@ class gradingform_rubric_instance extends gradingform_instance {
public function get_rubric_filling($force = false) {
global $DB;
if ($this->rubric === null || $force) {
- $records = $DB->get_records('gradingform_rubric_fillings', array('forminstanceid' => $this->get_id()));
+ $records = $DB->get_records('gradingform_rubric_fillings', array('instanceid' => $this->get_id()));
$this->rubric = array('criteria' => array());
foreach ($records as $record) {
$this->rubric['criteria'][$record->criterionid] = (array)$record;
@@ -657,7 +657,7 @@ class gradingform_rubric_instance extends gradingform_instance {
parent::update($data);
foreach ($data['criteria'] as $criterionid => $record) {
if (!array_key_exists($criterionid, $currentgrade['criteria'])) {
- $newrecord = array('forminstanceid' => $this->get_id(), 'criterionid' => $criterionid,
+ $newrecord = array('instanceid' => $this->get_id(), 'criterionid' => $criterionid,
'levelid' => $record['levelid'], 'remarkformat' => FORMAT_MOODLE);
if (isset($record['remark'])) {
$newrecord['remark'] = $record['remark'];