<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="mod/glossary/db" VERSION="20061114" COMMENT="XMLDB file for Moodle mod/glossary"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
  <TABLES>
    <TABLE NAME="glossary" COMMENT="all glossaries" NEXT="glossary_entries">
      <FIELDS>
        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="course"/>
        <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="name"/>
        <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="course" NEXT="intro"/>
        <FIELD NAME="intro" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="allowduplicatedentries"/>
        <FIELD NAME="allowduplicatedentries" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="intro" NEXT="displayformat"/>
        <FIELD NAME="displayformat" TYPE="char" LENGTH="50" NOTNULL="true" DEFAULT="dictionary" SEQUENCE="false" ENUM="false" PREVIOUS="allowduplicatedentries" NEXT="mainglossary"/>
        <FIELD NAME="mainglossary" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="displayformat" NEXT="showspecial"/>
        <FIELD NAME="showspecial" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="mainglossary" NEXT="showalphabet"/>
        <FIELD NAME="showalphabet" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="showspecial" NEXT="showall"/>
        <FIELD NAME="showall" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="showalphabet" NEXT="allowcomments"/>
        <FIELD NAME="allowcomments" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="showall" NEXT="allowprintview"/>
        <FIELD NAME="allowprintview" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="allowcomments" NEXT="usedynalink"/>
        <FIELD NAME="usedynalink" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="allowprintview" NEXT="defaultapproval"/>
        <FIELD NAME="defaultapproval" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="usedynalink" NEXT="globalglossary"/>
        <FIELD NAME="globalglossary" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="defaultapproval" NEXT="entbypage"/>
        <FIELD NAME="entbypage" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="10" SEQUENCE="false" ENUM="false" PREVIOUS="globalglossary" NEXT="editalways"/>
        <FIELD NAME="editalways" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="entbypage" NEXT="rsstype"/>
        <FIELD NAME="rsstype" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="editalways" NEXT="rssarticles"/>
        <FIELD NAME="rssarticles" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="rsstype" NEXT="assessed"/>
        <FIELD NAME="assessed" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="rssarticles" NEXT="assesstimestart"/>
        <FIELD NAME="assesstimestart" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="assessed" NEXT="assesstimefinish"/>
        <FIELD NAME="assesstimefinish" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="assesstimestart" NEXT="scale"/>
        <FIELD NAME="scale" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="assesstimefinish" NEXT="timecreated"/>
        <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="scale" NEXT="timemodified"/>
        <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timecreated"/>
      </FIELDS>
      <KEYS>
        <KEY NAME="primary" TYPE="primary" FIELDS="id" />
      </KEYS>
      <INDEXES>
        <INDEX NAME="course" UNIQUE="false" FIELDS="course"/>
      </INDEXES>
    </TABLE>
    <TABLE NAME="glossary_entries" COMMENT="all glossary entries" PREVIOUS="glossary" NEXT="glossary_alias">
      <FIELDS>
        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="glossaryid"/>
        <FIELD NAME="glossaryid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
        <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="glossaryid" NEXT="concept"/>
        <FIELD NAME="concept" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="definition"/>
        <FIELD NAME="definition" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="concept" NEXT="format"/>
        <FIELD NAME="format" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="definition" NEXT="attachment"/>
        <FIELD NAME="attachment" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="format" NEXT="timecreated"/>
        <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="attachment" NEXT="timemodified"/>
        <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timecreated" NEXT="teacherentry"/>
        <FIELD NAME="teacherentry" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timemodified" NEXT="sourceglossaryid"/>
        <FIELD NAME="sourceglossaryid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="teacherentry" NEXT="usedynalink"/>
        <FIELD NAME="usedynalink" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="sourceglossaryid" NEXT="casesensitive"/>
        <FIELD NAME="casesensitive" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="usedynalink" NEXT="fullmatch"/>
        <FIELD NAME="fullmatch" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="casesensitive" NEXT="approved"/>
        <FIELD NAME="approved" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="fullmatch"/>
      </FIELDS>
      <KEYS>
        <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="glossaryid"/>
        <KEY NAME="glossaryid" TYPE="foreign" FIELDS="glossaryid" REFTABLE="glossary" REFFIELDS="id" PREVIOUS="primary"/>
      </KEYS>
      <INDEXES>
        <INDEX NAME="userid" UNIQUE="false" FIELDS="userid" NEXT="concept"/>
        <INDEX NAME="concept" UNIQUE="false" FIELDS="concept" PREVIOUS="userid"/>
      </INDEXES>
    </TABLE>
    <TABLE NAME="glossary_alias" COMMENT="entries alias" PREVIOUS="glossary_entries" NEXT="glossary_categories">
      <FIELDS>
        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="entryid"/>
        <FIELD NAME="entryid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="alias"/>
        <FIELD NAME="alias" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="entryid"/>
      </FIELDS>
      <KEYS>
        <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="entryid"/>
        <KEY NAME="entryid" TYPE="foreign" FIELDS="entryid" REFTABLE="glossary_entries" REFFIELDS="id" PREVIOUS="primary"/>
      </KEYS>
    </TABLE>
    <TABLE NAME="glossary_categories" COMMENT="all categories for glossary entries" PREVIOUS="glossary_alias" NEXT="glossary_entries_categories">
      <FIELDS>
        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="glossaryid"/>
        <FIELD NAME="glossaryid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="name"/>
        <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="glossaryid" NEXT="usedynalink"/>
        <FIELD NAME="usedynalink" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="name"/>
      </FIELDS>
      <KEYS>
        <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="glossaryid"/>
        <KEY NAME="glossaryid" TYPE="foreign" FIELDS="glossaryid" REFTABLE="glossary" REFFIELDS="id" PREVIOUS="primary"/>
      </KEYS>
    </TABLE>
    <TABLE NAME="glossary_entries_categories" COMMENT="categories of each glossary entry" PREVIOUS="glossary_categories" NEXT="glossary_comments">
      <FIELDS>
        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="categoryid"/>
        <FIELD NAME="categoryid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="entryid"/>
        <FIELD NAME="entryid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="categoryid"/>
      </FIELDS>
      <KEYS>
        <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="categoryid"/>
        <KEY NAME="categoryid" TYPE="foreign" FIELDS="categoryid" REFTABLE="glossary_categories" REFFIELDS="id" PREVIOUS="primary" NEXT="entryid"/>
        <KEY NAME="entryid" TYPE="foreign" FIELDS="entryid" REFTABLE="glossary_entries" REFFIELDS="id" PREVIOUS="categoryid"/>
      </KEYS>
    </TABLE>
    <TABLE NAME="glossary_comments" COMMENT="comments on glossary entries" PREVIOUS="glossary_entries_categories" NEXT="glossary_formats">
      <FIELDS>
        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="entryid"/>
        <FIELD NAME="entryid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
        <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="entryid" NEXT="entrycomment"/>
        <FIELD NAME="entrycomment" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="format"/>
        <FIELD NAME="format" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="entrycomment" NEXT="timemodified"/>
        <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="format"/>
      </FIELDS>
      <KEYS>
        <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="entryid"/>
        <KEY NAME="entryid" TYPE="foreign" FIELDS="entryid" REFTABLE="glossary_entries" REFFIELDS="id" PREVIOUS="primary"/>
      </KEYS>
      <INDEXES>
        <INDEX NAME="userid" UNIQUE="false" FIELDS="userid"/>
      </INDEXES>
    </TABLE>
    <TABLE NAME="glossary_formats" COMMENT="Setting of the display formats" PREVIOUS="glossary_comments" NEXT="glossary_ratings">
      <FIELDS>
        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="name"/>
        <FIELD NAME="name" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="popupformatname"/>
        <FIELD NAME="popupformatname" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="visible"/>
        <FIELD NAME="visible" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="popupformatname" NEXT="showgroup"/>
        <FIELD NAME="showgroup" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="visible" NEXT="defaultmode"/>
        <FIELD NAME="defaultmode" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="showgroup" NEXT="defaulthook"/>
        <FIELD NAME="defaulthook" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="defaultmode" NEXT="sortkey"/>
        <FIELD NAME="sortkey" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="defaulthook" NEXT="sortorder"/>
        <FIELD NAME="sortorder" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="sortkey"/>
      </FIELDS>
      <KEYS>
        <KEY NAME="primary" TYPE="primary" FIELDS="id" />
      </KEYS>
    </TABLE>
    <TABLE NAME="glossary_ratings" COMMENT="Contains user ratings for entries" PREVIOUS="glossary_formats">
      <FIELDS>
        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="userid"/>
        <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="entryid"/>
        <FIELD NAME="entryid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="time"/>
        <FIELD NAME="time" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="entryid" NEXT="rating"/>
        <FIELD NAME="rating" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="time"/>
      </FIELDS>
      <KEYS>
        <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="entryid"/>
        <KEY NAME="entryid" TYPE="foreign" FIELDS="entryid" REFTABLE="glossary_entries" REFFIELDS="id" PREVIOUS="primary"/>
      </KEYS>
      <INDEXES>
        <INDEX NAME="userid" UNIQUE="false" FIELDS="userid"/>
      </INDEXES>
    </TABLE>
  </TABLES>
  <STATEMENTS>
    <STATEMENT NAME="insert log_display" TYPE="insert" TABLE="log_display" COMMENT="Initial insert of records on table log_display">
      <SENTENCES>
        <SENTENCE TEXT="(module, action, mtable, field) VALUES ('glossary', 'add', 'glossary', 'name')" />
        <SENTENCE TEXT="(module, action, mtable, field) VALUES ('glossary', 'update', 'glossary', 'name')" />
        <SENTENCE TEXT="(module, action, mtable, field) VALUES ('glossary', 'view', 'glossary', 'name')" />
        <SENTENCE TEXT="(module, action, mtable, field) VALUES ('glossary', 'view all', 'glossary', 'name')" />
        <SENTENCE TEXT="(module, action, mtable, field) VALUES ('glossary', 'add entry', 'glossary', 'name')" />
        <SENTENCE TEXT="(module, action, mtable, field) VALUES ('glossary', 'update entry', 'glossary', 'name')" />
        <SENTENCE TEXT="(module, action, mtable, field) VALUES ('glossary', 'add category', 'glossary', 'name')" />
        <SENTENCE TEXT="(module, action, mtable, field) VALUES ('glossary', 'update category', 'glossary', 'name')" />
        <SENTENCE TEXT="(module, action, mtable, field) VALUES ('glossary', 'delete category', 'glossary', 'name')" />
        <SENTENCE TEXT="(module, action, mtable, field) VALUES ('glossary', 'add comment', 'glossary', 'name')" />
        <SENTENCE TEXT="(module, action, mtable, field) VALUES ('glossary', 'update comment', 'glossary', 'name')" />
        <SENTENCE TEXT="(module, action, mtable, field) VALUES ('glossary', 'delete comment', 'glossary', 'name')" />
        <SENTENCE TEXT="(module, action, mtable, field) VALUES ('glossary', 'approve entry', 'glossary', 'name')" />
        <SENTENCE TEXT="(module, action, mtable, field) VALUES ('glossary', 'view entry', 'glossary_entries', 'concept')" />
      </SENTENCES>
    </STATEMENT>
  </STATEMENTS>
</XMLDB>
