Ignore:
Timestamp:
07/26/11 13:44:23 (14 years ago)
Author:
fpvanagthoven
Message:

survey.php all types implemented. Should do input checking also.

File:
1 edited

Legend:

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

    r51 r52  
    3737    private function displayDescription() {
    3838        ?>
    39         <p><?php echo $this->survey->description; ?></p>
     39        <p class='centerBoxed'><?php echo $this->survey->description; ?></p>
    4040        <?php
    4141    }
     
    4949
    5050    private function displayQuestion($question, $numQ) {
     51        echo "<fieldset>";
    5152        $this->displayQuestionTitle($question);
    5253        $this->displayQuestionDescription($question);
    5354        $this->displayAnswerBox($question, $numQ);
     55        echo "</fieldset>";
    5456    }
    5557
    5658    private function displayQuestionTitle($question) {
    5759        ?>
    58         <h2><?php echo $question->title; ?></h2>
     60        <?php echo "<legend><h2>" . $question->title . "</h2></legend>"; ?>
    5961        <?php
    6062    }
     
    6264    private function displayQuestionDescription($question) {
    6365        ?>
    64         <p><?php echo $question->description; ?></p>
     66        <p><?php echo "<div class='questionDescription noPadding'>" . $question->description . "</div>"; ?></p>
    6567        <?php
    6668    }
    6769
    6870    private function displayAnswerBox($question, $numQ) {
     71        echo "<div class='answerBox'>";
    6972        switch ($question->type) {
    7073            case 'text':
    71 
    72 
     74                ?>
     75                <input type="text" name="<?php echo 'q' . $numQ . 'ans1' ?>" value="" class="textBox"/>
     76                <?php
    7377                break;
    7478            case 'int':
    75 
    76 
     79                ?>
     80                <input type="text" name="<?php echo 'q' . $numQ . 'ans1' ?>" value="" class="intBox"/>
     81                <?php
    7782                break;
    7883            case 'mc':
     
    9297                break;
    9398            case 'scale':
    94 
    95 
     99                ?>
     100                <div class="scaleLabel"><?php echo $question->answers[1]; ?></div>
     101                <?php
     102                for ($i = 1; $i < $question->answers[3] + 1; $i++) {
     103                    ?><input type="radio" class="scaleRadio" name="<?php echo 'q' . $numQ . 'ans1' ?>" value="<?php echo $i;?>"/><?php } ?>
     104                <div class="scaleLabel"><?php echo $question->answers[2]; ?></div>
     105                <?php
    96106                break;
    97107            default:
    98108                break;
    99109        }
     110        echo "</div>";
    100111    }
    101112
    102113    private function submitSurvey() {
    103114        ?>
    104         <input type="submit" value="Submit survey!" />
     115        <input type="submit" value="Submit survey!" class="topMargin surveyButton bigSurveyButton"/>
    105116        <?php
    106117    }
Note: See TracChangeset for help on using the changeset viewer.