Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ruleset template #302

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open

Conversation

albertas-jn
Copy link
Contributor

Closes #99

feedback_form=Form([question], submit_label='Continue', is_profile=True)).action()
for question in questions
]

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To my understanding, a questionnaire cannot be part of first_round. We don't have a session before the StartSession view, so we wouldn't be able to process the results. So better to move this to next_round instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As things are now, we save profile data with Participant, so asking Profile questions in the first_round() is common in many experiments. If we decide to link Profile answers to Session, then many other experiments will also have to be modified.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't been able to find any experiment rules in which there are Profile questions in the first round. For the participant, the difference should also not be noticeable, as StartSession is a "silent" view.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example, the categorization experiment has a questionnaire in the first_round. Consent is also a profile question that is in every experiment's first_round.

It should not be noticeable to the participant, but the implementation depends on what our choice for saving Profile questions will be.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say the Categorization experiment is an atypical case, so perhaps better to follow the majority of the experiments here, which don't ask questions before StartSession?

session.save()

# Calculate average score
score_avg = session.result_set.all().aggregate(Avg('score'))['score__avg']
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this should be also moved to a class method get_final_view or something along these lines? This makes this easier to override.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point

Copy link
Collaborator

@BeritJanssen BeritJanssen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Also like the overview of the steps to be done in order to set up the experiment. I'd only suggest to factor out the final view, so this can be more easily overridden.

@albertas-jn albertas-jn marked this pull request as draft January 25, 2023 09:30
@albertas-jn albertas-jn marked this pull request as ready for review June 13, 2023 09:15
Copy link
Collaborator

@BeritJanssen BeritJanssen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to have this updated, thanks! Before we merge though -- I've been wondering whether we can make the base.py class the template, as all other rules files derive from that. It would be neat if the template is in itself a working experiment, then subclassing / overriding functions would make the first steps towards your own experiment easiest. Perhaps something to look into tomorrow?

@@ -200,6 +201,6 @@ def get_feedback(cls, session):
instruction=instruction,
steps=[],
button_label=button_label
).action()
)

return feedback
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing emtpy line

@albertas-jn albertas-jn mentioned this pull request Feb 9, 2024
@drikusroor
Copy link
Contributor

Should we close this PR now that we have a ruleset template in the createexperiment / createruleset command?

@BeritJanssen
Copy link
Collaborator

We should incorporate this work as a starting place for the 2AFC paradigm, I think. I'm thinking manage.py createruleset -t 2AFC , with -t as an optional flag to switch between experiment types, and create an extra template based on this PR.

@drikusroor
Copy link
Contributor

We should incorporate this work as a starting place for the 2AFC paradigm, I think. I'm thinking manage.py createruleset -t 2AFC , with -t as an optional flag to switch between experiment types, and create an extra template based on this PR.

Okay, in that case we might want to update the name of this PR and its corresponding issue to avoid confusion.

@albertas-jn
Copy link
Contributor Author

I have updated this PR to reflect new changes in our infrastructure.

I am not sure if there is any need to use a command to "generate" this template, because it is already "generated" and sitting in the rules directory. I think we should merge it as it is, close this PR and reopen if we come up with new ideas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ruleset templates
3 participants