Subversion Repositories wimsdev

Rev

Rev 12211 | Rev 12214 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 12211 Rev 12213
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;
135
  char *user, *classe, *sh, *sess, *exo, *cc, *ip, *allow, *pend;
136
  char *ex;
136
  char *ex;
137
  double sc,Sc;
137
  double sc,Sc;
138
    int i, scorelog;
138
    int i, scorelog, 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=strcmp(c,"new")!=0 && strcmp(c,"renew")!=0 && gettrycheck(classe,user,atoi(sh),atoi(exo))==1;
186
  pend=getvar("wims_scoring"); if(pend==NULL) pend="";
187
  pend=getvar("wims_scoring"); if(pend==NULL) pend="";
187
    if((i==0 || !exodepOK || strcmp(pend,"pending")!=0) && strcmp(cc,"rafale")!=0)
188
    if((i==0 || !exodepOK || strcmp(pend,"pending")!=0 || testmax) && strcmp(cc,"rafale")!=0)
188
      allow="\tnoscore";
189
      if(testmax) allow="\tmaxtry noscore"; else allow="noscore";
189
    else allow="";
190
      else allow="";
190
  ip=remote_addr; if(*ip==0) ip="-"; scorelog=0;
191
  ip=remote_addr; if(*ip==0) ip="-"; scorelog=0;
191
  if(user==NULL || *user==0) {
192
  if(user==NULL || *user==0) {
192
    classe="0"; allow="";
193
    classe="0"; allow="";
193
    mkfname(fname,"../sessions/%s/.score",sess);
194
    mkfname(fname,"../sessions/%s/.score",sess);
194
  }
195
  }
195
  else {
196
  else {
196
    char *pp;
197
    char *pp;
197
    if(classe==NULL || *classe==0) return;
198
    if(classe==NULL || *classe==0) return;
198
    pp=getvar("wims_scorereg");
199
    pp=getvar("wims_scorereg");
199
     if((allow[0]==0 || (pp!=NULL && strcmp(pp,"suspend")==0)) && *ex!='E')
200
     if((allow[0]==0 || gettrycheck(classe,user,atoi(sh),atoi(exo))==1 || (pp!=NULL && strcmp(pp,"suspend")==0)) && *ex!='E')
200
      scorelog=1;
201
      scorelog=1;
201
    else
202
    else
202
      mkfname(fname,"classes/%s/noscore/%s",classe,user);
203
      mkfname(fname,"classes/%s/noscore/%s",classe,user);
203
  }
204
  }
204
  if(isexam && user!=NULL && *user!=0) {
205
  if(isexam && user!=NULL && *user!=0) {
Line 217... Line 218...
217
      }
218
      }
218
    }
219
    }
219
    else snprintf(exam_sheetexo+strlen(exam_sheetexo),
220
    else snprintf(exam_sheetexo+strlen(exam_sheetexo),
220
        sizeof(exam_sheetexo)-strlen(exam_sheetexo), "\tS");
221
        sizeof(exam_sheetexo)-strlen(exam_sheetexo), "\tS");
221
  }
222
  }
222
  snprintf(logbuf,sizeof(logbuf),"%s%s %s %2s %2s %s  \t%s%s",
223
  snprintf(logbuf,sizeof(logbuf),"%s%s %s %2s %2s %s  \t%s\t%s",
223
      ex,nowstr,sess,sh,exo,cc,ip,allow);
224
      ex,nowstr,sess,sh,exo,cc,ip,allow);
224
  if(scorelog) {
225
  if(scorelog) {
225
    snprintf(tmplbuf,sizeof(tmplbuf),"-c%s -u%s scorelog %s",
226
    snprintf(tmplbuf,sizeof(tmplbuf),"-c%s -u%s scorelog %s",
226
       classe,user,logbuf);
227
       classe,user,logbuf);
227
    _daemoncmd(tmplbuf);
228
    _daemoncmd(tmplbuf);