Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jul 19, 2025

This PR implements the list_course_rubrics() function to retrieve all rubrics attached to a course from the Canvas LMS API, as requested in the feature request.

🎯 What's Added

New Function: list_course_rubrics()

  • Endpoint: GET /api/v1/courses/:course_id/rubrics
  • Parameters:
    • canvas - API authentication object
    • course_id - Course ID (required)
    • include - Optional parameter for additional data ("associations", "rubric_assessments", or vector)
    • per_page - Pagination support (default 100)
  • Returns: Data frame of rubric objects with all available metadata

Usage Examples

# Basic usage - get all rubrics for a course
rubrics <- list_course_rubrics(canvas, course_id = 12345)

# Include rubric associations
rubrics_with_associations <- list_course_rubrics(
  canvas, 
  course_id = 12345,
  include = "associations"
)

# Multiple include options
rubrics_full <- list_course_rubrics(
  canvas,
  course_id = 12345, 
  include = c("associations", "rubric_assessments")
)

📁 Files Changed

  • R/list_course_rubrics.R - Main function implementation
  • man/list_course_rubrics.Rd - R help documentation
  • NAMESPACE - Export declaration added
  • TODO.md - Endpoint marked as implemented ✅
  • _pkgdown.yml - Added "Rubrics" section to documentation site

🔧 Implementation Details

Follows vvcanvas Patterns

  • Consistent with existing functions like get_assignments() and list_all_enrollment_terms()
  • Same parameter structure and error handling approach
  • Comprehensive Roxygen documentation with real-world examples

Robust Error Handling

  • Parameter validation for canvas and course_id
  • HTTP status code handling (401 authentication, 404 not found)
  • Graceful handling of empty results
  • Clear error messages for troubleshooting

Feature Support

  • Include Parameter: Supports string or vector for additional data
    • "associations" - Include rubric associations
    • "rubric_assessments" - Include rubric assessments
  • Pagination: Configurable per_page parameter (default 100)
  • Flexible Input: Accepts numeric or character course_id

✅ Quality Assurance

  • ✓ Syntax validation passed
  • ✓ Parameter validation tested
  • ✓ Error handling verified
  • ✓ Package integration confirmed
  • ✓ Documentation completeness validated
  • ✓ Follows existing code patterns and conventions

The function is ready for production use and provides comprehensive access to Canvas course rubrics with full metadata support.

Fixes #24.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…sting

Co-authored-by: tin900 <113692500+tin900@users.noreply.github.com>
Copilot AI changed the title [WIP] [Feature] Add list_course_rubrics() to vvcanvas Add list_course_rubrics() function to retrieve course rubrics from Canvas API Jul 19, 2025
Copilot AI requested a review from tin900 July 19, 2025 17:35
Copy link
Contributor

@tin900 tin900 left a comment

Choose a reason for hiding this comment

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

@copilot use the new paginate function see other functions how to use it

Co-authored-by: tin900 <113692500+tin900@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jul 23, 2025

@copilot use the new paginate function see other functions how to use it

Updated the list_course_rubrics() function to use the new paginate helper function. Changes include:

  • Removed the per_page parameter since pagination is now handled automatically
  • Updated function to use paginate(response, canvas$api_key) pattern like other functions
  • Uses lapply() and dplyr::bind_rows() to combine paginated results
  • Updated documentation to reflect the changes

Commit: 3e0630a

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from tin900 July 23, 2025 13:58
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.

[Feature] Add list_course_rubrics() to vvcanvas

2 participants