Rev 11380 | Rev 13362 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 11380 | Rev 13229 | ||
---|---|---|---|
Line 1... | Line -... | ||
1 | <pre> |
- | |
- | 1 | # Protocol for WIMS direct connection with other web servers |
|
2 | 2 | ||
3 |
|
3 | WIMS direct communication with another web server is two-directional. |
- | 4 | It can receive http/https requests from the other server, and/or send http/https requests to the other. |
|
- | 5 | The connectable server must be declared in a file |
|
- | 6 | within the directory `WIMS_HOME/log/classes/.connections/`. |
|
4 | 7 | ||
5 | WIMS direct communication with another web server is two-directional. It can |
- | |
6 | receive http/https requests from the other server, and/or send http/https |
- | |
7 | requests to the other. The connectable server must be declared in a file |
- | |
8 | within the directory WIMS_HOME/log/classes/.connections/. |
- | |
9 | - | ||
10 | Requests sent to WIMS should obey the format described below. Results of |
8 | Requests sent to WIMS should obey the format described below. Results of such requests can be formatted according to the need of the connecting software. |
11 | such requests can be formatted according to the need of the connecting |
- | |
12 | software. |
- | |
13 | 9 | ||
14 | Outgoing requests sent by WIMS can be formatted according to the |
10 | Outgoing requests sent by WIMS can be formatted according to the |
15 | specification of the receiving software, |
11 | specification of the receiving software, |
16 | should be formatted according to the need of WIMS, as described below. |
12 | while the result of the request should be formatted according to the need of WIMS, as described below. |
17 | 13 | ||
18 |
|
14 | _________________________________________________________________ |
- | 15 | ## Request format |
|
19 | 16 | ||
20 |
|
17 | A request from a connecting server is an http/https request sent to the main cgi program of the WIMS server, followed by parameter definitions as in a usual http protocol. |
21 | 18 | ||
22 |
|
19 | All requests must contain the following common parameters: |
23 | cgi program of the WIMS server, followed by parameter definitions as in |
- | |
24 | a usual http protocol. |
- | |
25 | 20 | ||
- | 21 | --- |
|
- | 22 | | Name | Value | |
|
- | 23 | |--------|----------------------------| |
|
- | 24 | | module | adm/raw | |
|
- | 25 | | ident | sender identifier (a word, according to the definition in `WIMS_HOME/log/classes/.connections/`) | |
|
26 |
|
26 | | passwd | sender password (as defined in `WIMS_HOME/log/classes/.connections/`) | |
- | 27 | | code | a random word. This word will be sent back to the sender, in order to allow it to check whether the result is from the good request. | |
|
- | 28 | | job | type of request, see below. | |
|
- | 29 | --- |
|
27 | 30 | ||
28 | --------------------------------------- |
- | |
29 | Name Value |
- | |
30 | --------------------------------------- |
- | |
31 | module adm/raw |
- | |
32 | ident sender identifier (a word, according to the definition |
- | |
33 | in WIMS_HOME/log/classes/.connections/) |
- | |
34 | passwd sender password (as defined in |
- | |
35 | WIMS_HOME/log/classes/.connections/) |
- | |
36 | code a random word. This word will be sent back to the sender, |
- | |
37 | in order to allow it to check whether the result is from |
- | |
38 | the good request. |
- | |
39 | job type of request, see below. |
- | |
40 | --------------------------------------------- |
- | |
41 | 31 | ||
42 | And the following parameters may be added according to the type |
32 | And the following parameters may be added according to the type |
43 | of the request. |
33 | of the request. |
44 | 34 | ||
45 | --------------------------------------- |
- | |
46 | Name |
35 | | Name | Value | |
47 | -------------------------------------- |
36 | |----------|----------------------------| |
48 | qclass |
37 | | qclass | identifier of the class on the receiving server. It should be an integer. | |
49 | It should be an integer. |
- | |
50 | qprogram |
38 | | qprogram | | |
51 | quser |
39 | | quser | user identifier in the receiving server (when the request concerns a particular user). | |
52 | concerns a particular user). |
- | |
53 | qsheet |
40 | | qsheet | sheet identifier in the receiving server (when the request concerns a particular sheet). | |
54 | concerns a particular sheet). |
- | |
55 | rclass |
41 | | rclass | identifier of the class on the sending server. | |
56 |
|
42 | | format | Format of the data. | |
57 |
|
43 | | option | Different meaning according to request. | |
58 |
|
44 | | data1 | Different meaning according to request. | |
59 | data2 Different meaning according to request. |
- | |
60 | --------------------------------------------- |
- | |
- | 45 | --- |
|
61 | 46 | ||
62 | For example, the following request checks whether the class |
47 | For example, the following request checks whether the class `12345` exists on |
63 | the WIMS server |
48 | the WIMS server `wims.unice.fr`, sent by a connecting server called `friend1` (by |
64 | wims.unice.fr), with password |
49 | wims.unice.fr), with password `abcde`. |
65 | 50 | ||
66 |
|
51 | `https://wims.unice.fr/wims/wims.cgi?module=adm/raw&ident=friend1&passwd=abcde&code=afdqreaf1r783&job=checkclass&qclass=12345&rclass=myclass` |
67 | 52 | ||
68 | Note that for this check to return OK, the class |
53 | Note that for this check to return OK, the class `12345` on wims.unice.fr must |
69 | have declared |
54 | have declared `friend1/myclass` as connectable. |
70 | 55 | ||
71 | _______________________________________________________________________________ |
56 | _______________________________________________________________________________ |
72 | 57 | ||
73 |
|
58 | ## Query output |
74 | 59 | ||
75 | The query output (that is, the result of the http query) is always of |
60 | The query output (that is, the result of the http query) is always of |
76 | text/plain type (even if sometimes the output is a binary file). |
61 | text/plain type (even if sometimes the output is a binary file). |
77 | 62 | ||
78 | WIMS OUTPUT TYPE : (old fashioned way, non-recommended) |
63 | **WIMS OUTPUT TYPE** : (old fashioned way, non-recommended) |
79 | The first line of the output content is a status line, which is either a |
64 | The first line of the output content is a status line, which is either a |
80 | word OK followed by the random code contained in the request, or the |
65 | word OK followed by the random code contained in the request, or the |
81 | word ERROR. If the first line is not as such, then there is a |
66 | word ERROR. If the first line is not as such, then there is a |
82 | serious error in the request or a bug in the server software. |
67 | serious error in the request or a bug in the server software. |
83 | - | ||
84 | In case the status is OK, the remaining of the output content is the |
68 | In case the status is OK, the remaining of the output content is the |
85 | content of the data. Otherwise the second line contains the nature of |
69 | content of the data. Otherwise the second line contains the nature of |
86 | the error. |
70 | the error. |
87 | 71 | ||
88 | JSON OUTPUT TYPE : (recommended) |
72 | **JSON OUTPUT TYPE** : (recommended) |
89 | output values are returned json formatted. (see http://json.org for more |
73 | output values are returned json formatted. (see [http://json.org]() for more |
90 | details) |
74 | details) |
91 | _______________________________________________________________________________ |
75 | _______________________________________________________________________________ |
92 | 76 | ||
93 |
|
77 | ## Types of the requests. |
94 | 78 | ||
95 | A request to WIMS can have the following types (defined by the parameter 'job') |
79 | A request to WIMS can have the following types (defined by the parameter 'job') |
96 | 80 | ||
97 | job=help Show this text. |
81 | * **job=help** Show this text. |
- | 82 | ||
- | 83 | * **job=checkident** Check whether the connection is accepted. |
|
- | 84 | ||
- | 85 | * **job=checkclass** Check whether the class accepts connection. |
|
- | 86 | ||
- | 87 | * **job=checkuser** Check whether the user exists. |
|
- | 88 | ||
- | 89 | * **job=checksheet** Check whether the sheet exists. |
|
- | 90 | ||
- | 91 | * **job=addclass** Add a class on the receiving server. |
|
98 | 92 | ||
99 | job=checkident Check whether the connection is accepted. |
- | |
100 | - | ||
101 | job=checkclass Check whether the class accepts connection. |
- | |
102 | - | ||
103 | job=checkuser Check whether the user exists. |
- | |
104 | - | ||
105 | job=checksheet Check whether the sheet exists. |
- | |
106 | - | ||
107 | job=addclass Add a class on the receiving server. |
- | |
108 | - | ||
109 | For this request, |
93 | For this request, `data1` should be a multi-line text defining the |
110 | properties of the new class. Each line contains a definition in the format |
94 | properties of the new class. Each line contains a definition in the format |
111 |
|
95 | `name=value`. (This text must be reformatted for http query string) |
112 | The following names may be present in the definitions: |
96 | The following names may be present in the definitions: |
113 | (mandatory) |
- | |
114 | description = name of the class |
- | |
115 | institution = name of the institution |
- | |
116 | supervisor = full name of the supervisor |
- | |
117 | email = contact email address |
- | |
118 | password = password for user registration |
- | |
119 | lang = class language (en, fr, es, it, etc) |
- | |
120 | (optional) |
- | |
121 | expiration = class expiration date (yyyymmdd) |
- | |
122 | (optional, defaults to one year later) |
- | |
123 | limit = limit of number of participants |
- | |
124 | (optional, defaults to 30) |
- | |
125 | level = level of the class (optional, defaults to H4) |
- | |
126 | Valid levels: E1, E2, ..., E6, H1, ..., H6, |
- | |
127 | U1, ..., U5, G, R |
- | |
128 | secure = secure hosts |
- | |
129 | bgcolor = page background color |
- | |
130 | refcolor = menu background color |
- | |
131 | css = css file (must be existing css on the WIMS server) |
- | |
132 | 97 | ||
- | 98 | * **mandatory:** |
|
- | 99 | * description = name of the class |
|
- | 100 | * institution = name of the institution |
|
- | 101 | * supervisor = full name of the supervisor |
|
- | 102 | * email = contact email address |
|
- | 103 | * password = password for user registration |
|
- | 104 | * lang = class language (en, fr, es, it, etc) |
|
- | 105 | * **optional:** |
|
- | 106 | * expiration = class expiration date (yyyymmdd) |
|
- | 107 | (optional, defaults to one year later) |
|
- | 108 | * limit = limit of number of participants |
|
- | 109 | (optional, defaults to 30) |
|
- | 110 | * level = level of the class (optional, defaults to H4) |
|
- | 111 | Valid levels: E1, E2, ..., E6, H1, ..., H6, |
|
- | 112 | U1, ..., U5, G, R |
|
- | 113 | * secure = secure hosts |
|
- | 114 | * bgcolor = page background color |
|
- | 115 | * refcolor = menu background color |
|
- | 116 | * css = css file (must be existing css on the WIMS server) |
|
- | 117 | ||
133 |
|
118 | `data2` should be a multi-line text defining the supervisor account, in the |
134 | same format as for data1. |
119 | same format as for data1. |
135 | The following names may be present in the definitions: |
120 | The following names may be present in the definitions: |
- | 121 | ||
136 |
|
122 | * **mandatory:** |
137 |
|
123 | * lastname = last name of the supervisor user |
138 |
|
124 | * firstname = first name of the supervisor user |
139 |
|
125 | * password = supervisor user's password, non-crypted. |
140 |
|
126 | * **optional** |
141 |
|
127 | * email = supervisor email address |
142 |
|
128 | * comments = any comments |
143 |
|
129 | * regnum = registration number |
144 |
|
130 | * photourl = url of a user picture |
145 |
|
131 | * participate = list classes (if in a class group) where user participates |
146 |
|
132 | * courses = |
147 |
|
133 | * classes = |
148 |
|
134 | * supervise = |
149 |
|
135 | * supervisable = |
150 |
|
136 | * external_auth = |
151 |
|
137 | * agreecgu = Boolean indicating if user accepted CGU |
152 |
|
138 | * regprop[1..5] = custom properties |
153 | - | ||
154 | - | ||
155 | 139 | ||
156 | job=adduser Add a user to the specified class. |
- | |
157 | 140 | ||
- | 141 | * **job=adduser** Add a user to the specified class. |
|
- | 142 | ||
158 |
|
143 | `data1` should be a multi-line text defining the user account. |
159 | The following names may be present in the definitions: |
144 | The following names may be present in the definitions: |
- | 145 | ||
160 |
|
146 | * **mandatory:** |
161 |
|
147 | * lastname = user's lastname |
162 |
|
148 | * firstname = user's firstname |
163 |
|
149 | * password = user's password, non-crypted. |
164 |
|
150 | * **optional** |
165 |
|
151 | * email = email address |
166 |
|
152 | * comments = any comments |
167 |
|
153 | * regnum = registration number |
168 |
|
154 | * photourl = url of user’s photo |
169 |
|
155 | * participate = list classes where user participates |
170 | group and portal) |
156 | (only for group and portal) |
171 |
|
157 | * courses = special for portal |
172 |
|
158 | * classes = special for portal |
173 |
|
159 | * supervise = List classes where teacher are administator |
174 | for group and portal) |
160 | (only for group and portal) |
175 |
|
161 | * supervisable = `yes/no` ; give right to the user to supervise a class |
176 |
|
162 | (only for group and portal) |
177 |
|
163 | * external_auth = login for external_auth (by cas or shiboleth for example). |
178 |
|
164 | Not useful for Moodle |
179 |
|
165 | * agreecgu = if yes, the user will not be asked when he enters |
180 | for the first time to agree the cgu |
166 | for the first time to agree the cgu |
181 |
|
167 | * regprop[1..5] = custom variables, upon to you |
182 | here an external group for example) |
168 | (i.e : you can set here an external group for example) |
183 | 169 | ||
184 | 170 | ||
185 | job=modclass Modify the properties of a class. |
171 | * **job=modclass** Modify the properties of a class. |
186 | 172 | ||
187 |
|
173 | `data1` should be a multi-line text containing the properties to be redefined. |
188 | Only modified properties need to be present in data1. |
174 | Only modified properties need to be present in data1. |
189 | 175 | ||
190 | 176 | ||
191 | job=moduser Modify the properties of a user. As modclass. |
177 | * **job=moduser** Modify the properties of a user. As modclass. |
192 | 178 | ||
193 | job=delclass Delete a class. |
179 | * **job=delclass** Delete a class. |
194 | 180 | ||
195 | job=deluser Delete a user. |
181 | * **job=deluser** Delete a user. |
196 | 182 | ||
197 | job=recuser Recover a deleted user. |
183 | * **job=recuser** Recover a deleted user. |
198 | 184 | ||
199 | job=getclass Get the properties of a class. |
185 | * **job=getclass** Get the properties of a class. |
200 | 186 | ||
201 | Optionally, the query parameter 'option' may contain the names of fields |
187 | Optionally, the query parameter 'option' may contain the names of fields |
202 | queried. In this case, only the queried properties are returned. |
188 | queried. In this case, only the queried properties are returned. |
203 | 189 | ||
204 | Note: definitions for portals have beed added to output variables but are |
190 | Note: definitions for portals have beed added to output variables but are |
Line 210... | Line 196... | ||
210 | levels = |
196 | levels = |
211 | icourses = |
197 | icourses = |
212 | subclasses = |
198 | subclasses = |
213 | 199 | ||
214 | 200 | ||
215 | job=getsheet Get the properties of a sheet (of a class). |
201 | * **job=getsheet** Get the properties of a sheet (of a class). |
216 | 202 | ||
217 | Optionally, the query parameter 'option' may contain |
203 | Optionally, the query parameter 'option' may contain |
218 | the names of fields queried. In this case, only the |
204 | the names of fields queried. In this case, only the |
219 | queried properties are returned. |
205 | queried properties are returned. |
220 | 206 | ||
221 | OUTPUT variables: |
207 | OUTPUT variables: |
222 | queryclass : the requested class |
208 | queryclass : the requested class |
223 | querysheet : the requested sheet |
209 | querysheet : the requested sheet |
224 | sheet_properties : list of properties of the requested |
210 | sheet_properties : list of properties of the requested sheet |
225 | status,expiration date,title,description) |
211 | (sheet status,expiration date,title,description) |
226 | exocnt : number of exercices included |
212 | exocnt : number of exercices included |
227 | exotitlelist : list of the exercices included (module:params) |
213 | exotitlelist : list of the exercices included (module:params) |
228 | 214 | ||
229 | 215 | ||
230 | job=listsheets List all the sheets of a class. |
216 | * **job=listsheets** List all the sheets of a class. |
231 | 217 | ||
232 | OUTPUT variables: |
218 | OUTPUT variables: |
233 | queryclass : the requested class |
219 | queryclass : the requested class |
234 | nbsheet : number of sheets in this class |
220 | nbsheet : number of sheets in this class |
235 | sheettitlelist : list of the sheets with the format "sheet_id:title" |
221 | sheettitlelist : list of the sheets with the format "sheet_id:title" |
236 | 222 | ||
237 | 223 | ||
238 | job=listclasses |
224 | * **job=listclasses** List all the classes with connection between the `rclass` and `ident/rclass`. |
239 | $ident/$rclass. |
- | |
240 | 225 | ||
241 | Optionally, the query parameter 'option' contains the name of fields related |
226 | Optionally, the query parameter 'option' contains the name of fields related |
242 | to classes asked: |
227 | to classes asked: |
243 | e.g. : option=description,supervisor |
228 | e.g. : option=description,supervisor |
244 | 229 | ||
245 | 230 | ||
246 | job=getclassesuser List all the classes with connection between the rclass and |
231 | * **job=getclassesuser** List all the classes with connection between the rclass and |
247 |
|
232 | `ident/rclass` where the user exists. |
248 | 233 | ||
249 | Optionally, the query parameter 'option' may contain the names of fields |
234 | Optionally, the query parameter 'option' may contain the names of fields |
250 | queried. In this case, only the queried properties of the classes are |
235 | queried. In this case, only the queried properties of the classes are |
251 | returned. |
236 | returned. |
252 | 237 | ||
253 | 238 | ||
254 | job=getuser Get the properties of a user (of a class). |
239 | * **job=getuser** Get the properties of a user (of a class). |
255 | 240 | ||
256 | Optionally, the query parameter 'option' may contain the names of fields |
241 | Optionally, the query parameter 'option' may contain the names of fields |
257 | to be queried. In this case, only the queried properties are returned. |
242 | to be queried. In this case, only the queried properties are returned. |
258 | The output format is as for 'getclass'. |
243 | The output format is as for 'getclass'. |
259 | 244 | ||
260 | 245 | ||
261 | job=getcsv |
246 | * **job=getcsv** Get data of the class, under the form of a csv/tsv spreatsheet file. |
262 | spreatsheet file. |
- | |
263 | 247 | ||
264 | The query parameter 'format' may be used to specify the desired output format |
248 | The query parameter 'format' may be used to specify the desired output format |
265 | (csv or tsv, defaults to csv). |
249 | (csv or tsv, defaults to csv). |
266 | The query parameter 'option' should contain a list of desired data columns. |
250 | The query parameter 'option' should contain a list of desired data columns. |
267 | The following names can be included in 'option', with their respective meanings: |
251 | The following names can be included in 'option', with their respective meanings: |
- | 252 | ||
268 |
|
253 | * login : user identifiers |
269 |
|
254 | * password : user passwords (uncrypted) |
270 |
|
255 | * name : user names (last name and first name) |
271 |
|
256 | * lastname : user family names |
272 |
|
257 | * firstname : user given names |
273 |
|
258 | * email : user email addresses |
274 |
|
259 | * regnum : user registration numbers |
275 |
|
260 | * allscore : all score fields (averages and details) |
276 |
|
261 | * averages : score averages (average0, average1, average2) |
277 |
|
262 | * average0 : global score average (as computed by WIMS) |
278 |
|
263 | * average1 : average of scores automatically attributed by WIMS |
279 |
|
264 | * average2 : average of teacher-entered scores |
280 |
|
265 | * exams : exam1+exam2+... |
281 | exam1, exam2, ...: |
- | |
282 |
|
266 | * exam1, exam2, ...: scores of each exam |
283 |
|
267 | * sheets : sheet1+sheet2+... |
284 | sheet1, sheet2, ...: |
- | |
285 |
|
268 | * sheet1, sheet2, ...: scores of each worksheet |
286 |
|
269 | * manuals : manual1+manual2+... |
287 | manual1, manual2, ...: |
- | |
288 |
|
270 | * manual1, manual2, ...: first, second, ... teacher-entered scores. |
289 | 271 | ||
290 | The output content (below the status line in WIMS format) is a csv/tsv |
272 | The output content (below the status line in WIMS format) is a csv/tsv |
291 | spreadsheet table. The first row of the table contains |
273 | spreadsheet table. The first row of the table contains |
292 | the names of the fields. The second row gives short |
274 | the names of the fields. The second row gives short |
293 | descriptions of each field. The third row is blank. |
275 | descriptions of each field. The third row is blank. |
294 | The rest is the table content, with one row for each user. |
276 | The rest is the table content, with one row for each user. |
295 | 277 | ||
296 | 278 | ||
297 | job=lightpopup Presents an exercise without the top, bottom, and left menu |
279 | * **job=lightpopup** Presents an exercise without the top, bottom, and left menu |
298 | 280 | ||
299 | The syntax is |
281 | The syntax is `job=lightpopup&emod=MODULE` where `MODULE` is an exercise module with its parameters. |
300 | with its parameters. |
- | |
301 | option: |
282 | option: |
- | 283 | ||
302 |
|
284 | * about : show "about" which gives author information about the |
303 | exercise (default) |
285 | exercise (default) |
304 |
|
286 | * noabout : the "about" will not appear. |
305 | 287 | ||
306 | SAMPLES REQUESTS : |
288 | SAMPLES REQUESTS : |
- | 289 | ||
307 |
|
290 | * http://127.0.0.1/wims/wims.cgi?module=adm/raw&job=lightpopup&emod=H3%2Fanalysis%2Foeflinf.fr |
308 |
|
291 | * http://127.0.0.1/wims/wims.cgi?module=adm/raw&job=lightpopup&emod=H3%2Fanalysis%2Foeflinf.fr&parm=cmd=new;exo=antecedant;qnum=1;qcmlevel=3&option=noabout |
309 | 292 | ||
310 | 293 | ||
311 | job=putcsv Put data into the class. |
294 | * **job=putcsv** Put data into the class. |
312 | 295 | ||
313 | The data to put is sent as the value of the query parameter |
296 | The data to put is sent as the value of the query parameter `data1`, in the |
314 | same format as for the query 'getcsv' above. And with the following |
297 | same format as for the query 'getcsv' above. And with the following |
315 | particularities: |
298 | particularities: |
316 | Field |
299 | Field `login` must be present. |
317 | The second row (short descriptions) is not necessary. |
300 | The second row (short descriptions) is not necessary. |
318 | WIMS-attributed scores cannot be uploaded, and will be ignored. |
301 | WIMS-attributed scores cannot be uploaded, and will be ignored. |
319 | If all the necessary fields corresponding to user properties (lastname, |
302 | If all the necessary fields corresponding to user properties (lastname, |
320 | firstname, password, etc.) are present, non-existent users will be |
303 | firstname, password, etc.) are present, non-existent users will be |
321 | added to the class. This can be used to install the whole user accounts |
304 | added to the class. This can be used to install the whole user accounts |
322 | of the class with one request. |
305 | of the class with one request. |
323 | 306 | ||
324 | 307 | ||
325 | job=getlog Get the detailed activity registry of a user. |
308 | * **job=getlog** Get the detailed activity registry of a user. |
326 | 309 | ||
- | 310 | ||
327 | job=gettime Get the current time of the server |
311 | * **job=gettime** Get the current time of the server |
328 | 312 | ||
329 | Can be used for synchronization purposes. |
313 | Can be used for synchronization purposes. |
330 | 314 | ||
331 | 315 | ||
332 | job=update Ask WIMS to update data in a class. |
316 | * **job=update** Ask WIMS to update data in a class. |
333 | 317 | ||
334 | Upon reception of this request, WIMS server will issue queries back to the |
318 | Upon reception of this request, WIMS server will issue queries back to the |
335 | remote server, in order to get the up-to-date information and update the |
319 | remote server, in order to get the up-to-date information and update the |
336 | class. |
320 | class. |
337 | The query parameter 'option' contains the nature of the update request. |
321 | The query parameter 'option' contains the nature of the update request. |
338 | It may be one of the following: |
322 | It may be one of the following: |
339 | class : update class properties (corresponding to modclass) |
- | |
340 | user : update properties of a user (moduser) |
- | |
341 | scores : teacher-entered scores (putcsv) |
- | |
342 | - | ||
343 | 323 | ||
- | 324 | * class : update class properties (corresponding to modclass) |
|
- | 325 | * user : update properties of a user (moduser) |
|
- | 326 | * scores : teacher-entered scores (putcsv) |
|
- | 327 | ||
- | 328 | ||
344 | job=authuser Get an authentification for a user. |
329 | * **job=authuser** Get an authentification for a user. |
345 | 330 | ||
346 | User's password is not required. |
331 | User's password is not required. |
347 | Accepts the query parameter |
332 | Accepts the query parameter `option=hashlogin`: |
348 | If called with option=hashlogin, quser should be the external |
333 | If called with option=hashlogin, quser should be the external |
349 | identification of user and the function hashlogin is called to convert |
334 | identification of user and the function hashlogin is called to convert |
350 | such id to a WIMS login. If the user exists in class, it returns a |
335 | such id to a WIMS login. If the user exists in class, it returns a |
351 | session number as above. If the user does not exists, the WIMS login is |
336 | session number as above. If the user does not exists, the WIMS login is |
352 | returned in the error message. |
337 | returned in the error message. |
353 | 338 | ||
354 | OUTPUT : |
339 | OUTPUT : |
- | 340 | ||
355 |
|
341 | * wims_session : a session number under which the user can connect |
356 | with no need of further authentification |
342 | with no need of further authentification |
357 |
|
343 | * home_url : a complete URL to connect as authentified. |
358 | 344 | ||
359 | 345 | ||
- | 346 | * **job=addsheet** Add a new sheet to the specified class `qclass`. |
|
360 | 347 | ||
361 | job=addsheet Add a new sheet to the specified class. |
- | |
362 | - | ||
363 |
|
348 | `data1` may be defined as a multi-line text defining the sheet defs |
364 | The following names may be present in the definitions: |
349 | The following names may be present in the definitions: |
365 | (mandatory) |
350 | (mandatory) |
366 | (optional) |
351 | (optional) |
367 | title = name of the sheet (defaults to "sheet n#") |
- | |
368 | description = description of the sheet (defaults to "sheet n#") |
- | |
369 | expiration = expiration date (yyyymmdd) defaults to one year later |
- | |
370 | sheetmode = the mode of the sheet: |
- | |
371 | 0 : pending (default) |
- | |
372 | 1 : active |
- | |
373 | 2 : expired |
- | |
374 | 3 : expired + hidden |
- | |
375 | weight = weight of the sheet in class score |
- | |
376 | formula = How the score is calculated for this sheet (0 to 6) |
- | |
377 | indicator = what indicator will be used in the score formula (0 to 2) |
- | |
378 | contents = the contents for the multi-line file to be created. |
- | |
379 | The semicolons (;) in this parameter will be |
- | |
380 | interpreted as new lines. Equal characters (=) must |
- | |
381 | be replaced by the character AT (@). |
- | |
382 | There is no check made, so the integrity of the |
- | |
383 | contents is up to you only! (defaults to "") |
- | |
384 | - | ||
385 | OUTPUT : |
- | |
386 | queryclass : the requested class |
- | |
387 | sheet_id : id of the new created sheet |
- | |
388 | - | ||
389 | - | ||
390 | job=modsheet Modify an existing sheet in the specified class. |
- | |
391 | - | ||
392 | 'data1' may be defined as a multi-line text defining the sheet defs |
- | |
393 | (cf addsheet) |
- | |
394 | - | ||
395 | - | ||
396 | job=listexos Lists all exercices presents in class $qclass |
- | |
397 | - | ||
398 | job=movexo Moves exercice $qexo from class $qclass to class $data1 |
- | |
399 | - | ||
400 | Condition : Both 2 classes must be linked by $rclass |
- | |
401 | # option : you can use "copy" to copy file instead of moving it. |
- | |
402 | - | ||
403 | - | ||
404 | job=movexos Moves ALL exercice from class $qclass to class $data1 |
- | |
405 | 352 | ||
- | 353 | * title = name of the sheet (defaults to "sheet n#") |
|
- | 354 | * description = description of the sheet (defaults to "sheet n#") |
|
- | 355 | * expiration = expiration date (yyyymmdd) defaults to one year later |
|
- | 356 | * sheetmode = the mode of the sheet: |
|
- | 357 | * 0 : pending (default) |
|
- | 358 | * 1 : active |
|
- | 359 | * 2 : expired |
|
- | 360 | * 3 : expired + hidden |
|
- | 361 | * weight = weight of the sheet in class score |
|
- | 362 | * formula = How the score is calculated for this sheet (0 to 6) |
|
- | 363 | * indicator = what indicator will be used in the score formula (0 to 2) |
|
- | 364 | * contents = the contents for the multi-line file to be created. |
|
- | 365 | The semicolons (;) in this parameter will be |
|
- | 366 | interpreted as new lines. Equal characters (=) must |
|
406 |
|
367 | be replaced by the character AT (@). |
407 |
|
368 | There is no check made, so the integrity of the |
- | 369 | contents is up to you only! (defaults to "") |
|
408 | 370 | ||
- | 371 | **OUTPUT** : |
|
409 | 372 | ||
- | 373 | * queryclass : the requested class |
|
- | 374 | * sheet_id : id of the new created sheet |
|
- | 375 | ||
- | 376 | ||
- | 377 | * **job=addexam** Add a new exam to the specified class `qclass`. |
|
- | 378 | `data1` may be defined as a multi-line text defining the sheet defs, with the same parameters as in addsheet (see above), plus these additional optional parameters: |
|
- | 379 | ||
- | 380 | * duration = exam duration |
|
- | 381 | * attempts = number of authorized attempts |
|
- | 382 | * cut_hours = Cut hours (format : `yyyymmdd.hh:mm` (separate several hours by spaces). |
|
410 |
|
383 | * opening = Opening Restrictions (IP ranges / Schedules) opening can set a time restriction for recording notes by adding the words > yyyymmdd.hh:mm (start) and/or < yyyymmdd.hh:mm (end). Dates and times must be in server local time and must be separated by spaces. |
- | 384 | ||
- | 385 | ||
- | 386 | * **job=addexo** Add the source file (data1) of an exercise directly to the class, under the name `qexo` |
|
- | 387 | ||
- | 388 | ||
- | 389 | * **job=putexo** Add content (an existing exercise) to the sheet `qsheet` of the `qclass` class |
|
- | 390 | `data1` may be defined as a multi-line text defining the exo defs, according to these parameters: |
|
- | 391 | * **mandatory:** |
|
- | 392 | * module = the module where comes the erexercice from |
|
- | 393 | * **optional** |
|
- | 394 | * params = list of parameters to add to the module |
|
411 |
|
395 | * points = number of requested points |
- | 396 | * weight = Weight of the exercise |
|
- | 397 | * title = title of the exercise in the sheet |
|
- | 398 | * description = description of the exercise in the sheet |
|
- | 399 | ||
- | 400 | ||
- | 401 | * **job=modsheet** Modify an existing sheet in the specified class. |
|
- | 402 | ||
- | 403 | `data1` may be defined as a multi-line text defining the sheet defs |
|
- | 404 | (cf addsheet) |
|
- | 405 | ||
- | 406 | ||
- | 407 | * **job=listexos** Lists all exercices presents in class `qclass` |
|
- | 408 | ||
- | 409 | ||
- | 410 | * **job=movexo** Moves exercice `qexo` from class `qclass` to class `data1` |
|
- | 411 | ||
- | 412 | Condition : Both 2 classes must be linked by `rclass` |
|
- | 413 | ||
- | 414 | *option*: you can use `copy` to copy file instead of moving it. |
|
- | 415 | ||
- | 416 | ||
- | 417 | * **job=movexos** Moves ALL exercice from class `qclass` to class `data1` |
|
412 | 418 | ||
413 | Condition: Both 2 classes must be linked by |
419 | Condition: Both 2 classes must be linked by `rclass` |
- | 420 | *option*: you can use `copy` to copy files instead of moving them. |
|
- | 421 | ||
- | 422 | ||
- | 423 | * **job=sharecontent** declare neighbour classes, allowing class "qclass" to share content with class "data1" |
|
- | 424 | ||
- | 425 | Condition: Both 2 classes must be linked by `rclass` |
|
414 | The |
426 | The `option` parameter can be used to declare which type of content to share |
415 | (currently, only the "exo" content type is supported) |
427 | (currently, only the "exo" content type is supported) |
- | 428 | ||
- | 429 | ||
- | 430 | * **job=linksheet** Add all exercices from sheet `qsheet` to exam `qexam` |
|
416 | 431 | ||
417 | 432 | ||
418 |
|
433 | * **job=getscore** Get all scores from user `quser` (optionaly, you can filter with sheet `qsheet`) |
419 | 434 | ||
420 | job=getscore Get all scores from user $quser (optionaly, you can filter with sheet $qsheet) |
- | |
421 | 435 | ||
422 | job=getsheetscores Get all scores from sheet |
436 | * **job=getsheetscores** Get all scores from sheet `qsheet` - JSON OUTPUT only |
423 | 437 | ||
424 | job=getexamscores Get all scores from exam $qexam - JSON OUTPUT only |
- | |
425 | 438 | ||
- | 439 | * **job=getexamscores** Get all scores from exam `qexam` - JSON OUTPUT only |
|
426 | 440 | ||
427 |
|
441 | --- |