When I view the results of a Quiz containing questions of type long_answer I get the following error message:

Notice: Undefined property: LongAnswerResponse::$answer_format in LongAnswerResponse->getFeedbackValues() (regel 310 van /Users/fabianderijk/Sites/dubbelklik/sites/all/modules/contrib/quiz/question_types/long_answer/long_answer.classes.inc).

I've added a check that checks if answer_format exists, if not just use check_plain instead of check_markup. This way the error won't show up. I will upload the patch up next.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fabianderijk created an issue. See original summary.

fabianderijk’s picture

Johan den Hollander’s picture

Version: 6.x-5.x-dev » 7.x-5.x-dev
Da_Cloud’s picture

Personally I would suggest using the following code instead.
'attempt' => check_markup($this->answer, (isset($this->answer_format) ? $this->answer_format : NULL)),

Check_markup already has a fallback functionality should the second parameter be NULL, this will result in the use of the variable "filter_fallback_format". While in most cases this will probably result in the exact same output as a check_plain, it is possible to overwrite this variable at which point the output could be different.

Johan den Hollander’s picture

Updated patch to work with the latest dev version.
I used @Da_Cloud's suggestion for this.

djdevin’s picture

Status: Active » Needs review