We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7df5faf + 9cd4c56 commit 3a4b1d2Copy full SHA for 3a4b1d2
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