Skip to content

Commit de361c9

Browse files
author
Skalski
committed
chore: 🔧 replace placeholder quizzes with meaningful data
1 parent 0a90382 commit de361c9

3 files changed

Lines changed: 92 additions & 68 deletions

File tree

‎database/initdb/02-data.sql‎

Lines changed: 60 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,62 @@
22
-- Insert initial course data
33
INSERT INTO courses (course_id, title) VALUES
44
('550e8400-e29b-41d4-a716-446655440000', 'DevOps Fundamentals'),
5-
('550e8400-e29b-41d4-a716-446655441000', 'Placeholder Course 1'),
6-
('550e8400-e29b-41d4-a716-446655442000', 'Placeholder Course 2');
5+
('550e8400-e29b-41d4-a716-446655441000', 'Software Testing Fundamentals'),
6+
('550e8400-e29b-41d4-a716-446655442000', 'Network Security Essentials');
77

88
-- Insert DevOps chapters
99
INSERT INTO chapters (chapter_id, name, course_id) VALUES
1010
('550e8400-e29b-41d4-a716-446655440001', 'CI/CD Pipelines', '550e8400-e29b-41d4-a716-446655440000'),
1111
('550e8400-e29b-41d4-a716-446655440002', 'Infrastructure as Code', '550e8400-e29b-41d4-a716-446655440000'),
1212
('550e8400-e29b-41d4-a716-446655440003', 'Monitoring and Observability', '550e8400-e29b-41d4-a716-446655440000');
1313

14-
-- Insert Placeholder Course 1 chapters
14+
-- Insert Software Testing Fundamentals chapters
1515
INSERT INTO chapters (chapter_id, name, course_id) VALUES
16-
('550e8400-e29b-41d4-a716-446655441001', 'Placeholder Chapter 1A', '550e8400-e29b-41d4-a716-446655441000'),
17-
('550e8400-e29b-41d4-a716-446655441002', 'Placeholder Chapter 1B', '550e8400-e29b-41d4-a716-446655441000');
16+
('550e8400-e29b-41d4-a716-446655441001', 'Testing Principles & Fundamentals', '550e8400-e29b-41d4-a716-446655441000'),
17+
('550e8400-e29b-41d4-a716-446655441002', 'Test Types & Methodologies', '550e8400-e29b-41d4-a716-446655441000');
1818

19-
-- Insert Placeholder Course 2 chapters
19+
-- Insert Network Security Essentials chapters
2020
INSERT INTO chapters (chapter_id, name, course_id) VALUES
21-
('550e8400-e29b-41d4-a716-446655442001', 'Placeholder Chapter 2A', '550e8400-e29b-41d4-a716-446655442000'),
22-
('550e8400-e29b-41d4-a716-446655442002', 'Placeholder Chapter 2B', '550e8400-e29b-41d4-a716-446655442000');
21+
('550e8400-e29b-41d4-a716-446655442001', 'Network Threats & Vulnerabilities', '550e8400-e29b-41d4-a716-446655442000'),
22+
('550e8400-e29b-41d4-a716-446655442002', 'Security Protocols & Implementation', '550e8400-e29b-41d4-a716-446655442000');
2323

24-
-- Insert sample questions for Placeholder Course 1
24+
-- Insert sample questions for Software Testing Fundamentals
2525
INSERT INTO questions (question_id, text, sample_solution, chapter_id, ordering) VALUES
2626
('550e8400-e29b-41d4-a716-446655441011',
27-
'What are the fundamental principles of software testing?',
28-
'The fundamental principles of software testing include: 1) Testing shows the presence of defects, not their absence, 2) Exhaustive testing is impossible, 3) Early testing saves time and money, 4) Defects cluster together, 5) Testing is context-dependent, 6) The pesticide paradox - tests need to be updated regularly, and 7) Absence-of-errors fallacy - finding defects does not guarantee system usability.',
27+
'What are the seven fundamental principles of software testing?',
28+
'The seven principles are: 1) Testing shows the presence of defects, not their absence, 2) Exhaustive testing is impossible, 3) Early testing saves time and money, 4) Defects cluster together, 5) Testing is context-dependent, 6) Pesticide paradox - tests need regular updates, 7) Absence-of-errors fallacy - finding defects doesn''t guarantee usability.',
2929
'550e8400-e29b-41d4-a716-446655441001', 1),
3030
('550e8400-e29b-41d4-a716-446655441012',
31-
'Explain the difference between verification and validation in testing.',
32-
'Verification is the process of checking whether the product is being built correctly according to specifications (Are we building the product right?). Validation is the process of checking whether the correct product is being built according to user requirements (Are we building the right product?). Verification typically involves static testing methods like reviews and inspections, while validation involves dynamic testing by executing the code.',
33-
'550e8400-e29b-41d4-a716-446655441002', 1);
31+
'Explain the difference between verification and validation in software testing.',
32+
'Verification asks "Are we building the product right?" - checking if software meets specifications through static methods like reviews. Validation asks "Are we building the right product?" - ensuring software meets user needs through dynamic testing by executing code.',
33+
'550e8400-e29b-41d4-a716-446655441001', 2),
34+
('550e8400-e29b-41d4-a716-446655441013',
35+
'What is the difference between black-box and white-box testing?',
36+
'Black-box testing examines functionality without knowledge of internal code structure, focusing on inputs and outputs. White-box testing involves testing with full knowledge of internal code structure, paths, and logic to ensure all code paths are tested.',
37+
'550e8400-e29b-41d4-a716-446655441002', 1),
38+
('550e8400-e29b-41d4-a716-446655441014',
39+
'Describe the key differences between unit testing, integration testing, and system testing.',
40+
'Unit testing tests individual components in isolation. Integration testing verifies interfaces between integrated components. System testing validates the complete integrated system against requirements. Each level increases in scope and complexity.',
41+
'550e8400-e29b-41d4-a716-446655441002', 2);
3442

35-
-- Insert sample questions for Placeholder Course 2
43+
-- Insert sample questions for Network Security Essentials
3644
INSERT INTO questions (question_id, text, sample_solution, chapter_id, ordering) VALUES
3745
('550e8400-e29b-41d4-a716-446655442011',
38-
'Describe advanced testing strategies for complex systems.',
39-
'Advanced testing strategies for complex systems include: 1) Risk-based testing to prioritize test efforts, 2) Model-based testing using formal models, 3) Property-based testing with automated test case generation, 4) Mutation testing to evaluate test suite quality, 5) Exploratory testing for discovering unexpected behaviors, 6) Performance testing under realistic loads, and 7) Security testing to identify vulnerabilities.',
46+
'What are the main types of network security threats?',
47+
'Main network threats include: 1) Malware (viruses, worms, trojans), 2) DDoS attacks, 3) Man-in-the-middle attacks, 4) Phishing and social engineering, 5) SQL injection, 6) Cross-site scripting (XSS), 7) Ransomware, 8) Advanced Persistent Threats (APTs).',
4048
'550e8400-e29b-41d4-a716-446655442001', 1),
4149
('550e8400-e29b-41d4-a716-446655442012',
42-
'How do you implement continuous testing in modern development workflows?',
43-
'Continuous testing in modern development workflows involves: 1) Integrating automated tests into CI/CD pipelines, 2) Implementing multiple test layers (unit, integration, system, acceptance), 3) Using test automation frameworks and tools, 4) Parallel test execution for faster feedback, 5) Test data management and environment provisioning, 6) Real-time monitoring and reporting, 7) Shift-left testing practices, and 8) Continuous feedback loops for test improvement.',
44-
'550e8400-e29b-41d4-a716-446655442002', 1);
50+
'Explain how a firewall works and describe different types of firewalls.',
51+
'Firewalls monitor and control network traffic based on security rules. Types include: 1) Packet-filtering firewalls (examine packet headers), 2) Stateful inspection firewalls (track connection states), 3) Application layer firewalls (deep packet inspection), 4) Next-generation firewalls (combine multiple technologies).',
52+
'550e8400-e29b-41d4-a716-446655442001', 2),
53+
('550e8400-e29b-41d4-a716-446655442013',
54+
'What is the purpose of network encryption and how does TLS/SSL work?',
55+
'Network encryption protects data confidentiality during transmission. TLS/SSL works through: 1) Handshake protocol establishing secure connection, 2) Certificate exchange for authentication, 3) Key exchange using asymmetric encryption, 4) Symmetric encryption for data transfer using shared keys.',
56+
'550e8400-e29b-41d4-a716-446655442002', 1),
57+
('550e8400-e29b-41d4-a716-446655442014',
58+
'Describe the components and benefits of a Virtual Private Network (VPN).',
59+
'VPN components include: VPN client, VPN server, tunneling protocols (IPSec, OpenVPN), and encryption algorithms. Benefits: secure remote access, data encryption, IP address masking, bypassing geo-restrictions, protection on public networks.',
60+
'550e8400-e29b-41d4-a716-446655442002', 2);
4561

4662
-- Insert questions for Chapter 1: CI/CD Pipelines
4763
INSERT INTO questions (question_id, text, sample_solution, chapter_id, ordering) VALUES
@@ -91,8 +107,8 @@ INSERT INTO questions (question_id, text, sample_solution, chapter_id, ordering)
91107
-- Insert test flashcard decks
92108
INSERT INTO flashcard_decks (deck_id, user_id, name) VALUES
93109
('550e8400-e29b-41d4-a716-446655450001', '00000000-0000-0000-0000-000000000001', 'DevOps Fundamentals Deck'),
94-
('550e8400-e29b-41d4-a716-446655450002', '00000000-0000-0000-0000-000000000001', 'Testing Strategies Deck'),
95-
('550e8400-e29b-41d4-a716-446655450003', '00000000-0000-0000-0000-000000000001', 'CI/CD Pipeline Essentials');
110+
('550e8400-e29b-41d4-a716-446655450002', '00000000-0000-0000-0000-000000000001', 'Software Testing Fundamentals Deck'),
111+
('550e8400-e29b-41d4-a716-446655450003', '00000000-0000-0000-0000-000000000001', 'Network Security Essentials Deck');
96112

97113
-- Insert test flashcards for DevOps Fundamentals Deck
98114
INSERT INTO flashcards (flashcard_id, deck_id, front, back) VALUES
@@ -112,34 +128,42 @@ INSERT INTO flashcards (flashcard_id, deck_id, front, back) VALUES
112128
'What is the difference between monitoring and observability?',
113129
'Monitoring tells you WHAT is happening (predefined metrics), while observability helps you understand WHY it is happening (ability to debug unknown issues)');
114130

115-
-- Insert test flashcards for Testing Strategies Deck
131+
-- Insert test flashcards for Software Testing Fundamentals Deck
116132
INSERT INTO flashcards (flashcard_id, deck_id, front, back) VALUES
117133
('550e8400-e29b-41d4-a716-446655450021', '550e8400-e29b-41d4-a716-446655450002',
118134
'What is the difference between verification and validation?',
119135
'Verification: Are we building the product right? (according to specifications)\nValidation: Are we building the right product? (according to user requirements)'),
120136

121137
('550e8400-e29b-41d4-a716-446655450022', '550e8400-e29b-41d4-a716-446655450002',
122-
'Name 3 fundamental principles of software testing',
123-
'1. Testing shows presence of defects, not their absence\n2. Exhaustive testing is impossible\n3. Early testing saves time and money'),
138+
'Name the 7 fundamental principles of software testing',
139+
'1. Testing shows presence of defects, not absence\n2. Exhaustive testing is impossible\n3. Early testing saves time and money\n4. Defects cluster together\n5. Testing is context-dependent\n6. Pesticide paradox\n7. Absence-of-errors fallacy'),
124140

125141
('550e8400-e29b-41d4-a716-446655450023', '550e8400-e29b-41d4-a716-446655450002',
126-
'What is mutation testing?',
127-
'A testing technique that evaluates test suite quality by introducing small changes (mutations) to the code and checking if tests can detect these changes');
142+
'What is the difference between black-box and white-box testing?',
143+
'Black-box: Testing without knowing internal code structure, focusing on inputs/outputs\nWhite-box: Testing with full knowledge of internal code structure and logic'),
144+
145+
('550e8400-e29b-41d4-a716-446655450024', '550e8400-e29b-41d4-a716-446655450002',
146+
'What are the main differences between unit, integration, and system testing?',
147+
'Unit: Tests individual components in isolation\nIntegration: Tests interfaces between integrated components\nSystem: Tests complete integrated system against requirements');
128148

129-
-- Insert test flashcards for CI/CD Pipeline Essentials Deck
149+
-- Insert test flashcards for Network Security Essentials Deck
130150
INSERT INTO flashcards (flashcard_id, deck_id, front, back) VALUES
131151
('550e8400-e29b-41d4-a716-446655450031', '550e8400-e29b-41d4-a716-446655450003',
132-
'What are the key stages of a CI/CD pipeline?',
133-
'1. Source Control\n2. Build Stage\n3. Test Stage\n4. Code Analysis\n5. Deployment to Staging\n6. Production Deployment\n7. Monitoring'),
152+
'What are the main types of network security threats?',
153+
'Malware, DDoS attacks, Man-in-the-middle attacks, Phishing, SQL injection, XSS, Ransomware, APTs'),
134154

135155
('550e8400-e29b-41d4-a716-446655450032', '550e8400-e29b-41d4-a716-446655450003',
136-
'What is the main benefit of automated testing in CI/CD?',
137-
'Early detection of integration issues and improved code quality through consistent, repeatable testing'),
156+
'What are the different types of firewalls?',
157+
'1. Packet-filtering (examine headers)\n2. Stateful inspection (track connections)\n3. Application layer (deep packet inspection)\n4. Next-generation (multiple technologies)'),
138158

139159
('550e8400-e29b-41d4-a716-446655450033', '550e8400-e29b-41d4-a716-446655450003',
140-
'What is infrastructure drift?',
141-
'When actual infrastructure configuration deviates from the defined specification over time due to manual changes, patches, or updates'),
160+
'How does TLS/SSL work?',
161+
'1. Handshake protocol\n2. Certificate exchange for authentication\n3. Key exchange using asymmetric encryption\n4. Symmetric encryption for data transfer'),
142162

143163
('550e8400-e29b-41d4-a716-446655450034', '550e8400-e29b-41d4-a716-446655450003',
144-
'How does IaC prevent infrastructure drift?',
145-
'By maintaining a single source of truth in code, regularly comparing actual vs desired state, and enabling automated remediation');
164+
'What are the main components of a VPN?',
165+
'VPN client, VPN server, tunneling protocols (IPSec, OpenVPN), encryption algorithms'),
166+
167+
('550e8400-e29b-41d4-a716-446655450035', '550e8400-e29b-41d4-a716-446655450003',
168+
'What are the benefits of using a VPN?',
169+
'Secure remote access, data encryption, IP masking, bypassing geo-restrictions, protection on public networks');

‎helm/study-assistant/values.yaml‎

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -136,22 +136,22 @@ prometheus:
136136
global:
137137
scrape_interval: 15s
138138
scrape_configs:
139-
- job_name: 'auth-service'
140-
metrics_path: '/actuator/prometheus'
139+
- job_name: "auth-service"
140+
metrics_path: "/actuator/prometheus"
141141
static_configs:
142-
- targets: ['study-assistant-auth-service:8083']
143-
- job_name: 'quiz-service'
144-
metrics_path: '/actuator/prometheus'
142+
- targets: ["study-assistant-auth-service:8083"]
143+
- job_name: "quiz-service"
144+
metrics_path: "/actuator/prometheus"
145145
static_configs:
146-
- targets: ['study-assistant-quiz-service:8081']
147-
- job_name: 'flashcard-service'
148-
metrics_path: '/actuator/prometheus'
146+
- targets: ["study-assistant-quiz-service:8081"]
147+
- job_name: "flashcard-service"
148+
metrics_path: "/actuator/prometheus"
149149
static_configs:
150-
- targets: ['study-assistant-flashcard-service:8082']
151-
- job_name: 'genai-service'
152-
metrics_path: '/metrics'
150+
- targets: ["study-assistant-flashcard-service:8082"]
151+
- job_name: "genai-service"
152+
metrics_path: "/metrics"
153153
static_configs:
154-
- targets: ['study-assistant-genai-service:5001']
154+
- targets: ["study-assistant-genai-service:5001"]
155155

156156
# Grafana configuration
157157
grafana:
@@ -196,13 +196,13 @@ alertmanager:
196196
config:
197197
global: {}
198198
route:
199-
receiver: 'default-receiver'
200-
group_by: ['alertname', 'job', 'instance']
199+
receiver: "default-receiver"
200+
group_by: ["alertname", "job", "instance"]
201201
group_wait: 30s
202202
group_interval: 5m
203203
repeat_interval: 4h
204204
receivers:
205-
- name: 'default-receiver'
205+
- name: "default-receiver"
206206

207207
ingress:
208208
enabled: true
@@ -317,8 +317,8 @@ postgresql:
317317
-- Insert initial course data
318318
INSERT INTO courses (course_id, title) VALUES
319319
('550e8400-e29b-41d4-a716-446655440000', 'DevOps Fundamentals'),
320-
('550e8400-e29b-41d4-a716-446655441000', 'Placeholder Course 1'),
321-
('550e8400-e29b-41d4-a716-446655442000', 'Placeholder Course 2');
320+
('550e8400-e29b-41d4-a716-446655441000', 'Software Testing Fundamentals'),
321+
('550e8400-e29b-41d4-a716-446655442000', 'Network Security Essentials');
322322
323323
-- Insert DevOps chapters
324324
INSERT INTO chapters (chapter_id, name, course_id) VALUES

‎quiz-service/src/main/java/com/aet/studyassistant/quiz_service/controller/QuizController.java‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -252,20 +252,20 @@ public ResponseEntity<?> getGenAIHealth() {
252252
private String getDescriptionForCourse(String title) {
253253
if (title.contains("DevOps")) {
254254
return "Master DevOps practices including CI/CD, Infrastructure as Code, and Monitoring & Observability";
255-
} else if (title.contains("Placeholder Course 1")) {
256-
return "Comprehensive testing fundamentals and best practices for software quality assurance";
257-
} else if (title.contains("Placeholder Course 2")) {
258-
return "Advanced course covering sophisticated concepts and real-world applications";
255+
} else if (title.contains("Software Testing Fundamentals")) {
256+
return "Comprehensive foundation in software testing principles, methodologies, and best practices for quality assurance";
257+
} else if (title.contains("Network Security Essentials")) {
258+
return "Advanced network security concepts covering threats, vulnerabilities, and implementation of security protocols";
259259
}
260260
return "Comprehensive technology course with hands-on practice";
261261
}
262262

263263
private String getDifficultyForCourse(String title) {
264264
if (title.contains("DevOps")) {
265265
return "Intermediate";
266-
} else if (title.contains("Placeholder Course 1")) {
266+
} else if (title.contains("Software Testing Fundamentals")) {
267267
return "Beginner";
268-
} else if (title.contains("Placeholder Course 2")) {
268+
} else if (title.contains("Network Security Essentials")) {
269269
return "Advanced";
270270
}
271271
return "Beginner";
@@ -274,9 +274,9 @@ private String getDifficultyForCourse(String title) {
274274
private String getEstimatedTimeForCourse(String title) {
275275
if (title.contains("DevOps")) {
276276
return "8-12 hours";
277-
} else if (title.contains("Placeholder Course 1")) {
277+
} else if (title.contains("Software Testing Fundamentals")) {
278278
return "4-6 hours";
279-
} else if (title.contains("Placeholder Course 2")) {
279+
} else if (title.contains("Network Security Essentials")) {
280280
return "6-8 hours";
281281
}
282282
return "4-6 hours";
@@ -285,21 +285,21 @@ private String getEstimatedTimeForCourse(String title) {
285285
private String getIconKeyForCourse(String title) {
286286
if (title.contains("DevOps")) {
287287
return "cloud";
288-
} else if (title.contains("Placeholder Course 1")) {
288+
} else if (title.contains("Software Testing Fundamentals")) {
289289
return "brain";
290-
} else if (title.contains("Placeholder Course 2")) {
291-
return "cpu";
290+
} else if (title.contains("Network Security Essentials")) {
291+
return "shield";
292292
}
293293
return "code";
294294
}
295295

296296
private List<String> getTagsForCourse(String title) {
297297
if (title.contains("DevOps")) {
298298
return Arrays.asList("CI/CD", "Infrastructure", "Monitoring", "Automation");
299-
} else if (title.contains("Placeholder Course 1")) {
300-
return Arrays.asList("Testing", "Quality Assurance", "Fundamentals");
301-
} else if (title.contains("Placeholder Course 2")) {
302-
return Arrays.asList("Advanced", "Methodologies", "Best Practices");
299+
} else if (title.contains("Software Testing Fundamentals")) {
300+
return Arrays.asList("Testing", "Quality Assurance", "Verification", "Validation");
301+
} else if (title.contains("Network Security Essentials")) {
302+
return Arrays.asList("Security", "Networking", "Encryption", "Firewalls");
303303
}
304304
return Arrays.asList("Technology", "Programming");
305305
}

0 commit comments

Comments
 (0)