mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-23 23:58:02 -05:00
Save user code errors without 'Line N: ' prefix
This commit is contained in:
parent
42b81fd55e
commit
f4426f2e43
3 changed files with 9 additions and 1 deletions
|
@ -15,6 +15,7 @@ _.extend UserCodeProblemSchema.properties,
|
||||||
errId: {type: 'string'}
|
errId: {type: 'string'}
|
||||||
errLevel: {type: 'string'}
|
errLevel: {type: 'string'}
|
||||||
errMessage: {type: 'string'}
|
errMessage: {type: 'string'}
|
||||||
|
errMessageNoLineInfo: {type: 'string'}
|
||||||
errRange: {type: 'array'}
|
errRange: {type: 'array'}
|
||||||
errType: {type: 'string'}
|
errType: {type: 'string'}
|
||||||
language: {type: 'string'}
|
language: {type: 'string'}
|
||||||
|
|
|
@ -539,7 +539,13 @@ module.exports = class SpellView extends CocoView
|
||||||
@userCodeProblem.set 'errHint', aetherProblem.hint if aetherProblem.hint
|
@userCodeProblem.set 'errHint', aetherProblem.hint if aetherProblem.hint
|
||||||
@userCodeProblem.set 'errId', aetherProblem.id if aetherProblem.id
|
@userCodeProblem.set 'errId', aetherProblem.id if aetherProblem.id
|
||||||
@userCodeProblem.set 'errLevel', aetherProblem.level if aetherProblem.level
|
@userCodeProblem.set 'errLevel', aetherProblem.level if aetherProblem.level
|
||||||
@userCodeProblem.set 'errMessage', aetherProblem.message if aetherProblem.message
|
if aetherProblem.message
|
||||||
|
@userCodeProblem.set 'errMessage', aetherProblem.message
|
||||||
|
# Save error message without 'Line N: ' prefix
|
||||||
|
messageNoLineInfo = aetherProblem.message
|
||||||
|
if lineInfoMatch = messageNoLineInfo.match /^Line [0-9]+\: /
|
||||||
|
messageNoLineInfo = messageNoLineInfo.slice(lineInfoMatch[0].length)
|
||||||
|
@userCodeProblem.set 'errMessageNoLineInfo', messageNoLineInfo
|
||||||
@userCodeProblem.set 'errRange', aetherProblem.range if aetherProblem.range
|
@userCodeProblem.set 'errRange', aetherProblem.range if aetherProblem.range
|
||||||
@userCodeProblem.set 'errType', aetherProblem.type if aetherProblem.type
|
@userCodeProblem.set 'errType', aetherProblem.type if aetherProblem.type
|
||||||
@userCodeProblem.set 'language', aether.language.id if aether.language?.id
|
@userCodeProblem.set 'language', aether.language.id if aether.language?.id
|
||||||
|
|
|
@ -11,6 +11,7 @@ class UserCodeProblemHandler extends Handler
|
||||||
'errId'
|
'errId'
|
||||||
'errLevel'
|
'errLevel'
|
||||||
'errMessage'
|
'errMessage'
|
||||||
|
'errMessageNoLineInfo'
|
||||||
'errRange'
|
'errRange'
|
||||||
'errType'
|
'errType'
|
||||||
'language'
|
'language'
|
||||||
|
|
Loading…
Reference in a new issue