Annotation of loncom/homework/CAPA-converter/convert.c, revision 1.1
1.1 ! albertel 1: /* ======================================================================== */
! 2: /* Feb. 10 1997 Isaac Tsai */
! 3: /* ======================================================================== */
! 4:
! 5: #ifdef NeXT
! 6: #include <stdlib.h>
! 7: #include <sys/types.h>
! 8: #include <sys/stat.h>
! 9: #include <bsd/curses.h>
! 10: #else
! 11: #include <curses.h>
! 12: #include <malloc.h>
! 13: double atof();
! 14: #endif
! 15:
! 16: #include <stdio.h>
! 17: #include <ctype.h>
! 18: #include <sys/types.h>
! 19: #include <sys/stat.h>
! 20: #include <signal.h>
! 21: #include <time.h>
! 22: #include <math.h>
! 23: #include <string.h>
! 24:
! 25:
! 26: #define YES 1
! 27:
! 28: #include "capaCommon.h"
! 29:
! 30: char *progname;
! 31:
! 32:
! 33: void
! 34: print_answer(FILE *o_fp,int ans_cnt,char *ans,char *lower,char *upper,char *unit)
! 35: {
! 36: if (unit && (strlen(unit)>0))
! 37: if(ans_cnt==2) fprintf(o_fp,"ANS:%s %s %s %s\n",ans,lower,upper,unit);
! 38: else fprintf(o_fp,"ANS:%s %s\n",lower,unit);
! 39: else
! 40: if(ans_cnt==2) fprintf(o_fp,"ANS:%s %s %s\n",ans,lower,upper);
! 41: else fprintf(o_fp,"ANS:%s\n",lower);
! 42: }
! 43:
! 44: void print_question (FILE *o_fp,char *question)
! 45: {
! 46: fprintf(o_fp,"BQES:\n%s\nEQES:\n",question);
! 47: }
! 48:
! 49: int main (int argc, char **argv)
! 50: {
! 51: extern int Parsemode_f;
! 52: extern int managermode;
! 53:
! 54: Problem_t *first_prob,*p;
! 55: int q_cnt, num_answers, result, setIdx = 1, q_idx;
! 56: char lower[ANSWER_STRING_LENG], upper[ANSWER_STRING_LENG];
! 57: int StartSet = 1, EndSet = 1;
! 58: char tmp_str[ANSWER_STRING_LENG];
! 59: double tmp_ans;
! 60: T_student a_student;
! 61:
! 62: Parsemode_f=ASCII_MODE;
! 63: if ( argc > 3 || argc < 2 ) {
! 64: printf("USAGE: %s filename\n",
! 65: argv[0]);
! 66: exit(-1);
! 67: }
! 68:
! 69: result = capa_parse(setIdx, &first_prob, argv[1] ,&q_cnt,NULL);
! 70:
! 71: return (0);
! 72: }
! 73:
! 74:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>