Index: /Dev/trunk/classes/Question.php
===================================================================
--- /Dev/trunk/classes/Question.php	(revision 34)
+++ /Dev/trunk/classes/Question.php	(revision 35)
@@ -12,4 +12,5 @@
  */
 class Question {
+    public $id;
     public $title;
     public $type;
@@ -17,6 +18,7 @@
     public $answers; // format answers['#']
     
-    public function __construct($title, $type, $description = null)
+    public function __construct($id, $title, $type, $description = null)
     {
+        $this->id = $id;
         $this->title = $title;
         $this->type = $type;
Index: /Dev/trunk/classes/Survey.php
===================================================================
--- /Dev/trunk/classes/Survey.php	(revision 34)
+++ /Dev/trunk/classes/Survey.php	(revision 35)
@@ -36,9 +36,10 @@
         while (isset($info['questionTitle' . $numQ]))
         {
+            $id = $info['questionID' . $numQ];
             $title = $info['questionTitle' . $numQ];
             $type = $info['questionType' . $numQ];
             $description = $info['questionDescription' . $numQ];
                     
-            $question = new Question($title, $type, $description);
+            $question = new Question($id, $title, $type, $description);
 
             $numA = 1; //number answers
Index: /Dev/trunk/classes/SurveyCreationTool.php
===================================================================
--- /Dev/trunk/classes/SurveyCreationTool.php	(revision 34)
+++ /Dev/trunk/classes/SurveyCreationTool.php	(revision 35)
@@ -38,17 +38,17 @@
             /* autosave every 3 minutes */
             setTimeout("save('<?php echo $id; ?>')", 180000);
-                                                                                                                                                    
+                                                                                                                                                            
             var questionCount = 1;          
-                                                                                                                                                                                                                                                                                            
+                                                                                                                                                                                                                                                                                                    
             function getNewQuestion(title, description)
             {
                 if (title == null)
                     var title = 'Untitled Question';
-                                                                                        
+                                                                                                
                 if (description != null)
                     var description = description;
                 else
                     var description = 'Write a question description here.';
-                                                                                                            
+                                                                                                                    
                 var questionDiv = document.createElement("div");
                 var htmlStr = 
@@ -71,10 +71,10 @@
                     "<div id='answersDiv" + questionCount + "' class='answersDiv'></div>" +
                     "</div>";
-                                                                                                                                                                                                                                                                                        
+                                                                                                                                                                                                                                                                                                
                 questionDiv.innerHTML = htmlStr;
-                                                                                                                                                                                                                                                                                        
+                                                                                                                                                                                                                                                                                                
                 return questionDiv;
             }
-                                                                                                                                                                                                                                                                                            
+                                                                                                                                                                                                                                                                                                    
             function handleFocus(input)
             {
@@ -82,7 +82,7 @@
                 if (input.clicked == null && 
                     (input.value == "Untitled Survey"
-                        || input.value == "Write a helpful description for this survey here."
-                        || input.value == "Write a question description here."
-                        || input.value == "Untitled Question"))
+                    || input.value == "Write a helpful description for this survey here."
+                    || input.value == "Write a question description here."
+                    || input.value == "Untitled Question"))
                 {
                     input.value = "";
@@ -91,15 +91,15 @@
                 }
             }
-                                                                                                                                                                                                                                                                                                                            
+                                                                                                                                                                                                                                                                                                                                    
             function handleBlur(input)
             {        
                 var surveyTitle = document.getElementById('surveyTitle');
                 var surveyDescription = document.getElementById('surveyDescription');
-                                                                                                                                                                                                                                                                                                            
+                                                                                                                                                                                                                                                                                                                    
                 if (input.value == "")
                 {
                     input.style.color = "gray";
                     input.clicked = null;
-                                                                                                                                                                                                                                                                                                                                    
+                                                                                                                                                                                                                                                                                                                                            
                     if (input == surveyTitle)
                     {
@@ -112,5 +112,5 @@
                 }                           
             }
-                                                                                                                                                                                                                                                                            
+                                                                                                                                                                                                                                                                                    
             function handleType(select, answers)
             {
@@ -120,5 +120,5 @@
                 answersDiv.answerCount = 1;
                 answersDiv.clicked = null;
-                                                                                                                                                                                                                                
+                                                                                                                                                                                                                                        
                 switch (type) {
                     case 'mc':
@@ -133,5 +133,5 @@
                         else
                             addOption(numQ);
-                                                                                                                                                                                                                                                                
+                                                                                                                                                                                                                                                                        
                         break;
                     case 'text':
@@ -140,5 +140,5 @@
                     case 'int':    
                         answersDiv.innerHTML = "";
-                                                                                        
+                                                                                                
                         //min max
                         if (answers != null)
@@ -172,6 +172,6 @@
 
             }
+                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                             
-                                                                                                                                                                                                                                                    
             function addOption(questionNumber, optionStr)
             {        
@@ -179,14 +179,14 @@
                 var answerCount = answersDiv.answerCount;
                 var answerDiv = document.createElement("div");
-                        
+                                
                 if (optionStr == null)
                     var optionStr = "Option " + answerCount;
-                        
-                       
+                                
+                               
                 answerDiv.className = "answerDiv";
-                                                                                                                                                                                                                                                        
+                                                                                                                                                                                                                                                                
                 var htmlStr = "<input type='text' name='q" + 
                     questionNumber + "ans" + answerCount + "' value='" + optionStr + "' />";
-                                                                                                                                                                                                                                
+                                                                                                                                                                                                                                        
                 if (answersDiv.clicked == null)
                 {
@@ -194,21 +194,21 @@
                         + " class='surveyButton' onclick='addOption(" + questionNumber + ")' value='Add Option' />" +
                         "<input type='button' class='surveyButton' onclick='removeOption(" + questionNumber + ")' value='x' />";
-                                                                                                                                                                                                    
+                                                                                                                                                                                                            
                     answersDiv.clicked = true;
                 }
-                                                                                                                                                                                                                                                               
+                                                                                                                                                                                                                                                                       
                 answerDiv.innerHTML = htmlStr;
-                                                                                                                                                                                                
+                                                                                                                                                                                                        
                 answerDiv.prev = answersDiv.lastAnswer; //singly linked list
                 answersDiv.lastAnswer = answerDiv;
-                                                                                                                                                                                                                                                               
+                                                                                                                                                                                                                                                                       
                 answersDiv.appendChild(answerDiv);
                 answersDiv.answerCount++;
             }
-                                                                                                                                                                                            
+                                                                                                                                                                                                    
             function removeOption(questionNumber)
             {
                 var answersDiv = document.getElementById("answersDiv" + questionNumber);
-                                                                                                                                                                                               
+                                                                                                                                                                                                       
                 if (answersDiv.lastAnswer.prev != null)
                 {
@@ -218,5 +218,5 @@
                 }
             }
-                                                                                                                                                                                                                    
+                                                                                                                                                                                                                            
             function minMax(questionNumber, min, max)
             {
@@ -225,16 +225,16 @@
                 if (max == null)
                     var max = '';
-                                                                                
+                                                                                        
                 var answersDiv = document.getElementById("answersDiv" + questionNumber);
-                                                                                                                                                                                                                       
+                                                                                                                                                                                                                               
                 var answerDiv = document.createElement("div");
-                                                                                                                                                                                        
+                                                                                                                                                                                                
                 answerDiv.className = "answerDiv";
                 answerDiv.innerHTML = "<label for='min'>Min</label><input type='text' value='" + min + "' name='q" + questionNumber + "ans1' />" +
                     "<label for='max'>Max</label><input type='text' value='" + max + "' name='q" + questionNumber + "ans2' />";
-                                                                                                                                                                                                                   
+                                                                                                                                                                                                                           
                 answersDiv.appendChild(answerDiv);
             }  
-                                                                                                                                                                                                                    
+                                                                                                                                                                                                                            
             function minMaxIncr(questionNumber, left, right, incr)
             {
@@ -245,7 +245,7 @@
                 if (incr == null)
                     var incr = '';
-                                
+                                        
                 var answersDiv = document.getElementById("answersDiv" + questionNumber);
-                                                                                                                                                                                                                       
+                                                                                                                                                                                                                               
                 var answerDiv = document.createElement("div");
                 answerDiv.className = "answerDiv";
@@ -254,14 +254,14 @@
                     "<label>Scale count</label><input type='text' value='" + incr + "' name='q" + questionNumber + "ans3' />" +
                     "<div id='inputCheckFeedback'" + questionNumber + "";
-                                                                                                                                                                                                                   
+                                                                                                                                                                                                                           
                 answersDiv.appendChild(answerDiv);
             }         
-                                                                                                                                                                                                                                                                         
                                                                                                                                                                                                                                                                                  
+                                                                                                                                                                                                                                                                                         
             function addQuestion(title, description)
             {
                 var questionsDiv = document.getElementById('questionsDiv');
                 var newQuestion = getNewQuestion(title, description);
-                                                                                                                                                                                                                
+                                                                                                                                                                                                                        
 
                 newQuestion.prev = document.lastQuestion;
@@ -271,9 +271,9 @@
                 questionCount++;
             }
-                                                                                                                                                                                                            
+                                                                                                                                                                                                                    
             function removeLastQuestion()
             {
                 var questionsDiv = document.getElementById('questionsDiv');
-                                                                                                                                                                                                                
+                                                                                                                                                                                                                        
                 if (document.lastQuestion.prev != null)
                 {
@@ -287,5 +287,5 @@
                 }               
             }
-                                                                                                                                                                                     
+                                                                                                                                                                                             
             function save(surveyID)
             {
@@ -293,5 +293,5 @@
                 var questionsDiv = document.getElementById('questionsDiv');
                 form.action = "surveycreation.php";
-                                                                                                                                                        
+                                                                                                                                                                
                 /* extra time stamp */
                 var date = new Date();
@@ -304,16 +304,16 @@
                 timeStampInput.value = timeStamp;
                 timeStampInput.type = "hidden";
-                                                                                                            
+                                                                                                                    
                 var surveyIDInput = document.createElement("input");
                 surveyIDInput.name = "surveyID";
                 surveyIDInput.value = surveyID;
                 surveyIDInput.type = "hidden";
-                                                                                                                                     
+                                                                                                                                             
                 questionsDiv.appendChild(timeStampInput);
                 questionsDiv.appendChild(surveyIDInput);
                 form.submit();
             }
-                                                                                                                                                                                                                    
-                                                                                                                                                                                                                                                                                                                                                                                                    
+                                                                                                                                                                                                                            
+                                                                                                                                                                                                                                                                                                                                                                                                            
         </script>
         <?php
@@ -371,4 +371,12 @@
                 ?>
                 <script type="text/javascript"> 
+                    var questionIDInput = document.createElement("input");
+                    questionIDInput.name = "questionID<?php echo $numQ; ?>";
+                    questionIDInput.value = "<?php echo $question->id; ?>";
+                    questionIDInput.type = "hidden";
+                                                                                                                                                     
+                    document.getElementById("questionsDiv").appendChild(questionIDInput);
+                                 
+                                                            
                     var answers = new Array();
                 <?php
@@ -378,7 +386,7 @@
                 }
                 ?>
-                                                    
+                                                                    
                     addQuestion('<?php echo $question->title; ?>', '<?php echo $question->description; ?>');
-                                                                                                                                                    
+                                                                                                                                                                    
                     var select = document.getElementById('<?php echo $numQ; ?>');
                     var type = '<?php echo $question->type; ?>';
Index: /Dev/trunk/surveycreation.php
===================================================================
--- /Dev/trunk/surveycreation.php	(revision 34)
+++ /Dev/trunk/surveycreation.php	(revision 35)
@@ -8,4 +8,5 @@
     $timeStamp = $_POST['timeStamp'];
 	
+//        echo 'This is what gets sent:';
 //	var_dump($_POST);
 //	echo '<br/><br/>';
@@ -14,4 +15,5 @@
 	$info = $surveyDBI->getSurveyInfo();
 //	echo '<br/><br/>';
+//        echo 'This is what I get back:';
 //	var_dump($info);
         
