Moodle

Courses' backup with quiz

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Cannot Reproduce
  • Affects Version/s: 1.8
  • Fix Version/s: None
  • Component/s: Backup, Quiz
  • Labels:
    None
  • Environment:
    Solaris

Description

The backup of the quiz activities doesn't work due to two Oracle exceptions. We have detected and solved both problems:

  • First of all, there is a query of a clob column which isn't working:
    $categorieswithrandom = get_records_sql("
    SELECT DISTINCT question.category AS id
    FROM {$CFG->prefix}quiz_question_instances qqi,
    $from
    {$CFG->prefix}question question
    WHERE question.id = qqi.question
    AND question.qtype = '" . RANDOM . "'
    AND to_char(question.questiontext) = '1'
    $where
    ");
    To solve this problem notice that we have added the to_char function to the clob column name.
  • The second problem is an insert in the info clob column of an empty string (''). To solve this problem we have added and white space (' ') instead of empty (''):
    $status = execute_sql("INSERT INTO {$CFG->prefix}backup_ids
    (backup_code, table_name, old_id, info)
    SELECT '$backup_unique_code', 'question_categories', qc.id, ' '
    FROM {$CFG->prefix}question_categories qc
    WHERE qc.course = $course", false);

In general, we have detected that all the clob columns are always problematic so it would be nice to revise the DB API to solve it at this level.

Thank you in advance!

Activity

Hide
Michael de Raadt added a comment -

Thanks for reporting this issue.

We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.

If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

Michael d;

lqjjLKA0p6

Show
Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d; lqjjLKA0p6
Hide
Sara Arjona added a comment -

At the moment we haven't tested this issue in Moodle 2.X so we don't know if it still remains.

Show
Sara Arjona added a comment - At the moment we haven't tested this issue in Moodle 2.X so we don't know if it still remains.
Hide
Tim Hunt added a comment -

I am going to take an informed guess and say that this is no longer an issue in 2.0.

Backup and restore have been completely re-written there.

There were some issues with backing up and restoring questions there, but they were reported separately, and fixed, I think. So I am closing this issue.

I'm sorry that your suggested fixes got lost in the past. Thank you for trying to contribute to Moodle.

Show
Tim Hunt added a comment - I am going to take an informed guess and say that this is no longer an issue in 2.0. Backup and restore have been completely re-written there. There were some issues with backing up and restoring questions there, but they were reported separately, and fixed, I think. So I am closing this issue. I'm sorry that your suggested fixes got lost in the past. Thank you for trying to contribute to Moodle.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: