update the courseware.json to treat challengeSeed as an array, and update schema and write logic to strinify this array

pull/82/head
Michael Q Larson 2015-02-06 12:11:22 -08:00
parent 1c3bb66848
commit 57db67aa82
3 changed files with 479 additions and 105 deletions

View File

@ -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);

View File

@ -44,6 +44,8 @@ var allTests = '';
});
})();
var coursewareTests = "<script>" +
"var allTestsGood = true;" +
"var expect = chai.expect; " +
@ -111,9 +113,15 @@ var editorValue;
var challengeSeed = challengeSeed || null;
var tests = tests || [];
var allSeeds = '';
(function() {
challengeSeed.forEach(function(elem) {
allSeeds += elem + '\n';
});
})();
myCodeMirror.setValue(challengeSeed);
myCodeMirror.setValue(allSeeds);
function doLinting () {
editor.operation(function () {

File diff suppressed because it is too large Load Diff