mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-23 23:58:02 -05:00
Fixed #2181, I hope.
This commit is contained in:
parent
6b9d8161ef
commit
e01e71d5e8
1 changed files with 15 additions and 16 deletions
|
@ -56,27 +56,26 @@ module.exports = class LadderSubmissionView extends CocoView
|
|||
failure = (jqxhr, textStatus, errorThrown) =>
|
||||
console.log jqxhr.responseText
|
||||
@setRankingButtonText 'failed' unless @destroyed
|
||||
transpiledCode = @transpileSession()
|
||||
@transpileSession (transpiledCode) =>
|
||||
|
||||
ajaxData =
|
||||
session: @session.id
|
||||
levelID: @level.id
|
||||
originalLevelID: @level.get('original')
|
||||
levelMajorVersion: @level.get('version').major
|
||||
transpiledCode: transpiledCode
|
||||
ajaxData =
|
||||
session: @session.id
|
||||
levelID: @level.id
|
||||
originalLevelID: @level.get('original')
|
||||
levelMajorVersion: @level.get('version').major
|
||||
transpiledCode: transpiledCode
|
||||
|
||||
$.ajax '/queue/scoring', {
|
||||
type: 'POST'
|
||||
data: ajaxData
|
||||
success: success
|
||||
error: failure
|
||||
}
|
||||
$.ajax '/queue/scoring', {
|
||||
type: 'POST'
|
||||
data: ajaxData
|
||||
success: success
|
||||
error: failure
|
||||
}
|
||||
|
||||
transpileSession: ->
|
||||
transpileSession: (callback) ->
|
||||
submittedCode = @session.get('code')
|
||||
codeLanguage = @session.get('codeLanguage') or 'javascript'
|
||||
@session.set('submittedCodeLanguage', codeLanguage)
|
||||
@session.save() # TODO: maybe actually use a callback to make sure this works?
|
||||
transpiledCode = {}
|
||||
for thang, spells of submittedCode
|
||||
transpiledCode[thang] = {}
|
||||
|
@ -85,7 +84,7 @@ module.exports = class LadderSubmissionView extends CocoView
|
|||
aetherOptions = createAetherOptions functionName: spellID, codeLanguage: codeLanguage
|
||||
aether = new Aether aetherOptions
|
||||
transpiledCode[thang][spellID] = aether.transpile spell
|
||||
transpiledCode
|
||||
@session.save null, success: -> callback transpiledCode
|
||||
|
||||
onHelpSimulate: ->
|
||||
@playSound 'menu-button-click'
|
||||
|
|
Loading…
Reference in a new issue