From 6800ea2ff7c750590cec3e637f14e88df91e24c4 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Wed, 10 Feb 2016 14:16:54 -0800 Subject: [PATCH] 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']