output folder for exported questions

output folder for exported questions

от Jurgen Schepens -
Number of replies: 14

Hi

I wanted to export some questions of a quiz to XML or TXT file.
My first problem is I can't select an output path and I don't know where the file is stored!

Secondly I guess the exported questions will be the same as the ones I've imported from TXT file. Adapations that were made or added pictures will be lost?

Isn't there a way just to export a quiz as it is at that moment with pictures included?

Thanks
Jurgen

In reply to Jurgen Schepens

Re: output folder for exported questions

от Tim Hunt -
Снимка на Core developers Снимка на Documentation writers Снимка на Particularly helpful Moodlers Снимка на Peer reviewers Снимка на Plugin developers
One option is to use the couse backup feature. You can choose to backup only the quiz data on a course, and it does include everything.

If you are just exporting the questions. The export initially creates a file on the server, then you get a link to click to download it, or you can get it from the course files area. I don't know if it includes images, I have never tried it, but it does include any edits you have made in Moodle, and questions you have created on the server that were never imported.
In reply to Tim Hunt

Re: output folder for exported questions

от John Isner -
I am very interested in this discussion because I am preparing to do a backup/restore of a course from one site to another.  The course I'm copying has dozens of quizzes with a total of 1800 quiz questions and lots of images.

I made the backup.  It seems to contain EVERYTHING from the course.   For example, it contains all the files in the files area, including uploaded images used in quizzes.  That's good: I wouldn't want to have to copy my images separately and re-insert them into 1800 quiz questions!

I'm planning to do my restore into course #1 (the moodle "front page," which is also a course).  I do this so that my image files become site files, visible to every course on the site.  The backup is from a course which is not #1. 

Will this work, or will it blow up the target site smile

FYI the source moodle is version 1.5.4 and the target is moodle 1.6+.

Thanks in advance for your advice!

In reply to John Isner

Re: output folder for exported questions

от Joseph Rézeau -
Снимка на Core developers Снимка на Particularly helpful Moodlers Снимка на Plugin developers Снимка на Testers Снимка на Translators

Hi John,

> I'm planning to do my restore into course #1 (the moodle "front page," which is also a course).  I do this so that my image files become site files, visible to every course on the site.  The backup is from a course which is not #1.

I'm pretty sure what you intend to do is impossible. sad Any course you restore on a Moodle site is either restored as an existing course (deleting it first or adding data to it) or as a new course, but that means any course except the Moodle front page. The Moodle front page is sometimes considered as course #1, but it is really quite different from a "normal" course.

Joseph

In reply to Joseph Rézeau

Re: output folder for exported questions

от John Isner -
Hi Joseph,
But if it's impossible, why do we bother to back it up every night?  And why is there a "Restore" link in the front page Administration block that takes you to the Site Files->backupdata folder?  (I should have mentioned that I'm the administrator of this site, so I see the Administration block).

I hear different opinions on the front page "course" depending on who I talk to.  Some people say it's "really quite different from a 'normal' course," and others say it is no different from any other course.  So far I have yet to discover how it's different, except that some features are not shown -- like the ability to add teachers and students.  But you can access these features by constructing an appropriate URL.

So....If I back up just the things that I want to bring over from the course on my other site (questions, quizzes, images) and place the zip file in the target site's Site Files->backupdata directory, and then click "restore," what will happen?  I'm convinced SOMETHING will happen.  I'm just not sure it will be something good smile.
John
In reply to John Isner

Re: output folder for exported questions

от Joseph Rézeau -
Снимка на Core developers Снимка на Particularly helpful Moodlers Снимка на Plugin developers Снимка на Testers Снимка на Translators

Hi John, let's take an example.

  1. On a Moodle Site called mySite01 you have courses: Maths, English, History, Art.
  2. On mySite01 backup you course Maths.
  3. This gives you a backup file called something like backup-maths-20060706-1810.zip.
  4. Log in as Admin to your other Moodle Site, called e.g. mySite02, and upload       backup-maths-20060706-1810.zip to the Site files.
  5. On mySite02, still logged in as Admin, in Administration, click on the Restore link.
  6. This takes you to the Site Files folder where, on the line backup-maths-20060706-1810.zip, you click on the Restore link.
  7. You see these messages: You are about to start the restore process for: backup-maths-20060706-1810.zip. Later in this process you will have a choice of adding this backup to an existing course or creating a completely new course. Do you want to continue?
  8. Click Yes
  9. Next screen, click Continue.
  10. Next screen, you are given a choice of Restore to:
    1. Existing course, deleting it first
    2. Existing course, adding data to it
    3. New course
  11. There is no option to restore the contents of your Maths course to mySite02|"Course#1" (i.e. mySite02 Front page).

John, when you write "But if it's impossible, why do we bother to back it up every night?" what exactly do you mean by "it"? Of course it is possible to backup and restore a) individual courses and b) your Moodle site front page. But, as far as I understand Moodle, it is not possible to restore an individual course (Maths, English, Art, etc.) to the front page, as if it were course #1.

I hope this helps...

Joseph

In reply to Joseph Rézeau

Re: output folder for exported questions

от John Isner -
Hi Joseph,
Thank you for your example.  It was very helpful in sorting this out.  I was confused about what would happen in step 10 if I were to select

Restore to existing course, adding data to it

So I tried it.  A couple of screens later, I was asked  to choose:

                Choose a course
Art
English
History
Main
Maths


The courses are listed alphabetically (I substituted your names for mine).  See Main?  It's the name of course #1.  So Moodle DOES give me this option.

At this point, I aborted the restore operation, not sure of what would happen  and not wanting to destroy my siteусмивка  But the question remains: what would happen if I selected Main and continued?
John


In reply to John Isner

Re: output folder for exported questions

от Tim Hunt -
Снимка на Core developers Снимка на Documentation writers Снимка на Particularly helpful Moodlers Снимка на Peer reviewers Снимка на Plugin developers
I do have a test install that I could risk destroying. This was 1.6+, and actually it seemed to work and did not destroy my install. My various test quizzes and forums got added to the site front page, and the student attempts at the quiz came over too.

However, if you were doing this for a particular purpose, I would not back up the whole of the course, just make a backup containing the few things you want to transfer (in this case the files) and only restore those. That seems safer.

And I am only giving the result of one test here. I am not giving you any guarantee that it would work for you.
In reply to Tim Hunt

Re: output folder for exported questions

от John Isner -
Tim,
Thank you very much for testing this for me.  I'm getting up the courage to try it.  Hopefully I will be able to restore my front page course from last night's backup if things don't work out as expected.

The only remaining issue is that the backup file is from a 1.5.4 site, and I will be restoring to a 1.6 site.   According to http://docs.moodle.org/en/Backup_FAQ

Any backup files with contents which are not 100% ISO-8859-1 will be a problem to restore to Moodle 1.6 (and upwards) running under Unicode. Instead, please try the following:

  1. Make a clean install of Moodle 1.5.x (the latest version available)
  2. Restore all your courses there (they should work if they were working originally)
  3. Upgrade your site to Moodle 1.6 and run the UTF-8 migration script
  4. Backup your courses again

This will produce a new set of backup files that will be 100% UTF-8 and you will be able to use them with Moodle 1.6 without any problems.


Does this apply to ALL pre-1.6 backup files?  If not, how can I test if my backup file is 100% ISO-8859-1?
In reply to John Isner

Re: output folder for exported questions

от Joseph Rézeau -
Снимка на Core developers Снимка на Particularly helpful Moodlers Снимка на Plugin developers Снимка на Testers Снимка на Translators
Hi John,
You are quite right, it is possible to restore any course to course #1 (front page) of a Moodle site, through selecting option 2: Existing course, adding data to it.
We learn all the time! blush
Hope you will be able to achieve what you wanted to do, thanks also to Tim's advice on this.
All the best,
Joseph
In reply to Joseph Rézeau

Re: output folder for exported questions

от John Isner -
Hi Joseph,
I'm very timid about trying new things, especially if they're not explicitly documented.  If it weren't for moodle forums, I'd never try anything new!  At least I know that if I crash my site, I can always ask the forum how to restore itусмивка.

Once again, many thanks to both you and Tim for your help!
--John
In reply to John Isner

Re: output folder for exported questions

от Tim Hunt -
Снимка на Core developers Снимка на Documentation writers Снимка на Particularly helpful Moodlers Снимка на Peer reviewers Снимка на Plugin developers
I would strongly recommend you try this first on a test setup, not on your real server. And I would be fascinated to know if it works. I must admit that the backup and restore code is one bit I don't understand very well, mainly because it normally just works, and so I have not had to look in there in detail yet to try to fix a bug.