Changeset 95 for Dev/trunk/classes


Ignore:
Timestamp:
08/31/11 15:35:10 (14 years ago)
Author:
fpvanagthoven
Message:

Done: Default question description -> do not display in SurveyTool?. Added bug to TODO list

Location:
Dev/trunk/classes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/classes/Survey.php

    r75 r95  
    11<?php
     2
    23/*
    34 * To change this template, choose Tools | Templates
     
    1617    public $description;
    1718    public $questions;
    18        
    19         public $results;
     19    public $results;
     20   
     21    const DEFAULT_DESCRIPTION = "Write a helpful description for this survey here.";
    2022
    2123    public function __construct($id, $title, $description = null) {
     
    2426        $this->description = $description;
    2527        $this->questions = array();
    26                
    27                 $this->results = null;
     28
     29        $this->results = null;
    2830    }
    29        
    30         public function addQuestion($question)
    31         {
    32                 array_push($this->questions, $question);
    33         }
    34        
    35         public function setResults($surveyResults)
    36         {
    37                 $this->results = $surveyResults;
    38         }
     31
     32    public function addQuestion($question) {
     33        array_push($this->questions, $question);
     34    }
     35
     36    public function setResults($surveyResults) {
     37        $this->results = $surveyResults;
     38    }
    3939
    4040    public static function getSurvey($info) {
     
    7070        return $survey;
    7171    }
    72        
    73         /**
    74          * TODO: Should return Results-object from reading RDF-database
    75          * @param type $surveyID
    76          */
    77         public static function getResults($surveyID)
    78         {
    79                
    80         }
     72
     73    /**
     74     * TODO: Should return Results-object from reading RDF-database
     75     * @param type $surveyID
     76     */
     77    public static function getResults($surveyID) {
     78       
     79    }
    8180
    8281}
     82
    8383?>
  • Dev/trunk/classes/SurveyTool.php

    r59 r95  
    7070
    7171    private function displayDescription() {
     72        if ($this->survey->description != Survey::DEFAULT_DESCRIPTION)
     73            $description = $this->survey->description;
     74        else
     75            $description = "";
    7276        ?>
    73         <p class='centerBoxed'><?php echo $this->survey->description; ?></p>
     77        <p class='centerBoxed'><?php echo $description; ?></p>
    7478        <?php
    7579    }
     
    97101
    98102    private function displayQuestionDescription($question) {
     103        if ($question->description != "Write a question description here.")
     104            $description = $question->description;
     105        else
     106            $description = "";
    99107        ?>
    100         <p><?php echo "<div class='questionDescription noPadding'>" . $question->description . "</div>"; ?></p>
     108        <p><?php echo "<div class='questionDescription noPadding'>" . $description . "</div>"; ?></p>
    101109        <?php
    102110    }
Note: See TracChangeset for help on using the changeset viewer.