<<set setup.version to 0.1>>
<<set setup.scenarios to []>>
<<run setup.loadScenarios()>>
<<set setup.categorizedScenarios to {}>>
<<set $voiceOver to true>>
<<set $analytics>>
<<set $initialComplexity>>
<<set $finalComplexity>>
/*<<run setup.categorizeScenarios(setup.scenarios)>>*/
<<set $studentChar to [
{
name: "Léa",
compLvl: 0,
goalType: [0,3],
bio: "Léa is a friendly and creative student who loves drawing and decorating her notebook. She often helps her classmates with small tasks and enjoys being noticed for her kindness. Sometimes, she gets distracted during lessons because she starts doodling instead of taking notes. Her teacher sees a lot of potential in her enthusiasm and imagination."
},
{
name: "Émile",
compLvl: 0,
goalType: [0,3],
bio: "Émile is curious and full of energy, always eager to share what he knows about video games or hockey. He learns quickly but can lose focus when the activity feels too easy for him. He sometimes talks out of turn, trying to make his classmates laugh. His confidence makes him a natural leader when guided in the right way."
},
{
name: "Camille",
compLvl: 0,
goalType: [0,3],
bio: "Camille is quiet and polite, often finishing her work neatly and on time. She loves reading short English stories and takes pride in pronouncing words correctly. However, she sometimes gets anxious when she has to speak in front of the class. With encouragement, she slowly gains confidence in sharing her ideas aloud."
},
{
name: "Olivier",
compLvl: 0,
goalType: [0,3],
bio: "Olivier is bright and curious, often asking questions that go beyond the lesson. He enjoys challenging himself but can become impatient when things move too slowly. Occasionally, he argues about classroom rules, wanting to prove his point. When given responsibilities, he thrives and takes them seriously."
},
{
name: "Florence",
compLvl: 0,
goalType: [0,3],
bio: "Florence is hardworking and thoughtful, especially during writing activities. She sometimes gets frustrated when her efforts don’t lead to perfect results. At times, she compares herself to others and gives up too quickly. Gentle reassurance helps her regain motivation and pride in her progress."
},
{
name: "William",
compLvl: 0,
goalType: [0,3],
bio: "William is cheerful and talkative, always ready to start a conversation in English. His classmates like him, but he sometimes forgets to listen when others are speaking. He can get restless during longer lessons, fidgeting or whispering to friends. Positive redirection usually helps him refocus quickly."
},
{
name: "Thomas",
compLvl: 0,
goalType: [0,3],
bio: "Thomas is a bright thinker who enjoys puzzles and problem-solving tasks. He likes helping others but can get competitive when playing team games. Occasionally, he gets upset if he feels something is unfair. When recognized for his cooperation, his energy turns fully positive."
},
{
name: "Rosalie",
compLvl: 0,
goalType: [0,3],
bio: "Rosalie is kind and empathetic, often the first to notice when a classmate is struggling. She participates actively in group work but sometimes talks too much while trying to encourage others. When she feels ignored, she might become chatty or distracted. Her warmth makes her a strong connector in class discussions."
},
{
name: "Jacob",
compLvl: 0,
goalType: [0,3],
bio: "Jacob is quiet but attentive, absorbing details others might miss. He enjoys hands-on activities and prefers working with clear instructions. Sometimes, when unsure of himself, he avoids asking for help and stays stuck. A bit of encouragement goes a long way in helping him take initiative."
},
{
name: "Charlotte",
compLvl: 0,
goalType: [0,3],
bio: "Charlotte is creative and expressive, often bringing humor and color to class presentations. She loves performing but can get distracted when the topic doesn’t interest her. At times, she interrupts others to share her ideas quickly. When engaged in something she enjoys, she becomes one of the most focused students in the room."
}
]>><<set $seenScenarios to []>>
<<run setup.initializeStudents()>>
<<run setup.initAnalytics()>>
<h1>Welcome to The De-Escalation Game!</h1>
<p>This is a prototype for a game that aims to help you practice responding to class misbehavior. Since this is an early stage prototype, you might find mistakes and things that don't work perfectly yet. Please note them and mention them to us in the feedback form!</p>
<b>Very Important: When you are done playing, please make sure to press the Finish Up button on the sidebar to log your data with us and access the feedback form.</b> With your support, we can make this game better!
<br>
<br>
<<button "Start" "Main">><</button>><<set _s to clone(setup.scenarios[0])>>
<<set _scenarioText to setup.replaceStudent(_s.scenario, $studentChar.name)>>
<h3><<print _s.title>></h3>
<p><<print _scenarioText>></p>Your students are: <br>
<div id="studentTracker">
<<include StudentTracker>>
</div>
<br>
<<button "Finish Up" "Finish">>
<<run setup.finishSession()>>
<</button>>
<br>
<div id="voiceOverToggle">
<<include VoiceOverToggle>>
</div>
<br>
<<button "Restart" "Start">><</button>><<for _i to 0; _i < $studentChar.length; _i++>>
<div @class="'studentBlock c'+$studentChar[_i].compLvl" >
<<print $studentChar[_i].name>>
<div class="tooltip">
<<print $studentChar[_i].bio>>
</div>
</div>
<</for>><<if $voiceOver>>
<<button "Turn VoiceOver Off">>
<<set $voiceOver to false>>
<<run setup.stopSpeaking()>>
<<run setup.renderInto("#voiceOverToggle","VoiceOverToggle")>>
<</button>>
<<else>>
<<button "Turn VoiceOver On">>
<<set $voiceOver to true>>
<<run setup.renderInto("#voiceOverToggle","VoiceOverToggle")>>
<</button>>
<</if>><<run setup.sendAnalyticsToGoogleForm("https://docs.google.com/forms/d/e/1FAIpQLScCFVpnhZnm7G53LKdUB9ORhbv0Vk_WsOa87eA-gE-B39QxVw/formResponse","entry.249370858")>>
<h1>Thank you for playing!</h1>
<b>Your session id is: <<print $analytics.sessionId>></b><br>
Please copy it for the feedback form.
<br>
If you have any questions or comments, please let us know during this session, or add them on the form below.<br>
Please help us by filling out our feedback form in the link below:<br>
<br>
<<button "Fill Form">>
<<run window.open("https://forms.office.com/pages/responsepage.aspx?id=hfFpVS_SE06YUM5bGrzS6C2qaFNWW95Aj1TRnvKo7chUOUZYM05ZNlJQNUNUMTlRM1dTTkRZWTJKUC4u&route=shorturl", "_blank")>>
<</button>>
/* https://docs.google.com/forms/d/e/1FAIpQLScCFVpnhZnm7G53LKdUB9ORhbv0Vk_WsOa87eA-gE-B39QxVw/viewform?usp=pp_url&entry.249370858=test
https://docs.google.com/forms/d/e/1FAIpQLScCFVpnhZnm7G53LKdUB9ORhbv0Vk_WsOa87eA-gE-B39QxVw/formResponse*/<<set $choice to -1>>
<<set $result to -1>>
<<set _currentStudent to setup.getCurrentStudent()>>
<<set _id to setup.getScenarioId(_currentStudent)>>
<<set _explanation to "">>
<<set _isExpected to false>>
<<if _id !== null>>
<<set $seenScenarios.push(_id)>>
<<set _currentScenario to clone(setup.scenarios[_id])>>
/*Log the scenario into analytics*/
<<run setup.logScenarioStart(_currentStudent, _currentScenario)>>
<<set _scenarioText to setup.replaceStudent(_currentScenario.scenario, _currentStudent.name)>>
<<run setup.speakText(_scenarioText)>>
<div id="choice-block">
<h3>The Situation</h3>
<p><<print _scenarioText>></p>
<<for _i to 0; _i < _currentScenario.choices.length; _i++>>
<<set _optionText to setup.replaceStudent(_currentScenario.choices[_i].text, _currentStudent.name)>>
<div class="option-column">
<<capture _i>>
<<button _optionText>>
<<set $choice to _i>>
<<run setup.stopSpeaking()>>
<<run console.log("Your choice is: "+$choice)>>
<<set $result to setup.studentResponse(_currentStudent, _currentScenario, $choice)>>
/*Log Choice into analytics*/
<<run setup.logChoice($choice, $result)>>
<<set _explanation to setup.replaceStudent(_currentScenario.choices[$choice].explanation, _currentStudent.name)>>
<<replace "#choice-block">>
<<include ResultPassage>>
<</replace>>
<</button>>
<</capture>>
</div>
<</for>>
</div>
<<else>>
<p>You've completed all available scenarios!</p>
<</if>><h3> The Result </h3>
<<switch $result>>
<<case 0>> <<print _currentStudent.name>> reacts positively to your intervention. Your class continues.
<<case 1>> <<print _currentStudent.name>> reacts very positively to your intervention. You might have an easier time with them in the future.
<<case 2>> <<print _currentStudent.name>> reacts negatively to your intervention. While the issue is resolved for now, you might have a harder time with them in the future.
<<default>> Something is wrong.
<</switch>>
<br>
<br>
<div id="explanation-block">
<h3>Feedback Time!</h3>
Your intervention corresponds to Bump <<print _currentScenario.choices[$choice].bump>>.
<br>
<p><<print _explanation>></p>
</div>
<br>
<<run setup.speakText(_explanation)>>
<<button "Next Scenario">><<goto "Main">><</button>>
<<run setup.renderInto("#studentTracker","StudentTracker")>>Lorem Ipsum...
Feel free to completely edit this.