Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Talk:Question Engine 2:Overview

From MoodleDocs

Two types of feedback require different handling

Following the discussion in MDL-20269: there are two types of feedback in many questions: general feedback and feedback (we can call it per-asnwer feedback or question-defined feedback). They have different purposes and should be handled differently.

Feedback usually is given on per-answer basis and often used to spot a particular errors in partially incorrect answers, so the student can think more and answer carefully next time. This feedback you will want to be displayed to the student during attempt of quiz if he will be able to do next attempt on question. Actually this feedback is questiontype-dependent and should be left on the question type to handle, thought the interactive model could give it some pointers about whether it desirable.

General feedback actually belongs to question engine, not question type, and serves to give the student some sort of general comments i.e. what question is about, what is a correct answer and why. It often contains correct answer (with explanation), so it should NOT be displayed while question still can be attempted, as it makes further attempts useless.

I think that referring to these two as simply feedback is confusing and may lead to not quite perfect decisions, so I would like to see a description of what will become with each type of feedback in each interaction model.

There maybe a case where general feedback contains only some general hints and pointers, and a teacher want it to be used during the attempt. Probably the perfect solution would be adding to engine a concept of textual hints, with each hint associated with penalty. When you reach -100% penalty you can't further attempt a question and so -100% penalty effectively work for feedback with a correct answer and it's description. There may be two modes of hint using: by student initiative (in which case you may want to have a hint titles) or after each incorrect answer student will get next (more expensive) hint. --Oleg Sychev 10:11, 6 October 2009 (UTC)

Yes. --Tim Hunt 10:30, 6 October 2009 (UTC)
OK, that answer might be a bit brief :-) Basically I agree about the two different types of feedback, and they will be controlled separately in future. I am not sure whether I would agree that generalfeedback belongs to the question engine. I would rather say that it belongs to the question type base class - but then perhaps that is part of the question engine. Anyway, the two types of feedback will be controlled separately.
Also, hints will be supported, initially just for Interactive mode, but if someone wants to make a new mode to show hints on the student's initiative, that will, of course, be possible.--Tim Hunt 10:30, 6 October 2009 (UTC)

Does interaction models correctly separate questions from module using them?

Tim, you wrote:

When a quiz attempts is started, each question type is asked something like "A quiz attempt is starting using 'adaptive mode'. Exactly which interaction model should be used for questions of this type in this attempt?"

What is worring there is that it seems that question type should contains information about quiz and it's modes coded in it. I understand this is not easy problem, but not having question types separated from the modules that use them is a serious issue.

  1. What happens when a quiz added new mode(or a new module, like lesson, starts using question engine) while question type (maybe 3d party) isn't updated to understand it?
  2. What happens if a 3d party module will want to use question engine? The core question types will almost certainly doesn't contain an interaction model selector for it. Should author of such module deploy it with patches to core qtypes?

These are serious issues to consider.--Oleg Sychev 21:26, 20 October 2009 (UTC)

The phrase "When a quiz attempts is started" in the bit you quote should actually say "When some other part of the code (for example the quiz or lesson or ...) wants to start an attempt at some questions". I thought the first form was easier to understand, and the difference was not important for the point I was trying to make.
I suggest that you look at my work-in-progress code: http://github.com/timhunt/Moodle-Question-Engine-2/blob/new_qe2/question/engine/lib.php. When something, e.g. the quiz, starts using some questions, it creates a question_usage_by_activity, and calls set_preferred_interaction_model. The $model argument there is just a string.
Then look at the start_all_questions method, it passes that preferred model onto each question_attempt as it starts. So you end up in question_attempt::start, which is really the key bit of code. As you can see, it just asks the particular question to create the appropriate interaction model object and return it, by passing on the preferred model string.
So, it is just a string. There is nothing quiz-specific in the question engine. Actually, the problem will be, how can the quiz know the list of interaction models that are available, to display on the quiz settings form? The answer is that we will need to make a new function question_engine::get_available_interaction_models(), but again.
Anyway, this is not a new problem. It is fairly standard when you have a list of things that you want to be extensible, but you also need to find the best thing from the list in a given situation. Another example is the content negotiation part of the HTTP protocol. There, you will see that what one side is requesting is expressed as a text string that is interpreted on the other side. Our situation is similar but simpler.--Tim Hunt 08:42, 21 October 2009 (UTC)

Hmmm ... the problem may not be how can quiz know the list of available interaction models. The problem is should it know at show them all? I.e. if some third-party questions questions define a new, interesting interaction model with it, how core question types would behave in a quiz with such model set as preferred (user tried to create intermixed quiz with orfinary and 3d party questions)? Generally speaking, what a question type should do if it encounters unknown interaction model as preferred? Is there a some agent-driven negotiation like in HTTP from the quiz (module) side or something? --Oleg Sychev 16:46, 27 October 2009 (UTC)