diff --git a/mod/quiz/db/migrate2utf8.php b/mod/quiz/db/migrate2utf8.php
index 6dc32787420..6a9ffce43d7 100755
--- a/mod/quiz/db/migrate2utf8.php
+++ b/mod/quiz/db/migrate2utf8.php
@@ -9,8 +9,8 @@ function migrate2utf8_question_name($recordid){
}
$SQL = "SELECT qc.course
- FROM {$CFG->prefix}question_categories qc,
- {$CFG->prefix}question qq
+ FROM {$CFG->prefix}quiz_question_categories qc,
+ {$CFG->prefix}quiz_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('question','id',$recordid)) {
+ if (!$quizquestions = get_record('quiz_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('question',$newquizquestion);
+ update_record('quiz_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}question_categories qc,
- {$CFG->prefix}question qq
+ FROM {$CFG->prefix}quiz_question_categories qc,
+ {$CFG->prefix}quiz_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('question','id',$recordid)) {
+ if (!$quizquestions = get_record('quiz_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('question',$newquizquestion);
+ update_record('quiz_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}question_categories qc,
- {$CFG->prefix}question qq,
+ FROM {$CFG->prefix}quiz_question_categories qc,
+ {$CFG->prefix}quiz_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}question_categories qc,
- {$CFG->prefix}question qq,
+ FROM {$CFG->prefix}quiz_question_categories qc,
+ {$CFG->prefix}quiz_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}question_categories qc,
- {$CFG->prefix}question qq,
+ FROM {$CFG->prefix}quiz_question_categories qc,
+ {$CFG->prefix}quiz_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}question_categories qc,
- {$CFG->prefix}question qq,
- {$CFG->prefix}question_answers qa
+ FROM {$CFG->prefix}quiz_question_categories qc,
+ {$CFG->prefix}quiz_question qq,
+ {$CFG->prefix}quiz_question_answers qa
WHERE qc.id = qq.category
AND qq.id = qa.question
AND qa.id = $recordid";
@@ -277,7 +277,7 @@ function migrate2utf8_question_answers_answer($recordid){
return false;
}
- if (!$quizanswer= get_record('question_answers','id',$recordid)) {
+ if (!$quizanswer= get_record('quiz_question_answers','id',$recordid)) {
log_the_problem_somewhere();
return false;
}
@@ -301,7 +301,7 @@ function migrate2utf8_question_answers_answer($recordid){
$newquizanswer = new object;
$newquizanswer->id = $recordid;
$newquizanswer->answer = $result;
- update_record('question_answers',$newquizanswer);
+ update_record('quiz_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}question_categories qc,
- {$CFG->prefix}question qq,
- {$CFG->prefix}question_answers qa
+ FROM {$CFG->prefix}quiz_question_categories qc,
+ {$CFG->prefix}quiz_question qq,
+ {$CFG->prefix}quiz_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('question_answers','id',$recordid)) {
+ if (!$quizanswer= get_record('quiz_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('question_answers',$newquizanswer);
+ update_record('quiz_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}question_categories qc,
+ FROM {$CFG->prefix}quiz_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}question_categories qc
+ FROM {$CFG->prefix}quiz_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('question_categories','id',$recordid)) {
+ if (!$quizcategory = get_record('quiz_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('question_categories',$newquizcategory);
+ update_record('quiz_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}question_categories qc
+ FROM {$CFG->prefix}quiz_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('question_categories','id',$recordid)) {
+ if (!$quizcategory = get_record('quiz_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('question_categories',$newquizcategory);
+ update_record('quiz_question_categories',$newquizcategory);
}
/// And finally, just return the converted field
diff --git a/mod/quiz/db/migrate2utf8.xml b/mod/quiz/db/migrate2utf8.xml
index 888a9302850..0e79084db11 100755
--- a/mod/quiz/db/migrate2utf8.xml
+++ b/mod/quiz/db/migrate2utf8.xml
@@ -39,7 +39,7 @@