version 1.16, 2000/09/14 20:20:45
|
version 1.17, 2000/10/24 22:17:19
|
Line 3019 capa_check_ans(ai,ans, error) AnswerInfo
|
Line 3019 capa_check_ans(ai,ans, error) AnswerInfo
|
for(idx=0;idx<ANSWER_STRING_LENG;idx++) choice[idx] = 0; |
for(idx=0;idx<ANSWER_STRING_LENG;idx++) choice[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(s[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(ans[ii]) - 'A'; |
if(choice[idx] != 1 ) result = INCORRECT; |
if(choice[idx] != 1 ) result = INCORRECT; |
} |
} |
} else { result = INCORRECT; } |
} else { result = INCORRECT; } |
Line 3374 Problem_t *p; char **answers; int cnt; c
|
Line 3374 Problem_t *p; char **answers; int cnt; c
|
for(ii=0;ii<cnt;ii++) outcomes[ii]=0; /* initialize the outcomes array */ |
for(ii=0;ii<cnt;ii++) outcomes[ii]=0; /* initialize the outcomes array */ |
outcomes[0] = capa_check_answer(p, answers[0], &errormsg[0]); |
outcomes[0] = capa_check_answer(p, answers[0], &errormsg[0]); |
#ifdef COMMON_DBUG |
#ifdef COMMON_DBUG |
fprintf(dfp,"CAPA_CHECK_ANSWER(%s,%s):: outcome[0]=%d\n", |
printf("CAPA_CHECK_ANSWER(%s,%s):: outcome[0]=%d\n", |
p->answer,answers[0],outcomes[0]); fflush(dfp); |
p->answer,answers[0],outcomes[0]); |
#endif |
#endif |
for(ii=1, ai = p->ans_list; ai; ii++,ai = ai->ans_next ) { |
for(ii=1, ai = p->ans_list; ai; ii++,ai = ai->ans_next ) { |
outcomes[ii] = capa_check_ans(ai,answers[ii],&(errormsg[ii])); |
outcomes[ii] = capa_check_ans(ai,answers[ii],&(errormsg[ii])); |
#ifdef COMMON_DBUG |
#ifdef COMMON_DBUG |
fprintf(dfp,"CAPA_CHECK_ANS(%s,%s): outcome[%d]=%d\n", ai->ans_str,answers[ii],ii,outcomes[ii]); fflush(dfp); |
printf("CAPA_CHECK_ANS(%s,%s): outcome[%d]=%d\n", ai->ans_str,answers[ii],ii,outcomes[ii]); |
#endif |
#endif |
} |
} |
done = ii = 0; |
done = ii = 0; |