Skip to content

Commit ee656f0

Browse files
committed
Scripts: Fix tables fields to replace course code - refs BT#22302
1 parent d1bf590 commit ee656f0

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

main/inc/lib/exercise.lib.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7497,7 +7497,7 @@ public static function replaceTermsInContent(string $search, string $replace): a
74977497
{
74987498
$replacements = [
74997499
Database::get_course_table(TABLE_QUIZ_TEST) => [
7500-
'iid' => ['title', 'description', 'sound', 'text_when_finished_failure'],
7500+
'iid' => ['title', 'description', 'sound'],
75017501
],
75027502
Database::get_course_table(TABLE_QUIZ_QUESTION) => [
75037503
'iid' => ['question', 'description'],
@@ -7659,7 +7659,7 @@ public static function replaceTermsInContent(string $search, string $replace): a
76597659
'id' => ['name'],
76607660
],
76617661
Database::get_main_table(TABLE_MAIN_COURSE_REQUEST) => [
7662-
'iid' => ['description', 'title', 'objetives', 'target_audience'],
7662+
'id' => ['description', 'title', 'objetives', 'target_audience'],
76637663
],
76647664
'course_type' => [
76657665
'id' => ['description'],
@@ -7782,16 +7782,16 @@ public static function replaceTermsInContent(string $search, string $replace): a
77827782
'id' => ['teacher_comment'],
77837783
],
77847784
Database::get_main_table(TABLE_STATISTIC_TRACK_E_DEFAULT) => [
7785-
'id' => ['default_value'],
7785+
'default_id' => ['default_value'],
77867786
],
77877787
Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES) => [
7788-
'id' => ['data_tracking', 'questions_to_check'],
7788+
'exe_id' => ['data_tracking', 'questions_to_check'],
77897789
],
77907790
Database::get_main_table(TABLE_STATISTIC_TRACK_E_ITEM_PROPERTY) => [
77917791
'id' => ['content'],
77927792
],
77937793
'track_e_open' => [
7794-
'id' => ['open_remote_host', 'open_agent', 'open_referer'],
7794+
'open_id' => ['open_remote_host', 'open_agent', 'open_referer'],
77957795
],
77967796
Database::get_main_table(TABLE_TRACK_STORED_VALUES) => [
77977797
'id' => ['sv_value'],
@@ -7816,6 +7816,10 @@ public static function replaceTermsInContent(string $search, string $replace): a
78167816
];
78177817
}
78187818

7819+
if (api_get_configuration_value('exercise_text_when_finished_failure')) {
7820+
$replacements[Database::get_course_table(TABLE_QUIZ_TEST)]['iid'][] = 'text_when_finished_failure';
7821+
}
7822+
78197823
$changes = array_map(
78207824
fn($table) => 0,
78217825
$replacements

0 commit comments

Comments
 (0)