mhtess / gen-games

Games for eliciting generalizations in language
1 stars 2 forks source link

investigate subject info recording #39

Closed mhtess closed 7 years ago

mhtess commented 7 years ago

Line 364 of mp-game.js has

      globalGame.socket.send("logSubjInfo.subjInfo." + _.pairs(encodeData(exp.subj_data)).join('.'));

i suspect encodeData is causing an error to be thrown (perhaps when certain fields are omitted). I think I included encodeData so that fairPrice would be parsed properly, but I think it may be recorded as a string, not as numeric, in which case encodeData probably doesn't work on it. May need a new fn for that.

ashulman18 commented 7 years ago

This is the encodeData function we have in our localUtils: function encodeData(dataObj){ return _.mapObject(dataObj, function(val, key) { if (isNumeric(val)) { if (Number.isInteger(val)) { return val.toString() } else { return val.toString().replace(".", "&") } } else { return val } }); } From what I understand, the problem is not about something being a string (because the else takes care of that). With omission - maybe returning an empty string messes something up further down the line?

ashulman18 commented 7 years ago

Not sure if this is still a problem. I have trouble looking through our data files and checking. There were superfluous lines in the encode and decode functions that I had taken out. This should make it easier to understand what's happening. We just need to check if this is fixed; I don't remember this still being a big problem.

mhtess commented 7 years ago

@ashulman18 Can you just click through the subject info page, filling out various amounts of information (from everything to nothing), and see if anything throws an error in the server console? If not, then this issue can be closed. If it's possible, you can comment out the other slides and just go straight to the subject info page.