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

Return the actual value for RosterEntry.active #6907

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

marcospri
Copy link
Member

@marcospri marcospri commented Dec 9, 2024

We have been returning True for all entries until now. Actually return the value on the DB for roster entries and True for the ones based on launches.

Testing

  • Open a LT1.1 assignment for which you have at least one student launch. Open the dashboard for it.

https://hypothesis.instructure.com/courses/125/assignments/873

You get the list of students. No "drop" badges.

  • Open a LTI1.3 assignment

https://hypothesis.instructure.com/courses/319/assignments/3336

  • Make sure you have a roster for it, on make shell:
from lms.tasks.roster import schedule_fetching_rosters
schedule_fetching_rosters.delay()
  • Open the dashboard, you'll get the list of students, no badges.

  • On make sql, set everyone as inactive:

update assignment_roster set active=false;
  • Refresh the dashboard, everyone gets a DROP badge!

@marcospri marcospri force-pushed the roster-dashboard-api branch from 48e1891 to 961499c Compare December 10, 2024 09:33
Base automatically changed from roster-dashboard-api to main December 10, 2024 09:45
@marcospri marcospri force-pushed the roster-dashboard-api-active branch from 913c92f to e256c71 Compare December 10, 2024 14:56
@marcospri marcospri force-pushed the roster-dashboard-api-active branch from e256c71 to 0d1b070 Compare December 10, 2024 15:07
.join(LMSUser, AssignmentRoster.lms_user_id == LMSUser.id)
.join(LTIRole, AssignmentRoster.lti_role_id == LTIRole.id)
.where(AssignmentRoster.assignment_id == assignment.id)
).distinct()
Copy link
Member Author

Choose a reason for hiding this comment

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

As we now use a join we have to return distinct rows.

In the spec is not possible to get a user active with one role but inactive with another so we'll always get unique users here.

@marcospri marcospri changed the title Roster dashboard api active Return the actual value for RosterEntry.active Dec 11, 2024
@marcospri marcospri requested a review from acelaya December 11, 2024 08:49
@marcospri marcospri marked this pull request as ready for review December 11, 2024 08:49
@marcospri marcospri merged commit a4aaec4 into main Dec 11, 2024
9 checks passed
@marcospri marcospri deleted the roster-dashboard-api-active branch December 11, 2024 11:14
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