Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-51659

The mod_choice\event\answer_submitted(updated) events are incorrect

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.8.8, 2.9
    • Fix Version/s: None
    • Component/s: Choice
    • Labels:
    • Affected Branches:
      MOODLE_28_STABLE, MOODLE_29_STABLE

      Description

      1. The objecttable is wrong. We are submitting an answer, not a choice activity. This also makes the description incorrect as it states we made a choice with id '$this->objectid' which just refers to the 'choice' table. The trigger for these events should be triggered after we either insert to or update the 'choice_answers' table.
      2. The 'optionid' is being passed as an array, so we can't map it when restoring - even if just one answer is selected. The event is triggered each time a choice is answered, where it may be possible to select multiple options, so the value is converted to an array, which is then passed to the event. This should be passed as an int (which will be fixed when addressing 1) so we can actually map it on a restore, currently we cannot.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              markn Mark Nelson
              Participants:
              Component watchers:
              Dan Marsden, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: