annotate listeningTest/pairComp/endPairComp.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 5e72201496c8
children
rev   line source
b@0 1 function endPairComp(hf)
b@0 2
b@0 3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
b@0 4 %
b@0 5 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
b@0 6 dat=get(hf,'userdata');
b@0 7 sesDat=dat.sesDat;
b@0 8 reREAD=sesDat.reREAD;
b@0 9 rsl=dat.rsl;
b@0 10
b@0 11 noComb=dat.noComb;
b@0 12 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
b@0 13 % collect datas in .rsl
b@0 14 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
b@0 15 if noComb<=dat.nbComb
b@0 16 if dat.nbQuest
b@0 17 for noQuest=1:dat.nbQuest
b@0 18 rsl.quest(noComb,noQuest)=get(dat.hQuest(noQuest),'value');
b@0 19 % if(rsl.quest(noComb,noQuest))
b@0 20 % disp(noQuest); % in case of crash
b@0 21 % end
b@0 22 end
b@0 23 end
b@0 24 if dat.nbScale
b@0 25 for noScale=1:dat.nbScale
b@0 26 rsl.scale(noComb,noScale)=get(dat.hScale(noScale),'value');
b@0 27 end
b@0 28 end
b@0 29 if dat.COM
b@0 30 rsl.com{noComb}=get(dat.hCom,'string');
b@0 31 end
b@0 32
b@0 33 dat.rsl=rsl;
b@0 34 dat.noComb=noComb+1;
b@0 35 set(hf,'name',sprintf('%d tests left / pair #%d/%d',sesDat.nbTst-sesDat.noTst,dat.noComb,dat.nbComb));
b@0 36 set(hf,'userdata',dat);
b@0 37
b@0 38 % reLAUNCH the next pair comparison
b@0 39
b@0 40 if noComb<dat.nbComb
b@0 41 if reREAD
b@0 42 if dat.nbQuest
b@0 43 for noQuest=1:dat.nbQuest
b@0 44 set(dat.hQuest(noQuest),'value',rsl.quest(noComb+1,noQuest));
b@0 45 end
b@0 46 end
b@0 47 if dat.nbScale
b@0 48 for noScale=1:dat.nbScale
b@0 49 set(dat.hScale(noScale),'value',rsl.scale(noComb+1,noScale));
b@0 50 end
b@0 51 end
b@0 52 if dat.COM
b@0 53 set(dat.hCom,'string',rsl.com{noComb+1});
b@0 54 end
b@0 55 else
b@0 56 if dat.nbQuest
b@0 57 set(dat.hQuest,'value',0);
b@0 58 end
b@0 59 if dat.nbScale
b@0 60 for noScale=1:dat.nbScale
b@0 61 set(dat.hScale(noScale),'value',get(dat.hScale(noScale),'min'));
b@0 62 end
b@0 63 end
b@0 64 if dat.COM
b@0 65 set(dat.hCom,'string',dat.stri);
b@0 66 end
b@0 67 end
b@0 68 return
b@0 69 end
b@0 70 end
b@0 71
b@0 72
b@0 73 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
b@0 74 % Timer
b@0 75 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
b@0 76 rsl.duration=etime(clock,dat.t0);
b@0 77
b@0 78 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
b@0 79 % generate a small report file
b@0 80 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
b@0 81
b@0 82 fid=reportTest(sesDat,rsl,'PAIR COMPARISONS');
b@0 83
b@0 84 if dat.nbScale
b@0 85 fprintf(fid,'--------- scales ');eol(fid);
b@0 86 for noScale=1:dat.nbScale
b@0 87 fprintf(fid,'Scale #%d : %s',noScale,dat.scale(noScale).name);eol(fid);
b@0 88 end
b@0 89 end
b@0 90
b@0 91 fprintf(fid,'------------- COMBINATIONS ');eol(fid);eol(fid);
b@0 92 fprintf(fid,'A\t B\t ');eol(fid);
b@0 93
b@0 94 for noComb=1:dat.nbComb
b@0 95 fprintf(fid,'%d \t %d ',dat.comb(noComb,1),dat.comb(noComb,2));eol(fid);
b@0 96 end
b@0 97 eol(fid);
b@0 98
b@0 99 for noComb=1:dat.nbComb
b@0 100 fprintf(fid,'%d \t %d ',dat.comb(noComb,1),dat.comb(noComb,2));eol(fid);
b@0 101 if (dat.comb(noComb,1) - dat.comb(noComb,2) == 0)
b@0 102 if (rsl.quest(noComb,3)==0)
b@0 103 disp('FALSE UNEQUAL');
b@0 104 fprintf(fid,'PROBLEM: False unequal');
b@0 105 end
b@0 106 else if (rsl.quest(noComb,3))
b@0 107 if (dat.comb(noComb,1) - dat.comb(noComb,2) ~= 0)
b@0 108 disp('FALSE EQUAL');
b@0 109 fprintf(fid,'PROBLEM: False equal');
b@0 110 end
b@0 111 end
b@0 112 end
b@0 113 if dat.nbScale
b@0 114 fprintf(fid,'SCALES:\t');
b@0 115 for noScale=1:dat.nbScale
b@0 116 fprintf(fid,'%2.2f\t',rsl.scale(noComb,noScale));
b@0 117 end
b@0 118 eol(fid);
b@0 119 end
b@0 120 if dat.nbQuest
b@0 121 fprintf(fid,'QUESTS:\t');
b@0 122 for noQuest=1:dat.nbQuest
b@0 123 if rsl.quest(noComb,noQuest)
b@0 124 fprintf(fid,'%s',dat.quest{noQuest});eol(fid);
b@0 125 end
b@0 126 end
b@0 127 eol(fid);
b@0 128 end
b@0 129 if dat.COM
b@0 130 fprintf(fid,'COM:\t');
b@0 131 scom=rsl.com{noComb}';
b@0 132 fprintf(fid,'%s',scom(:));eol(fid);eol(fid);
b@0 133 end
b@0 134 end
b@0 135
b@0 136 fprintf(fid,'------------- LIST OF RESULTS');eol(fid);eol(fid);
b@2 137
b@0 138 for noComb=1:dat.nbComb
b@0 139 if rsl.quest(noComb,1)
b@0 140 fprintf(fid,'%d',dat.comb(noComb,1));eol(fid);
b@0 141 else if rsl.quest(noComb,2)
b@0 142 fprintf(fid,'%d',dat.comb(noComb,2));eol(fid);
b@0 143 else
b@0 144 fprintf(fid,'%d',0);eol(fid);
b@0 145 end
b@0 146 end
b@0 147 end
b@0 148 eol(fid);
b@0 149
b@0 150 fclose(fid);
b@0 151
b@0 152 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
b@0 153 % Save it
b@0 154 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
b@0 155 dat=get(hf,'userdata');
b@0 156 saveTest(dat,rsl,'paircomp');
b@0 157