Skip to content
Open
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
123 changes: 57 additions & 66 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"build": "react-scripts build",
"test": "react-scripts test",
"test:cov": "react-scripts test --coverage --watchAll",
"test:json": "react-scripts test --json --watchAll=false --outputFile jest-output.json --coverage",
"eject": "react-scripts eject",
"lint": "eslint ./src --ext .tsx --ext .ts --max-warnings 0",
"eslint-output": "eslint-output ./src --ext .tsx --ext .ts --max-warnings 0",
Expand Down
5 changes: 5 additions & 0 deletions public/tasks/task-objects.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Task - Objects

Version: 0.0.1

Implement functions that work with objects immutably.
79 changes: 79 additions & 0 deletions src/data/questions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"BLANK_QUESTIONS": [
{
"id": 1,
"name": "Question 1",
"body": "",
"type": "multiple_choice_question",
"options": [],
"expected": "",
"points": 1,
"published": false
},
{
"id": 47,
"name": "My New Question",
"body": "",
"type": "multiple_choice_question",
"options": [],
"expected": "",
"points": 1,
"published": false
},
{
"id": 2,
"name": "Question 2",
"body": "",
"type": "short_answer_question",
"options": [],
"expected": "",
"points": 1,
"published": false
}
],
"SIMPLE_QUESTIONS": [
{
"id": 1,
"name": "Addition",
"body": "What is 2+2?",
"type": "short_answer_question",
"options": [],
"expected": "4",
"points": 1,
"published": true
},
{
"id": 2,
"name": "Letters",
"body": "What is the last letter of the English alphabet?",
"type": "short_answer_question",
"options": [],
"expected": "Z",
"points": 1,
"published": false
},
{
"id": 5,
"name": "Colors",
"body": "Which of these is a color?",
"type": "multiple_choice_question",
"options": ["red", "apple", "firetruck"],
"expected": "red",
"points": 1,
"published": true
},
{
"id": 9,
"name": "Shapes",
"body": "What shape can you make with one line?",
"type": "multiple_choice_question",
"options": ["square", "triangle", "circle"],
"expected": "circle",
"points": 2,
"published": false
}
],
"SIMPLE_QUESTIONS_2": [],
"EMPTY_QUESTIONS": [],
"TRIVIA_QUESTIONS": []
}
21 changes: 21 additions & 0 deletions src/interfaces/question.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/** QuestionType influences how a question is asked and what kinds of answers are possible */
export type QuestionType = "multiple_choice_question" | "short_answer_question";

export interface Question {
/** A unique identifier for the question */
id: number;
/** The human-friendly title of the question */
name: string;
/** The instructions and content of the Question */
body: string;
/** The kind of Question; influences how the user answers and what options are displayed */
type: QuestionType;
/** The possible answers for a Question (for Multiple Choice questions) */
options: string[];
/** The actually correct answer expected */
expected: string;
/** How many points this question is worth, roughly indicating its importance and difficulty */
points: number;
/** Whether or not this question is ready to display to students */
published: boolean;
}
Loading