db.h

text/plain

Filename: db.h
Type: text/plain
Part: 2
Message: PostgreSQL program question.
/******* Answer Structure *******/
struct _answerStruct {
   char * text;              //text of answer 
   int answer;               //answer 1 - true, 0 - false
};

typedef struct _answerStruct answerStruct;

/******* Question Structure *******/
struct _questionStruct {
   int id;		    //question's identification
   char * text;             //text of question
   char * question;         //question
   int bonus;               //question's bonus
   int numAnswers;          //number of answers
   answerStruct * answers;  //answers
};

typedef struct _questionStruct questionStruct;

/******* _testStruct *******/
struct _testStruct {
   int id;                 //indentification of test
   int testNum;            //number of test 
   char * Description;     //test's description
};

typedef struct _testStruct testStruct;

/******* Functions *******/
testStruct * getAllowTest(const char * loginName, int * num);

questionStruct * getQuestion(const int idTest, int * num);

void writeResult(const int idTest, const char * loginName, const int result);