Commit Graph

68 Commits

Author SHA1 Message Date
Adrian Packel b71575d6bd [ci no-cached-dist] Handle custom columns properly when importing
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
2018-10-11 21:23:35 +00:00
Ryan Kuang d9d2d54e4b Add custom columns to gradebook imports
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>
2018-08-24 21:15:03 +00:00
Gary Mei e1a58a0239 fix gradebook import of moderated assignments
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>
2018-07-17 15:54:06 +00:00
Gary Mei 5a3437c251 fix semicolons as delimiters in gradebook importer
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>
2018-07-10 21:13:27 +00:00
Ryan Kuang 6e2d127d8d Add custom columns to gradebook imports/exports
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>
2018-07-10 17:36:50 +00:00
Neil Gupta 6a659fbaa8 stop using anonymous moderated marking feature flag
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>
2018-06-12 20:58:47 +00:00
Adrian Packel 7d2a89fbbb add unposted scores to gradebook import/export
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>
2018-01-29 18:20:24 +00:00
Rob Orton b5de0458d9 dots and new lines
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>
2018-01-17 16:56:26 +00:00
Matt Taylor 9bd0936399 gradebook export and import localized CSV
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>
2017-12-06 21:03:48 +00:00
Simon Williams ad1dfbfb3a better failure handling for invalid gradebook import csv headers
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>
2017-09-27 23:05:36 +00:00
Neil Gupta 695e57836c apply deductions when a missing policy changes
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>
2017-07-10 22:44:39 +00:00
Landon Wilkins e08cd0c241 da licença part 30
add consistent license headers to all source files
(ruby, coffeescript, javascript)

except for vendor files

Change-Id: I13ce64f5dea44b41fe32c7c4b2ee1e31c0878c85
Reviewed-on: https://gerrit.instructure.com/110055
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-04-27 21:59:55 +00:00
Neil Gupta 3c95f9fd9e Don't blow up if checking effective due dates for a non-assigned user
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>
2017-03-15 19:35:52 +00:00
Keith Garner 9f06f54427 switch to using effective_due_dates in gradebook_importer
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>
2017-03-06 19:53:36 +00:00
Neil Gupta 4f79f99d80 Merge branch 'master' into dev/weighted-grading
Change-Id: Ic32918de212a8ee3a5082545ca84b23f2e012c17
2017-03-02 11:58:33 -06:00
Keith Garner 95d260aa0b fix n+1 in gradebook_importer
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>
2017-03-01 23:31:14 +00:00
Neil Gupta 7298b8749f Get rid of multiple_grading_periods feature flag
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>
2017-01-25 20:35:18 +00:00
Keith Garner 56ce3b0e2c fix N+1 in gradebook importer.
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>
2016-12-09 00:04:21 +00:00
Shahbaz Javeed 95283746ea prevent grading if submission is due in closed grading period
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>
2016-12-08 21:01:07 +00:00
Simon Williams 1ad2499ee9 remove confusing method User#admin_of_root_account?
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>
2016-10-26 20:52:02 +00:00
Derek Bender 3870709ea5 speedup GradebookImporter by removing N+1s
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>
2016-10-05 16:22:18 +00:00
Spencer Olson 3c934f9fa6 gradebook upload respects close date
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>
2016-09-20 16:10:04 +00:00
Keith Garner 74e1b6ce67 honor gradebook inactive/concluded settings in export
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
2016-08-04 18:13:09 +00:00
James Williams 12bd2627ab remove float rounding monkey-patch
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>
2016-04-22 18:17:18 +00:00
James Williams 0777cba946 remove differentiated assignments feature checks
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>
2016-03-07 18:44:46 +00:00
Ethan Vizitei 31460a3f29 remove string contents pathway for gradebook upload
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>
2016-02-05 23:11:24 +00:00
Ethan Vizitei db3ba60b11 gradebook importer files through S3
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>
2016-02-05 16:06:02 +00:00
Strand McCutchen 94ed3ea48b when future GPs exist GB Importer can create assignments
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
2016-01-19 18:12:45 +00:00
Spencer Olson a3b624100b always include sis login id in gradebook export
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>
2015-12-02 17:03:52 +00:00
Cameron Matheson 41e5cae7d8 gradebook csv: show correct totals for mgp
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>
2015-11-16 21:48:56 +00:00
Dylan Ross 19c91f01b6 export selected grading period instead of current
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>
2015-11-06 20:17:08 +00:00
Keith Garner 5e89f78e34 during gradebook import pass_fail partial scores passes, 0 fails
During Gradebook imports with pass_fail scores, points possible as
well as partial points in the CSV are considered passing.  0 will be
considered as failing. (The words "complete" and "incomplete" can
still be passed.)  Furthermore, the confirmation screen now reports
"complete" or "incomplete" instead of the points being imported For
the canvas user, this will result in a clearer understanding of the
grade changes happening as a result of the import.

fixes CNVS-21255
fixes gh-624

test plan:
  - Create a course with a student and 5 pass_fail assignments with 4
    points possible
  - In the gradebook:
    - Leave three assignment as null
    - Set one assignment to complete
    - Set one assignment to incomplete
  - Export the current gradebook to CSV
  - Edit the CSV to:
    - Set the first null assignment to 4 points
    - Set the second null assignment to 1 point
    - Set the third null assignment to 0 points
    - Set the complete assignment to 0 points
    - Set the incomplete assignment to 1 point
  - Import the CSV back into the gradebook
  - Observe:
    - On the confirmation screen the words "complete" and "incomplete"
      are used
    - The first null assignment shows as complete
    - The second null assignment shows as complete
    - The third null assignment shows as incomplete
    - The complete assignment now shows as incomplete
    - The incomplete assignment now shows as complete

Change-Id: I92921a3d88ad64f069573a2b27c41936151cec3c
Reviewed-on: https://gerrit.instructure.com/62206
Reviewed-by: Cody Poll <cpoll@instructure.com>
QA-Review: Jason Carter <jcarter@instructure.com>
Tested-by: Jenkins
Product-Review: Keith T. Garner <kgarner@instructure.com>
2015-09-14 16:41:31 +00:00
Strand McCutchen 32229423db add filter for current assignments to GradebookExporter
fixes CNVS-22054

Test plan:

1. Create a course with assignments in past grading periods,
   future grading periods, current grading periods, and
   assignments without due dates.
2. Export the gradebook from that course.
3. Confirm that assignments in the current grading period
   are exported.
4. Confirm that assignments without due dates are exported.
5. Confirm that assignments in past grading periods
   are NOT exported.
6. Confirm that assignments in future grading periods
   are NOT exported.

Change-Id: Ie2dde8673196d53fc7d7fd41ae3d833b4ab50cd9
Reviewed-on: https://gerrit.instructure.com/59804
Tested-by: Jenkins
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
QA-Review: Jason Carter <jcarter@instructure.com>
Product-Review: Strand McCutchen <smccutchen@instructure.com>
2015-08-26 16:41:17 +00:00
Keith Garner 3260f7f1ae gradebook importer considers variations of 'EX' as equivalent
gradebook importer now handles all case variations of 'EX' as excused.  Because
of this, case variations are not considered changes to grades on import.

fixes CNVS-21909

test plan:
- Go to Gradebook.
- Excuse a few assignments
- Export Grades.
- Change an 'EX' grade to a different case, i.e. 'ex', 'eX', 'Ex', then import
  the same CSV file.
- Note that 'no changes made' page is displayed

Change-Id: I97bf28d2c9a333cd38f9890b10df1d41a6db322e
Reviewed-on: https://gerrit.instructure.com/59920
Tested-by: Jenkins
Reviewed-by: Cameron Matheson <cameron@instructure.com>
QA-Review: Jason Carter <jcarter@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2015-08-07 16:37:13 +00:00
Strand McCutchen 5a2269ff8a GradebookImporter only allows editing current assignments
fixes CNVS-19924

When a teacher uploads a CSV with assignments in past
grading periods then they are not able to change grades.

Test plan

1. As an admin, create an account level grading period in
   the past.
2. Create assignments due during the past grading period.
3. Login as a teacher.
4. Navigate to the gradebook
5. Click export to download a CSV
6. Change the grade for the assignment in the past grading
   period.
7. Click the export button and use the wizard to upload
   your modified CSV.
8. You should receive a message telling you you are not
   allowed to edit the assignment in the past.

Change-Id: Ia8701c3504b03bd6ed35d0da1fe56cd8330ace79
Reviewed-on: https://gerrit.instructure.com/55297
Reviewed-by: Dylan Ross <dross@instructure.com>
Tested-by: Jenkins
QA-Review: Jason Carter <jcarter@instructure.com>
Product-Review: Strand McCutchen <smccutchen@instructure.com>
2015-08-05 23:30:54 +00:00
Cameron Matheson d5284d03b1 gradebook csv: support excused assignments
closes CNVS-21267

Test plan:
  * excuse some assignments in a course
  * download the gradebook
  * excuse/unexcuse students in the gradebook
  * upload the gradebook

Change-Id: I624f48415f0be524da70d0ea41ccd6216e06ed68
Reviewed-on: https://gerrit.instructure.com/57158
QA-Review: Adam Stone <astone@instructure.com>
Tested-by: Jenkins
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2015-07-15 03:41:23 +00:00
Spencer Olson 0d0ca444f1 show green banner on successful gradebook upload
when a gradebook is successfully uploaded, a
green success banner will show.

closes CNVS-20359

test plan:
import a Gradebook CSV (with changes made to scores).
verify that after the gradebook is done uploading,
you are redirected to the Gradebook and there is a
green banner at the top of the page that says
'Upload successful'. refresh the page and verify that
a green banner does _not_ appear with the success
message.

Change-Id: I29346498a3c1ae7158e7ac2f11de3f7ca5b8d806
Reviewed-on: https://gerrit.instructure.com/57062
Tested-by: Jenkins
Reviewed-by: Cody Poll <cpoll@instructure.com>
QA-Review: Derek Hansen <dhansen@instructure.com>
Product-Review: Spencer Olson <solson@instructure.com>
2015-06-25 16:18:27 +00:00
Cody Poll 43dfc9c10a GradebookImporter ignores readonly stuff
fixes CNVS-18853

When a gradebook with a custom grading scheme was exported, some extra readonly
columns are inserted. When imported, the importer did not check for
readonly-ness, and so these columns that shouldn't have been looked at were
construed as extra assignments.

After this commit, those extra columns should no longer be considered
assignments, but should be left alone.

Test plan:
  1. In a course without a custom grading scheme, export grades.
  2. Without changing anything, import the exported CSV.
  3. Verify that nothing has changed.
  4. Enable a custom grading scheme.
  5. Export the gradebook again.
  6. Import the new gradebook CSV.
  7. Verify again that nothing has changed.

Change-Id: I4b43cfd8ef390a4dc6e5393f243f1b98e922cd4a
Reviewed-on: https://gerrit.instructure.com/54882
Tested-by: Jenkins
Reviewed-by: Cameron Matheson <cameron@instructure.com>
QA-Review: Adrian Foong <afoong@instructure.com>
Product-Review: Cody Poll <cpoll@instructure.com>
2015-06-18 21:52:03 +00:00
Strand McCutchen d6597c107c fix Style/EmptyLineBetweenDefs issue
Change-Id: Ib7b824043a7ac9196f06020e2ca42fe983565f0d
fixes: CNVS-20009
Reviewed-on: https://gerrit.instructure.com/52919
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Strand McCutchen <smccutchen@instructure.com>
QA-Review: Strand McCutchen <smccutchen@instructure.com>
2015-04-29 16:28:39 +00:00
Strand McCutchen 04cb5187e0 fix Performance/ReverseEach issue
Change-Id: I939e883124ebcd67d57febc7dde6336db6277f62
fixes: CNVS-20009
Reviewed-on: https://gerrit.instructure.com/52893
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Strand McCutchen <smccutchen@instructure.com>
QA-Review: Strand McCutchen <smccutchen@instructure.com>
2015-04-27 20:53:43 +00:00
Josh Simpson 6821dfe030 gradebook csv upload: make parsing step async
Test plan:
  * uploading the gradebook should work like it used to (except it will
    even work for ridiculous-large courses)
  * try to break it by running multiple uploads in parallel / etc

Change-Id: I80dfe7babe320a1cee4021c59c5691d1df5382dd
Reviewed-on: https://gerrit.instructure.com/51499
Tested-by: Jenkins
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
QA-Review: Robert Lamb <rlamb@instructure.com>
2015-04-03 06:52:25 +00:00
Cameron Matheson 527cec4c19 csv upload: don't offer unpublished assignments as candidates
we missed this s/active/published during draft state.  unpublished
assignments aren't gradeable.

Test plan:
  * make an unpublished assignment in a course
  * add a new assignment to a gradebook.csv
  * import the csv
  * the new assignment shouldn't let you change it to the unpublished
    assignment

Change-Id: I4056afcf0317b1d9004df5c26357759203471c27
Reviewed-on: https://gerrit.instructure.com/51445
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Tested-by: Jenkins
Product-Review: Matt Fairbourn <mfairbourn@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
2015-04-02 04:09:59 +00:00
Michael Nomitch 15361ae474 DA doesnt break new csv assignments
fixes CNVS-18185

test plan:
  - turn DA on
  - upload a GB csv with a new assignment
    that has student grades
    - the assignment and grades are
      properly uploaded
  - on a DA'd assignment, try to assign a grade
    to a students that can and cannot see it
      - students who cant see dont get a grade
      - students who can see do get a grade

Change-Id: I71fe1630c9d7eca3888550439782da24065f833c
Reviewed-on: https://gerrit.instructure.com/49401
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Adam Stone <astone@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2015-02-26 19:22:29 +00:00
Michael Nomitch a52b85ee8b DA - remove N+1 from assignment groups controller
fixes CNVS-16025

test plan:
  - load gradebook with DA on and off
    - both work properly
  - upload && download gradebook csv
    - both work properly
    - check for extra "N/A"s showing up
      where they aren't supposed to
  - assignment index page works with DA on/off
    (as student and teacher)
  - single student grades page as student and teacher works
    - with DA on and off

Change-Id: I826d42ae78cbe70f15672e065acc546e51f0b7f4
Reviewed-on: https://gerrit.instructure.com/42360
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Sean Lewis <slewis@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-10-10 21:44:06 +00:00
Cody Cutrer 8399be4b1a don't use write_attribute for gradebook importer temp storage
refs CNVS-15830

test plan:
 * download the gradebook, change a grade, and upload it again
 * it should work

Change-Id: I0fe245b23aa24152a2a62ad919cf045120ae1c47
Reviewed-on: https://gerrit.instructure.com/41974
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-10-06 15:44:08 +00:00
Cameron Sutter 0425b8652b DA - gradebook csv
fixes CNVS-14085

test plan:
 * enable DA
 - download gb csv
 > assignments without visibility should have "N/A" in the cell
 - upload gb csv
 > assignments without visibility should be ignored even if the "N/A"
   was replaced with a score in the cell
 > non-DA assignments can be changed like normal

 * without DA
 - download/upload csv
 > it should work like normal

Change-Id: I05984b4feb9046bc8de43bcf67aa46f2f751cafc
Reviewed-on: https://gerrit.instructure.com/40517
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Product-Review: Cameron Sutter <csutter@instructure.com>
2014-09-18 15:49:31 +00:00
Cameron Matheson 661f19cf00 include concluded enrollments in gradebook csv
closes CNVS-1296

Test plan:
  * conclude an enrollment in a course
  * open the gradebook, the user shouldn't be displayed
  * download the csv, the user should not be included
  * include concluded enrollments in gradebook display
  * download the csv again, it should include the user

Change-Id: I5a464b3fa5e963e9989837a216fd2732fc9979b6
Reviewed-on: https://gerrit.instructure.com/38954
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2014-08-13 21:15:00 +00:00
Cody Cutrer c3ca1f93f7 respect root_account column in csv gradebook uploads
fixes CNVS-13672

test plan:
 * create a trust from account A to account B
 * enroll a user from account B in a course from account A
 * create an SIS login for the user from account B
 * create an assignment in that course
 * export the gradebook CSV
 * the CSV should refer to the user by their sis ID
   in account B
 * set a score for the user
 * upload the CSV
 * it should succeed and set the score for the user

Change-Id: Ib5079ffd005685abe7995c38f65e604e425cbb6e
Reviewed-on: https://gerrit.instructure.com/36654
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-06-24 20:28:11 +00:00
Cameron Sutter 78a7d26d91 remove :includes => :quiz_submission
fixes CNVS-9933

test plan:
 - basic regression on the following:
   - teacher activity pages
   - gradebook pages
   - grades page
   - gradebook upload
   - changing due dates on assignments
   - submissions api
   - assignments api
 - sorry

Change-Id: I7bb4c32a74b159565772da8ee1d5a43e27369ca0
Reviewed-on: https://gerrit.instructure.com/30367
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-03-01 01:46:22 +00:00
Cody Cutrer a389fd18c1 rails 3 doesn't auto-require csv, so require it where necessary
Change-Id: Id76980c82024a082855f5b7b5b60cd7e760730a9
Reviewed-on: https://gerrit.instructure.com/30132
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-02-14 16:04:34 +00:00