Rev | Line | |
---|
[75] | 1 | <?php |
---|
| 2 | |
---|
| 3 | class ResultType |
---|
| 4 | { |
---|
| 5 | /* possible types */ |
---|
| 6 | const TEXT = 0; // string |
---|
| 7 | const INTEGER = 1; // int |
---|
| 8 | const MULTIPLE_CHOICE = 2; // string |
---|
| 9 | const CHECKBOXES = 3; // array |
---|
| 10 | const SCALE = 4; // int |
---|
| 11 | } |
---|
| 12 | |
---|
| 13 | /** |
---|
| 14 | * 1 Results per Survey |
---|
| 15 | * |
---|
| 16 | * @author Frans |
---|
| 17 | */ |
---|
| 18 | class SurveyResults |
---|
| 19 | { |
---|
| 20 | private $questionResults; |
---|
| 21 | |
---|
| 22 | public function __construct() |
---|
| 23 | { |
---|
| 24 | $this->questionResults = array(); |
---|
| 25 | } |
---|
| 26 | |
---|
| 27 | public function addQuestionResult($result) |
---|
| 28 | { |
---|
| 29 | array_push($this->questionResults, $result); |
---|
| 30 | } |
---|
| 31 | |
---|
| 32 | public function getQuestionResults() |
---|
| 33 | { |
---|
| 34 | return $this->questionResults; |
---|
| 35 | } |
---|
| 36 | |
---|
| 37 | } |
---|
| 38 | |
---|
| 39 | /** |
---|
| 40 | * A Result per question |
---|
| 41 | */ |
---|
| 42 | class QuestionResult |
---|
| 43 | { |
---|
| 44 | private $type; |
---|
[97] | 45 | public $answers; // array |
---|
[75] | 46 | |
---|
| 47 | public function __construct($type, $answers) |
---|
| 48 | { |
---|
| 49 | $this->type = $type; |
---|
| 50 | $this->answers = $answers; |
---|
| 51 | } |
---|
[97] | 52 | |
---|
| 53 | public function getType() |
---|
| 54 | { |
---|
| 55 | return $this->type; |
---|
| 56 | } |
---|
[75] | 57 | } |
---|
| 58 | |
---|
| 59 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.