<FIELDNAME="name"TYPE="char"LENGTH="255"NOTNULL="true"SEQUENCE="false"COMMENT="The name of this quiz."PREVIOUS="course"NEXT="intro"/>
<FIELDNAME="intro"TYPE="text"LENGTH="small"NOTNULL="true"SEQUENCE="false"COMMENT="The introductory text desplayed on the view.php page."PREVIOUS="name"NEXT="introformat"/>
<FIELDNAME="timeopen"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="Time at which students may start attempting this quiz."PREVIOUS="introformat"NEXT="timeclose"/>
<FIELDNAME="timeclose"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="Time by which students must have completed their attempt."PREVIOUS="timeopen"NEXT="optionflags"/>
<FIELDNAME="optionflags"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="This stores the adaptive mode setting for this quiz."PREVIOUS="timeclose"NEXT="penaltyscheme"/>
<FIELDNAME="penaltyscheme"TYPE="int"LENGTH="4"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="Stores the apply penaties setting."PREVIOUS="optionflags"NEXT="attempts"/>
<FIELDNAME="attempts"TYPE="int"LENGTH="6"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"COMMENT="The maximum number of attempts that a student is allowed at this quiz. 0 mean no limit."PREVIOUS="penaltyscheme"NEXT="attemptonlast"/>
<FIELDNAME="attemptonlast"TYPE="int"LENGTH="4"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"COMMENT="Whether each attempt builds on last mode is on."PREVIOUS="attempts"NEXT="grademethod"/>
<FIELDNAME="grademethod"TYPE="int"LENGTH="4"NOTNULL="true"UNSIGNED="false"DEFAULT="1"SEQUENCE="false"COMMENT="How individual attempt grades are combined to get the overall grade. From the top of mod/quiz/lib.php: 1 = QUIZ_GRADEHIGHEST, 2 = QUIZ_GRADEAVERAGE, 3 = QUIZ_ATTEMPTFIRST, 4 = QUIZ_ATTEMPTLAST."PREVIOUS="attemptonlast"NEXT="decimalpoints"/>
<FIELDNAME="decimalpoints"TYPE="int"LENGTH="4"NOTNULL="true"UNSIGNED="false"DEFAULT="2"SEQUENCE="false"COMMENT="Number of decimal points to display when printing scores belonging to this quiz."PREVIOUS="grademethod"NEXT="questiondecimalpoints"/>
<FIELDNAME="questiondecimalpoints"TYPE="int"LENGTH="4"NOTNULL="true"UNSIGNED="false"DEFAULT="-2"SEQUENCE="false"COMMENT="The number of decimal digits to use when displaying question grades. -1 = use decimalpoints, otherwise a separate setting."PREVIOUS="decimalpoints"NEXT="review"/>
<FIELDNAME="review"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="A bitfield encoding the Review options setting. Read the code of function quiz_get_reviewoptions from mod/quiz/locallib.php to see what each bit means."PREVIOUS="questiondecimalpoints"NEXT="questionsperpage"/>
<FIELDNAME="questionsperpage"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"COMMENT="This does not do exactly what the name suggests, and the behaviour depends on the shufflequestions setting."PREVIOUS="review"NEXT="shufflequestions"/>
<FIELDNAME="shufflequestions"TYPE="int"LENGTH="4"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"COMMENT="Whether the list of questions in the quiz should be randomly shuffled at the start of each attempt."PREVIOUS="questionsperpage"NEXT="shuffleanswers"/>
<FIELDNAME="shuffleanswers"TYPE="int"LENGTH="4"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"COMMENT="Whether, in question types that support it, individual parts of a question should be shuffled."PREVIOUS="shufflequestions"NEXT="questions"/>
<FIELDNAME="questions"TYPE="text"LENGTH="small"NOTNULL="true"SEQUENCE="false"COMMENT="Comma-separated list of questionids, with 0s for page breaks. The layout of questions in this quiz."PREVIOUS="shuffleanswers"NEXT="sumgrades"/>
<FIELDNAME="sumgrades"TYPE="number"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"DECIMALS="5"COMMENT="Total of the maximum grades you can get from each question. This is redundant, it is SELECT SUM(grade) FROM {quiz_question_instances} WHERE quiz = ?."PREVIOUS="questions"NEXT="grade"/>
<FIELDNAME="grade"TYPE="number"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"DECIMALS="5"COMMENT="Maximum grade that you can get from this quiz."PREVIOUS="sumgrades"NEXT="timecreated"/>
<FIELDNAME="timecreated"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="Timestamp when this quiz was created."PREVIOUS="grade"NEXT="timemodified"/>
<FIELDNAME="timemodified"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="Timestamp when this row was last updated."PREVIOUS="timecreated"NEXT="timelimit"/>
<FIELDNAME="timelimit"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="Time limit in seconds."PREVIOUS="timemodified"NEXT="password"/>
<FIELDNAME="password"TYPE="char"LENGTH="255"NOTNULL="true"SEQUENCE="false"COMMENT="Students must enter this password before they can attempt the quiz."PREVIOUS="timelimit"NEXT="subnet"/>
<FIELDNAME="subnet"TYPE="char"LENGTH="255"NOTNULL="true"SEQUENCE="false"COMMENT="If set, only allow attempts from certain IP addresses. The checking is performed by the address_in_subnet function from lib/moodlelib.php."PREVIOUS="password"NEXT="popup"/>
<FIELDNAME="popup"TYPE="int"LENGTH="4"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"COMMENT="Force the quiz to be attempted in a full-screen pop-up window with some evil JavaScript that attempts to prevent copying and pasting, etc."PREVIOUS="subnet"NEXT="delay1"/>
<FIELDNAME="delay1"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"COMMENT="Enforced delay between the first and second attempts, in seconds."PREVIOUS="popup"NEXT="delay2"/>
<FIELDNAME="delay2"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"COMMENT="Enforced delay between the second and subsequent attempts, in seconds."PREVIOUS="delay1"NEXT="showuserpicture"/>
<FIELDNAME="showuserpicture"TYPE="int"LENGTH="4"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"COMMENT="Option to show the user's picture during the attempt and on the review page."PREVIOUS="delay2"/>
<FIELDNAME="uniqueid"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="Foreign key references question_attempts.id, and hence links into the attempt information for each question in the attempt."PREVIOUS="id"NEXT="quiz"/>
<FIELDNAME="attempt"TYPE="int"LENGTH="6"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"COMMENT="The attempt number for this user on this quiz. It counts up from one. (quiz, userid, attempt) could be an alternate primary key for this table."PREVIOUS="userid"NEXT="sumgrades"/>
<FIELDNAME="sumgrades"TYPE="number"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"DECIMALS="5"COMMENT="The sum of the user's grades for all questions in this attempt."PREVIOUS="attempt"NEXT="timestart"/>
<FIELDNAME="timestart"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="The time this attempt started."PREVIOUS="sumgrades"NEXT="timefinish"/>
<FIELDNAME="timefinish"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="The time this attempt finished. If 0, this attempt is still open."PREVIOUS="timestart"NEXT="timemodified"/>
<FIELDNAME="timemodified"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="The time this attemtp was last modified. I think this is not changed by a regrade, and I don't know about what happens if a teacher manually grades a question. If you really need to know, look at the code, then update this comment. Thanks."PREVIOUS="timefinish"NEXT="layout"/>
<FIELDNAME="layout"TYPE="text"LENGTH="small"NOTNULL="true"SEQUENCE="false"COMMENT="A comma-separated list of question ids, with 0s for page breaks. If quiz.shuffequestions = 0, this will be the same as quiz.layout."PREVIOUS="timemodified"NEXT="preview"/>
<FIELDNAME="preview"TYPE="int"LENGTH="3"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="Used to distinguish preview attempts. Previews do not show up in reports; are deleted automatically when quiz settings are changed; and do not prevent the quiz from being edited."PREVIOUS="layout"/>
<TABLENAME="quiz_grades"COMMENT="The overall grade for each user on the quiz, based on their individual and the quiz.grademethod setting."PREVIOUS="quiz_attempts"NEXT="quiz_question_instances">
<FIELDNAME="grade"TYPE="number"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"DECIMALS="5"COMMENT="The overall grade from the quiz. Not affected by overrides in the gradebook."PREVIOUS="userid"NEXT="timemodified"/>
<FIELDNAME="timemodified"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="The last time this grade changed."PREVIOUS="grade"/>
<TABLENAME="quiz_question_instances"COMMENT="Stores the maximum possible grade (weight) for each question used in a quiz."PREVIOUS="quiz_grades"NEXT="quiz_feedback">
<FIELDNAME="grade"TYPE="number"LENGTH="12"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"DECIMALS="7"COMMENT="How many marks this question contributes to quiz.sumgrades."PREVIOUS="question"/>
<TABLENAME="quiz_feedback"COMMENT="Feedback given to students based on which grade band their overall score lies."PREVIOUS="quiz_question_instances"NEXT="quiz_report">
<FIELDNAME="feedbacktext"TYPE="text"LENGTH="small"NOTNULL="true"SEQUENCE="false"COMMENT="The feedback to show for a attempt where mingrade <= attempt grade < maxgrade. See function quiz_feedback_for_grade in mod/quiz/locallib.php."PREVIOUS="quizid"NEXT="mingrade"/>
<FIELDNAME="mingrade"TYPE="number"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"DECIMALS="5"COMMENT="The lower limit of this grade band. Inclusive."PREVIOUS="feedbacktext"NEXT="maxgrade"/>
<FIELDNAME="maxgrade"TYPE="number"LENGTH="10"NOTNULL="true"UNSIGNED="false"DEFAULT="0"SEQUENCE="false"DECIMALS="5"COMMENT="The upper limit of this grade band. Exclusive."PREVIOUS="mingrade"/>
<TABLENAME="quiz_report"COMMENT="Lists all the installed quiz reports and their display order and so on. No need to worry about deleting old records. Only records with an equivalent directory are displayed."PREVIOUS="quiz_feedback">
<FIELDNAME="name"TYPE="char"LENGTH="255"NOTNULL="false"SEQUENCE="false"COMMENT="name of the report, same as the directory name"PREVIOUS="id"NEXT="displayorder"/>
<FIELDNAME="displayorder"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"SEQUENCE="false"COMMENT="display order for report tabs"PREVIOUS="name"NEXT="lastcron"/>
<FIELDNAME="lastcron"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="timestamp when cron was last run for this report."PREVIOUS="displayorder"NEXT="cron"/>
<FIELDNAME="cron"TYPE="int"LENGTH="10"NOTNULL="true"UNSIGNED="true"DEFAULT="0"SEQUENCE="false"COMMENT="0 if there is no cron for this report (default) or the time between crons otherwise."PREVIOUS="lastcron"NEXT="capability"/>
<FIELDNAME="capability"TYPE="char"LENGTH="255"NOTNULL="false"SEQUENCE="false"COMMENT="Capability required to see this report. May be blank which means use the default of mod/quiz:viewreport. This is used when deciding which tabs to render."PREVIOUS="cron"/>