b@0: function [sesDat,indDat]=saveTest(dat,rsl,typeTst) b@0: b@0: test=[]; b@0: indDat=[]; b@0: sesDat=dat.sesDat; b@0: b@0: test.rsl=rsl; b@0: test.tstFile=sesDat.tstDat{dat.sesDat.noTst}.tstFile; b@0: test.tstType=sesDat.tstDat{dat.sesDat.noTst}.tstType; b@0: test.sndFile=sesDat.cuSndListFile; b@0: b@0: % Create new test data file b@0: sesDat.tstDat{dat.sesDat.noTst}=test; b@0: b@0: % make temporary variable in workspace b@0: assignin('base',typeTst,test); b@0: b@0: % save the individual session b@0: indDat.id=sesDat.id; b@0: indDat.sesScript=sesDat.sesScript; b@0: indDat.tstDat=sesDat.tstDat; b@0: eval(sprintf('%s=indDat;',indDat.id)); b@0: expre=sprintf('save(''responses/%s'',''%s'')',indDat.id,indDat.id); b@0: eval(expre); b@0: b@0: % close the test window b@0: closereq; b@0: b@0: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% b@0: % Call the next test b@0: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% b@0: noTst=sesDat.noTst+1; b@0: nbTst=sesDat.nbTst; b@0: b@0: if ~(noTst>nbTst) b@0: sesDat.noTst=noTst; b@0: expr=sprintf('%s(sesDat)',sesDat.tstDat{noTst}.tstType); b@0: eval(expr); b@9: else b@9: msgbox('Thanks for your participation!', 'Test finished'); b@0: end b@0: b@0: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% b@0: % Clean up b@0: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% b@0: clear;