<FIELDNAME="defaultgroupingid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="default grouping used in course modules, does not have key intentionally"PREVIOUS="groupmodeforce"NEXT="lang"/>
<FIELDNAME="defaultrole"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="The default role given to participants who self-enrol"PREVIOUS="enrol"NEXT="enablecompletion"/>
<FIELDNAME="enablecompletion"TYPE="int"LENGTH="1"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="1 = allow use of 'completion' progress-tracking on this course. 0 = disable completion tracking on this course."PREVIOUS="defaultrole"/>
<KEYNAME="parent"TYPE="foreign"FIELDS="parent"REFTABLE="course_categories"REFFIELDS="id"COMMENT="note that to make this recursive FK working someday, the parent field must be declared NULL"PREVIOUS="primary"/>
<FIELDNAME="groupmembersonly"TYPE="int"LENGTH="4"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="only members of any group are allowed to access the activity"PREVIOUS="groupingid"NEXT="completion"/>
<FIELDNAME="completion"TYPE="int"LENGTH="1"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="Whether the completion-tracking facilities are enabled for this activity. 0 = not enabled (database default) 1 = manual tracking, user can tick this activity off (UI default for most activity types) 2 = automatic tracking, system should mark completion according to rules specified in course_moduleS_completion"PREVIOUS="groupmembersonly"NEXT="completiongradeitemnumber"/>
<FIELDNAME="completiongradeitemnumber"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="Grade-item number used to track automatic completion, if applicable."PREVIOUS="completion"NEXT="completionview"/>
<FIELDNAME="completionview"TYPE="int"LENGTH="1"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="Controls whether a page view is part of the automatic completion requirements for this activity. 0 = view not required 1 = view required"PREVIOUS="completiongradeitemnumber"NEXT="completionexpected"/>
<FIELDNAME="completionexpected"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="Date at which students are expected to complete this activity. This field is used when displaying student progress."PREVIOUS="completionview"NEXT="availablefrom"/>
<FIELDNAME="availablefrom"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="If set non-zero, the activity only becomes available from the time given here."PREVIOUS="completionexpected"NEXT="availableuntil"/>
<FIELDNAME="availableuntil"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="If set non-zero, the activity is only available until the time given here."PREVIOUS="availablefrom"NEXT="showavailability"/>
<FIELDNAME="showavailability"TYPE="int"LENGTH="1"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="If this field is set to 1 and the activity is not available because the 'availablefrom' date has not been reached, or one of the conditions in course_modules_availability is not matched, then the item will be displayed greyed-out (unclickable) with an information message such as 'Available from (date)'. Otherwise, the item will not be displayed to students at all."PREVIOUS="availableuntil"/>
<INDEXNAME="idnumber-course"UNIQUE="false"FIELDS="idnumber, course"COMMENT="non unique index (although programatically we are guarantying some sort of uniqueness both under this table and the grade_items one). TODO: We need a central store of module idnumbers in the future."PREVIOUS="instance"/>
<TABLENAME="course_modules_availability"COMMENT="Table stores conditions that affect whether a module/activity is currently available to students or not."PREVIOUS="course_modules"NEXT="course_modules_completion">
<FIELDNAME="coursemoduleid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="ID of the module whose availability is being restricted by this condition."PREVIOUS="id"NEXT="sourcecmid"/>
<FIELDNAME="sourcecmid"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="If this condition is based on completion of another activity, then this is the course-module ID of that activity. Otherwise null."PREVIOUS="coursemoduleid"NEXT="requiredcompletion"/>
<FIELDNAME="requiredcompletion"TYPE="int"LENGTH="1"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="If this condition is on a module's completion, then this should be set to the required completion state. Otherwise null. Suitable values are 1 = completed, 2 = completed-passed, 3 = completed-failed."PREVIOUS="sourcecmid"NEXT="gradeitemid"/>
<FIELDNAME="gradeitemid"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="If this condition is based on a gradebook score, the item ID is given here (and the item will now not be available until a value is achieved for that grade). Otherwise null."PREVIOUS="requiredcompletion"NEXT="grademin"/>
<FIELDNAME="grademin"TYPE="number"LENGTH="10"NOTNULL="false"UNSIGNED="false"SEQUENCE="false"DECIMALS="5"COMMENT="If set, this is the minimum grade percentage that must be reached (greater than or equal) in order for this module to appear. Otherwise null."PREVIOUS="gradeitemid"NEXT="grademax"/>
<FIELDNAME="grademax"TYPE="number"LENGTH="10"NOTNULL="false"UNSIGNED="false"SEQUENCE="false"DECIMALS="5"COMMENT="If set, this is the maximum grade percentage that users must be below (less than) in order to display this item. Otherwise null."PREVIOUS="grademin"/>
<TABLENAME="course_modules_completion"COMMENT="Stores the completion state (completed or not completed, etc) of each user on each activity."PREVIOUS="course_modules_availability"NEXT="course_sections">
<FIELDNAME="coursemoduleid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="Activity that has been completed (or not)."PREVIOUS="id"NEXT="userid"/>
<FIELDNAME="userid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="ID of user who has (or hasn't) completed the activity."PREVIOUS="coursemoduleid"NEXT="completionstate"/>
<FIELDNAME="completionstate"TYPE="int"LENGTH="1"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="Whether or not the user has completed the activity. Available states: 0 = not completed [if there's no row in this table, that also counts as 0] 1 = completed 2 = completed, show passed 3 = completed, show failed"PREVIOUS="userid"NEXT="viewed"/>
<FIELDNAME="viewed"TYPE="int"LENGTH="1"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="Tracks whether or not this activity has been viewed. NULL = we are not tracking viewed for this activity 0 = not viewed 1 = viewed"PREVIOUS="completionstate"NEXT="timemodified"/>
<FIELDNAME="timemodified"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="Time at which the completion state last changed."PREVIOUS="viewed"/>
<INDEXNAME="coursemoduleid"UNIQUE="false"FIELDS="coursemoduleid"COMMENT="For quick access via course-module (e.g. when displaying course module settings page and we need to determine whether anyone has completed it)."NEXT="userid"/>
<INDEXNAME="userid"UNIQUE="false"FIELDS="userid"COMMENT="Index on user ID. Used when obtaining completion information for normal course page view."PREVIOUS="coursemoduleid"/>
</INDEXES>
</TABLE>
<TABLENAME="course_sections"COMMENT="to define the sections for each course"PREVIOUS="course_modules_completion"NEXT="course_request">
<TABLENAME="filter_active"COMMENT="Stores information about which filters are active in which contexts. Also the filter sort order. See get_active_filters in lib/filterlib.php for how this data is used."PREVIOUS="course_allowed_modules"NEXT="filter_config">
<FIELDNAME="filter"TYPE="char"LENGTH="32"NOTNULL="true"SEQUENCE="false"COMMENT="The filter internal name, like 'filter/tex' or 'mod/glossary'."PREVIOUS="id"NEXT="contextid"/>
<FIELDNAME="active"TYPE="int"LENGTH="4"NOTNULL="true"UNSIGNED="false"SEQUENCE="false"COMMENT="Whether this filter is active in this context. +1 = On, -1 = Off, no row with this contextid = inherit. As a special case, when contextid points to the system context, -9999 means this filter is completely disabled."PREVIOUS="contextid"NEXT="sortorder"/>
<FIELDNAME="sortorder"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"COMMENT="Only relevant if contextid points to the system context. In other cases this field should contain 0. The order in which the filters should be applied."PREVIOUS="active"/>
<FIELDNAME="filter"TYPE="char"LENGTH="32"NOTNULL="true"SEQUENCE="false"COMMENT="The filter internal name, like 'filter/tex' or 'mod/glossary'."PREVIOUS="id"NEXT="contextid"/>
<FIELDNAME="exectime"TYPE="number"LENGTH="10"NOTNULL="true"UNSIGNED="false"SEQUENCE="false"DECIMALS="5"COMMENT="query execution time in seconds as float"PREVIOUS="backtrace"NEXT="timelogged"/>
<FIELDNAME="timelogged"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="timestamp when log info stored into db"PREVIOUS="exectime"/>
</FIELDS>
<KEYS>
<KEYNAME="primary"TYPE="primary"FIELDS="id"/>
</KEYS>
</TABLE>
<TABLENAME="log_display"COMMENT="For a particular module/action, specifies a moodle table/field"PREVIOUS="log_queries"NEXT="message">
<FIELDNAME="fullmessageformat"TYPE="int"LENGTH="4"NOTNULL="false"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="The format of the full message"PREVIOUS="fullmessage"NEXT="fullmessagehtml"/>
<FIELDNAME="fullmessagehtml"TYPE="text"LENGTH="medium"NOTNULL="false"SEQUENCE="false"COMMENT="html format of message"PREVIOUS="fullmessageformat"NEXT="smallmessage"/>
<FIELDNAME="smallmessage"TYPE="text"LENGTH="small"NOTNULL="false"SEQUENCE="false"COMMENT="Smal version of message (eg sms)"PREVIOUS="fullmessagehtml"NEXT="timecreated"/>
<FIELDNAME="fullmessageformat"TYPE="int"LENGTH="4"NOTNULL="false"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="The format of the full message"PREVIOUS="fullmessage"NEXT="fullmessagehtml"/>
<FIELDNAME="fullmessagehtml"TYPE="text"LENGTH="medium"NOTNULL="false"SEQUENCE="false"COMMENT="html format of message"PREVIOUS="fullmessageformat"NEXT="smallmessage"/>
<FIELDNAME="smallmessage"TYPE="text"LENGTH="small"NOTNULL="false"SEQUENCE="false"COMMENT="Smal version of message (eg sms)"PREVIOUS="fullmessagehtml"NEXT="timecreated"/>
<FIELDNAME="state"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="0 means normal session"PREVIOUS="id"NEXT="sid"/>
<FIELDNAME="imagealt"TYPE="char"LENGTH="255"NOTNULL="false"SEQUENCE="false"COMMENT="alt tag for user uploaded image"PREVIOUS="trustbitmask"NEXT="screenreader"/>
<FIELDNAME="screenreader"TYPE="int"LENGTH="1"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"COMMENT="flag for determining whehter the user uses a screenreader."PREVIOUS="imagealt"/>
<TABLENAME="user_lastaccess"COMMENT="To keep track of course page access times, used in online participants block, and participants list"PREVIOUS="user_preferences"NEXT="scale">
<FIELDNAME="source"TYPE="char"LENGTH="255"NOTNULL="false"SEQUENCE="false"COMMENT="What caused the modification? manual/module/import/..."PREVIOUS="oldid"NEXT="timemodified"/>
<FIELDNAME="timemodified"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="The last time this grade_item was modified"PREVIOUS="source"NEXT="loggeduser"/>
<FIELDNAME="loggeduser"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="the userid of the person who last modified this outcome"PREVIOUS="timemodified"NEXT="courseid"/>
<FIELDNAME="roleid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="id of role for the aggregates"PREVIOUS="timeend"NEXT="stattype"/>
<FIELDNAME="stattype"TYPE="char"LENGTH="20"NOTNULL="true"DEFAULT="activity"SEQUENCE="false"COMMENT="type of stat"PREVIOUS="roleid"NEXT="stat1"/>
<FIELDNAME="stat1"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="stat1. usually used for reads"PREVIOUS="stattype"NEXT="stat2"/>
<FIELDNAME="stat2"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="stat2. usually used for writes."PREVIOUS="stat1"/>
<FIELDNAME="roleid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="id of role for the aggregates"PREVIOUS="timeend"NEXT="stattype"/>
<FIELDNAME="stattype"TYPE="char"LENGTH="20"NOTNULL="true"DEFAULT="activity"SEQUENCE="false"COMMENT="type of stat"PREVIOUS="roleid"NEXT="stat1"/>
<FIELDNAME="stat1"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="stat1. usually used for reads"PREVIOUS="stattype"NEXT="stat2"/>
<FIELDNAME="stat2"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="stat2. usually used for writes."PREVIOUS="stat1"/>
<FIELDNAME="roleid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="id of role for the aggregates"PREVIOUS="timeend"NEXT="stattype"/>
<FIELDNAME="stattype"TYPE="char"LENGTH="20"NOTNULL="true"DEFAULT="activity"SEQUENCE="false"COMMENT="type of stat"PREVIOUS="roleid"NEXT="stat1"/>
<FIELDNAME="stat1"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="stat1. usually used for reads"PREVIOUS="stattype"NEXT="stat2"/>
<FIELDNAME="stat2"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="stat2. usually used for writes."PREVIOUS="stat1"/>
<TABLENAME="context_temp"COMMENT="Used by build_context_path() in upgrade and cron to keep context depths and paths in sync."PREVIOUS="context"NEXT="capabilities">
<FIELDNAME="id"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="This id isn't autonumeric/sequence. It's the context->id"NEXT="path"/>
<TABLENAME="role_allow_switch"COMMENT="This table stores which which other roles a user is allowed to switch to if they have one role."PREVIOUS="role_allow_override"NEXT="role_assignments">
<FIELDNAME="roleid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="The role the user has."PREVIOUS="id"NEXT="allowswitch"/>
<FIELDNAME="allowswitch"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="The id of a role that the user is allowed to switch to as a result of having this role."PREVIOUS="roleid"/>
<TABLENAME="role_capabilities"COMMENT="permission has to be signed, overriding a capability for a particular role in a particular context"PREVIOUS="role_assignments"NEXT="role_names">
<TABLENAME="role_context_levels"COMMENT="Lists which roles can be assigned at which context levels. The assignment is allowed in the corresponding row is present in this table."PREVIOUS="role_sortorder"NEXT="user_info_field">
<FIELDNAME="shortname"TYPE="char"LENGTH="255"NOTNULL="true"DEFAULT="shortname"SEQUENCE="false"COMMENT="short name for each field"PREVIOUS="id"NEXT="name"/>
<FIELDNAME="datatype"TYPE="char"LENGTH="255"NOTNULL="true"SEQUENCE="false"COMMENT="Type of data held in this field"PREVIOUS="name"NEXT="description"/>
<FIELDNAME="description"TYPE="text"LENGTH="big"NOTNULL="false"SEQUENCE="false"COMMENT="Description of field"PREVIOUS="datatype"NEXT="categoryid"/>
<FIELDNAME="categoryid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="id from category table"PREVIOUS="description"NEXT="sortorder"/>
<FIELDNAME="sortorder"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="order within the category"PREVIOUS="categoryid"NEXT="required"/>
<FIELDNAME="forceunique"TYPE="int"LENGTH="2"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="should the field contain unique data"PREVIOUS="visible"NEXT="signup"/>
<FIELDNAME="signup"TYPE="int"LENGTH="2"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="display field on signup page"PREVIOUS="forceunique"NEXT="defaultdata"/>
<FIELDNAME="defaultdata"TYPE="text"LENGTH="big"NOTNULL="false"SEQUENCE="false"COMMENT="Default value for this field"PREVIOUS="signup"NEXT="param1"/>
<FIELDNAME="userid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="id from the user table"PREVIOUS="id"NEXT="fieldid"/>
<FIELDNAME="fieldid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="id from the field table"PREVIOUS="userid"NEXT="data"/>
<FIELDNAME="contextid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="context that this category is shared in"PREVIOUS="name"NEXT="info"/>
<KEYNAME="parent"TYPE="foreign"FIELDS="parent"REFTABLE="question_categories"REFFIELDS="id"COMMENT="note that to make this recursive FK working someday, the parent field must be declared NULL"PREVIOUS="primary"/>
</KEYS>
<INDEXES>
<INDEXNAME="contextid"UNIQUE="false"FIELDS="contextid"COMMENT="links to context table"/>
<FIELDNAME="generalfeedback"TYPE="text"LENGTH="small"NOTNULL="true"SEQUENCE="false"COMMENT="to store the question feedback"PREVIOUS="image"NEXT="defaultgrade"/>
<FIELDNAME="timecreated"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="time question was created"PREVIOUS="hidden"NEXT="timemodified"/>
<FIELDNAME="timemodified"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="time that question was last modified"PREVIOUS="timecreated"NEXT="createdby"/>
<FIELDNAME="createdby"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="userid of person who created this question"PREVIOUS="timemodified"NEXT="modifiedby"/>
<FIELDNAME="modifiedby"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="userid of person who last edited this question"PREVIOUS="createdby"/>
<KEYNAME="parent"TYPE="foreign"FIELDS="parent"REFTABLE="question"REFFIELDS="id"COMMENT="note that to make this recursive FK working someday, the parent field must be declared NULL"PREVIOUS="category"NEXT="createdby"/>
<KEYNAME="createdby"TYPE="foreign"FIELDS="createdby"REFTABLE="user"REFFIELDS="id"COMMENT="foreign (createdby) references user (id)"PREVIOUS="parent"NEXT="modifiedby"/>
<KEYNAME="modifiedby"TYPE="foreign"FIELDS="modifiedby"REFTABLE="user"REFFIELDS="id"COMMENT="foreign (modifiedby) references user (id)"PREVIOUS="createdby"/>
</KEYS>
</TABLE>
<TABLENAME="question_answers"COMMENT="Answers, with a fractional grade (0-1) and feedback"PREVIOUS="question"NEXT="question_attempts">
<FIELDNAME="flagged"TYPE="int"LENGTH="2"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"COMMENT="The person attempting the question may mark certain questions within their question_attempt if the module that owns the attempt allow it. This field stores the status of that flag."PREVIOUS="manualcomment"/>
<FIELDNAME="remoteid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="Unique ID of course on its home server"PREVIOUS="hostid"NEXT="cat_id"/>
<TABLENAME="mnet_enrol_assignments"COMMENT="Information about enrolments on courses on remote hosts"PREVIOUS="mnet_enrol_course"NEXT="mnet_application">
<FIELDNAME="userid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="Unique ID of user on *this* server"PREVIOUS="id"NEXT="hostid"/>
<FIELDNAME="courseid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="Unique ID of course on its home server"PREVIOUS="hostid"NEXT="rolename"/>
<FIELDNAME="offer"TYPE="int"LENGTH="1"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="Do we even offer this service?"PREVIOUS="apiversion"/>
<FIELDNAME="id"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="true"COMMENT="Required ID field"NEXT="serviceid"/>
<FIELDNAME="serviceid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="Unique service ID"PREVIOUS="id"NEXT="rpcid"/>
<FIELDNAME="rpcid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="Unique Function ID"PREVIOUS="serviceid"/>
<FIELDNAME="useragent"TYPE="char"LENGTH="40"NOTNULL="true"SEQUENCE="false"COMMENT="SHA1 hash of User Agent"PREVIOUS="mnethostid"NEXT="confirm_timeout"/>
<FIELDNAME="confirm_timeout"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="UNIX timestamp for expiry of session"PREVIOUS="useragent"NEXT="session_id"/>
<FIELDNAME="expires"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="Expire time of session on peer"PREVIOUS="session_id"/>
<TABLENAME="mnet_sso_access_control"COMMENT="Users by host permitted (or not) to login from a remote provider"PREVIOUS="mnet_session"NEXT="events_queue">
<FIELDNAME="mnet_host_id"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="id of mnet host"PREVIOUS="username"NEXT="accessctrl"/>
<FIELDNAME="accessctrl"TYPE="char"LENGTH="20"NOTNULL="true"DEFAULT="allow"SEQUENCE="false"COMMENT="Whether or not this user/host can login"PREVIOUS="mnet_host_id"/>
<TABLENAME="events_queue"COMMENT="This table is for storing queued events. It stores only one copy of the eventdata here, and entries from this table are being references by the event_queue_handlers table."PREVIOUS="mnet_sso_access_control"NEXT="events_handlers">
<FIELDNAME="eventdata"TYPE="text"LENGTH="big"NOTNULL="true"SEQUENCE="false"COMMENT="serialized version of the data object passed to the event handler."PREVIOUS="id"NEXT="stackdump"/>
<FIELDNAME="stackdump"TYPE="text"LENGTH="medium"NOTNULL="false"SEQUENCE="false"COMMENT="serialized debug_backtrace showing where the event was fired from"PREVIOUS="eventdata"NEXT="userid"/>
<FIELDNAME="userid"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="$USER-&gt;id when the event was fired"PREVIOUS="stackdump"NEXT="timecreated"/>
<FIELDNAME="timecreated"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="time stamp of the first time this was added"PREVIOUS="userid"/>
<TABLENAME="events_handlers"COMMENT="This table is for storing which components requests what type of event, and the location of the responsible handlers. For example, the assignment registers 'grade_updated' event with a function assignment_grade_handler() that should be called event time an 'grade_updated' event is triggered by grade_update() function."PREVIOUS="events_queue"NEXT="events_queue_handlers">
<FIELDNAME="eventname"TYPE="char"LENGTH="166"NOTNULL="true"SEQUENCE="false"COMMENT="name of the event, e.g. 'grade_updated'"PREVIOUS="id"NEXT="handlermodule"/>
<FIELDNAME="handlerfile"TYPE="char"LENGTH="255"NOTNULL="true"SEQUENCE="false"COMMENT="path to the file of the function, eg /grade/export/lib.php"PREVIOUS="handlermodule"NEXT="handlerfunction"/>
<FIELDNAME="handlerfunction"TYPE="text"LENGTH="medium"NOTNULL="false"SEQUENCE="false"COMMENT="serialized string or array describing function, suitable to be passed to call_user_func()"PREVIOUS="handlerfile"NEXT="schedule"/>
<FIELDNAME="schedule"TYPE="char"LENGTH="255"NOTNULL="false"SEQUENCE="false"COMMENT="'cron' or 'instant'."PREVIOUS="handlerfunction"NEXT="status"/>
<FIELDNAME="status"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="number of failed attempts to process this handler"PREVIOUS="schedule"/>
<TABLENAME="events_queue_handlers"COMMENT="This is the list of queued handlers for processing. The event object is retrieved from the events_queue table. When no further reference is made to the event_queues table, the corresponding entry in the events_queue table should be deleted. Entry should get deleted after a successful event processing by the specified handler."PREVIOUS="events_handlers"NEXT="grade_outcomes">
<FIELDNAME="queuedeventid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="foreign key id corresponding to the id of the event_queues table"PREVIOUS="id"NEXT="handlerid"/>
<FIELDNAME="handlerid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="foreign key id corresponding to the id of the event_handlers table"PREVIOUS="queuedeventid"NEXT="status"/>
<FIELDNAME="status"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="false"SEQUENCE="false"COMMENT="number of failed attempts to process this handler"PREVIOUS="handlerid"NEXT="errormessage"/>
<FIELDNAME="errormessage"TYPE="text"LENGTH="medium"NOTNULL="false"SEQUENCE="false"COMMENT="if an error happened last time we tried to process this event, record it here."PREVIOUS="status"NEXT="timemodified"/>
<FIELDNAME="timemodified"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="time stamp of the last attempt to run this from the queue"PREVIOUS="errormessage"/>
<TABLENAME="grade_outcomes"COMMENT="This table describes the outcomes used in the system. An outcome is a statement tied to a rubric scale from low to high, such as “Not met, Borderline, Met” (stored as 0,1 or 2)"PREVIOUS="events_queue_handlers"NEXT="grade_outcomes_courses">
<FIELDNAME="id"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="true"COMMENT="id of the table"NEXT="courseid"/>
<FIELDNAME="courseid"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="Mostly these are defined site wide ie NULL"PREVIOUS="id"NEXT="shortname"/>
<FIELDNAME="shortname"TYPE="char"LENGTH="255"NOTNULL="true"SEQUENCE="false"COMMENT="The short name or code for this outcome statement"PREVIOUS="courseid"NEXT="fullname"/>
<FIELDNAME="fullname"TYPE="text"LENGTH="small"NOTNULL="true"SEQUENCE="false"COMMENT="The full description of the outcome (usually 1 sentence)"PREVIOUS="shortname"NEXT="scaleid"/>
<FIELDNAME="scaleid"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="The recommended scale for this outcome."PREVIOUS="fullname"NEXT="description"/>
<FIELDNAME="timecreated"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="the time this outcome was first created"PREVIOUS="description"NEXT="timemodified"/>
<FIELDNAME="timemodified"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="the time this outcome was last updated"PREVIOUS="timecreated"NEXT="usermodified"/>
<FIELDNAME="usermodified"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="the userid of the person who last modified this outcome"PREVIOUS="timemodified"/>
<TABLENAME="grade_categories"COMMENT="This table keeps information about categories, used for grouping items."PREVIOUS="grade_outcomes_courses"NEXT="grade_items">
<FIELDNAME="courseid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="The course this grade category is part of"PREVIOUS="id"NEXT="parent"/>
<FIELDNAME="parent"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="Categories can be hierarchical"PREVIOUS="courseid"NEXT="depth"/>
<FIELDNAME="depth"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="How many parents does this category have?"PREVIOUS="parent"NEXT="path"/>
<FIELDNAME="path"TYPE="char"LENGTH="255"NOTNULL="false"SEQUENCE="false"COMMENT="shows the path as /1/2/3 (like course_categories)"PREVIOUS="depth"NEXT="fullname"/>
<FIELDNAME="fullname"TYPE="char"LENGTH="255"NOTNULL="true"SEQUENCE="false"COMMENT="The name of this grade category"PREVIOUS="path"NEXT="aggregation"/>
<FIELDNAME="aggregation"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"COMMENT="A constant pointing to one of the predefined aggregation strategies (none, mean,median,sum, etc)"PREVIOUS="fullname"NEXT="keephigh"/>
<FIELDNAME="keephigh"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"COMMENT="Keep only the X highest items"PREVIOUS="aggregation"NEXT="droplow"/>
<FIELDNAME="droplow"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"COMMENT="Drop the X lowest items"PREVIOUS="keephigh"NEXT="aggregateonlygraded"/>
<FIELDNAME="aggregateonlygraded"TYPE="int"LENGTH="1"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="aggregate only graded activities"PREVIOUS="droplow"NEXT="aggregateoutcomes"/>
<FIELDNAME="aggregatesubcats"TYPE="int"LENGTH="1"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="ignore subcategories in aggregation"PREVIOUS="aggregateoutcomes"NEXT="timecreated"/>
<TABLENAME="grade_items"COMMENT="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."PREVIOUS="grade_categories"NEXT="grade_grades">
<FIELDNAME="courseid"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="The course this item is part of"PREVIOUS="id"NEXT="categoryid"/>
<FIELDNAME="categoryid"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="(optional) the category group this item belongs to"PREVIOUS="courseid"NEXT="itemname"/>
<FIELDNAME="itemname"TYPE="char"LENGTH="255"NOTNULL="false"SEQUENCE="false"COMMENT="The name of this item (pushed in by the module)"PREVIOUS="categoryid"NEXT="itemtype"/>
<FIELDNAME="iteminstance"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="id of the item module"PREVIOUS="itemmodule"NEXT="itemnumber"/>
<FIELDNAME="itemnumber"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="Can be used to distinguish multiple grades for an activity"PREVIOUS="iteminstance"NEXT="iteminfo"/>
<FIELDNAME="iteminfo"TYPE="text"LENGTH="medium"NOTNULL="false"SEQUENCE="false"COMMENT="Info and notes about this item XXX"PREVIOUS="itemnumber"NEXT="idnumber"/>
<FIELDNAME="idnumber"TYPE="char"LENGTH="255"NOTNULL="false"SEQUENCE="false"COMMENT="Arbitrary idnumber provided by the module responsible"PREVIOUS="iteminfo"NEXT="calculation"/>
<FIELDNAME="calculation"TYPE="text"LENGTH="medium"NOTNULL="false"SEQUENCE="false"COMMENT="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#]"PREVIOUS="idnumber"NEXT="gradetype"/>
<FIELDNAME="grademax"TYPE="number"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="100"SEQUENCE="false"DECIMALS="5"COMMENT="What is the maximum allowable grade?"PREVIOUS="gradetype"NEXT="grademin"/>
<FIELDNAME="grademin"TYPE="number"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"DECIMALS="5"COMMENT="What is the minimum allowable grade?"PREVIOUS="grademax"NEXT="scaleid"/>
<FIELDNAME="scaleid"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="If this grade is based on a scale, which one is it?"PREVIOUS="grademin"NEXT="outcomeid"/>
<FIELDNAME="outcomeid"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="If this grade is related to an outcome, which one is it?"PREVIOUS="scaleid"NEXT="gradepass"/>
<FIELDNAME="gradepass"TYPE="number"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"DECIMALS="5"COMMENT="What grade is needed to pass? grademin &lt; gradepass &lt;= grademax"PREVIOUS="outcomeid"NEXT="multfactor"/>
<FIELDNAME="multfactor"TYPE="number"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="1.0"SEQUENCE="false"DECIMALS="5"COMMENT="Multiply all grades by this"PREVIOUS="gradepass"NEXT="plusfactor"/>
<FIELDNAME="plusfactor"TYPE="number"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"DECIMALS="5"COMMENT="Add this to all grades"PREVIOUS="multfactor"NEXT="aggregationcoef"/>
<FIELDNAME="aggregationcoef"TYPE="number"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"DECIMALS="5"COMMENT="Aggregation coefficient used for category weights or other aggregation types"PREVIOUS="plusfactor"NEXT="sortorder"/>
<FIELDNAME="sortorder"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"COMMENT="Sorting order of the columns"PREVIOUS="aggregationcoef"NEXT="display"/>
<FIELDNAME="display"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"COMMENT="Display as real grades, percentages (in reference to the minimum and maximum grades) or letters (A, B, C etc..), or course default (0)"PREVIOUS="sortorder"NEXT="decimals"/>
<FIELDNAME="decimals"TYPE="int"LENGTH="1"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="Also known as precision, the number of digits after the decimal point symbol."PREVIOUS="display"NEXT="hidden"/>
<FIELDNAME="hidden"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"COMMENT="1 is hidden, &gt; 1 is a date to hide until (prevents viewing)"PREVIOUS="decimals"NEXT="locked"/>
<FIELDNAME="locked"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"COMMENT="1 is locked, &gt; 1 is a date to lock until (prevents update)"PREVIOUS="hidden"NEXT="locktime"/>
<FIELDNAME="locktime"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="lock all final grades after this date"PREVIOUS="locked"NEXT="needsupdate"/>
<FIELDNAME="needsupdate"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"COMMENT="If this flag is set, then the whole column will be recalculated"PREVIOUS="locktime"NEXT="timecreated"/>
<FIELDNAME="timecreated"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="The first time this grade_item was created"PREVIOUS="needsupdate"NEXT="timemodified"/>
<FIELDNAME="timemodified"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="The last time this grade_item was modified"PREVIOUS="timecreated"/>
<INDEXNAME="locked-locktime"UNIQUE="false"FIELDS="locked, locktime"COMMENT="used in grading cron"NEXT="itemtype-needsupdate"/>
<INDEXNAME="itemtype-needsupdate"UNIQUE="false"FIELDS="itemtype, needsupdate"COMMENT="used in grading cron"PREVIOUS="locked-locktime"NEXT="gradetype"/>
<INDEXNAME="gradetype"UNIQUE="false"FIELDS="gradetype"COMMENT="index for gradetype"PREVIOUS="itemtype-needsupdate"NEXT="idnumber-courseid"/>
<INDEXNAME="idnumber-courseid"UNIQUE="false"FIELDS="idnumber, courseid"COMMENT="non unique index (although programatically we are guarantying some sort of uniqueness both under this table and the course_modules one). TODO: We need a central store of module idnumbers in the future."PREVIOUS="gradetype"/>
<TABLENAME="grade_grades"COMMENT="grade_grades This table keeps individual grades for each user and each item, exactly as imported or submitted by modules. The rawgrademax/min and rawscaleid are stored here to record the values at the time the grade was stored, because teachers might change this for an activity! All the results are normalised/resampled for the final grade value."PREVIOUS="grade_items"NEXT="grade_outcomes_history">
<FIELDNAME="itemid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="The item this grade belongs to"PREVIOUS="id"NEXT="userid"/>
<FIELDNAME="userid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="The user who this grade is for"PREVIOUS="itemid"NEXT="rawgrade"/>
<FIELDNAME="rawgrade"TYPE="number"LENGTH="10"NOTNULL="false"UNSIGNED="false"SEQUENCE="false"DECIMALS="5"COMMENT="If the grade is a float value (or has been converted to one)"PREVIOUS="userid"NEXT="rawgrademax"/>
<FIELDNAME="rawgrademax"TYPE="number"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="100"SEQUENCE="false"DECIMALS="5"COMMENT="The maximum allowable grade when this was created"PREVIOUS="rawgrade"NEXT="rawgrademin"/>
<FIELDNAME="rawgrademin"TYPE="number"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"DECIMALS="5"COMMENT="The minimum allowable grade when this was created"PREVIOUS="rawgrademax"NEXT="rawscaleid"/>
<FIELDNAME="rawscaleid"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="If this grade is based on a scale, which one was it?"PREVIOUS="rawgrademin"NEXT="usermodified"/>
<FIELDNAME="usermodified"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="the userid of the person who last modified this grade"PREVIOUS="rawscaleid"NEXT="finalgrade"/>
<FIELDNAME="finalgrade"TYPE="number"LENGTH="10"NOTNULL="false"UNSIGNED="false"SEQUENCE="false"DECIMALS="5"COMMENT="The final grade (cached) after all calculations are made"PREVIOUS="usermodified"NEXT="hidden"/>
<FIELDNAME="hidden"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="show 0, hide 1 or hide until date"PREVIOUS="finalgrade"NEXT="locked"/>
<FIELDNAME="locked"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="not locked 0, locked from date"PREVIOUS="hidden"NEXT="locktime"/>
<FIELDNAME="locktime"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="automatic locking of final grade, 0 means none, date otherwise"PREVIOUS="locked"NEXT="exported"/>
<FIELDNAME="exported"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="date of last grade export, 0 if none"PREVIOUS="locktime"NEXT="overridden"/>
<FIELDNAME="overridden"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="indicates grade overridden from gradebook, 0 means none, date means overridden"PREVIOUS="exported"NEXT="excluded"/>
<FIELDNAME="excluded"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="grade excluded from aggregation functions, date means when excluded"PREVIOUS="overridden"NEXT="feedback"/>
<FIELDNAME="feedbackformat"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="format of feedback text"PREVIOUS="feedback"NEXT="information"/>
<FIELDNAME="informationformat"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="format of information text"PREVIOUS="information"NEXT="timecreated"/>
<FIELDNAME="timecreated"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="the time this grade was first created"PREVIOUS="informationformat"NEXT="timemodified"/>
<FIELDNAME="timemodified"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="the time this grade was last modified"PREVIOUS="timecreated"/>
<FIELDNAME="source"TYPE="char"LENGTH="255"NOTNULL="false"SEQUENCE="false"COMMENT="What caused the modification? manual/module/import/..."PREVIOUS="oldid"NEXT="timemodified"/>
<FIELDNAME="timemodified"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="The last time this grade_item was modified"PREVIOUS="source"NEXT="loggeduser"/>
<FIELDNAME="loggeduser"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="the userid of the person who last modified this outcome"PREVIOUS="timemodified"NEXT="courseid"/>
<FIELDNAME="courseid"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="Mostly these are defined site wide ie NULL"PREVIOUS="loggeduser"NEXT="shortname"/>
<FIELDNAME="shortname"TYPE="char"LENGTH="255"NOTNULL="true"SEQUENCE="false"COMMENT="The short name or code for this outcome statement"PREVIOUS="courseid"NEXT="fullname"/>
<FIELDNAME="fullname"TYPE="text"LENGTH="small"NOTNULL="true"SEQUENCE="false"COMMENT="The full description of the outcome (usually 1 sentence)"PREVIOUS="shortname"NEXT="scaleid"/>
<FIELDNAME="scaleid"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="The recommended scale for this outcome."PREVIOUS="fullname"NEXT="description"/>
<FIELDNAME="source"TYPE="char"LENGTH="255"NOTNULL="false"SEQUENCE="false"COMMENT="What caused the modification? manual/module/import/..."PREVIOUS="oldid"NEXT="timemodified"/>
<FIELDNAME="timemodified"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="The last time this grade_item was modified"PREVIOUS="source"NEXT="loggeduser"/>
<FIELDNAME="loggeduser"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="the userid of the person who last modified this outcome"PREVIOUS="timemodified"NEXT="courseid"/>
<FIELDNAME="courseid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="The course this grade category is part of"PREVIOUS="loggeduser"NEXT="parent"/>
<FIELDNAME="parent"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="Categories can be hierarchical"PREVIOUS="courseid"NEXT="depth"/>
<FIELDNAME="depth"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="How many parents does this category have?"PREVIOUS="parent"NEXT="path"/>
<FIELDNAME="path"TYPE="char"LENGTH="255"NOTNULL="false"SEQUENCE="false"COMMENT="shows the path as /1/2/3 (like course_categories)"PREVIOUS="depth"NEXT="fullname"/>
<FIELDNAME="fullname"TYPE="char"LENGTH="255"NOTNULL="true"SEQUENCE="false"COMMENT="The name of this grade category"PREVIOUS="path"NEXT="aggregation"/>
<FIELDNAME="aggregation"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"COMMENT="A constant pointing to one of the predefined aggregation strategies (none, mean,median,sum, etc)"PREVIOUS="fullname"NEXT="keephigh"/>
<FIELDNAME="keephigh"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"COMMENT="Keep only the X highest items"PREVIOUS="aggregation"NEXT="droplow"/>
<FIELDNAME="droplow"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"COMMENT="Drop the X lowest items"PREVIOUS="keephigh"NEXT="aggregateonlygraded"/>
<FIELDNAME="aggregateonlygraded"TYPE="int"LENGTH="1"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="aggregate only graded items"PREVIOUS="droplow"NEXT="aggregateoutcomes"/>
<FIELDNAME="aggregatesubcats"TYPE="int"LENGTH="1"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="ignore subcategories in aggregation"PREVIOUS="aggregateoutcomes"/>
<FIELDNAME="source"TYPE="char"LENGTH="255"NOTNULL="false"SEQUENCE="false"COMMENT="What caused the modification? manual/module/import/..."PREVIOUS="oldid"NEXT="timemodified"/>
<FIELDNAME="timemodified"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="The last time this grade_item was modified"PREVIOUS="source"NEXT="loggeduser"/>
<FIELDNAME="loggeduser"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="the userid of the person who last modified this outcome"PREVIOUS="timemodified"NEXT="courseid"/>
<FIELDNAME="courseid"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="The course this item is part of"PREVIOUS="loggeduser"NEXT="categoryid"/>
<FIELDNAME="categoryid"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="(optional) the category group this item belongs to"PREVIOUS="courseid"NEXT="itemname"/>
<FIELDNAME="itemname"TYPE="char"LENGTH="255"NOTNULL="false"SEQUENCE="false"COMMENT="The name of this item (pushed in by the module)"PREVIOUS="categoryid"NEXT="itemtype"/>
<FIELDNAME="iteminstance"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="id of the item module"PREVIOUS="itemmodule"NEXT="itemnumber"/>
<FIELDNAME="itemnumber"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="Can be used to distinguish multiple grades for an activity"PREVIOUS="iteminstance"NEXT="iteminfo"/>
<FIELDNAME="iteminfo"TYPE="text"LENGTH="medium"NOTNULL="false"SEQUENCE="false"COMMENT="Info and notes about this item XXX"PREVIOUS="itemnumber"NEXT="idnumber"/>
<FIELDNAME="idnumber"TYPE="char"LENGTH="255"NOTNULL="false"SEQUENCE="false"COMMENT="Arbitrary idnumber provided by the module responsible"PREVIOUS="iteminfo"NEXT="calculation"/>
<FIELDNAME="calculation"TYPE="text"LENGTH="medium"NOTNULL="false"SEQUENCE="false"COMMENT="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#]"PREVIOUS="idnumber"NEXT="gradetype"/>
<FIELDNAME="grademax"TYPE="number"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="100"SEQUENCE="false"DECIMALS="5"COMMENT="What is the maximum allowable grade?"PREVIOUS="gradetype"NEXT="grademin"/>
<FIELDNAME="grademin"TYPE="number"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"DECIMALS="5"COMMENT="What is the minimum allowable grade?"PREVIOUS="grademax"NEXT="scaleid"/>
<FIELDNAME="scaleid"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="If this grade is based on a scale, which one is it?"PREVIOUS="grademin"NEXT="outcomeid"/>
<FIELDNAME="outcomeid"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="If this grade is related to an outcome, which one is it?"PREVIOUS="scaleid"NEXT="gradepass"/>
<FIELDNAME="gradepass"TYPE="number"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"DECIMALS="5"COMMENT="What grade is needed to pass? grademin &lt; gradepass &lt;= grademax"PREVIOUS="outcomeid"NEXT="multfactor"/>
<FIELDNAME="multfactor"TYPE="number"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="1.0"SEQUENCE="false"DECIMALS="5"COMMENT="Multiply all grades by this"PREVIOUS="gradepass"NEXT="plusfactor"/>
<FIELDNAME="plusfactor"TYPE="number"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"DECIMALS="5"COMMENT="Add this to all grades"PREVIOUS="multfactor"NEXT="aggregationcoef"/>
<FIELDNAME="aggregationcoef"TYPE="number"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"DECIMALS="5"COMMENT="Aggregation coefficient used for category weights or other aggregation types"PREVIOUS="plusfactor"NEXT="sortorder"/>
<FIELDNAME="sortorder"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"COMMENT="Sorting order of the columns"PREVIOUS="aggregationcoef"NEXT="hidden"/>
<FIELDNAME="hidden"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"COMMENT="1 is hidden, &gt; 1 is a date to hide until (prevents viewing)"PREVIOUS="sortorder"NEXT="locked"/>
<FIELDNAME="locked"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"COMMENT="1 is locked, &gt; 1 is a date to lock until (prevents update)"PREVIOUS="hidden"NEXT="locktime"/>
<FIELDNAME="locktime"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="lock all final grades after this date"PREVIOUS="locked"NEXT="needsupdate"/>
<FIELDNAME="needsupdate"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"COMMENT="If this flag is set, then the whole column will be recalculated"PREVIOUS="locktime"/>
<FIELDNAME="source"TYPE="char"LENGTH="255"NOTNULL="false"SEQUENCE="false"COMMENT="What caused the modification? manual/module/import/..."PREVIOUS="oldid"NEXT="timemodified"/>
<FIELDNAME="timemodified"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="The last time this grade_item was modified"PREVIOUS="source"NEXT="loggeduser"/>
<FIELDNAME="loggeduser"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="the userid of the person who last modified this outcome"PREVIOUS="timemodified"NEXT="itemid"/>
<FIELDNAME="itemid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="The item this grade belongs to"PREVIOUS="loggeduser"NEXT="userid"/>
<FIELDNAME="userid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="The user who this grade is for"PREVIOUS="itemid"NEXT="rawgrade"/>
<FIELDNAME="rawgrade"TYPE="number"LENGTH="10"NOTNULL="false"UNSIGNED="false"SEQUENCE="false"DECIMALS="5"COMMENT="If the grade is a float value (or has been converted to one)"PREVIOUS="userid"NEXT="rawgrademax"/>
<FIELDNAME="rawgrademax"TYPE="number"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="100"SEQUENCE="false"DECIMALS="5"COMMENT="The maximum allowable grade when this was created"PREVIOUS="rawgrade"NEXT="rawgrademin"/>
<FIELDNAME="rawgrademin"TYPE="number"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"DECIMALS="5"COMMENT="The minimum allowable grade when this was created"PREVIOUS="rawgrademax"NEXT="rawscaleid"/>
<FIELDNAME="rawscaleid"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="If this grade is based on a scale, which one was it?"PREVIOUS="rawgrademin"NEXT="usermodified"/>
<FIELDNAME="usermodified"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="the userid of the person who last modified this grade"PREVIOUS="rawscaleid"NEXT="finalgrade"/>
<FIELDNAME="finalgrade"TYPE="number"LENGTH="10"NOTNULL="false"UNSIGNED="false"SEQUENCE="false"DECIMALS="5"COMMENT="The final grade (cached) after all calculations are made"PREVIOUS="usermodified"NEXT="hidden"/>
<FIELDNAME="hidden"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="show 0, hide 1 or hide until date"PREVIOUS="finalgrade"NEXT="locked"/>
<FIELDNAME="locked"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="not locked 0, locked from date"PREVIOUS="hidden"NEXT="locktime"/>
<FIELDNAME="locktime"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="automatic locking of final grade, 0 means none, date otherwise"PREVIOUS="locked"NEXT="exported"/>
<FIELDNAME="exported"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="date of last grade export, 0 if none"PREVIOUS="locktime"NEXT="overridden"/>
<FIELDNAME="overridden"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="indicates grade overridden from gradebook, 0 means none, date means overridden"PREVIOUS="exported"NEXT="excluded"/>
<FIELDNAME="excluded"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="grade excluded from aggregation functions, date means when excluded"PREVIOUS="overridden"NEXT="feedback"/>
<FIELDNAME="feedbackformat"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="format of feedback text"PREVIOUS="feedback"NEXT="information"/>
<FIELDNAME="informationformat"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="format of information text"PREVIOUS="information"/>
<TABLENAME="grade_import_newitem"COMMENT="temporary table for storing new grade_item names from grade import"PREVIOUS="grade_grades_history"NEXT="grade_import_values">
<FIELDNAME="importcode"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="import batch code for identification"PREVIOUS="itemname"NEXT="importer"/>
<FIELDNAME="importer"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="user importing the data"PREVIOUS="importcode"/>
<FIELDNAME="itemid"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="if set, this points to existing grade_items id"PREVIOUS="id"NEXT="newgradeitem"/>
<FIELDNAME="newgradeitem"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="if set, points to the id of grade_import_newitem"PREVIOUS="itemid"NEXT="userid"/>
<FIELDNAME="importcode"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="similar to backup_code, a unique batch code for identifying one batch of imports"PREVIOUS="feedback"NEXT="importer"/>
<TABLENAME="tag"COMMENT="Tag table - this generic table will replace the old "tags" table."PREVIOUS="grade_import_values"NEXT="tag_correlation">
<FIELDNAME="rawname"TYPE="char"LENGTH="255"NOTNULL="true"SEQUENCE="false"COMMENT="The raw, unnormalised name for the tag as entered by users"PREVIOUS="name"NEXT="tagtype"/>
<FIELDNAME="flag"TYPE="int"LENGTH="4"NOTNULL="false"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="a tag can be 'flagged' as inappropriate"PREVIOUS="descriptionformat"NEXT="timemodified"/>
<INDEXNAME="name"UNIQUE="true"FIELDS="name"COMMENT="tag names are unique"/>
</INDEXES>
</TABLE>
<TABLENAME="tag_correlation"COMMENT="The rationale for the 'tag_correlation' table is performance. It works as a cache for a potentially heavy load query done at the 'tag_instance' table. So, the 'tag_correlation' table stores redundant information derived from the 'tag_instance' table"PREVIOUS="tag"NEXT="tag_instance">
<TABLENAME="tag_instance"COMMENT="tag_instance table holds the information of associations between tags and other items"PREVIOUS="tag_correlation"NEXT="groups">
<FIELDNAME="ordering"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="Maintains the order of the tag instances of an item"PREVIOUS="tiuserid"NEXT="timemodified"/>
<FIELDNAME="name"TYPE="char"LENGTH="254"NOTNULL="true"SEQUENCE="false"COMMENT="Short human readable unique name for the group."PREVIOUS="courseid"NEXT="description"/>
<FIELDNAME="name"TYPE="char"LENGTH="255"NOTNULL="true"SEQUENCE="false"COMMENT="Short human readable unique name for group."PREVIOUS="courseid"NEXT="description"/>
<FIELDNAME="configdata"TYPE="text"LENGTH="small"NOTNULL="false"SEQUENCE="false"COMMENT="extra configuration data - may be used by group IU tools"PREVIOUS="description"NEXT="timecreated"/>
<TABLENAME="groupings_groups"COMMENT="Link a grouping to a group (note, groups can be in multiple groupings ONLY in a course). WAS: groups_groupings_groups"PREVIOUS="groups_members"NEXT="user_private_key">
<FIELDNAME="validuntil"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="timestampt - valid until data"PREVIOUS="iprestriction"NEXT="timecreated"/>
<TABLENAME="grade_letters"COMMENT="Repository for grade letters, for courses and other moodle entities that use grades."PREVIOUS="user_private_key"NEXT="cache_flags">
<FIELDNAME="contextid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="What contextid does this letter apply to (for now these will always be courses, but later...)"PREVIOUS="id"NEXT="lowerboundary"/>
<FIELDNAME="lowerboundary"TYPE="number"LENGTH="10"NOTNULL="true"UNSIGNED="false"SEQUENCE="false"DECIMALS="5"COMMENT="The lower boundary of the letter. Its upper boundary is the lower boundary of the next highest letter, unless there is none above, in which case it's grademax for that grade_item."PREVIOUS="contextid"NEXT="letter"/>
<FIELDNAME="letter"TYPE="char"LENGTH="255"NOTNULL="true"SEQUENCE="false"COMMENT="The display value of the letter. Can be any character or string of characters (OK, A, 10% etc..)"PREVIOUS="lowerboundary"/>
<TABLENAME="portfolio_instance"COMMENT="base table (not including config data) for instances of portfolio plugins."PREVIOUS="webdav_locks"NEXT="portfolio_instance_config">
<FIELDNAME="plugin"TYPE="char"LENGTH="50"NOTNULL="true"SEQUENCE="false"COMMENT="fk to plugin"PREVIOUS="id"NEXT="name"/>
<FIELDNAME="name"TYPE="char"LENGTH="255"NOTNULL="true"SEQUENCE="false"COMMENT="name of plugin instance"PREVIOUS="plugin"NEXT="visible"/>
<FIELDNAME="visible"TYPE="int"LENGTH="1"NOTNULL="true"UNSIGNED="true"DEFAULT="1"SEQUENCE="false"COMMENT="whether this instance is visible or not"PREVIOUS="name"/>
<FIELDNAME="instance"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="instance of plugin we're configurating"PREVIOUS="id"NEXT="name"/>
<KEYNAME="instancefk"TYPE="foreign"FIELDS="instance"REFTABLE="portfolio_instance"REFFIELDS="id"COMMENT="fk to portfolio_instance"PREVIOUS="primary"NEXT="userfk"/>
<KEYNAME="userfk"TYPE="foreign"FIELDS="userid"REFTABLE="user"REFFIELDS="id"COMMENT="fk to user table"PREVIOUS="instancefk"/>
<TABLENAME="portfolio_log"COMMENT="log of portfolio transfers (used to later check for duplicates)"PREVIOUS="portfolio_instance_user"NEXT="portfolio_tempdata">
<FIELDNAME="userid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="user who exported content"PREVIOUS="id"NEXT="time"/>
<FIELDNAME="time"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="time of transfer (in the case of a queued transfer this is the time the actual transfer ran, not when the user started)"PREVIOUS="userid"NEXT="portfolio"/>
<FIELDNAME="portfolio"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="fk to portfolio_instance"PREVIOUS="time"NEXT="caller_class"/>
<FIELDNAME="caller_class"TYPE="char"LENGTH="150"NOTNULL="true"SEQUENCE="false"COMMENT="the name of the class used to create the transfer"PREVIOUS="portfolio"NEXT="caller_file"/>
<FIELDNAME="caller_file"TYPE="char"LENGTH="255"NOTNULL="true"SEQUENCE="false"COMMENT="path to file to include where the class definition lives. (relative to dirroot)"PREVIOUS="caller_class"NEXT="caller_sha1"/>
<FIELDNAME="caller_sha1"TYPE="char"LENGTH="255"NOTNULL="true"SEQUENCE="false"COMMENT="sha1 of exported content as far as the caller is concerned (before the portfolio plugin gets a hold of it)"PREVIOUS="caller_file"/>
<TABLENAME="portfolio_tempdata"COMMENT="stores temporary data for portfolio exports. the id of this table is used for the itemid for the temporary files area. cron can clean up stale records (and associated file data) after expirytime."PREVIOUS="portfolio_log"NEXT="message_providers">
<FIELDNAME="data"TYPE="text"LENGTH="big"NOTNULL="false"SEQUENCE="false"COMMENT="dumping ground for portfolio callers to store their data in."PREVIOUS="id"NEXT="expirytime"/>
<FIELDNAME="expirytime"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="time this record will expire (used for cron cleanups) - the start of export + 24 hours"PREVIOUS="data"NEXT="userid"/>
<FIELDNAME="userid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="psuedo fk to user. this is stored in the serialised data structure in the data field, but added here for ease of lookups."PREVIOUS="expirytime"/>
<TABLENAME="message_providers"COMMENT="This table stores the message providers (modules and core systems)"PREVIOUS="portfolio_tempdata"NEXT="message_processors">
<FIELDNAME="id"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="false"SEQUENCE="true"COMMENT="id of the table, please edit me"NEXT="name"/>
<FIELDNAME="name"TYPE="char"LENGTH="100"NOTNULL="true"SEQUENCE="false"COMMENT="The full name of the message provider in standard form"PREVIOUS="id"NEXT="component"/>
<FIELDNAME="component"TYPE="char"LENGTH="200"NOTNULL="true"SEQUENCE="false"COMMENT="The name of the component that produces these messages"PREVIOUS="name"NEXT="capability"/>
<FIELDNAME="capability"TYPE="char"LENGTH="255"NOTNULL="false"SEQUENCE="false"COMMENT="Optional: permission that is required on the user's setting screen to see this message provider."PREVIOUS="component"/>
<FIELDNAME="id"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="false"SEQUENCE="true"COMMENT="id of the table, please edit me"NEXT="unreadmessageid"/>
<FIELDNAME="unreadmessageid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="message that still needs some processing (on message table)"PREVIOUS="id"NEXT="processorid"/>
<FIELDNAME="processorid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="The processor with processes the message"PREVIOUS="unreadmessageid"/>
<FIELDNAME="contenthash"TYPE="char"LENGTH="40"NOTNULL="true"SEQUENCE="false"COMMENT="sha1 hash of file content"PREVIOUS="id"NEXT="pathnamehash"/>
<FIELDNAME="pathnamehash"TYPE="char"LENGTH="40"NOTNULL="true"SEQUENCE="false"COMMENT="complete file path sha1 hash - unique for each file"PREVIOUS="contenthash"NEXT="contextid"/>
<FIELDNAME="contextid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="The context id defined in context table - identifies the instance of plugin owning the file"PREVIOUS="pathnamehash"NEXT="filearea"/>
<FIELDNAME="filearea"TYPE="char"LENGTH="50"NOTNULL="true"SEQUENCE="false"COMMENT="Like "coursefiles". "submission", "intro" and "content" (images and swf linked from summaries), etc."PREVIOUS="contextid"NEXT="itemid"/>
<FIELDNAME="itemid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="Optional - some plugin specific item id (eg. forum post, blog entry or assignment submission, user id for user files)"PREVIOUS="filearea"NEXT="filepath"/>
<FIELDNAME="filepath"TYPE="char"LENGTH="255"NOTNULL="true"SEQUENCE="false"COMMENT="Optional - relative path to file from module content root, useful in Scorm and Resource mod - most of the mods do not need this"PREVIOUS="itemid"NEXT="filename"/>
<FIELDNAME="filename"TYPE="char"LENGTH="255"NOTNULL="true"SEQUENCE="false"COMMENT="The full Unicode name of this file (case sensitive) - some chars are not allowed though"PREVIOUS="filepath"NEXT="userid"/>
<FIELDNAME="userid"TYPE="int"LENGTH="10"NOTNULL="false"UNSIGNED="true"SEQUENCE="false"COMMENT="Optional - general userid field - meaning depending on plugin"PREVIOUS="filename"NEXT="filesize"/>
<FIELDNAME="mimetype"TYPE="char"LENGTH="100"NOTNULL="false"SEQUENCE="false"COMMENT="type of file - jpeg image, open document spreadsheet"PREVIOUS="filesize"NEXT="status"/>
<FIELDNAME="status"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="number greater than 0 means something is wrong with this file (virus, missing, etc.)"PREVIOUS="mimetype"NEXT="timecreated"/>
<TABLENAME="repository"COMMENT="This table contains one entry for every configured external repository instance."PREVIOUS="files"NEXT="repository_instances">
<TABLENAME="repository_instances"COMMENT="This table contains one entry for every configured external repository instance."PREVIOUS="repository"NEXT="repository_instance_config">
<TABLENAME="block_instances"COMMENT="This table stores block instances. The type of block this is is given by the blockname column. The places this block instance appears is controlled by the parentcontexid, showinsubcontexts, pagetypepattern and subpagepattern fields. Where the block appears on the page (by default) is controlled by the defaultposition and defaultweight columns. The block's own configuration is stored serialized in configdata."PREVIOUS="block"NEXT="block_positions">
<FIELDNAME="blockname"TYPE="char"LENGTH="40"NOTNULL="true"SEQUENCE="false"COMMENT="The type of block this is. Foreign key, references block.name."PREVIOUS="id"NEXT="parentcontextid"/>
<FIELDNAME="parentcontextid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="The context within which this block appears. Foreign key, references context.id."PREVIOUS="blockname"NEXT="showinsubcontexts"/>
<FIELDNAME="showinsubcontexts"TYPE="int"LENGTH="4"NOTNULL="true"UNSIGNED="false"SEQUENCE="false"COMMENT="If 1, this block appears on all matching pages in subcontexts of parentcontextid, as well in pages belonging to parentcontextid."PREVIOUS="parentcontextid"NEXT="pagetypepattern"/>
<FIELDNAME="pagetypepattern"TYPE="char"LENGTH="64"NOTNULL="true"SEQUENCE="false"COMMENT="The types of page this block appears on. Either an exact page type like mod-quiz-view, or a pattern like mod-quiz-* or course-view-*. Note that course-view-* will match course-view."PREVIOUS="showinsubcontexts"NEXT="subpagepattern"/>
<FIELDNAME="subpagepattern"TYPE="char"LENGTH="16"NOTNULL="false"SEQUENCE="false"COMMENT="Further restrictions on where this block appears. In some places, e.g. during a quiz or lesson attempt, different pages have different subpage ids. If this field is not null, the block only appears on that particular subpage."PREVIOUS="pagetypepattern"NEXT="defaultregion"/>
<FIELDNAME="defaultregion"TYPE="char"LENGTH="16"NOTNULL="true"SEQUENCE="false"COMMENT="Which block region this block should appear in on each page, in the absence of a specific position in the block_positions table."PREVIOUS="subpagepattern"NEXT="defaultweight"/>
<FIELDNAME="defaultweight"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="false"SEQUENCE="false"COMMENT="Used to order the blocks within a block region. Again, may be overridden by the block_positions table for a specific page where this block appears."PREVIOUS="defaultregion"NEXT="configdata"/>
<FIELDNAME="configdata"TYPE="text"LENGTH="small"NOTNULL="false"SEQUENCE="false"COMMENT="A serialized blob of configuration data for this block instance."PREVIOUS="defaultweight"/>
<TABLENAME="block_positions"COMMENT="Stores the position of a sticky block_instance on a another page than the one where it was added."PREVIOUS="block_instances"NEXT="external_services_functions">
<FIELDNAME="blockinstanceid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="The block_instance this position relates to."PREVIOUS="id"NEXT="contextid"/>
<FIELDNAME="contextid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="With pagetype and subpage, defines the page we are setting the position for."PREVIOUS="blockinstanceid"NEXT="pagetype"/>
<FIELDNAME="pagetype"TYPE="char"LENGTH="64"NOTNULL="true"SEQUENCE="false"COMMENT="With contextid and subpage, defines the page we are setting the position for."PREVIOUS="contextid"NEXT="subpage"/>
<FIELDNAME="subpage"TYPE="char"LENGTH="16"NOTNULL="true"SEQUENCE="false"COMMENT="With contextid and pagetype, defines the page we are setting the position for."PREVIOUS="pagetype"NEXT="visible"/>
<FIELDNAME="visible"TYPE="int"LENGTH="4"NOTNULL="true"UNSIGNED="false"SEQUENCE="false"COMMENT="Whether this block instance is visible on this page."PREVIOUS="subpage"NEXT="region"/>
<FIELDNAME="region"TYPE="char"LENGTH="16"NOTNULL="true"SEQUENCE="false"COMMENT="Which block region on this page this block should appear in."PREVIOUS="visible"NEXT="weight"/>
<FIELDNAME="weight"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="false"SEQUENCE="false"COMMENT="Used to order the blocks within a block region."PREVIOUS="region"/>
<TABLENAME="external_services_functions"COMMENT="lists functions available in each service group"PREVIOUS="block_positions"NEXT="external_services_users">