--- capa/capa51/pProj/capaCommon.c 1999/09/28 21:26:21 1.1.1.1 +++ capa/capa51/pProj/capaCommon.c 1999/10/13 18:45:28 1.2 @@ -46,8 +46,6 @@ capa_excuse(int set,int prob,int secti /* Calculate parameters */ if (capa_get_header(&header,set)) return (-1); sscanf(header.num_questions,"%d", &nq); - capa_mfree(header.weight); - capa_mfree(header.partial_credit); if( ( prob > nq ) || (section < 0 ) || (section > MAX_SECTION_COUNT) ) return (-1); num_students= 0; @@ -57,15 +55,24 @@ capa_excuse(int set,int prob,int secti offset = capa_get_entry(&entry,tmp_number,set); if(offset < 0 ) offset = -offset; switch(entry.answers[prob-1]) { + case '0': case '-': entry.answers[prob-1] = 'E'; break; case 'N': entry.answers[prob-1] = 'E'; break; case 'n': entry.answers[prob-1] = 'e'; break; + case '1': case '2': case '3': case '4': case '5': + case '6': case '7': case '8': case '9': + if (entry.answers[prob-1] < header.weight[prob-1]) { + entry.answers[prob-1] = 'E'; + } + break; default : break; } capa_set_entry(&entry,tmp_number,set,offset); capa_mfree(entry.answers); entry.answers = NULL; capa_mfree(entry.tries); entry.tries = NULL; } + capa_mfree(header.weight); + capa_mfree(header.partial_credit); free_students(student_p); return (0); }