Rev 12218 | Rev 12224 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 12218 | Rev 12219 | ||
---|---|---|---|
Line 133... | Line 133... | ||
133 | { |
133 | { |
134 | char fname[MAX_FNAME+1], logbuf[MAX_LINELEN+1], cbuf[256], sbuf[32], shbuf[32]; |
134 | char fname[MAX_FNAME+1], logbuf[MAX_LINELEN+1], cbuf[256], sbuf[32], shbuf[32]; |
135 | char *user, *classe, *sh, *sess, *exo, *cc, *ip, *allow, *pend, *se; |
135 | char *user, *classe, *sh, *sess, *exo, *cc, *ip, *allow, *pend, *se; |
136 | char *ex; |
136 | char *ex; |
137 | double sc,Sc; |
137 | double sc,Sc; |
138 | int i, scorelog, testmax; |
138 | int i, scorelog, testmax_,testmax; |
139 | 139 | ||
140 | if(robot_access || strstr("session_prefix","_check")!=NULL) return; |
140 | if(robot_access || strstr("session_prefix","_check")!=NULL) return; |
141 | user=getvar("wims_user"); classe=getvar("wims_class"); |
141 | user=getvar("wims_user"); classe=getvar("wims_class"); |
142 | sc=0; |
142 | sc=0; |
143 | if(isexam) { |
143 | if(isexam) { |
Line 181... | Line 181... | ||
181 | cc=cbuf; |
181 | cc=cbuf; |
182 | } |
182 | } |
183 | else cc=c; |
183 | else cc=c; |
184 | if(classe==NULL || *classe==0) i=1; |
184 | if(classe==NULL || *classe==0) i=1; |
185 | else i=getscorestatus(classe,atoi(sh)); |
185 | else i=getscorestatus(classe,atoi(sh)); |
- | 186 | testmax_=gettrycheck(classe,user,atoi(sh),atoi(exo))==1; |
|
186 |
|
187 | testmax=strcmp(c,"new")!=0 && strcmp(c,"renew")!=0 && testmax_; |
187 | pend=getvar("wims_scoring"); if(pend==NULL) pend=""; |
188 | pend=getvar("wims_scoring"); if(pend==NULL) pend=""; |
188 |
|
189 | if((i==0 || !exodepOK || strcmp(pend,"pending")!=0 || testmax) && strcmp(cc,"rafale")!=0) |
189 |
|
190 | if(testmax) allow="maxtry noscore"; else allow="noscore"; |
- | 191 | else { |
|
- | 192 | if((strcmp(c,"new")==0 || strcmp(c,"renew")==0) && testmax_) allow="noscore"; |
|
190 |
|
193 | else allow=""; |
- | 194 | } |
|
191 | ip=remote_addr; if(*ip==0) ip="-"; scorelog=0; |
195 | ip=remote_addr; if(*ip==0) ip="-"; scorelog=0; |
192 | if(user==NULL || *user==0) { |
196 | if(user==NULL || *user==0) { |
193 | classe="0"; allow=""; |
197 | classe="0"; allow=""; |
194 | mkfname(fname,"../sessions/%s/.score",sess); |
198 | mkfname(fname,"../sessions/%s/.score",sess); |
195 | } |
199 | } |
196 | else { |
200 | else { |
197 | char *pp; |
201 | char *pp; |
198 | if(classe==NULL || *classe==0) return; |
202 | if(classe==NULL || *classe==0) return; |
199 | pp=getvar("wims_scorereg"); |
203 | pp=getvar("wims_scorereg"); |
200 | if((allow[0]==0 || |
204 | if((allow[0]==0 || testmax_ || (pp!=NULL && strcmp(pp,"suspend")==0)) && *ex!='E') |
201 | scorelog=1; |
205 | scorelog=1; |
202 | else |
206 | else |
203 | mkfname(fname,"classes/%s/noscore/%s",classe,user); |
207 | mkfname(fname,"classes/%s/noscore/%s",classe,user); |
204 | } |
208 | } |
205 | if(isexam && user!=NULL && *user!=0) { |
209 | if(isexam && user!=NULL && *user!=0) { |
Line 221... | Line 225... | ||
221 | sizeof(exam_sheetexo)-strlen(exam_sheetexo), "\tS"); |
225 | sizeof(exam_sheetexo)-strlen(exam_sheetexo), "\tS"); |
222 | } |
226 | } |
223 | if(strcmp(c,"new")==0 || strcmp(c,"renew")==0) |
227 | if(strcmp(c,"new")==0 || strcmp(c,"renew")==0) |
224 | se=getvar("wims_seed"); else se=""; |
228 | se=getvar("wims_seed"); else se=""; |
225 | snprintf(logbuf,sizeof(logbuf),"%s%s %s %2s %2s %s \t%s\t%s\t%s", |
229 | snprintf(logbuf,sizeof(logbuf),"%s%s %s %2s %2s %s \t%s\t%s\t%s", |
226 | ex,nowstr,sess,sh,exo,cc,ip, |
230 | ex,nowstr,sess,sh,exo,cc,ip,se,allow); |
227 | if(scorelog) { |
231 | if(scorelog) { |
228 | snprintf(tmplbuf,sizeof(tmplbuf),"-c%s -u%s scorelog %s", |
232 | snprintf(tmplbuf,sizeof(tmplbuf),"-c%s -u%s scorelog %s", |
229 | classe,user,logbuf); |
233 | classe,user,logbuf); |
230 | _daemoncmd(tmplbuf); |
234 | _daemoncmd(tmplbuf); |
231 | } |
235 | } |