Note:

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

Hinting question behaviours(VSTU)

From MoodleDocs


Warning: This page is no longer in use. The information contained on the page should NOT be seen as relevant or reliable.


Goal

Every question type should be able to create it's own hints using standard interface and without modifying Moodle core!

Basic hint and question with hint support classes and interfaces are defined in POAS abstract question, accessible throught Moodle plugins database.

Behaviours

Implemented behaviours allow to use advanced hinting in standard Moodle quiz behaviours:

  • adaptive;
  • adaptive (no penalties);
  • interactive.

These hinting behaviours are non-archetypal, i.e. you don't choose them in quiz settings. Instead, when you have question that supports advanced hinting, for example, in "interactive" behaviour quiz it actually use "interactive with hints" behaviour automatically.

Student choosen hints

This is planned archetypal behaviour, that should make possible to select hints for the student, not the teacher, with possible penalty for using it.

It is based on assumption, that student is no automaton and knows better, what hint he need in the given situation, than teacher. Student can make responsible decision to use hint giving up some porion of the grade.

[Olga please put you descriptions there]

API

To support advanced hints in you question type you need to make changes in 3 areas:

  • question class must support question_with_qtype_specific_hints interface, basically meaning that it could
    • report what hints are available for given student's answer (or before he gives anyone)
    • work as hint objects factory;
  • hint classes should be written, their main responsibilities are:
    • report hint type;
    • render hint for given hint key and answer;
    • report if hint available for given hint key and answer;
    • calculate hint penalty
  • question renderer class should
    • render hint with given key when _render_hint_<hintkey> behaviour variable is set (using question class for getting hint object by the key, and hint object to render hint);
    • optionally it could render hint buttons, if it is better to render them near some question elements.

Hint types

There are three hint types for now:

  • single instance hint - there is always one instance of this hint for the given student answer
    • a good example is next word hint for text answer, there is only one next word there;
  • multiple instance sequential hint - there may be several hints for one answer, that student can get in strict order
    • Moodle text hints from the teacher is example of this ones, they are accessible only in sequence;
  • multiple instance choosen hint - there may be several hints for one answer, that student could take in any order
    • for example, CorrectWriting question type has a correct placement hint for every misplaced word in the student answer, student should be able to choose separately for which misplaced words he actually want to see hint.