-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
78 lines (70 loc) · 1.9 KB
/
Copy pathtypes.ts
File metadata and controls
78 lines (70 loc) · 1.9 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// FIX: Added 'Page' type to fix navigation-related type errors.
export type Page = 'home' | 'challenge' | 'profile';
export interface User {
id: number;
username: string;
email: string;
password?: string; // Should not be stored long-term in a real app
xp: number;
coins: number;
streak: number;
lastLoginDate: string | null;
completedLessons: number[];
// FIX: Added 'currentChallengeId' and 'completedChallenges' to track user progress in challenges.
currentChallengeId: number;
completedChallenges: number[];
completedCodingQuizzes: number[];
}
// FIX: Added 'Challenge' interface to define the shape of challenge objects.
export interface Challenge {
id: number;
level: number;
title: string;
description: string;
starterCode: string;
expectedOutput: string;
xpAward: number;
coinAward: number;
}
export interface QuizQuestion {
question: string;
options: string[];
correctAnswerIndex: number;
code?: string;
}
export interface Lesson {
id: number;
title: string;
category: 'Procedural Programming' | 'Object-Oriented Programming' | 'GUI Programming';
theory: string;
quiz: QuizQuestion[];
xpAward: number;
coinAward: number;
}
export interface ChatMessage {
sender: 'user' | 'bot';
text: string;
}
export interface TestCase {
input: string; // e.g., '5', '"hello"', '[1, 2, 3]'
expectedOutput: string;
}
export interface CodingQuiz {
id: number;
title: string;
description: string;
difficulty: 'Easy' | 'Medium' | 'Difficult';
starterCode: string;
// A template for how to call the user's function with the test case input
testHarness: (input: string) => string;
testCases: TestCase[];
hint: string;
xpAward: number;
coinAward: number;
}
export interface Tutorial {
id: number;
title: string;
videoId: string; // The YouTube video ID
category: 'Python Basics for Beginners' | 'Data Structures' | 'Object-Oriented Programming';
}