Changeset 52


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

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

Location:
Dev/trunk
Files:
4 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    }
  • Dev/trunk/css/style.css

    r51 r52  
    1212*/
    1313
     14h1 {
     15    width: 100%;
     16    text-align: center;
     17    color: #333;
     18    text-shadow: #fff 0px 0px 10px;
     19    margin: 0 0 0.5em 0;
     20}
     21
     22h2 {
     23    margin: 0;
     24    font-size: larger;
     25    color: #333;
     26}
     27
    1428h3 {
    1529    margin: 0;
     
    1933}
    2034
     35legend {
     36    padding-left: 0em;
     37    color: #888;
     38    text-shadow: #fff 0px 0px 1px;
     39}
     40
     41fieldset {
     42    border: 1px solid #fff;
     43    background-color: #eee;
     44    -moz-border-radius: 15px;
     45    border-radius: 15px;
     46    margin-bottom: 2em;
     47    padding: 0 1em 1em 1em;
     48    -moz-box-shadow: 2px 2px 1px #888;
     49    -webkit-box-shadow: 2px 2px 1px #888;
     50    box-shadow: 2px 2px 1px #888;
     51}
     52
    2153root {
    2254    display: block;
     
    3870#header {
    3971    height: 4em;
    40     background-color: slategrey;
     72    background-color: slategray;
    4173}
    4274
     
    4779    text-align: center;
    4880    line-height: 2em;
    49     text-shadow: 2px 2px 2px black;
     81    text-shadow: #0e2933 0px 0px 5px;
    5082}
    5183
     
    197229    margin-top: 3em;
    198230    border-top: 1px solid #ddd;
     231    text-shadow: #fff 0px 0px 1px;
    199232}
    200233
     
    222255    height: 10em;
    223256}
     257
     258/* ##################################################################
     259   ===================== STYLESHEET OF GLORY ======================== */
     260
     261.topMargin {
     262    margin-top: 2em;
     263}
     264
     265.leftPadding {
     266    padding-left: 2em;
     267}
     268
     269.noPadding {
     270    padding: 0;
     271}
     272
     273.centerBoxed {
     274    margin: 0 auto;
     275    width: 30em;
     276    text-align: center;
     277    padding: 0 1em;
     278    /*    border: 1px solid gray;*/
     279}
     280
     281/* ##################################################################
     282   ===================== STYLESHEET OF GLORY ======================== */
     283
     284.answerBox {
     285    padding-left: 1em;
     286}
     287
     288.textBox {
     289    width: 20em;
     290}
     291
     292.intBox {
     293    width: 5em;
     294}
     295
     296.scaleLabel {
     297    display: inline;
     298    color: #333;
     299}
     300
     301.questionDescription {
     302    font-size: small;
     303}
  • Dev/trunk/survey.php

    r51 r52  
    2222    <head>
    2323        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    24             <title>Facilitator</title>
     24            <title>Survey</title>
    2525            <link rel="stylesheet" type="text/css" href="css/style.css" />
    2626            <script type="text/javascript" src="js/menu.js"></script>
  • Dev/trunk/surveycreation.php

    r51 r52  
    1818    $timeStamp = $_POST['timeStamp'];
    1919
    20     echo 'This is what gets sent:';
    21     var_dump($_POST);
     20//    echo 'This is what gets sent:';
     21//    var_dump($_POST);
    2222//    echo '<br/><br/>';
    2323    $surveyDBI = new SurveyDatabaseInterface($_POST['surveyID']);
     
    2525    $info = $surveyDBI->getSurveyInfo();
    2626//    echo '<br/><br/>';
    27     echo 'This is what I get back:';
    28     var_dump($info);
     27//    echo 'This is what I get back:';
     28//    var_dump($info);
    2929
    3030    $savedSurvey = Survey::getSurvey($info);
Note: See TracChangeset for help on using the changeset viewer.