New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get attendance count from list of learners - not working for TTT? #1177

Open
maneesha opened this Issue Apr 11, 2017 · 11 comments

Comments

Projects
None yet
4 participants
@chrismedrela

This comment has been minimized.

Collaborator

chrismedrela commented Apr 16, 2017

"Ask for attendance" button is enabled if and only if the attendance is unknown or is equal zero. Should it be always enabled?

@maneesha

This comment has been minimized.

Contributor

maneesha commented Apr 19, 2017

This is not about the "Ask for attendance" button. Attendance count is supposed to populate from the list of learners. That does not seem to be working.

@chrismedrela chrismedrela self-assigned this Apr 19, 2017

@chrismedrela chrismedrela added this to the v1.11 milestone Apr 19, 2017

@chrismedrela

This comment has been minimized.

Collaborator

chrismedrela commented Apr 19, 2017

@narayanaditya95 what is the reason to only increase attendance count here? Why don't we update the count when it decreases?

Also, why do we store the count in a field instead of computing it on demand? Is it for speed?

@chrismedrela

This comment has been minimized.

Collaborator

chrismedrela commented Apr 19, 2017

@maneesha it has nothing to do with TTT, it's a cache invalidation problem. As a workaround, you can edit and save an event when you want to update the count.

@chrismedrela

This comment has been minimized.

Collaborator

chrismedrela commented Apr 26, 2017

@narayanaditya95 ping

@aditnryn

This comment has been minimized.

Member

aditnryn commented Apr 26, 2017

@chrismedrela

@narayanaditya95 what is the reason to only increase attendance count here?

This snippet of code was previously being called during the POST requests for event_edit view. I modified it to be invoked at save method of the Event model. This cache invalidation problem probably existed then as well, I never paid enough attention to it.

Why don't we update the count when it decreases?

Same. I never looked into that during the refactor.

Also, why do we store the count in a field instead of computing it on demand? Is it for speed?

You are right, the entire cache invalidation problem wouldn't have existed if the attendance attribute was calculated on demand.

@chrismedrela

This comment has been minimized.

Collaborator

chrismedrela commented Apr 26, 2017

@narayanaditya95 thank you for your feedback. It all makes sense to me now.

@chrismedrela

This comment has been minimized.

Collaborator

chrismedrela commented Apr 26, 2017

Right now, attendance can be 1) entered manually or 2) computed from learner tasks and overridden. I propose that we leave attendance for storing "manual" values and create real_attendance property that returns max(self.attendance, number_of_learner_tasks).

@pbanaszkiewicz @narayanaditya95 any opinions?

@chrismedrela

This comment has been minimized.

Collaborator

chrismedrela commented Apr 26, 2017

And maybe rename the field to manual_attendance and the property to computed_attendance.

@aditnryn

This comment has been minimized.

Member

aditnryn commented Apr 28, 2017

Right now, attendance can be 1) entered manually or 2) computed from learner tasks and overridden. I propose that we leave attendance for storing "manual" values and create real_attendance property that returns max(self.attendance, number_of_learner_tasks).

That sounds right. +1

@chrismedrela

This comment has been minimized.

Collaborator

chrismedrela commented Apr 28, 2017

@narayanaditya95 thank you for your feedback. :-)

@chrismedrela chrismedrela modified the milestones: v1.11, v1.12 Jul 10, 2017

@pbanaszkiewicz pbanaszkiewicz modified the milestones: v1.12, v2.0 Jul 1, 2018

@pbanaszkiewicz pbanaszkiewicz removed this from the v2.0 milestone Jul 30, 2018

@pbanaszkiewicz pbanaszkiewicz added this to the v2.1 milestone Aug 12, 2018

@pbanaszkiewicz pbanaszkiewicz modified the milestones: v2.1, v2.2 Sep 20, 2018

@pbanaszkiewicz pbanaszkiewicz modified the milestones: v2.2, v2.3 Oct 28, 2018

@pbanaszkiewicz pbanaszkiewicz modified the milestones: v2.3, v2.4 Dec 1, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment