ExperimentSession.abort()#

ExperimentSession.abort(reason: str, title: str = 'Experiment aborted', msg: str = 'Sorry! The experiment was aborted.', icon: str = 'mug-hot', page: Optional[alfred3.page.Page] = None)[source]#

Aborts the experiment session.

Parameters
  • reason (str) – The reason for which the session was aborted.

  • title (str) – Title of the abort page.

  • msg (str) – Message displayed on the abort page.

  • icon (str) – Name of the icon that you wish to show on the page. All free icons from Font Awesome 5 can be used: https://fontawesome.com/icons?d=gallery&p=1&m=free

  • page (alfred3.page.Page) – A custom page that you want to display upon experiment abortion. If you use this argument, the arguments title and msg will be ignored.

When a session is aborted, the experiment will jump to the “Abort Page”, informing the participant about the event.

In an aborted experiment, the movement system is shut down. The corresponding dataset will contain the info that the session was aborted, as well as the reason.

Examples

This is a minimal example of a participant screening. In this case, the experiment will abort:

import alfred3 as al
exp = al.Experiment()

@exp.member
class Screening(al.Page):
    title = "Participant Screening"

    def on_exp_access(self):
        self += al.NumberEntry(leftlab="Please enter your age", name="age", force_input=True)

    def on_first_hide(self):
        if int(self.exp.values.get("age")) < 25:
            self.exp.abort(
                reason="screening",
                title="Experiment aborted",
                icon="users",
                msg="Sorry, you do not fulfill the criteria for participation."
                )