Importing multiple xml files into question bank

 Importing multiple xml files into question bank

Patrick Fitzgerald發表於
Number of replies: 2
 
 

Does anyone know any way to export multiple XML files into a Moodle Quiz. I know how to process one but I can't find any answers on how to do multiple ? Can anyone help with this? If the XML files were compressed into a zip file? Could that work ?

Best 

Patrick

評比平均分數: -
In reply to Patrick Fitzgerald

Re:  Importing multiple xml files into question bank

Rick Jerz發表於
Particularly helpful Moodlers的相片 Testers的相片
I believe the default behavior is to import one at a time.

If you know what you are doing, you might be able to combine multiple XML files with a text editor. However, the time it would take to do this would probably not save you any overall time importing the individual files.
In reply to Patrick Fitzgerald

Re:  Importing multiple xml files into question bank

Eoin Campbell發表於
Core developers的相片 Particularly helpful Moodlers的相片 Plugin developers的相片
The Moosh command-line tool supports importing Moodle Question XML files directly into a quiz (see https://moosh-online.com/commands/#question-import) or a question bank category (cf. https://moosh-online.com/commands/#questionbank-import). However, you must specify the quiz ID or the question bank category ID, which might be tricky. You also need command-line access to the Moodle server for this approach. A better solution would be to write an XSLT script to combine multiple files into one, and then import the final output into a course question bank, see https://stackoverflow.com/questions/9693431/combine-multiple-xml-urls-into-one-xml-file-with-php-xslt for a starting point.
評比平均分數:Useful (2)