[virtualcommons-developer] commit/vcweb: alllee: session ids should be embedded in the round config
Status: Beta
Brought to you by:
alllee
|
From: <com...@bi...> - 2013-03-19 07:01:17
|
1 new commit in vcweb: https://bitbucket.org/virtualcommons/vcweb/commits/69282ad0b5f9/ changeset: 69282ad0b5f9 user: alllee date: 2013-03-19 08:01:00 summary: session ids should be embedded in the round configurations themselves affected #: 2 files diff -r 7f44c1cbedbc8a556647b7dbf3ebca272897ff92 -r 69282ad0b5f9fb3882ed224cd6c15106ab0f8875 vcweb/boundaries/views.py --- a/vcweb/boundaries/views.py +++ b/vcweb/boundaries/views.py @@ -111,14 +111,7 @@ # FIXME: these need to be looked up experiment_model_dict['maxHarvestDecision'] = 10 experiment_model_dict['hasSubmit'] = False - experiment_model_dict['practiceRound'] = round_configuration.is_practice_round - experiment_model_dict['instructions'] = current_round.get_custom_instructions(session_number=get_session_number(current_round)) + experiment_model_dict['practiceRound'] = current_round.is_practice_round + experiment_model_dict['instructions'] = current_round.get_custom_instructions() experiment_model_dict.update(**kwargs) return dumps(experiment_model_dict) - -def get_session_number(round_configuration): - # FIXME: brittle but alternatives are messy and time consuming, refactor later - if round_configuration.sequence_number > 22: - return 2 - else: - return 1 diff -r 7f44c1cbedbc8a556647b7dbf3ebca272897ff92 -r 69282ad0b5f9fb3882ed224cd6c15106ab0f8875 vcweb/core/models.py --- a/vcweb/core/models.py +++ b/vcweb/core/models.py @@ -958,7 +958,7 @@ instructions_template = select_template([self.template_path]) if context_dict is None: context_dict = {} - context_dict.update(kwargs) + context_dict.update(kwargs, session_number=self.session_id) c = Context(context_dict) return instructions_template.render(c) 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. |