Skip to content

Commit

Permalink
MDL-9137 Removed hidden field from grade_categories and added deleted…
Browse files Browse the repository at this point in the history
… field to grade_items. Also added 2 images in pix/i
  • Loading branch information
nicolasconnault committed Jun 1, 2007
1 parent 5fad506 commit ec4560c
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 15 deletions.
12 changes: 6 additions & 6 deletions lib/db/install.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="lib/db" VERSION="20070517" COMMENT="XMLDB file for core Moodle tables"
<XMLDB PATH="lib/db" VERSION="20070601" COMMENT="XMLDB file for core Moodle tables"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd"
>
Expand Down Expand Up @@ -1256,8 +1256,9 @@
<FIELD NAME="plusfactor" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" DECIMALS="5" COMMENT="Add this to all grades" PREVIOUS="multfactor" NEXT="sortorder"/>
<FIELD NAME="sortorder" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Sorting order of the columns" PREVIOUS="plusfactor" NEXT="hidden"/>
<FIELD NAME="hidden" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="1 is hidden, &amp;gt; 1 is a date to hide until (prevents viewing)" PREVIOUS="sortorder" NEXT="locked"/>
<FIELD NAME="locked" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="1 is locked, &amp;gt; 1 is a date to lock until (prevents update)" PREVIOUS="hidden" NEXT="needsupdate"/>
<FIELD NAME="needsupdate" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="If this flag is set, then the whole column will be recalculated" PREVIOUS="locked" NEXT="timecreated"/>
<FIELD NAME="locked" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="1 is locked, &amp;gt; 1 is a date to lock until (prevents update)" PREVIOUS="hidden" NEXT="deleted"/>
<FIELD NAME="deleted" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="1 means the associated module instance has been deleted" PREVIOUS="locked" NEXT="needsupdate"/>
<FIELD NAME="needsupdate" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="If this flag is set, then the whole column will be recalculated" PREVIOUS="deleted" NEXT="timecreated"/>
<FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="The first time this grade_item was created" PREVIOUS="needsupdate" NEXT="timemodified"/>
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="The last time this grade_item was modified" PREVIOUS="timecreated"/>
</FIELDS>
Expand All @@ -1279,9 +1280,8 @@
<FIELD NAME="fullname" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" COMMENT="The name of this grade category" PREVIOUS="path" NEXT="aggregation"/>
<FIELD NAME="aggregation" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="A constant pointing to one of the predefined aggregation strategies (none, mean,median,sum, etc)" PREVIOUS="fullname" NEXT="keephigh"/>
<FIELD NAME="keephigh" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Keep only the X highest items" PREVIOUS="aggregation" NEXT="droplow"/>
<FIELD NAME="droplow" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Drop the X lowest items" PREVIOUS="keephigh" NEXT="hidden"/>
<FIELD NAME="hidden" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="1 is hidden, &amp;gt; 1 is a date to hide until" PREVIOUS="droplow" NEXT="timecreated"/>
<FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" ENUM="false" PREVIOUS="hidden" NEXT="timemodified"/>
<FIELD NAME="droplow" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Drop the X lowest items" PREVIOUS="keephigh" NEXT="timecreated"/>
<FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" ENUM="false" PREVIOUS="droplow" NEXT="timemodified"/>
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" ENUM="false" PREVIOUS="timecreated"/>
</FIELDS>
<KEYS>
Expand Down
23 changes: 23 additions & 0 deletions lib/db/upgrade.php
Expand Up @@ -1302,6 +1302,29 @@ function xmldb_main_upgrade($oldversion=0) {
$result = $result && drop_field($table, $field);
}

if ($result && $oldversion < 2007052300) {
require_once($CFG->dirroot . '/question/upgrade.php');
$result = $result && question_remove_rqp_qtype();
}

if ($result && $oldversion < 2007060100) {

/// Define field hidden to be dropped from grade_categories
$table = new XMLDBTable('grade_categories');
$field = new XMLDBField('hidden');

// Launch drop field hidden
$result = $result && drop_field($table, $field);

// Define field deleted to be added to grade_items
$table = new XMLDBTable('grade_items');
$field = new XMLDBField('deleted');
$field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'locked');

// Launch add field deleted
$result = $result && add_field($table, $field);
}

return $result;
}

Expand Down
6 changes: 0 additions & 6 deletions lib/grade/grade_category.php
Expand Up @@ -99,12 +99,6 @@ class grade_category extends grade_object {
*/
var $droplow;

/**
* Date until which to hide this category. If null, 0 or false, category is not hidden.
* @var int $hidden
*/
var $hidden;

/**
* Array of grade_items or grade_categories nested exactly 1 level below this category
* @var array $children
Expand Down
4 changes: 2 additions & 2 deletions lib/grade/grade_grades_final.php
Expand Up @@ -63,13 +63,13 @@ class grade_grades_final extends grade_object {
var $gradevalue;

/**
* Date until which to hide this grade_item. If null, 0 or false, grade_item is not hidden. Hiding prevents viewing.
* Date until which to hide this grade_final. If null, 0 or false, grade_item is not hidden. Hiding prevents viewing.
* @var int $hidden
*/
var $hidden;

/**
* Date until which to lock this grade_item. If null, 0 or false, grade_item is not locked. Locking prevents updating.
* Date until which to lock this grade_final. If null, 0 or false, grade_item is not locked. Locking prevents updating.
* @var int $locked
*/
var $locked = false;
Expand Down
6 changes: 6 additions & 0 deletions lib/grade/grade_item.php
Expand Up @@ -186,6 +186,12 @@ class grade_item extends grade_object {
*/
var $locked = false;

/**
* Whether or not the module instance referred to by this grade_item has been deleted.
* @var int $deleted
*/
var $deleted;

/**
* If set, the whole column will be recalculated, then this flag will be switched off.
* @var boolean $needsupdate
Expand Down
Binary file added pix/i/lock.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pix/i/unlock.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion version.php
Expand Up @@ -6,7 +6,7 @@
// This is compared against the values stored in the database to determine
// whether upgrades should be performed (see lib/db/*.php)

$version = 2007052800; // YYYYMMDD = date
$version = 2007060100; // YYYYMMDD = date
// XY = increments within a single day

$release = '1.9 dev'; // Human-friendly version name
Expand Down

0 comments on commit ec4560c

Please sign in to comment.