Commit Graph

4 Commits

Author SHA1 Message Date
Cody Cutrer c65d57737a RuboCop: Layout lib
Change-Id: I0655d9a9d750f2debd6378b03d8ddc1403ebc31b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274158
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-22 20:01:52 +00:00
Adrian Packel cd3815d643 Add bulk override grade update endpoint
closes EVAL-1330
flag=none

Test plan:
- Have a course with final grade override enabled and some students
  and grading periods
- Take note of the IDs of one or more students
- Make a PUT request to the API endpoint:
  - /api/v1/courses/<courseid>/update_final_grade_overrides
- With a JSON request body like the following (you can add additional
  records if you feel like it):
  {
    "grading_period_id": "1",
    "override_scores": [
      {"override_score":"60", "student_id":"7"},
      {"override_score":"61", "student_id":"125"}
    ]
  }
- (Replace the grading period and student IDs above with values
  applicable to you, or remove the grading_period_id parameter entirely
  apply the change to the course override score)
- Check that the request returns a Progress object (which should
  finish in short order) and that override grades in the gradebook are
  updated to the values you set
- Check that changing override scores in this way populates gradebook
  history

- Check that the following return unauthorized errors:
  - Accessing the endpoint for a course without final grade override
    enabled
  - Accessing the endpoint for a concluded course
  - Accessing the endpoint as a user who does hnot have permission to
    manage grades

- Smoke test setting override grades manually from Gradebook
  - Make sure it still works and populates gradebook history as before

Change-Id: I78d19d899485b40c6c812867a89b8352c215955f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/253921
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
Reviewed-by: Syed Hussain <shussain@instructure.com>
QA-Review: Syed Hussain <shussain@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
2020-12-15 19:23:46 +00:00
Cody Cutrer 06763dd519 add # frozen_string_literal: true for lib
Change-Id: I59b751cac52367a89e03f572477f0cf1d607b405
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251155
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-10-27 20:49:50 +00:00
Jeremy Neander 66eee60398 create endpoint for final grade overrides
closes GRADE-1876

test plan:
 Notes:
  * To test the endpoint, send use the path:

     GET /courses/:course_id/gradebook/final_grade_overrides

  * To set overrides, perform the following in the Rails console:

     enrollment = course.enrollments.find_by(user_id: <student.id>)

     # to update a course score
     score = enrollment.scores.find_by!(course_score: true)
     score.update!(override_score: 89.2) # some score value

     # to update a grading period score
     period = <some grading period>
     score = enrollment.scores.find_by!(grading_period: period)
     score.update!(override_score: 89.2) # some score value

 A. Setup
    1. Select or create a course
    2. Ensure the course has at least one assignment
    3. Enable the "Final Grade Override" feature flag
    4. Use an enrollment term with some grading periods
    5. Override a student's course score
    6. Override a student's grading period score

 B. Verify
    1. As a teacher in the course, send a request to the endpoint
    2. Verify the response is structured as follows:

       {
         final_grade_overrides: {
           <student_id>: {
             course_grade: {
               percentage: 12.34
             },
             grading_period_grades: {
               <grading_period_id>: {
                 percentage: 56.78
               },
               <grading_period_id>: {
                 percentage: 90.12
               }
             }
           },
           <student_id>: {…}
         }
       }

    3. Verify the response includes ids of only students with
       overrides
    4. Verify each student represented includes scores for only the
       specific overrides assigned
       * not all grading period ids will be included if they do not
         all have overrides
       * the course grade override will not be included if not
         assigned
    5. Verify the override percentage values are accurate

Change-Id: I0e7df11139518b94460883d3dbd4700cba9aaeda
Reviewed-on: https://gerrit.instructure.com/174017
Tested-by: Jenkins
Reviewed-by: Gary Mei <gmei@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
QA-Review: Adrian Packel <apackel@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
2018-12-07 18:26:39 +00:00