Skip to content

Game assessments state refreshes #1891

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

Merged
merged 3 commits into from
Aug 3, 2021

Conversation

gok99
Copy link
Contributor

@gok99 gok99 commented Aug 1, 2021

Description

NOTE: Please do not merge this till the Rook PR #1878 has been reviewed and merged

This PR introduces ways to update the game when student missions are updated, without having to refresh/navigate away from game.

Features:

  • Adds a Back button in the Go to My Room scene
  • Adds a Refresh button in the Go to My Room scene that fetches and updates student code, before restarting the scene

  • update_assessment_status action for txt files that updates the game's userstate.assessments
  • Conditional goto support that allows statements like:
    • goto 2
    • goto 2 if !userstate.assessments.173
    • goto 2 if !userstate.assessments.173 else 3

Below is an example dialogue that uses the update_assessment_status action and conditional gotos:

unwelcome
    1
    @scottie, sad
    You haven't finished assessment
    Finish assessment 173 first and come back?
        navigate_to_assessment(173)
    goto 2 
    2
    @scottie
    Have you finished the assignment?
      prompt: Have you finished?
          Yes -> goto 4
          I don't want to -> goto 3
    3
    @scottie
    OK
    4
    @scottie
    Hmmm
        update_assessment_status*()
    Let me check
    goto 2 if !userstate.assessments.173 else 3

Type of change

  • New feature (non-breaking change which adds functionality)

How to test

Replace public/asssets/mockChapter0.txt with the txt file below, replacing instances of 173 with the mission id of interest.

mockChapter0.txt

Run the Spaceship Emergency chapter under Play Chapter, and navigate to assessment when prompted. Try proceeding with the dialogue before/after finalizing your mission submission.

Checklist

  • I have tested this code
  • I have updated the documentation

@gok99 gok99 changed the title Game assessments state refreshes Game assessments state refreshes (do NOT merge till the main Rook PR #1878 is merged) Aug 1, 2021
@angelsl angelsl changed the title Game assessments state refreshes (do NOT merge till the main Rook PR #1878 is merged) Game assessments state refreshes Aug 3, 2021
@gok99 gok99 force-pushed the game-assessments branch from 9931b91 to 0c07224 Compare August 3, 2021 15:27
@gok99 gok99 requested a review from anthony-halim August 3, 2021 15:33
@angelsl angelsl merged commit bbfbb0f into source-academy:multitenant/dev Aug 3, 2021
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.

3 participants