From 57db67aa824e56fa9a9811ce1b78513d2906f8f4 Mon Sep 17 00:00:00 2001 From: Michael Q Larson Date: Fri, 6 Feb 2015 12:11:22 -0800 Subject: [PATCH] update the courseware.json to treat challengeSeed as an array, and update schema and write logic to strinify this array --- models/Courseware.js | 3 +- .../lib/coursewares/coursewaresFramework.js | 10 +- seed_data/coursewares.json | 571 ++++++++++++++---- 3 files changed, 479 insertions(+), 105 deletions(-) diff --git a/models/Courseware.js b/models/Courseware.js index 68e816a01c..7baa6cc565 100644 --- a/models/Courseware.js +++ b/models/Courseware.js @@ -14,7 +14,8 @@ var coursewareSchema = new mongoose.Schema({ difficulty: String, description: Array, tests: Array, - challengeSeed: String + challengeSeed: Array, + challengeType: Number // 0 = html, 1 = javascript only, 2 = video }); module.exports = mongoose.model('Courseware', coursewareSchema); \ No newline at end of file diff --git a/public/js/lib/coursewares/coursewaresFramework.js b/public/js/lib/coursewares/coursewaresFramework.js index ba06db1afc..759e0526a6 100644 --- a/public/js/lib/coursewares/coursewaresFramework.js +++ b/public/js/lib/coursewares/coursewaresFramework.js @@ -44,6 +44,8 @@ var allTests = ''; }); })(); + + var coursewareTests = "