Changeset 50 for Dev/trunk


Ignore:
Timestamp:
07/25/11 17:45:22 (14 years ago)
Author:
fpvanagthoven
Message:

Saving now gives the link to participant survey.

Location:
Dev/trunk
Files:
1 added
4 edited

Legend:

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

    r49 r50  
    2222        ?>
    2323
    24         <div id="surveyCreation"><form id="survey" action="submitsurvey.php" method="post">
     24        <div id="surveyCreation"><form id="survey" action="surveycreation.php" method="post">
    2525                <?php
    2626                $this->surveyHead();
     
    2828                SurveyCreationTool::addQuestionButton();
    2929                SurveyCreationTool::removeLastQuestionButton();
    30                 SurveyCreationTool::submitButton();
    3130                ?></form></div>
    3231        <?php
     
    338337                form.submit();
    339338            }
    340                                                                                                                                                                                                                                            
    341                                                                                                                                                                                                                                                                                                                                                                                                                            
     339           
     340            function selectAll(input)
     341            {
     342                input.select();
     343            }
     344                                                                                                                                                                                                                                                                                                                                                                                                           
    342345        </script>
    343346        <?php
     
    350353        $this->saveSurvey();
    351354        $this->descriptionBox();
     355        $this->surveyLink();
    352356        ?></div>
    353357        <?php
     
    384388        <textarea id="surveyDescription" name="surveyDescription" onblur="handleBlur(this)" onfocus="handleFocus(this)"><?php echo $value; ?></textarea>
    385389        <?php
     390    }
     391   
     392    private function surveyLink() {
     393        if (isset($this->survey))
     394        {
     395                $surveyID = $this->survey->id;
     396               
     397                $link = $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) .
     398                    '/survey.php?id=' . $surveyID;
     399        ?>
     400        <input type="text" value="<?php echo $link; ?>" id="surveyLink" onclick="selectAll(this)">
     401        <?php
     402        }
    386403    }
    387404
     
    449466    }
    450467
    451     private static function submitbutton() {
    452         ?>
    453         <input type="submit" name="submitSurvey"
    454                value="Submit Survey!" class="surveyButton" id="submitSurvey"/>
    455         <?php
    456     }
    457 
    458468}
    459469?>
  • Dev/trunk/css/style.css

    r48 r50  
    106106#surveyDescription {
    107107    display: block;
    108     width: 35em;
    109     max-width: 35em;
     108    width: 30em;
     109    max-width: 30em;
    110110    font-family: sans-serif;
    111111    color: gray;
     
    130130#surveyDescription:hover {
    131131    color: black;
     132}
     133
     134#surveyLink {
     135    position: absolute;
     136    top: -2em;
     137    right: 0;
     138    font-size: x-small;
     139    color: gray;
     140    width: 30em;
     141    border-color: transparent;
     142    background-color: transparent;
    132143}
    133144
  • Dev/trunk/mainmenu.php

    r47 r50  
    2020}
    2121
    22 /* make an array of survey mock objects */
     22
    2323$surveys = array();
    2424
  • Dev/trunk/surveycreation.php

    r44 r50  
    44$savedSurvey = null;
    55$timeStamp = null;
    6 var_dump($_POST);
     6//var_dump($_POST);
    77
    88/* LOAD SURVEY */
     
    1111    $surveyDBI = new SurveyDatabaseInterface($surveyID);
    1212    $info = $surveyDBI->getSurveyInfo();
    13    
     13
    1414    $savedSurvey = Survey::getSurvey($info);
    1515}
    1616
    17 /* AUTOSAVE */
    18 else if (isset($_POST['timeStamp'])) {
     17/* AUTOSAVE */ else if (isset($_POST['timeStamp'])) {
    1918    $timeStamp = $_POST['timeStamp'];
    2019
    21     echo 'This is what gets sent:';
    22     var_dump($_POST);
    23     echo '<br/><br/>';
     20//    echo 'This is what gets sent:';
     21//    var_dump($_POST);
     22//    echo '<br/><br/>';
    2423    $surveyDBI = new SurveyDatabaseInterface($_POST['surveyID']);
    2524    $surveyDBI->setSurveyInfo($_POST);
    2625    $info = $surveyDBI->getSurveyInfo();
    27     echo '<br/><br/>';
    28     echo 'This is what I get back:';
    29     var_dump($info);
     26//    echo '<br/><br/>';
     27//    echo 'This is what I get back:';
     28//    var_dump($info);
    3029
    3130    $savedSurvey = Survey::getSurvey($info);
     
    4948
    5049            <div id="content">
    51                                 <?php
    52                                 new SurveyCreationTool($savedSurvey, $timeStamp);
    53                                 ?>
     50                <?php
     51                new SurveyCreationTool($savedSurvey, $timeStamp);
     52                ?>
    5453            </div>
    5554        </div>
Note: See TracChangeset for help on using the changeset viewer.