Browse Source

Change name of game_cross.rows to usedrows (MariaDB compatibility)

MOODLE_20_STABLE
bdaloukas 8 years ago
parent
commit
a16cc8846c
  1. 2
      backup/moodle2/backup_game_stepslib.php
  2. 8
      cross/cross_class.php
  3. 4
      cross/crossdb_class.php
  4. 7
      db/install.xml

2
backup/moodle2/backup_game_stepslib.php

@ -94,7 +94,7 @@ class backup_game_activity_structure_step extends backup_activity_structure_step
$crosss = new backup_nested_element('game_crosss');
$cross = new backup_nested_element('game_cross', array('id'), array(
'cols', 'rows', 'words', 'wordsall', 'createscore', 'createtries',
'usedcols', 'usedrows', 'words', 'wordsall', 'createscore', 'createtries',
'createtimelimit', 'createconnectors', 'createfilleds', 'createspaces', 'triesplay'));
$cryptexs = new backup_nested_element('game_cryptexs');

8
cross/cross_class.php

@ -461,8 +461,8 @@ class Cross
$crossm = new stdClass();
$crossm->datebegin = time();
$crossm->time = $time;
$crossm->cols = $cols;
$crossm->rows = $rows;
$crossm->usedcols = $cols;
$crossm->usedrows = $rows;
$crossm->words = count( $this->mbestcrosspos);
$crossm->wordsall = count( $this->minputanswers);
@ -774,8 +774,8 @@ class Cross
$this->mLegendh = array();
$this->mLegendv = array();
$sret = "CrosswordWidth = {$crossm->cols};\n";
$sret .= "CrosswordHeight = {$crossm->rows};\n";
$sret = "CrosswordWidth = {$crossm->usedcols};\n";
$sret .= "CrosswordHeight = {$crossm->usedrows};\n";
$sret .= "Words=".count( $crossd).";\n";
$swordlength = "";

4
cross/crossdb_class.php

@ -122,8 +122,8 @@ class CrossDB extends Cross {
$loadfromdb = ( $g == "");
$this->mmincol = $this->mminrow = 0;
$this->mmaxcol = $crossrec->cols;
$this->mmaxrow = $crossrec->rows;
$this->mmaxcol = $crossrec->usedcols;
$this->mmaxrow = $crossrec->usedrows;
if ($g == "") {
$g = str_repeat( ' ', $this->mmaxcol * $this->mmaxrow);

7
db/install.xml

@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="mod/game/db" VERSION="20160626" COMMENT="XMLDB file for Moodle mod/game"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd">
<TABLES>
<TABLE NAME="game" COMMENT="game">
<FIELDS>
@ -140,8 +139,8 @@
<TABLE NAME="game_cross" COMMENT="game_cross">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="cols" TYPE="char" LENGTH="50" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="rows" TYPE="int" LENGTH="3" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="usedcols" TYPE="char" LENGTH="50" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="usedrows" TYPE="int" LENGTH="3" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="words" TYPE="int" LENGTH="3" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="wordsall" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="createscore" TYPE="float" NOTNULL="false" SEQUENCE="false"/>

Loading…
Cancel
Save