add yet unfinished curriculum overview to challengeMap

This commit is contained in:
Quincy Larson
2015-05-31 02:01:55 -07:00
parent 9dc504a99d
commit 5380a9ea74
8 changed files with 246 additions and 48 deletions

View File

@@ -22,12 +22,11 @@ module.exports = {
var noDuplicatedChallenges = R.uniq(completedList);
var challengeList = resources.getChallengeMapForDisplay();
var completedChallengeList = noDuplicatedChallenges
.map(function(challenge) {
return challenge._id;
});
var challengeList = resources.getChallengeMapForDisplay(completedChallengeList);
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');

View File

@@ -72,13 +72,14 @@ Array.zip = function(left, right, combinerFunction) {
module.exports = {
getChallengeMapForDisplay: function() {
getChallengeMapForDisplay: function(completedChallengeList) {
if (!challengeMapForDisplay) {
challengeMapForDisplay = {};
Object.keys(challengeMap).forEach(function(key) {
challengeMapForDisplay[key] = {
name: challengeMap[key].name,
challenges: challengeMap[key].challenges
challenges: challengeMap[key].challenges,
completedCount: challengeMap[key].challenges //ToDo count number of uncompleted challenges
}
});
}