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

Multianswer (Cloze) left orphan database items(multiplechoice,numerical) when saving a modified question.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.8.3
    • Fix Version/s: None
    • Component/s: Questions
    • Labels:
      None
    • Affected Branches:
      MOODLE_18_STABLE

      Description

      When saving the questions, it reuse the same subquestion without checking that the qtype has changed.
      So if the first subquestion is a numerical one and in the modifed question this became a shortanswer the question_numerical database item always exist and refers to a question that is a shortanswer.
      Unused subquestions are simply deleted by
      // Delete redundant wrapped questions
      if(is_array($oldwrappedids) && count($oldwrappedids))

      { $oldwrappedids = implode(',', $oldwrappedids); delete_records_select('question', "id IN ($oldwrappedids)"); }

      the other database items are ignored...
      As I am writing a new code for multiquestion i will solve this.

        Attachments

          Activity

            People

            Assignee:
            ppichet Pierre Pichet
            Reporter:
            ppichet Pierre Pichet
            Tester:
            Nobody
            Participants:
            Component watchers:
            Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: