Skip to content

Commit 6873e15

Browse files
feat: add data from old project
1 parent 3416215 commit 6873e15

File tree

9 files changed

+114
-0
lines changed

9 files changed

+114
-0
lines changed

data/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Data for Code Quiz
2+
3+
The `index.json` file at the root describes all the categories available for quizes. The `name` is how it will show up in the app, and the `key` maps to a folder containing quizzes.
4+
5+
Inside each category folder, there will also be an `index.json` file. It will describe the quizzes (title, description, difficulty, answer choices, correct answer). The quizzes themselves will live in subfolders and use the file format for the language they are describing.
6+
7+
Should difficulty be universal for all quizzes or allow categories to define their own range?

data/index.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"categories": [
3+
{
4+
"name": "JavaScript",
5+
"key": "javascript"
6+
}
7+
]
8+
}

data/javascript/index.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "javascript",
3+
"subcategories": ["all", "arithmetic", "coercion"],
4+
"quizzes": [
5+
{
6+
"title": "Simple Add",
7+
"key": "simple-add",
8+
"categories": ["beginner", "interview"],
9+
"subcategory": "arithmetic"
10+
},
11+
{
12+
"title": "Plus Operator Coercion",
13+
"key": "plus-operator-coercion",
14+
"categories": ["beginner", "interview"],
15+
"subcategory": "coercion"
16+
},
17+
{
18+
"title": "Minus Operator Coercion",
19+
"key": "minus-operator-coercion",
20+
"categories": ["beginner", "interview"],
21+
"subcategory": "coercion"
22+
}
23+
],
24+
"minimumDifficulty": 1,
25+
"maximumDifficulty": 10
26+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"title": "Minus Operator Coercion",
3+
"description": "Understand the - operator coercion",
4+
"questionFile": "question.js",
5+
"difficulty": 1,
6+
"correctAnswer": "1 NaN 2",
7+
"answers": [
8+
{
9+
"answer": "NaN NaN NaN"
10+
},
11+
{
12+
"answer": "undefined undefined 2"
13+
},
14+
{
15+
"answer": "NaN NaN 2"
16+
},
17+
{
18+
"answer": "1 NaN 2"
19+
}
20+
]
21+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// What will console.log from the following code;
2+
3+
console.log(true - false, 2 - "foo", "3" - 1);
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"title": "Plus Operator Coercion",
3+
"description": "Understand the + operator coercion",
4+
"questionFile": "question.js",
5+
"difficulty": 1,
6+
"correctAnswer": "1 'truefoo' 'bar5'",
7+
"answers": [
8+
{
9+
"answer": "'true0' 'truefoo' 6"
10+
},
11+
{
12+
"answer": "1 'truefoo' 'bar5'"
13+
},
14+
{
15+
"answer": "true 'truefoo' 'bar5'"
16+
},
17+
{
18+
"answer": "true true 'bar5'"
19+
}
20+
]
21+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// What will console.log from the following code;
2+
3+
console.log(true + 0, true + "foo", "bar" + 5);

data/javascript/simple-add/index.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"title": "Simple Add",
3+
"description": "Solve a simple addition",
4+
"questionFile": "question.js",
5+
"difficulty": 1,
6+
"correctAnswer": "5",
7+
"answers": [
8+
{
9+
"answer": "3"
10+
},
11+
{
12+
"answer": "4"
13+
},
14+
{
15+
"answer": "5"
16+
},
17+
{
18+
"answer": "6"
19+
}
20+
]
21+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// What will console.log from the following code;
2+
const simpleAdd = (a, b) => a + b;
3+
4+
console.log(simpleAdd(2, 3));

0 commit comments

Comments
 (0)