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
+71Lines changed: 71 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,3 +37,74 @@ If you want the Web UX to display the correct/incorrect state to the user, you c
37
37
curl -X POST localhost:3000/validate &> /dev/null
38
38
```
39
39
40
+
## How to use as a standalone solution
41
+
42
+
The 2 main dependencies required for this project are python and node. Both can be gotten in the python base images, since every base image contains node as well. A few files need to be created to make the solution work standalone.
43
+
44
+
An example can be found [here](https://app-staging.codesignal.dev/question/NzuLaf2PfcWuxhmAD/)
45
+
### setup.sh
46
+
47
+
```bash
48
+
#!/bin/sh
49
+
echo"Setting up environment…"
50
+
51
+
# Download the specified version (v0.7) of the repository as a tar.gz file
# run the node server to display the quiz on port 3000
78
+
node server.js
79
+
```
80
+
81
+
### run_solution.sh
82
+
83
+
```bash
84
+
#!/bin/bash
85
+
86
+
# force all clients (just the one for the preview window) to update
87
+
# their display and show the correctness of the answers
88
+
curl -X POST localhost:3000/validate &> /dev/null
89
+
90
+
# process the answers given to assess if the learner correctly
91
+
# completed the quiz
92
+
python3 format_answers.py
93
+
94
+
exit 0
95
+
```
96
+
97
+
### View settings
98
+
99
+
The expected setup in the view settings (present either on the course level or on the task level):
100
+
- Task Preview: "Full Screen"
101
+
- Task Preview URL Header: "Hidden"
102
+
- Refresh Preview on Run: "Disabled"
103
+
104
+
## FAQ
105
+
106
+
### my questions aren't showing up in the survey
107
+
Are you sure you didn't store your particular questions in a path different than the one used in the `setup.sh` file?
108
+
109
+
### I'm getting errors after copying the exact scripts provided here
110
+
Ensure you are using the latest release of this repository. While the script assume version 0.7, it could very well be that a bug was fixed somewhere down the line and a newer release fixes the issues.
0 commit comments