Index: Dev/trunk/classes/QuestionCreationTool.php
===================================================================
--- Dev/trunk/classes/QuestionCreationTool.php	(revision 103)
+++ Dev/trunk/classes/QuestionCreationTool.php	(revision 104)
@@ -24,8 +24,8 @@
                 var type = select.valueOf().value;
                 clearSpecifications();
-                                                        
+                                                                        
                 /* set answerCount for options */
                 document.getElementById("answerSpecifications").answerCount = 1;
-                                                        
+                                                                        
                 switch (type) {
                     case "text":
@@ -44,10 +44,10 @@
                         break;
                     default:
-                                                                
-                        break;
-                }
-
-            }
-                                                    
+                                                                                
+                        break;
+                }
+
+            }
+                                                                    
             function clearSpecifications()
             {
@@ -56,5 +56,5 @@
                 specs.clicked = null;
                 specs.lastAnswer = null;
-                                        
+                                                        
                 var questionType = document.getElementById("questionType");
                 var buttons = document.getElementById("questionButtons");
@@ -62,18 +62,18 @@
                     questionType.removeChild(buttons);
             }
-                                                    
+                                                                    
             function addOption()
             {                       
                 var specs = document.getElementById("answerSpecifications");
-                                                        
+                                                                        
                 addAddRemoveOptionButtonsOnce(specs);
                 addAnswerInput(specs);
-                                                        
-            }
-                                                    
+                                                                        
+            }
+                                                                    
             function removeOption()
             {
                 var specs = document.getElementById("answerSpecifications");
-                                                        
+                                                                        
                 if(specs.lastAnswer.prev != null)
                 {
@@ -83,12 +83,12 @@
                 }
             }
-                                                    
+                                                                    
             function addAnswerInput(specs)
             {
                 var answerCount = specs.answerCount;
-                                                        
+                                                                        
                 /* set value for option textbox */
                 var optionStr = "Option " + answerCount;
-                                                        
+                                                                        
                 /* the input textbox */
                 var answerInput = document.createElement("input");
@@ -97,14 +97,14 @@
                 answerInput.setAttribute("value", optionStr);
                 answerInput.className = "answerInput";
-                                                        
+                                                                        
                 specs.appendChild(answerInput);
-                                                        
+                                                                        
                 /* Singly linked list */
                 answerInput.prev = specs.lastAnswer; // remember last one
                 specs.lastAnswer = answerInput; // new lastAnswer
-                                                        
+                                                                        
                 specs.answerCount++;               
             }
-                                                    
+                                                                    
             function addAddRemoveOptionButtonsOnce(specs)
             {
@@ -116,12 +116,12 @@
                     var typeBox = document.getElementById("questionType");
                     typeBox.appendChild(buttonsDiv);
-                                            
+                                                            
                     addAddOptionButton(buttonsDiv);                                  
                     addRemoveOptionButton(buttonsDiv);
-                                                            
+                                                                            
                     specs.clicked = true;
                 }
             }
-                                                    
+                                                                    
             function addAddOptionButton(buttonsDiv)
             {    
@@ -134,5 +134,5 @@
                 buttonsDiv.appendChild(addOpt);                                  
             }
-                                                    
+                                                                    
             function addRemoveOptionButton(buttonsDiv)
             {
@@ -144,5 +144,5 @@
                 buttonsDiv.appendChild(removeOpt);
             }
-                                                   
+                                                                   
             function minMax(min, max)
             {
@@ -151,16 +151,16 @@
                 if (max == null)
                     var max = '';
-                                                                                                                                                                                                                                                                                
-                var specs = document.getElementById("answerSpecifications");
-                                                                                                                                                                                                                                                                                                                                                                                                                       
+                                                                                                                                                                                                                                                                                                
+                var specs = document.getElementById("answerSpecifications");
+                                                                                                                                                                                                                                                                                                                                                                                                                                       
                 var answerDiv = document.createElement("div");
-                                                                                                                                                                                                                                                                                                                                                                                        
+                                                                                                                                                                                                                                                                                                                                                                                                        
                 answerDiv.className = "answerDiv";
                 answerDiv.innerHTML = "<label for='min'>Min</label><input type='text' class='intBox' onchange='checkInt(this)' value='" + min + "' name='ans1' />" +
                     "<label for='max'>Max</label><input type='text' class='intBox' onchange='checkInt(this)' value='" + max + "' name='ans2' />";
-                                                                                                                                                                                                                                                                                                                                                                                                                   
+                                                                                                                                                                                                                                                                                                                                                                                                                                   
                 specs.appendChild(answerDiv);
             }      
-                            
+                                            
             function checkInt(input)
             {
@@ -178,5 +178,5 @@
                 }
             }
-            
+                            
             function minMaxIncr(left, right, incr)
             {
@@ -191,10 +191,10 @@
                 if (incr == null)
                     var incr = '';
-                                                                                                                                                                                                        
-                var specs = document.getElementById("answerSpecifications");
-                                                                                                                                                                                                                                                                                                                                                                                               
+                                                                                                                                                                                                                        
+                var specs = document.getElementById("answerSpecifications");
+                                                                                                                                                                                                                                                                                                                                                                                                               
                 var answerDiv = document.createElement("div");
                 answerDiv.className = "answerDiv";
-                                                                                                                               
+                                                                                                                                               
                 var leftLabel = document.createElement("label");
                 var rightLabel = document.createElement("label");
@@ -203,5 +203,5 @@
                 rightLabel.innerHTML = "Right label";
                 scaleLabel.innerHTML = "Scale count";
-                                                                                                                                
+                                                                                                                                                
                 var leftInput = document.createElement("input");
                 leftInput.type = "text";
@@ -209,5 +209,5 @@
                 leftInput.name= "ans1";
                 leftInput.setAttribute("onchange", "handleAnswerChange()");
-                                                                                                                                
+                                                                                                                                                
                 var rightInput = document.createElement("input");
                 rightInput.type = "text";
@@ -215,5 +215,5 @@
                 rightInput.name = "ans2";
                 rightInput.setAttribute("onchange", "handleAnswerChange()");
-                                                                                                                                
+                                                                                                                                                
                 var scaleInput = document.createElement("input");
                 scaleInput.type = "text";
@@ -223,5 +223,5 @@
                 scaleInput.setAttribute("onchange", "");
                 scaleInput.name = "ans3";
-                                                                                                                                
+                                                                                                                                                
                 answerDiv.appendChild(leftLabel);
                 answerDiv.appendChild(leftInput);
@@ -230,8 +230,8 @@
                 answerDiv.appendChild(scaleLabel);
                 answerDiv.appendChild(scaleInput);
-                                                                                                                                                                                                                                                                                                                                                                           
+                                                                                                                                                                                                                                                                                                                                                                                           
                 specs.appendChild(answerDiv);
             }         
-                                                    
+                                                                    
         </script>
         <?php
@@ -249,35 +249,42 @@
     private function displayEditPanel() {
         ?>
-        <div id="creation">
-            <form id="questionEditForm" action="">
-                <table class="questionTable">
-                    <tr>
-                        <td><label for="questionCode">Code</label></td>
-                        <td><input id="questionCode" name="questionCode" size="5" /></td>
-                    </tr>
-                    <tr>
-                        <td><label for="questionTitle">Title</label></td>
-                        <td><input id="questionTitle" name="questionTitle" size="30" /></td>
-                    </tr>
-                    <tr>
-                        <td><label for="questionDescription">Description</label></td>
-                        <td><input id="questionDescription" name="questionDescription" size="60" /></td>
-                    </tr>
-                    <tr>
-                        <td><label for="questionType">Type answer</label></td>
-                        <td id="questionType">
-                            <select name="questionType" onchange="handleType(this)">
-                                <option value='text' selected='selected'>Text</option>
-                                <option value='int'>Integer</option>
-                                <option value='mc'>Multiple choice</option>
-                                <option value='checkboxes'>Checkboxes</option>
-                                <option value='scale'>Scale</option>
-                            </select>
-                        </td>
-                    </tr>
-                </table>
-                <div id="answerSpecifications"></div>
-            </form>
+        <div id="questionCreation" class="floatLeft">
+            <?php $this->displayForm(); ?>
         </div>
+        <?php
+    }
+
+    private function displayForm() {
+        ?>
+        <form id="questionEditForm" method="post" action="" onsubmit="">
+            <table class="questionTable">
+                <tr>
+                    <td><label for="questionCode">Code</label></td>
+                    <td><input id="questionCode" name="questionCode" size="5" /></td>
+                </tr>
+                <tr>
+                    <td><label for="questionTitle">Title</label></td>
+                    <td><input id="questionTitle" name="questionTitle" size="30" /></td>
+                </tr>
+                <tr>
+                    <td><label for="questionDescription">Description</label></td>
+                    <td><input id="questionDescription" name="questionDescription" size="60" /></td>
+                </tr>
+                <tr>
+                    <td><label for="questionType">Type answer</label></td>
+                    <td id="questionType">
+                        <select name="questionType" onchange="handleType(this)">
+                            <option value='text' selected='selected'>Text</option>
+                            <option value='int'>Integer</option>
+                            <option value='mc'>Multiple choice</option>
+                            <option value='checkboxes'>Checkboxes</option>
+                            <option value='scale'>Scale</option>
+                        </select>
+                    </td>
+                </tr>
+            </table>
+            <div id="answerSpecifications"></div>
+            <input id="saveQuestion" type="submit" class="surveyButton" value="Save" />
+        </form>
         <?php
     }
