MCPcopy Index your code
hub / github.com/codecombat/codecombat / getSolutions

Method getSolutions

app/models/Level.js:502–518  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

500 }
501
502 getSolutions () {
503 const plan = this.getProgrammablePlan()
504 const solutions = _.cloneDeep(plan?.solutions || [])
505 const context = this.getCodeContext(plan)
506
507 return _.map(solutions, solution => {
508 try {
509 return {
510 ...solution,
511 source: _.template(solution.source)(context),
512 }
513 } catch (e) {
514 console.error(`Problem with template and solution comments for '${this.get('slug') || this.get('name')}'`, e)
515 return solution
516 }
517 })
518 }
519
520 getSampleCode (team = 'humans') {
521 const plan = this.getProgrammablePlan(team)

Callers 10

getSolutionCodeFunction · 0.95
getSolutionsMapMethod · 0.80
onLevelLoadedMethod · 0.80
levelToCodeMethod · 0.80
onTestLevelsLoadedMethod · 0.80
verifyMethod · 0.80
onConceptsLoadedMethod · 0.80
onThangsEditedMethod · 0.80
completeFunction · 0.80

Calls 5

getProgrammablePlanMethod · 0.95
getCodeContextMethod · 0.95
templateMethod · 0.80
errorMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected