Use GIFT to import "decision tree-like" questions in a Lesson

Use GIFT to import "decision tree-like" questions in a Lesson

Joao CORREIA -
回帖数:3
Hello everyone,

I am used to writing tests using GIFT (fully writing them on Visual Studio Code, I find it fun don't ask why). I am now trying to write a "positioning" test, that is a test that would evolve with the answers you'd give it.

I read that you could sort of do it through a Lesson, using the "if A then B" logic. If someone has a better suggestion, please share ! But in the meantime I was wondering if it is possible to write that "If A then B" logic down when writing the .gift file ?

Thank you <3
回复Joao CORREIA

Re: Use GIFT to import "decision tree-like" questions in a Lesson

Visvanath Ratnaweera -
Particularly helpful Moodlers的头像 Translators的头像
I'm a new comer to Lesson. My impressions are a) you can't write Lessons in GIFT or any similar format b) the question types Lesson can handle are limited.
回复Joao CORREIA

Re: Use GIFT to import "decision tree-like" questions in a Lesson

Eoin Campbell -
Core developers的头像 Particularly helpful Moodlers的头像 Plugin developers的头像
If your goal is to create lessons using a full-featured editor, rather than the clunky web-based lesson editing interface in Moodle, then you could consider using the Microsoft Word file Import/Export (Lesson) plugin to create the text content pages, and the Microsoft Word file Import/Export (Question) plugin to create the questions. The question plugin uses a structured table in Word to contain each question, not the GIFT format. The lesson plugin allows standard narrative text (including images, tables, etc.) in Word, and uses headings as delimiters to decompose it into separate pages in the lesson.
Ideally, the Lesson plugin should import both questions and text so that they could be kept in a single Word file, but unfortunately this is not possible (as yet). Once imported, you still have to stitch the pages and the questions together in the logical structure that you want, as they initially form what is essentially a long linear list.



回复Eoin Campbell

Re: Use GIFT to import "decision tree-like" questions in a Lesson

Nick Patsiouras -
For what it's worth, the underlying structure of a backup is already in XML. It shouldn't be difficult to add the import/export feature.
If you do a backup on a Lesson and extract the internals, the lesson itself resides in activityXX/lesson.xml.
It should contain any info needed in there to just export/import the lesson without any other info like users, grades etc.

Currently I'm regenerating the whole mbz on my own, but it's impractical as the ids for sections, contexts etc can be corrupted. But so far it's been mostly successful even with incorrect ids (I assume to a point moodle ignores the ones in the files and overrides them with what it currently sees in db).

Shame that at the very least MoodleXML is not possible yet.