Index: Dev/trunk/classes/Loader.php
===================================================================
--- Dev/trunk/classes/Loader.php	(revision 111)
+++ Dev/trunk/classes/Loader.php	(revision 112)
@@ -8,4 +8,16 @@
 class Loader {
 
+    public static function load($info, $classname) {
+        $theArray = array();
+        
+        foreach ($info as $id => $title)
+        {
+            $object = new $classname($id, $title);
+            array_push($theArray, $object);
+        }
+        
+        return $theArray;
+    }
+
     /**
      *
@@ -13,45 +25,42 @@
      */
     public static function loadSurveys() {
-        $surveys = array();
-
+    
         $surveyDBI = new SurveyCreationDatabaseInterface(null);
         $surveyIDTitles = $surveyDBI->getExistingSurveys();
 
-        foreach ($surveyIDTitles as $id => $title) {
-            $survey = new Survey($id, $title);
-            array_push($surveys, $survey);
-        }
-        
-        return $surveys;
+        return Loader::load($surveyIDTitles, "Survey");
+    }
+
+    public static function loadApplications() {
+        $applicationDBI = new ApplicationDatabaseInterface(null);
+        $applicationTitles = $applicationDBI->getExistingApplications();
+
+        return Loader::load($applicationTitles, "Application");
+    }
+
+    public static function loadSessions() {
+        $sessionDBI = new SessionCreationDatabaseInterface(null);
+        $sessionTitles = $sessionDBI->getExistingSessions();
+
+        return Loader::load($sessionTitles, "Session");
+    }
+
+    public static function loadQuestions() {
+        $questionDBI = new QuestionCreationDatabaseInterface();
+        $questionCodesAndTitles = $questionDBI->getExistingQuestions();
+
+        return Loader::load($questionCodesAndTitles, "Question");
     }
     
-    public static function loadApplications()
-    {
-        $applications = array();
+    public static function loadFullQuestions() {
+        $questionDBI = new QuestionCreationDatabaseInterface();
+        $questionCodesAndTitles = $questionDBI->getExistingQuestions();
         
-        $applicationDBI = new ApplicationDatabaseInterface(null);
-        $applicationTitles = $applicationDBI->getExistingApplications();
+        $questions = array();
         
-        foreach ($applicationTitles as $id => $title) {
-            $application = new Application($id, $title);
-            array_push($applications, $application);
+        foreach ($questionCodesAndTitles as $code => $title) {
+            $info = $questionDBI->getQuestionInfo($code);
+            
         }
-        
-        return $applications;
-    }
-    
-    public static function loadSessions()
-    {
-        $sessions = array();
-        
-        $sessionDBI = new SessionCreationDatabaseInterface(null);
-        $sessionTitles = $sessionDBI->getExistingSessions();
-        
-        foreach ($sessionIDTitles as $id => $title) {
-            $session = new Application($id, $title);
-            array_push($sessions, $session);
-        }
-        
-        return $sessions;
     }
 
Index: Dev/trunk/classes/Question.php
===================================================================
--- Dev/trunk/classes/Question.php	(revision 111)
+++ Dev/trunk/classes/Question.php	(revision 112)
@@ -11,6 +11,5 @@
  * @author fpvanagthoven
  */
-class Question {
-    public $id;
+class Question {    
     public $code;
     public $title;
@@ -18,8 +17,8 @@
     public $description;
     public $answers; // format answers['#']
+    public $category;
     
-    public function __construct($id, $code, $title, $type, $description = null)
+    public function __construct($code, $title, $type = null, $description = null)
     {
-        $this->id = $id;
         $this->code = $code;
         $this->title = $title;
@@ -28,4 +27,15 @@
         $this->answers = array();
     }
+    
+    /* reminder that constructor doesn't contain category haha */
+    public function setCategory($category)
+    {
+        $this->category = $category;
+    }
+    
+    public static function getQuestion($questionInfo)
+    {
+        
+    }
 
 }
Index: Dev/trunk/classes/QuestionCreationDatabaseInterface.php
===================================================================
--- Dev/trunk/classes/QuestionCreationDatabaseInterface.php	(revision 111)
+++ Dev/trunk/classes/QuestionCreationDatabaseInterface.php	(revision 112)
@@ -54,5 +54,5 @@
     public function getQuestionInfo($qCode)
     {
-        $questionInfo - array();
+        $questionInfo = array();
         
         $questionTitleObject = $this->questionRDFReader->readQuestionTitle($qCode);
@@ -77,4 +77,6 @@
             }
         }
+        
+        return $questionInfo;
     }
     
Index: Dev/trunk/classes/QuestionCreationTool.php
===================================================================
--- Dev/trunk/classes/QuestionCreationTool.php	(revision 111)
+++ Dev/trunk/classes/QuestionCreationTool.php	(revision 112)
@@ -244,5 +244,57 @@
                 categoryBox.appendChild(categoryInput);
             }
-                                                                    
+                       
+            function clearFields()
+            {
+                clearCategory();
+                clearCode();
+                clearTitle();
+                clearDescription();
+                clearType();
+            }
+            
+            function clearCategory()
+            {
+                var categoryBox = document.getElementById("categoryBox");
+                categoryBox.innerHTML = "";
+                
+                var questionCategorySelect = document.createElement("select");
+                questionCategorySelect.setAttribute("name", "questionCategory");
+                questionCategorySelect.id = "questionCategorySelect";
+                
+                var newCategoryButton = document.createElement("input");
+                newCategoryButton.setAttribute("type", "button");
+                newCategoryButton.setAttribute("onclick", "newCategory()");
+                newCategoryButton.setAttribute("value", "New Category");
+                newCategoryButton.className = "surveyButton";
+                
+                categoryBox.appendChild(questionCategorySelect);
+                categoryBox.appendChild(newCategoryButton);
+            }
+            
+            function clearCode()
+            {
+                var codeInput = document.getElementById("questionCode");
+                codeInput.value = "";
+            }
+            
+            function clearTitle()
+            {
+                var titleInput = document.getElementById("questionTitle");
+                titleInput.value ="";
+            }
+            
+            function clearDescription()
+            {
+                var descriptionInput = document.getElementById("questionDescription");
+                descriptionInput.value = "";
+            }
+            
+            function clearType()
+            {
+                var typeSelect = document.getElementById("questionTypeSelect");
+                typeSelect.selectedIndex = 0;
+            }
+            
         </script>
         <?php
@@ -273,5 +325,5 @@
                     <td><label for="questionCategory">Category</label></td>
                     <td id="categoryBox"><!-- Select should be filled with existing categories-->
-                        <select name="questionCategory">
+                        <select id="questionCategorySelect" name="questionCategory">
                             <option value='Test Category'>Test Category</option>
                         </select>
@@ -295,5 +347,5 @@
                     <td><label for="questionType">Type answer</label></td>
                     <td id="questionType">
-                        <select name="questionType" onchange="handleType(this)">
+                        <select id="questionTypeSelect" name="questionType" onchange="handleType(this)">
                             <option value='text' selected='selected'>Text</option>
                             <option value='int'>Integer</option>
@@ -306,4 +358,5 @@
             </table>
             <div id="answerSpecifications"></div>
+            <input id="clearQuestionFields" type="button" onclick="clearFields()" class="surveyButton" value="Clear" />
             <input id="saveQuestion" type="submit" class="surveyButton" value="Save" />
         </form>
Index: Dev/trunk/css/awesome.css
===================================================================
--- Dev/trunk/css/awesome.css	(revision 111)
+++ Dev/trunk/css/awesome.css	(revision 112)
@@ -441,4 +441,10 @@
     top: 1em;
     right: 1em;
+}
+
+#clearQuestionFields {
+    position: absolute;
+    top: 1em;
+    right: 5em;
 }
 
Index: Dev/trunk/mainmenu.php
===================================================================
--- Dev/trunk/mainmenu.php	(revision 111)
+++ Dev/trunk/mainmenu.php	(revision 112)
@@ -27,5 +27,4 @@
 $surveys = Loader::loadSurveys();
 $applications = Loader::loadApplications();
-
 ?>
 
Index: Dev/trunk/questioncreation.php
===================================================================
--- Dev/trunk/questioncreation.php	(revision 111)
+++ Dev/trunk/questioncreation.php	(revision 112)
@@ -1,15 +1,19 @@
 <?php
 require 'classes/master.php';
-
-$questionDBI = new QuestionCreationDatabaseInterface();
 
 /* If a question is saved */
 if(isset($_POST['questionCode']))
 {
+    $questionDBI = new QuestionCreationDatabaseInterface();
     echo $questionDBI->setQuestionInfo($_POST); // save to DB
 }
 
-$existingQuestions = $questionDBI->getExistingQuestions();
-var_dump($existingQuestions);
+$questions = Loader::loadQuestions();
+var_dump($questions);
+
+//$dbi = new QuestionCreationDatabaseInterface();
+//$info = $dbi->getQuestionInfo("testcode1");
+
+//var_dump($info);
 
 ?>
@@ -32,5 +36,5 @@
                 <?php var_dump($_POST); ?>
                 <?php
-                    new QuestionCreationTool();
+                    new QuestionCreationTool($questions);
                 ?>
             </div>
