changeset 30:84d943797cf2

Require rating for each melody
author Jeremy Gow <jeremy.gow@gmail.com>
date Tue, 13 Nov 2012 11:46:10 +0000
parents 4574bad81227
children ec628e1d70d1
files Block.class ExperimentController.class ExperimentController.java ExperimentGui$1.class ExperimentGui.class MelodyResults$1.class MelodyResults.class MelodyResults.java
diffstat 8 files changed, 14 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
Binary file Block.class has changed
Binary file ExperimentController.class has changed
--- a/ExperimentController.java	Tue Nov 13 11:45:12 2012 +0000
+++ b/ExperimentController.java	Tue Nov 13 11:46:10 2012 +0000
@@ -106,9 +106,16 @@
 //             else 
 //                 reportError("You have already played the melody.");
         } else if (source == sp.getNextButton()) { 
-            if (!exp.hasRun() || exp.isRunning()) 
+            if (!exp.hasRun() || exp.isRunning()) {
+		//System.out.println(!exp.hasRun());
+		//System.out.println(exp.isRunning());
+		//System.out.println(exp.getCurrentBlock().getMidiPlayer().getSequencer().isRunning());
                 reportError("You haven't finished playing the melody yet."); 
-            else if (sp.unansweredQuestions())
+
+            } else if (exp.getCurrentBlock().getMelodyResults().countResponses() == 0) {
+                reportError("Please select a number."); 
+
+            } else if (sp.unansweredQuestions())
                 reportError("There are unanswered questions."); 
             else {  
                 // store results (and write to file)
Binary file ExperimentGui$1.class has changed
Binary file ExperimentGui.class has changed
Binary file MelodyResults$1.class has changed
Binary file MelodyResults.class has changed
--- a/MelodyResults.java	Tue Nov 13 11:45:12 2012 +0000
+++ b/MelodyResults.java	Tue Nov 13 11:46:10 2012 +0000
@@ -63,6 +63,11 @@
         responseTimes.add(t);
     }
 
+    public int countResponses() {
+	return responses.size();
+    }
+
+
     /* add question */ 
     public void addQuestion(String question) { 
         questions.add(question);