Diff for /capa/capa51/pProj/capaCommon.c between versions 1.5 and 1.8

version 1.5, 2000/01/31 18:34:13 version 1.8, 2000/02/22 18:13:20
Line 569  int        set; Line 569  int        set;
    }     }
    funlockstream(fp); fclose(fp);     funlockstream(fp); fclose(fp);
    if(!found) {     if(!found) {
      ans_p = capa_malloc(nq+1,1);        ans_p = capa_malloc(nq+2,1); 
      tries_p = capa_malloc(3*nq+2,1); /* space and \0 */       tries_p = capa_malloc(3*nq+3,1); /* space and \0 */
      for(ii=0;ii<nq;ii++) { /* Initialize answer string and tries string */       for(ii=0;ii<nq;ii++) { /* Initialize answer string and tries string */
        ans_p[ii] = '-'; tries_p[3*ii] = ' '; tries_p[3*ii + 1] = '0';         ans_p[ii] = '-'; tries_p[3*ii] = ' '; tries_p[3*ii + 1] = '0';
        if(ii < nq-1) tries_p[3*ii + 2] = ',';         if(ii < nq-1) tries_p[3*ii + 2] = ',';
Line 585  int        set; Line 585  int        set;
      comma=index(oneline,',');       comma=index(oneline,',');
      length=((int)(comma-oneline))-(MAX_STUDENT_NUMBER+1);       length=((int)(comma-oneline))-(MAX_STUDENT_NUMBER+1);
      if (length < nq) {       if (length < nq) {
        ans_p = capa_malloc(nq+1,1);          ans_p = capa_malloc(nq+2,1); 
        tries_p = capa_malloc(3*nq+2,1); /* space and \0 */         tries_p = capa_malloc(3*nq+3,1); /* space and \0 */
      } else {       } else {
        ans_p = capa_malloc(length+1,1);          ans_p = capa_malloc(length+2,1); 
        tries_p = capa_malloc(3*length+2,1); /* space and \0 */         tries_p = capa_malloc(3*length+3,1); /* space and \0 */
      }       }
      sprintf(fmtbuf, "%%%dc",length);       sprintf(fmtbuf, "%%%dc",length);
      sscanf(oneline + MAX_STUDENT_NUMBER+1,fmtbuf,ans_p);       sscanf(oneline + MAX_STUDENT_NUMBER+1,fmtbuf,ans_p);
        ans_p[length]='\0';
      sprintf(fmtbuf, "%%%dc",(3*length-1));       sprintf(fmtbuf, "%%%dc",(3*length-1));
      sscanf(oneline + MAX_STUDENT_NUMBER+1+length+1,fmtbuf,tries_p);       sscanf(oneline + MAX_STUDENT_NUMBER+1+length+1,fmtbuf,tries_p);
        tries_p[3*length-1];
      entry->answers = ans_p;       entry->answers = ans_p;
      entry->tries   = tries_p;       entry->tries   = tries_p;
      entry->e_probs = nq;       entry->e_probs = nq;
Line 2998  capa_check_ans(ai,ans) AnswerInfo_t  *ai Line 3000  capa_check_ans(ai,ans) AnswerInfo_t  *ai
           result = check_formula_ans(s,ans,ai->ans_id_list,ai->ans_pts_list,tt,to);            result = check_formula_ans(s,ans,ai->ans_id_list,ai->ans_pts_list,tt,to);
           break;            break;
     case ANSWER_IS_EXTERNAL: /* Not yet implemented */      case ANSWER_IS_EXTERNAL: /* Not yet implemented */
             
           break;            break;
   }    }
   return (result);    return (result);
Line 3154  capa_check_answer(p, answer) Problem_t * Line 3157  capa_check_answer(p, answer) Problem_t *
          /* we assume the external program is called through popen() */           /* we assume the external program is called through popen() */
          /* and the result will be given back as 0 or 1 to indicate the */           /* and the result will be given back as 0 or 1 to indicate the */
          /* given answer is correct or not */           /* given answer is correct or not */
                     /* arguments are given to the program as */
   
           break;            break;
           
   }    }

Removed from v.1.5  
changed lines
  Added in v.1.8


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>