Quiz Wifi Resilience Mode

Quiz access rules ::: quizaccess_wifiresilience
Maintained by ETHzETH Zürich
The Wifiresilience accessrule is designed to allow students to continue work on deferred-feedback quiz attempts even if the network connection goes down. For this purpose Wifiresilience makes use of localstorage. Stored answers can be accessed, synced to server and also be downloaded manually in case connection does not come back.
Latest release:
64 sites
315 downloads
7 fans
Current versions available: 4

 Wifiresilience Quiz Access Rule

The Wifiresilience accessrule is designed to allow students to continue work on deferred-feedback quiz attempts even if the network connection goes down. For this purpose Wifiresilience makes use of localstorage. Stored answers can be accessed, synced to server and also be downloaded manually in case connection does not come back.

Note:

Wifiresilience is not designed for offline use per se. A working connection is required to start quizzes. Wifiresilience will intervene when connection breaks down.

The Wifiresilience accessrule is built on top of Quiz fault-tolerant mode (quizaccess_offlinemode) by Tim Hunt but adding additional features. Credits here go to Tim Hunt for creating Quiz fault-tolerant mode!

Installation:

1. Extract the contents of the downloaded zip to `mod/quiz/accessrule`.

2. Rename the extracted folder to `wifiresilience`.

3. Start the Moodle upgrade procedure.

Admin Settings:

- **quizaccess_wifiresilience | defaultenabled**

  You can configure whether the Wifi Resilience Mode should be enabled by default for new quizzes or not.


- **quizaccess_wifiresilience | privatekey**

  You can use public-key cryptography to protect the downloaded responses. To do that, you need to supply a private/public key pair. You can generate a private key using `openssl genrsa -out rsa_1024_priv.pem 1024` at the command-line (if you have OpenSSL installed from https://www.openssl.org/). Then paste the content of the rsa_1024_priv.pem file into this box.


- **quizaccess_wifiresilience | publickey**

  This must correspond to the private key. You can generate it from the private key using `openssl rsa -pubout -in rsa_1024_priv.pem -out rsa_1024_pub.pem` then past the contents of rsa_1024_pub.pem here.


- **quizaccess_wifiresilience | wifitoken**

  Web service token to send emergency files in background when the device is connected. This token can be generated from (Search "webservicetokens" / manage tokens) in site administration pages.


- **quizaccess_wifiresilience | prechecks**

  This option will display the technical details of the browser before commencing the exam. Checks are for service workers, local storage, request of increase of local storage and others.


- **quizaccess_wifiresilience | techerrors**

  This feature is useful to understand the underlying technical reason for the failure of exam submission. It only shows the error at the bottom of the submission page if there is any.


- **quizaccess_wifiresilience | navdetails**

  Show server and device status last time the data was saved (locally and on server). It also shows online status details (whether device/server is connected or not). It also displays a link for emergency file to be downloaded.


- **quizaccess_wifiresilience | watchxhr**

  One URL per line. Some question types require live checks or uploads with the server. If they are added here, the plugin will be able to count the time-offline for the user, and then add it automatically to the total extra time they get so they finish the exam with precise grace time or time limit.


- **quizaccess_wifiresilience | fetchandlog**

  One per line. If you want to cache attachements (of any static type; i.e. docx, pdf, xls, zip, html etc) that are embedded in some questions as extra resource or for further readings, then add the full URLs you want them to be cached. Example: https://example.org/instructions.docx will cache instructions.docx that is embedded in the question(s). Usually attachements in exams have "pluginfile.php" inside the link. Please note that for cross-origin (remote domains or different subdomains, please make sure both are served via https, and also those domains allow CORS. Important: This option can defeat security principles of cross domain communications, so please use with care, or better only use locally hosted files on same domain).


- **quizaccess_wifiresilience | precachefiles**

  Only static files. One link per line. If you would like the service worker to pre-cache specific files (only static file; ie. css, jpg, html etc), please add the direct link for them, one per line. Note: The precached URLs will automatically be served using a cache-first strategy.


- **quizaccess_wifiresilience | excludelist**

  Link/file per line. Exclude specific files/links from caching with service worker. This is useful when you want some files or links to be in NetworkOnly (never get cached) mode.


- **quizaccess_wifiresilience | extraroutes**

  Add extra routes to exam service worker. If you want exam service worker [Wifiresilience-SW] to catch extra routes (file extensions, web addresses, etc) and treat them differently when the connection drops.


##  Credits:


Quiz fault-tolerant mode from Tim Hunt: https://github.com/timhunt/moodle-quizaccess_offlinemode

##  Third-party libraries used:


1. The Stanford Javascript Crypto Library from https://github.com/bitwiseshiftleft/sjcl

2. JSEncrypt https://github.com/travist/jsencrypt


Important:

1. Please use this plugin at your own risk. We are not responsible for any unwanted effect or damage caused by the plugin.

2. The plugin is used as a pilot project for service workers and local storage, and shall not be taken as a complete job. Unless you have some technical knowledge, we advice you not to use it on production sites.

Screenshots

Screenshot #0

Contributors

ETHz
ETH Zürich (Lead maintainer)
Antonia Bonaccorso: Service owner, contact
Please login to view contributors details and/or to contact them

Comments RSS

Comments

  • Plugins bot
    Tue, 11 May 2021, 2:40 AM
    Approval issue created: CONTRIB-8541
  • Olivier Lischer
    Thu, 12 Oct 2023, 4:36 PM
    Hello all
    We try to set up an exam in Moodle using the Safe Exam Browser and the Wi-Fi Resilience Mode. However, when we try to finish the exam, we get an error if the exam has a question with free text answers. The error message is the following one:

    Thu, 12 Oct 2023 08:34:00 GMT: Fehler: mod_quiz\access_manager::get_end_time(): Argument #1 ($attempt) must be of type stdClass, mod_quiz\quiz_attempt given, called in [dirroot]/mod/quiz/accessrule/wifiresilience/sync.php on line 109 (generalexceptionmessage)

    Do others have the same error? Does somebody know how to fix this?
    Thanks in advance.
  • ETHz
    Thu, 12 Oct 2023, 4:40 PM
    Hi Olivier, what moodle version do you have? may I suggest to download the latest wifi plugin from here: https://github.com/ethz-let/moodle-quizaccess_wifiresilience/tree/main
  • Olivier Lischer
    Tue, 24 Oct 2023, 3:41 PM
    Thank you. With the latest version from the Github Repo it works again.
  • Enrique Castro
    Fri, 15 Mar 2024, 7:44 PM
    Hi, in these pages you indicate plugin version 4.4 is the latest available and that 4.4 is "Latest release for Moodle 4.1".
    But current version 4.4 of the plugin is NOT compatible with moodle 4.1 LTS.

    The code try to use features only available in moodle 4.2 or 4.3, so you get a fatal error if you install this updated 4.4 version of the plugin in moodle 4.1.
    With the undesired side effect that you cannot use the quiz module at all, because on entering the main quiz page the system checks for available accessrules and this one generates a fatal error, aborting loading.
    In the github repository you have branches for several moodle version. You have a branch for MOODLE_401_STABLE that should be compatible with moodle 4.1 LTS. But you have updated that specific branch, too, with features non-existent in moodle 4.1
Please login to post comments