Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions public/tasks/task-nested.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Task - Nested

Version: 0.0.1

Implement functions that work with nested arrays and objects immutably.
147 changes: 144 additions & 3 deletions src/data/questions.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,148 @@
"published": false
}
],
"SIMPLE_QUESTIONS_2": [],
"EMPTY_QUESTIONS": [],
"TRIVIA_QUESTIONS": []
"TRIVIA_QUESTIONS": [
{
"id": 1,
"name": "Mascot",
"body": "What is the name of the UD Mascot?",
"type": "multiple_choice_question",
"options": ["Bluey", "YoUDee", "Charles the Wonder Dog"],
"expected": "YoUDee",
"points": 7,
"published": false
},
{
"id": 2,
"name": "Motto",
"body": "What is the University of Delaware's motto?",
"type": "multiple_choice_question",
"options": [
"Knowledge is the light of the mind",
"Just U Do it",
"Nothing, what's the motto with you?"
],
"expected": "Knowledge is the light of the mind",
"points": 3,
"published": false
},
{
"id": 3,
"name": "Goats",
"body": "How many goats are there usually on the Green?",
"type": "multiple_choice_question",
"options": [
"Zero, why would there be goats on the green?",
"18420",
"Two"
],
"expected": "Two",
"points": 10,
"published": false
}
],
"EMPTY_QUESTIONS": [
{
"id": 1,
"name": "Empty 1",
"body": "This question is not empty, right?",
"type": "multiple_choice_question",
"options": ["correct", "it is", "not"],
"expected": "correct",
"points": 5,
"published": true
},
{
"id": 2,
"name": "Empty 2",
"body": "",
"type": "multiple_choice_question",
"options": ["this", "one", "is", "not", "empty", "either"],
"expected": "one",
"points": 5,
"published": true
},
{
"id": 3,
"name": "Empty 3",
"body": "This questions is not empty either!",
"type": "short_answer_question",
"options": [],
"expected": "",
"points": 5,
"published": true
},
{
"id": 4,
"name": "Empty 4",
"body": "",
"type": "short_answer_question",
"options": [],
"expected": "Even this one is not empty",
"points": 5,
"published": true
},
{
"id": 5,
"name": "Empty 5 (Actual)",
"body": "",
"type": "short_answer_question",
"options": [],
"expected": "",
"points": 5,
"published": false
}
],
"SIMPLE_QUESTIONS_2": [
{
"id": 478,
"name": "Students",
"body": "How many students are taking CISC275 this semester?",
"type": "short_answer_question",
"options": [],
"expected": "90",
"points": 53,
"published": true
},
{
"id": 1937,
"name": "Importance",
"body": "On a scale of 1 to 10, how important is this quiz for them?",
"type": "short_answer_question",
"options": [],
"expected": "10",
"points": 47,
"published": true
},
{
"id": 479,
"name": "Sentience",
"body": "Is it technically possible for this quiz to become sentient?",
"type": "short_answer_question",
"options": [],
"expected": "Yes",
"points": 40,
"published": true
},
{
"id": 777,
"name": "Danger",
"body": "If this quiz became sentient, would it pose a danger to others?",
"type": "short_answer_question",
"options": [],
"expected": "Yes",
"points": 60,
"published": true
},
{
"id": 1937,
"name": "Listening",
"body": "Is this quiz listening to us right now?",
"type": "short_answer_question",
"options": [],
"expected": "Yes",
"points": 100,
"published": true
}
]
}
13 changes: 13 additions & 0 deletions src/interfaces/answer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/***
* A representation of a students' answer in a quizzing game
*/
export interface Answer {
/** The ID of the question being answered. */
questionId: number;
/** The text that the student entered for their answer. */
text: string;
/** Whether or not the student has submitted this answer. */
submitted: boolean;
/** Whether or not the students' answer matched the expected. */
correct: boolean;
}
1 change: 1 addition & 0 deletions src/interfaces/question.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/** QuestionType influences how a question is asked and what kinds of answers are possible */
export type QuestionType = "multiple_choice_question" | "short_answer_question";

/** A representation of a Question in a quizzing application */
export interface Question {
/** A unique identifier for the question */
id: number;
Expand Down
Loading