Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJeanie Herold
15,555 Pointsthe name of badges earned for a particular track
I have accessed the .json file for a user. I can see all their badges but what I really want to know is if Treehouse has a list of the name of the badges a user should have earned to successfully complete a track?
Like for FullStack JavaScript Track. Is there a list of badges just for that track? SO a program administrator can verify track completion by looking at the badges associated just with the corresponding Track?
I want to make an array for each track of the badges needed for completion of a particular track
3 Answers
Jeanie Herold
15,555 PointsI just needed them for a particular moment in time. I suppose I will just have to go through the list.
After each 'stage' of a course a badge is earned. Is the badge always the name of the stage do you know?
Simon Coates
28,694 PointsI'm not sure. Your starting point with the comparison might want to be a user json file like https://teamtreehouse.com/mikethefrog.json . I don't know how resistant treehouse is to scraping, so don't know if you could automate the verification process. Might be more time consuming than manual comparison.
Jeanie Herold
15,555 PointsIt is only for about 4 tracks for a Code School so I am hoping it is manageable.
That is exactly what I am doing... using .getJSON to obtain the users json file and then I want to compare the badge names they have earned to an array containing the track badges needed for the Code School requirements.
Does that sound like to you that I am tackling that in a correct direction?
Then the arrays could easily be added to and subtracted from if requirements change for certain tracks but would only need manual checks at the beginning of each course.
Simon Coates
28,694 Pointsyeah. I assumed that was what you were doing. The steps seemed to be 1) confirm name to badge mapping. 2) build a data structure to represent the track 3) use the json to compare. 4) deal with the changing track composition.
Jeanie Herold
15,555 PointsThank you. That is the best way I could see to go about it as well. Your replies are much appreciated.
Simon Coates
28,694 PointsSimon Coates
28,694 PointsI don't know. I'd note that Tracks evolve. so a list of badges would likely need to be for a particular track with it's composition at a particular time. So you'd likely need data published from a track versioning system. (given that the tracks do compare an existing structure against the revised one, there may be some track versioning already build somewhere).