From: Simon H. <sim...@us...> - 2010-09-07 13:40:15
|
Update of /cvsroot/stack/stack-dev/lib/database In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv20768/lib/database Modified Files: Tag: STACK2_2 MoodleDB.php Log Message: Diagnostic reporting patch. Index: MoodleDB.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/database/MoodleDB.php,v retrieving revision 1.14.10.5 retrieving revision 1.14.10.6 diff -C2 -d -r1.14.10.5 -r1.14.10.6 *** MoodleDB.php 24 Aug 2010 17:23:39 -0000 1.14.10.5 --- MoodleDB.php 7 Sep 2010 13:40:07 -0000 1.14.10.6 *************** *** 674,678 **** } ! /** * Return all the responses from the student for the given attempt, in order, as well as (Moodle) question id * @access public --- 674,678 ---- } ! /** * Return all the responses from the student for the given attempt, in order, as well as (Moodle) question id * @access public *************** *** 680,684 **** * @return array $responses */ ! public function getAttemptResponses($attempt) { global $config; $prefix = $config->getMoodle('prefix'); --- 680,684 ---- * @return array $responses */ ! public function getQuestionAttemptResponses($attempt) { global $config; $prefix = $config->getMoodle('prefix'); *************** *** 691,706 **** $result = $this->query($sql); ! $responses = NULL; if($result) { for($i = 0; $i < $this->noRows(); $i++) { ! $responses[$this->result($i, 'seq_number')]['answer'] = $this->result($i, 'answer'); ! $responses[$this->result($i, 'seq_number')]['event'] = $this->result($i, 'event'); } - $return['question'] = $this->result(0, 'question'); - $return['version'] = substr($this->result(0, 'remoteid'), 1); // strip off 'q' - $return['responses'] = $responses; } return $return; ! } } --- 691,706 ---- $result = $this->query($sql); ! // $responses = NULL; if($result) { for($i = 0; $i < $this->noRows(); $i++) { ! $q = $this->result($i, 'question'); ! $s = $this->result($i, 'seq_number'); ! $return[$q]['version'] = substr($this->result($i, 'remoteid'), 1); // strip off 'q' ! $return[$q][$s]['answer'] = $this->result($i, 'answer'); ! $return[$q][$s]['event'] = $this->result($i, 'event'); } } return $return; ! } } |