Diff for /capa/capa51/pProj/capaCgiUtils.c between versions 1.8 and 1.12

version 1.8, 1999/12/13 21:38:44 version 1.12, 2000/02/22 18:13:20
Line 425  void w_get_responses(int x,int q_idx,cha Line 425  void w_get_responses(int x,int q_idx,cha
   sa_p->a_idx  = sub_idx;    sa_p->a_idx  = sub_idx;
   sa_p->a_str  = strsave(g_entries[x].val);    sa_p->a_str  = strsave(g_entries[x].val);
   sa_p->a_next = NULL;    sa_p->a_next = NULL;
     trim_response_ws(sa_p->a_str);
   if( g_stu_ans_pp[q_idx] == NULL ) {    if( g_stu_ans_pp[q_idx] == NULL ) {
     g_stu_ans_pp[q_idx] = sa_p;      g_stu_ans_pp[q_idx] = sa_p;
   } else {     } else { 
Line 800  void        append_qtext(new_str) char * Line 801  void        append_qtext(new_str) char *
   len,g_qchar_cnt,g_qsize);    len,g_qchar_cnt,g_qsize);
   fflush(g_cgi);    fflush(g_cgi);
 #endif /* CGI_DBUG */      #endif /* CGI_DBUG */    
   if (g_qchar_cnt+len>g_qsize-1) {    if (g_qchar_cnt+len>g_qsize-2) {
     char *temp_text;      char *temp_text;
     g_qsize=(g_qchar_cnt+len)*2;      g_qsize=(g_qchar_cnt+len)*2;
     temp_text=capa_malloc(g_qsize,sizeof(char));      temp_text=capa_malloc(g_qsize,sizeof(char));
Line 814  void        append_qtext(new_str) char * Line 815  void        append_qtext(new_str) char *
   g_qchar_cnt += len;    g_qchar_cnt += len;
   g_question_txt[g_qchar_cnt+1]='\0';    g_question_txt[g_qchar_cnt+1]='\0';
 #ifdef CGI_DBUG  #ifdef CGI_DBUG
   fprintf(g_cgi,"after: len %d; g_qchar_cnt %d; g_qsize %d\n",len,g_qchar_cnt,g_qsize);    fprintf(g_cgi,"after: len %d; g_qchar_cnt %d; g_qsize %d; strlen(g_question_txt):%d\n",len,g_qchar_cnt,g_qsize,strlen(g_question_txt));
   fflush(g_cgi);    fflush(g_cgi);
 #endif /* CGI_DBUG */      #endif /* CGI_DBUG */    
 }  }
Line 828  void        append_stext(new_str) char * Line 829  void        append_stext(new_str) char *
   new_str,len,g_schar_cnt,g_ssize);    new_str,len,g_schar_cnt,g_ssize);
   fflush(g_cgi);    fflush(g_cgi);
 #endif /* CGI_DBUG */      #endif /* CGI_DBUG */    
   if (g_schar_cnt+len>g_ssize-1) {    if (g_schar_cnt+len>g_ssize-2) {
     char *temp_text;      char *temp_text;
     g_ssize=(g_schar_cnt+len)*2;      g_ssize=(g_schar_cnt+len)*2;
     temp_text=capa_malloc(g_ssize,sizeof(char));      temp_text=capa_malloc(g_ssize,sizeof(char));
Line 1062  print_page_header(mode,num_quest) int mo Line 1063  print_page_header(mode,num_quest) int mo
   char *serverName;    char *serverName;
   int    configResult,term_summary_button=1;    int    configResult,term_summary_button=1;
   
     buf[0]='\0';
     discussdir[0]='\0';
   serverName=getenv("SERVER_NAME");    serverName=getenv("SERVER_NAME");
   if (!serverName) {    if (!serverName) {
     fprintf(stdout,"Enviroment variable SERVER_NAME not set.\n");      fprintf(stdout,"Enviroment variable SERVER_NAME not set.\n");
Line 1405  char *class_dir; char *c_owner;char *cla Line 1408  char *class_dir; char *c_owner;char *cla
   
   if ( result != 0 ) {    if ( result != 0 ) {
      if( !g_passdue ) {       if( !g_passdue ) {
        append_qtext("<FORM method=\"post\" ");         append_qtext("<FORM NAME=\"CAPA\" method=\"post\" ");
        sprintf(buf,"action=\"http://%s/%s/%s/capasbin\">",serverName,         sprintf(buf,"action=\"http://%s/%s/%s/capasbin\">",serverName,
        g_cgibin_path,c_owner);         g_cgibin_path,c_owner);
        append_qtext(buf);         append_qtext(buf);
Line 2597  FILE *out; Line 2600  FILE *out;
   
       
   fprintf(out,"<CENTER>\n");    fprintf(out,"<CENTER>\n");
   fprintf(out,"<APPLET CODE=TScore.class CODEBASE=\"http://%s\" width=%d height=%d>\n",capa_server,width,height);    fprintf(out,"<APPLET CODE=TScore.class CODEBASE=\"http://%s/CAPA/\" width=%d height=%d>\n",capa_server,width,height);
   fprintf(out,"<PARAM NAME=\"HW_W\"  VALUE=\"%f\">\n", hw_w);    fprintf(out,"<PARAM NAME=\"HW_W\"  VALUE=\"%f\">\n", hw_w);
   fprintf(out,"<PARAM NAME=\"QZ_W\"  VALUE=\"%f\">\n", qz_w);    fprintf(out,"<PARAM NAME=\"QZ_W\"  VALUE=\"%f\">\n", qz_w);
   fprintf(out,"<PARAM NAME=\"EX_W\"  VALUE=\"%f\">\n", ex_w);    fprintf(out,"<PARAM NAME=\"EX_W\"  VALUE=\"%f\">\n", ex_w);
Line 2641  FILE *out; Line 2644  FILE *out;
   capa_mfree((char *)capa_server);    capa_mfree((char *)capa_server);
 }  }
   
 int  void
 get_tscore_width_height(width,height)   get_tscore_width_height(width,height) 
 int *width;int *height;  int *width;int *height;
 {  {

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


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