Mercurial > hg > mep
diff SubjectResults.java @ 45:351b0c8b34ac
Fixed issue where error message was shown every time the user chose to move continue using the keyboard.
Fixed issue where data wasn't saving to file after questionaire.
Changed SubjectData output filename to "<Participant ID>_qu.dat" (previously was "subjects.dat". Would have been overwritten as wasn't dynamic.
author | Carl Bussey <c.bussey@se10.qmul.ac.uk> |
---|---|
date | Sun, 09 Jun 2013 22:06:52 +0100 |
parents | 0e030f32a6e2 |
children |
line wrap: on
line diff
--- a/SubjectResults.java Fri Jun 07 18:28:39 2013 +0100 +++ b/SubjectResults.java Sun Jun 09 22:06:52 2013 +0100 @@ -21,18 +21,21 @@ /* accessors */ public String getSubjectID() { return subjectID; } public void setSubjectID(String id) { subjectID = id; } - public void setSubjectData (ArrayList sd) { subjectData = sd; } + public void setSubjectData (ArrayList sd) { subjectData = sd; } + public void setSubjectDataFile(String id){ + subjectDataFile = new File(exp.RESULTS_DIRECTORY + File.separator + id + "_q" + exp.RESULTS_EXTENSION); + } public void setOutputFile (String id) { - outputFile = new File(exp.RESULTS_DIRECTORY + id + + outputFile = new File(exp.RESULTS_DIRECTORY + id + exp.RESULTS_EXTENSION); } /* constructor */ public SubjectResults(Experiment e) { exp = e; - subjectDataFile = new File(exp.SUBJECT_RESULTS_FILE); + //subjectDataFile = new File(exp.SUBJECT_RESULTS_FILE); results = new ArrayList(); - subjectData = new ArrayList(); + subjectData = new ArrayList(); } /* methods */ @@ -59,7 +62,8 @@ try { writer = new FileWriter (subjectDataFile, true); } catch (IOException e) { - System.out.println("Could not write file: " + outputFile.getPath()); + System.out.println("Could not write file: " + subjectDataFile.getPath()); + e.printStackTrace(); return; }