Skip to content

Instantly share code, notes, and snippets.

@hawksprite
Created October 21, 2020 16:46
Show Gist options
  • Save hawksprite/40b3677d3ad8b3e6d98b977a13a4d44d to your computer and use it in GitHub Desktop.
Save hawksprite/40b3677d3ad8b3e6d98b977a13a4d44d to your computer and use it in GitHub Desktop.
let successTemplate = 'Looking at how you played, you were <adjective triggered by percentage> <style name>. You were <2 hardest process objectives achieved> which helped you <list of outcome objectives achieved>.<Statement about style when successful>. <Statement about connections to chart>.<Statement about learner growth from this successful experience>';
let failureTemplate = 'Looking at how you played, you were not very <style name>. You did manage to <List of 2 hardest objectives Achieved> but you <list of 3 easiest unachieved objectives>.<Statement of how to achieve style which is also the plan> <Statement about style when you fail>.<Statement about learner growth from this unsuccessful experience>. Maybe try this again using some of my advice?';
const successMessage = successTemplate
.replace('<adjective triggered by percentage>', '')
.replace('<style name>', this.convertScenarioToStyle(scenario))
.replace('<2 hardest process objectives achieved>', this.getBottomAdjectives(successObjectives, 2, "process"))
.replace('<list of outcome objectives achieved>', this.getTopAdjectives(successObjectives, 10, "outcome"))
.replace('<Statement about style when successful>', this.getSectionFromSheet2(configStatement, this.convertScenarioToX(scenario), 2))
.replace('<Statement about connections to chart>', this.getSectionFromSheet2(configStatement, this.convertScenarioToX(scenario), 3))
.replace('<Statement about learner growth from this successful experience>', this.getSectionFromSheet2(configStatement, this.convertScenarioToX(scenario), 4));
const failureMessage = failureTemplate
.replace('<style name>', this.convertScenarioToStyle(scenario))
.replace('<List of 2 hardest objectives Achieved>', this.getBottomAdjectives(successObjectives, 2, undefined))
.replace('<list of 3 easiest unachieved objectives>', this.getTopAdjectives(failedObjectives, 3, undefined))
.replace('<Statement of how to achieve style which is also the plan>', this.getSectionFromSheet2(configStatement, this.convertScenarioToX(scenario), 1))
.replace('<Statement about style when you fail>', this.getSectionFromSheet2(configStatement, this.convertScenarioToX(scenario), 5))
.replace('<Statement about learner growth from this unsuccessful experience>', this.getSectionFromSheet2(configStatement, this.convertScenarioToX(scenario), 6));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment