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
39 changes: 38 additions & 1 deletion lesson_02/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,41 @@ Please review the following resources before lecture:

## Homework

- TODO(anthonydmays): Make up some stuff to do...
- [ ] Complete [Lesson 02 quiz](#lesson-02-quiz-instructions)
- [ ] Do pre-work for [lesson 03](/lesson_03/).

### Prerequisites

To complete this assignment, you must have **Docker** and **VS Code** with the [**Dev Containers**][dev-containers-link] extension installed.

### Lesson 02 Quiz Instructions

For this assignment, you will complete a quiz by modifying a TypeScript application. Within the quiz project, there are tests that you will need to make pass in order to submit your answers. Here are the instructions for completing the assignment:

1. Make sure to sync your fork to pull in the latest changes.
2. Open the project in **VS Code** and make sure to select `Reopen in Container` when prompted.
3. Navigate to the [quiz][lesson-2-quiz-dir] directory and install the required dependencies.
```bash
cd lesson_02/quiz
npm install --prefix ../../lib/javascript/codedifferently-instructional
npm install
npm start
```
4. Open the [lesson2.ts][lesson-2-file] file located in the [quiz/src/][lesson-2-src-dir] directory.
5. Update the code to provide the correct answers to the given questions.
6. When ready to test, run the following command in the `quiz` sub-directory using the terminal:
```bash
npm run test
```
7. Once all tests pass, submit your work by creating a pull request (PR).

[dev-containers-link]: https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers
[lesson-2-quiz-dir]: quiz/
[lesson-2-file]: quiz/src/lesson2.ts
[lesson-2-src-dir]: quiz/src/
[test-report]: quiz/lesson_02_quiz/build/reports/tests/test/index.html
[spotless-link]: https://github.com/diffplug/spotless

### (Stretch) Porting to Java

In addition to completing the quiz, you are tasked with creating a Java port of the assignment app in the `quiz_java/` sub-directory. You must use the `lib/java/codedifferently-instructional` library to complete this part of the assignment.
8 changes: 8 additions & 0 deletions lesson_02/quiz/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
insert_final_newline = true
1 change: 1 addition & 0 deletions lesson_02/quiz/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/
3 changes: 3 additions & 0 deletions lesson_02/quiz/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Ignore artifacts:
build
coverage
1 change: 1 addition & 0 deletions lesson_02/quiz/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
15 changes: 15 additions & 0 deletions lesson_02/quiz/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// @ts-check

import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import eslintConfigPrettier from "eslint-config-prettier";

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.strict,
...tseslint.configs.stylistic,
eslintConfigPrettier,
{
ignores: ["build"],
},
);
11 changes: 11 additions & 0 deletions lesson_02/quiz/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/** @type {import('ts-jest').JestConfigWithTsJest} **/
export default {
testEnvironment: "node",
transform: {
"^.+.tsx?$": ["ts-jest", { useESM: true }],
},
moduleNameMapper: {
"^(\\.\\.?\\/.+)\\.js$": "$1",
},
extensionsToTreatAsEsm: [".ts"],
};
Loading
Loading