#ifndef SHARED_HOTPOT_PARSER_H
#define SHARED_HOTPOT_PARSER_H

#define MAX_TEXT 2000    /* the length of the text between tags cannot be longer than this */


#define MAX_HOTPOT_CHOICES 62   /* max len of following string */
extern char hotpot_answer_letters[MAX_HOTPOT_CHOICES + 1];

typedef enum {JBC, JQZ, JQZ6, UNKNOWN_QUIZ} QUIZ_TYPE;   /** JBC is original HOPOT 5 jbc multi-choice format
                                                         *** JQZ is original HOTPOT 5 jqz short answer
                                                         *** JQZ6 is HOTPOT 6 jqz which can mix short answer
                                                         ***      and multi-choice questions
                                                         **/
                                                         



typedef enum  {MC, SHORT, MC_MULTI, UNKNOWN_QUESTION_TYPE}  QUESTION_TYPE;   
                                                     /* MC is multiple choice - HOTPOT 6 type 1
                                                     ** SHORT is short answer - HOTPOT 6 type 2
                                                     ** MC-MULTI is multi-select (user must select
                                                     **  all of the correct answers in a multiple-
                                                     **  choice question)        HOTPOT 6 type 4
                                                     **
                                                     ** HOTPOT 6 Hybrid questions (type 3) are 
                                                     ** converted to either MC or SHORT on-the-fly
                                                     **/
                                                        
                                                        

typedef struct answer_node
 {
  char *answer;
  int is_correct;
  char *feedback;
  struct answer_node *next;
}  ANSWER_NODE;
  

typedef struct question_node
 {
  QUESTION_TYPE question_type;
  char *question;

  char *response;       /* as entered by the person taking the exam */
  char *correct_answer_string;   /* for MC and MC_MULTI_QUESTIONS */
  int answer_correct;            /* did the student get this answer correct? */
  
  int correct_answer_count;      /* how many of the answers to the original test were marked 'correct'? */
  int answer_count;              /* how many answers are there for this question? */
  ANSWER_NODE *head;
  ANSWER_NODE *last_answer;
  struct question_node *next;
 } QUESTION_NODE;



typedef struct quiz_data
 {
  QUIZ_TYPE type;
  char *version;
  char *title;
  char *sub_title;
  char *instructions;  
  int case_sensitive;
  char *pg_bg_color;
  char *title_color;
  char *text_color;
  char *link_color;
  char *vlink_color;
  char *ex_bg_color;
  char *font_face;
  QUESTION_NODE *head;
  QUESTION_NODE *last_question;
 }QUIZ_DATA;  


extern QUIZ_DATA quiz_data;
extern char stored_text[MAX_TEXT];



typedef enum {TITLE,INSTRUCTIONS, EXERCISE_SUBTITLE, QUESTION,
              MUST_SELECT_ALL, TEXT, CORRECT, FEEDBACK, 
              PG_BG_COLOR, EX_BG_COLOR,TITLE_COLOR, TEXT_COLOR, LINK_COLOR, VLINK_COLOR,
              FONT_FACE, CASE_SENSITIVE, JBC_QUIZ, JQZ_QUIZ, HOTPOT_VERSION, 
              QUES_TYPE, INCLUDE_IN_MC_OPTIONS, UNUSED} TAGS;



void free_quiz_data();
int parse_hotpot_file(const char *path);




#endif
