All coursewares list now displays properly, coursewares properly direct to the follow on, courseware controller now properly finds the next courseware

This commit is contained in:
Nathan Leniz
2015-02-22 18:23:50 +09:00
parent b5a449cb1c
commit 3e65298e35
9 changed files with 81 additions and 43 deletions

View File

@ -239,15 +239,19 @@ module.exports = {
return coursewares.map(function(elem) {
return {
name: elem.name,
difficulty: elem.difficulty
difficulty: elem.difficulty,
_id: elem._id
}
})
.sort(function(a, b) {
return a.difficulty - b.difficulty;
})
.map(function(elem) {
return elem.name;
});
.map (function(elem) {
return {
name : elem.name,
_id: elem._id
}
});
},
whichEnvironment: function() {
return process.env.NODE_ENV;