Hello,

I have upgraded the Quiz module from version 4.0-beta2 to 5.0-alpha10. When i visit ../admin/quiz/reports/score-long-answer i get an error.

In my dblog it is saying the column `result_id` doesn't exists.

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'a.result_id' in 'field list': SELECT a.result_id AS result_id, a.question_nid AS question_nid, a.question_vid AS question_vid, a.answer_feedback AS answer_feedback, a.answer_feedback_format AS answer_feedback_format, r.title AS title, qnr.time_end AS time_end, qnr.time_start AS time_start, qnr.uid AS uid FROM {quiz_long_answer_user_answers} a INNER JOIN {node_revision} r ON a.question_vid = r.vid INNER JOIN {quiz_node_results} qnr ON a.result_id = qnr.result_id INNER JOIN {node} n ON qnr.nid = n.nid WHERE (a.is_evaluated = :db_condition_placeholder_0) AND( (n.uid = :db_condition_placeholder_1) OR (qnr.uid = :db_condition_placeholder_2) ); Array ( [:db_condition_placeholder_0] => 0 [:db_condition_placeholder_1] => 1 [:db_condition_placeholder_2] => 1 ) in LongAnswerResponse::fetchAllUnscoredAnswers() (line 219 of C:\sites\psp\sites\all\modules\contrib\quiz\question_types\long_answer\long_answer.classes.inc).

Can someone please help me out, because this error is on a live site.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

djdevin’s picture

Maybe a silly question but did you run update.php?

djdevin’s picture

I reproduced this. The long answer grading is broken.

As a workaround, you can still go to the individual user's attempt (in node/X/quiz), and grade the answer there.

martini9011’s picture

I Just did a "clean" install and ran into the same issue. This tells us this issue is not so much caused by updating from 4.0-beta2 to 5.0-alpha10, but that it's an issue within the 5.0-alpha10 version.

djdevin’s picture

Version: 7.x-5.0-alpha10 » 7.x-5.x-dev
martini9011’s picture

This issue occurs from version 7.x-5.0-alpha8. Downgrading to 7.x-5.0-alpha7 seems to resolve the issue for now.

EDIT: Downgrading does not solve the issue, since it's database related. I tested with a clean 7.x-5.0-alpha7 install.

martini9011’s picture

I have updated the SQL statements for the Long answer evaluation and the Short answer evaluation and it seems to be working.

Please confirm if this is working

martini9011’s picture

Status: Active » Needs review
djdevin’s picture

Issue tags: -MySQL, -error, -result_id +Needs tests

Thanks! That works and I committed the change.

Leaving this open to add tests.

  • djdevin committed 838b62b on 7.x-5.x authored by martini9011
    Issue #2542644 by martini9011: SQL Error after upgrade 4.0-beta2 > 5.0-...