[virtualcommons-svn] commit/vcweb: alllee: fixing a bug where regrowth wasn't being calculated if n
Status: Beta
Brought to you by:
alllee
From: <com...@bi...> - 2013-03-29 07:24:24
|
1 new commit in vcweb: https://bitbucket.org/virtualcommons/vcweb/commits/2bdfcbcab00d/ Changeset: 2bdfcbcab00d User: alllee Date: 2013-03-29 08:24:04 Summary: fixing a bug where regrowth wasn't being calculated if no one harvested adding waitThirtySeconds property to a bloated view model Affected #: 4 files diff -r bc2e245b0a67b2b30f6e7cc4a8d6ae59d1c01649 -r 2bdfcbcab00d636dffbc2eac0588cd558f7e278b vcweb/boundaries/models.py --- a/vcweb/boundaries/models.py +++ b/vcweb/boundaries/models.py @@ -120,7 +120,6 @@ if round_configuration is None: round_configuration = round_data.round_configuration if is_shared_resource_enabled(round_configuration): - logger.debug("returning shared resource level") return get_shared_resource_level_dv(group, round_data, cluster) else: return get_unshared_resource_level_dv(group, round_data) @@ -256,7 +255,7 @@ # get_total_group_harvest(group, ...), see if we can enable this dynamically total_harvest = get_total_group_harvest(group, round_data) logger.debug("Harvest: total group harvest for playable round: %s", total_harvest) - if current_resource_level > 0 and total_harvest > 0: + if current_resource_level > 0: if total_harvest > current_resource_level: # divide remaining trees evenly among every participant group_size = group.size diff -r bc2e245b0a67b2b30f6e7cc4a8d6ae59d1c01649 -r 2bdfcbcab00d636dffbc2eac0588cd558f7e278b vcweb/boundaries/templates/boundaries/participate.html --- a/vcweb/boundaries/templates/boundaries/participate.html +++ b/vcweb/boundaries/templates/boundaries/participate.html @@ -557,7 +557,7 @@ model.setCurrentInterval( setInterval(function() { model.tick(); - if (model.secondsLeft() > 30 && ! model.isPracticeRound()) { + if (model.secondsLeft() > 30 && model.waitThirtySeconds()) { model.disableHarvestForm(); } else { diff -r bc2e245b0a67b2b30f6e7cc4a8d6ae59d1c01649 -r 2bdfcbcab00d636dffbc2eac0588cd558f7e278b vcweb/boundaries/views.py --- a/vcweb/boundaries/views.py +++ b/vcweb/boundaries/views.py @@ -73,6 +73,7 @@ 'chatMessages': [], 'canObserveOtherGroup': False, 'isInstructionsRound': False, + 'waitThirtySeconds': False, 'totalHarvest': 0, } # FIXME: need to distinguish between instructions / welcome rounds and practice/regular rounds @@ -94,6 +95,8 @@ experiment_model_dict['templateName'] = current_round.template_name experiment_model_dict['isPracticeRound'] = current_round.is_practice_round experiment_model_dict['showTour'] = current_round.is_practice_round and not previous_round.is_practice_round +# FIXME: extend this to first 3 regular rounds of each session as well? + experiment_model_dict['waitThirtySeconds'] = current_round.is_practice_round and current_round.sequence_number < 6 # instructions round parameters if current_round.is_instructions_round: experiment_model_dict['isInstructionsRound'] = True @@ -137,7 +140,6 @@ logger.debug("already submitted, setting harvest decision to %s", experiment_model_dict['harvestDecision']) experiment_model_dict['chatMessages'] = [cm.to_dict() for cm in ChatMessage.objects.for_group(own_group)] - logger.debug("chat messages: %s", experiment_model_dict['chatMessages']) if can_observe_other_group(current_round): experiment_model_dict['canObserveOtherGroup'] = True other_group = own_group.get_related_group() diff -r bc2e245b0a67b2b30f6e7cc4a8d6ae59d1c01649 -r 2bdfcbcab00d636dffbc2eac0588cd558f7e278b vcweb/core/models.py --- a/vcweb/core/models.py +++ b/vcweb/core/models.py @@ -1907,7 +1907,6 @@ if default is None: raise e else: - logger.warning("unable to retrieve ParticipantRoundDataValue with parameter %s, returning default value %s", parameter, default) return DefaultValue(default) def set_data_value(self, parameter=None, value=None, round_data=None): Repository URL: https://bitbucket.org/virtualcommons/vcweb/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |