version 1.2, 2000/09/11 21:30:16
|
version 1.5, 2000/11/29 00:29:43
|
Line 10 int caparesponse_capa_check_answer(char
|
Line 10 int caparesponse_capa_check_answer(char
|
char *error=NULL,filename[FILE_NAME_LENGTH]; |
char *error=NULL,filename[FILE_NAME_LENGTH]; |
FILE *fp; |
FILE *fp; |
|
|
|
printf("hi in caparesponse\n"); |
/*need to initialize unit parser*/ |
/*need to initialize unit parser*/ |
sprintf(filename,"/home/httpd/html/res/adm/include/capa.units"); |
sprintf(filename,"/home/httpd/html/res/adm/includes/capa.units"); |
if ((fp=fopen(filename,"r"))==NULL) { |
if ((fp=fopen(filename,"r"))==NULL) { |
/* printf("Error: can't open %s\n",filename);*/ |
/* printf("Error: can't open %s\n",filename);*/ |
return (-1); |
return (-1); |
Line 26 int caparesponse_capa_check_answer(char
|
Line 27 int caparesponse_capa_check_answer(char
|
p.sig_lbound = sig_lbound; |
p.sig_lbound = sig_lbound; |
p.sig_ubound = sig_ubound; |
p.sig_ubound = sig_ubound; |
strncpy(p.ans_fmt,ans_fmt,ANSWER_STRING_LENG-1); |
strncpy(p.ans_fmt,ans_fmt,ANSWER_STRING_LENG-1); |
strncpy(p.unit_str,unit_str,ANSWER_STRING_LENG-1); |
if (unit_str[0]!='\0') { |
p.ans_unit = u_parse_unit(unit_str); |
strncpy(p.unit_str,unit_str,ANSWER_STRING_LENG-1); |
|
p.ans_unit = u_parse_unit(unit_str); |
|
} else { |
|
p.unit_str[0]='\0'; |
|
p.ans_unit=NULL; |
|
} |
p.calc = calc; |
p.calc = calc; |
|
|
/* assign_id_list and assign_pts_list exist in capaGrammerDef.y */ |
/* assign_id_list and assign_pts_list exist in capaGrammerDef.y */ |
p.id_list=NULL; |
p.id_list=NULL; |
p.pts_list=NULL; |
p.pts_list=NULL; |
|
|
|
|
result=capa_check_answer(&p,response,&error); |
result=capa_check_answer(&p,response,&error); |
|
|
if (error!=NULL) {free(error);} |
if (error!=NULL) {free(error);} |