You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,11 @@
4
4
5
5
1. Clone the repository
6
6
2. Add questions to the `questions.json` file
7
-
3. Run `python server.py` to start the server
7
+
3. Run `node server.js` to start the server
8
8
4. Open `localhost:3000` in your browser
9
9
10
+
Note: the legacy way of doing it was `python server.py` but python does not support websockets out of the box where Node.js does. So `server.py` is deprecated in favor of `server.js`.
11
+
10
12
## How to add questions
11
13
12
14
Questions are stored in the `questions.json` file. The questions are stored in an array of objects. Each object represents a question and has the following properties:
@@ -27,3 +29,11 @@ As the user interacts with the quiz, the answers are stored in the `answers.json
27
29
28
30
To run the solution, run `python format_answers.py`. This will read the `questions.json` and `answers.json` files and format the answers into a human readable format.
29
31
32
+
## How to display the correct/incorrect state to the user
33
+
First, you must use the `node` version of the server (`server.js`). It exposes a websocket and a `/validate` endpoint you can POST to. It will request the HTML to annotate the UX.
34
+
35
+
If you want the Web UX to display the correct/incorrect state to the user, you can make a request to the quiz server:
0 commit comments