b@0: function endMultiComp(hf) % called when 'Finished' clicked b@0: b@0: playSound([]); % stop all sound b@0: b@0: dat=get(hf,'userdata'); b@0: b@9: if(sum(dat.playVec) < size(dat.sesDat.cuSndList,2)) b@0: x = mat2str(dat.permVec(find(dat.playVec==0))); b@0: errordlg(['Please continue until all sounds are assessed: you haven''t listened to ' x ' yet.'], 'Not all sounds played!'); b@0: return; b@0: end b@0: b@0: % are you sure? b@0: choice = questdlg('Are you sure you are finished and want to submit your response for this round?','Finish and submit','No','Yes','No'); b@0: if strcmp(choice, 'No') b@0: return; b@0: end b@0: b@0: % TODO: replace some of the following by savemultiComp b@0: b@0: sesDat=dat.sesDat; b@0: test=dat.test; b@0: b@0: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% b@0: % Collect the results into rsl b@0: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% b@0: b@0: rsl.gcom=get(dat.gcom,'string'); % general comments b@0: rsl.hcom=get(struct([]), 'struct'); % empty array of individual comments b@0: rsl.permVec=dat.permVec; b@0: rsl.playVec=dat.playVec; b@0: b@0: nbSnd=test.nbComb; b@0: nbScale=length(test.scale); b@0: b@0: for noScale=1:nbScale b@0: for noSnd=1:nbSnd b@0: rsl.hcom{noSnd}=get(dat.hcom{noSnd}, 'string'); % individual comments b@0: posIc=get(dat.hIcon(noScale,noSnd),'position'); b@0: scale=test.scale(noScale); b@0: posx=posIc(1); b@0: dxx=dat.dxx; b@0: dxI=dat.dxI; b@0: minx=scale.minn; b@0: maxx=scale.maxx; b@0: stepp=scale.stepp; b@0: a=(maxx-minx)/(1-2*dxx); b@0: b=minx-a*dxx; b@0: nx=a*(posx+dxI/2)+b; b@0: rsl.mat(noScale,noSnd)=nx; b@0: end b@0: end b@0: b@0: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% b@0: % Timer b@0: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% b@0: rsl.duration=etime(clock,dat.t0); b@0: b@0: b@0: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% b@0: % generate a small report file b@0: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% b@0: fid=reportTest(sesDat,rsl,'MULTIPLE COMPARISON 1D'); b@0: b@0: % scales b@0: fprintf(fid,'%%%%%%%%%%%% scales ');eol(fid);eol(fid); b@0: for noScale=1:nbScale b@0: fprintf(fid,'Scale #%d -- %s',noScale,test.scale(noScale).name);eol(fid); b@0: end b@0: b@0: % matrix results b@0: for noScale=1:nbScale b@0: fprintf(fid,'SCALE #%d: ',noScale); b@0: for noSnd=1:nbSnd b@0: fprintf(fid,'%2.2f \t',rsl.mat(noScale,noSnd)); b@0: end b@0: eol(fid); b@0: end b@0: b@0: % COMMENTS b@0: fprintf(fid,'');eol(fid); b@0: fprintf(fid,'%%%%%%%%%%%% COMMENTS');eol(fid); b@0: b@0: for index = 1:nbSnd b@0: com = rsl.hcom{dat.permVec(index)}; % individual comments b@0: fprintf(fid,'Sound %d, marker %s\n',index,com); b@0: end b@0: b@0: fprintf(fid,'%s\n',rsl.gcom); % print general comments b@0: b@0: b@0: eol(fid);eol(fid); b@0: fclose(fid); b@0: b@0: b@0: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% b@0: % Save it b@0: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% b@0: dat=get(hf,'userdata'); b@0: saveTest(dat,rsl,'multiComp');