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
OJ_VERSION is obtained from the available branches.
120
120
121
-
= Installation / Upgrading
121
+
122
122
123
123
124
124
[TIP]
125
125
`MOODLE_PATH` means the root path of your moodle installation.
126
126
127
-
== Linux
128
-
129
-
1. If the directory `MOODLE_PATH/local/onlinejudge` exists, remove/move it https://github.com/hit-moodle/moodle-local_onlinejudge/blob/e87e12c01f8e2e81bc66471bc0f3e960079256cb/cli/install_assign_feedback#L7-L11[(because it will be automatically removed)].
130
-
2. Make sure the directory name of this plugin is `onlinejudge`. If not, rename it.
131
-
3. Put `onlinejudge` into `MOODLE_PATH/local/`
132
-
4. Run `MOODLE_PATH/local/onlinejudge/cli/install_assign_feedback`.
133
-
5. Login your site as admin and access `/admin/index.php`. The plugins will be installed/upgraded.
134
-
6. In shell, `sudo -u www-data php MOODLE_PATH/local/onlinejudge/cli/judged.php`, to launch the <<judge-daemon>>.
127
+
== Judge Engines
135
128
136
-
=== Sandbox
129
+
=== Sandbox
137
130
138
131
If you would like to use sandbox judge engine, then run:
139
132
```
@@ -145,14 +138,7 @@ make
145
138
[TIP]
146
139
Make sure the file named `sand` is _executable_, and has the following context: `system_u:object_r:bin_t:s0`.
147
140
148
-
== Windows
149
141
150
-
1. If the folder `MOODLE_PATH\local\onlinejudge` exists, remove/move it https://github.com/hit-moodle/moodle-local_onlinejudge/blob/e87e12c01f8e2e81bc66471bc0f3e960079256cb/cli/install_assign_feedback.bat#L7-L9[(because it will be automatically removed)].
151
-
2. Make sure the folder name of this plugin is `onlinejudge`. If not, rename it.
152
-
3. Put `onlinejudge` into `MOODLE_PATH\local\`
153
-
4. Navigate to `MOODLE_PATH\local\onlinejudge\cli` and run `install_assign_feedback.bat`.
154
-
5. Login your site as admin and access `/admin/index.php`. The plugins will be installed/upgraded.
155
-
6. In command prompt, write `php.exe MOODLE_PATH\local\onlinejudge\cli\judged.php -v`, to launch the <<judge-daemon>>.
156
142
157
143
== Sphere Engine
158
144
@@ -167,16 +153,92 @@ composer install
167
153
```
168
154
169
155
[TIP]
170
-
Sphere Engine accepts only one file. So, ensure that the "Maximum number of uploaded files" under "Submission types"
171
-
is equal to `1`.
156
+
Sphere Engine accepts only one file. So, ensure that the "Maximum number of
157
+
uploaded files" under "Submission types" is equal to `1` when you create an
158
+
assignment.
159
+
160
+
== Supported Platforms
161
+
=== Linux
162
+
163
+
1. If the directory `MOODLE_PATH/local/onlinejudge` exists, remove/move it
2. Make sure the directory name of this plugin is `onlinejudge`. If not, rename it.
167
+
3. Put `onlinejudge` into `MOODLE_PATH/local/`
168
+
4. Login your site as admin and access `/admin/index.php`. The plugin will be installed/upgraded.
169
+
5. Configure the maximum cpu and memory limits.
170
+
6. Run `MOODLE_PATH/local/onlinejudge/cli/install_assign_feedback` to install the local plugin.
171
+
7. Login your site as admin and access `/admin/index.php`. The plugin will be installed/upgraded.
172
+
8. In shell, `sudo php MOODLE_PATH/local/onlinejudge/cli/judged.php -n -v`, to launch the <<judge-daemon>>.
173
+
174
+
=== Windows
175
+
176
+
1. If the folder `MOODLE_PATH\local\onlinejudge` exists, remove/move it https://github.com/hit-moodle/moodle-local_onlinejudge/blob/e87e12c01f8e2e81bc66471bc0f3e960079256cb/cli/install_assign_feedback.bat#L7-L9[(because it will be automatically removed)].
177
+
2. Make sure the folder name of this plugin is `onlinejudge`. If not, rename it.
178
+
3. Put `onlinejudge` into `MOODLE_PATH\local\`
179
+
4. Login your site as admin and access `/admin/index.php`. The plugins will be installed/upgraded.
180
+
5. Configure the maximum cpu and memory limits.
181
+
6. Navigate to `MOODLE_PATH\local\onlinejudge\cli` and run `install_assign_feedback.bat` to install the local plugin.
182
+
7. Login your site as admin and access `/admin/index.php`. The plugins will be installed/upgraded.
183
+
8. In command prompt, write `php.exe MOODLE_PATH\local\onlinejudge\cli\judged.php -v`, to launch the <<judge-daemon>>.
172
184
173
185
= Usage
174
186
175
187
== Online Judge Assignment Feedback Type
176
188
177
-
After installation, there will be a new assignment feedback type called *Online Judge* appears in the *"Feedback types"* while creating the assignment. Simply check it it and follow the inline help.
178
-
179
-
After creating the assignment, two buttons will appear in the assignment page context, `Test Case Management` and `Rejudge All` buttons.
189
+
After installation, there will be a new assignment feedback type called *Online
190
+
Judge* appears in the *"Feedback types"* while creating the assignment. Simply
191
+
check that box and follow the inline help.
192
+
193
+
==== Creating an Assignment Activity
194
+
195
+
After checking the `Online Judge` checkbox, several options will appear:
196
+
197
+
1. Programming Language (please note that if you installed `libsandbox`, there
198
+
will be two instance of the `C` and `C++` programming languages which could be
199
+
judged either using `libsandbox` or <<sphere-engine>>, however, the ones
200
+
executed by the sandbox engine will have "(run locally)" next to them).
201
+
2. "Ratio for presentation error" (please click the question mark symbol next to
202
+
that field).
203
+
3. "Compile only" (please click the question mark symbol next to
204
+
that field).
205
+
4. "Link Math Library" (please click the question mark symbol next to
206
+
that field).
207
+
5. "Allow Warnings" (please click the question mark symbol next to
208
+
that field).
209
+
6. "Link Static Libraries" (please click the question mark symbol next to that
210
+
field). It is recommended to enable that option if you are using `libsandbox`.
211
+
7. "Maximum CPU time" (please click the question mark symbol next to that
212
+
field).
213
+
8. "Maximum memory usage" (please click the question mark symbol next to that
214
+
field).
215
+
9. "Sphere-Engine Client ID" (If you are using sphere engine, you can find your
216
+
client id in the "API Tokens" tab)
217
+
10. "Sphere-Engine Access Token" (If you are using sphere engine, you can find your
218
+
access token in the "API Tokens" tab)
219
+
220
+
After creating the assignment, two buttons will appear in the assignment page
221
+
context, `Test Case Management` and `Rejudge All` buttons.
222
+
223
+
==== Test Case Management
224
+
225
+
If you click the `Test Case Management` button, you will be redirected to a web
226
+
form which allows you to specify several test cases which will be tested against
227
+
the submitted code. You can specify these test cases either in the textarea
228
+
fields or by uploading testcase files and from which the expected input or
229
+
output will be read.
230
+
231
+
You may also choose to specify a grade per testcase (e.g., based on their
232
+
difficulty).
233
+
234
+
=== Rejudge All
235
+
236
+
This option might come in handy if you have edited the assignment or the judging
237
+
options and would like the have the edits reflected in the previously judged
238
+
submissions.
239
+
240
+
If you expand the "Online Judge" tab of a submission, there will be a `Force
241
+
Judge` button which allows you to only rejudge that submission.
0 commit comments