Skip to content

Commit

Permalink
Merge branch 'MDL-41760-master-v8' of https://github.com/jamiepratt/m…
Browse files Browse the repository at this point in the history
…oodle

Conflicts:
	version.php
  • Loading branch information
stronk7 committed Mar 19, 2014
2 parents b9add57 + 038014c commit 1c77432
Show file tree
Hide file tree
Showing 29 changed files with 1,232 additions and 401 deletions.
16 changes: 14 additions & 2 deletions lib/db/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1455,19 +1455,31 @@
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="hashcode" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" COMMENT="sha1 hash of serialized qubaids_condition class. Unique for every combination of class name and property."/>
<FIELD NAME="whichtries" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="questionid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="variant" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="subqid" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="aid" TYPE="char" LENGTH="100" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="response" TYPE="text" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="rcount" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="credit" TYPE="number" LENGTH="15" NOTNULL="true" SEQUENCE="false" DECIMALS="5"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
</KEYS>
</TABLE>
<TABLE NAME="question_response_count" COMMENT="Count for each responses for each try at a question.">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="analysisid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="try" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="rcount" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
<KEY NAME="analysisid" TYPE="foreign" FIELDS="analysisid" REFTABLE="question_response_analysis" REFFIELDS="id"/>
</KEYS>
</TABLE>
<TABLE NAME="mnet_application" COMMENT="Information about applications on remote hosts">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
Expand Down
59 changes: 59 additions & 0 deletions lib/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3124,5 +3124,64 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2014022600.00);
}

if ($oldversion < 2014031400.01) {
// Delete any cached stats to force recalculation later, then we can be sure that cached records will have the correct
// field.
$DB->delete_records('question_response_analysis');
$DB->delete_records('question_statistics');
$DB->delete_records('quiz_statistics');

// Define field response to be dropped from question_response_analysis.
$table = new xmldb_table('question_response_analysis');
$field = new xmldb_field('rcount');

// Conditionally launch drop field response.
if ($dbman->field_exists($table, $field)) {
$dbman->drop_field($table, $field);
}

// Main savepoint reached.
upgrade_main_savepoint(true, 2014031400.01);
}

if ($oldversion < 2014031400.02) {

// Define table question_response_count to be created.
$table = new xmldb_table('question_response_count');

// Adding fields to table question_response_count.
$table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);
$table->add_field('analysisid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
$table->add_field('try', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
$table->add_field('rcount', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);

// Adding keys to table question_response_count.
$table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
$table->add_key('analysisid', XMLDB_KEY_FOREIGN, array('analysisid'), 'question_response_analysis', array('id'));

// Conditionally launch create table for question_response_count.
if (!$dbman->table_exists($table)) {
$dbman->create_table($table);
}

// Main savepoint reached.
upgrade_main_savepoint(true, 2014031400.02);
}

if ($oldversion < 2014031400.03) {

// Define field whichtries to be added to question_response_analysis.
$table = new xmldb_table('question_response_analysis');
$field = new xmldb_field('whichtries', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null, 'hashcode');

// Conditionally launch add field whichtries.
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}

// Main savepoint reached.
upgrade_main_savepoint(true, 2014031400.03);
}

return true;
}
2 changes: 2 additions & 0 deletions mod/quiz/report/statistics/lang/en/quiz_statistics.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
$string['cic'] = 'Coefficient of internal consistency (for {$a})';
$string['completestatsfilename'] = 'completestats';
$string['count'] = 'Count';
$string['counttryno'] = 'Count Try {$a}';
$string['coursename'] = 'Course name';
$string['detailedanalysis'] = 'More detailed analysis of the responses to this question';
$string['detailedanalysisforvariant'] = 'More detailed analysis of the responses to variant {$a} of this question';
Expand Down Expand Up @@ -110,4 +111,5 @@
$string['statsfor'] = 'Quiz statistics (for {$a})';
$string['variant'] = 'Variant';
$string['variantno'] = 'Variant {$a}';
$string['whichtries'] = 'Analyze responses for';

Loading

0 comments on commit 1c77432

Please sign in to comment.