TIM-JYU / TIM

TIM (The Interactive Material) is an open-source cloud-based platform for creating interactive learning documents.
https://tim.education/view/about/en-US
MIT License
13 stars 4 forks source link

userselect: Add 'verifyFields' field #3654

Closed dezhidki closed 1 month ago

dezhidki commented 1 month ago

Testisivu: https://timdevs01-5.it.jyu.fi/view/users/dz-dz/test-userselect-verify (mikä tahansa testikäyttäjä käy) Käyttäjät jaettu paikkakuntiin seuraavasti:

Usage:

verifyFields:
  - field: "%%docid%%.paikkakunta"  # What field value to check
    expectedValue: "%%paikkakunta%%" # The value that is expected to show. This can be specified via a url macro
    failMessage: "Hakija '{realname}' on väärällä paikkakunnalla! Hänen pitäisi olla paikkakunnalla '{expected}'." # What message to show if the check fails
    isError: false # If true, the message is displayed as an error instead as a warning that a user can skip

The option allows for userSelect to verify that the user has specific values in specific fields before allowing to verify. This can be used to e.g. alert supervisors if a person needs to be at another place.