"Write context to file" - exactly what does it do when exporting questions?

"Write context to file" - exactly what does it do when exporting questions?

by Przemek Kaszubski -
Number of replies: 2
Picture of Particularly helpful Moodlers Picture of Testers

This will probably come across as a simplistic question for many, but I'm having problems understanding the "Write context to file" option when exporting questions. "Write category to file" sounds clear to me, but what is that "context" that the other check box asks for? I would be very happy to learn. I've tried googling and searching the forums, but somehow haven't found an answer.

Thanks.

Przemek

Average of ratings: -
In reply to Przemek Kaszubski

Re: "Write context to file" - exactly what does it do when exporting questions?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

It is a fairly technical issue, and not terribly important, but to explain.

When you go to the question bank for a quiz, it looks like this:

  • Quiz: My quiz
    • Default for Quiz: My quiz
    • Test category
  • Course: My course
    • Default for Course: My course

If you export 'Other category' then, with the option on, what is written to the file is category="$module$/Test category". With the option off, what is written is category="Test category"

Now, if you import this into the question bank for another quiz, then for the option on case, you end up with

  • Quiz: Other quiz
    • Default for Quiz: Other quiz
    • Test category
  • Course: Other course
    • Default for Course: Other course

In the option off case, you end up with

  • Quiz: Other quiz
    • Default for Quiz: Other quiz
  • Course: Other course
    • Default for Course: Other course
    • Test category

Because things normally default to the course category if nothing else is specified.

Average of ratings: Useful (1)
In reply to Tim Hunt

Re: "Write context to file" - exactly what does it do when exporting questions?

by Przemek Kaszubski -
Picture of Particularly helpful Moodlers Picture of Testers

Thanks, I'll try and play with that when I find a moment - just tio make sure I underatnd this mechanism fully. Good to know that it's not critical - the funny thing though is that the docs for the Quiz module do mention this step and the check box itself, but there is no explanation.