Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Duplicate
-
Affects Version/s: 1.6
-
Fix Version/s: None
-
Component/s: Questions
-
Labels:None
-
Environment:All
-
Affected Branches:MOODLE_16_STABLE
Description
Currentlly you can write a new questiontype because types are now plugins, but you can't add it to the known qtypes in import/export formats.
Example: Joseph Rezeau regular expression questiontype is only a slight variation of the shortanswer qtype. So if you use Joseph's original idea of REPLACING shortanswer qtype, you are able to import/export questions in a lot of formats including GIFT and XML.
But if you ADD it as a new question type (We choose 'regexp' with Joseph as name for this qtype and the code is ready and working) you are not able to export/import any regexp questions !
This is unfortunate so I think the import/export code should be made expandable if we want new custom qtypes to be really popular.
Maybe as a first step if Moodle xml was modified it will be a good start, but maybe also designing a general way for formats to be expandable would be better ?
Gustav, can you forward this to Howard Miller ?
Issue Links
| This issue duplicates: | ||||
| MDL-6367 | New question types cannot easily be added to the import/export formats |
|
|
|
Activity
- All
- Comments
- History
- Activity
- Source
- Test Sessions
From Gustav Delius (gwd2 at york.ac.uk) Wednesday, 5 April 2006, 02:23 AM:
Yes, I have been discussing this with Howard already. In order to have a true plugin capability for both questiontypes and for import/export formats we need one file for each questiontype - format pair. This file should contain the code to extend the questiontype class by the functions needed for importing and exporting that questiontype in that format.
Using classes for this has the advantage that new questiontypes can inherit the import/export functions from existing questiontype classes in those cases where they are very similar.
I agree with you that the XML format is the first one which should be made extensible in this way.
From Gustav Delius (gwd2 at york.ac.uk) Friday, 28 April 2006, 05:41 PM:
I am assigning this to Howard because it is clear that I won't have the time to do anything about it
From Howard Miller (howard.miller at udcf.gla.ac.uk) Friday, 28 April 2006, 05:46 PM:
Yes, it's all very true. But... I haven't the slightest idea how to actually do it.
The trouble seems to me to be that in most case 90% of the processing takes place before you know the questiontype. GIFT for example simply infers the questiontype from the syntax of the question - it must all be parsed before the code can judge what the question is. How do you make that expandable.
I have a vague notion about adding a 'custom' method that can be overriden to deal with unknown import formats before an error is thrown, but I haven't thought that much about it (yet).
From Jean_Michel Vedrine (jean-michel.vedrine at wanadoo.fr) Friday, 28 April 2006, 11:06 PM:
Howard,
Maybe we should concentrate on import/export formats where the questiontype information is preserved in the export (as Moodle XML) because I agree with you that other types like GIFT will be more difficult to expand and for some types I can't even imagine how they could be expanded !!(Aiken or OAN ?)
For the users of custom question types the important thing is to have a mean to exchange question banks, whatever the format is, they don't need all formats to work.
For instance when the RQP question type will work again, I would love to be able to share my questions with other math teachers but I am certainly not thinking I will be able to do it via GIFT files !!!
From Gustav Delius (gwd2 at york.ac.uk) Saturday, 29 April 2006, 04:35 PM:
I agree with Jean-Michel that there needs to be one import/export format that works for all question types. Luckily in a sense that already exists, namely the XML format that is used for backup/restore. We should make that available via the import/export interface.