more bug fixes =(
This commit is contained in:
+81
-16
@@ -406,6 +406,39 @@ function migrate2utf8_cache_text_formattedtext($recordid){
|
||||
return $result;
|
||||
}
|
||||
|
||||
function migrate2utf8_grade_category_name($recordid){
|
||||
global $CFG;
|
||||
|
||||
/// Some trivial checks
|
||||
if (empty($recordid)) {
|
||||
log_the_problem_somewhere();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$gradecategory = get_record('grade_category', 'id', $recordid)) {
|
||||
log_the_problem_somewhere();
|
||||
return false;
|
||||
}
|
||||
|
||||
$sitelang = $CFG->lang;
|
||||
$courselang = get_course_lang($gradecategory->courseid); //Non existing!
|
||||
$userlang = get_main_teacher_lang($gradecategory->courseid); //N.E.!!
|
||||
|
||||
$fromenc = get_original_encoding($sitelang, $courselang, $userlang);
|
||||
|
||||
/// We are going to use textlib facilities
|
||||
$textlib = textlib_get_instance();
|
||||
/// Convert the text
|
||||
$result = $textlib->convert($gradecategory->name, $fromenc);
|
||||
|
||||
$newgradecategory = new object;
|
||||
$newgradecategory->id = $recordid;
|
||||
$newgradecategory->name = $result;
|
||||
update_record('grade_category',$newgradecategory);
|
||||
/// And finally, just return the converted field
|
||||
return $result;
|
||||
}
|
||||
|
||||
function migrate2utf8_grade_letter_letter($recordid){
|
||||
global $CFG;
|
||||
|
||||
@@ -448,7 +481,7 @@ function migrate2utf8_group_name($recordid){
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$group = get_record('group', 'id', $recordid)) {
|
||||
if (!$group = get_record('groups', 'id', $recordid)) {
|
||||
log_the_problem_somewhere();
|
||||
return false;
|
||||
}
|
||||
@@ -467,7 +500,7 @@ function migrate2utf8_group_name($recordid){
|
||||
$newgroup = new object;
|
||||
$newgroup->id = $recordid;
|
||||
$newgroup->name = $result;
|
||||
update_record('group',$newgroup);
|
||||
update_record('groups',$newgroup);
|
||||
/// And finally, just return the converted field
|
||||
return $result;
|
||||
}
|
||||
@@ -481,7 +514,7 @@ function migrate2utf8_group_description($recordid){
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$group = get_record('group', 'id', $recordid)) {
|
||||
if (!$group = get_record('groups', 'id', $recordid)) {
|
||||
log_the_problem_somewhere();
|
||||
return false;
|
||||
}
|
||||
@@ -500,7 +533,7 @@ function migrate2utf8_group_description($recordid){
|
||||
$newgroup = new object;
|
||||
$newgroup->id = $recordid;
|
||||
$newgroup->description = $result;
|
||||
update_record('group',$newgroup);
|
||||
update_record('groups',$newgroup);
|
||||
/// And finally, just return the converted field
|
||||
return $result;
|
||||
}
|
||||
@@ -514,7 +547,7 @@ function migrate2utf8_group_lang($recordid){
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$group = get_record('group', 'id', $recordid)) {
|
||||
if (!$group = get_record('groups', 'id', $recordid)) {
|
||||
log_the_problem_somewhere();
|
||||
return false;
|
||||
}
|
||||
@@ -533,7 +566,7 @@ function migrate2utf8_group_lang($recordid){
|
||||
$newgroup = new object;
|
||||
$newgroup->id = $recordid;
|
||||
$newgroup->lang = $result;
|
||||
update_record('group',$newgroup);
|
||||
update_record('groups',$newgroup);
|
||||
/// And finally, just return the converted field
|
||||
return $result;
|
||||
}
|
||||
@@ -547,7 +580,7 @@ function migrate2utf8_group_theme($recordid){
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$group = get_record('group', 'id', $recordid)) {
|
||||
if (!$group = get_record('groups', 'id', $recordid)) {
|
||||
log_the_problem_somewhere();
|
||||
return false;
|
||||
}
|
||||
@@ -566,7 +599,7 @@ function migrate2utf8_group_theme($recordid){
|
||||
$newgroup = new object;
|
||||
$newgroup->id = $recordid;
|
||||
$newgroup->theme = $result;
|
||||
update_record('group',$newgroup);
|
||||
update_record('groups',$newgroup);
|
||||
/// And finally, just return the converted field
|
||||
return $result;
|
||||
}
|
||||
@@ -580,12 +613,12 @@ function migrate2utf8_message_message($recordid){
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$message = get_record('message', 'id', $recordid)) {
|
||||
if (!$message = get_record('message_read', 'id', $recordid)) {
|
||||
log_the_problem_somewhere();
|
||||
return false;
|
||||
}
|
||||
|
||||
$user = get_record('user','id',$message->userfrom);
|
||||
$user = get_record('user','id',$message->useridfrom);
|
||||
|
||||
$sitelang = $CFG->lang;
|
||||
$courselang = null; //Non existing!
|
||||
@@ -601,7 +634,7 @@ function migrate2utf8_message_message($recordid){
|
||||
$newmessage = new object;
|
||||
$newmessage->id = $recordid;
|
||||
$newmessage->message = $result;
|
||||
update_record('message',$newmessage);
|
||||
update_record('message_read',$newmessage);
|
||||
/// And finally, just return the converted field
|
||||
return $result;
|
||||
}
|
||||
@@ -615,12 +648,12 @@ function migrate2utf8_message_read_message($recordid){
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$messageread = get_record('message', 'id', $recordid)) {
|
||||
if (!$messageread = get_record('message_read', 'id', $recordid)) {
|
||||
log_the_problem_somewhere();
|
||||
return false;
|
||||
}
|
||||
|
||||
$user = get_record('user','id',$messageread->userfrom);
|
||||
$user = get_record('user','id',$messageread->useridfrom);
|
||||
|
||||
$sitelang = $CFG->lang;
|
||||
$courselang = null; //Non existing!
|
||||
@@ -636,7 +669,40 @@ function migrate2utf8_message_read_message($recordid){
|
||||
$newmessageread = new object;
|
||||
$newmessageread->id = $recordid;
|
||||
$newmessageread->message = $result;
|
||||
update_record('message',$newmessage);
|
||||
update_record('message_read',$newmessage);
|
||||
/// And finally, just return the converted field
|
||||
return $result;
|
||||
}
|
||||
|
||||
function migrate2utf8_modules_search($recordid){
|
||||
global $CFG;
|
||||
|
||||
/// Some trivial checks
|
||||
if (empty($recordid)) {
|
||||
log_the_problem_somewhere();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$modules = get_record('modules', 'id', $recordid)) {
|
||||
log_the_problem_somewhere();
|
||||
return false;
|
||||
}
|
||||
|
||||
$sitelang = $CFG->lang;
|
||||
$courselang = null; //Non existing!
|
||||
$userlang = null; //N.E.!!
|
||||
|
||||
$fromenc = get_original_encoding($sitelang, $courselang, $userlang);
|
||||
|
||||
/// We are going to use textlib facilities
|
||||
$textlib = textlib_get_instance();
|
||||
/// Convert the text
|
||||
$result = $textlib->convert($modules->search, $fromenc);
|
||||
|
||||
$newmodules = new object;
|
||||
$newmodules->id = $recordid;
|
||||
$newmodules->search = $result;
|
||||
update_record('modules',$newmodules);
|
||||
/// And finally, just return the converted field
|
||||
return $result;
|
||||
}
|
||||
@@ -873,12 +939,11 @@ function migrate2utf8_user_description($recordid){
|
||||
$userlang = $user->lang; //N.E.!!
|
||||
|
||||
$fromenc = get_original_encoding($sitelang, $courselang, $userlang);
|
||||
|
||||
/// We are going to use textlib facilities
|
||||
$textlib = textlib_get_instance();
|
||||
/// Convert the text
|
||||
$result = $textlib->convert($user->description, $fromenc);
|
||||
|
||||
echo "useruseruser ".($result);
|
||||
$newuser = new object;
|
||||
$newuser->id = $recordid;
|
||||
$newuser->description = $result;
|
||||
|
||||
+21
-8
@@ -141,7 +141,15 @@
|
||||
</TABLE>
|
||||
<TABLE name="grade_item" />
|
||||
<TABLE name="grade_preferences" />
|
||||
<TABLE name="grade_category" />
|
||||
<TABLE name="grade_category">
|
||||
<FIELDS>
|
||||
<FIELD name="name" method="PHP_FUNCTION" type="varchar" length="64">
|
||||
<PHP_FUNCTION>
|
||||
migrate2utf8_grade_category_name(RECORDID)
|
||||
</PHP_FUNCTION>
|
||||
</FIELD>
|
||||
</FIELDS>
|
||||
</TABLE>
|
||||
<TABLE name="grade_exceptions" />
|
||||
<TABLE name="grade_letter">
|
||||
<FIELDS>
|
||||
@@ -170,7 +178,7 @@
|
||||
migrate2utf8_groups_lang(RECORDID)
|
||||
</PHP_FUNCTION>
|
||||
</FIELD>
|
||||
<FIELD name="theme" method="PHP_FUNCTION" type="text" length="0">
|
||||
<FIELD name="theme" method="PHP_FUNCTION" type="varchar" length="50">
|
||||
<PHP_FUNCTION>
|
||||
migrate2utf8_groups_theme(RECORDID)
|
||||
</PHP_FUNCTION>
|
||||
@@ -181,9 +189,9 @@
|
||||
<FIELDS>
|
||||
<FIELD name="ip" method="NO_CONV" type="varchar" length="15" dropindex="timecoursemoduleaction"/>
|
||||
<FIELD name="module" method="NO_CONV" type="varchar" length="20" dropindex="coursemoduleaction"/>
|
||||
<FIELD name="action" method="NO_CONV" type="varchar" length="15" addindex="timecoursemoduleaction(time, course, module(20), action(15))" />
|
||||
<FIELD name="action" method="NO_CONV" type="varchar" length="15" addindex="timecoursemoduleaction(time, course, module(20), action(15))" />
|
||||
<FIELD name="url" method="NO_CONV" type="varchar" length="100" addindex="coursemoduleaction(course, module(20), action(15))" />
|
||||
<FIELD name="info" method="PLAIN_SQL_UPDATE" type="text" length="0">
|
||||
<FIELD name="info" method="PLAIN_SQL_UPDATE" type="varchar" length="255">
|
||||
<SQL_DETECT_USER>
|
||||
SELECT l.userid
|
||||
FROM {$CFG->prefix}log l
|
||||
@@ -228,7 +236,12 @@
|
||||
</TABLE>
|
||||
<TABLE name="modules">
|
||||
<FIELDS>
|
||||
<FIELD name="name" method="PLAIN_SQL_UPDATE" type="varchar" length="20" dropindex="name" addindex="name(name(20))"/>
|
||||
<FIELD name="name" method="NO_CONV" type="varchar" length="20" dropindex="name" addindex="name(name(20))"/>
|
||||
<FIELD name="search" method="PHP_FUNCTION" type="varchar" length="255">
|
||||
<PHP_FUNCTION>
|
||||
migrate2utf8_modules_search(RECORDID)
|
||||
</PHP_FUNCTION>
|
||||
</FIELD>
|
||||
</FIELDS>
|
||||
</TABLE>
|
||||
<TABLE name="scale">
|
||||
@@ -274,7 +287,7 @@
|
||||
<TABLE name="sessions">
|
||||
<FIELDS>
|
||||
<FIELD name="sesskey" method="NO_CONV" type="varchar" length="32" dropprimary="true" addprimary="(sesskey(32))"/>
|
||||
<FIELD name="expireref " method="NO_CONV" type="varchar" length="64" />
|
||||
<FIELD name="expireref" method="NO_CONV" type="varchar" length="64" />
|
||||
<FIELD name="data" method="NO_CONV" type="text" length="0" />
|
||||
</FIELDS>
|
||||
</TABLE>
|
||||
@@ -336,14 +349,14 @@
|
||||
<TABLE name="user_coursecreators" />
|
||||
<TABLE name="user">
|
||||
<FIELDS>
|
||||
<FIELD name="auth" method="NO_CONV" type="varchar" length="20"/>
|
||||
<FIELD name="auth" method="NO_CONV" type="varchar" length="20" dropindex="auth" addindex="auth(auth(20))"/>
|
||||
<FIELD name="username" method="NO_CONV" type="varchar" length="100" dropindex="username" adduniqueindex="username(username(100))"/>
|
||||
<FIELD name="password" method="PHP_FUNCTION" type="varchar" length="32">
|
||||
<PHP_FUNCTION>
|
||||
migrate2utf8_user_password(RECORDID)
|
||||
</PHP_FUNCTION>
|
||||
</FIELD>
|
||||
<FIELD name="idnumber" method="PHP_FUNCTION" type="varchar" length="64">
|
||||
<FIELD name="idnumber" method="PHP_FUNCTION" type="varchar" length="64" dropindex="idnumber" addindex="idnumber(idnumber(64))">
|
||||
<PHP_FUNCTION>
|
||||
migrate2utf8_user_idnumber(RECORDID)
|
||||
</PHP_FUNCTION>
|
||||
|
||||
@@ -37,50 +37,7 @@ function migrate2utf_hotpot_questions_name($recordid){
|
||||
$newhotpotquestion = new object;
|
||||
$newhotpotquestion->id = $recordid;
|
||||
$newhotpotquestion->name = $result;
|
||||
update_record('forum',$newhotpotquestion);
|
||||
/// And finally, just return the converted field
|
||||
return $result;
|
||||
}
|
||||
|
||||
function migrate2utf_hotpot_questions_text($recordid){
|
||||
global $CFG;
|
||||
|
||||
/// Some trivial checks
|
||||
if (empty($recordid)) {
|
||||
log_the_problem_somewhere();
|
||||
return false;
|
||||
}
|
||||
$SQL = "SELECT h.course
|
||||
FROM {$CFG->prefix}hotpot h,
|
||||
{$CFG->prefix}hotpot_questions hq
|
||||
WHERE h.id = hq.hotpot
|
||||
AND hq.id = $recordid";
|
||||
|
||||
if (!$hotpot = get_record_sql($SQL) {
|
||||
log_the_problem_somewhere();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$hotpotquestion = get_record_sql('hotpot_questions','id',$recordid) {
|
||||
log_the_problem_somewhere();
|
||||
return false;
|
||||
}
|
||||
|
||||
$sitelang = $CFG->lang;
|
||||
$courselang = get_course_lang($hotpot->course); //Non existing!
|
||||
$userlang = get_main_teacher_lang($hotpot->course); //N.E.!!
|
||||
|
||||
$fromenc = get_original_encoding($sitelang, $courselang, $userlang);
|
||||
|
||||
/// We are going to use textlib facilities
|
||||
$textlib = textlib_get_instance();
|
||||
/// Convert the text
|
||||
$result = $textlib->convert($hotpotquestion->text, $fromenc);
|
||||
|
||||
$newhotpotquestion = new object;
|
||||
$newhotpotquestion->id = $recordid;
|
||||
$newhotpotquestion->text = $result;
|
||||
update_record('forum',$newhotpotquestion);
|
||||
update_record('hotpot_questions',$newhotpotquestion);
|
||||
/// And finally, just return the converted field
|
||||
return $result;
|
||||
}
|
||||
@@ -118,7 +75,7 @@ function migrate2utf_hotpot_name($recordid){
|
||||
return $result;
|
||||
}
|
||||
|
||||
function migrate2utf_glossary_summary($recordid){
|
||||
function migrate2utf_hotpot_summary($recordid){
|
||||
global $CFG;
|
||||
|
||||
/// Some trivial checks
|
||||
@@ -143,15 +100,15 @@ function migrate2utf_glossary_summary($recordid){
|
||||
/// Convert the text
|
||||
$result = $textlib->convert($hotpot->summary, $fromenc);
|
||||
|
||||
$newglossary = new object;
|
||||
$newglossary->id = $recordid;
|
||||
$newglossary->summary = $result;
|
||||
$newhotpot = new object;
|
||||
$newhotpot->id = $recordid;
|
||||
$newhotpot->summary = $result;
|
||||
update_record('hotpot',$newhotpot);
|
||||
/// And finally, just return the converted field
|
||||
return $result;
|
||||
}
|
||||
|
||||
function migrate2utf_glossary_password($recordid){
|
||||
function migrate2utf_hotpot_password($recordid){
|
||||
global $CFG;
|
||||
|
||||
/// Some trivial checks
|
||||
@@ -176,9 +133,9 @@ function migrate2utf_glossary_password($recordid){
|
||||
/// Convert the text
|
||||
$result = $textlib->convert($hotpot->password, $fromenc);
|
||||
|
||||
$newglossary = new object;
|
||||
$newglossary->id = $recordid;
|
||||
$newglossary->password = $result;
|
||||
$newhotpot = new object;
|
||||
$newhotpot->id = $recordid;
|
||||
$newhotpot->password = $result;
|
||||
update_record('hotpot',$newhotpot);
|
||||
/// And finally, just return the converted field
|
||||
return $result;
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
<TABLE name="hotpot_attempts" />
|
||||
<TABLE name="hotpot_strings">
|
||||
<FIELDS>
|
||||
<FIELD name="string" method="NO_CONV" type="TEXT" length="0">
|
||||
<FIELD name="string" method="NO_CONV" type="TEXT" length="0" />
|
||||
</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">
|
||||
<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">
|
||||
@@ -42,11 +42,6 @@
|
||||
migrate2utf8_hotpot_questions_name(RECORDID)
|
||||
</PHP_FUNCTION>
|
||||
</FIELD>
|
||||
<FIELD name="text" method="PLAIN_SQL_UPDATE" type="text" length="0">
|
||||
<PHP_FUNCTION>
|
||||
migrate2utf8_hotpot_questions_text(RECORDID)
|
||||
</PHP_FUNCTION>
|
||||
</FIELD>
|
||||
</FIELDS>
|
||||
</TABLE>
|
||||
<TABLE name="hotpot">
|
||||
@@ -68,6 +63,7 @@
|
||||
</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>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?
|
||||
function migrate2utf_journal_name($recordid){
|
||||
function migrate2utf8_journal_name($recordid){
|
||||
global $CFG;
|
||||
|
||||
/// Some trivial checks
|
||||
@@ -32,7 +32,7 @@ function migrate2utf_journal_name($recordid){
|
||||
return $result;
|
||||
}
|
||||
|
||||
function migrate2utf_glossary_intro($recordid){
|
||||
function migrate2utf8_journal_intro($recordid){
|
||||
global $CFG;
|
||||
|
||||
/// Some trivial checks
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<DBMIGRATION type="mod/journel" VERSION="2005120100">
|
||||
<DBMIGRATION type="mod/journal" VERSION="2005120100">
|
||||
<TABLES>
|
||||
<TABLE name="journal_entries">
|
||||
<FIELDS>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?
|
||||
function migrate2utf_label_name($recordid){
|
||||
function migrate2utf8_label_name($recordid){
|
||||
global $CFG;
|
||||
|
||||
/// Some trivial checks
|
||||
@@ -32,7 +32,7 @@ function migrate2utf_label_name($recordid){
|
||||
return $result;
|
||||
}
|
||||
|
||||
function migrate2utf_label_content($recordid){
|
||||
function migrate2utf8_label_content($recordid){
|
||||
global $CFG;
|
||||
|
||||
/// Some trivial checks
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?
|
||||
function migrate2utf_lams_name($recordid){
|
||||
function migrate2utf8_lams_name($recordid){
|
||||
global $CFG;
|
||||
|
||||
/// Some trivial checks
|
||||
@@ -32,7 +32,7 @@ function migrate2utf_lams_name($recordid){
|
||||
return $result;
|
||||
}
|
||||
|
||||
function migrate2utf_lams_introduction($recordid){
|
||||
function migrate2utf8_lams_introduction($recordid){
|
||||
global $CFG;
|
||||
|
||||
/// Some trivial checks
|
||||
|
||||
@@ -133,7 +133,7 @@ function migrate2utf8_lesson_pages_contents($recordid){
|
||||
$newlessonpages = new object;
|
||||
$newlessonpages->id = $recordid;
|
||||
$newlessonpages->contents = $result;
|
||||
update_record('lesson_answers',$newlessonpages);
|
||||
update_record('lesson_pages',$newlessonpages);
|
||||
/// And finally, just return the converted field
|
||||
return $result;
|
||||
}
|
||||
@@ -177,7 +177,7 @@ function migrate2utf8_lesson_pages_title($recordid){
|
||||
$newlessonpages = new object;
|
||||
$newlessonpages->id = $recordid;
|
||||
$newlessonpages->title = $result;
|
||||
update_record('lesson_answers',$newlessonpages);
|
||||
update_record('lesson_pages',$newlessonpages);
|
||||
/// And finally, just return the converted field
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
</FIELD>
|
||||
<FIELD name="response" method="PHP_FUNCTION" type="text" length="0">
|
||||
<PHP_FUNCTION>
|
||||
migrate2utf8_lesson_answers_answer(RECORDID)
|
||||
migrate2utf8_lesson_answers_response(RECORDID)
|
||||
</PHP_FUNCTION>
|
||||
</FIELD>
|
||||
</FIELDS>
|
||||
@@ -76,6 +76,8 @@
|
||||
migrate2utf8_lesson_password(RECORDID)
|
||||
</PHP_FUNCTION>
|
||||
</FIELD>
|
||||
<FIELD name="conditions" method="NO_CONV" type="text" length="0" />
|
||||
<FIELD name="mediafile" method="NO_CONV" type="varchar" length="255" />
|
||||
<FIELD name="bgcolor" method="NO_CONV" type="varchar" length="7" />
|
||||
</FIELDS>
|
||||
</TABLE>
|
||||
|
||||
@@ -38,7 +38,7 @@ function migrate2utf8_quiz_questions_name($recordid){
|
||||
$newquizquestion = new object;
|
||||
$newquizquestion->id = $recordid;
|
||||
$newquizquestion->name = $result;
|
||||
update_record('quiz_question',$newquizquestion);
|
||||
update_record('quiz_questions',$newquizquestion);
|
||||
/// And finally, just return the converted field
|
||||
return $result;
|
||||
}
|
||||
@@ -82,7 +82,7 @@ function migrate2utf8_quiz_questions_questiontext($recordid){
|
||||
$newquizquestion = new object;
|
||||
$newquizquestion->id = $recordid;
|
||||
$newquizquestion->questiontext = $result;
|
||||
update_record('quiz_question',$newquizquestion);
|
||||
update_record('quiz_questions',$newquizquestion);
|
||||
/// And finally, just return the converted field
|
||||
return $result;
|
||||
}
|
||||
@@ -175,7 +175,7 @@ function migrate2utf8_quiz_match_sub_questiontext($recordid){
|
||||
$newquizmatchsub = new object;
|
||||
$newquizmatchsub->id = $recordid;
|
||||
$newquizmatchsub->questiontext = $result;
|
||||
update_record('quiz_numerical_units',$newquizmatchsub);
|
||||
update_record('quiz_match_sub',$newquizmatchsub);
|
||||
/// And finally, just return the converted field
|
||||
return $result;
|
||||
}
|
||||
@@ -221,7 +221,7 @@ function migrate2utf8_quiz_match_sub_answertext($recordid){
|
||||
$newquizmatchsub = new object;
|
||||
$newquizmatchsub->id = $recordid;
|
||||
$newquizmatchsub->answertext = $result;
|
||||
update_record('quiz_numerical_units',$newquizmatchsub);
|
||||
update_record('quiz_match_sub',$newquizmatchsub);
|
||||
/// And finally, just return the converted field
|
||||
return $result;
|
||||
}
|
||||
@@ -248,7 +248,7 @@ function migrate2utf8_quiz_answers_answer($recordid){
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$quizanswer= get_record('quiz_answer','id',$recordid)) {
|
||||
if (!$quizanswer= get_record('quiz_answers','id',$recordid)) {
|
||||
log_the_problem_somewhere();
|
||||
return false;
|
||||
}
|
||||
@@ -267,7 +267,7 @@ function migrate2utf8_quiz_answers_answer($recordid){
|
||||
$newquizanswer = new object;
|
||||
$newquizanswer->id = $recordid;
|
||||
$newquizanswer->answer = $result;
|
||||
update_record('quiz_answer',$newquizanswer);
|
||||
update_record('quiz_answers',$newquizanswer);
|
||||
/// And finally, just return the converted field
|
||||
return $result;
|
||||
}
|
||||
@@ -294,7 +294,7 @@ function migrate2utf8_quiz_answers_feedback($recordid){
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$quizanswer= get_record('quiz_answer','id',$recordid)) {
|
||||
if (!$quizanswer= get_record('quiz_answers','id',$recordid)) {
|
||||
log_the_problem_somewhere();
|
||||
return false;
|
||||
}
|
||||
@@ -313,7 +313,7 @@ function migrate2utf8_quiz_answers_feedback($recordid){
|
||||
$newquizanswer = new object;
|
||||
$newquizanswer->id = $recordid;
|
||||
$newquizanswer->feedback = $result;
|
||||
update_record('quiz_answer',$newquizanswer);
|
||||
update_record('quiz_answers',$newquizanswer);
|
||||
/// And finally, just return the converted field
|
||||
return $result;
|
||||
}
|
||||
@@ -403,7 +403,7 @@ function migrate2utf8_quiz_categories_name($recordid){
|
||||
$newquizcategory = new object;
|
||||
$newquizcategory->id = $recordid;
|
||||
$newquizcategory->name = $result;
|
||||
update_record('quiz_category',$newquizcategory);
|
||||
update_record('quiz_categories',$newquizcategory);
|
||||
/// And finally, just return the converted field
|
||||
return $result;
|
||||
}
|
||||
@@ -445,7 +445,7 @@ function migrate2utf8_quiz_categories_info($recordid){
|
||||
$newquizcategory = new object;
|
||||
$newquizcategory->id = $recordid;
|
||||
$newquizcategory->info = $result;
|
||||
update_record('quiz_category',$newquizcategory);
|
||||
update_record('quiz_categories',$newquizcategory);
|
||||
/// And finally, just return the converted field
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
</TABLE>
|
||||
<TABLE name="quiz_shortanswer">
|
||||
<FIELDS>
|
||||
<FIELD name="answers" method="NO_CONV" type="text" length="0" />
|
||||
<FIELD name="answers" method="NO_CONV" type="varchar" length="255" />
|
||||
</FIELDS>
|
||||
</TABLE>
|
||||
<TABLE name="quiz_numerical">
|
||||
@@ -134,12 +134,12 @@
|
||||
<FIELDS>
|
||||
<FIELD name="questiontext" method="PHP_FUNCTION" type="text" length="0">
|
||||
<PHP_FUNCTION>
|
||||
migrate2utf_quiz_match_sub_questionext(RECORDID)
|
||||
migrate2utf8_quiz_match_sub_questionext(RECORDID)
|
||||
</PHP_FUNCTION>
|
||||
</FIELD>
|
||||
<FIELD name="answertext" method="PHP_FUNCTION" type="varchar" length="255">
|
||||
<PHP_FUNCTION>
|
||||
migrate2utf_quiz_match_sub_answertext(RECORDID)
|
||||
migrate2utf8_quiz_match_sub_answertext(RECORDID)
|
||||
</PHP_FUNCTION>
|
||||
</FIELD>
|
||||
</FIELDS>
|
||||
@@ -223,7 +223,7 @@
|
||||
migrate2utf8_quiz_intro(RECORDID)
|
||||
</PHP_FUNCTION>
|
||||
</FIELD>
|
||||
<FIELD name="questions" method="NO_CONV" type="varchar" length="255" />
|
||||
<FIELD name="questions" method="NO_CONV" type="text" length="0" />
|
||||
<FIELD name="password" method="PHP_FUNCTION" type="varchar" length="255">
|
||||
<PHP_FUNCTION>
|
||||
migrate2utf8_quiz_password(RECORDID)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?
|
||||
function migrate2utf_resource_name($recordid){
|
||||
function migrate2utf8_resource_name($recordid){
|
||||
global $CFG;
|
||||
|
||||
/// Some trivial checks
|
||||
@@ -8,7 +8,7 @@ function migrate2utf_resource_name($recordid){
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$resource = get_record('resource','id',$recordid) {
|
||||
if (!$resource = get_record('resource','id',$recordid)) {
|
||||
log_the_problem_somewhere();
|
||||
return false;
|
||||
}
|
||||
@@ -32,7 +32,7 @@ function migrate2utf_resource_name($recordid){
|
||||
return $result;
|
||||
}
|
||||
|
||||
function migrate2utf_resource_reference($recordid){
|
||||
function migrate2utf8_resource_reference($recordid){
|
||||
global $CFG;
|
||||
|
||||
/// Some trivial checks
|
||||
@@ -41,7 +41,7 @@ function migrate2utf_resource_reference($recordid){
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$resource = get_record('resource','id',$recordid) {
|
||||
if (!$resource = get_record('resource','id',$recordid)) {
|
||||
log_the_problem_somewhere();
|
||||
return false;
|
||||
}
|
||||
@@ -65,7 +65,7 @@ function migrate2utf_resource_reference($recordid){
|
||||
return $result;
|
||||
}
|
||||
|
||||
function migrate2utf_resource_summary($recordid){
|
||||
function migrate2utf8_resource_summary($recordid){
|
||||
global $CFG;
|
||||
|
||||
/// Some trivial checks
|
||||
@@ -74,7 +74,7 @@ function migrate2utf_resource_summary($recordid){
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$resource = get_record('resource','id',$recordid) {
|
||||
if (!$resource = get_record('resource','id',$recordid)) {
|
||||
log_the_problem_somewhere();
|
||||
return false;
|
||||
}
|
||||
@@ -84,12 +84,11 @@ function migrate2utf_resource_summary($recordid){
|
||||
$userlang = get_main_teacher_lang($resource->course); //N.E.!!
|
||||
|
||||
$fromenc = get_original_encoding($sitelang, $courselang, $userlang);
|
||||
|
||||
/// We are going to use textlib facilities
|
||||
$textlib = textlib_get_instance();
|
||||
/// Convert the text
|
||||
$result = $textlib->convert($resource->summary, $fromenc);
|
||||
|
||||
print('sumsumsum'.$result);
|
||||
$newresource = new object;
|
||||
$newresource->id = $recordid;
|
||||
$newresource->summary = $result;
|
||||
@@ -98,7 +97,7 @@ function migrate2utf_resource_summary($recordid){
|
||||
return $result;
|
||||
}
|
||||
|
||||
function migrate2utf_resource_alltext($recordid){
|
||||
function migrate2utf8_resource_alltext($recordid){
|
||||
global $CFG;
|
||||
|
||||
/// Some trivial checks
|
||||
@@ -107,7 +106,7 @@ function migrate2utf_resource_alltext($recordid){
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$resource = get_record('resource','id',$recordid) {
|
||||
if (!$resource = get_record('resource','id',$recordid)) {
|
||||
log_the_problem_somewhere();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -13,12 +13,12 @@
|
||||
migrate2utf8_resource_reference(RECORDID)
|
||||
</PHP_FUNCTION>
|
||||
</FIELD>
|
||||
<FIELD name="summary" method="PHP_FUNCTION" type="varchar" length="255">
|
||||
<FIELD name="summary" method="PHP_FUNCTION" type="text" length="0">
|
||||
<PHP_FUNCTION>
|
||||
migrate2utf8_resource_summary(RECORDID)
|
||||
</PHP_FUNCTION>
|
||||
</FIELD>
|
||||
<FIELD name="alltext" method="PHP_FUNCTION" type="varchar" length="255">
|
||||
<FIELD name="alltext" method="PHP_FUNCTION" type="text" length="0">
|
||||
<PHP_FUNCTION>
|
||||
migrate2utf8_resource_alltext(RECORDID)
|
||||
</PHP_FUNCTION>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?
|
||||
function migrate2utf_scorm_scoes_manifest($recordid){
|
||||
function migrate2utf8_scorm_scoes_manifest($recordid){
|
||||
global $CFG;
|
||||
|
||||
/// Some trivial checks
|
||||
@@ -43,7 +43,7 @@ function migrate2utf_scorm_scoes_manifest($recordid){
|
||||
return $result;
|
||||
}
|
||||
|
||||
function migrate2utf_scorm_scoes_organization($recordid){
|
||||
function migrate2utf8_scorm_scoes_organization($recordid){
|
||||
global $CFG;
|
||||
|
||||
/// Some trivial checks
|
||||
@@ -87,7 +87,7 @@ function migrate2utf_scorm_scoes_organization($recordid){
|
||||
return $result;
|
||||
}
|
||||
|
||||
function migrate2utf_scorm_scoes_parent($recordid){
|
||||
function migrate2utf8_scorm_scoes_parent($recordid){
|
||||
global $CFG;
|
||||
|
||||
/// Some trivial checks
|
||||
@@ -132,7 +132,7 @@ function migrate2utf_scorm_scoes_parent($recordid){
|
||||
}
|
||||
|
||||
|
||||
function migrate2utf_scorm_scoes_identifier($recordid){
|
||||
function migrate2utf8_scorm_scoes_identifier($recordid){
|
||||
global $CFG;
|
||||
|
||||
/// Some trivial checks
|
||||
@@ -176,7 +176,7 @@ function migrate2utf_scorm_scoes_identifier($recordid){
|
||||
return $result;
|
||||
}
|
||||
|
||||
function migrate2utf_scorm_scoes_launch($recordid){
|
||||
function migrate2utf8_scorm_scoes_launch($recordid){
|
||||
global $CFG;
|
||||
|
||||
/// Some trivial checks
|
||||
@@ -220,7 +220,7 @@ function migrate2utf_scorm_scoes_launch($recordid){
|
||||
return $result;
|
||||
}
|
||||
|
||||
function migrate2utf_scorm_scoes_parameters($recordid){
|
||||
function migrate2utf8_scorm_scoes_parameters($recordid){
|
||||
global $CFG;
|
||||
|
||||
/// Some trivial checks
|
||||
@@ -264,7 +264,7 @@ function migrate2utf_scorm_scoes_parameters($recordid){
|
||||
return $result;
|
||||
}
|
||||
|
||||
function migrate2utf_scorm_scoes_scormtype($recordid){
|
||||
function migrate2utf8_scorm_scoes_scormtype($recordid){
|
||||
global $CFG;
|
||||
|
||||
/// Some trivial checks
|
||||
@@ -308,7 +308,7 @@ function migrate2utf_scorm_scoes_scormtype($recordid){
|
||||
return $result;
|
||||
}
|
||||
|
||||
function migrate2utf_scorm_scoes_title($recordid){
|
||||
function migrate2utf8_scorm_scoes_title($recordid){
|
||||
global $CFG;
|
||||
|
||||
/// Some trivial checks
|
||||
@@ -352,7 +352,7 @@ function migrate2utf_scorm_scoes_title($recordid){
|
||||
return $result;
|
||||
}
|
||||
|
||||
function migrate2utf_scorm_scoes_prerequisites($recordid){
|
||||
function migrate2utf8_scorm_scoes_prerequisites($recordid){
|
||||
global $CFG;
|
||||
|
||||
/// Some trivial checks
|
||||
@@ -396,7 +396,7 @@ function migrate2utf_scorm_scoes_prerequisites($recordid){
|
||||
return $result;
|
||||
}
|
||||
|
||||
function migrate2utf_scorm_scoes_maxtimeallowed($recordid){
|
||||
function migrate2utf8_scorm_scoes_maxtimeallowed($recordid){
|
||||
global $CFG;
|
||||
|
||||
/// Some trivial checks
|
||||
@@ -440,7 +440,7 @@ function migrate2utf_scorm_scoes_maxtimeallowed($recordid){
|
||||
return $result;
|
||||
}
|
||||
|
||||
function migrate2utf_scorm_scoes_timelimitaction($recordid){
|
||||
function migrate2utf8_scorm_scoes_timelimitaction($recordid){
|
||||
global $CFG;
|
||||
|
||||
/// Some trivial checks
|
||||
@@ -484,7 +484,7 @@ function migrate2utf_scorm_scoes_timelimitaction($recordid){
|
||||
return $result;
|
||||
}
|
||||
|
||||
function migrate2utf_scorm_scoes_datafromlms($recordid){
|
||||
function migrate2utf8_scorm_scoes_datafromlms($recordid){
|
||||
global $CFG;
|
||||
|
||||
/// Some trivial checks
|
||||
@@ -528,7 +528,7 @@ function migrate2utf_scorm_scoes_datafromlms($recordid){
|
||||
return $result;
|
||||
}
|
||||
|
||||
function migrate2utf_scorm_scoes_masteryscore($recordid){
|
||||
function migrate2utf8_scorm_scoes_masteryscore($recordid){
|
||||
global $CFG;
|
||||
|
||||
/// Some trivial checks
|
||||
@@ -573,7 +573,7 @@ function migrate2utf_scorm_scoes_masteryscore($recordid){
|
||||
}
|
||||
|
||||
|
||||
function migrate2utf_scorm_name($recordid){
|
||||
function migrate2utf8_scorm_name($recordid){
|
||||
global $CFG;
|
||||
|
||||
/// Some trivial checks
|
||||
@@ -606,7 +606,7 @@ function migrate2utf_scorm_name($recordid){
|
||||
return $result;
|
||||
}
|
||||
|
||||
function migrate2utf_scorm_reference($recordid){
|
||||
function migrate2utf8_scorm_reference($recordid){
|
||||
global $CFG;
|
||||
|
||||
/// Some trivial checks
|
||||
@@ -639,7 +639,7 @@ function migrate2utf_scorm_reference($recordid){
|
||||
return $result;
|
||||
}
|
||||
|
||||
function migrate2utf_scorm_summary($recordid){
|
||||
function migrate2utf8_scorm_summary($recordid){
|
||||
global $CFG;
|
||||
|
||||
/// Some trivial checks
|
||||
@@ -672,7 +672,7 @@ function migrate2utf_scorm_summary($recordid){
|
||||
return $result;
|
||||
}
|
||||
|
||||
function migrate2utf_scorm_options($recordid){
|
||||
function migrate2utf8_scorm_options($recordid){
|
||||
global $CFG;
|
||||
|
||||
/// Some trivial checks
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<TABLES>
|
||||
<TABLE name="scorm_scoes_track">
|
||||
<FIELDS>
|
||||
<FIELD name="element" method="PLAIN_SQL_UPDATE" type="varchar" length="255" dropindex="track" addindex="track (userid, scormid, scoid, attempt, element(255))">
|
||||
<FIELD name="value" method="PLAIN_SQL_UPDATE" type="longtext" length="0">
|
||||
<SQL_DETECT_USER>
|
||||
SELECT sst.userid
|
||||
FROM {$CFG->prefix}scorm_scoes_track sst
|
||||
@@ -16,7 +16,7 @@
|
||||
AND sst.id = RECORDID
|
||||
</SQL_DETECT_COURSE>
|
||||
</FIELD>
|
||||
<FIELD name="value" method="PLAIN_SQL_UPDATE" type="longtext" length="0">
|
||||
<FIELD name="element" method="PLAIN_SQL_UPDATE" type="varchar" length="255" dropindex="track" addindex="track (userid, scormid, scoid, attempt, element(255))">
|
||||
<SQL_DETECT_USER>
|
||||
SELECT sst.userid
|
||||
FROM {$CFG->prefix}scorm_scoes_track sst
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
<DBMIGRATION type="mod/survey" VERSION="2005120100">
|
||||
<TABLES>
|
||||
<TABLE name="survey_questions">
|
||||
<FIELDS>
|
||||
<FIELD name="options" method="NO_CONV" type="text" length="0" />
|
||||
<FIELD name="shorttext" method="NO_CONV" type="varchar" length="30" />
|
||||
<FIELDS>
|
||||
<FIELD name="text" method="NO_CONV" type="varchar" length="255" />
|
||||
<FIELD name="shorttext" method="NO_CONV" type="varchar" length="30" />
|
||||
<FIELD name="multi" method="NO_CONV" type="varchar" length="100" />
|
||||
<FIELD name="intro" method="NO_CONV" type="varchar" length="50" />
|
||||
<FIELD name="options" method="NO_CONV" type="text" length="0" />
|
||||
</FIELDS>
|
||||
</TABLE>
|
||||
<TABLE name="survey_analysis">
|
||||
|
||||
@@ -8,7 +8,7 @@ function migrate2utf8_wiki_name($recordid){
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$wiki = get_record('wiki','id',$recordid)) {
|
||||
if (!$wiki = get_record('wiki','id',$recorvarchardid)) {
|
||||
log_the_problem_somewhere();
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user