-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API accepts partial question definitions and cascades #1391
Comments
@geoo89, @smmercuri this is something we discussed yesterday. I expect we could cascade before a call is made to the API, but this seems a sensible addition to the API itself. Let's discuss this issue here before making decisions. |
Maybe the input also needs to be part of the xml which is directly/always communicated? The input type is certainly something which is relatively dynamic (across multiple questions), though I guess it's fine to assume it's algebraic input with no relevant additional options given unless otherwise specified. What are the instances you have in mind when you say this would be very helpful? In my case I'm imagining that I would have written a question in stack in Moodle already, and would therefore be using the exported xml, at which point although it's neater to pass the fragment, it would actually create work in creating the fragment first. But I'm sure there are instances where one isn't starting from the export and this would be more useful? Not particularly relevant to this thread, but just to make a note on a vaguely connected thread, I also think we should have an API route that send a filename and question identifier, allowing the server to pull the xml from a file stored on the server. |
Hi Sam, some colleagues in Kenya are working on a text book using PreText (which you may be familiar with), but hope to embed STACK questions in the interactive version. The Moodle XML export is quite bulky, and it would be nice to include something more concise in the XML that defines the exercises (along the lines of this example for a Webwork question). Some people may also prefer to edit their questions in a text editor rather than a GUI, and a readable format may be convenient for this too. Chris' example still feels rather bulky, especially with all the
At the same time, it feels like going down this way may be a rabbit hole, and requiring the input to be a subset of the Moodle XML fields is more consistent and predictable. So anything that is different from a Moodle XML subset maybe belongs into a client-side script then, if one wanted to use that? |
Hi Georg, I know of PreText, though I've never actually tried using it. The YAML format support for questions would probably help make these snippets less verbose here, but either way I agree that it would be nice to support some sort of partial, with the rest of the xml/yaml being inferred from defaults. @sangwinc, this probably isn't specific to the API though, as any desire to write/modify the xml/yaml for a question would probably want to be able to operate only on such partials. Sam |
Currently the API expects to receive the full Moodle XML of a question. It would be very helpful if we accept a fragment and use any received information to overwrite default values.
E.g. rather than send in the whole of this file
https://github.com/maths/moodle-qtype_stack/blob/master/samplequestions/stacklibrary/Algebra-Refresher/01-Combinations-of-arithmetic-operations/AlgMap-1-1.xml
We could just send this to the API
In this case we have a non-trivial PRT. Eventually (!) it would be good to author the nodes as
<test>EqualComAss(ans,ta)</test>
rather than have separate XML fields e.g.<answertest>EqualComAss</answertest>
.Anyway, for now allowing cascading on the API side would be a real improvement.
The text was updated successfully, but these errors were encountered: