-
Notifications
You must be signed in to change notification settings - Fork 168
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
Game: Create a new quiz feature #2919
Conversation
Pull Request Test Coverage Report for Build 10237680885Details
💛 - Coveralls |
…fault (#2848) * Make compact components the new default and remove any mentions to the old components. Also removes the experimental button toggle. * Update test snapshots * Clean up testing code a little * Formatting changes * Fix some minor issues
* bumping js-slang * Update tests * remove obsolete snapshots --------- Co-authored-by: NhatMinh0208 <minhkhicon2468@gmail.com>
…store quiz questions to dialogue log
Remove the unnecessary use of parameterized type
simplify unnecessary conditional statement Co-authored-by: Richard Dominick <34370238+RichDom2185@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @CYX22222003 @reginateh - your work over the semester is much appreciated! This feature should be quite helpful for game storywriters moving forward 😄
Apart from the images (which I see you've posted), could you also provide a full example of a quiz being written in a checkpoint txt file? It would be helpful as a cross-reference.
Also, after this PR, please don't forget to update the documentation for the game developer guide & the storywriter guide!
Here are some small queries / nits to address:
refactor the logic of makeLineQuizScores method Co-authored-by: reginateh <154109919+reginateh@users.noreply.github.com>
remove unnecessary comment line
change method access modifiers
change method access modifiers
reformatting Co-authored-by: Lee Hyung Woon / 이형운 <leehyungwoonsamuel@gmail.com>
change variable name
change the parameters of game components setting
Here is a sample of quiz:
Use the
|
We have updated the game developer guide but we cannot push our changes of the storywriter guide to the general repo. |
Correct parsers' behavior for errors Co-authored-by: Lee Hyung Woon / 이형운 <leehyungwoonsamuel@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! All the issues I've brought up seem to either have been addressed, or will be opened as separate issues as they were deemed out-of-scope during our discussions.
Thank you both for working on this!
Description
Previously, the quiz feature of the game was implemented by jumping between dialogue segments based on the player's choices. We have now separated the quiz component from the dialogue objects and achieved the following improvements:
GameQuizManager
Renders the quiz using dialogue boxes and prompts UI. A prompt for players to choose whether they want to start the quiz is added before every quiz starts.
QuizParser
Parses the quiz content under the
quizzes
header in the story file.Saving quiz results
Quiz results are saved as an array of
[string, number]
pairs, representing thequizId
and the latest score of the corresponding quiz. The score of a quiz is the number of questions answered correctly.New actions & conditions
Adds new action
show_quiz
to show a quiz. Theshow_quiz
action is recommended to only be used in dialogues. During a quiz, the dialogue box and speaker belonging to the dialogue will be set invisible, and keyboard inputs will be disabled.New conditions
attemptedQuiz
,passedQuiz
, andquizScore
are added for story writers to check the completion status of a quiz.attemptedQuiz
is true if the player has played all questions in the given quiz, regardless of the scores obtained.passedQuiz
is true if the player has played all questions in the given quiz and got full marks.quizScore
is true if the score of the given quiz is greater than or equal to the given number.The syntax for conditions in txt file is as follows:
Interpolation of quiz scores in dialogues
Storywriters can insert quiz scores in dialogue lines. This allows writers to define how they want to show the quiz score. The syntax in txt file is similar to inserting the player's name in dialogues:
Type of change
How to test
As this feature should be backward compatible, all previous mock chapters on Source Academy & all chapters already uploaded on Source Academy should function without issues.
A mock chapter containing quizzes is used to test the new features in the game simulator.
Checklist