-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
116 lines (100 loc) · 2.22 KB
/
Copy pathtypes.ts
File metadata and controls
116 lines (100 loc) · 2.22 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
export enum Language {
Python = 'Python',
Java = 'Java',
CPP = 'C++',
C = 'C',
}
export interface Topic {
id: string;
title: string;
category: string;
type: 'lesson' | 'practice';
problemSubCategory?: string;
}
export interface PracticeProblem {
id: string;
title: string;
difficulty: 'Easy' | 'Medium' | 'Hard';
category: string;
subCategory: string;
description: string;
}
export interface ChatMessage {
sender: 'user' | 'ai';
text: string;
visualization?: VisualizationData;
}
export interface MCQOption {
text: string;
isCorrect: boolean;
}
export interface MCQQuestion {
question: string;
options: MCQOption[];
explanation: string;
}
export interface ConceptualQuestion {
question: string;
answer: string;
}
export interface ProblemSolvingTask {
problem: string;
solution: string;
}
export interface Quiz {
mcqs: MCQQuestion[];
conceptualQuestions: ConceptualQuestion[];
problemSolvingTasks: ProblemSolvingTask[];
}
// New types for the Coding Environment
export interface TestCase {
input: string;
output: string;
isPublic: boolean;
}
export interface CodingProblem {
id: string;
title: string;
description: string;
starterCode: {
[Language.Python]: string;
[Language.Java]: string;
[Language.CPP]: string;
[Language.C]: string;
};
testCases: TestCase[];
}
export interface CodeExecutionResult {
results: {
input: string;
expectedOutput: string;
actualOutput: string;
passed: boolean;
}[];
consoleOutput: string;
feedback: string;
}
// New type for Code Snippets
export interface Snippet {
id: string;
name: string;
code: string;
language: Language;
}
// New types for Visualizations
export type VisualizationType = 'ARRAY' | 'LINKED_LIST';
export interface ArrayVisData {
type: 'ARRAY';
operation: 'ADD' | 'ACCESS' | 'INSERT' | 'DELETE';
data: (string | number)[];
highlightIndex?: number;
value?: string | number;
}
export interface LinkedListVisData {
type: 'LINKED_LIST';
operation: 'ADD_TAIL' | 'ADD_HEAD' | 'DELETE' | 'TRAVERSE';
data: (string | number)[];
highlightIndex?: number;
value?: string | number;
}
export type VisualizationData = ArrayVisData | LinkedListVisData;