Absolute links remain in shared quiz backup

Absolute links remain in shared quiz backup

by Don Hinkelman -
Number of replies: 3
Picture of Particularly helpful Moodlers Picture of Plugin developers
I am sharing a listening quiz (used for language placement tests) as a backup zip file. When my colleagues restore it, the links to the audio files remain linked to my server. I assumed the backup/restore process strips the path to my server and replaces them with the path to the files now uploaded on the new server. Is that assumption correct?

If it is, then what is causing the problem. I have a few ideas.
  1. different versions of Moodle (mine and his--should I only share between servers with the same version of Moodle)
  2. bad backup procedure (I am doing it inside the course with course files attached, no users)
  3. bad zip moving (I backup in the course with course files attached, then find the zip file by FTP client, download to my desktop, then email to colleague)
  4. quiz links (maybe the quiz files have links to a site file location, not a course file location)
  5. quiz database screwup (I have moved these files and associated questions all around various servers, maybe some reference is making trouble)

Thanks for any advice! Hopefully, the answer is I made a mistake or that everything will be solved in version 1.5. smile
Average of ratings: -
In reply to Don Hinkelman

Re: Absolute links remain in shared quiz backup

by Timothy Takemoto -

Hi Don
Yes, as Martin D writes
"backup/restore detects references to wwwroot and converts them to a neutral representation on backup, then does the opposite on restore. If it's not working .... yet this is probably a bug that needs to go in the bug tracker for Eloy" (my snip)

However some thoughts
Were your categories published? If you publish your question categories, it can in effect have the REVERSE effect that you wish for
http://moodle.org/mod/forum/discuss.php?d=22460
because by publishing them it means that the quiz questions refer to the files referenced by the original published category, which means that courses may attempt to reference files in another course (which if the students are not enrolled in the other course they may not be able to do). So if you are sharing questions WITHIN an installation, especially those that reference files, it may be better NOT to publish them. Conceivably, this might have something to do with your problem.

I think that, as Sue says at the end of the above thread, some thought needs to go into how to share quiz categories/questions especially since back/restore is the only way to manage mutliple courses at the moment. In my system I think that I have "an unorganized mess of questions."

If "publishing" were the problem then you might still have issues with an "unplublished" quiz since there is another level of question reduplication minimisation using the question ID stamp and version as mentioned in a previous thread. I am not sure how this works, but apparently the versioning is introduced in 1.5.

A possible partial solution to the persistance of links to media files accessed by quizes might be
(1) Using a special multimedia folders in site files that is NOT open to everyone, and course files, that is referenced by quizes.
(2) In combination with (1) the greater use of variables rather than URLs at to reference in GIFT and in database and at backup and restore, i.e. at all stages and in all forms of quiz import export (as implemented by Jamie in the TUI).
E.g.
LIsten to this<a href="[sitefilesfolder]listening.mp3">click</a>. Did you year it?{=yes, ~no}
LIsten to this<a href="[coursefilesfolder]listening.mp3">click</a>. Did you year it?{=yes, ~no}
I am not sure whether this would have any bearing on your problem but I think that Howard Miller, the king of quiz import/export, is thinking of instituting such variables at the GIFT level. Once this variables exist perhaps they might be kept at the quiz execution and back/uprestore level with would eliminate the need to parse to check for wwwroot. If you agree please vote for http://moodle.org/bugs/bug.php?op=show&bugid=2956&pos=20
which has been deffered.

Timothy

In reply to Don Hinkelman

Re: Absolute links remain in shared quiz backup

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Don,

could you send me your backup file to see how are such links encoded and to check if there is something wrong at backup/restore level?

Basically, at backup level, two requirements are present to be able to move such links and files correctly:

1.- Every link must be absolute
2.- Files must be inside the course being saved.

If you are satisfying both, it should work (the backup).

At restore, things like questions already in destination server and published categories can break file access but, if I'm not wrong, links should be rebuilt without problems...

Ciao smile