Grade Items Table Schema (grade_items)


This table keeps information about gradeable items (ie columns). If an activity (eg an assignment or quiz) has multiple grade_items associated with it (eg several outcomes or numerical grades), then there will be a corresponding multiple number of rows in this table.

grade_items table columns

Column Type Size Nulls Auto Default Children Parents Comments
id bigint 10 null
grade_grades.itemid gradgrad_ite2_fk R
grade_grades_history.itemid gradgradhist_ite2_fk R
grade_import_values.itemid gradimpovalu_ite2_fk R
grade_items_history.oldid graditemhist_old2_fk R
courseid bigint 10 null graditem_cou2_fk R

The course this item is part of

categoryid bigint 10 null graditem_cat2_fk R

(optional) the category group this item belongs to

itemname varchar 255 null

The name of this item (pushed in by the module)

itemtype varchar 30

'mod', 'blocks', 'import', 'calculated' etc

itemmodule varchar 30 null

'forum', 'quiz', 'csv', etc

iteminstance bigint 10 null

id of the item module

itemnumber bigint 10 null

Can be used to distinguish multiple grades for an activity

iteminfo longtext 2147483647 null

Info and notes about this item XXX

idnumber varchar 255 null

Arbitrary idnumber provided by the module responsible

calculation longtext 2147483647 null

Formula describing how to derive this grade from other items, referring to them using giXXX where XXX is grade item id ... eg something like: =sin(square(#gi20#)) + #gi30#

gradetype smallint 4 1

0 = none, 1 = value, 2 = scale, 3 = text

grademax decimal 10 100.00000

What is the maximum allowable grade?

grademin decimal 10 0.00000

What is the minimum allowable grade?

scaleid bigint 10 null graditem_sca2_fk R

If this grade is based on a scale, which one is it?

outcomeid bigint 10 null graditem_out2_fk R

If this grade is related to an outcome, which one is it?

gradepass decimal 10 0.00000

What grade is needed to pass? grademin < gradepass <= grademax

multfactor decimal 10 1.00000

Multiply all grades by this

plusfactor decimal 10 0.00000

Add this to all grades

aggregationcoef decimal 10 0.00000

Aggregation coefficient used for category weights or other aggregation types

aggregationcoef2 decimal 10 0.00000

Aggregation coefficient used for weights in aggregation types with both extra credit and weight

sortorder bigint 10 0

Sorting order of the columns

display bigint 10 0

Display as real grades, percentages (in reference to the minimum and maximum grades) or letters (A, B, C etc..), or course default (0)

decimals BIT 1 null

Also known as precision, the number of digits after the decimal point symbol.

hidden bigint 10 0

1 is hidden, > 1 is a date to hide until (prevents viewing)

locked bigint 10 0

1 is locked, > 1 is a date to lock until (prevents update)

locktime bigint 10 0

lock all final grades after this date

needsupdate bigint 10 0

If this flag is set, then the whole column will be recalculated

weightoverride BIT 1 0
timecreated bigint 10 null

The first time this grade_item was created

timemodified bigint 10 null

The last time this grade_item was modified

Table contained -1 rows

grade_items table indexes

Constraint Name Type Sort Column(s)
PRIMARY Primary key Asc id
graditem_cat_ix Performance Asc categoryid
graditem_cou_ix Performance Asc courseid
graditem_gra_ix Performance Asc gradetype
graditem_idncou_ix Performance Asc/Asc idnumber + courseid
graditem_itenee_ix Performance Asc/Asc itemtype + needsupdate
graditem_locloc_ix Performance Asc/Asc locked + locktime
graditem_out_ix Performance Asc outcomeid
graditem_sca_ix Performance Asc scaleid

grade_items table relationships