| 32 | } |
| 33 | |
| 34 | initialize (options) { |
| 35 | this.level = options.level |
| 36 | this.course = options.course |
| 37 | this.classroom = options.classroom // not guaranteed to exist (eg. when teacher is playing) |
| 38 | this.nextLevel = options.nextLevel |
| 39 | this.nextAssessment = options.nextAssessment |
| 40 | this.levelSessions = options.levelSessions |
| 41 | this.session = options.session |
| 42 | this.courseInstanceID = options.courseInstanceID |
| 43 | // Translate and Markdownify level description, but take out any images (we don't have room for arena banners, etc.). |
| 44 | // Images in Markdown are like  |
| 45 | this.nextLevel.get('description', true) // Make sure the defaults are available |
| 46 | this.nextLevelDescription = marked(utils.i18n(this.nextLevel.attributesWithDefaults, 'description').replace(/!\[.*?\]\(.*?\)\n*/g, '')) |
| 47 | this.nextAssessment.get('description', true) // Make sure the defaults are available |
| 48 | this.nextAssessmentDescription = marked(utils.i18n(this.nextAssessment.attributesWithDefaults, 'description').replace(/!\[.*?\]\(.*?\)\n*/g, '')) |
| 49 | if (this.level.isProject()) { |
| 50 | this.shareURL = urls.playDevLevel({ level: this.level, session: this.session, course: this.course }) |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | onClickDoneButton () { |
| 55 | return this.trigger('done') |