Skip to content

Improve progress data determination: use type_id lookup and broaden line chart source#66

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/improve-progress-data-determination
Draft

Improve progress data determination: use type_id lookup and broaden line chart source#66
Copilot wants to merge 3 commits intomainfrom
copilot/improve-progress-data-determination

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 20, 2026

Progress resource discovery relied on a fragile name substring match (' Progress'). Additionally, the subject progress line chart was limited to submissions from Progress resources only, missing the full picture of student activity.

Changes

  • Resource lookup: Both get_progress_data_for_dashboard and get_student_comparison_data now find Progress resources via ('type_id.name', '=', 'Progress') instead of ('name', 'ilike', ' Progress')

  • Line chart data source (get_progress_data_for_dashboard): line_data is now built from all active submitted/completed submissions for the student — not just those linked to Progress-type resources. This gives a complete history across every subject.

  • Bar chart + pace info unchanged in scope: bar_data and pace_data continue to be derived exclusively from Progress-type resource submissions, and notes parsing (start/end/redline dates, exclude lists) is untouched.

# Before — fragile name match, same submissions for both charts
progress_resources = self.env['aps.resources'].search([('name', 'ilike', ' Progress')])
submissions = self.search([('resource_id', 'in', progress_resources.ids), ...])
# line_data and bar_data both built from `submissions`

# After — type-based lookup; line chart draws from all submissions
progress_resources = self.env['aps.resources'].search([('type_id.name', '=', 'Progress')])
progress_submissions = self.search([('resource_id', 'in', progress_resources.ids), ...])  # bar + pace
all_submissions = self.search([('student_id', '=', student_id), ...])                     # line chart
Original prompt

This section details on the original issue you should resolve

<issue_title>Improve progress data determination</issue_title>
<issue_description>The progress data for the charts that show on the dashboard can now be drawn from several resources.

  1. All Progress resources have the 'Progress' type_id. Use that to find the resouces not the existing 'Progress' name search.
  2. One of the resources has the Notes info that determines start and end dates etc. That remains unchanged.
  3. Check that the subject line chart showing progress over time uses data from any relevant submission.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…for line chart

Co-authored-by: agrogers <13920678+agrogers@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve progress data determination for dashboard charts Improve progress data determination: use type_id lookup and broaden line chart source Mar 20, 2026
Copilot AI requested a review from agrogers March 20, 2026 05:19
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.

Improve progress data determination

2 participants