Skip to content

Page that won't let you continue until all questions are answered correctly #247

Discussion options

You must be logged in to vote

There are two ways to do this.

Because Option 2 is not documented, I recommend Option 1.

Option 1: Page.custom_move()

You can use the Page.custom_move() hook. This hook is used to conduct manually specified movements. Usually, you would use ExperimentSession.forward() or ExperimentSession.backward() or ExperimentSession.jump() inside this method. But if it returns a "falsy" value like False or None without any custom movement, alfred will just stay on the same page. To fall back to alfreds normal movement system, you can define a case in which the method returns True. In your example, that could look like this:

import alfred3 as al

exp = al.Experiment()

@exp.member
class Demo(al.Page): …

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@slussinator
Comment options

@jobrachem
Comment options

Comment options

You must be logged in to vote
2 replies
@slussinator
Comment options

@jobrachem
Comment options

Answer selected by slussinator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants