Undefined property LongAnswerResponse::$answer_feedback in LongAnswerResponse->getReportFormAnswerFeedback() in long_answer_classes.inc in result screen. This happens when I skip a long answer question in a quiz.

Comments

selvamkf’s picture

We managed to fix this. In long_answer_classes.inc , replace this line

'#default_value' => $this->answer_feedback with

'#default_value' => isset($this->answer_feedback) ? $this->answer_feedback : '',

  public function getReportFormAnswerFeedback($showpoints = TRUE, $showfeedback = TRUE, $allow_scoring = FALSE) {
    if (quiz_access_to_score() && $allow_scoring) {
      return array(
        '#title' => t('Enter feedback'),
        '#type' => 'textarea',
        '#default_value' => isset($this->answer_feedback) ? $this->answer_feedback : '',
        '#attributes' => array('class' => array('quiz-report-score')),
      );
    }
    return FALSE;
  }
Sivaji_Ganesh_Jojodae’s picture

Status: Active » Fixed

Thank you. Fix committed to git (b95c6a9..085361e).

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

eyenology’s picture

Status: Closed (fixed) » Active

I ran across this same error with, but with ShortAnswerResponse. The same fix in #1 worked in short_answer.classes.inc

eyenology’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

  • Commit 085361e on 7.x-4.x, 7.x-5.x authored by selvamkf, committed by sivaji:
    Issue #1979476 by selvamkf: Fixed Undefined property LongAnswerResponse...

  • Commit 085361e on 7.x-4.x, 7.x-5.x, quiz-pages authored by selvamkf, committed by sivaji:
    Issue #1979476 by selvamkf: Fixed Undefined property LongAnswerResponse...

  • Commit 085361e on 7.x-4.x, 7.x-5.x, quiz-pages, 2269219 authored by selvamkf, committed by sivaji:
    Issue #1979476 by selvamkf: Fixed Undefined property LongAnswerResponse...

  • Commit 085361e on 7.x-4.x, 7.x-5.x, 2269219 authored by selvamkf, committed by sivaji:
    Issue #1979476 by selvamkf: Fixed Undefined property LongAnswerResponse...
fox mulder’s picture

Issue summary: View changes

I can not reopen this, but as eyenology wrote (#4) same error exists in quiz/question_types/short_answer/short_answer.classes.inc too
Version: Quiz-7.x-5.1

yurg’s picture

Can confirm #11 works for Quiz-7.x-5.1