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

question->qtype missing in crash in quiz report single analysis

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 1.9.2
    • Questions, Quiz
    • None
    • php 5, mysql 5, apache 2, moodle 1.9.2
    • MySQL
    • MOODLE_19_STABLE
    • Easy

      We have added several extra question types over time from Moodle.org cvs contrib folder

      Today, it appears that one of them is not defined correctly (i guess)
      since one of our teachers found out she could not see the "single question analysis" of a quiz she gave
      we got fatal error reference to non-object on line 1474 in questionlib.php

      by the help of my friend (and co php developer - Eli Ben-David) we found a workaround / solution
      for this issue after changing the line:

      $namestr = $QTYPES[$question->qtype]->menu_name();

      to...

      $namestr = "no question type";
      if (!empty($question->qtype))

      { $namestr = $QTYPES[$question->qtype]->menu_name(); }

      i need a code review on this issue since i am very new to the "quiz & questions" module
      and i can not understand if this fix is ok or a deeper issue is at hand

            timhunt Tim Hunt
            nadavkav Nadav Kavalerchik
            Sam Hemelryk Sam Hemelryk
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

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