(team = 'humans')
| 518 | } |
| 519 | |
| 520 | getSampleCode (team = 'humans') { |
| 521 | const plan = this.getProgrammablePlan(team) |
| 522 | const sampleCode = _.cloneDeep(plan?.languages || {}) |
| 523 | sampleCode.javascript = plan?.source |
| 524 | const context = this.getCodeContext(plan) |
| 525 | |
| 526 | _.forEach(sampleCode, (code, language) => { |
| 527 | try { |
| 528 | sampleCode[language] = _.template(code)(context) |
| 529 | } catch (e) { |
| 530 | console.error(`Problem with template and solution comments for '${this.get('slug') || this.get('name')}'`, e) |
| 531 | } |
| 532 | }) |
| 533 | |
| 534 | return sampleCode |
| 535 | } |
| 536 | |
| 537 | getSolutionForLanguage (language) { |
| 538 | if (!language) { return '' } |
no test coverage detected