Moodle
  1. Moodle
  2. MDL-26773

PHP error notice when editing multianswer question

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0.3
    • Component/s: Questions
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Rank:
      16705

      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...

        Activity

        Hide
        Tim Hunt added a comment -

        Thanks Joseph. Your proposed fix is right.

        I hope you might think about learning to use git some time

        Show
        Tim Hunt added a comment - Thanks Joseph. Your proposed fix is right. I hope you might think about learning to use git some time
        Hide
        Helen Foster added a comment -

        Thanks Joseph and Tim. The fix is available in this week's 2.0.2+.

        Show
        Helen Foster added a comment - Thanks Joseph and Tim. The fix is available in this week's 2.0.2+.

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: