[virtualcommons-svn] commit/vcweb: alllee: - fixed display bug expanding the content div when displ
Status: Beta
Brought to you by:
alllee
From: <com...@bi...> - 2013-07-22 06:57:57
|
1 new commit in vcweb: https://bitbucket.org/virtualcommons/vcweb/commits/7e2d5e56d3b0/ Changeset: 7e2d5e56d3b0 User: alllee Date: 2013-07-22 08:57:45 Summary: - fixed display bug expanding the content div when displaying qualtrics survey iframe - fixed off-by-one bug where repeating rounds were being executed n+1 times instead of n Affected #: 2 files diff -r ee35940a39534c9fc64839e9f9bf30ed23fbc114 -r 7e2d5e56d3b09e1f3be89997b9c77a095e390fba vcweb/bound/templates/bound/participate.html --- a/vcweb/bound/templates/bound/participate.html +++ b/vcweb/bound/templates/bound/participate.html @@ -736,7 +736,6 @@ model.update = function() { $.get('view-model', { participant_group_id: model.participantGroupId() }, function(data) { ko.mapping.fromJS(data, model); - model.afterRenderTemplate(); $('#progress-modal').modal('hide'); }); } @@ -772,9 +771,14 @@ } // FIXME: should move to a model where we only enable chat in REGULAR rounds? model.initializeChat(); - if (model.isSurveyEnabled() && model.templateId() === "PRACTICE_ROUND_RESULTS") { - $('#sidebar').hide(); - $('#content').toggleClass('span8 span12'); + if (model.isSurveyEnabled()) { + switch (model.templateId()) { + case "PRACTICE_ROUND_RESULTS": + case "FINAL_DEBRIEFING": + $('#sidebar').hide(); + $('#content').toggleClass('span8 span12'); + break; + } } $('[data-content]').popover({placement: 'top', trigger: 'hover'}); } diff -r ee35940a39534c9fc64839e9f9bf30ed23fbc114 -r 7e2d5e56d3b09e1f3be89997b9c77a095e390fba vcweb/core/models.py --- a/vcweb/core/models.py +++ b/vcweb/core/models.py @@ -98,7 +98,7 @@ next_round_data, created = e.get_or_create_round_data(round_configuration=e.next_round, is_next_round_data=True) for existing_dv in data_values: - logger.debug("copying existing dv %s to next round %s", existing_dv, next_round_data) + #logger.debug("copying existing dv %s to next round %s", existing_dv, next_round_data) # Taking advantage of a trick from here: # http://stackoverflow.com/questions/12182657/copy-or-clone-an-object-instance-in-django-python existing_dv.pk = None @@ -451,9 +451,15 @@ @property def status_label(self): return u"%s, %s" % (self.get_status_display(), self.current_round.get_round_type_display()) + @property def sequence_label(self): - return u"Round %s of %s" % (self.current_round_sequence_number, self.experiment_configuration.final_sequence_number) + cr = self.current_round + if cr.is_repeating_round: + return u"Round %s (repeating round %d of %d)" % (self.current_round_sequence_number, + self.current_repeated_round_sequence_number + 1, cr.repeat) + else: + return u"Round %s" % cr.sequence_label @property def status_line(self): @@ -545,7 +551,10 @@ if round_configuration.is_repeating_round: crsn = self.current_repeated_round_sequence_number if previous_round: - crsn = crsn - 1 + # XXX: convoluted logic, if we're looking for a previous repeating round and the current repeated + # round sequence number is 0 we need to clamp the repeated round sequence number to N - 1 where N is the + # number of repeats for that repeating round + crsn = round_configuration.repeat - 1 if crsn == 0 else crsn - 1 elif next_round: crsn = crsn + 1 ps.update(repeating_round_sequence_number=crsn) @@ -563,7 +572,7 @@ @property def should_repeat(self): cr = self.current_round - return cr.is_repeating_round and self.current_repeated_round_sequence_number < cr.repeat + return cr.is_repeating_round and self.current_repeated_round_sequence_number + 1 < cr.repeat @property def next_round(self): 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. |