MDL-32188 question engine: behaviour static methods -> new classes
authorTim Hunt <T.J.Hunt@open.ac.uk>
Thu, 9 Aug 2012 18:42:57 +0000 (19:42 +0100)
committerTim Hunt <T.J.Hunt@open.ac.uk>
Fri, 4 Oct 2013 11:15:01 +0000 (12:15 +0100)
commitf3460297a962e2a3d07869a56241866576ffc7a3
treebccfbc1651d9f0a569334bcb07af6a897ecbdd4e
parent56cc9b387ed095a18a6ee4df724dabf490f93df6
MDL-32188 question engine: behaviour static methods -> new classes

It was always a bit of a hack to use static methods on the
qbehaviour_whatever classes to return metadata about the behaviour. It
is better design to have real qbehaviour_whatever_type classes to report
that metadata, particularly now that we are planning to add more such.

For example, inheritance works better with real classes. See, for
example, the improvements in
question_engine::get_behaviour_unused_display_options().

This change has been implemented in a backwards-compatbile way. Old
behaviours will continue to work. There will just be some developer debug
output to prompt people to upgrade their code properly.
29 files changed:
mod/quiz/comment.php
mod/quiz/report/grading/report.php
question/behaviour/adaptive/behaviourtype.php [new file with mode: 0644]
question/behaviour/adaptivenopenalty/behaviour.php
question/behaviour/adaptivenopenalty/behaviourtype.php [new file with mode: 0644]
question/behaviour/behaviourbase.php
question/behaviour/behaviourtypebase.php [new file with mode: 0644]
question/behaviour/deferredcbm/behaviour.php
question/behaviour/deferredcbm/behaviourtype.php [new file with mode: 0644]
question/behaviour/deferredfeedback/behaviour.php
question/behaviour/deferredfeedback/behaviourtype.php [new file with mode: 0644]
question/behaviour/immediatecbm/behaviour.php
question/behaviour/immediatecbm/behaviourtype.php [new file with mode: 0644]
question/behaviour/immediatefeedback/behaviourtype.php [new file with mode: 0644]
question/behaviour/informationitem/behaviour.php
question/behaviour/informationitem/behaviourtype.php [new file with mode: 0644]
question/behaviour/interactive/behaviour.php
question/behaviour/interactive/behaviourtype.php [new file with mode: 0644]
question/behaviour/interactivecountback/behaviour.php
question/behaviour/interactivecountback/behaviourtype.php [new file with mode: 0644]
question/behaviour/manualgraded/behaviour.php
question/behaviour/manualgraded/behaviourtype.php [new file with mode: 0644]
question/behaviour/missing/behaviour.php
question/behaviour/missing/behaviourtype.php [new file with mode: 0644]
question/behaviour/upgrade.txt
question/engine/lib.php
question/engine/upgrade.txt [new file with mode: 0644]
question/type/essay/question.php
question/type/questionbase.php