[LON-CAPA-cvs] cvs: loncom /homework/caparesponse caparesponse.c
albertel
lon-capa-cvs@mail.lon-capa.org
Mon, 07 Nov 2005 23:37:39 -0000
albertel Mon Nov 7 18:37:39 2005 EDT
Modified files:
/loncom/homework/caparesponse caparesponse.c
Log:
BUG#4444
Index: loncom/homework/caparesponse/caparesponse.c
diff -u loncom/homework/caparesponse/caparesponse.c:1.17 loncom/homework/caparesponse/caparesponse.c:1.18
--- loncom/homework/caparesponse/caparesponse.c:1.17 Tue Feb 15 17:15:05 2005
+++ loncom/homework/caparesponse/caparesponse.c Mon Nov 7 18:37:39 2005
@@ -1,6 +1,6 @@
/* The LearningOnline Network with CAPA
* CAPA wrapper code
- * $Id: caparesponse.c,v 1.17 2005/02/15 22:15:05 albertel Exp $
+ * $Id: caparesponse.c,v 1.18 2005/11/07 23:37:39 albertel Exp $
*
* Copyright Michigan State University Board of Trustees
*
@@ -34,7 +34,7 @@
int done=0;
/*fprintf(stderr,"ids %s\n",id_list);
fprintf(stderr,"pts %s\n",pts_list);*/
- while (!done) {
+ while (!done && pts_list) {
int idx;
/*fprintf(stderr,"pts; %s\n",idx_pts);*/
new=gen_ptslist_str(idx_pts);
@@ -97,6 +97,9 @@
if (type == ANSWER_IS_FORMULA) {
p.id_list=id_list;
p.pts_list=parse_pts_list(pts_list);
+ if ( p.id_list == NULL || p.pts_list == NULL) {
+ return BAD_FORMULA;
+ }
}
p.ans_type = type;
p.answer = correct;