-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfile_io.h
More file actions
53 lines (45 loc) · 1.63 KB
/
file_io.h
File metadata and controls
53 lines (45 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef FILE_IO_H
#define FILE_IO_H
#include "database.h"
/**
* @brief 将所有题目导出到 timu.txt 文件
* @param filename 输出文件名(通常为 "timu.txt")
* @return 成功返回 1,失败返回 0
*/
int exportQuestionsToFile(const char* filename);
/**
* @brief 将所有学生成绩导出到 stu.txt 文件
* @param filename 输出文件名(通常为 "stu.txt")
* @return 成功返回 1,失败返回 0
*/
int exportGradesToFile(const char* filename);
/**
* @brief 将按成绩排序的结果导出到 sort1.txt 文件
* @param filename 输出文件名(通常为 "sort1.txt")
* @return 成功返回 1,失败返回 0
*/
int exportGradesByScoreToFile(const char* filename);
/**
* @brief 将按班级排序的结果导出到 sort2.txt 文件
* @param filename 输出文件名(通常为 "sort2.txt")
* @return 成功返回 1,失败返回 0
*/
int exportGradesByClassToFile(const char* filename);
/**
* @brief 将学生答题记录追加到 stu.txt 文件
* @param student_uuid 学生 UUID
* @param student_name 学生姓名
* @param class_name 班级名称
* @param student_num 学号
* @param total_score 总分
* @return 成功返回 1,失败返回 0
*/
int addStuGradeToFile(const char* filename, const char* student_uuid,
const char* student_name, const char* class_name,
int student_num, int total_score);
/* 将单次答题的每道题及学生答案追加到 stu.txt (包含正确答案) */
int addStuAnsToFile(const char* filename, const char* student_name,
const char* class_name, int student_num,
int question_count, const char** questions,
const char** user_answers, const char** correct_answers);
#endif /* FILE_IO_H */