Online GIFT format validator

Online GIFT format validator

- Cris Fuhrman の投稿
返信数: 0

Hello,

Some time ago, there were several discussions about GIFT and deriving a grammar for it, etc. to find a way to create GIFT questions quickly without having to find out when you try to import them whether they're valid. It's a lot of clicks before you can know if your GIFT is valid (essentially you have to let the Moodle back-end try to import the file before you get error messages). I can't comment anymore in those threads because they're too old.

The project I had started a while back using PEG (and PEG.js) is finally usable, although I don't claim that it's 100% compatible with the PHP implementation of GIFT. I've put the validator up on github at https://fuhrmanator.github.io/GIFT-grammar-PEG.js/docs/editor/ -- it's free and does the validation using Javascript (generated from the grammar) in the browser. The error messages come from the grammar, as well as the location in the editor where the error is found. 

Feedback is welcome! It should be useful for creating most types of GIFT questions.

Here's a screenshot:

Screen shot of GIFT validator

PEG.js can be written to create JSON output, so this project does that as well. For now, it's preliminary JSON and used mostly for testing. The project has several unit tests (in Node.js) for various formats of GIFT questions I have found. Perhaps those can be useful to the Moodle developers?