SMILEConsortium / node-smile-server

3 stars 4 forks source link

Fix broken test cases for scoring results #37

Open truedat101 opened 11 years ago

truedat101 commented 11 years ago

A GET to /smile/results ✗ should return raw results »
actual expected

    {"winnerScore":01,"winnerRating":03.5,"bestScoredStudentNames":["test"],"bestRatedQuestionStudentNames":["test2"],"numberOfQuestions":2,"rightAnswers":[3,2],"averageRatings":[],"":[2,3.5],"questionsCorrectPercentage":[]}":[50,0]} 
     // game.test.js:663 

A GET to /smile/all 
truedat101 commented 11 years ago

Fixed up the issues with some crashing. I need to resolve a race condition where we have two simultaneous calls to store the session, and we don't actually want to store the session twice. One call is from the teacher app, and one is from the student app/web. I think I need to modify this flow to store the session by an explicit token passed in the query parameter. If there is a "persist=true" in the request, and if we haven't already saved the results, then save the results. Or ... maybe we just need check when we transition the server state machine to "show results".

truedat101 commented 11 years ago

When we switch to {"TYPE":"START_SHOW","HIGHSCORE":0,"HIGHRATING":0,"NUMQ":0,"RANSWER":[],"AVG_RATINGS":[],"RPERCENT":[]} ... start show, we probably can persist at this point. I think we only transition here once. Route is: http://localhost/smile/currentmessage