- Timestamp:
- 09/01/11 14:24:04 (14 years ago)
- Location:
- Dev/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/classes/DashboardTool.php
r96 r97 6 6 * @author Frans 7 7 */ 8 class DashboardTool 9 { 10 private $surveys; 11 private $gamedata; 8 class DashboardTool { 12 9 13 public function __construct($surveys, $gamedata = null) 14 { 15 $this->surveys = $surveys; 16 $this->gamedata = $gamedata; 10 private $surveys; 11 private $gamedata; 17 12 18 $this->init(); 19 } 13 public function __construct($surveys, $gamedata = null) { 14 $this->surveys = $surveys; 15 $this->gamedata = $gamedata; 20 16 21 private function init() 22 { 23 foreach ($this->surveys as $survey) 24 { 25 $surveyResults = $survey->results; 26 $questionResults = $surveyResults->getQuestionResults(); 27 ?> 28 <div class="resultsDiv borderRadius padding1em"> 29 <?php 30 foreach ($questionResults as $questionResult) 31 { 32 $this->visualizeResult($questionResult); 33 } 34 ?> 35 </div> 36 <?php 37 } 38 } 17 $this->init(); 18 } 39 19 40 private function visualizeResult($questionResult) 41 { 42 ?><div class="resultDiv"><?php 43 $this->displayQuestion($questionResult); 44 $this->displayVisualization($questionResult); 45 $this->displayChangeVisualizationBar(); 46 ?></div><?php 47 } 48 49 private function displayQuestion($questionResult) 50 { 51 echo "allo?"; 52 } 53 54 private function displayVisualization($questionResult) 55 { 56 57 } 58 59 private function displayChangeVisualizationBar() 60 { 61 62 } 20 private function init() { 21 $this->visualizeSurvey(); 22 } 23 24 private function visualizeSurvey() { 25 foreach ($this->surveys as $survey) { 26 $surveyResults = $survey->results; 27 28 /* iterate at the same time through these arrays */ 29 $questions = $survey->questions; 30 $questionResults = $surveyResults->getQuestionResults(); 31 ?> 32 <div class="resultsDiv borderRadius padding1em"> 33 <?php 34 $i = 0; 35 while (isset($questions[$i])) { 36 ?><div class="resultDiv"><?php 37 $this->displayQuestion($questions[$i]); 38 $this->visualizeResult($questionResults[$i]); 39 ?></div><?php 40 41 $i++; 42 } 43 ?> 44 </div> 45 <?php 46 } 47 } 48 49 private function visualizeResult($questionResult) { 50 51 $this->displayVisualization($questionResult); 52 $this->displayChangeVisualizationBar(); 53 54 } 55 56 private function displayQuestion($question) { 57 echo $question->title; 58 echo "<br />"; 59 echo $question->description; 60 } 61 62 private function displayVisualization($questionResult) { 63 $type = $questionResult->getType(); 64 65 switch ($type) { 66 case 0: 67 $value = "TEXT"; 68 69 break; 70 case 1: 71 $value = "INTEGER"; 72 break; 73 case 2: 74 $value = "MULT. CHOICE"; 75 break; 76 case 3: 77 $value = "CHECKBOXES"; 78 break; 79 case 4: 80 $value = "SCALE"; 81 break; 82 default: 83 break; 84 } 85 echo $value; 86 87 foreach($questionResult->answers as $answer) 88 { 89 echo "<br />" . $answer; 90 } 91 } 92 93 private function displayChangeVisualizationBar() { 94 95 } 96 63 97 } 64 ?>98 ?> -
Dev/trunk/classes/SurveyResults.php
r75 r97 43 43 { 44 44 private $type; 45 p rivate$answers; // array45 public $answers; // array 46 46 47 47 public function __construct($type, $answers) … … 50 50 $this->answers = $answers; 51 51 } 52 53 public function getType() 54 { 55 return $this->type; 56 } 52 57 } 53 58 -
Dev/trunk/css/awesome.css
r92 r97 84 84 #wrapper { 85 85 width: 80%; 86 min-width: 570px;86 min-width: 800px; 87 87 margin: auto; 88 88 } -
Dev/trunk/doc/TODO
r96 r97 29 29 30 30 BUGS - Hoge prioriteit 31 Question title en description worden niet geupdate32 31 Application description wordt niet geupdate 33 32
Note: See TracChangeset
for help on using the changeset viewer.