Wiki source code of 06 Schnittstelle ONYX Editor

Last modified by Carina Enke on 12.12.2025

Hide last authors
Carina Enke 98.1 1 {{section}}
2 {{column width="60%"}}
Carina Enke 95.1 3
Carina Enke 98.1 4 {{/column}}
Carina Enke 30.1 5
Carina Enke 98.1 6 {{column width="30%"}}
7 {{panel title="Content"}}
8 {{toc start="2"/}}
Carina Enke 30.1 9 {{/panel}}
Carina Enke 98.1 10 {{/column}}
11 {{/section}}
Carina Enke 30.1 12
Carina Enke 98.1 13 == Save results ==
Carina Enke 30.1 14
Carina Enke 98.1 15 With the ONYX Editor, system independent tests may be published. If users perform these tests, the result will be transferred back to the ONYX Editor, which saves it. The ONYX Editor provides the following REST interfaces:
Carina Enke 30.1 16
Carina Enke 98.1 17 {{code title="Save results"}}
Carina Enke 30.1 18 @RestMethod(name = "saveResult2")
19 public Boolean saveResult(
20 @RestParam(name = "uniqueId") final String uniqueId,
21 @RestParam(name = "resultFile") final byte[] resultFile,
22 @RestParam(name = "params") final Map<String, String> params) {}
23 {{/code}}
24
25
26 === Parameter saveResult2 ===
27
28 |(((
29 uniqueId
30 )))|(((
Carina Enke 98.1 31 Unique ID used by the ONYX WebPlayer and ONYX Editor when running the test.
Carina Enke 30.1 32 )))
33 |(((
34 resultFile
35 )))|(((
Carina Enke 98.1 36 Result file as ZIP file (QTI-compliant result.xml, including any referenced files such as user uploads or user content if necessary)
Carina Enke 30.1 37 )))
38 |(((
39 params
40 )))|(((
Carina Enke 98.1 41 Generic parameters. These are currently only stored without further processing.
Carina Enke 30.1 42 )))
43
44 === returnValue saveResult2 ===
45
46 |(((
47 boolean
48 )))|(((
Carina Enke 98.1 49 True if successful, otherwise false
Carina Enke 30.1 50 )))
51
Carina Enke 98.1 52 == Save results (legacy) ==
Carina Enke 30.1 53
Carina Enke 98.1 54 {{code title="Save results (legacy)"}}
Carina Enke 30.1 55 @RestMethod(name = "saveResult")
56 public Boolean saveResult(
57 @RestParam(name = "uniqueId") final String uniqueId,
58 @RestParam(name = "resultFile") final byte[] resultFile) {}
59 {{/code}}
60
61
62 === Parameter saveResult2 ===
63
64 |(((
65 uniqueId
66 )))|(((
Carina Enke 98.1 67 Unique ID used by the ONYX WebPlayer and ONYX Editor when running the test.
Carina Enke 30.1 68 )))
69 |(((
70 resultFile
71 )))|(((
Carina Enke 98.1 72 Result file as ZIP file (QTI-compliant result.xml, including any referenced files such as user uploads or user content if necessary)
Carina Enke 30.1 73 )))
74
75 === returnValue saveResult2 ===
76
77 |(((
78 boolean
79 )))|(((
Carina Enke 98.1 80 True if successful, otherwise false
Carina Enke 30.1 81 )))
82
Carina Enke 98.1 83 == Query interface version ==
Carina Enke 30.1 84
Carina Enke 98.1 85 {{code title="Query version"}}
Carina Enke 30.1 86 @RestMethod(name = "version")
87 public String version() {}
88 {{/code}}
89
90
91 === Parameter version ===
92
Carina Enke 98.1 93 None
Carina Enke 30.1 94
95
96 === returnValue saveResult2 ===
97
98 |(((
99 String
100 )))|(((
Carina Enke 98.1 101 REST interface version, currently always "1.0 (ONYX Editor version)"
Carina Enke 30.1 102 )))
103
Carina Enke 98.1 104 == Delete user ==
Carina Enke 30.1 105
Carina Enke 98.1 106 The ONYX Editor can be coupled to an LMS with the LMS being the user data management system. If users are deleted from the LMS, all related data (e. g. personal user settings) should also be deleted from the ONYX Editor.
Carina Enke 30.1 107
Carina Enke 98.1 108 {{code title="Delete user"}}
Carina Enke 30.1 109 @RestMethod
110 public Map<String, String> deleteUser(
111 @RestParam(name = "login") final String login,
112 @RestParam(name = "password") final String password,
113 @RestParam(name = "repo") final String repo,
114 @RestParam(name = "property") final String property,
115 @RestParam(name = "values") final ArrayList<String> values,
116 @RestParam(name = "reason") final String reason,
117 @RestParam(name = "params") final Map<String, String> params) {}
118 {{/code}}
119
120 === Parameter deleteUser ===
121
122 |(((
123 login
124 )))|(((
Carina Enke 98.1 125 User name of an ONYX Editor admin user who has the right to delete other users.
Carina Enke 30.1 126 )))
127 |(((
128 password
129 )))|(((
Carina Enke 98.1 130 Password of this ONYX Editor admin user.
Carina Enke 30.1 131 )))
132 |(((
133 repo
134 )))|(((
Carina Enke 98.1 135 ID of the LMS repository as it is already configured in the LMS and used for communication with the ONYX Editor.
Carina Enke 30.1 136 )))
137 |(((
138 property
139 )))|(((
Carina Enke 98.1 140 Selection criterion for the users to be deleted. If "uid", filtering is done according to the globally valid user identifier (Shibboleth criterion). Otherwise, the filtering is done according to the user names used internally by the LMS in conjunction with the ONYX Editor.
Carina Enke 30.1 141 )))
142 |(((
143 values
144 )))|(((
Carina Enke 98.1 145 List of values to filter by, for example, list of user names.
Carina Enke 30.1 146 )))
147 |(((
148 reason
149 )))|(((
Carina Enke 98.1 150 Reason for deletion. Will be included in the deletion log.
Carina Enke 30.1 151 )))
152 |(((
153 params
154 )))|(((
Carina Enke 98.1 155 Currently not used
Carina Enke 30.1 156 )))
157
158 === returnValue deleteUser ===
159
Carina Enke 98.1 160 Deletion result information.
Carina Enke 30.1 161
162 |(((
163 Key
164 )))|(((
Carina Enke 98.1 165 The values as specified in the _values_ parameter
Carina Enke 30.1 166 )))
167 |(((
168 Value
169 )))|(((
Carina Enke 98.1 170 Deletion result (e. g _NOT FOUND_, _ERROR:xyz_, ...)
171 )))~{~{/layout-cell}}
172 ~{~{/layout-section}}
173 ~{~{/layout}}