--- capa/capa51/pProj/capaCgiUtils.c 1999/09/28 21:26:20 1.1 +++ capa/capa51/pProj/capaCgiUtils.c 1999/11/08 22:30:02 1.4 @@ -1067,7 +1067,7 @@ print_mainmenu(class,sn,pin)char *class; void print_page_header(mode,num_quest) int mode;int num_quest; { - char buf[MAX_BUFFER_SIZE]; + char buf[MAX_BUFFER_SIZE], discussdir[MAX_BUFFER_SIZE]; char *serverName; int configResult,term_summary_button=1; @@ -1206,6 +1206,20 @@ print_page_header(mode,num_quest) int mo fprintf(stdout,""); } + /*Discuss Button*/ + + sprintf(discussdir,"%s/discussion/%d",g_class_fullpath,g_login_set); + if ( access(discussdir,F_OK) == 0 ) { + fprintf(stdout,"
Answer %d of %d:\n",ii+1,p->ans_cnt,q_idx+1,ii+1); + } else { + sprintf(buf,"
Answer %d of %d:\n",ii+1,p->ans_cnt,q_idx+1,ii+1);
+ }
+ append_qtext(buf);
+ for(ii=1, ai=p->ans_list;ii Answer %d of %d:\n",ii+1,p->ans_cnt,q_idx+1,ii+1);
} else {
sprintf(buf," Answer %d of %d:\n",ii+1,p->ans_cnt,q_idx+1,ii+1);
}
@@ -2171,7 +2194,8 @@ char *class_dir;char *class;char *studen
set_score, /* Score on a set */
term_score=0, /* Total points received */
term_valid=0, /* Total points possible */
- result;
+ result,
+ tot_num_sets=0;
T_entry entry; /* Database entry for a set */
char buf[MAX_BUFFER_SIZE]; /* Output line buffer */
char buf2[MAX_BUFFER_SIZE]; /* Output line buffer */
@@ -2186,7 +2210,7 @@ char *class_dir;char *class;char *studen
fprintf(stdout,"Unable to complete actions.\n");
return;
}
-
+ printf("");
sprintf(class_fullpath,"%s/%s",class_dir,class);
chdir(class_fullpath);
configResult=read_capa_config("web_status_line_length",buf);
@@ -2207,9 +2231,18 @@ char *class_dir;char *class;char *studen
for (set_idx=1; set_idx<=set; set_idx++) {
g_inhibit_response=capa_check_option(OPTION_INHIBIT_RESPONSE,set_idx,
g_student_data.s_sec);
- if (g_inhibit_response > 0) continue;
+ if (g_inhibit_response > 0) {
+ printf("\n",set_idx);
+ continue;
+ }
+ if ( capa_check_date(CHECK_OPEN_DATE,g_student_number,
+ g_student_data.s_sec,set_idx) < 0 ){
+ printf("\n",set_idx);
+ continue;
+ }
if (capa_get_header(&header,set_idx)) return;
+ tot_num_sets++;
capa_get_entry(&entry,student_number,set_idx);
sscanf(header.num_questions,"%d", &(question_cnt) );
valid_wgt = 0; set_score = 0;
@@ -2253,7 +2286,11 @@ char *class_dir;char *class;char *studen
printf("\n\n
\n");
/* SHOW TOTALS */
/* if capalogin_show_summary_score is set to none don't show it */
- sprintf(buf,"%d sets, total = %3d/%3d (%d%%)\n", set, term_score, term_valid, 100*term_score/term_valid);
+ if (term_valid > 0) {
+ sprintf(buf,"%d sets, total = %3d/%3d (%d%%)\n", tot_num_sets, term_score, term_valid, 100*term_score/term_valid);
+ } else {
+ sprintf(buf,"%d sets, total = %3d/%3d\n", tot_num_sets, term_score, term_valid);
+ }
result=read_capa_config("capalogin_show_summary_score",buf2);
if (result != 0 && result != -1) {
if (strcasecmp(buf2,"none")==0) {
@@ -2369,27 +2406,28 @@ FILE *out;
i, /* Question counter */
set_score, /* Score on a set */
term_score=0, /* Total points received */
- term_valid=0, /* Total points possible */
- result;
+ term_valid=0; /* Total points possible */
T_entry entry; /* Database entry for a set */
char buf[MAX_BUFFER_SIZE]; /* Output line buffer */
- char buf2[MAX_BUFFER_SIZE]; /* Output line buffer */
T_header header; /* Problem set header */
- int question_cnt,valid_wgt, rate,configResult,
- status_line_length=DEFAULT_STATUS_LINE_LENGTH,row;
+ int question_cnt,valid_wgt,configResult;
char class_fullpath[ONE_K],*serverName;
int hw_c, hw_r, qz_c, qz_r, fs, homework_count, quiz_count;
- int ex_c, epc_c;
float hw_w, qz_w, ex_w, fe_w, pc_w;
int idx, entry_count, tmp_len;
float *S, *F;
int *X;
- char *capa_server, *qz_p, *ex_p, *epc_p;
+ char *capa_server;
int max_set[4];
char **c_path_pp;
-
-
-
+
+ /*Unused Vars
+ char buf2[MAX_BUFFER_SIZE];
+ char *qz_p, *ex_p, *epc_p;
+ int ex_c, epc_c, result;
+ int rate, status_line_length=DEFAULT_STATUS_LINE_LENGTH,row;
+ */
+
serverName=getenv("SERVER_NAME");
if (!serverName) {
fprintf(out,"Enviroment variable SERVER_NAME not set.\n");