lib/zen/src/quiz/model.zig
daab053ee43316e1809a84551d573ddd1e5bf3d2
1 pub const Option = struct {
2 text: []const u8,
3 correct: bool,
4 };
5
6 pub const Question = struct {
7 prompt: []const u8,
8 options: []const Option,
9 explanation: []const u8,
10 };
11
12 pub const Quiz = struct {
13 questions: []const Question,
14 };
15
16 pub const ParseError = error{InvalidQuizDirective};
17
18 pub const Exhaustion = error{
19 QuestionCapacityExceeded,
20 OptionCapacityExceeded,
21 JoinedTextByteCapacityExceeded,
22 QuizStorageInUse,
23 };
24
25 pub const Error = ParseError || Exhaustion || error{CapacityOverflow};