campsych / concerto-platform

Concerto Platform - Open-Source Online Adaptive Testing Platform
https://concertoplatform.com/
Apache License 2.0
153 stars 88 forks source link

Exiting a test without finishing it or without closing #336

Closed BogdanDitoiu closed 2 years ago

BogdanDitoiu commented 3 years ago

Is it possible to create a button to branch out of an assessment?

I have added an escape button, together with the back and next, and have created a different branch out of the assessment node ( so it has out and a new one with the button name).

Expected (and wanted behaviour) is when pressed and page is submitted, the test and move to the next node when the button is pushed, however the assessment just moves on to the next question.

is there another way of implementing this?

BogdanDitoiu commented 3 years ago

I've managed implementing it

The idea was to have a test made out of subtests, each checking a different skill, sub-tests that are skippable themselves - user picks a sub-test, and if the questions for that 'skill' are too hard he can press the skip button and be brough back to the choose subtest page.

was easy to implement

  1. added a button named 'endtest' to the test template
  2. instead of using the assessment node I copied the _assessment flow as it is in my test flow (setting the variables as they would have been in the assessment node)
  3. In the show item step add if(templateResponse$buttonPressed == "end") { .branch = "end" } point the branch to where you want to go back and voila.
vesspopov commented 2 years ago

Thanks Bogdan for posting your solution. There's also a tutorial on branching your test logic, if helpful for others: https://github.com/campsych/concerto-platform/wiki/Branch-Your-Test-Logic