When you make backup for course that include some questions and then make restore for this course you will notice that the new resulting course does not have any questions .
We have solved this problem by editing two functions in this file:
- c:\\root-dir\qustion\backuplib.php
as the following :
- First function called [ backup_question () ] : You need to change (order by) clause in the select query by changing from [ "ORDER BY parent ASC,id"] to [ "ORDER BY q.parent ASC,q.id"]
- Second funciton called [ question_insert_q_ids() ] : You need to enter space or text in this query because oracle database doesnt recognize the empty parameter in select statment.The solution to enter any text as this query
"INSERT INTO {$CFG->prefix}backup_ids
(backup_code, table_name, old_id, info)
SELECT '$backup_unique_code', 'question', q.id, ' [Enter here any text or space ] '
FROM {$CFG->prefix}question q, {$CFG->prefix}backup_ids bk
WHERE q.category = bk.old_id AND bk.table_name = 'question_categories'
AND " . sql_compare_text('bk.info') . " = '$info'
AND bk.backup_code = '$backup_unique_code'"