#ifndef SHARED_GRADE_BOOK_DB_H
#define SHARED_GRADE_BOOK_DB_H 1
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <sqlite3.h>
#include "../global.h"
#include "../grade.h"

#include "shared_cs_util.h"
#include "shared_file_util.h"
#include "shared_survey_string.h"

extern SCALE_LIST *global_scale_list;
extern CATEGORY_LIST *global_cat_list;
extern ITEM_LIST *global_item_list;
extern LETTER_GRADE_LIST *global_letter_grades;
extern GRADE_LIST *global_grade_list;
extern GRADE_LIST *global_grade_temp_list;


int get_scales(CONFIG_STRUCT *conf, const char *db_name);
int get_categories(CONFIG_STRUCT *conf, const char *db_name);
int get_items(CONFIG_STRUCT *conf, const char *db_name, int desc);
int get_cat_members(CONFIG_STRUCT *conf, int cat_id, const char *db_name);

int get_one_item(CONFIG_STRUCT *conf, int item_id, const char *db_name);
int get_letter_grades(CONFIG_STRUCT *conf, int item_id, const char *db_name);
int get_current_grade_list(CONFIG_STRUCT *conf, int item_id, const char *mydb);
int get_user_score_logs(CONFIG_STRUCT *conf, int item_id, const char *username, const char *mydb);
int update_letter_log_list(CONFIG_STRUCT *conf,  int item_id, const char *mydb, GRADE_LIST *list);
int get_one_item_grade_list(CONFIG_STRUCT *conf, int item_id, const char *mydb);
int get_student_one_item_grade(CONFIG_STRUCT *conf, int item_id, const char *uesrname, const char *mydb);

#endif
