version 1.27, 2005/12/20 19:59:57
|
version 1.30, 2024/04/27 16:36:30
|
Line 150 funlockstream(sp) FILE *sp;
|
Line 150 funlockstream(sp) FILE *sp;
|
|
|
int |
int |
inquery_a_lock(sp,cmd,type,offset,whence,len) |
inquery_a_lock(sp,cmd,type,offset,whence,len) |
FILE *sp;int cmd;off_t offset;int whence;off_t len; |
FILE *sp;int cmd;short int type;off_t offset;int whence;off_t len; |
{ |
{ |
struct flock lock; |
struct flock lock; |
int fd; |
int fd; |
Line 2936 capa_check_ans(ai,ans, error) AnswerInfo
|
Line 2936 capa_check_ans(ai,ans, error) AnswerInfo
|
int input_len, all_alphabet = 1, idx, ii, type; |
int input_len, all_alphabet = 1, idx, ii, type; |
int outcome=-1, result = INCORRECT; |
int outcome=-1, result = INCORRECT; |
int sig, corr_len; |
int sig, corr_len; |
int choice[ANSWER_STRING_LENG]; |
int choice[MAX_ASCII]; |
char num_str[ANSWER_STRING_LENG], unit_str[ANSWER_STRING_LENG]; |
char num_str[ANSWER_STRING_LENG], unit_str[ANSWER_STRING_LENG]; |
char fmted[ANSWER_STRING_LENG], correctans[ANSWER_STRING_LENG], answer[ANSWER_STRING_LENG]; |
char fmted[ANSWER_STRING_LENG], correctans[MAX_ASCII], answer[ANSWER_STRING_LENG]; |
double n_part; |
double n_part; |
double given, target, ratio, fmted_target, target_u, target_l, scale=1.0; |
double given, target, ratio, fmted_target, target_u, target_l, scale=1.0; |
double delta; |
double delta; |
Line 3040 capa_check_ans(ai,ans, error) AnswerInfo
|
Line 3040 capa_check_ans(ai,ans, error) AnswerInfo
|
{ |
{ |
corr_len = strlen(s); input_len = strlen(ans); |
corr_len = strlen(s); input_len = strlen(ans); |
if( corr_len == input_len ) { |
if( corr_len == input_len ) { |
for(idx=0;idx<ANSWER_STRING_LENG;idx++) { |
for(idx=0;idx<MAX_ASCII;idx++) { |
choice[idx] = 0;correctans[idx] = 0; |
choice[idx] = 0;correctans[idx] = 0; |
} |
} |
result = EXACT_ANS; |
result = EXACT_ANS; |
for(ii=0;ii<corr_len; ii++) { |
for(ii=0;ii<corr_len; ii++) { |
idx = toupper(s[ii]) - 'A'; choice[idx] = 1; |
idx = toupper(s[ii]); choice[idx] = 1; |
} |
} |
for(ii=0;ii<input_len;ii++) { |
for(ii=0;ii<input_len;ii++) { |
idx = toupper(ans[ii]) - 'A'; correctans[idx] = 1; |
idx = toupper(ans[ii]); correctans[idx] = 1; |
} |
} |
for(ii=0;ii<ANSWER_STRING_LENG;ii++) { |
for(ii=0;ii<MAX_ASCII;ii++) { |
if(choice[ii] != correctans[ii] ) result = INCORRECT; |
if(choice[ii] != correctans[ii] ) result = INCORRECT; |
} |
} |
} else { result = INCORRECT; } |
} else { result = INCORRECT; } |
Line 3101 capa_check_answer(p, answer, error) Prob
|
Line 3101 capa_check_answer(p, answer, error) Prob
|
int sig_l; |
int sig_l; |
int sig_u; |
int sig_u; |
char *fmt; |
char *fmt; |
int choice[ANSWER_STRING_LENG], correctans[ANSWER_STRING_LENG]; |
int choice[MAX_ASCII], correctans[MAX_ASCII]; |
int ii, idx, corr_len, input_len; |
int ii, idx, corr_len, input_len; |
int result = INCORRECT, sig, outcome=-1, all_alphabet; |
int result = INCORRECT, sig, outcome=-1, all_alphabet; |
char fmted[FORMAT_STRING_LENG]; |
char fmted[FORMAT_STRING_LENG]; |
Line 3209 capa_check_answer(p, answer, error) Prob
|
Line 3209 capa_check_answer(p, answer, error) Prob
|
{ |
{ |
corr_len = strlen(correct); input_len = strlen(answer); |
corr_len = strlen(correct); input_len = strlen(answer); |
if( corr_len == input_len ) { |
if( corr_len == input_len ) { |
for(idx=0;idx<ANSWER_STRING_LENG;idx++) { |
for(idx=0;idx<MAX_ASCII;idx++) { |
choice[idx] = 0;correctans[idx] = 0; |
choice[idx] = 0;correctans[idx] = 0; |
} |
} |
result = EXACT_ANS; |
result = EXACT_ANS; |
for(ii=0;ii<corr_len; ii++) { |
for(ii=0;ii<corr_len; ii++) { |
idx = toupper(correct[ii]) - 'A'; choice[idx] = 1; |
idx = toupper(correct[ii]); choice[idx] = 1; |
} |
} |
for(ii=0;ii<input_len;ii++) { |
for(ii=0;ii<input_len;ii++) { |
idx = toupper(answer[ii]) - 'A'; correctans[idx] = 1; |
idx = toupper(answer[ii]); correctans[idx] = 1; |
} |
} |
for(ii=0;ii<ANSWER_STRING_LENG;ii++) { |
for(ii=0;ii<MAX_ASCII;ii++) { |
if(choice[ii] != correctans[ii] ) result = INCORRECT; |
if(choice[ii] != correctans[ii] ) result = INCORRECT; |
} |
} |
} else { result = INCORRECT; } |
} else { result = INCORRECT; } |
break; |
break; |
Line 3311 char *fml_str;char *input_str;char *var_
|
Line 3311 char *fml_str;char *input_str;char *var_
|
outcome = BAD_FORMULA; |
outcome = BAD_FORMULA; |
break; |
break; |
} |
} |
|
if (outcome != APPROX_ANS) { |
|
break; |
|
} |
} |
} |
capa_mfree((char *)check_fml_str); |
capa_mfree((char *)check_fml_str); |
|
|