Hi Gustav,
Yes, I know you have worked quite hard at making the question type independent from core code. However, as you can see in my bug report, it is not quite so simple.
1- Any new question type will work without any change to core question & quiz code. However, there remain a few alterations to be made to other core code files for it to work fully.
Let's first the example of a new question type called MYQUESTIONTYPE.
a) If you want questions created with MYQUESTIONTYPE to be exported/imported (e.g. in the Moodle XML format) you have to modify \question\format\xml\format.php.
b) If you want to follow the same conventions as for the other question types, you'll need to make this addition to lib\questionlib.php: define("MYQUESTIONTYPE", "myquestiontype");
c) There is a little formatting problem, since MYQUESTIONTYPE is not known to \mod\quiz\styles.php e.g. here:
mod-quiz-attempt .que.shortanswer .feedback,#mod-quiz-attempt .truefalse .feedback {(would need to add #mod-quiz-attempt .myquestiontype .feedback).
d) There is another problem because the <title> tag for the new regexp question type is created through \lib\questionlib.php:
function print_question_icon($question, $editlink=true, $return = false) {// returns a question icon global $QTYPES, $CFG; $namestr = get_string($question->qtype, 'quiz');One has to add to \lang\...\quiz.php this line:
$string['myquestiontype'] = 'My brand-new question type';
2- I also need my new question type (regular expression short answer) to be available to the existing Close (Embedded) question type. So I've had to modify \question\type\multianswer\questiontype.php file for it to accomodate my new question type.
Of course, if all the points mentioned above (1a through 1d) could be solved in the core files so that any new question type would really work by only dropping it into \question\type, it would be an ideal situation. In the meantime, I really have to insist that the regexp question type be made part of 1.6, for the reasons mentioned in my previous post.
Thanks in advance,
Joseph
PS I've uploaded my new type and proposed modified core files for version 1.6 beta 3 to the bug tracker.