csdl / makahiki

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

HPU's level unlocking does not seem to work #562

Closed yongwen closed 10 years ago

yongwen commented 11 years ago

HPU's instance's level 2 has the unlock condition: submitted_some_of_level(2, "Level 1") and submitted_action("power-energy") it does not seems to unlock after the condition is met.

Can reproduce on mopsa.

cammoore commented 11 years ago

The predicate changed from using the level's name to using the level's priority. So now the predicate should look like 'submitted_some_of_level(2, 1) and submitted_action("power-energy")' if "Level 1" has a priority of 1.

yongwen commented 10 years ago

used submitted_some_of_level(2, 1) and submitted_action("power-energy") in hpu's test instance, it does not seems to work either.

yongwen commented 10 years ago

the current predicate syntax is submitted_some_of_level(level_priority, count), so the condition should be: submitted_some_of_level(1, 2). update hpu instance and mopsa, working now.

yongwen commented 10 years ago

had to fix the predicate code to filter by grid.action: c += user.actionmember_set.filter(action=grid.action).count()