Skip to content

Add "Generate Feedback" button to Submission form view#94

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/add-generate-feedback-button
Draft

Add "Generate Feedback" button to Submission form view#94
Copilot wants to merge 2 commits intomainfrom
copilot/add-generate-feedback-button

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

Adds a faculty-only "Generate Feedback" button to the header of the submission form view that scaffolds an HTML feedback template from available submission data.

Model (aps_resource_submission.py)

  • New action_generate_feedback() method:
    • Requires faculty — raises UserError for non-faculty users
    • Raises UserError if feedback already exists (prevents silent overwrite)
    • Builds an HTML template containing score summary (with percentage) and model answer reference when available
    • Uses html_sanitize when embedding model_answer content
    • Returns a display_notification success action

View (aps_resource_submission_views.xml)

  • "Generate Feedback" button added to <header>, before "Reviewed"
  • Hidden via invisible="not is_current_user_faculty" — students never see it
<button name="action_generate_feedback" string="Generate Feedback"
        type="object" class="btn-secondary"
        invisible="not is_current_user_faculty"/>

- Add action_generate_feedback method to APSResourceSubmission model
  - Faculty-only guard (raises UserError if non-faculty)
  - Guard against overwriting existing feedback
  - Builds HTML template with score summary and model answer reference
  - Uses html_sanitize for safe HTML embedding
  - Returns display_notification on success
- Add "Generate Feedback" button to the form header in
  aps_resource_submission_views.xml, visible only to faculty

Agent-Logs-Url: https://github.com/agrogers/aps_sis/sessions/6aa08eb8-9606-45ee-8013-42f9b610d3a6

Co-authored-by: agrogers <13920678+agrogers@users.noreply.github.com>
Copilot AI changed the title [WIP] Add generate feedback button to submission view Add "Generate Feedback" button to Submission form view Apr 1, 2026
Copilot AI requested a review from agrogers April 1, 2026 08:43
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.

Add a generate feedback button to the Submission View

2 participants