<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="question/type/stack/db" VERSION="20240324" COMMENT="XMLDB file for Moodle question/type/stack"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:noNamespaceSchemaLocation="../../../../lib/xmldb/xmldb.xsd"
>
  <TABLES>
    <TABLE NAME="qtype_stack_options" COMMENT="Stores the main options for each Stack question">
      <FIELDS>
        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
        <FIELD NAME="questionid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="Foreign key link to question.id"/>
        <FIELD NAME="stackversion" TYPE="text" NOTNULL="false" SEQUENCE="false" COMMENT="The version of the STACK plugin on which this question was authored."/>
        <FIELD NAME="isbroken" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Has this question been saved in a broken state."/>
        <FIELD NAME="questionvariables" TYPE="text" NOTNULL="true" SEQUENCE="false" COMMENT="Maxima code that is run when the question is started to initialise variables."/>
        <FIELD NAME="specificfeedback" TYPE="text" NOTNULL="true" SEQUENCE="false" COMMENT="CAS text for the specific feedback for the question."/>
        <FIELD NAME="specificfeedbackformat" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="The FORMAT_... for the specific feedback"/>
        <FIELD NAME="questionnote" TYPE="text" NOTNULL="true" SEQUENCE="false" COMMENT="CAS text. This should be a short summary of which random variant of the question the student saw."/>
        <FIELD NAME="questionnoteformat" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="The FORMAT_... for the question note"/>
        <FIELD NAME="questiondescription" TYPE="text" NOTNULL="false" SEQUENCE="false" COMMENT="CAS text. This field is used to store a description/nararive about the question itself."/>
        <FIELD NAME="questiondescriptionformat" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="The FORMAT_... for the question description"/>
        <FIELD NAME="questionsimplify" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="1" SEQUENCE="false" COMMENT="Whether to simplify expressions in the question text, question variables, etc."/>
        <FIELD NAME="assumepositive" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Whether to assume that variables are positive."/>
        <FIELD NAME="assumereal" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Whether to assume that variables are real."/>
        <FIELD NAME="prtcorrect" TYPE="text" NOTNULL="true" SEQUENCE="false" COMMENT="Standard feedback displayed for any PRT that returns a score of 1."/>
        <FIELD NAME="prtcorrectformat" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Text format for prtcorrect."/>
        <FIELD NAME="prtpartiallycorrect" TYPE="text" NOTNULL="true" SEQUENCE="false" COMMENT="Standard feedback displayed for any PRT that returns a score between 0 and 1."/>
        <FIELD NAME="prtpartiallycorrectformat" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Text format for the prtpartiallycorrect field."/>
        <FIELD NAME="prtincorrect" TYPE="text" NOTNULL="true" SEQUENCE="false" COMMENT="Standard feedback displayed for any PRT that returns a score of 0."/>
        <FIELD NAME="prtincorrectformat" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Text format for the prtincorrect field."/>
        <FIELD NAME="decimals" TYPE="char" LENGTH="8" NOTNULL="true" DEFAULT="." SEQUENCE="false" COMMENT="The symbol to use for the decimal separator."/>
        <FIELD NAME="scientificnotation" TYPE="char" LENGTH="8" NOTNULL="true" DEFAULT="*10" SEQUENCE="false" COMMENT="Controls display of numbers written in scientific notation."/>
        <FIELD NAME="multiplicationsign" TYPE="char" LENGTH="8" NOTNULL="true" DEFAULT="dot" SEQUENCE="false" COMMENT="The symbol to use for multiplication."/>
        <FIELD NAME="sqrtsign" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="1" SEQUENCE="false" COMMENT="Whether to display square roots as surds."/>
        <FIELD NAME="complexno" TYPE="char" LENGTH="8" NOTNULL="true" DEFAULT="i" SEQUENCE="false" COMMENT="How complex numbers should be displayed and represented."/>
        <FIELD NAME="inversetrig" TYPE="char" LENGTH="8" NOTNULL="true" DEFAULT="cos-1" SEQUENCE="false" COMMENT="How the inverse trigonometric function should be displayed. The valid values are cos-1, acos or arccos."/>
        <FIELD NAME="logicsymbol" TYPE="char" LENGTH="8" NOTNULL="true" DEFAULT="lang" SEQUENCE="false" COMMENT="How logical symbols should be displayed. The valid values are lang or symbol."/>
        <FIELD NAME="matrixparens" TYPE="char" LENGTH="8" NOTNULL="true" DEFAULT="[" SEQUENCE="false" COMMENT="The parentheses used to surround matrices."/>
        <FIELD NAME="variantsselectionseed" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" COMMENT="If set, used to control the random seed in a deterministic way, so different questions in the quiz can use the same random variable values."/>
        <FIELD NAME="compiledcache" TYPE="text" NOTNULL="false" SEQUENCE="false" COMMENT="The prevalidated CAS expressions used for processing various things. Stored as JSON. Thrown away every time the question is changed / saved or the question type is updated."/>
      </FIELDS>
      <KEYS>
        <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
        <KEY NAME="questionid" TYPE="foreign-unique" FIELDS="questionid" REFTABLE="question" REFFIELDS="id"/>
      </KEYS>
    </TABLE>
    <TABLE NAME="qtype_stack_inputs" COMMENT="One row for each input in the question.">
      <FIELDS>
        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
        <FIELD NAME="questionid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="Foreign key referencing question.id."/>
        <FIELD NAME="name" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" COMMENT="The name of the input element."/>
        <FIELD NAME="type" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" COMMENT="The type of input element this is."/>
        <FIELD NAME="tans" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="The model answer for this input, that could be part of a correct solution."/>
        <FIELD NAME="boxsize" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="15" SEQUENCE="false" COMMENT="The desired size for the input."/>
        <FIELD NAME="strictsyntax" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="1" SEQUENCE="false" COMMENT="Whether this input element should validate the input strictly."/>
        <FIELD NAME="insertstars" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Whether this input should automatically insert *s where there is implicit multiplication."/>
        <FIELD NAME="syntaxhint" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="An optional initial value to display in the input to help the student know what to type."/>
        <FIELD NAME="syntaxattribute" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="If 0 then the syntax hint is used as the value attribute, otherwise the syntax hint is a placeholder."/>
        <FIELD NAME="forbidwords" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="Any additional words (e.g. function names) that the student is not permitted to use in this input."/>
        <FIELD NAME="allowwords" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="Any additional words (e.g. function names) that the student is permitted to use in this input."/>
        <FIELD NAME="forbidfloat" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="1" SEQUENCE="false" COMMENT="Whether floating point numbers should be rejected in this input."/>
        <FIELD NAME="requirelowestterms" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Whether any fractions in the input must be given in lowest terms."/>
        <FIELD NAME="checkanswertype" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Whether the type of the students answer (expression, list, ...) should be validated to ensure it is the same as tans."/>
        <FIELD NAME="mustverify" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="1" SEQUENCE="false" COMMENT="Whether the interpretation of this input must be verified by the student before it is graded."/>
        <FIELD NAME="showvalidation" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="1" SEQUENCE="false" COMMENT="Whether the validation results for this input should be displayed."/>
        <FIELD NAME="options" TYPE="text" NOTNULL="true" SEQUENCE="false" COMMENT="Extra options that are interpreted in an input-specific way."/>
      </FIELDS>
      <KEYS>
        <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
        <KEY NAME="questionid" TYPE="foreign" FIELDS="questionid" REFTABLE="question" REFFIELDS="id"/>
      </KEYS>
      <INDEXES>
        <INDEX NAME="questionid-name" UNIQUE="true" FIELDS="questionid, name"/>
      </INDEXES>
    </TABLE>
    <TABLE NAME="qtype_stack_prts" COMMENT="One row for each PRT in the question.">
      <FIELDS>
        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
        <FIELD NAME="questionid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="Foreign key reference to question.id."/>
        <FIELD NAME="name" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" COMMENT="The name used to identify this PRT."/>
        <FIELD NAME="value" TYPE="number" LENGTH="12" NOTNULL="true" DEFAULT="1" SEQUENCE="false" DECIMALS="7" COMMENT="The maximum score this PRT can contribute to the question."/>
        <FIELD NAME="autosimplify" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="1" SEQUENCE="false" COMMENT="Whether to automatically simplify the variables used in this tree."/>
        <FIELD NAME="feedbackstyle" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="1" SEQUENCE="false" COMMENT="Controls how PRT feedback is displayed."/>
        <FIELD NAME="feedbackvariables" TYPE="text" NOTNULL="true" SEQUENCE="false" COMMENT="Additional expressions that should be computed before evaluating this tree."/>
        <FIELD NAME="firstnodename" TYPE="char" LENGTH="8" NOTNULL="true" SEQUENCE="false" COMMENT="Refers to qtype_stack_prt_nodes.nodename of the first node in the tree."/>
      </FIELDS>
      <KEYS>
        <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
        <KEY NAME="questionid" TYPE="foreign" FIELDS="questionid" REFTABLE="question" REFFIELDS="id"/>
        <KEY NAME="questionid-name" TYPE="unique" FIELDS="questionid, name"/>
      </KEYS>
    </TABLE>
    <TABLE NAME="qtype_stack_prt_nodes" COMMENT="One row for each node in each PRT in the question.">
      <FIELDS>
        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
        <FIELD NAME="questionid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="Foreign key reference to question.id"/>
        <FIELD NAME="prtname" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" COMMENT="foreign key reference to qtype_stack_prts.name"/>
        <FIELD NAME="nodename" TYPE="char" LENGTH="8" NOTNULL="true" SEQUENCE="false" COMMENT="Unique identifier for the node. Currently we use 1, 2, 3, ..."/>
        <FIELD NAME="description" TYPE="char" LENGTH="255" NOTNULL="false" DEFAULT="" SEQUENCE="false" COMMENT="We store meaningful node purpose."/>
        <FIELD NAME="answertest" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" COMMENT="What answer test to apply at this node."/>
        <FIELD NAME="sans" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="What expression to feed into the sans side of the answer test."/>
        <FIELD NAME="tans" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="What expression to feed into the tans side of the answer test."/>
        <FIELD NAME="testoptions" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="Any options to pass to the answer test."/>
        <FIELD NAME="quiet" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Whether to suppress any feedback generated by the answer test."/>
        <FIELD NAME="truescoremode" TYPE="char" LENGTH="4" NOTNULL="true" DEFAULT="=" SEQUENCE="false" COMMENT="How to adjust the score when the test is true."/>
        <FIELD NAME="truescore" TYPE="char" LENGTH="255" NOTNULL="true" DEFAULT="1" SEQUENCE="false" COMMENT="The number used in the score adjustment when the answer test returns true."/>
        <FIELD NAME="truepenalty" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" COMMENT="The penalty to use when the test returns true."/>
        <FIELD NAME="truenextnode" TYPE="char" LENGTH="8" NOTNULL="false" SEQUENCE="false" COMMENT="The node name to go to next when the test returns true."/>
        <FIELD NAME="trueanswernote" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="The answer note to append when the test returns true."/>
        <FIELD NAME="truefeedback" TYPE="text" NOTNULL="true" SEQUENCE="false" COMMENT="Any extra feedback to add when the test returns true."/>
        <FIELD NAME="truefeedbackformat" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="The text format of truefeedback."/>
        <FIELD NAME="falsescoremode" TYPE="char" LENGTH="4" NOTNULL="true" DEFAULT="=" SEQUENCE="false" COMMENT="How to adjust the score when the test is false."/>
        <FIELD NAME="falsescore" TYPE="char" LENGTH="255" NOTNULL="false" DEFAULT="0" SEQUENCE="false" COMMENT="The number used in the score adjustment when the answer test returns false."/>
        <FIELD NAME="falsepenalty" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" COMMENT="The penalty to use when the test returns false."/>
        <FIELD NAME="falsenextnode" TYPE="char" LENGTH="8" NOTNULL="false" SEQUENCE="false" COMMENT="The node name to go to next when the test returns false."/>
        <FIELD NAME="falseanswernote" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="The answer note to append when the test returns false."/>
        <FIELD NAME="falsefeedback" TYPE="text" NOTNULL="true" SEQUENCE="false" COMMENT="Any extra feedback to add when the test returns false."/>
        <FIELD NAME="falsefeedbackformat" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="The text format of falsefeedback."/>
      </FIELDS>
      <KEYS>
        <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
        <KEY NAME="questionid-name" TYPE="foreign" FIELDS="questionid, prtname" REFTABLE="qtype_stack_prts" REFFIELDS="questionid, name"/>
      </KEYS>
      <INDEXES>
        <INDEX NAME="questionid-prtname-nodename" UNIQUE="true" FIELDS="questionid, prtname, nodename"/>
      </INDEXES>
    </TABLE>
    <TABLE NAME="qtype_stack_cas_cache" COMMENT="Caches the resuts of calls to Maxima.">
      <FIELDS>
        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
        <FIELD NAME="hash" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" COMMENT="The SHA1 hash of command. Used for quick look-ups"/>
        <FIELD NAME="command" TYPE="text" NOTNULL="true" SEQUENCE="false" COMMENT="The Maxima code that was sent to Maxima."/>
        <FIELD NAME="result" TYPE="text" NOTNULL="true" SEQUENCE="false" COMMENT="The unpacked results from Maxima."/>
      </FIELDS>
      <KEYS>
        <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
      </KEYS>
      <INDEXES>
        <INDEX NAME="hash" UNIQUE="false" FIELDS="hash"/>
      </INDEXES>
    </TABLE>
    <TABLE NAME="qtype_stack_qtests" COMMENT="One row for each questiontest for each question.">
      <FIELDS>
        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
        <FIELD NAME="questionid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="Foreign key link to question.id"/>
        <FIELD NAME="description" TYPE="char" LENGTH="255" NOTNULL="false" DEFAULT="" SEQUENCE="false" COMMENT="We store meaningful test purpose."/>
        <FIELD NAME="testcase" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="Sequential number for this testcase within this question."/>
        <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/>
      </FIELDS>
      <KEYS>
        <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
        <KEY NAME="questionid" TYPE="foreign" FIELDS="questionid" REFTABLE="question" REFFIELDS="id"/>
        <KEY NAME="questionid-testcase" TYPE="unique" FIELDS="questionid, testcase"/>
      </KEYS>
    </TABLE>
    <TABLE NAME="qtype_stack_qtest_inputs" COMMENT="The value for each input for the question tests.">
      <FIELDS>
        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
        <FIELD NAME="questionid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="Foreign key reference to question.id."/>
        <FIELD NAME="testcase" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="foreign key reference to qtype_stack_qtests.testcase."/>
        <FIELD NAME="inputname" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" COMMENT="The name of the input."/>
        <FIELD NAME="value" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="The value to enter into this input for this test."/>
      </FIELDS>
      <KEYS>
        <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
        <KEY NAME="questionid-testcase" TYPE="foreign" FIELDS="questionid, testcase" REFTABLE="qtype_stack_qtests" REFFIELDS="questionid, testcase"/>
      </KEYS>
      <INDEXES>
        <INDEX NAME="questionid-testcase-inputname" UNIQUE="true" FIELDS="questionid, testcase, inputname"/>
      </INDEXES>
    </TABLE>
    <TABLE NAME="qtype_stack_qtest_expected" COMMENT="Holds the expected outcomes for each PRT for this question test.">
      <FIELDS>
        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
        <FIELD NAME="questionid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="Foreign key reference to question.id."/>
        <FIELD NAME="testcase" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="Foreign key reference to qtype_stack_qtests.testcase."/>
        <FIELD NAME="prtname" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" COMMENT="The name of the PRT for which these are the expected outcomes."/>
        <FIELD NAME="expectedscore" TYPE="number" LENGTH="12" NOTNULL="false" SEQUENCE="false" DECIMALS="7" COMMENT="The expected score."/>
        <FIELD NAME="expectedpenalty" TYPE="number" LENGTH="12" NOTNULL="false" SEQUENCE="false" DECIMALS="7" COMMENT="The expected penalty."/>
        <FIELD NAME="expectedanswernote" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="The expected answer note."/>
      </FIELDS>
      <KEYS>
        <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
        <KEY NAME="questionid-testcase" TYPE="foreign" FIELDS="questionid, testcase" REFTABLE="qtype_stack_qtests" REFFIELDS="questionid, testcase"/>
      </KEYS>
      <INDEXES>
        <INDEX NAME="questionid-testcase-prtname" UNIQUE="true" FIELDS="questionid, testcase, prtname"/>
      </INDEXES>
    </TABLE>
    <TABLE NAME="qtype_stack_qtest_results" COMMENT="Stores the result the last time each question test was run for each variant of a question">
      <FIELDS>
        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
        <FIELD NAME="questionid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="The question this test result belongs to."/>
        <FIELD NAME="testcase" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="Which testcase number this result relates to (as in stack_qtests.testscase)"/>
        <FIELD NAME="seed" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="The seed when this question test was run."/>
        <FIELD NAME="result" TYPE="int" LENGTH="4" NOTNULL="true" SEQUENCE="false" COMMENT="1 = test passed. 0 = test failed."/>
        <FIELD NAME="timerun" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="The time when the question test was executed to give this result."/>
      </FIELDS>
      <KEYS>
        <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
        <KEY NAME="questionid-testcase" TYPE="foreign" FIELDS="questionid, testcase" REFTABLE="qtype_stack_qtests" REFFIELDS="questionid, testcase"/>
      </KEYS>
      <INDEXES>
        <INDEX NAME="questionid-testcase-seed" UNIQUE="true" FIELDS="questionid, testcase, seed"/>
      </INDEXES>
    </TABLE>
    <TABLE NAME="qtype_stack_deployed_seeds" COMMENT="Holds the seeds for the variants of each question that have been deployed.">
      <FIELDS>
        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
        <FIELD NAME="questionid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="Foreign key link to question.id."/>
        <FIELD NAME="seed" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="The seed that has been deployed."/>
      </FIELDS>
      <KEYS>
        <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
        <KEY NAME="questionid" TYPE="foreign" FIELDS="questionid" REFTABLE="question" REFFIELDS="id"/>
      </KEYS>
      <INDEXES>
        <INDEX NAME="questionid-seed" UNIQUE="true" FIELDS="questionid, seed"/>
      </INDEXES>
    </TABLE>
  </TABLES>
</XMLDB>
