Future CodeRunner developments for Moodle 4.x

Re: Future CodeRunner developments for Moodle 4.x

by Richard Lobb -
Number of replies: 0
Thinking more about linking of questions to prototypes ...

Suppose in my course I have the following 3 activities
  1. A question bank my_prototype_bank, containing all my custom prototypes.
  2. A question bank my_cr_question_bank containing my learning-module CodeRunner questions. These questions use prototypes from three different question banks:
    • The standard built-in prototypes (in the CodeRunner prototypes course)
    • my_prototype_bank
    • my_other_course_prototypes, which is a question bank in another course I teach.
  3. A quiz that uses a subset of questions from my_cr_question_bank.
What happens when I export that quiz?

Since the goal is to keep together any linked information, I assume that the export will need to contain not only the quiz questions from my_cr_question_bank but also the prototype questions from the three different prototype banks. At this point my understanding get fuzzy (or even fuzzier). Are all those questions and prototypes (and only those ones) in a new question bank that's included in the quiz, with the questions linked to their prototypes in that question bank? That seems the most probable outcome but there are other possibilities, such as multiple attached (partial or complete) question banks.

Now ... if I import that exported quiz into my other course, I have duplicate copies of all the system prototypes that the quiz uses and also duplicates of the prototypes from my_other_prototypes.

On the plus side, this means integrity has been maintained - the quiz will continue to run exactly as before. This is great and will avoid some of the screw-ups that have occurred in the past. But on the downside I have potential confusion from the fact I have duplicate prototypes: if, say, I tried to update one of my prototypes in the my_other_prototypes bank, I would be surprised to discover that the questions in my imported quiz didn't also update, even though their coderunner question type name is exactly the same as that of the updated prototype.

Similar confusions would seem to occur during course backup and restore. Suppose at the start of a new academic year we set up a new Moodle server with a new version of CodeRunner that has updated some of the built-in question prototypes. I backup my course from last year's server and restore it on the new year's server. The backup copy will presumably have copies of all the built-in question types from last year, so will not use the updated question types.

Some or all of these difficulties could be mitigated by having a special CodeRunner question-bank plugin that allows you to manage the prototypes, and perhaps "re-parent" a set of questions that use, say, a copy of a built-in prototype to instead use the updated built-in prototype. But I an concerned that:
  1. This is sounding like a worryingly large amount of redesign and redevelopment of code, and my development time is very limited. 
  2. I fear it might prove even more confusing to question authors than the current 'find-prototype-by-name' system.