From: Simon H. <sim...@us...> - 2010-11-19 18:16:27
|
Update of /cvsroot/stack/stack-dev/lib/ui In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv23798/lib/ui Modified Files: Tag: item_state_separation DisplayItem.php Log Message: Index: DisplayItem.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/DisplayItem.php,v retrieving revision 1.91.2.4.2.4 retrieving revision 1.91.2.4.2.5 diff -C2 -d -r1.91.2.4.2.4 -r1.91.2.4.2.5 *** DisplayItem.php 18 Nov 2010 14:21:15 -0000 1.91.2.4.2.4 --- DisplayItem.php 19 Nov 2010 18:16:19 -0000 1.91.2.4.2.5 *************** *** 82,93 **** * * - * @var string - * @access protected - */ - protected $questionForDisplay; - - /** - * - * * @var StudentAns * @access protected --- 82,85 ---- *************** *** 1681,1693 **** public function getState() { $state = array(); ! } /** ! * Sets the mutable state (probabaly obtained from the cache) for this DisplayItem. * */ public function setState($state) { // options, etc have already been loaded. just need current state. } } --- 1673,1705 ---- public function getState() { $state = array(); ! $state['userId'] = $this->userId; ! $state['feedback'] = $this->feedback = $state['feedback']; ! $state['mark'] = $this->mark; ! $state['cachedQuestionStem'] = $this->cachedQuestionStem; ! $state['cachedQuestionNote'] = $this->cachedQuestionNote; ! $state['attempts'] = $this->attempts; ! $state['studentsLastAns'] = $this->studentsLastAns; ! $state['preCalculated'] = $this->preCalculated; } /** ! * Sets the mutable state (probably obtained from the cache) for this DisplayItem. * */ public function setState($state) { // options, etc have already been loaded. just need current state. + // Still wondering if it would be better to properly encapsulate state in ItemState object... + + // state elements + // attempts + // feedback + $this->userId = $state['userId']; + $this->feedback = $state['feedback']; + $this->mark = $state['mark']; + $this->cachedQuestionStem = $state['cachedQuestionStem']; + $this->cachedQuestionNote = $state['cachedQuestionNote']; + $this->attempts = $state['attempts']; + $this->studentsLastAns = $state['studentsLastAns']; + $this->preCalculated = $state['preCalculated']; } } |