diff --git a/app/assets/docs/CodeCombatTeacherGuideCourse2.pdf b/app/assets/docs/CodeCombatTeacherGuideCourse2.pdf old mode 100755 new mode 100644 index b070829ad..32dbae708 Binary files a/app/assets/docs/CodeCombatTeacherGuideCourse2.pdf and b/app/assets/docs/CodeCombatTeacherGuideCourse2.pdf differ diff --git a/app/core/Tracker.coffee b/app/core/Tracker.coffee index 2e8e13fc6..f94669d6f 100644 --- a/app/core/Tracker.coffee +++ b/app/core/Tracker.coffee @@ -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() diff --git a/app/lib/surface/LankBoss.coffee b/app/lib/surface/LankBoss.coffee index bcf014ac4..ca8e1c71e 100644 --- a/app/lib/surface/LankBoss.coffee +++ b/app/lib/surface/LankBoss.coffee @@ -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() diff --git a/app/models/User.coffee b/app/models/User.coffee index 99e2ad771..4c03a68f1 100644 --- a/app/models/User.coffee +++ b/app/models/User.coffee @@ -19,11 +19,11 @@ module.exports = class User extends CocoModel broadName: -> name = @get('name') return name if name - name = _.filter([@get('firstName'), @get('lastName')]).join('') + name = _.filter([@get('firstName'), @get('lastName')]).join(' ') 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 diff --git a/app/templates/courses/classroom-view.jade b/app/templates/courses/classroom-view.jade index 46da8ee85..0066a3ef1 100644 --- a/app/templates/courses/classroom-view.jade +++ b/app/templates/courses/classroom-view.jade @@ -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) diff --git a/app/views/courses/ClassroomView.coffee b/app/views/courses/ClassroomView.coffee index 1005e38b3..8ff59da9d 100644 --- a/app/views/courses/ClassroomView.coffee +++ b/app/views/courses/ClassroomView.coffee @@ -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' diff --git a/app/views/editor/component/ThangComponentConfigView.coffee b/app/views/editor/component/ThangComponentConfigView.coffee index 8f8580043..f0322df81 100644 --- a/app/views/editor/component/ThangComponentConfigView.coffee +++ b/app/views/editor/component/ThangComponentConfigView.coffee @@ -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}) @@ -120,5 +118,5 @@ class SolutionsNode extends TreemaArrayNode language: language passes: true }) - + @set('/', solutions) \ No newline at end of file diff --git a/app/views/play/level/tome/DocFormatter.coffee b/app/views/play/level/tome/DocFormatter.coffee index 72644029d..94122cd20 100644 --- a/app/views/play/level/tome/DocFormatter.coffee +++ b/app/views/play/level/tome/DocFormatter.coffee @@ -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