Abitti 2 Application Specification
The Abitti 2 application is designed to operate on the client-side and is deployed from a Docker container. Contact us before you start working on your Abitti HTML5 application!
The apps will be run in an iframe in the Abitti exam system, and they will be able to access the exam's files via WebDAV. The apps should not use any technology that interferes with the iframe, for example referring to window.top.
Want to read the code instead of spec? Take a look at the example implementation with Draw.io.
note: At the moment this documentation may change since we're taking the baby steps with the architecture.
GET /
This is the main entry point to the app called by the Abitti exam system when the application is started. The app server MAY serve additional assets only under this path.
If the app supports files, it will be launched with the filename query parameter. A client-side script MUST first check the file's existence with a WebDAV PROPFIND request, and load the app with its contents if it exists. Otherwise the app SHOULD present a new, blank file to the user.
The app MUST use the path /wd/{filename} to access the file.
const url = `/wd/${encodeURIComponent(filename)}`
const result = await fetch(url, { method: "PROPFIND" })
switch (result.status) {
case 207: {
// The file exists; open the app with its contents.
return startApp(await fetch(url).then(response => response.blob()))
}
case 404: {
// No such file; it will be created when first saved.
return startApp(new File())
}
default: {
// An error happened; do not start the app.
return
}
}
The app MAY automatically save the file, or when prompted by the user, via a PUT request with the new contents to the same URL.
const url = `/wd/${encodeURIComponent(filename)}`
await fetch(url, { method: "PUT", body: file })
Session cookies determine the exam and student whose files are being used, but the app MUST NOT make any use or assumptions of such cookies.