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

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.1
    • 2.0
    • Questions
    • None
    • MOODLE_20_STABLE
    • MOODLE_21_STABLE

      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.

            timhunt Tim Hunt
            oa_sychev Oleg Sychev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.