diff ExperimentController.java @ 8:235484b93707

Make the familarity/pleasantness questions and final questionnaire command line options. Ignore-this: cc4721e49541fa92c99fc37cf313b09b
author Marcus Pearce <m.pearce@gold.ac.uk>
date Tue, 19 Jul 2011 19:14:07 +0100
parents 135338ba37ef
children 3dd7636ca811
line wrap: on
line diff
--- a/ExperimentController.java	Fri Jul 15 16:36:53 2011 +0100
+++ b/ExperimentController.java	Tue Jul 19 19:14:07 2011 +0100
@@ -2,7 +2,7 @@
  * File:       ExperimentController.java
  * Author:     Marcus Pearce <m.pearce@gold.ac.uk>
  * Created:    <2007-12-14 12:06:10 marcusp>
- * Time-stamp: <2010-11-25 11:09:56 marcusp>
+ * Time-stamp: <2011-07-19 15:26:30 marcusp>
  *=============================================================================
  */
 
@@ -88,12 +88,15 @@
          
        // SubjectDataPanel
         else if (e.getSource() == sdp.getFinishButton()) { 
-            if (sdp.allDataEntered()) { 
-                sdp.storeData(); 
-                results.writeSubjectData(); 
+            if (exp.getFinalQuestionnaire()) {
+                if (sdp.allDataEntered()) { 
+                    sdp.storeData(); 
+                    results.writeSubjectData(); 
+                    System.exit(0); 
+                } else 
+                    reportError("You have not filled in all the information."); 
+            } else 
                 System.exit(0); 
-            } else 
-                reportError("You have not filled in all the information."); 
         }
 
         // StimulusPanel
@@ -109,10 +112,18 @@
                 reportError("There are unanswered questions."); 
             else {  
                 // store results (and write to file)
-                String answer1 = (String)(sp.getQ1Box().getSelectedItem()); 
-                String answer2 = (String)(sp.getQ2Box().getSelectedItem()); 
-                block.addMelodyQA("known", answer1); 
-                block.addMelodyQA("liked", answer2); 
+                if (exp.getAskFamiliarity()) {
+                    String answer1 = (String)(sp.getQ1Box().getSelectedItem()); 
+                    block.addMelodyQA("known", answer1); 
+                } else 
+                    block.addMelodyQA("known", "-1");
+                
+                if (exp.getAskLiking()) {
+                    String answer2 = (String)(sp.getQ2Box().getSelectedItem()); 
+                    block.addMelodyQA("liked", answer2); 
+                } else 
+                    block.addMelodyQA("liked", "-1");
+                
                 block.storeMelodyResult();
                 results.writeResults();
                 // close the midi player