annotate listeningTest/saveTest.m @ 1:b64c9fb34bd0

Response folder included in package (put README in it).
author Brecht <b.deman@qmul.ac.uk>
date Wed, 30 Jul 2014 12:38:47 +0100
parents 4fd284285159
children ee22af6610a3
rev   line source
b@0 1 function [sesDat,indDat]=saveTest(dat,rsl,typeTst)
b@0 2
b@0 3 test=[];
b@0 4 indDat=[];
b@0 5 sesDat=dat.sesDat;
b@0 6
b@0 7 test.rsl=rsl;
b@0 8 test.tstFile=sesDat.tstDat{dat.sesDat.noTst}.tstFile;
b@0 9 test.tstType=sesDat.tstDat{dat.sesDat.noTst}.tstType;
b@0 10 test.sndFile=sesDat.cuSndListFile;
b@0 11
b@0 12 % Create new test data file
b@0 13 sesDat.tstDat{dat.sesDat.noTst}=test;
b@0 14
b@0 15 % make temporary variable in workspace
b@0 16 assignin('base',typeTst,test);
b@0 17
b@0 18 % save the individual session
b@0 19 indDat.id=sesDat.id;
b@0 20 indDat.sesScript=sesDat.sesScript;
b@0 21 indDat.tstDat=sesDat.tstDat;
b@0 22 eval(sprintf('%s=indDat;',indDat.id));
b@0 23 expre=sprintf('save(''responses/%s'',''%s'')',indDat.id,indDat.id);
b@0 24 eval(expre);
b@0 25
b@0 26 % close the test window
b@0 27 closereq;
b@0 28
b@0 29 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
b@0 30 % Call the next test
b@0 31 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
b@0 32 noTst=sesDat.noTst+1;
b@0 33 nbTst=sesDat.nbTst;
b@0 34
b@0 35 if ~(noTst>nbTst)
b@0 36 sesDat.noTst=noTst;
b@0 37 expr=sprintf('%s(sesDat)',sesDat.tstDat{noTst}.tstType);
b@0 38 eval(expr);
b@0 39 end
b@0 40
b@0 41 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
b@0 42 % Clean up
b@0 43 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
b@0 44 clear;