Merge branch 'master' into production

This commit is contained in:
Nick Winter 2016-01-25 12:29:33 -08:00
commit a1d6341aa3
8 changed files with 14 additions and 12 deletions

BIN
app/assets/docs/CodeCombatTeacherGuideCourse2.pdf Executable file → Normal file

Binary file not shown.

View file

@ -62,7 +62,7 @@ module.exports = class Tracker
@explicitTraits ?= {}
@explicitTraits[key] = value for key, value of traits
for userTrait in ['email', 'anonymous', 'dateCreated', 'name', 'testGroupNumber', 'gender', 'lastLevel', 'siteref', 'ageRange']
for userTrait in ['email', 'anonymous', 'dateCreated', 'name', 'testGroupNumber', 'gender', 'lastLevel', 'siteref', 'ageRange', 'schoolName', 'coursePrepaidID']
traits[userTrait] ?= me.get(userTrait)
console.log 'Would identify', me.id, traits if debugAnalytics
return unless @isProduction and not me.isAdmin()

View file

@ -82,7 +82,7 @@ module.exports = class LankBoss extends CocoClass
console.error 'Lank collision! Already have:', id if @lanks[id]
@lanks[id] = lank
@lankArray.push lank
layer ?= @layerAdapters['Obstacle'] if lank.thang?.spriteName.search(/(dungeon|indoor|ice).wall/i) isnt -1
layer ?= @layerAdapters['Obstacle'] if lank.thang?.spriteName.search(/(dungeon|indoor|ice|classroom).wall/i) isnt -1
layer ?= @layerForChild lank.sprite, lank
layer.addLank lank
layer.updateLayerOrder()
@ -204,7 +204,7 @@ module.exports = class LankBoss extends CocoClass
cacheObstacles: (updatedObstacles=null) ->
return if @cachedObstacles and not updatedObstacles
lankArray = @lankArray
wallLanks = (lank for lank in lankArray when lank.thangType?.get('name').search(/(dungeon|indoor|ice).wall/i) isnt -1)
wallLanks = (lank for lank in lankArray when lank.thangType?.get('name').search(/(dungeon|indoor|ice|classroom).wall/i) isnt -1)
return if _.any (s.stillLoading for s in wallLanks)
walls = (lank.thang for lank in wallLanks)
@world.calculateBounds()

View file

@ -23,7 +23,7 @@ module.exports = class User extends CocoModel
return name if name
email = @get('email')
return email if email
return ''
return 'Anoner'
getPhotoURL: (size=80, useJobProfilePhoto=false, useEmployerPageAvatar=false) ->
photoURL = if useJobProfilePhoto then @get('jobProfile')?.photoURL else null

View file

@ -55,7 +55,7 @@ block content
for user in view.users.models
.row
.col-md-6
.student-name= user.broadName() || 'Anoner'
.student-name= user.broadName()
.col-md-6
if view.teacherMode
a.remove-student-link.pull-right.text-uppercase(data-user-id=user.id)

View file

@ -79,6 +79,7 @@ module.exports = class ClassroomView extends RootView
onLoaded: ->
@teacherMode = me.isAdmin() or @classroom.get('ownerID') is me.id
userSessions = @sessions.groupBy('creator')
@users.remove(@users.where({ deleted: true }))
for user in @users.models
user.sessions = new CocoCollection(userSessions[user.id], { model: LevelSession })
user.sessions.comparator = 'changed'

View file

@ -104,13 +104,11 @@ class SolutionsNode extends TreemaArrayNode
onClickFillDefaults: (e) =>
e.preventDefault()
sources = {}
if source = @parent.data.source
sources.javascript = source
sources = { javascript: @parent.data.source }
_.extend sources, @parent.data.languages or {}
solutions = _.clone(@data)
solutions = _.filter(solutions, (solution) -> not _.isEmpty(solution) )
for language in _.keys(sources)
source = sources[language]
solution = _.findWhere(solutions, {language: language})

View file

@ -154,7 +154,10 @@ module.exports = class DocFormatter
content = popoverTemplate doc: @doc, docName: docName, language: @options.language, value: @formatValue(), marked: marked, argumentExamples: argumentExamples, writable: @options.writable, selectedMethod: @options.selectedMethod, cooldowns: @inferCooldowns(), item: @options.item
owner = if @doc.owner is 'this' then @options.thang else window[@doc.owner]
content = @replaceSpriteName content
content.replace /\#\{(.*?)\}/g, (s, properties) => @formatValue downTheChain(owner, properties.split('.'))
content = content.replace /\#\{(.*?)\}/g, (s, properties) => @formatValue downTheChain(owner, properties.split('.'))
content = content.replace /{([a-z]+)}([^]*?){\/\1}/g, (s, language, text) =>
if language is @options.language then return text
return ''
replaceSpriteName: (s) ->
# Prefer type, and excluded the quotes we'd get with @formatValue