Subversion Repositories wimsdev

Rev

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

Rev 15707 Rev 15708
Line 591... Line 591...
591
    if(*p3) *p3++=0;
591
    if(*p3) *p3++=0;
592
    perc=atoi(p2);
592
    perc=atoi(p2);
593
    if(perc<=0 || perc>100) break;
593
    if(perc<=0 || perc>100) break;
594
    for(pp=p1; *pp; pp++) if(!myisdigit(*pp)) *pp=' ';
594
    for(pp=p1; *pp; pp++) if(!myisdigit(*pp)) *pp=' ';
595
    tgot=ttot=tmean=0; sum=0;
595
    tgot=ttot=tmean=0; sum=0;
596
    {FILE *f=fopen("../fichier_idiot","a");
-
 
597
 fprintf(f,"p1=%s et p2=%s et p3=%s \n",p1,p2,p3);
-
 
598
fclose(f);}
-
 
599
    for(pp=find_word_start(p1); *pp; pp=find_word_start(p4)) {
596
    for(pp=find_word_start(p1); *pp; pp=find_word_start(p4)) {
600
      p4=find_word_end(pp); if(*p4) *p4++=0;
597
      p4=find_word_end(pp); if(*p4) *p4++=0;
601
      t=atoi(pp); if(t<=0 || t>ecnt) goto lend;
598
      t=atoi(pp); if(t<=0 || t>ecnt) goto lend;
602
      t--;
599
      t--;
603
      ttot+=rs[t].require; tgot+=rs[t].score; tmean+=rs[t].mean;
600
      ttot+=rs[t].require; tgot+=rs[t].score; tmean+=rs[t].mean;
604
      sum++;
601
      sum++;
605
    }
602
    }
606
    {FILE *f=fopen("../fichier_idiot","a");
-
 
607
  fprintf(f,"t=%i; tmean=%f tgot=%f ttot=%f sum=%d\n",t,tmean,tgot,ttot,sum);
-
 
608
  fprintf(f,"%f/%f*sqrt(%f/(%d*10))*100<%d\n",tgot,ttot,tmean,sum,perc);
-
 
609
  fclose(f);}
-
 
610
 
-
 
611
    if(ttot<10) continue;
603
    if(ttot<10) continue;
612
    {FILE *f=fopen("../fichier_idiot","a");
-
 
613
  fprintf(f,"ttot>10\n");
-
 
614
  fclose(f);}
-
 
615
    if(tgot/ttot*sqrt(tmean/(sum*10))*100<perc) {
604
    if(tgot/ttot*sqrt(tmean/(sum*10))*100<perc) {
616
      for(pp=p1;pp<p2-1;pp++) if(!*pp) *pp=',';
605
      for(pp=p1;pp<p2-1;pp++) if(!*pp) *pp=',';
617
      *pp=0; setvar("dep_list",p1);
606
      *pp=0; setvar("dep_list",p1);
618
      {FILE *f=fopen("../fichier_idiot","a");
-
 
619
        fprintf(f,"fin dep p1=%s\n",p1);
-
 
620
        //p1=4,5,6
-
 
621
      fclose(f);}
-
 
622
      return 0;
607
      return 0;
623
    }
608
    }
624
    {FILE *f=fopen("../fichier_idiot","a");
-
 
625
        fprintf(f,"ne retourne pas 0\n");
-
 
626
      fclose(f);}
-
 
627
 
-
 
628
  lend: ;
609
  lend: ;
629
  }
610
  }
630
  return 1;
611
  return 1;
631
}
612
}
632
 
613
 
633
int depcheck(char *sh, int exo, char *deps)
614
int depcheck(char *sh, int exo, char *deps)
634
{
615
{
635
  char buf[MAX_LINELEN+1];
616
  char buf[MAX_LINELEN+1];
636
  char *s, sbuf[64];
617
  char *s, sbuf[64];
637
  int i, is;
618
  int i, is;
638
  {FILE *f=fopen("../fichier_idiot","a");
-
 
639
  fprintf(f,"entre depcheck : deps=%s \n",deps);
-
 
640
  fclose(f);}
-
 
641
 
619
 
642
  s=getvar("wims_session");
620
  s=getvar("wims_session");
643
  if(s==NULL || *s==0 || strstr(s,"robot")!=NULL) return 0;
621
  if(s==NULL || *s==0 || strstr(s,"robot")!=NULL) return 0;
644
  mystrncpy(sbuf,s,sizeof(sbuf));
622
  mystrncpy(sbuf,s,sizeof(sbuf));
645
  s=strchr(sbuf,'_'); if(s) *s=0;
623
  s=strchr(sbuf,'_'); if(s) *s=0;
646
  accessfile(buf,"r","../sessions/%s/exodep.%s",sbuf,sh);
624
  accessfile(buf,"r","../sessions/%s/exodep.%s",sbuf,sh);
647
  if(buf[0]==0) {     /* no dep file found */
625
  if(buf[0]==0) {     /* no dep file found */
648
    is=atoi(sh); if(is<=0 || is>totsheets) return 0;
626
    is=atoi(sh); if(is<=0 || is>totsheets) return 0;
649
    s=getvar("wims_class"); if(s==NULL || *s==0) return 0;
627
    s=getvar("wims_class"); if(s==NULL || *s==0) return 0;
650
    getscoreuser(s,"");
628
    getscoreuser(s,"");
651
    {FILE *f=fopen("../fichier_idiot","a");
-
 
652
  fprintf(f,"dans depcheck2 avant return : deps=%s \n",deps);
-
 
653
  fclose(f);}
-
 
654
 
-
 
655
    return _depcheck(deps,rscore+sheetstart[is-1],shexocnt[is-1]);
629
    return _depcheck(deps,rscore+sheetstart[is-1],shexocnt[is-1]);
656
  }
630
  }
657
  for(i=1,s=strchr(buf,':'); s && i<exo; i++, s=strchr(s+1,':'));
631
  for(i=1,s=strchr(buf,':'); s && i<exo; i++, s=strchr(s+1,':'));
658
  if(s==NULL) return 0;     /* bad file or exo number */
632
  if(s==NULL) return 0;     /* bad file or exo number */
659
  if(myisdigit(*++s)) return 0; else return 1;
633
  if(myisdigit(*++s)) return 0; else return 1;
Line 661... Line 635...
661
 
635
 
662
int exam_depcheck(char *deps, int exam)
636
int exam_depcheck(char *deps, int exam)
663
{
637
{
664
  static struct scoreresult esc[MAX_EXOS];
638
  static struct scoreresult esc[MAX_EXOS];
665
  int i;
639
  int i;
666
  {FILE *f=fopen("../fichier_idiot","a");
-
 
667
 fprintf(f,"entre exam_depcheck deps=%s\n",deps);
-
 
668
fclose(f);}
-
 
669
  exam_currscore(exam);
640
  exam_currscore(exam);
670
  for(i=0;i<MAX_EXOS;i++) {
641
  for(i=0;i<MAX_EXOS;i++) {
671
    esc[i].require=esc[i].mean=10;
642
    esc[i].require=esc[i].mean=10;
672
    if(exam_scoredata[i]==-1000) esc[i].score=0;
643
    if(exam_scoredata[i]==-1000) esc[i].score=0;
673
    else esc[i].score=exam_scoredata[i];
644
    else esc[i].score=exam_scoredata[i];