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

PHP error notice when editing multianswer question

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0
    • 2.0.3
    • Questions
    • None
    • MOODLE_20_STABLE
    • MOODLE_20_STABLE

    Description

      with PHP error debug ON:

      PHP error notice when editing multianswer question:
      Notice: Undefined variable: course in C:\server\htdocs\moodlegit20\moodle\question\type\multianswer\questiontype.php on line 174
      I think this bug comes from this change in multianswer/questiontype.php line (on November 22, 2010)

      • function save_question($authorizedquestion, $form, $course) {
        + function save_question($authorizedquestion, $form) {
        the $course parameter was removed
        so $course is unknown in the following line:
        $form->course = $course; // To pass the course object to
        // save_question_options, where it is
        // needed to call type specific
        // save_question methods.
        Simply removing $form->course = $course; resolves the problem. I have no idea how (un)useful $form->course is. Maybe it is no longer useful...

      Attachments

        Activity

          People

            timhunt Tim Hunt
            rezeau Joseph Rézeau
            Aparup Banerjee Aparup Banerjee
            Tim Hunt, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              5/May/11