MDL-35325 fix adaptive feedback to use the last graded submission

Prior to this commit, the adaptive question type provided question-
type feedback based on the most recent question step, rather than
the most recently graded question step: as a result, students could
inappropriately retrieve feedback for answers which were merely
saved-- without submitting their answers and being assessed penalties.

To solve this issue, the following changes are made:

* A custom 'qtype_feedback' is implemented, which fetches feedback for
  the most recently graded step.
* A 'get_restricted_attempt_for_feedback' method is added to the
  adaptive behavior, which retrieves a
  question_attempt_with_restricted_history object whose history is
  limited to the most recently graded submission (or to the question's
  initialization, if no submissions have been graded), intended for use
  by the question renderer.
MDL-35325 allow qbehavior to control qtype feedback

Prior to this commit, the core question renderer directly included
question-type feedback; without passing through the relevant question
behaviour class. As a result, the question behaviour had no say in
what feedback was provided, and at least one behaviour (adaptive)
incorrectly displayed feedback for the most recent step, whether it
had been graded or merely saved.

To fix this error, this commit introduces the following new methods
to the qbehaviour_renderer API:

* qtype_feedback, which is used to determine the question type
  feedback appropriate for the current question attempt and behaviour.

The default implementation of qtype_feedback, provided in
qbehaviour_renderer, should be appropriate for most cases-- so
question behaviours unaffected by the bug above will not require
modification.

From this commit forwards, the core_question_renderer will use this
new API function, rather than calling the qtype renderer's feedback
method directly; allowing the qbehaviour control over any relevant
changes.
MDL-35325 qtype_multianswer: Fix adaptive behaviour feedback popup displaying prematurely

Adds a method to retrieve latest graded answer in question_behaviour.