Subversion Repositories wimsdev

Rev

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

Rev 18421 Rev 18679
Line 74... Line 74...
74
     for (k = 0; k < cd->sheets[i].exocnt; k++, ed++)
74
     for (k = 0; k < cd->sheets[i].exocnt; k++, ed++)
75
       my_debug("[a: %i r: %f w:%f] ", ed->active, ed->require, ed->weight);
75
       my_debug("[a: %i r: %f w:%f] ", ed->active, ed->require, ed->weight);
76
     my_debug("\n");
76
     my_debug("\n");
77
   }
77
   }
78
 }
78
 }
79
 if (cd->exam.exocnt>0)
79
 if (cd->examcnt>0)
80
 {
80
 {
81
    ed = cd->exos + cd->exam.indstart;
81
    ed = cd->exos + cd->exam.indstart;
82
    my_debug("Examen: %i exercices\n", cd->exam.exocnt);
82
    my_debug("Examens: %i exercices\n", cd->exam.exocnt);
83
    for (k = 0; k < cd->exam.exocnt; k++, ed++)
83
    for (k = 0; k < cd->examcnt; k++, ed++){
84
       my_debug("[a: %i r: %f w:%f] ", ed->active, ed->require, ed->weight);
84
      my_debug("[a: %i r: %f w:%f] ", ed->active, ed->require, ed->weight);
85
     my_debug("\n");
85
      my_debug("%s",cd->ctbuf+cd->ctptr[k]);
-
 
86
    }
86
 }
87
 }
87
 else
88
 else
88
   my_debug("Pas d'examen\n");
89
   my_debug("Pas d'examen\n");
89
 my_debug("Fin de la classe\n");
90
 my_debug("Fin de la classe\n");
90
}
91
}
Line 146... Line 147...
146
   }
147
   }
147
    cd->sheetcnt=i;
148
    cd->sheetcnt=i;
148
  }
149
  }
149
  else {
150
  else {
150
  /* i: sheet, k: exo numero counted with multiplicity, l: tech version*/
151
  /* i: sheet, k: exo numero counted with multiplicity, l: tech version*/
151
    for (i=k=0,p1++; *p1; i++,p1=p2) {
152
    for (i=k=0,p1++; *p1; i++,p1=p2) {
152
      cd->sheets[i].indstart=k; /* numero of the first exo of the i sheet with multiplicity */
153
      cd->sheets[i].indstart=k; /* numero of the first exo of the i sheet with multiplicity */
153
      cd->sheets[i].start=cd->exocnt;
154
      cd->sheets[i].start=cd->exocnt;
154
      p2=strchr(p1,':'); if(p2) *p2++=0; else p2=p1+strlen(p1);
155
      p2=strchr(p1,':'); if(p2) *p2++=0; else p2=p1+strlen(p1);
155
      for (l=0; *p1; l++,p1=p3) {
156
      for (l=0; *p1; l++,p1=p3) {
156
        p3=strchr(p1,'\n'); if(p3) *p3++=0; else p3=p1+strlen(p1);
157
        p3=strchr(p1,'\n'); if(p3) *p3++=0; else p3=p1+strlen(p1);
Line 232... Line 233...
232
          }
233
          }
233
        }
234
        }
234
      }
235
      }
235
    }
236
    }
236
  }
237
  }
237
  //class_dump(cd);
-
 
238
  if(stat("exams/.exams",&st)==0) cd->modif=st.st_mtime; else return cd;
238
  if(stat("exams/.exams",&st)==0) cd->modif=st.st_mtime; else return cd;
239
  wlogdaccessfile(buf,"r","exams/.exams");
239
  wlogdaccessfile(buf,"r","exams/.exams");
240
  if(buf[0]==0) return cd;
240
  if(buf[0]==0) return cd;
241
  if(buf[0]==':') p1=buf-1; else p1=strstr(buf,"\n:");
241
  if(buf[0]==':') p1=buf-1; else p1=strstr(buf,"\n:");
242
  for(n=m=0,k=cd->exam.indstart; p1 && k<MAX_CLASSEXOS && m<MAX_EXAMS; p1=p2,m++,k++) {
242
  for(n=m=0,k=cd->exam.indstart; p1 && k<MAX_CLASSEXOS && m<MAX_EXAMS; p1=p2,m++,k++) {
Line 257... Line 257...
257
  }
257
  }
258
  cd->examcnt=m; // number of exos in all exams
258
  cd->examcnt=m; // number of exos in all exams
259
  cd->exocnt+=m; // number of all exos without multiplicity
259
  cd->exocnt+=m; // number of all exos without multiplicity
260
  cd->exam.exocnt=m;
260
  cd->exam.exocnt=m;
261
  cd->sheets[cd->sheetcnt]=cd->exam;
261
  cd->sheets[cd->sheetcnt]=cd->exam;
-
 
262
  //class_dump(cd);
262
  return cd;
263
  return cd;
263
}
264
}