Merge branch 'MDL-72377-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE

This commit is contained in:
Jake Dallimore
2022-06-10 13:17:00 +02:00
committed by Sara Arjona
8 changed files with 34 additions and 11 deletions
+7 -2
View File
@@ -229,7 +229,7 @@ class edit_category_form extends moodleform {
$mform->addElement('checkbox', 'grade_item_hidden', get_string('hidden', 'grades'));
$mform->addHelpButton('grade_item_hidden', 'hidden', 'grades');
$mform->addElement('date_time_selector', 'grade_item_hiddenuntil', get_string('hiddenuntil', 'grades'), array('optional'=>true));
$mform->disabledIf('grade_item_hidden', 'grade_item_hiddenuntil[off]', 'notchecked');
$mform->disabledIf('grade_item_hidden', 'grade_item_hiddenuntil[enabled]', 'checked');
/// locking
$mform->addElement('checkbox', 'grade_item_locked', get_string('locked', 'grades'));
@@ -440,7 +440,12 @@ class edit_category_form extends moodleform {
$grade_category = grade_category::fetch(array('id'=>$id));
$grade_item = $grade_category->load_grade_item();
$mform->setDefault('grade_item_hidden', (int) $grade_item->hidden);
// Load appropriate "hidden"/"hidden until" defaults.
if ($grade_item->is_hiddenuntil()) {
$mform->setDefault('grade_item_hiddenuntil', $grade_item->get_hidden());
} else {
$mform->setDefault('grade_item_hidden', $grade_item->get_hidden());
}
if ($grade_item->is_outcome_item()) {
// we have to prevent incompatible modifications of outcomes if outcomes disabled
+1 -1
View File
@@ -93,7 +93,7 @@ class edit_grade_form extends moodleform {
$mform->addElement('checkbox', 'hidden', get_string('hidden', 'grades'));
$mform->addHelpButton('hidden', 'hidden', 'grades');
$mform->addElement('date_time_selector', 'hiddenuntil', get_string('hiddenuntil', 'grades'), array('optional'=>true));
$mform->disabledIf('hidden', 'hiddenuntil[off]', 'notchecked');
$mform->disabledIf('hidden', 'hiddenuntil[enabled]', 'checked');
/// locking
$mform->addElement('advcheckbox', 'locked', get_string('locked', 'grades'));
+1 -1
View File
@@ -78,7 +78,7 @@ class edit_outcomeitem_form extends moodleform {
$mform->addElement('checkbox', 'hidden', get_string('hidden', 'grades'));
$mform->addHelpButton('hidden', 'hidden', 'grades');
$mform->addElement('date_time_selector', 'hiddenuntil', get_string('hiddenuntil', 'grades'), array('optional'=>true));
$mform->disabledIf('hidden', 'hiddenuntil[off]', 'notchecked');
$mform->disabledIf('hidden', 'hiddenuntil[enabled]', 'checked');
//locking
$mform->addElement('advcheckbox', 'locked', get_string('locked', 'grades'));
+1 -2
View File
@@ -69,7 +69,6 @@ class create_gradecategories_test extends \externallib_advanced_testcase {
// Check the path is correct.
$this->assertEquals('/' . implode('/', [$courseparentcat->id, $record1->id, $record2->id]) . '/', $record2->path);
/* MDL-72377 commenting broken test.
// Now create a category with some customised data and check the returns. This customises every value.
$customopts = [
'aggregation' => GRADE_AGGREGATE_MEAN,
@@ -118,7 +117,7 @@ class create_gradecategories_test extends \externallib_advanced_testcase {
$this->assertEquals(1, $cat3->grade_item->weightoverride);
// Coefficient is converted to percentage.
$this->assertEquals(0.2, $cat3->grade_item->aggregationcoef2);
$this->assertEquals($record2->id, $cat3->parent);*/
$this->assertEquals($record2->id, $cat3->parent);
// Now test creating 2 in parallel, and nesting them.
$status4 = create_gradecategories::execute($course->id, [
+2 -2
View File
@@ -1863,7 +1863,7 @@
<FIELD NAME="aggregateoutcomes" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Aggregate outcomes"/>
<FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="hidden" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="hidden" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
@@ -2003,7 +2003,7 @@
<FIELD NAME="aggregateonlygraded" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="aggregate only graded items"/>
<FIELD NAME="aggregateoutcomes" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Aggregate outcomes"/>
<FIELD NAME="aggregatesubcats" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="This setting was removed from grade_categories. It is kept here only to preserve history."/>
<FIELD NAME="hidden" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="hidden" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
+20
View File
@@ -2700,5 +2700,25 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2021051706.12);
}
if ($oldversion < 2021051707.05) {
// Changing precision of field hidden on table grade_categories to (10).
$table = new xmldb_table('grade_categories');
$field = new xmldb_field('hidden', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0', 'timemodified');
// Launch change of precision for field hidden.
$dbman->change_field_precision($table, $field);
// Changing precision of field hidden on table grade_categories_history to (10).
$table = new xmldb_table('grade_categories_history');
$field = new xmldb_field('hidden', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0', 'aggregatesubcats');
// Launch change of precision for field hidden.
$dbman->change_field_precision($table, $field);
// Main savepoint reached.
upgrade_main_savepoint(true, 2021051707.05);
}
return true;
}
+1 -2
View File
@@ -563,7 +563,6 @@ class core_grades_external_testcase extends externallib_advanced_testcase {
// Check the path is correct.
$this->assertEquals('/' . implode('/', [$courseparentcat->id, $record1->id, $record2->id]) . '/', $record2->path);
/* MDL-72377 commenting broken test.
// Now create a category with some customised data and check the returns. This customises every value.
$customopts = [
'aggregation' => GRADE_AGGREGATE_MEAN,
@@ -610,7 +609,7 @@ class core_grades_external_testcase extends externallib_advanced_testcase {
$this->assertEquals(1, $cat3->grade_item->weightoverride);
// Coefficient is converted to percentage.
$this->assertEquals(0.2, $cat3->grade_item->aggregationcoef2);
$this->assertEquals($record2->id, $cat3->parent);*/
$this->assertEquals($record2->id, $cat3->parent);
}
}
+1 -1
View File
@@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
$version = 2021051707.04; // 20210517 = branching date YYYYMMDD - do not modify!
$version = 2021051707.05; // 20210517 = branching date YYYYMMDD - do not modify!
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.
$release = '3.11.7+ (Build: 20220603)';// Human-friendly version name