version 1.16, 2000/09/14 20:20:45
|
version 1.19, 2001/01/29 23:25:22
|
Line 1449 void capa_get_due_date(char *date_str,T_
|
Line 1449 void capa_get_due_date(char *date_str,T_
|
if ((duration > 0) && (student_number!=NULL)) { |
if ((duration > 0) && (student_number!=NULL)) { |
if (capa_get_login_time(student_number,set,&logintime)==1) { |
if (capa_get_login_time(student_number,set,&logintime)==1) { |
duetime=logintime+duration; |
duetime=logintime+duration; |
due_time_tm=localtime(&duetime); |
if (compare_datetime(duetime,current->due_date)==-1) { |
sprintf(date_str,"%04d/%02d/%02d %02d:%02d",((due_time_tm->tm_year)+1900), |
due_time_tm=localtime(&duetime); |
due_time_tm->tm_mon+1,due_time_tm->tm_mday,due_time_tm->tm_hour, |
sprintf(date_str,"%04d/%02d/%02d %02d:%02d",((due_time_tm->tm_year)+1900), |
due_time_tm->tm_min); |
due_time_tm->tm_mon+1,due_time_tm->tm_mday,due_time_tm->tm_hour, |
|
due_time_tm->tm_min); |
|
} else { |
|
strncpy(date_str,current->due_date,DATE_BUFFER); |
|
} |
return; |
return; |
} |
} |
} |
} |
Line 3019 capa_check_ans(ai,ans, error) AnswerInfo
|
Line 3023 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 3378 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; |
Line 3552 char *key_word;char *value;
|
Line 3556 char *key_word;char *value;
|
} |
} |
} |
} |
if (c=='\n') found=1; |
if (c=='\n') found=1; |
if (((char)c)==((char)EOF)) break; |
if (((char)c)==((char)EOF)) {failed=1;break;} |
} |
} |
} |
} |
} while (!done && !failed); |
} while (!done && !failed); |