closes EVAL-1314
flag=none
Test Plan:
1. Create an anonymous assignment. Grade a few students anonymously in
SpeedGrader. Don't post grades yet.
2. Export the Gradebook.
3. Open the exported CSV. Verify that all scores for the anonymous
assignment show as "N/A" and the header shows "Manual Posting (scores
hidden from instructors)".
4. Make some changes to scores in the CSV, making sure to change at
least one score for the anonymous unposted assignment, and one score
for an active, non-anonymous assignment.
5. Import the changed CSV. Verify the changes to the anonymous
assignment are ignored, and the changes to the non-anonymous
assignment are not ignored.
6. Post grades for the anonymous assignment.
7. Re-export the Gradebook.
8. Open the exported CSV. Verify that all scores for the anonymous
assignment are now shown.
9. Make some changes to scores in the CSV for the anonymous assignment.
10. Import the changed CSV. Verify the changes to the anonymous
assignment are no longer ignored.
* Edge case: try steps 1-10 but with your locale set to anything other
than English. This will ensure the Gradebook Importer logic can
handle and identify headers such as, "Manual Posting (scores cachés
aux instructeurs)". Note that "Manual Posting" will never be
translated (always English), but the content in parentheses will be
translated. This is expected.
Change-Id: Ief17a06bd97c15b4138531030ed50ba19f2e03fa
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/253151
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
If a CSV file is imported and contains override score changes (which
will only be processed in the first place if the relevant feature flag
is on), show the changes on the upload confirmation screen and allow the
user to edit them as with assignments. Do not actually apply the
changes yet.
closes EVAL-1351
flag=import_override_scores_in_gradebook
Test plan:
- With the "Import Override Scores in Gradebook" feature ON:
- Upload a CSV with changes to override scores
- As with assignments, if any student's override grade has changed for
a given grading period, the upload confirmation screen should show
the old and new override scores for all students for that grading
period
- Ditto for override scores for the whole course
- Any changes that would decrease a student's override score, or
remove a score, should be highlighted in red
- You should be able to edit the scores inline and have the changes
stick
- Note that confirming/submitting will not actually submit the
override changes
- With the "Import Override Scores in Gradebook" feature OFF:
- Changes to override scores in imported CSVs should not be
acknowledged on the confirmation page
Change-Id: Ie27a88bda45ce39f6e879c92d8ab2b38685797ad
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/254944
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Adrian Packel <apackel@instructure.com>
Product-Review: Jody Sailor
Reviewed-by: Gary Mei <gmei@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
closes FOO-1328
flag=none
TEST PLAN:
1) upload a badly encoded file for gradebook
2) the job should fail, as it already does,
but without notifying sentry (logs still happen)
Change-Id: I3b09f93a2138bd843e0229bf25e15f54593879b7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/255081
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
Allow the gradebook importer to recognize changes override scores and
record them as part of a gradebook upload. (The changes are not yet
shown to the user on the confirmation page or applied in any way; they
are only stored in the temporary upload object created on the backend.)
closes EVAL-1293
flag=import_override_scores_in_gradebook
Test plan:
Run the following tests with two CSV files: one with grades for the
course as a whole, and the other with grades for a specific grading period.
For the latter file, you can either ensure the separate "export grading
periods in column headers" commit is merged and the associated feature
flag turned on when you export, or you can fake it by taking an existing
file and renaming the "Override Score" column to include the grading
period (e.g., "Override Score (Fall 2020)").
- Have a course with override grades enabled and some grading periods
active
- Give out some override grades for the course and for individual
grading periods
- Export a CSV
- After exporting, make some changes to override scores in either the
gradebook or the CSV file
- With the feature flag ENABLED:
- Open the Network tab or equivalent in your browser's developer tools
- In Gradebook, import the CSV file from earlier
- On the confirmation page, check the network requests for a request
to gradebook_uploads/<id>/data
- Examine the response JSON, and look at the "students" hash
- Assuming there was at least one student with an override score
change, each student hash should contain an "override_scores"
entry with override score data (even if unchanged)
- If there were no override score changes at all, none of the
"override_scores" arrays should contain any elements
- The actual "review changes" page will not recognize the changes yet,
so if it claims that there are no changes, that's fine
- With the feature flag DISABLED:
- Upload a modified CSV and examine the response JSON as above
- It should not contain any override grade changes for any students
Change-Id: I6f4d391e8c639b1894306e325c5d1c1736dd58e5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/252696
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
fixes EVAL-1035
flag=none
Test Plan
- Export the gradebook.
- In the csv, assign 1 grade to have a leading space, 1 to have a
trailing space, and 1 with neither.
- Import the gradebook.
- Verify that the changes are present without issue.
Change-Id: I62a6696bd6dbbb2b08e1ff4e3133c1b4522e2c2f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244781
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Syed Hussain <shussain@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
test plan:
* smoke test todo list
(needs grading and peer review lists in particular)
closes #LA-952
Change-Id: I613ffa2499986700744482c56976bba207cfb971
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/234903
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
closes TALLY-800
flag=none
Test Plan
- Export the gradebook.
- Change some values for a student.
- Import the gradebook.
- Verify that importing still works.
Change-Id: Id4f785deccce98b643a1ab1aa4aaac559f43e2ea
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/232734
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Spencer Olson <solson@instructure.com>
Product-Review: Spencer Olson <solson@instructure.com>
The gradebook importer will now ignore reserved names it counts on, such
as "Section". Also, it will ignore custom columns that are not in an
active workflow state, bringing the importer in line with the exporter.
closes APG-122
flag=gradebook_reserved_importer_bugfix
test plan:
- Ensure that the gradebook_reserved_importer_bugfix feature flag is On
- Part 1:
- Create a custom column (either via the rails console or the API)
and set the workflow_state to hidden or deleted
- Create a gradebook import with that custom column and data in it
- Note that the column is ignored during upload
- Part 2:
- Create a custom column, with validations skipped, via the rails
console with a reserved name such as "Section."
- Create a gradebook import with that custom column and data in it
- Note that the column is ignored during upload
Change-Id: I69692738a6ee9e96ab4f404f33ae6ba193149d9e
Reviewed-on: https://gerrit.instructure.com/211545
Tested-by: Jenkins
Reviewed-by: Gary Mei <gmei@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: Nick Pitrak <npitrak@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
This stops creation of gradebook custom columns that match
reserved/special names that the gradebook importer is expecting.
refs APG-122
flag=gradebook_reserved_importer_bugfix
test plan:
- Make sure the gradebook_reserved_importer_bugfix feature flag is set
to On
- Using the /api/v1/courses/:course_id/custom_gradebook_columns
endpoint, attempt to create a custom column with one of the reserved
keywords such as "Section"
- Note that an error is returned
Change-Id: I22291fdc5c41c0ff604f6515080b96b658a55e7e
Reviewed-on: https://gerrit.instructure.com/212249
Tested-by: Jenkins
Reviewed-by: Derek Bender <djbender@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Keith Garner <kgarner@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
fixes GRADE-2251
Test Plan:
- Create a course, teacher, and assignment with pass-fail grading
- From gradebook, export the CSV
- In the CSV, change the assignment's grade to 'EX'
- Import CSV back to gradebook
- Assignment's grade should now be excused
Change-Id: I58b5f57da774e262d8176f2369f2b74ff0b3f100
Reviewed-on: https://gerrit.instructure.com/198757
Tested-by: Jenkins
Reviewed-by: Gary Mei <gmei@instructure.com>
Reviewed-by: Keith Garner <kgarner@instructure.com>
QA-Review: Jeremy Neander <jneander@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
fixes GRADE-2229
test plan
- export gradebook
- it should work
- set root_account to include integration_ids in gradebook
- export gradebook
- it should include integration_id
- account grade export reports should also use account setting
- import grade export that includes integration_id
- it should import with out error
Change-Id: I7b5eb980492c3ee657e87df27217263c36615cb4
Reviewed-on: https://gerrit.instructure.com/196982
Tested-by: Jenkins
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
Reviewed-by: Keith Garner <kgarner@instructure.com>
Reviewed-by: Nathan Mills <nathanm@instructure.com>
closes GRADE-1859
Test plan:
- Set up a course with Post Policies enabled
- Ensure at least one assignment is manually-posted
- (i.e., `assignment.post_mnually?` returns true)
- (can be set at the assignment level or via the default course policy)
- Export grades to CSV
- In place of the previous "muted" row, there should be a row
containing "Manual Posting" for manually-posted assignments
and no value for other assignments
- Turn manual posting off for all assignments in the course
- Re-export to CSV
- This time, the "Manual Posting" line should be absent
- Set up a course with Post Policies disabled
- Check that exporting behaves as it did previously
- (i.e., it should check for muted assignments and include a "muted"
row if there are any)
Change-Id: I4d52b28acf910b0a9acb652cbb10686c44075689
Reviewed-on: https://gerrit.instructure.com/190389
Tested-by: Jenkins
Reviewed-by: Gary Mei <gmei@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: Adrian Packel <apackel@instructure.com>
Product-Review: Jonathan Fenton <jfenton@instructure.com>
closes GRADE-1998
Test plan:
- Have a course with Final Grade Override enabled
- Set up at least one grading period and some assignments
- Enable "show totals for all grading periods" option for the
grading period set
- In new Gradebook, turn on the "Allow final grade override" setting
- (Note this does *not* affect whether the new columns are
included; it's just to let you enter values)
- Leave some assignment grades and some override grades
- Export to CSV for the following scenarios:
- With a grading standard enabled for the course
- With a grading period selected
- CSV should include override score/grade for the period
- With no grading period selected
- CSV should include override score/grade for the whole course
- With no grading standard enabled for the course
- With a grading period selected
- CSV should include override score for the period
- With no grading period selected
- CSV should include override score for the whole course
- Re-import one of the above CSVs
- The import should ignore the above columns, even if changed
- Disable the Final Grade Override feature flag
- Export to CSV
- The CSV file should NOT contain either override column
Change-Id: Ic352bb508007f13d6025390460e411aac512ccbb
Reviewed-on: https://gerrit.instructure.com/181265
Tested-by: Jenkins
Reviewed-by: Derek Bender <djbender@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
QA-Review: Gary Mei <gmei@instructure.com>
Product-Review: Matthew Goodwin <mattg@instructure.com>
Export scores in CSV files with 2 digits of precision to match what is
shown in Gradebook, and compare against existing scores at that same
precision when importing. Do not include thousands separators.
fixes GRADE-871
Test plan:
- Have a course with some students and a points-based assignment
- Enter a score greater than one thousand
- Enter a score with three decimals of precision that rounds up
(e.g., 123.456); this will display as 123.46
- Export the CSV file
- In the CSV:
- Scores greater than one thousand should *not* include any
thousands separators
- All scores should appear with a precision of two decimal places
(even if there is no decimal component), with whatever rounding
that entails
- Re-import the CSV without modifying it
- You should be told that no changes were found (i.e., the lack of
a thousands separator and the rounding should not cause false
positives)
- Make some changes to those values and reimport the CSV
- The import page should identify your changes as expected
Change-Id: Ia88d257b4ea57bf72ac25773fdd1ccdbd0ee605b
Reviewed-on: https://gerrit.instructure.com/173856
Tested-by: Jenkins
Reviewed-by: Keith Garner <kgarner@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
QA-Review: Gary Mei <gmei@instructure.com>
Product-Review: Sidharth Oberoi <soberoi@instructure.com>
When importing a gradebook CSV and and analyzing what changes have been
made, map changes to custom columns properly and do not attempt to
include deleted or hidden columns.
fixes GRADE-1616
Test plan:
- In a course with some students, set up four custom columns
(referred to as C1 through C4); for now, don't change any
settings on them
- In new Gradebook, set some values for the columns
- Adjust them as follows:
- C1: deleted
- C2: hidden
- C3: read-only
- C4: [leave as is]
- Export a CSV
- The CSV should contain C3 and C4 but not the other two
columns (this behavior has not changed)
- Twiddle some assignment scores and custom-column values in the CSV
- Import the edited CSV and check the following on the proposed
changes screen:
- Changes to C4 are shown as expected
- Any changes to assignment scores are shown as expected
- Changes to C3 are *not* shown, and the warning message about
preventing changing read-only columns is shown at the bottom
- Otherwise, everything is as you'd expect: the importer isn't
attempting to replace a custom column with the section name
or perpetrate any similar skulduggery
Change-Id: Ib1ebcec6820120288e67c1652cb5496a8b8240a7
Reviewed-on: https://gerrit.instructure.com/167149
Reviewed-by: Keith Garner <kgarner@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: Gary Mei <gmei@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
Tested-by: Jenkins
When importing a gradebook, the csv import can include custom columns
closes GRADE-1315
Test Plan
- Create a course with (not read_only) custom columns in the gradebook
- Export the gradebook to csv
- Make changes to the data in the writable custom columns in the csv
- Import the csv into gradebook
- Run the delayed jobs server
- The gradebook will make changes in writable custom columns with
or without additional changes in assignment columns
- If no changes are made, or changes in non writable columns are made,
the importer will skip these changes
Change-Id: I0a529ea8727be864f6105b9e6b256f75e1c8c471
Reviewed-on: https://gerrit.instructure.com/156068
Tested-by: Jenkins
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
QA-Review: Adrian Packel <apackel@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
Uploading a csv with moderated assignments would fail because
the attributes that would be checked weren't previously loaded in.
fixes GRADE-1374
Test Plan
- Create a moderated assignment.
- Export the gradebook.
- Modify the grade for the moderated assignment.
- If you are the final grader, uploading should work.
- If you are not the final grader, uploading should have no effect.
Change-Id: If0cef730e3b22cd9b049a9c44133cb7a389a6e85
Reviewed-on: https://gerrit.instructure.com/157526
Tested-by: Jenkins
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: Sidharth Oberoi <soberoi@instructure.com>
fixes GRADE-1324
Test Plan
- Have DelayedJobs running.
- Create a course with one teacher and at least one student.
- Create an assignment for that course.
- Go to the User settings of the teacher and turn on the option to
use semicolons in Gradebook Export.
- Go to the Gradebook as the teacher and export the Gradebook.
- Open the csv file and change the grade a bit.
- Verify that the csv did indeed use semicolons rather than commas.
- Import that csv file back into the Gradebook.
- Verify that the import worked successfully.
- Turn off the option for using semicolons and instead use commas.
- Verify that export/import works with commas using the same above
steps.
Change-Id: I42870aeb3ff4064f3db39ed1b67681e2acc4ed8e
Reviewed-on: https://gerrit.instructure.com/156648
Tested-by: Jenkins
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Adrian Packel <apackel@instructure.com>
Product-Review: Sidharth Oberoi <soberoi@instructure.com>
When exporting a gradebook,
the csv should include custom columns listed at the final columns.
fixes GRADE-1275
Test Plan (Exporting)
-Create a course
-Use the public api to add custom columns, 1 read only and 2 writable
(POST /api/v1/courses/:course_id/custom_gradebook_columns)
-Use the public api to add data into those custom columns
(PUT /api/v1/courses/:course_id/custom_gradebook_columns/:id/data/:user_id)
-Navigate to the gradebook for the course and inspect the columns
-Export to csv
-Check if the csv has the proper columns as the gradebook, the read only column
should not have changed, while the writable columns should display the changes
Test Plan (Importing)
-Follow the steps above to export to csv
-Change any data in an assignment column
-Make sure the column changed is not (read only)
-Save the csv and upload into gradebook
-Check if the assignment changes appear in the gradebook
Change-Id: I36a7d53af7b86ffcb6cdfbc4f78effcb0df9a3fe
Reviewed-on: https://gerrit.instructure.com/155027
Tested-by: Jenkins
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: Keith T. Garner <kgarner@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
fixes GRADE-976
test plan:
* Make sure the AMM flag is off
* All AMM features should be visible and work
* The Anonymous Marking and Moderated feature flags should be visible
* Toggling the AMM feature flag should do nothing
Change-Id: Ie0c52c23748389c6f5df5b85e8580bdf474c0a52
Reviewed-on: https://gerrit.instructure.com/152067
Reviewed-by: Adrian Packel <apackel@instructure.com>
Tested-by: Jenkins
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
Include unposted scores and grades for assignment groups as well as
current/final scores in the Gradebook CSV export.
closes GRADE-762
Test plan:
- Set up a course with some students and one or more assignment groups.
- Add some assignments and record some grades. Mute at least one of the
assignments.
- Export the grades from the course. Check that the resulting CSV file
includes columns for unposted scores for each assignment group you
exported and that they correctly reflect the values for unposted
scores.
- Also check that the CSV includes corresponding unposted columns for
each summary column (current score, final score, and so on) and that
each new column's value takes into account the scores of unposted
assignments.
- Finally, import the CSV file you just exported and make sure there
are no errors due to the addition of the new columns (as with the
rest of the summary columns, they should be ignored by the importer).
Change-Id: I3bbbe6b5ad93816d929fa72b48a6006271825ed4
Reviewed-on: https://gerrit.instructure.com/138047
Reviewed-by: Spencer Olson <solson@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: Indira Pai <ipai@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
test plan
- specs should pass
Change-Id: Iafc7c9b8ca64f32568e658b600e19c2e6f9045ca
Reviewed-on: https://gerrit.instructure.com/138026
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
fixes GRADE-271
Test Plan:
1. Modify a local copy of config/locales/is.yml, adding
the following translation key:
csv:
column_delimiter: ";"
2. Change Canvas settings to Íslenska (Icelandic):
- root account settings
- user profile
- course settings
3. Create at least two students and at least two
assignments for a course.
- name at least one assignment with non-ASCII
Icelandic characters such as "ð"
- name at least one assignment with multi-byte
Unicode characters, such as "文章"
4. Grade the assignments, covering the following:
- decimal grade (with comma as decimal separator)
- integer grade
- empty grade
5. Go to (old) gradebook, export grades and download it
6. Configure Microsoft Excel for Icelandic language
7. Open the download in Excel. Verify that rows and
columns are interpreted correctly, and that non-
ASCII characters are displayed correctly.
8. Import the download in Google Sheets, specifying
semicolon as the custom delmiter. Repeat the
verification from (7)
9. Repeat steps 3-8 using new gradebook.
10. Repeat steps 3-8 using US English for all
language settings.
11. Copy the Icelandic and English grade exports and
modify some student grades
12. Import the modified Icelandic export file, while
configured for US English. Verify that student
grades are updated.
13. Import the modified English export file. Verify
that student grades are updated.
Change-Id: Icf7fcdadae5b22fad524a224d956fd93c2438b57
Reviewed-on: https://gerrit.instructure.com/128786
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
Tested-by: Jenkins
QA-Review: Indira Pai <ipai@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
closes CNVS-39159
test plan:
- upload a gradebook import with an invalid header row
- it should behave the same as previously, from the user perspective
- check failed jobs, the jobs should not be listed there
Change-Id: I9a0c1fa61e6b3e105fe01398331c5dd8b37c705b
Reviewed-on: https://gerrit.instructure.com/125356
Reviewed-by: Matt Taylor <mtaylor@instructure.com>
Tested-by: Jenkins
QA-Review: Neil Gupta <ngupta@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
fixes CNVS-36866
test plan:
* Create a course with a student
* Create an assignment with a past due date
* Add a missing policy on the course
* The student's score for the missing submission should reflect your
policy
Change-Id: I005cd64945e882c1ca9ebfc8cb70360640f24876
Reviewed-on: https://gerrit.instructure.com/113601
Tested-by: Jenkins
Reviewed-by: Matt Taylor <mtaylor@instructure.com>
Reviewed-by: Shahbaz Javeed <sjaveed@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
Fixes CNVS-35631
Test plan:
* Create a course with an assignment and a student
* Create another course with another student
* In rails console:
edd = EffectiveDueDates.for_course(course1)
edd.in_closed_grading_period?(assignment, student_in_other_course)
This should return false, rather than crash.
Change-Id: I6facdf0643b2eabc557ff2fc651534d5572bfc0b
Reviewed-on: https://gerrit.instructure.com/104965
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
Tested-by: Jenkins
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: Spencer Olson <solson@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
This switches the gradebook import process to using EffectiveDueDates
to find student specific due dates. This avoids the N+1's that
calling Submission#cache_due_date can create.
closes CNVS-35366
test plan:
- Smoketest that gradebook importer still works, especially with a
few assignments overrides
- Speed test the gradebook on a large course
Change-Id: Ib669fbede2c50e78a53420868492342109df5b13
Reviewed-on: https://gerrit.instructure.com/103937
Tested-by: Jenkins
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
Fix an N+1 when processing existing submissions in the gradebook
importer. Prior to the N+1 fix, for each submission it would load the
assignment, the course, and the account.
fixes CNVS-35243
test plan:
- Smoketest that gradebook importer still works
- If possible, performance test with and without this fix
Change-Id: I0948a92d47e37c445ed7582d1f7bb39905837984
Reviewed-on: https://gerrit.instructure.com/103299
Tested-by: Jenkins
Reviewed-by: Derek Bender <djbender@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
Fixes CNVS-27109
Test plan:
Regression test everything related to multiple grading periods.
In particular, make sure:
* there is no mention of the multiple grading periods feature flag on
the account or course features pages
* make sure grading periods UI always shows up on the account grading
standards page
* make sure the grading periods UI only shows on the course grading
standards page if legacy course grading periods exist for that course
(see below)
* grading period dropdowns only show up everywhere else if there are
grading periods to show. Otherwise, it should behave as if MGP is
"disabled"
* Grade calculation should work as expected with and without grading
periods
To create legacy course grading periods, you have to use rails console:
1. Find your course:
course = Course.find(<id>)
2. Create a grading period group:
group = course.grading_period_groups.create!(title: "2017")
2. Create a grading period:
group.grading_periods.create!(
weight: 1,
title: 'Fall',
start_date: 5.days.ago,
end_date: 10.days.from_now
)
Here's the list of known places grading periods can be seen in the UI:
Instructor Assignments page
(https://community.canvaslms.com/docs/DOC-2615)
Student Assignments page
(https://community.canvaslms.com/docs/DOC-3123)
Gradebook (https://community.canvaslms.com/docs/DOC-2785)
Gradebook Individual View
(https://community.canvaslms.com/docs/DOC-2788)
Course Settings grading schemes page
(https://community.canvaslms.com/docs/DOC-4042)
Student Grades page (https://community.canvaslms.com/docs/DOC-1291)
Dashboard global Grades page
(https://community.canvaslms.com/docs/DOC-5464)
Change-Id: Iefac4b08120bd1699d4ed98bcb418089eec9b3b8
Reviewed-on: https://gerrit.instructure.com/99744
Reviewed-by: Spencer Olson <solson@instructure.com>
Tested-by: Jenkins
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
An assignment's context was being loaded once per assignment per
student. This eliminates the N+1 by preloading the context with the
assignments.
closes CNVS-32664
test plan:
- verify gradebook import still imports
Change-Id: I024b6022dc3dc4279ce3d168da9ae15489e6274f
Reviewed-on: https://gerrit.instructure.com/97031
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
Reviewed-by: Shahbaz Javeed <sjaveed@instructure.com>
Tested-by: Jenkins
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
closes CNVS-32229
closes CNVS-32232
test plan:
* Create a course with MGP enabled and two grading periods in
the default term
* Create two assignments for this course, one in a closed GP and
one in an open GP
* To test overrides, create the following as well:
* For one of the students, make the open assignment due in the
closed grading period
* For another student, make the closed assignment due in the
open grading period
* Ensure the following steps work for all assignment/student
combos due in a closed grading period.
** CNVS-32229 **
* Login as a teacher
* Go to speedgrader for the assignment in the closed GP
* Notice that the grade input is locked down
* Right click on the locked-down input and select 'Inspect'
* Remove the 'ui-state-disabled' class and remove
readonly="readonly" from the input field's HTML
* Notice the input is no longer grayed out and you can enter
a grade
* Enter a grade and tab out of the input
* You should see an error message that says something went wrong
and notice in the Network tab of your dev tools that the AJAX
post failed, meaning the submission was not gradeable
* Refresh the page and notice the grade is not there.
* Verify it isn't there in Gradebook either
* Login as an admin
* Go to speedgrader for the assignment in the closed GP
* Notice that the grade input is *not* locked down
* Enter a grade and tab out of the input
* You should *not* see an error message that says something went
wrong meaning the submission was graded successfully
* Refresh the page and notice the grade is there.
* Verify it is also present in Gradebook
** CNVS-32232 **
* Login as a teacher
* Go into a gradebook that has an assignment that is
locked down because it is in a closed grading period
* Notice that the grade cells for the assignment are locked
down (because the submissions fall in a closed grading period)
* Right-click on one of the locked-down cells and select 'Inspect'
* Remove the 'grayed-out' and 'cannot_edit_in_closed_grading_period'
classes
* Notice the cell is no longer grayed out and you can enter a grade.
* Enter a grade
* Click on another cell.
* You should see an error message that says something went wrong
and in the Network tab of your dev tools verify the AJAX post
failed, meaning the submission was not gradeable
* Refresh the page and notice the grade is not there
* Login as an admin
* Login as a teacher
* Go into a gradebook that has an assignment that is
in a closed grading period
* Enter a grade in a cell that should be due in a closed grading
period
* Click on another cell
* You should *not* see an error message that says something went
wrong meaning the submission was graded successfully
* Refresh the page and notice the grade is there.
* Verify it is also present in Gradebook
Change-Id: Ia80e4de626616309c5e9dffb78ed0f9671ad1076
Reviewed-on: https://gerrit.instructure.com/95687
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Tested-by: Jenkins
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
the implementation was actually true if the user was an admin of any
account or sub-account in the given institution.
closes CNVS-32901
test plan:
- test multiple grading period restrictions for admins
Change-Id: Ib0a52da45d1bdf4b05dadd85003782db3bef9851
Reviewed-on: https://gerrit.instructure.com/93472
Reviewed-by: Spencer Olson <solson@instructure.com>
Tested-by: Jenkins
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
This removes N+1 from the importer by preloading grading
periods and admin_of_root_account?.
Fix imports so that submissions with no due date fall
into the last period for the course.
closes: CNVS-26720
test plan:
1. Test that a gradebook upload can update a submission's
grade in a grading period where it is the last grading
period for the term (course) and the due date is nil
2. Test that an update fails if the above conditions are met
and the grading period is closed
3. Finally test for no N+1s during the import:
- have a course with grading periods and assignments
- import a gradebook csv as a basic teacher enrollment
- notice in the logs that there are not several (1 per
submission) N+1s for Grading Periods during import parsing
Change-Id: Ia595eaa50e44a2813727803aa13b897ee29fbd00
Reviewed-on: https://gerrit.instructure.com/91623
Tested-by: Jenkins
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
close date will now be respected when uploading a gradebook CSV.
this means a) grades cannot be changed if they fall in a closed
grading period, and b) assignments cannot be created via upload
if they would fall in a closed grading period.
closes CNVS-26720
test plan:
1. turn multiple grading periods on
for a course, go to the gradebook
and click 'import'.
2. log in as a non-admin teacher and verify via
CSV upload:
a) trying to change the grade for a submission
that falls in a closed grading period does
not change the grade and displays a message
before uploading that says some submissions
were skipped because they were not gradeable.
b) changing the grade for a submission with a due
date that does not fall in a closed grading period
is allowed.
c) trying to create a new assignment (by adding
a new assignment column in the CSV) does not
succeed if the last grading period in the course
is closed. also verify a message is displayed
saying new assignments could not be created
because they would fall in a closed grading period.
d) creating a new assignment (by adding a new assignment
column in the CSV) succeeds if the last grading period
in the course is not closed.
3. log in as a root account admin and verify step 2a allows
the user to change a submission's grade and step 2c allows
the user to create a new assignment.
4. turn off multiple grading periods and verify gradebook upload
behaves normally.
Change-Id: Ic4e9e1b08d7910cf99b5c4cff57d921e80af9e19
Reviewed-on: https://gerrit.instructure.com/88540
Tested-by: Jenkins
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
Gradebook export now honors the settings from gradebook related to
showing active and inactive enrollments.
fixes CNVS-30640
test plan:
- Create a course with an assignment, and three
students, one active, one inactive, and one concluded.
- In gradebook turn off show inactive and show concluded.
- Export the gradebook and note that only the active student shows.
- In gradebook turn on show inactive.
- Export the gradebook and note that both the active and inactive
students show.
- In gradebook turn off show inactive and turn on show concluded.
- Export the gradebook and note that both the active and concluded
students show.
- In gradebook turn on show inactive and turn on show concluded.
- Export the gradebook and note that all the students show
- Edit the export and change the grade for all students.
- Upload the export and note that only the active and inactive students
are graded
Change-Id: I40dfe08991049f0689e05588f189b33a59cf9813
Reviewed-on: https://gerrit.instructure.com/86570
Reviewed-by: Derek Bender <djbender@instructure.com>
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Tested-by: Jenkins
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Christi Wruck
used to turn 1.0.to_s to "1"
closes #CNVS-28310
Change-Id: I79106a4c0b42fe9b6d96097aaf9dd28a43024373
Reviewed-on: https://gerrit.instructure.com/75194
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
test plan:
* basic regression test of assignment overrides
closes #CNVS-27549
Change-Id: Ie463848b3831087efb3f9ec762dca6264055ee76
Reviewed-on: https://gerrit.instructure.com/73139
Tested-by: Jenkins
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
refs CNVS-27034
also refs gerrit c/71414/
this takes out the old "pass text" path that shouldn't be used
anymore for processing gradebook uploads. No active code paths
are being changed.
TEST PLAN:
1) gradebook imports still work
Change-Id: I3e0840c86ad7d0441164dcf6202932fc319d80e7
Reviewed-on: https://gerrit.instructure.com/71528
Tested-by: Jenkins
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
closes CNVS-27034
stops dumping the file to the delayed job parameter, which was never a
good idea. This sends it to S3 or file storage and streams it from
there on import. With the current setup, way more memory than necessary
is consumed while the job is running, and this is the way we process
large files in places like SIS anyway so this makes it more consistent.
TEST PLAN:
1) gradebook imports should still work
2) gradebook import jobs should not eat memory like popcorn
Change-Id: If5bc1aab2eba01c617d6c37480fe777000d80165
Reviewed-on: https://gerrit.instructure.com/71414
Reviewed-by: Derek Bender <djbender@instructure.com>
Tested-by: Jenkins
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
When the GradebookImporter receives data which would create
a new assignment, but there exists a future grading period,
the new assignment is not creatable due to MGP logic. This
change makes assignment creation and editing of assignments
without due dates possible through the GradebookImporter.
fixes CNVS-25380
Test plan:
0. In a course with a student…
1. Create a grading period in the present and another in
the future.
2. Export the gradebook.
3. Open the exported file and add a new assignment column
to the gradebook.csv, putting the name in row 1 and
possible points in row 2.
4. Import the gradebook.
5. Verify that the gradebook is imported and a new
assignment is created.
Change-Id: I8f88547582c1a632c7129eac72a4ba4e7f12a624
Reviewed-on: https://gerrit.instructure.com/68498
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Tested-by: Jenkins
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
QA-Review: Jason Carter <jcarter@instructure.com>
Product-Review: Christi Wruck
the sis login id is now always included in the
gradebook export, even if the teacher does not
have 'read sis' privileges.
closes CNVS-24913
test plan:
* disable "Read SIS Data” permission for
Teacher role
* enroll teacher in a course with students
and assignment items
* download the Gradebook as the teacher
* verify the “SIS Login ID” column is
included in the CSV
* enable "Read SIS Data" for Teacher role
* download the Gradebook as the teacher
* verify the "SIS Login ID" column is
included in the CSV
* in the examples above, verify that you
can import the CSVs that were exported
without any errors
* verify that you can import a CSV that
was exported before this change was made
by a teacher without 'read sis data'
permissions (a CSV without the 'SIS Login ID'
column).
Change-Id: I4668e9aca30f3b3e271713280cd1e9c915d5b240
Reviewed-on: https://gerrit.instructure.com/67749
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
Tested-by: Jenkins
QA-Review: Jason Carter <jcarter@instructure.com>
Product-Review: Spencer Olson <solson@instructure.com>
fixes CNVS-22054 (frd)
Test plan:
* enable multiple grading periods
* download the gradebook csv, make sure totals are correct
Change-Id: I24c50f47f112551a56da7cbcecc92acf5996ff48
Reviewed-on: https://gerrit.instructure.com/66342
Reviewed-by: Spencer Olson <solson@instructure.com>
Tested-by: Jenkins
QA-Review: Jason Carter <jcarter@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
this commit also adds support for the
'Display Totals for "All Grading Periods' feature
flag for exported gradebooks.
closes CNVS-24001
test plan:
- navigate to a gradebook with multiple
grading periods
- select all grading periods via the
grading period dropdown
- export the gradebook
- verify the exported gradebook has all
the assignments
- select the first grading period
- export the gradebook
- ensure only assignments in that
grading period have been exported
- ensure assignments without due dates
have not been exported
- select the last grading period
- export the gradebook
- ensure only assignments in that
grading period have been exported
- ensure assignments without due dates
have been exported
- create an assignment that is due after
all the grading periods
- ensure the assignment is not included when
exporting all grading periods
- ensure the assignment is not included when
exporting an individual graidng period
- export all grading periods and ensure the
assignment group current and final columns
as well as the total column is not included
in the csv
- enable 'Display Totals for "All Grading Periods'
and export all grading periods again. ensure
assignment group current and final, as well as
the total column are exported
Change-Id: If9f6a41704f6cdb1cd09d08b5f467cd0ea395ed3
Reviewed-on: https://gerrit.instructure.com/65362
Tested-by: Jenkins
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Jason Carter <jcarter@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>