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 stage 4 waiting room #554

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

Carifio24
Copy link
Member

This PR adds an implementation of the stage 4 waiting room. The behavior here differs slightly from the Voila version in that we now activate the advance button when enough students have completed their data, rather than the abrupt transition in the Voila version.

At the moment this si a bit difficult to test. I was able to test the class data polling functionality by continually using a dynamic checking condition:

    async def keep_checking_class_data():
        count = 0
        enough_students_ready = Ref(LOCAL_STATE.fields.enough_students_ready)
        while not enough_students_ready.value:
            points = load_class_data()
            count += 1
            ready = len(points) >= 100 - 10 * count
            # Some logging statements for checking values
            logger.info(100 - 10 * count)
            logger.info(ready)
            logger.info(enough_students_ready.value)
            logger.info("======")
            if ready:
                enough_students_ready.set(True)
            await asyncio.sleep(2)  # This sets how often (in seconds) we re-check the class data

Also, if you then want to reset the enough_students_ready in your student's story state, you can run

UPDATE cosmicds_db.StoryStates 
SET story_state = JSON_SET(story_state, '$.story.enough_students_ready', false)
WHERE student_id = <your-student-id>;

@Carifio24 Carifio24 marked this pull request as draft August 23, 2024 16:06
@Carifio24 Carifio24 force-pushed the sitting-in-the-waiting-room branch from 9bb2a74 to fb3d654 Compare October 28, 2024 20:03
@Carifio24 Carifio24 marked this pull request as ready for review November 18, 2024 16:38
@Carifio24 Carifio24 force-pushed the sitting-in-the-waiting-room branch from 60c716e to 76a70b1 Compare November 19, 2024 06:31
@Carifio24 Carifio24 mentioned this pull request Nov 19, 2024
20 tasks
@Carifio24 Carifio24 marked this pull request as draft December 4, 2024 16:48
@Carifio24
Copy link
Member Author

Marking as a draft again while I make some updates to handle some items from #660.

@Carifio24 Carifio24 marked this pull request as ready for review December 11, 2024 22:06
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.

1 participant