Skip to content
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

Todos sure up #4196

Merged
merged 2 commits into from
Jan 28, 2025
Merged

Todos sure up #4196

merged 2 commits into from
Jan 28, 2025

Conversation

urbanwide
Copy link
Contributor

@urbanwide urbanwide commented Jan 27, 2025

Spotted a couple of things that needed changing after a good poke around.

Firstly when observations are 'removed' via the frontend (via the ObservationRemoval service), if not in current academic year, visible is set to false, rather than it being removed. If they are in this academic year, they are destroyed, which automatically removes completed todos etc, which is how I assumed it worked all the time. So now this takes note of the visible flag in a number of places and removes completed todos when visible is set to false.

Also made sure that when picking the latest recording for a todo, there is a possibility that more than 1 recording occurs on the same day. Added code to make sure we always pick the last one created. It probably would have done this anyway, just wanted to be intentional.

@urbanwide urbanwide marked this pull request as ready for review January 27, 2025 18:20
@urbanwide urbanwide requested a review from ldodds January 27, 2025 18:20
Copy link
Collaborator

@ldodds ldodds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I was aware there was a visible flag on Observation but seems to be there since 2019. The changes make sense for consistency. I can see the flag is being used when displaying lists of observations (e.g. timeline, interventions controller, etc) but its not used in calculating scores? I guess that's deliberate to allow items to be hidden but the overall score to be retained?

@urbanwide
Copy link
Contributor Author

What I don't get is why if an observation is this calendar year then it is removed but in a previous calendar year it is made invisible. If it were to be to retain scores, don't our scoreboards only count for this calendar year anyway?

@urbanwide
Copy link
Contributor Author

In my local DB there are only 14 observations that are not visible. It seems like it was intentional to add this functionality but can't work out why. It's a bit inconsistent.

@ldodds
Copy link
Collaborator

ldodds commented Jan 28, 2025

What I don't get is why if an observation is this calendar year then it is removed but in a previous calendar year it is made invisible. If it were to be to retain scores, don't our scoreboards only count for this calendar year anyway?

You can retrieve older versions of scoreboards, e.g /scoreboards/north-west-england?previous_year=true. I think previously you could also request them for any previous academic years but we removed that as it wasn't that useful.

I can only think the visibility is there to allow scores to be retained, as the observation values are still counted. This was the original commit.

It's obviously been pretty rare to retrospectively remove items. When we're recently done updates because, e.g a school has recorded an activity multiple times, we just set the observation to zero. Which is better than removing or hiding anything.

@urbanwide
Copy link
Contributor Author

Ahh ok, didn't realise you could view a previous year's scoreboard, that would make more sense now. But yes, seems like behaviour we perhaps don't need anymore if we are setting score to zero if we don't want it to count...

Anyways, will merge in. It's been useful to discuss this. Thanks!

@urbanwide urbanwide merged commit b9a0222 into master Jan 28, 2025
20 checks passed
@urbanwide urbanwide deleted the todos-sure-up branch January 28, 2025 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants