<DBMIGRATION type="mod/hotpot" VERSION="2005120100">
  <TABLES>
    <TABLE name="hotpot_attempts" />
    <TABLE name="hotpot_strings">
      <FIELDS>
          <FIELD name="string" method="PHP_FUNCTION" type="TEXT" length="0">
            <PHP_FUNCTION>
                migrate2utf8_hotpot_strings_string(RECORDID)
            </PHP_FUNCTION>
          </FIELD>
      </FIELDS>
    </TABLE>
    <TABLE name="hotpot_responses">
      <FIELDS>
          <FIELD name="correct" method="NO_CONV" type="varchar" length="255" />
          <FIELD name="wrong" method="NO_CONV" type="varchar" length="255" />
          <FIELD name="ignored" method="NO_CONV" type="varchar" length="255" />
      </FIELDS>
    </TABLE>
    <TABLE name="hotpot_details">
      <FIELDS>
        <FIELD name="details" method="PLAIN_SQL_UPDATE" type="text" length="0">
          <SQL_DETECT_USER>
           SELECT ha.userid
           FROM {$CFG->prefix}hotpot_attempts ha,
                {$CFG->prefix}hotpot_details hd
           WHERE ha.id = hd.attempt
                 AND hd.id = RECORDID
           </SQL_DETECT_USER>
          <SQL_DETECT_COURSE>
           SELECT h.course
           FROM {$CFG->prefix}hotpot h,
                {$CFG->prefix}hotpot_attempts ha,
                {$CFG->prefix}hotpot_details hd
           WHERE h.id = ha.hotpot
                 AND ha.id = hd.attempt
                 AND hd.id = RECORDID
          </SQL_DETECT_COURSE>
        </FIELD>
      </FIELDS>
    </TABLE>
    <TABLE name="hotpot_questions">
      <FIELDS>
        <FIELD name="name" method="PHP_FUNCTION" type="text" length="0" dropindex="hotpot_questions_name_idx" addindex=" hotpot_questions_name_idx (name(20))">
          <PHP_FUNCTION>
            migrate2utf8_hotpot_questions_name(RECORDID)
          </PHP_FUNCTION>
        </FIELD>
      </FIELDS>
    </TABLE>
    <TABLE name="hotpot">
      <FIELDS>
        <FIELD name="name" method="PHP_FUNCTION" type="varchar" length="255">
          <PHP_FUNCTION>
            migrate2utf8_hotpot_name(RECORDID)
          </PHP_FUNCTION>
        </FIELD>
        <FIELD name="reference" method="NO_CONV" type="varchar" length="255" />
        <FIELD name="summary" method="PHP_FUNCTION" type="text" length="0">
          <PHP_FUNCTION>
            migrate2utf8_hotpot_summary(RECORDID)
          </PHP_FUNCTION>
        </FIELD>
        <FIELD name="password" method="PHP_FUNCTION" type="varchar" length="255">
          <PHP_FUNCTION>
            migrate2utf8_hotpot_password(RECORDID)
          </PHP_FUNCTION>
        </FIELD>
        <FIELD name="subnet" method="NO_CONV" type="varchar" length="255" />
        <FIELD name="studentfeedbackurl" method="NO_CONV" type="varchar" length="255" />
      </FIELDS>
    </TABLE>
  </TABLES>
</DBMIGRATION>
