GIFT Syntax Check???

GIFT Syntax Check???

by Anthony Borrow -
Number of replies: 3
Picture of Core developers Picture of Plugin developers Picture of Testers
I have a teacher that would like to write up some quizzes in GIFT; however, he would like to make sure that the syntax is correct before attempting to import in to the Moodle question database. I have had some challenges with this previously myself and think it would be a nice thing to have. The question is in what program or perhaps even if there would be a desire to have a page to upload a file and simply check the syntax before doing the upload.

Another idea is to have a separate window that is updated as changes are made when editing a question so that the teacher can see as they work on the question how it will appear. This would save having to click on the preview and click back to edit and thus speed up the process of adding questions.

Any thoughts/ideas would be appreciated. Peace.
Average of ratings: -
In reply to Anthony Borrow

Re: GIFT Syntax Check???

by John Isner -
I use a dummy category for importing. If there are errors in the GIFT file, just delete all questions in the dummy category, fix the GIFT file, and try again.

When GIFT files allow categories to be specified at the question level, the dummy category method won't work, and we will need something like what Anthony is suggesting.

Rather than a syntax checker, however, I would prefer if importing were an idempotent process (that is, an all-or-nothing process). My concern about a syntax checker is this: What if the syntax checker gets out of sync with the actual import code?
In reply to John Isner

Re: GIFT Syntax Check???

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
+1 for your suggestion.

The quiz import process is actually two-pass, so it's potentially do-able to make it stop after syntax errors.

The whole error handling and reporting thing is quiz import could be better. This is something I am working on at the moment.
In reply to John Isner

Re: GIFT Syntax Check???

by Colin McQueen -
Would it be sensible and easier for the coder on the section of import code for a particular format to be the person responsible for coding the syntax checker?
Personally I'd prefer a 4 step process.
  1. code uploaded
  2. checked for syntax
  3. any acceptable questions displayed (option to skip this step)
  4. questions imported to question bank (or a selection thereof)
I think you need this check (step 3) for any multi item upload import routine including users, courses, groups etc not just questions.
I guess with some formats it may not be possible and there could be issues with large imports.