$this->assertFalse(empty($grade_item->locked));
$this->assertFalse(empty($grade->locked)); // individual grades should be locked too
- $this->assertTrue($grade_item->set_locked(false));
+ $this->assertTrue($grade_item->set_locked(false, true));
$grade = new grade_grade($grade_item->get_final(1));
$this->assertTrue(empty($grade_item->locked));
$this->assertEqual(0, $grade_item->hidden);
$this->assertEqual(0, $grade->hidden);
- $grade_item->set_hidden(666);
+ $grade_item->set_hidden(666, true);
$grade = new grade_grade($grade_item->get_final(1));
$this->assertEqual(666, $grade_item->hidden);
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
// http://moodle.org //
// //
-// Copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com //
+// Copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
$grade_outcome = grade_outcome::fetch(array('id'=>$this->grade_outcomes[0]->id));
$this->assertEqual($this->grade_outcomes[0]->id, $grade_outcome->id);
$this->assertEqual($this->grade_outcomes[0]->shortname, $grade_outcome->shortname);
-
+ $grade_outcome->load_scale();
$this->assertEqual($this->scale[2]->id, $grade_outcome->scale->id);
}
/// Define table course_modules to be created
$table = new XMLDBTable('course_modules');
- if (!table_exists($table)) {
+ if ($result && !table_exists($table)) {
/// Adding fields to table course_modules
$table->addFieldInfo('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE, null, null, null);
$table->addFieldInfo('course', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0');
/// Define table modules to be created
$table = new XMLDBTable('modules');
- if (!table_exists($table)) {
+ if ($result && !table_exists($table)) {
/// Adding fields to table modules
$table->addFieldInfo('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE, null, null, null);
/// Define table grade_items to be created
$table = new XMLDBTable('grade_items');
- if (!table_exists($table)) {
+ if ($result && !table_exists($table)) {
$table->addFieldInfo('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE, null, null, null);
$table->addFieldInfo('courseid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, null, null, null);
$table->addFieldInfo('categoryid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, null, null, null);