start adding completion to challengeMap

This commit is contained in:
Quincy Larson
2015-05-31 16:41:04 -07:00
parent 003a70cc2b
commit a5edfa6fec
3 changed files with 9 additions and 8 deletions

View File

@@ -72,19 +72,14 @@ Array.zip = function(left, right, combinerFunction) {
module.exports = {
getChallengeMapForDisplay: function(completedChallengeList) {
getChallengeMapForDisplay: function() {
if (!challengeMapForDisplay) {
challengeMapForDisplay = {};
Object.keys(challengeMap).forEach(function(key) {
//TODO get ratio of completed to uncompleted for each section
//challengeMap[key].challenges.forEach(function(challenge){
//
//}
challengeMapForDisplay[key] = {
name: challengeMap[key].name,
dashedName: challengeMap[key].name.replace(/\s/g, '-'),
challenges: challengeMap[key].challenges,
completedCount: challengeMap[key].challenges //ToDo count number of uncompleted challenges
challenges: challengeMap[key].challenges
}
});
}