Skip to content

Commit ac49572

Browse files
committed
readme: adding installation and usage details
1 parent 6a51049 commit ac49572

File tree

1 file changed

+87
-25
lines changed

1 file changed

+87
-25
lines changed

readme.adoc

Lines changed: 87 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ The workflow is:
8686

8787
* https://download.moodle.org/releases/latest/[Moodle] `2.0`-`2.7`, `3.4+`
8888
* `php-cli`
89-
* `make`, `gcc` and `g++`.
89+
* `make`, `gcc`, `gcc-multilib`, and `g++`.
9090
* `pcntl` and `posix` extension for `php-cli`
9191

9292
=== SELinux
@@ -107,9 +107,9 @@ setsebool -P httpd_can_network_connect on
107107
* `php-cli`
108108

109109

110-
= Download
110+
= Installation / Upgrading
111111

112-
Using git:
112+
== Cloning
113113

114114
```
115115
git clone -b OJ_VERSION git://github.com/hit-moodle/moodle-local_onlinejudge.git onlinejudge
@@ -118,22 +118,15 @@ git clone -b OJ_VERSION git://github.com/hit-moodle/moodle-local_onlinejudge.git
118118
[TIP]
119119
OJ_VERSION is obtained from the available branches.
120120

121-
= Installation / Upgrading
121+
122122

123123

124124
[TIP]
125125
`MOODLE_PATH` means the root path of your moodle installation.
126126

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
135128

136-
=== Sandbox
129+
=== Sandbox
137130

138131
If you would like to use sandbox judge engine, then run:
139132
```
@@ -145,14 +138,7 @@ make
145138
[TIP]
146139
Make sure the file named `sand` is _executable_, and has the following context: `system_u:object_r:bin_t:s0`.
147140

148-
== Windows
149141

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>>.
156142

157143
== Sphere Engine
158144

@@ -167,16 +153,92 @@ composer install
167153
```
168154

169155
[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
164+
https://github.com/hit-moodle/moodle-local_onlinejudge/blob/e87e12c01f8e2e81bc66471bc0f3e960079256cb/cli/install_assign_feedback#L7-L11[(because
165+
it will be automatically removed)].
166+
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>>.
172184

173185
= Usage
174186

175187
== Online Judge Assignment Feedback Type
176188

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.
180242

181243
== Judge Daemon
182244

0 commit comments

Comments
 (0)