Skip to content

Game assessments state refreshes - #1891

Merged
angelsl merged 3 commits into
source-academy:multitenant/devfrom
gok99:game-assessments
Aug 3, 2021
Merged

angelsl merged 3 commits into
source-academy:multitenant/devfrom
gok99:game-assessments

Conversation

@gok99

@gok99 gok99 commented Aug 1, 2021 •

Copy link
Copy Markdown
Contributor

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