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

Assessment direct handout download #2020

Closed
wants to merge 10 commits into from
Closed

Assessment direct handout download #2020

wants to merge 10 commits into from

Conversation

damianhxy
Copy link
Member

@damianhxy damianhxy commented Dec 3, 2023

Summary

Summary generated by Reviewpad on 02 Jan 24 19:03 UTC

This pull request adds a new feature to the code. It introduces a "handout_only" toggle to the assessment model and views. The toggle allows an assessment to be marked as consisting solely of a handout, which will be directly downloaded when a student clicks on the assessment. The patch also includes updates to the schema.rb file and wording changes in the basic assessment edit view. Additionally, there are some undoing of inadvertent regressions in the index view. Overall, this pull request enhances the functionality of the assessment module.

Description

Add a "handout only" option to assessments. When enabled, non-instructor users who click on the assessment will be directed to the handout.

Motivation and Context

Facilitates the use of Autolab as a resource sharing medium (requested by 122).

Closes #2021

How Has This Been Tested?

Enable handout only option (under basic) and set a handout.

Screenshot 2023-12-03 at 22 19 55
Screenshot 2024-01-05 at 02 19 56

  • As an instructor, clicking on the assessment loads it as usual.
  • As a student, clicking on the assessment brings you directly to the handout.
  • Ensure handout_only setting is dumped to assessment yml file
  • Ensure handout_only setting is imported. e.g. delete the assessment and import from file system. Option should still be set.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have run rubocop and erblint for style check. If you haven't, run overcommit --install && overcommit --sign to use pre-commit hook for linting
  • My change requires a change to the documentation, which is located at Autolab Docs
  • I have updated the documentation accordingly, included in this PR

Copy link
Contributor

coderabbitai bot commented Dec 3, 2023

Walkthrough

Walkthrough

The changes implemented across multiple files in the application add a "handout only" option to assessments. This feature allows for a one-click download or redirection to a handout, streamlining the process of distributing resources through Autolab. The updates include database schema changes, updates to model serialization, view modifications to accommodate the new option, and conditional logic to handle the presentation and behavior of the new feature.

Changes

File Path Change Summary
app/models/assessment.rb Added handout_only attribute to serialized attributes.
app/views/assessments/.../_edit_advanced.html.erb Changed group_size field to a number field with minimum value constraint.
app/views/assessments/.../_edit_basic.html.erb Added wrap_class to handout field and introduced handout_only checkbox.
app/views/assessments/index.html.erb Added JS conditional for dataset.url and Ruby logic for handout_only badge display.
db/migrate/.../add_handout_only_to_assessments.rb Added handout_only boolean column to assessments table.
db/schema.rb Added handout_only boolean column to submissions table.

Assessment against linked issues

Objective Addressed Explanation
Add an option to allow one-click downloads of an assessment's handout. (#2021) The addition of the handout_only attribute and corresponding UI elements supports one-click downloads or redirection to a handout.
Use Autolab as a medium for resource distribution. (#2021) The implementation of the handout_only option facilitates the distribution of resources via Autolab.

The code changes align with the objectives outlined in the linked issue, providing a "handout only" option for assessments that enables easy access to handouts, thus enhancing the resource distribution capabilities of Autolab.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit's AI:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid.
    • @coderabbitai read the files in the src/scheduler package and generate README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@reviewpad reviewpad bot requested a review from evanyeyeye December 3, 2023 19:17
@reviewpad reviewpad bot added small Pull request is small waiting-for-review labels Dec 3, 2023
@damianhxy damianhxy linked an issue Dec 4, 2023 that may be closed by this pull request
@damianhxy damianhxy changed the title Enable direct handout download option for assessments Assessment direct handout download Jan 5, 2024
@damianhxy
Copy link
Member Author

Closing this in favor of a longer-term solution via #2035. This is pretty ad-hoc and would be superseded in the future.

@damianhxy damianhxy closed this Jan 16, 2024
@damianhxy damianhxy deleted the direct-download branch January 16, 2024 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
small Pull request is small waiting-for-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add "handout only" option to assessments
1 participant