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

Adds a split-run (A/B test) option to the module embedder. #2073

Open
wants to merge 3 commits into
base: dev/31-taconite
Choose a base branch
from

Conversation

FrenjaminBanklin
Copy link
Contributor

Closes #1453.

Allows instructors to embed either a single module (current behavior) or a split-run, which will send students to one of the two selected modules based on the timestamp of their user record creation in Obojobo.

…n embeds. Module selector modified to have an additional step prior to module selection allowing authors to embed a single module or a split-run, in which students will be directed to one of two selected modulesbased on the creation date of their user record. Added logic to the currentDocument middleware to choose one module if multiple options are available. Added a new page to the repository to handle the case of an instructor following a split-run embed link.
…ns breaking if the module wasn't in the last list that was loaded, new module button is now hidden when looking at the community collection list.
@FrenjaminBanklin FrenjaminBanklin marked this pull request as ready for review April 6, 2023 14:15
@RachelDau RachelDau self-requested a review April 12, 2023 12:12
Copy link
Contributor

@RachelDau RachelDau left a comment

Choose a reason for hiding this comment

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

It looks good and is working when I tested it out for both students and instructors.

My one question is since the module selection is based on when the user was created, should a particular user always go to the same module in a split. In my test, the same user did not always go to the same module when launching from the lti page. I am not sure if this is an issue. Here is the code I was looking at:
const chooseSplitRunDraft = (user, draftA, draftB) => (user.createdAt % 2 === 0 ? draftA : draftB)

can draftA and draftB switch on different runs? Will this impact students who I assume should always be taken to the same module once they begin from their webcourses.

@FrenjaminBanklin
Copy link
Contributor Author

Since the module presented in a split-run embed depends on the user's creation timestamp in the database, they should be getting the same one every time. I'm fairly certain that code is working properly - the thing that's changing sporadically appears to be user.createdAt. I'm going to investigate and see if I can figure out why.

…he model's createdAt value so it can be used in subsequent functions.
@FrenjaminBanklin
Copy link
Contributor Author

It looks like there were competing expectations for when the individual validators would be running. As part of the LTI launch/user login process req.currentUser was being set with the current timestamp as the createdAt value, which of course is not the same as the user's created_at value. Modified the User model to always update createdAt when running saveOrCreate, seems to have made results more consistent.

@RachelDau RachelDau self-requested a review May 2, 2023 12:37
Copy link
Contributor

@RachelDau RachelDau left a comment

Choose a reason for hiding this comment

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

looks good to me, what a cool feature

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.

2 participants