update the courseware.json to treat challengeSeed as an array, and update schema and write logic to strinify this array
parent
1c3bb66848
commit
57db67aa82
|
@ -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);
|
|
@ -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
Loading…
Reference in New Issue