Add codeLanguage to level session

This commit is contained in:
Michael Schmatz 2014-05-14 16:41:01 -07:00
parent dd1acb94ed
commit 4e268d8dc6
2 changed files with 7 additions and 4 deletions
app/schemas/models
server/levels/sessions

View file

@ -108,7 +108,11 @@ _.extend LevelSessionSchema.properties,
additionalProperties:
type: 'string'
format: 'javascript'
codeLanguage:
type: 'string'
default: 'javascript'
teamSpells:
type: 'object'
additionalProperties:
@ -146,8 +150,7 @@ _.extend LevelSessionSchema.properties,
submittedCodeLanguage:
type: 'string'
default: 'javascript'
enum: ['javascript', 'coffeescript', 'clojure', 'lua','python']
transpiledCode:
type: 'object'
additionalProperties:

View file

@ -6,7 +6,7 @@ TIMEOUT = 1000 * 30 # no activity for 30 seconds means it's not active
class LevelSessionHandler extends Handler
modelClass: LevelSession
editableProperties: ['multiplayer', 'players', 'code', 'completed', 'state',
editableProperties: ['multiplayer', 'players', 'code', 'codeLanguage', 'completed', 'state',
'levelName', 'creatorName', 'levelID', 'screenshot',
'chat', 'teamSpells', 'submitted', 'unsubscribed']
jsonSchema: require '../../../app/schemas/models/level_session'