Changeset 186 for Dev/trunk/classes/Survey.php
- Timestamp:
- 12/16/11 11:19:54 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/classes/Survey.php
r149 r186 22 22 $this->creator = $creator; 23 23 $this->questions = $questions; 24 } 24 } 25 26 /** 27 * function evaluate() 28 * Evaluates the references 29 */ 30 public function evaluate() 31 { 32 $dbi = new DatabaseInterface(); 33 if(is_string($this->creator)) 34 { 35 $result = $dbi->get("user", array("uid" => $this->creator)); 36 if(!isset($result[0])) 37 return false; 38 $this->creator = $result[0]; 39 } 40 41 if(!empty($this->questions) && is_string($this->questions[0])) 42 { 43 $newQuestions = array(); 44 foreach($this->questions as $question) 45 { 46 $result = $dbi->get("question", array("uid" => $question)); 47 if(!isset($result[0])) 48 return false; 49 $newQuestions[] = $result[0]; 50 } 51 $this->questions = newQuestions; 52 } 53 return true; 54 } 25 55 } 26 56
Note: See TracChangeset
for help on using the changeset viewer.