Moodle

Course backup does not include questions defined in the course unless there is a quiz activity within the course

Details

  • Type: Bug Bug
  • Status: Reopened Reopened
  • Priority: Critical Critical
  • Resolution: Unresolved
  • Affects Version/s: 1.9.2, 1.9.3, 1.9.4, 1.9.5, 2.2.1
  • Fix Version/s: STABLE backlog
  • Component/s: Backup, Questions, Quiz
  • Labels:
  • Database:
    MySQL, PostgreSQL
  • Affected Branches:
    MOODLE_19_STABLE, MOODLE_22_STABLE

Description

If you have questions defined within a course but there are no quiz modules, those questions will never be included within a course backup. Looking at the code in the quiz module it is handling the adding of questions to the backup_ids table in a display function (before the backup process has even been executed).

Activity

Hide
Justin Filip added a comment -

I had a filed a bug relating to the quiz issue before as it was causing problems with the silent backup and restore code but the silent backup and restore code was the only thing fixed: MDL-19343

I was hoping that previous bug would generate some discussion about the quiz module not using the backup API correctly as it should not be inserting information into the 'backup_ids' table when simply generating the HTML list of quiz activities within a course.

Show
Justin Filip added a comment - I had a filed a bug relating to the quiz issue before as it was causing problems with the silent backup and restore code but the silent backup and restore code was the only thing fixed: MDL-19343 I was hoping that previous bug would generate some discussion about the quiz module not using the backup API correctly as it should not be inserting information into the 'backup_ids' table when simply generating the HTML list of quiz activities within a course.
Hide
Eloy Lafuente (stronk7) added a comment -

Hi Justin, just for reference... which is the related bug about silent backups? Believe me tat I've been searching for it, in fact it sounds a lot to me. But, perhaps due to the time (2:30AM) I have been unable to find it.

In any case, about which questions are added within one backup... I remember that only "used" categories/questions are included. And unless Tim or anybody else had changed that, it has been the original behaviour since we have questions and category questions.

Will try to take a look to it tomorrow. Thanks for the report! Ciao

Show
Eloy Lafuente (stronk7) added a comment - Hi Justin, just for reference... which is the related bug about silent backups? Believe me tat I've been searching for it, in fact it sounds a lot to me. But, perhaps due to the time (2:30AM) I have been unable to find it. In any case, about which questions are added within one backup... I remember that only "used" categories/questions are included. And unless Tim or anybody else had changed that, it has been the original behaviour since we have questions and category questions. Will try to take a look to it tomorrow. Thanks for the report! Ciao
Hide
Justin Filip added a comment -

Hi Eloy, I suppose it would have helped if I had actually used the correct issue number in my comment? =)

This is the one I'm referring to: MDL-19084

I'd be willing to take a look and see what would be involved with taking the question backup/restore code out of the quiz (and probably lesson?) module(s) and making it a separate part of the process. But I think it makes more sense to have a discussion about that first, maybe here or in the developer forum, or perhaps somewhere else?

I can understand why you would only want "used" categories and questions in a backup but it's come up recently where questions and categories are defined in a course without any activities and that course is meant to be used as a "template" with which to populate data into other courses. The template course is backed up and restored into the destination course (using the "silent" API calls). It's an automatic process that can either be invoked by a teacher or happens automatically when certain criteria are met.

Show
Justin Filip added a comment - Hi Eloy, I suppose it would have helped if I had actually used the correct issue number in my comment? =) This is the one I'm referring to: MDL-19084 I'd be willing to take a look and see what would be involved with taking the question backup/restore code out of the quiz (and probably lesson?) module(s) and making it a separate part of the process. But I think it makes more sense to have a discussion about that first, maybe here or in the developer forum, or perhaps somewhere else? I can understand why you would only want "used" categories and questions in a backup but it's come up recently where questions and categories are defined in a course without any activities and that course is meant to be used as a "template" with which to populate data into other courses. The template course is backed up and restored into the destination course (using the "silent" API calls). It's an automatic process that can either be invoked by a teacher or happens automatically when certain criteria are met.
Hide
Eloy Lafuente (stronk7) added a comment -

I see your point, Justin, although I'm not sure if questions are really tied to one course AT ALL! Only their use in activities makes them to be related to one course, afaik, so perhaps, current approach is the only possible one?

I'm adding Tim Hunt here to get his valuable POV.

Ciao

Show
Eloy Lafuente (stronk7) added a comment - I see your point, Justin, although I'm not sure if questions are really tied to one course AT ALL! Only their use in activities makes them to be related to one course, afaik, so perhaps, current approach is the only possible one? I'm adding Tim Hunt here to get his valuable POV. Ciao
Hide
Eloy Lafuente (stronk7) added a comment -

Or perhaps question categories are the ones tied to courses? (there is one contextid field there)

Uhm... definetively not sure. I hope Tim will be able to reply / comment about the possibility of adding those categories/questions without the existence of activities.

Ciao

Show
Eloy Lafuente (stronk7) added a comment - Or perhaps question categories are the ones tied to courses? (there is one contextid field there) Uhm... definetively not sure. I hope Tim will be able to reply / comment about the possibility of adding those categories/questions without the existence of activities. Ciao
Hide
Justin Filip added a comment -

Question categories exist at three levels:

  • system
  • course category
  • course

I think it makes sense that you would want to include anything defined in the course context in a backup, regardless of whether the questions are used in an activity or not. That and backup of questions probably shouldn't be tied to the backup code in an activity module.

Show
Justin Filip added a comment - Question categories exist at three levels:
  • system
  • course category
  • course
I think it makes sense that you would want to include anything defined in the course context in a backup, regardless of whether the questions are used in an activity or not. That and backup of questions probably shouldn't be tied to the backup code in an activity module.
Hide
Tim Hunt added a comment -

That's odd. This sounds exactly like MDL-4084 which I fixed some time age.

There is MDL-12403 which is not yet fixed, however.

Show
Tim Hunt added a comment - That's odd. This sounds exactly like MDL-4084 which I fixed some time age. There is MDL-12403 which is not yet fixed, however.
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
Michael de Raadt added a comment -

I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.

Show
Michael de Raadt added a comment - I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.
Hide
Tim Hunt added a comment -

I have a nasty feeling that this is still an issue. At least, it needs to be re-tested before it is closed.

Show
Tim Hunt added a comment - I have a nasty feeling that this is still an issue. At least, it needs to be re-tested before it is closed.

People

Vote (0)
Watch (4)

Dates

  • Created:
    Updated: