--- capa/capa51/pProj/capaCommon.c 2000/10/24 22:17:19 1.17 +++ capa/capa51/pProj/capaCommon.c 2002/06/26 17:26:09 1.21 @@ -1449,10 +1449,14 @@ void capa_get_due_date(char *date_str,T_ if ((duration > 0) && (student_number!=NULL)) { if (capa_get_login_time(student_number,set,&logintime)==1) { duetime=logintime+duration; - due_time_tm=localtime(&duetime); - sprintf(date_str,"%04d/%02d/%02d %02d:%02d",((due_time_tm->tm_year)+1900), - due_time_tm->tm_mon+1,due_time_tm->tm_mday,due_time_tm->tm_hour, - due_time_tm->tm_min); + if (compare_datetime(duetime,current->due_date)==-1) { + due_time_tm=localtime(&duetime); + sprintf(date_str,"%04d/%02d/%02d %02d:%02d",((due_time_tm->tm_year)+1900), + 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; } } @@ -2917,7 +2921,7 @@ capa_check_ans(ai,ans, error) AnswerInfo int sig, corr_len; int choice[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 given, target, ratio, fmted_target, target_u, target_l, scale=1.0; double delta; @@ -3016,14 +3020,18 @@ capa_check_ans(ai,ans, error) AnswerInfo { corr_len = strlen(s); input_len = strlen(ans); if( corr_len == input_len ) { - for(idx=0;idx tol ) { outcome = INCORRECT; } } @@ -3552,7 +3566,7 @@ char *key_word;char *value; } } if (c=='\n') found=1; - if (((char)c)==((char)EOF)) break; + if (((char)c)==((char)EOF)) {failed=1;break;} } } } while (!done && !failed);