annotate listeningTest/saveTest.m @ 15:24be5e9ce25b tip

Update README
author Brecht De Man <brecht.deman@bcu.ac.uk>
date Thu, 20 Sep 2018 12:23:20 +0200
parents ee22af6610a3
children
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@9 39 else
b@9 40 msgbox('Thanks for your participation!', 'Test finished');
b@0 41 end
b@0 42
b@0 43 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
b@0 44 % Clean up
b@0 45 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
b@0 46 clear;