[LON-CAPA-cvs] cvs: loncom /homework/caparesponse caparesponse.c

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 23 Dec 2004 18:32:50 -0000


albertel		Thu Dec 23 13:32:50 2004 EDT

  Modified files:              
    /loncom/homework/caparesponse	caparesponse.c 
  Log:
  - stupid copy and paste variable clash stupidity
  
  
Index: loncom/homework/caparesponse/caparesponse.c
diff -u loncom/homework/caparesponse/caparesponse.c:1.14 loncom/homework/caparesponse/caparesponse.c:1.15
--- loncom/homework/caparesponse/caparesponse.c:1.14	Tue Nov 16 18:37:40 2004
+++ loncom/homework/caparesponse/caparesponse.c	Thu Dec 23 13:32:50 2004
@@ -1,6 +1,6 @@
 /* The LearningOnline Network with CAPA 
  * CAPA wrapper code
- * $Id: caparesponse.c,v 1.14 2004/11/16 23:37:40 albertel Exp $
+ * $Id: caparesponse.c,v 1.15 2004/12/23 18:32:50 albertel Exp $
  *
  * Copyright Michigan State University Board of Trustees
  *
@@ -130,7 +130,8 @@
   //double caparesponse_get_real_response (char* unit_str, char* answer) {
   int     input_len,all_alphabet,idx,outcome,result;
   double  n_part,scale=1.0,given,target;
-  char    input[ANSWER_STRING_LENG],filename[FILE_NAME_LENGTH];
+  char    input[ANSWER_STRING_LENG],filename[FILE_NAME_LENGTH],
+    tmp_unit_str[ANSWER_STRING_LENG];
   Unit_t *ans_unit;
   long    seed1,seed2;
   FILE   *fp;
@@ -155,10 +156,10 @@
     }
   }
   if( !all_alphabet ) {
-    outcome = split_num_unit(answer,&n_part,input,unit_str);
+    outcome = split_num_unit(answer,&n_part,input,tmp_unit_str);
     if( outcome > 1 ) { /* with both num and unit parts or only unit part */
       if( ans_unit != NULL ) {
-	result = check_correct_unit(unit_str,ans_unit,&scale);
+	result = check_correct_unit(tmp_unit_str,ans_unit,&scale);
       } else {
 	/* what to do when no unit is specified but student entered a unit? */
 	result = UNIT_NOTNEEDED;