Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-24429

course backup will not include course questions (Oracle only)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.9.4
    • Fix Version/s: 1.9.10
    • Component/s: Backup
    • Labels:
      None
    • Database:
      Oracle
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      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'"

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                25/Oct/10