changeset 9:ee22af6610a3

Sanitised user ID, end message, bug fixes.
author Brecht De Man <b.deman@qmul.ac.uk>
date Sun, 30 Nov 2014 21:44:03 +0000
parents 2afd6ff39f08
children 3c26ad251043
files listeningTest/launch.m listeningTest/multiComp/endMultiComp.m listeningTest/saveTest.m
diffstat 3 files changed, 21 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/listeningTest/launch.m	Fri Nov 28 00:52:12 2014 +0000
+++ b/listeningTest/launch.m	Sun Nov 30 21:44:03 2014 +0000
@@ -40,6 +40,24 @@
    end
    id=answer{1}; % from cell to string
    
+   % make robust
+   % if first character is a number:
+   if id(1) >= '0' && id(1) <= '9'
+        id = strcat('NUM', id);   
+   end
+   % if it contains spaces or special characters: 
+   id = strrep(id, ' ', '_'); 
+   id = strrep(id, '/', 'SLASH');
+   id = strrep(id, '\', 'BACKSLASH');
+   id = strrep(id, ':', 'COLON');
+   id = strrep(id, '.', 'DOT');
+   id = strrep(id, ',', 'COMMA');
+   id = strrep(id, '?', 'QMARK');
+   id = strrep(id, ';', 'SEMICOLON');
+   id = strrep(id, '!', 'EXCLMARK');
+   id = strrep(id, '(', 'OBRACKET');
+   id = strrep(id, ')', 'CBRACKET');
+   
    % if name already present, return to former test
    d=dir('responses');
    ASK=0;
--- a/listeningTest/multiComp/endMultiComp.m	Fri Nov 28 00:52:12 2014 +0000
+++ b/listeningTest/multiComp/endMultiComp.m	Sun Nov 30 21:44:03 2014 +0000
@@ -4,7 +4,7 @@
 
 dat=get(hf,'userdata');
 
-if(sum(dat.playVec) <= size(dat.sesDat.cuSndList,2)) % less than: allow for missing files... 
+if(sum(dat.playVec) < size(dat.sesDat.cuSndList,2))
     x = mat2str(dat.permVec(find(dat.playVec==0)));
     errordlg(['Please continue until all sounds are assessed: you haven''t listened to ' x ' yet.'], 'Not all sounds played!');
     return;
--- a/listeningTest/saveTest.m	Fri Nov 28 00:52:12 2014 +0000
+++ b/listeningTest/saveTest.m	Sun Nov 30 21:44:03 2014 +0000
@@ -36,6 +36,8 @@
    sesDat.noTst=noTst;
    expr=sprintf('%s(sesDat)',sesDat.tstDat{noTst}.tstType);
    eval(expr);
+else
+    msgbox('Thanks for your participation!', 'Test finished');
 end
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%