version 1.1, 1999/09/28 21:26:21
|
version 1.3, 1999/12/01 18:22:00
|
Line 46 capa_excuse(int set,int prob,int secti
|
Line 46 capa_excuse(int set,int prob,int secti
|
/* Calculate parameters */ |
/* Calculate parameters */ |
if (capa_get_header(&header,set)) return (-1); |
if (capa_get_header(&header,set)) return (-1); |
sscanf(header.num_questions,"%d", &nq); |
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); |
if( ( prob > nq ) || (section < 0 ) || (section > MAX_SECTION_COUNT) ) return (-1); |
num_students= 0; |
num_students= 0; |
Line 57 capa_excuse(int set,int prob,int secti
|
Line 55 capa_excuse(int set,int prob,int secti
|
offset = capa_get_entry(&entry,tmp_number,set); |
offset = capa_get_entry(&entry,tmp_number,set); |
if(offset < 0 ) offset = -offset; |
if(offset < 0 ) offset = -offset; |
switch(entry.answers[prob-1]) { |
switch(entry.answers[prob-1]) { |
|
case '0': |
case '-': entry.answers[prob-1] = 'E'; break; |
case '-': entry.answers[prob-1] = 'E'; break; |
case 'N': entry.answers[prob-1] = 'E'; break; |
case 'N': 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; |
default : break; |
} |
} |
capa_set_entry(&entry,tmp_number,set,offset); |
capa_set_entry(&entry,tmp_number,set,offset); |
capa_mfree(entry.answers); entry.answers = NULL; |
capa_mfree(entry.answers); entry.answers = NULL; |
capa_mfree(entry.tries); entry.tries = NULL; |
capa_mfree(entry.tries); entry.tries = NULL; |
} |
} |
|
capa_mfree(header.weight); |
|
capa_mfree(header.partial_credit); |
free_students(student_p); |
free_students(student_p); |
return (0); |
return (0); |
} |
} |
Line 1350 int capa_check_option(int option,int set
|
Line 1357 int capa_check_option(int option,int set
|
} |
} |
|
|
/*----------------------------------------------------------*/ |
/*----------------------------------------------------------*/ |
/* INPUT: set the X in logX.db */ |
/* INPUT: time the current time */ |
|
/* datetime the datetime string to compare */ |
/* OUTPUT: none */ |
/* OUTPUT: none */ |
/* */ |
/* */ |
/* RETURN: -1 file error */ |
/* RETURN: -1 time is earlier then datetime */ |
/* 0 no login */ |
/* 1 time is later than datetime */ |
/* >0 number of logins in that logX.db file */ |
|
/*----------------------------------------------------------*/ |
/*----------------------------------------------------------*/ |
int |
int |
compare_datetime(time,datetime) |
compare_datetime(time,datetime) |
Line 1384 char *datetime;
|
Line 1391 char *datetime;
|
/* What if: [7,3] date_info */ |
/* What if: [7,3] date_info */ |
/* [3,7] date_info */ |
/* [3,7] date_info */ |
/* 4 date_info */ |
/* 4 date_info */ |
|
/* RETURN: -1 if not pass time */ |
|
/* 1 if pass time (or no time available */ |
int capa_check_date(int which,char *student_number, int section,int set) |
int capa_check_date(int which,char *student_number, int section,int set) |
{ |
{ |
int result; |
int result; |