Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Backup last commit regarding to the "quiz_" prefixes. There must been…

… something wrong with the upgrade code that not renaming those tables.
  • Loading branch information...
commit 13c6d7e6bc14589d6f21d1850a52be99f05bcdab 1 parent 2df6965
patrickslee authored
Showing with 40 additions and 40 deletions.
  1. +30 −30 mod/quiz/db/migrate2utf8.php
  2. +10 −10 mod/quiz/db/migrate2utf8.xml
View
60 mod/quiz/db/migrate2utf8.php
@@ -9,8 +9,8 @@ function migrate2utf8_question_name($recordid){
}
$SQL = "SELECT qc.course
- FROM {$CFG->prefix}quiz_question_categories qc,
- {$CFG->prefix}quiz_question qq
+ FROM {$CFG->prefix}question_categories qc,
+ {$CFG->prefix}question qq
WHERE qc.id = qq.category
AND qq.id = $recordid";
@@ -19,7 +19,7 @@ function migrate2utf8_question_name($recordid){
return false;
}
- if (!$quizquestions = get_record('quiz_question','id',$recordid)) {
+ if (!$quizquestions = get_record('question','id',$recordid)) {
log_the_problem_somewhere();
return false;
}
@@ -42,7 +42,7 @@ function migrate2utf8_question_name($recordid){
$newquizquestion = new object;
$newquizquestion->id = $recordid;
$newquizquestion->name = $result;
- update_record('quiz_question',$newquizquestion);
+ update_record('question',$newquizquestion);
}
/// And finally, just return the converted field
return $result;
@@ -58,8 +58,8 @@ function migrate2utf8_question_questiontext($recordid){
}
$SQL = "SELECT qc.course
- FROM {$CFG->prefix}quiz_question_categories qc,
- {$CFG->prefix}quiz_question qq
+ FROM {$CFG->prefix}question_categories qc,
+ {$CFG->prefix}question qq
WHERE qc.id = qq.category
AND qq.id = $recordid";
@@ -68,7 +68,7 @@ function migrate2utf8_question_questiontext($recordid){
return false;
}
- if (!$quizquestions = get_record('quiz_question','id',$recordid)) {
+ if (!$quizquestions = get_record('question','id',$recordid)) {
log_the_problem_somewhere();
return false;
}
@@ -92,7 +92,7 @@ function migrate2utf8_question_questiontext($recordid){
$newquizquestion = new object;
$newquizquestion->id = $recordid;
$newquizquestion->questiontext = $result;
- update_record('quiz_question',$newquizquestion);
+ update_record('question',$newquizquestion);
}
/// And finally, just return the converted field
return $result;
@@ -109,8 +109,8 @@ function migrate2utf8_quiz_numerical_units_unit($recordid){
}
$SQL = "SELECT qc.course
- FROM {$CFG->prefix}quiz_question_categories qc,
- {$CFG->prefix}quiz_question qq,
+ FROM {$CFG->prefix}question_categories qc,
+ {$CFG->prefix}question qq,
{$CFG->prefix}quiz_numerical_units qnu
WHERE qc.id = qq.category
AND qq.id = qnu.question
@@ -161,8 +161,8 @@ function migrate2utf8_quiz_match_sub_questiontext($recordid){
}
$SQL = "SELECT qc.course
- FROM {$CFG->prefix}quiz_question_categories qc,
- {$CFG->prefix}quiz_question qq,
+ FROM {$CFG->prefix}question_categories qc,
+ {$CFG->prefix}question qq,
{$CFG->prefix}quiz_match_sub qms
WHERE qc.id = qq.category
AND qq.id = qms.question
@@ -213,8 +213,8 @@ function migrate2utf8_quiz_match_sub_answertext($recordid){
}
$SQL = "SELECT qc.course
- FROM {$CFG->prefix}quiz_question_categories qc,
- {$CFG->prefix}quiz_question qq,
+ FROM {$CFG->prefix}question_categories qc,
+ {$CFG->prefix}question qq,
{$CFG->prefix}quiz_match_sub qms
WHERE qc.id = qq.category
AND qq.id = qms.question
@@ -265,9 +265,9 @@ function migrate2utf8_question_answers_answer($recordid){
}
$SQL = "SELECT qc.course
- FROM {$CFG->prefix}quiz_question_categories qc,
- {$CFG->prefix}quiz_question qq,
- {$CFG->prefix}quiz_question_answers qa
+ FROM {$CFG->prefix}question_categories qc,
+ {$CFG->prefix}question qq,
+ {$CFG->prefix}question_answers qa
WHERE qc.id = qq.category
AND qq.id = qa.question
AND qa.id = $recordid";
@@ -301,7 +301,7 @@ function migrate2utf8_question_answers_answer($recordid){
$newquizanswer = new object;
$newquizanswer->id = $recordid;
$newquizanswer->answer = $result;
- update_record('quiz_question_answers',$newquizanswer);
+ update_record('question_answers',$newquizanswer);
}
/// And finally, just return the converted field
return $result;
@@ -317,9 +317,9 @@ function migrate2utf8_question_answers_feedback($recordid){
}
$SQL = "SELECT qc.course
- FROM {$CFG->prefix}quiz_question_categories qc,
- {$CFG->prefix}quiz_question qq,
- {$CFG->prefix}quiz_question_answers qa
+ FROM {$CFG->prefix}question_categories qc,
+ {$CFG->prefix}question qq,
+ {$CFG->prefix}question_answers qa
WHERE qc.id = qq.category
AND qq.id = qa.question
AND qa.id = $recordid";
@@ -329,7 +329,7 @@ function migrate2utf8_question_answers_feedback($recordid){
return false;
}
- if (!$quizanswer= get_record('quiz_question_answers','id',$recordid)) {
+ if (!$quizanswer= get_record('question_answers','id',$recordid)) {
log_the_problem_somewhere();
return false;
}
@@ -353,7 +353,7 @@ function migrate2utf8_question_answers_feedback($recordid){
$newquizanswer = new object;
$newquizanswer->id = $recordid;
$newquizanswer->feedback = $result;
- update_record('quiz_question_answers',$newquizanswer);
+ update_record('question_answers',$newquizanswer);
}
/// And finally, just return the converted field
return $result;
@@ -373,7 +373,7 @@ function migrate2utf8_quiz_dataset_definitions_name($recordid){
}
$SQL = "SELECT qc.course
- FROM {$CFG->prefix}quiz_question_categories qc,
+ FROM {$CFG->prefix}question_categories qc,
{$CFG->prefix}quiz_dataset_definitions qdd
WHERE qc.id = qdd.category
AND qdd.id = $recordid";
@@ -423,7 +423,7 @@ function migrate2utf8_question_categories_name($recordid){
}
$SQL = "SELECT qc.course
- FROM {$CFG->prefix}quiz_question_categories qc
+ FROM {$CFG->prefix}question_categories qc
WHERE qc.id = $recordid";
if (!$quiz = get_record_sql($SQL)) {
@@ -431,7 +431,7 @@ function migrate2utf8_question_categories_name($recordid){
return false;
}
- if (!$quizcategory = get_record('quiz_question_categories','id',$recordid)) {
+ if (!$quizcategory = get_record('question_categories','id',$recordid)) {
log_the_problem_somewhere();
return false;
}
@@ -455,7 +455,7 @@ function migrate2utf8_question_categories_name($recordid){
$newquizcategory = new object;
$newquizcategory->id = $recordid;
$newquizcategory->name = $result;
- update_record('quiz_question_categories',$newquizcategory);
+ update_record('question_categories',$newquizcategory);
}
/// And finally, just return the converted field
return $result;
@@ -471,7 +471,7 @@ function migrate2utf8_question_categories_info($recordid){
}
$SQL = "SELECT qc.course
- FROM {$CFG->prefix}quiz_question_categories qc
+ FROM {$CFG->prefix}question_categories qc
WHERE qc.id = $recordid";
if (!$quiz = get_record_sql($SQL)) {
@@ -479,7 +479,7 @@ function migrate2utf8_question_categories_info($recordid){
return false;
}
- if (!$quizcategory = get_record('quiz_question_categories','id',$recordid)) {
+ if (!$quizcategory = get_record('question_categories','id',$recordid)) {
log_the_problem_somewhere();
return false;
}
@@ -503,7 +503,7 @@ function migrate2utf8_question_categories_info($recordid){
$newquizcategory = new object;
$newquizcategory->id = $recordid;
$newquizcategory->info = $result;
- update_record('quiz_question_categories',$newquizcategory);
+ update_record('question_categories',$newquizcategory);
}
/// And finally, just return the converted field
View
20 mod/quiz/db/migrate2utf8.xml
@@ -39,7 +39,7 @@
<FIELD name="tolerance" method="NO_CONV" type="varchar" length="255" default="0.0" />
</FIELDS>
</TABLE>
- <TABLE name="quiz_question_sessions" />
+ <TABLE name="question_sessions" />
<TABLE name="quiz_multichoice">
<FIELDS>
<FIELD name="answers" method="NO_CONV" type="varchar" length="255" />
@@ -75,12 +75,12 @@
<FIELD name="layout" method="NO_CONV" type="text" length="0" />
</FIELDS>
</TABLE>
- <TABLE name="quiz_question_states">
+ <TABLE name="question_states">
<FIELDS>
<FIELD name="answer" method="PLAIN_SQL_UPDATE" type="text" length="0">
<SQL_DETECT_USER>
SELECT qa.userid
- FROM {$CFG->prefix}quiz_question_states qs,
+ FROM {$CFG->prefix}question_states qs,
{$CFG->prefix}quiz_attempts qa
WHERE qa.id = qs.attempt
AND qs.id=RECORDID
@@ -88,7 +88,7 @@
<SQL_DETECT_COURSE>
SELECT q.course
FROM {$CFG->prefix}quiz q,
- {$CFG->prefix}quiz_question_states qs,
+ {$CFG->prefix}question_states qs,
{$CFG->prefix}quiz_attempts qa
WHERE q.id = qa.quiz
AND qa.id = qs.attempt
@@ -97,7 +97,7 @@
</FIELD>
</FIELDS>
</TABLE>
- <TABLE name="quiz_question">
+ <TABLE name="question">
<FIELDS>
<FIELD name="name" method="PHP_FUNCTION" type="varchar" length="255">
<PHP_FUNCTION>
@@ -136,7 +136,7 @@
</FIELD>
</FIELDS>
</TABLE>
- <TABLE name="quiz_question_answers">
+ <TABLE name="question_answers">
<FIELDS>
<FIELD name="answer" method="PHP_FUNCTION" type="text" length="0">
<PHP_FUNCTION>
@@ -165,8 +165,8 @@
<FIELD name="response" method="PLAIN_SQL_UPDATE" type="text" length="0">
<SQL_DETECT_USER>
SELECT qa.userid
- FROM {$CFG->prefix}quiz_question_states qs,
- {$CFG->prefix}quiz_quiz_attempts qa,
+ FROM {$CFG->prefix}question_states qs,
+ {$CFG->prefix}quiz_attempts qa,
{$CFG->prefix}quiz_essay_states qes
WHERE qa.id = qs.attempt
AND qs.id = qes.stateid
@@ -176,7 +176,7 @@
SELECT q.course
FROM {$CFG->prefix}quiz q,
{$CFG->prefix}quiz_attempts qa,
- {$CFG->prefix}quiz_question_states qs,
+ {$CFG->prefix}question_states qs,
{$CFG->prefix}quiz_essay_states qes
WHERE q.id = qa.quiz
AND qa.id = qs.attempt
@@ -186,7 +186,7 @@
</FIELD>
</FIELDS>
</TABLE>
- <TABLE name="quiz_question_categories">
+ <TABLE name="question_categories">
<FIELDS>
<FIELD name="name" method="PHP_FUNCTION" type="varchar" length="255">
<PHP_FUNCTION>
Please sign in to comment.
Something went wrong with that request. Please try again.