--- C:/Users/Pratt/workspace/ou-moodle-31/mod/quiz/report/responses/Copy of responses_table.php Mon Sep 15 18:30:05 2008 +++ C:/Users/Pratt/workspace/ou-moodle-31/mod/quiz/report/responses/responses_table.php Mon Sep 15 19:41:59 2008 @@ -187,6 +187,7 @@ } function query_db($pagesize, $useinitialsbar=true){ + global $CFG; // Add table joins so we can sort by question answer // unfortunately can't join all tables necessary to fetch all answers // to get the state for one question per attempt row we must join two tables @@ -202,8 +203,8 @@ if (preg_match('/^qsanswer([0-9]+)/', $sortpart, $matches)){ $qid = intval($matches[1]); $this->sql->fields .= ", qs$qid.grade AS qsgrade$qid, qs$qid.answer AS qsanswer$qid, qs$qid.event AS qsevent$qid, qs$qid.id AS qsid$qid"; - $this->sql->from .= "LEFT JOIN {question_sessions} qns$qid ON qns$qid.attemptid = qa.uniqueid AND qns$qid.questionid = $qid "; - $this->sql->from .= "LEFT JOIN {question_states} qs$qid ON qs$qid.id = qns$qid.newgraded "; + $this->sql->from .= "LEFT JOIN {$CFG->prefix}question_sessions qns$qid ON qns$qid.attemptid = qa.uniqueid AND qns$qid.questionid = $qid "; + $this->sql->from .= "LEFT JOIN {$CFG->prefix}question_states qs$qid ON qs$qid.id = qns$qid.newgraded "; } } }