MCPcopy Create free account
hub / github.com/codecombat/codecombat / initialize

Method initialize

app/views/play/level/modal/ProgressView.js:34–52  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

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 ![description](url)
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')

Callers

nothing calls this directly

Calls 2

isProjectMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected