Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-17229 Shortanswer questiontype refactoring
  3. MDL-24386

Separate feedback handling from print_question_formulation_and_controls

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.1
    • Component/s: Questions
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE

      Description

      There is one more problem with print_question_formulation_and_controls() function in shortanswer question: it includes code to determine feedback, which mimicks code from grade_responses. If some (inherited) question would want to change grade_responses algorithm - as it does PREG 2.0 - it would also want to change feedback determining code too (without affecting question text or controls output). So it will be better to separate feedback handling in separate function, called from print_question_formulation_and_controls.

      Another, more radical and efficient way, would be to save answer id in the $state->responses during grading to avoid recalculating it to determine feedback .

      If any of these solutions suits you, I would write a patch implementing it - it is needed for my preg question type. It can be 2.0 only, since 1.9 version of PREG doesn't need it.

        Attachments

          Activity

            People

            Assignee:
            timhunt Tim Hunt
            Reporter:
            oa_sychev Oleg Sychev
            Participants:
            Component watchers:
            Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              1/Jul/11