Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jul 19, 2025

This PR implements the get_course_rubric() function to retrieve full details of a single rubric for a given course from the Canvas LMS API.

What's New

  • Function: get_course_rubric(canvas, course_id, rubric_id, include = NULL)
  • Endpoint: GET /api/v1/courses/:course_id/rubrics/:id
  • Returns: Complete rubric object with all criteria and ratings as a data frame

Features

  • Optional Parameters: Supports include parameter for additional data:

    • "associations" - Include rubric associations
    • "rubric_assessments" - Include rubric assessments
    • Can be a single string or vector of strings
  • Parameter Validation: Validates include parameter values and provides helpful error messages

  • Consistent API: Follows established patterns from other get_* functions in the package

Usage Examples

# Authenticate with Canvas
canvas <- canvas_authenticate(api_key = "your_api_key", base_url = "https://your.canvas.url")

# Get a basic rubric
rubric <- get_course_rubric(canvas, course_id = 12345, rubric_id = 67890)

# Get rubric with associations
rubric_with_assoc <- get_course_rubric(canvas, course_id = 12345, rubric_id = 67890, 
                                       include = "associations")

# Get rubric with multiple includes
full_rubric <- get_course_rubric(canvas, course_id = 12345, rubric_id = 67890,
                                 include = c("associations", "rubric_assessments"))

Implementation Details

  • Follows the same error handling and response processing patterns as existing functions
  • Adds metadata (course_id, retrieved_at) for consistency with other methods
  • Comprehensive roxygen2 documentation with examples and API reference
  • Added to pkgdown configuration in the Rubrics section
  • Updated TODO.md to mark the endpoint as implemented

Files Changed

  • R/get_course_rubric.R - Main function implementation
  • NAMESPACE - Export declaration
  • man/get_course_rubric.Rd - Documentation
  • TODO.md - Mark endpoint as implemented
  • _pkgdown.yml - Add to rubrics section

Testing

  • ✅ All R files parse correctly
  • ✅ URL construction validated for all parameter combinations
  • ✅ Parameter validation works as expected
  • ✅ No breaking changes to existing functionality

Fixes #26.

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:

  • cloud.r-project.org
    • Triggering command: /usr/lib/R/bin/exec/R -e .libPaths(c(&#39;~/R_libs&#39;,~&#43;~.libPaths()));~&#43;~dir.create(&#39;~/R_libs&#39;,~&#43;~showWarnings~&#43;~=~&#43;~FALSE,~&#43;~recursive~&#43;~=~&#43;~TRUE);~&#43;~install.packages(c(&#39;devtools&#39;,~&#43;~&#39;roxygen2&#39;),~&#43;~repos~&#43;~=~&#43;~&#39;REDACTED&#39;,~&#43;~lib~&#43;~=~&#43;~&#39;~/R_libs&#39;);~&#43;~library(devtools,~&#43;~lib.loc~&#43;~=~&#43;~&#39;~/R_libs&#39;);~&#43;~document() (dns block)
  • 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:


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: tin900 <113692500+tin900@users.noreply.github.com>
Copilot AI changed the title [WIP] [Feature] Add get_course_rubric() to vvcanvas Add get_course_rubric() function to retrieve rubric details from Canvas API Jul 19, 2025
Copilot AI requested a review from tin900 July 19, 2025 17:39
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 get_course_rubric() to vvcanvas

2 participants