Skip to content

Commit aedd9f2

Browse files
committed
Json integrated so they are built in.
1 parent 6873c9f commit aedd9f2

12 files changed

+6778
-13
lines changed

Data/Questions_Biology.json

Lines changed: 689 additions & 0 deletions
Large diffs are not rendered by default.

Data/Questions_Cinema.json

Lines changed: 844 additions & 0 deletions
Large diffs are not rendered by default.

Data/Questions_Gaming.json

Lines changed: 1114 additions & 0 deletions
Large diffs are not rendered by default.

Data/Questions_GeneralCulture.json

Lines changed: 977 additions & 0 deletions
Large diffs are not rendered by default.

Data/Questions_Geography.json

Lines changed: 730 additions & 0 deletions
Large diffs are not rendered by default.

Data/Questions_History.json

Lines changed: 748 additions & 0 deletions
Large diffs are not rendered by default.

Data/Questions_Musique.json

Lines changed: 830 additions & 0 deletions
Large diffs are not rendered by default.

Data/Questions_Physics.json

Lines changed: 688 additions & 0 deletions
Large diffs are not rendered by default.

Data/exercises.json

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{
2+
"CorrectAnswerExercises": [
3+
{
4+
"Description": "Great job! Stand up and do 5 jumping jacks!",
5+
"DurationSeconds": null,
6+
"Difficulty": 0,
7+
"Category": "Cardio"
8+
},
9+
{
10+
"Description": "Excellent! Get up, take 10 deep breaths and stretch your arms above your head.",
11+
"DurationSeconds": 30,
12+
"Difficulty": 0,
13+
"Category": "Stretching"
14+
},
15+
{
16+
"Description": "Well done! Do 5 push-ups or wall push-ups if needed.",
17+
"DurationSeconds": null,
18+
"Difficulty": 1,
19+
"Category": "Strength"
20+
},
21+
{
22+
"Description": "Perfect! Hold a plank position for as long as you can.",
23+
"DurationSeconds": 60,
24+
"Difficulty": 1,
25+
"Category": "Strength"
26+
},
27+
{
28+
"Description": "Outstanding! Do 15 squats - you've earned this challenge!",
29+
"DurationSeconds": 90,
30+
"Difficulty": 2,
31+
"Category": "Cardio"
32+
},
33+
{
34+
"Description": "Amazing! Run in place for 2 minutes at good intensity.",
35+
"DurationSeconds": 120,
36+
"Difficulty": 2,
37+
"Category": "Cardio"
38+
}
39+
],
40+
"WrongAnswerExercises": [
41+
{
42+
"Description": "Oops! Walk around your room 5 times to get those brain cells moving.",
43+
"DurationSeconds": 45,
44+
"Difficulty": 0,
45+
"Category": "Mental Break"
46+
},
47+
{
48+
"Description": "Not quite! Do get up and jump 5 times.",
49+
"DurationSeconds": 30,
50+
"Difficulty": 0,
51+
"Category": "Stretching"
52+
},
53+
{
54+
"Description": "Close, but not quite! Do 15 squats to boost your energy.",
55+
"DurationSeconds": null,
56+
"Difficulty": 1,
57+
"Category": "Strength"
58+
},
59+
{
60+
"Description": "Try again next time! March in place for 90 seconds.",
61+
"DurationSeconds": 90,
62+
"Difficulty": 1,
63+
"Category": "Cardio"
64+
},
65+
{
66+
"Description": "Tough question! Do 30 mountain climbers to reset your focus.",
67+
"DurationSeconds": null,
68+
"Difficulty": 2,
69+
"Category": "Cardio"
70+
},
71+
{
72+
"Description": "No worries! Jump 10 times standing on one leg then switch legs and do it again !",
73+
"DurationSeconds": 90,
74+
"Difficulty": 2,
75+
"Category": "Mental Break"
76+
}
77+
]
78+
}

Helpers/AppSettings.cs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,28 @@ private static void ValidateSettings(Settings settings)
164164
// Check if path is valid and accessible
165165
if (!Directory.Exists(settings.DataFolderPath))
166166
{
167-
// Reset to default if folder doesn't exist
168-
settings.DataFolderPath = string.Empty;
167+
// Try to create the directory if it's a Data subfolder
168+
string baseDirectory = AppDomain.CurrentDomain.BaseDirectory;
169+
string dataDirectory = Path.Combine(baseDirectory, "Data");
170+
171+
if (settings.DataFolderPath.Equals(dataDirectory, StringComparison.OrdinalIgnoreCase))
172+
{
173+
try
174+
{
175+
Directory.CreateDirectory(dataDirectory);
176+
// Successfully created, keep the setting
177+
}
178+
catch
179+
{
180+
// Reset to default if Data folder can't be created
181+
settings.DataFolderPath = string.Empty;
182+
}
183+
}
184+
else
185+
{
186+
// Reset to default if custom folder doesn't exist
187+
settings.DataFolderPath = string.Empty;
188+
}
169189
}
170190
}
171191
catch

0 commit comments

Comments
 (0)