From 9cbb5ad9241c7b45b8e38862d166fe63c5c80af8 Mon Sep 17 00:00:00 2001 From: sungame Date: Sat, 6 Feb 2016 17:06:27 +0100 Subject: [PATCH 1/4] Update sv.coffee Translated some english to swedish --- app/locale/sv.coffee | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/app/locale/sv.coffee b/app/locale/sv.coffee index 088662a3a..0fa095f80 100644 --- a/app/locale/sv.coffee +++ b/app/locale/sv.coffee @@ -75,7 +75,7 @@ module.exports = nativeDescription: "Svenska", englishDescription: "Swedish", tr subscription_required: "Kräver prenumeration" anonymous: "Anonym Spelare" level_difficulty: "Svårighetsgrad: " -# play_classroom_version: "Play Classroom Version" # Choose a level in campaign version that you also can play in one of your courses + play_classroom_version: "Spela klassrumsversion" # Choose a level in campaign version that you also can play in one of your courses campaign_beginner: "Nybörjarkampanj" awaiting_levels_adventurer_prefix: "Vi släpper nya nivåer varje vecka." # {change} awaiting_levels_adventurer: "Registrera dig som äventyrare" @@ -114,9 +114,9 @@ module.exports = nativeDescription: "Svenska", englishDescription: "Swedish", tr log_in: "logga in med lösenord" required: "Du måste logga in innan du kan gå dit" login_switch: "Har du redan ett konto?" -# school_name: "School Name and City" + school_name: "Namn på skolan och stad" # optional: "optional" -# school_name_placeholder: "Example High School, Springfield, IL" + school_name_placeholder: "Exempel Högstadiet Stenhamre, Ljusdal" recover: recover_account_title: "Återskapa ditt konto" @@ -553,15 +553,15 @@ module.exports = nativeDescription: "Svenska", englishDescription: "Swedish", tr press_paragraph_1_suffix: ". Alla loggor och bilder kan användas utan att kontakta oss direkt." team: "Team" nick_title: "Medgrundare" # {change} -# nick_blurb: "Motivation Guru" + nick_blurb: "Moitivationsguru" matt_title: "Medgrundare" # {change} matt_blurb: "Cyklist" cat_title: "Chefshantverkare" # {change} -# cat_blurb: "Airbender" + cat_blurb: "Luftbändare" scott_title: "Medgrundare" # {change} # scott_blurb: "Reasonable One" # maka_title: "Customer Advocate" -# maka_blurb: "Storyteller" + maka_blurb: "Sagoberättare" rob_title: "Kompileringsingenjör" # {change} rob_blurb: "Kodar saker" josh_c_title: "Speldesigner" @@ -699,11 +699,11 @@ module.exports = nativeDescription: "Svenska", englishDescription: "Swedish", tr continue_script: "Fortsätt förbi nuvarande kod." skip_scripts: "Hoppa över all kod som kan hoppas över." toggle_playback: "Spela/Pausa." -# scrub_playback: "Scrub back and forward through time." -# single_scrub_playback: "Scrub back and forward through time by a single frame." -# scrub_execution: "Scrub through current spell execution." -# toggle_debug: "Toggle debug display." -# toggle_grid: "Toggle grid overlay." + scrub_playback: "Spela bakåt och framåt genom tiden." + single_scrub_playback: "Spela bakåt och framåt genom tiden, en frame i taget." + scrub_execution: "Spela genom nuvarande magiska trollformel." + toggle_debug: "Toggla debug display." + toggle_grid: "Toggla grid overlay." # toggle_pathfinding: "Toggle pathfinding overlay." # beautify: "Beautify your code by standardizing its formatting." maximize_editor: "Maximera/minimera kodredigeraren." @@ -736,7 +736,7 @@ module.exports = nativeDescription: "Svenska", englishDescription: "Swedish", tr subs_only: "endast följare" create_clan: "Skapa ny klan" private_preview: "Förhandsgranska" -# private_clans: "Private Clans" + private_clans: "Privata klaner" public_clans: "Publik klan" my_clans: "Mina klaner" clan_name: "Klanens namn" From 06436a4bb743c0435c4afba645d1952e767e91a9 Mon Sep 17 00:00:00 2001 From: Matt Lott Date: Tue, 9 Feb 2016 15:12:01 -0800 Subject: [PATCH 2/4] Add levelID property to show subscription modal events Allows us to consolidate analytics collection indexes and code someday. --- app/views/play/CampaignView.coffee | 3 ++- app/views/play/level/LevelLoadingView.coffee | 4 +++- app/views/play/menu/GuideView.coffee | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/views/play/CampaignView.coffee b/app/views/play/CampaignView.coffee index e48c16033..e95400d1b 100644 --- a/app/views/play/CampaignView.coffee +++ b/app/views/play/CampaignView.coffee @@ -482,7 +482,8 @@ module.exports = class CampaignView extends RootView canPlayAnyway = not @requiresSubscription or level.adventurer or @levelStatusMap[level.slug] if requiresSubscription and not canPlayAnyway @openModalView new SubscribeModal() - window.tracker?.trackEvent 'Show subscription modal', category: 'Subscription', label: 'map level clicked', level: levelSlug + # TODO: Added levelID on 2/9/16. Remove level property and associated AnalyticsLogEvent 'properties.level' index later. + window.tracker?.trackEvent 'Show subscription modal', category: 'Subscription', label: 'map level clicked', level: levelSlug, levelID: levelSlug else @startLevel levelElement window.tracker?.trackEvent 'Clicked Start Level', category: 'World Map', levelID: levelSlug diff --git a/app/views/play/level/LevelLoadingView.coffee b/app/views/play/level/LevelLoadingView.coffee index 8c0f37b05..3f80228e9 100644 --- a/app/views/play/level/LevelLoadingView.coffee +++ b/app/views/play/level/LevelLoadingView.coffee @@ -193,7 +193,9 @@ module.exports = class LevelLoadingView extends CocoView onClickStartSubscription: (e) -> @openModalView new SubscribeModal() - window.tracker?.trackEvent 'Show subscription modal', category: 'Subscription', label: 'level loading', level: @level?.get('slug') or @options.level?.get('slug') + levelSlug = @level?.get('slug') or @options.level?.get('slug') + # TODO: Added levelID on 2/9/16. Remove level property and associated AnalyticsLogEvent 'properties.level' index later. + window.tracker?.trackEvent 'Show subscription modal', category: 'Subscription', label: 'level loading', level: levelSlug, levelID: levelSlug onSubscribed: -> document.location.reload() diff --git a/app/views/play/menu/GuideView.coffee b/app/views/play/menu/GuideView.coffee index cc0dcc097..fa231991c 100644 --- a/app/views/play/menu/GuideView.coffee +++ b/app/views/play/menu/GuideView.coffee @@ -89,7 +89,8 @@ module.exports = class LevelGuideView extends CocoView clickSubscribe: (e) -> level = @levelSlug # Save ref to level slug @openModalView new SubscribeModal() - window.tracker?.trackEvent 'Show subscription modal', category: 'Subscription', label: 'help video clicked', level: level + # TODO: Added levelID on 2/9/16. Remove level property and associated AnalyticsLogEvent 'properties.level' index later. + window.tracker?.trackEvent 'Show subscription modal', category: 'Subscription', label: 'help video clicked', level: level, levelID: level clickTab: (e) => @$el.find('li.active').removeClass('active') From 61d2ce3dc502f4c19bbbf68b6ad560ad13ee4781 Mon Sep 17 00:00:00 2001 From: Matt Lott Date: Tue, 9 Feb 2016 16:50:51 -0800 Subject: [PATCH 3/4] Add index for analytics server log collection Created on live analytics server as well. --- server/analytics/AnalyticsLogEvent.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/server/analytics/AnalyticsLogEvent.coffee b/server/analytics/AnalyticsLogEvent.coffee index 9882470dd..076f98be3 100644 --- a/server/analytics/AnalyticsLogEvent.coffee +++ b/server/analytics/AnalyticsLogEvent.coffee @@ -18,6 +18,7 @@ AnalyticsLogEventSchema = new mongoose.Schema({ AnalyticsLogEventSchema.index({event: 1, _id: -1}) AnalyticsLogEventSchema.index({event: 1, 'properties.level': 1}) +AnalyticsLogEventSchema.index({event: 1, 'properties.levelID': 1}) AnalyticsLogEventSchema.index({user: 1, event: 1}) AnalyticsLogEventSchema.statics.logEvent = (user, event, properties={}) -> From 6800ea2ff7c750590cec3e637f14e88df91e24c4 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Wed, 10 Feb 2016 14:16:54 -0800 Subject: [PATCH 4/4] Add picoCTFProblem field to levels --- app/schemas/models/campaign.schema.coffee | 1 + app/schemas/models/level.coffee | 1 + app/views/editor/level/settings/SettingsTabView.coffee | 2 +- server/levels/level_handler.coffee | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/schemas/models/campaign.schema.coffee b/app/schemas/models/campaign.schema.coffee index b8419f352..e8da4d884 100644 --- a/app/schemas/models/campaign.schema.coffee +++ b/app/schemas/models/campaign.schema.coffee @@ -123,6 +123,7 @@ _.extend CampaignSchema.properties, { tasks: c.array {title: 'Tasks', description: 'Tasks to be completed for this level.'}, c.task concepts: c.array {title: 'Programming Concepts', description: 'Which programming concepts this level covers.'}, c.concept + picoCTFProblem: { type: 'string', description: 'Associated picoCTF problem ID, if this is a picoCTF level' } #- normal properties position: c.point2d() diff --git a/app/schemas/models/level.coffee b/app/schemas/models/level.coffee index 8e237af86..4869e473a 100644 --- a/app/schemas/models/level.coffee +++ b/app/schemas/models/level.coffee @@ -354,6 +354,7 @@ _.extend LevelSchema.properties, scoreTypes: c.array {title: 'Score Types', description: 'What metric to show leaderboards for.', uniqueItems: true}, c.shortString(title: 'Score Type', 'enum': ['time', 'damage-taken', 'damage-dealt', 'gold-collected', 'difficulty']) # TODO: good version of LoC; total gear value. concepts: c.array {title: 'Programming Concepts', description: 'Which programming concepts this level covers.', uniqueItems: true}, c.concept + picoCTFProblem: { type: 'string', description: 'Associated picoCTF problem ID, if this is a picoCTF level' } c.extendBasicProperties LevelSchema, 'level' diff --git a/app/views/editor/level/settings/SettingsTabView.coffee b/app/views/editor/level/settings/SettingsTabView.coffee index e67566937..842978d87 100644 --- a/app/views/editor/level/settings/SettingsTabView.coffee +++ b/app/views/editor/level/settings/SettingsTabView.coffee @@ -15,7 +15,7 @@ module.exports = class SettingsTabView extends CocoView editableSettings: [ 'name', 'description', 'documentation', 'nextLevel', 'background', 'victory', 'i18n', 'icon', 'goals', 'type', 'terrain', 'showsGuide', 'banner', 'employerDescription', 'loadingTip', 'requiresSubscription', - 'helpVideos', 'replayable', 'scoreTypes', 'concepts' + 'helpVideos', 'replayable', 'scoreTypes', 'concepts', 'picoCTFProblem' ] subscriptions: diff --git a/server/levels/level_handler.coffee b/server/levels/level_handler.coffee index 6c7b8e852..2fc8ced6a 100644 --- a/server/levels/level_handler.coffee +++ b/server/levels/level_handler.coffee @@ -66,6 +66,7 @@ LevelHandler = class LevelHandler extends Handler 'buildTime' 'scoreTypes' 'concepts' + 'picoCTFProblem' ] postEditableProperties: ['name']