1 <?xml version="1.0" encoding="UTF-8" ?>
2 <XMLDB PATH="mod/exercise/db" VERSION="20060810" COMMENT="XMLDB file for Moodle mod/exercise">
4 <TABLE NAME="exercise" COMMENT="Defines exercise" NEXT="exercise_submissions">
6 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="course"/>
7 <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="name"/>
8 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="course" NEXT="nelements"/>
9 <FIELD NAME="nelements" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="phase"/>
10 <FIELD NAME="phase" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="nelements" NEXT="gradingstrategy"/>
11 <FIELD NAME="gradingstrategy" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="phase" NEXT="usemaximum"/>
12 <FIELD NAME="usemaximum" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="gradingstrategy" NEXT="assessmentcomps"/>
13 <FIELD NAME="assessmentcomps" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="2" SEQUENCE="false" ENUM="false" PREVIOUS="usemaximum" NEXT="anonymous"/>
14 <FIELD NAME="anonymous" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="assessmentcomps" NEXT="maxbytes"/>
15 <FIELD NAME="maxbytes" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="100000" SEQUENCE="false" ENUM="false" PREVIOUS="anonymous" NEXT="deadline"/>
16 <FIELD NAME="deadline" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="maxbytes" NEXT="timemodified"/>
17 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="deadline" NEXT="grade"/>
18 <FIELD NAME="grade" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timemodified" NEXT="gradinggrade"/>
19 <FIELD NAME="gradinggrade" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="grade" NEXT="showleaguetable"/>
20 <FIELD NAME="showleaguetable" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="gradinggrade" NEXT="usepassword"/>
21 <FIELD NAME="usepassword" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="showleaguetable" NEXT="password"/>
22 <FIELD NAME="password" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="usepassword"/>
25 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for exercise"/>
28 <INDEX NAME="course" UNIQUE="false" FIELDS="course"/>
31 <TABLE NAME="exercise_submissions" COMMENT="Info about submitted work from teacher and students" PREVIOUS="exercise" NEXT="exercise_assessments">
33 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="exerciseid"/>
34 <FIELD NAME="exerciseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
35 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="exerciseid" NEXT="title"/>
36 <FIELD NAME="title" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="timecreated"/>
37 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="title" NEXT="resubmit"/>
38 <FIELD NAME="resubmit" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timecreated" NEXT="mailed"/>
39 <FIELD NAME="mailed" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="resubmit" NEXT="isexercise"/>
40 <FIELD NAME="isexercise" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="mailed" NEXT="late"/>
41 <FIELD NAME="late" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="isexercise"/>
44 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for exercise_submissions" NEXT="exerciseid"/>
45 <KEY NAME="exerciseid" TYPE="foreign" FIELDS="exerciseid" REFTABLE="exercise" REFFIELDS="id" PREVIOUS="primary"/>
48 <INDEX NAME="userid" UNIQUE="false" FIELDS="userid"/>
51 <TABLE NAME="exercise_assessments" COMMENT="Info about assessments by teacher and students" PREVIOUS="exercise_submissions" NEXT="exercise_elements">
53 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="exerciseid"/>
54 <FIELD NAME="exerciseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="submissionid"/>
55 <FIELD NAME="submissionid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="exerciseid" NEXT="userid"/>
56 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="submissionid" NEXT="timecreated"/>
57 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="timegraded"/>
58 <FIELD NAME="timegraded" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timecreated" NEXT="grade"/>
59 <FIELD NAME="grade" TYPE="float" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timegraded" NEXT="gradinggrade"/>
60 <FIELD NAME="gradinggrade" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="grade" NEXT="mailed"/>
61 <FIELD NAME="mailed" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="gradinggrade" NEXT="generalcomment"/>
62 <FIELD NAME="generalcomment" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="mailed" NEXT="teachercomment"/>
63 <FIELD NAME="teachercomment" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="generalcomment"/>
66 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for exercise_assessments" NEXT="exerciseid"/>
67 <KEY NAME="exerciseid" TYPE="foreign" FIELDS="exerciseid" REFTABLE="exercise" REFFIELDS="id" PREVIOUS="primary" NEXT="submissionid"/>
68 <KEY NAME="submissionid" TYPE="foreign" FIELDS="submissionid" REFTABLE="exercise_submissions" REFFIELDS="id" PREVIOUS="exerciseid"/>
71 <INDEX NAME="userid" UNIQUE="false" FIELDS="userid"/>
74 <TABLE NAME="exercise_elements" COMMENT="Info about marking scheme of assignment" PREVIOUS="exercise_assessments" NEXT="exercise_rubrics">
76 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="exerciseid"/>
77 <FIELD NAME="exerciseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="elementno"/>
78 <FIELD NAME="elementno" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="exerciseid" NEXT="description"/>
79 <FIELD NAME="description" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="elementno" NEXT="scale"/>
80 <FIELD NAME="scale" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="description" NEXT="maxscore"/>
81 <FIELD NAME="maxscore" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="scale" NEXT="weight"/>
82 <FIELD NAME="weight" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="11" SEQUENCE="false" ENUM="false" PREVIOUS="maxscore"/>
85 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for exercise_elements" NEXT="exerciseid"/>
86 <KEY NAME="exerciseid" TYPE="foreign" FIELDS="exerciseid" REFTABLE="exercise" REFFIELDS="id" PREVIOUS="primary"/>
89 <TABLE NAME="exercise_rubrics" COMMENT="Info about the rubrics marking scheme" PREVIOUS="exercise_elements" NEXT="exercise_grades">
91 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="exerciseid"/>
92 <FIELD NAME="exerciseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="elementno"/>
93 <FIELD NAME="elementno" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="exerciseid" NEXT="rubricno"/>
94 <FIELD NAME="rubricno" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="elementno" NEXT="description"/>
95 <FIELD NAME="description" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="rubricno"/>
98 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for exercise_rubrics" NEXT="exerciseid"/>
99 <KEY NAME="exerciseid" TYPE="foreign" FIELDS="exerciseid" REFTABLE="exercise" REFFIELDS="id" PREVIOUS="primary"/>
102 <TABLE NAME="exercise_grades" COMMENT="Info about individual grades given to each element" PREVIOUS="exercise_rubrics">
104 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="exerciseid"/>
105 <FIELD NAME="exerciseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="assessmentid"/>
106 <FIELD NAME="assessmentid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="exerciseid" NEXT="elementno"/>
107 <FIELD NAME="elementno" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="assessmentid" NEXT="feedback"/>
108 <FIELD NAME="feedback" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="elementno" NEXT="grade"/>
109 <FIELD NAME="grade" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="feedback"/>
112 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for exercise_grades" NEXT="exerciseid"/>
113 <KEY NAME="exerciseid" TYPE="foreign" FIELDS="exerciseid" REFTABLE="exercise" REFFIELDS="id" PREVIOUS="primary" NEXT="assessmentid"/>
114 <KEY NAME="assessmentid" TYPE="foreign" FIELDS="assessmentid" REFTABLE="exercise_assessements" REFFIELDS="id" PREVIOUS="exerciseid"/>
119 <STATEMENT NAME="insert log_display" TYPE="insert" TABLE="log_display" COMMENT="Initial insert of records on table log_display">
121 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('exercise', 'close', 'exercise', 'name')" />
122 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('exercise', 'open', 'exercise', 'name')" />
123 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('exercise', 'submit', 'exercise', 'name')" />
124 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('exercise', 'view', 'exercise', 'name')" />
125 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('exercise', 'update', 'exercise', 'name')" />