--- capa/capa51/pProj/capaCgiUtils.c 1999/11/29 19:44:21 1.6 +++ capa/capa51/pProj/capaCgiUtils.c 1999/12/03 18:39:38 1.7 @@ -1038,7 +1038,7 @@ print_mainmenu(class,sn,pin)char *class; /*Termscore Button*/ if( outcome ) { fprintf(stdout,"
  • ",serverName,g_cgibin_path); + sprintf(buf,"action=\"http://%s/%s/%s/capasbin\">",serverName,g_cgibin_path,g_cowner); fprintf(stdout,"%s\n", buf); fprintf(stdout,"\n",class); fprintf(stdout,"\n",sn); @@ -2411,9 +2411,9 @@ FILE *out; float hw_w, qz_w, ex_w, fe_w, pc_w; int idx, entry_count, tmp_len; float *S, *F; - int *X; + int *X; /* array controlling whether to extrapolate scores */ char *capa_server; - int max_set[4]; + int max_set[4], width=600,height=750; /* width and height of applet*/ char **c_path_pp; /*Unused Vars @@ -2466,6 +2466,9 @@ FILE *out; return; } + + get_tscore_width_height(&width,&height); + c_path_pp = (char **)capa_malloc( 4, sizeof(char *)); tmp_len = strlen(class_fullpath) + 1; c_path_pp[0] = (char *)capa_malloc(tmp_len,sizeof(char)); @@ -2506,12 +2509,14 @@ FILE *out; c_path_pp[2] = (char *)capa_malloc( (tmp_len),sizeof(char)); sprintf(c_path_pp[2],"%s",buf); max_set[2] = check_class_get_maxset(c_path_pp[2]); + printf("\n",c_path_pp[2],max_set[2]); if( max_set[2] <= 0 ) { - /* should we continue ? */ - max_set[2] = 0; - for(idx=2;idx <= (fs*2); idx++) { + /* no sets */ + max_set[2] = 0; + } + /* start extrapolation with sets that don't yet exist */ + for(idx=2+(max_set[2]*2);idx <= (fs*2); idx++) { X[idx] = 1; - } } } else { /* if exam_path is not in capa.config, then skip exams */ fs = 0; @@ -2558,15 +2563,24 @@ FILE *out; term_score += set_score; capa_mfree(header.weight); capa_mfree(header.partial_credit); + printf("\n",c_path_pp[idx],set_score,valid_wgt); if(idx==2) { /* exam sets */ S[set_idx*2] = (float)set_score; F[set_idx*2] = (float)valid_wgt; - X[set_idx*2] = 0; + if (valid_wgt == 0) { + X[set_idx*2] = 1; + } else { + X[set_idx*2] = 0; + } } if(idx==3) { /* correction sets */ S[set_idx*2+1] = (float)set_score; F[set_idx*2+1] = (float)valid_wgt; - X[set_idx*2+1] = 0; + if (valid_wgt == 0 ) { + X[set_idx*2+1] = 1; + } else { + X[set_idx*2+1] = 0; + } } } if( (idx == 0) || (idx==1) ) { /* homeworks and quizzes */ @@ -2581,7 +2595,7 @@ FILE *out; fprintf(out,"
    \n"); - fprintf(out,"\n",capa_server); + fprintf(out,"\n",capa_server,width,height); fprintf(out,"\n", hw_w); fprintf(out,"\n", qz_w); fprintf(out,"\n", ex_w); @@ -2625,7 +2639,28 @@ FILE *out; capa_mfree((char *)capa_server); } - +int +get_tscore_width_height(width,height) +int *width;int *height; +{ + char buf[MAX_BUFFER_SIZE]; + int configResult; + + configResult=read_capa_config("tscore_width",buf); + if (configResult != 0 && configResult != -1 ) { + sscanf(buf,"%d", width); + if (*width <= 0 ) { *width = DEFAULT_WIDTH; } + } else { + printf("\n",configResult); + } + configResult=read_capa_config("tscore_height",buf); + if (configResult != 0 && configResult != -1 ) { + sscanf(buf,"%d", height); + if (*height <= 0 ) { *height = DEFAULT_HEIGHT; } + } else { + printf("\n",configResult); + } +} int get_termscore_params(hw,qw,ew,fw,pw,hc,qc,fs)