version 1.19, 2001/01/29 23:25:22
|
version 1.21, 2002/06/26 17:26:09
|
Line 2921 capa_check_ans(ai,ans, error) AnswerInfo
|
Line 2921 capa_check_ans(ai,ans, error) AnswerInfo
|
int sig, corr_len; |
int sig, corr_len; |
int choice[ANSWER_STRING_LENG]; |
int choice[ANSWER_STRING_LENG]; |
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], correct[ANSWER_STRING_LENG], answer[ANSWER_STRING_LENG]; |
char fmted[ANSWER_STRING_LENG], correctans[ANSWER_STRING_LENG], 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 3020 capa_check_ans(ai,ans, error) AnswerInfo
|
Line 3020 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++) choice[idx] = 0; |
for(idx=0;idx<ANSWER_STRING_LENG;idx++) { |
|
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]) - 'A'; choice[idx] = 1; |
} |
} |
for(ii=0;ii<input_len;ii++) { |
for(ii=0;ii<input_len;ii++) { |
idx = toupper(ans[ii]) - 'A'; |
idx = toupper(ans[ii]) - 'A'; correctans[idx] = 1; |
if(choice[idx] != 1 ) result = INCORRECT; |
} |
|
for(ii=0;ii<ANSWER_STRING_LENG;ii++) { |
|
if(choice[ii] != correctans[ii] ) result = INCORRECT; |
} |
} |
} else { result = INCORRECT; } |
} else { result = INCORRECT; } |
break; |
break; |
Line 3077 capa_check_answer(p, answer, error) Prob
|
Line 3081 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], ii, idx, corr_len, input_len; |
int choice[ANSWER_STRING_LENG], correctans[ANSWER_STRING_LENG]; |
|
int ii, idx, corr_len, input_len; |
int result = INCORRECT, sig, outcome, all_alphabet; |
int result = INCORRECT, sig, outcome, all_alphabet; |
char fmted[FORMAT_STRING_LENG]; |
char fmted[FORMAT_STRING_LENG]; |
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; |
Line 3181 capa_check_answer(p, answer, error) Prob
|
Line 3186 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(ii=0;ii<ANSWER_STRING_LENG;ii++) choice[ii] = 0; result = EXACT_ANS; |
for(idx=0;idx<ANSWER_STRING_LENG;idx++) { |
|
choice[idx] = 0;correctans[idx] = 0; |
|
} |
|
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]) - 'A'; choice[idx] = 1; |
} |
} |
for(ii=0;ii<input_len;ii++) { |
for(ii=0;ii<input_len;ii++) { |
idx = toupper(answer[ii]) - 'A'; |
idx = toupper(answer[ii]) - 'A'; correctans[idx] = 1; |
if(choice[idx] != 1 ) result = INCORRECT; |
} |
|
for(ii=0;ii<ANSWER_STRING_LENG;ii++) { |
|
if(choice[ii] != correctans[ii] ) result = INCORRECT; |
} |
} |
} else { result = INCORRECT; } |
} else { result = INCORRECT; } |
break; |
break; |
Line 3252 char *fml_str;char *input_str;char *var_
|
Line 3262 char *fml_str;char *input_str;char *var_
|
} |
} |
} else { |
} else { |
diff = abs(1.0 - formula_val) * 100.0 ; |
diff = abs(1.0 - formula_val) * 100.0 ; |
if( diff < tol ) { |
if( diff > tol ) { |
outcome = INCORRECT; |
outcome = INCORRECT; |
} |
} |
} |
} |