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

Use react-chartjs-2 for assignment grade distribution chart #5377

Conversation

JunruL
Copy link
Contributor

@JunruL JunruL commented Jul 4, 2021

Motivation and Context

Use react-chartjs-2 to render chart data on the dashboard page using React.

Your Changes

Description:

  • created method in assignment controller
  • added routes and corresponding tests
  • created options parameter in the component's state (the four types of charts should have different options)
  • added ajax request to get assignment grade distribution data
  • will add tests for the new method created in assignment controller (but now I'm not sure whether I will change the method in the future. I will add tests when the method won't be changed any more).

Type of change (select all that apply):

  • New feature (non-breaking change which adds functionality)
  • Test update (change that modifies or updates tests only)

Testing

The new graph is the same as the old one except:

  • The background area color (I find that react-charts-2 does not support this)
  • The labels on the x-axis (also, probably react-charts-2 does not support this)

Questions and Comments (if applicable)

Checklist

  • I have performed a self-review of my own code.
  • I have fixed any Hound bot comments.
  • I have verified that the TravisCI tests have passed.
  • I have reviewed the test coverage changes reported on Coveralls.
  • I have added tests for my changes.

Required documentation changes (if applicable)

Copy link
Contributor

@david-yz-liu david-yz-liu left a comment

Choose a reason for hiding this comment

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

@JunruL good work, this is excellent progress. I left a few inline comments, but also you should be adding tests for your new route in the assignments_controller_spec.rb file. You'll need to generate some real grade data to test the returned JSON of the new route, and I recommend looking in the model test file and the assignments.rb factory file to see what you can use.

app/controllers/assignments_controller.rb Outdated Show resolved Hide resolved
app/controllers/assignments_controller.rb Outdated Show resolved Hide resolved
@david-yz-liu david-yz-liu merged commit 4b67352 into MarkUsProject:react-chartjs Jul 10, 2021
@david-yz-liu
Copy link
Contributor

Thanks, @JunruL!

@JunruL JunruL deleted the assignment-grade-distribution-chart branch July 12, 2021 02:01
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.

2 participants