We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6736ff7 commit 9cd4c56Copy full SHA for 9cd4c56
src/routes/tutorial/[slug]/filetree/Filetree.svelte
@@ -29,7 +29,14 @@
29
collapsed,
30
31
add: async (name, type) => {
32
- if (!$solution[name] && !exercise.editing_constraints.create.has(name)) {
+ const expected = $solution[name];
33
+
34
+ if (type !== expected.type) {
35
+ modal_text = `${name.slice(exercise.scope.prefix.length)} should be a ${expected.type}, not a ${type}!`;
36
+ return;
37
+ }
38
39
+ if (!expected && !exercise.editing_constraints.create.has(name)) {
40
modal_text =
41
'Only the following files and folders are allowed to be created in this exercise:\n' +
42
Array.from(exercise.editing_constraints.create).join('\n');
0 commit comments