csdl / makahiki

An Open Source "Serious Game" Framework for Sustainability
http://makahiki.readthedocs.org/
MIT License
7 stars 5 forks source link

smartgrid sometimes blank with only level tab but no content ? #512

Closed yongwen closed 11 years ago

yongwen commented 11 years ago

User reported a potential bug:

"i would like to report a bug . When i use google chrome sometimes when i got to Get Nutz sometimes the smart grid game board dosent show up its just says level 1 level 2 level 3 and then its blank like no grid at all"

I suspect it is the level cookie or the caching. Could Cam take a look first? Thanks.

cammoore commented 11 years ago

This happens if a player looks at an activity in a level, then later the admin/predicate says that the level is now locked. The cookie that remembers what level the player is at 'shows' the tab for the level. Our template is smart enough not to load content for locked levels, so no grid is built. The player gets an empty grid. They'll have to switch to an unlocked level and select an activity to reset their cookie. This may be tricky to fix, the javascript that handles the cookie doesn't have access to the Django level lock information, just the cookie and HTML.

cammoore commented 11 years ago

It wasn't as hard as I thought. Added the class 'level-unlocked' to unlocked levels and the JavaScript checks for that class before showing the grid.