Commit Graph

44 Commits

Author SHA1 Message Date
Cameron Matheson d990265772 add graded_at column to enrollments table
Test info:
  This commit adds a graded_at column that should be updated whenever
  the grades for an enrollment change

Change-Id: If1fa48cb9f15a8a5b8c651b1124db111d355d6c1
Reviewed-on: https://gerrit.instructure.com/49513
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Tested-by: Jenkins
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2016-01-04 23:08:47 +00:00
Spencer Olson 802299b2cf feature flag for 'All Grading Periods' totals
Add grading period dropdowns on the 'grades' page,
and add a "Display Totals for 'All Grading Periods'"
feature flag. By default, the feature will be turned
'off'.

When the feature is 'off':
 - Totals will not display in the gradebook
   or the 'student grades' page when the 'All
   Grading Periods' option is selected.
 - The grading period dropdowns on the 'grades'
   page will not have an 'All Grading Periods'
   option.

When the feature is 'on':
 - Totals will display in the gradebook and the
   'student grades' page when the 'All Grading
   Periods' option is selected.
 - The grading period dropdowns on the 'grades'
   page will have an 'All Grading Periods' option.

closes CNVS-23995

test plan:

1) as a teacher, enable the 'multiple grading
   periods' feature (do not enable the 'display
   totals for all grading periods' feature yet).
   a) verify the gradebook does not show totals
    when the 'All Grading Periods' option is
    selected.
   b) verify the 'student grades page'
    (courses/4/grades/9#tab-assignments) does
    not show totals, and the calculation of
    'what-if' grades is disabled when the
    'All Grading Periods' option is selected.
   c) turn on the 'display totals for all
      grading periods' feature. repeat steps
      a & b and verify that the totals now
      show up (and you can calculate what-if
      grades on the student grades page when
      'All Grading Periods is selected')

2) sign in as a student that is enrolled in
   3 courses: 1 course with MGP disabled, 1
   course with MGP enabled and 'display all
   grading periods totals' (DAGPT) disabled,
   and 1 course with MGP enabled and DAGPT
   enabled. go the the 'grades' page (/grades).
   a) verify there is a grading period dropdown
      next to the totals for courses that have
      MGP enabled. verify there is not a grading
      period dropdown next to the total for the
      course with MGP disabled.
   b) verify that the current grading period is
      selected by default, if one exists. if a
      current grading period does not exist, then:
      - the dropdown next to the total for the
         course with DAGPT disabled should show
         'Select a grading period' and the total
         grade should show as '--'.
      - the dropdown next to the total for the
        course with DAGPT enabled should show
        'All Grading Periods' and the total grade
        should be displayed.
   c) verify clicking a grading period in the
      dropdown changes the total, and shows
      the correct total for that grading period.

3) repeat steps 2a-c, but sign in as an observer that
   is observing at least 3 students in 3 different
   courses(1 course with MGP disabled, 1 with MGP
   enabled and DAGPT disabled, and 1 course with
   MGP enabled + DAGPT enabled).

4) verify that the grading period dropdowns that were
   added are accessible.

Note: The 'grades' page (/grades) will _always_
display the total for 'All Grading Periods' when
signed in as a teacher. We are aware of this
existing bug and we're working on a solution.

Change-Id: If501b47aa57121d17d4e6629d1dcdbc8676971a2
Reviewed-on: https://gerrit.instructure.com/65847
Tested-by: Jenkins
Reviewed-by: Strand McCutchen <smccutchen@instructure.com>
Reviewed-by: Dylan Ross <dross@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: Jason Carter <jcarter@instructure.com>
Product-Review: Spencer Olson <solson@instructure.com>
2015-10-28 21:03:45 +00:00
James Williams 600165e7b2 rails4: deprecate Relation#all in favor of Relation#to_a
refs #CNVS-21596

Change-Id: I5dedaab90a2abe6bf288ff30401c9b31629b45b2
Reviewed-on: https://gerrit.instructure.com/59220
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-07-24 21:28:14 +00:00
Cameron Matheson da7512cbdc excused assignments backend
closes CNVS-17549
closes CNVS-17553

Test plan:
  * excuse and unexcuse assignments from the api
  * student grades should be correct

Change-Id: Id8e0fa9edb404bdf65bff0bfc4c79c6f33e8a7e4
Reviewed-on: https://gerrit.instructure.com/53409
Tested-by: Jenkins
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Adrian Foong <afoong@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2015-05-18 20:36:51 +00:00
Dylan Ross a878368b92 round total grade in gradebook to 2 decimal places
The total grade column is now rounded to two
decimal places in the gradebook and the
exported csv of the gradebook

fixes CNVS-14989

- the gradebook and exported csv column should
  round the total grade to two decimal places

- if a student has a total grade of 99.567,
  before it would be displayed as '99.6%'.
  Now it will be displayed as '99.57%'

Change-Id: Ifcb45226c7c6c9ae6874b8895707c060998c7b3c
Reviewed-on: https://gerrit.instructure.com/49623
QA-Review: Robert Lamb <rlamb@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Product-Review: Dylan Ross <dross@instructure.com>
Tested-by: Shawn Meredith <shawn@instructure.com>
Tested-by: Josh Simpson <jsimpson@instructure.com>
2015-05-11 19:54:06 +00:00
Cameron Matheson b51cc5d09f add logging around grade recomputation
Change-Id: I8fda274034d0815a4ed0f90a79946beed13b1f9f
Reviewed-on: https://gerrit.instructure.com/48780
Tested-by: Jenkins
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2015-02-19 22:12:49 +00:00
Cameron Matheson 5cda45c40f add grade period support to grade calculator
closes CNVS-17105

Test plan:
  (This has to be done at the rails console)

  * enable multiple grading periods
  * set up assignments in all the grading periods
  * grade the assignments for a student
  * run the grade calculator for a grade period.  make sure the grade
    only considers assignments in the grading period:

    gc = GradeCalculator.new([student_id], course, grading_period)
    pp gc.compute_scores.first.first

Change-Id: I3b87eb7ec08fedebaab4f7a2fc83e68d4d4d5c7e
Reviewed-on: https://gerrit.instructure.com/45753
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2014-12-29 20:01:45 +00:00
Cameron Matheson e3a8ea8445 remove Assignment.assignment_scope_for_draft_state
closes CNVS-17254

Test plan:
  * the gradebook should not show unpublished assignments
  * grades from the enrollment csv should be correct (they should not
    consider unpublished assignments)

Change-Id: I5a5405ff33146beeeba5453eff388d2bf806b427
Reviewed-on: https://gerrit.instructure.com/45250
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Sean Lewis <slewis@instructure.com>
Product-Review: Matt Fairbourn <mfairbourn@instructure.com>
2014-12-05 17:44:51 +00:00
Michael Nomitch 386a8d15e8 DA - split large hashes
fixes CNVS-16452

test plan:
  - regression test of the following
    - GB csv download/upload
    - assignments index
    - assignments api index
    - submissions api call to for_students
      - as teacher/observer/student
    - score calculation in GB
    - score calculation on individual grades page

Change-Id: Ifaa0c7580535c2c5d4e218508ef00c1b6007770b
Reviewed-on: https://gerrit.instructure.com/43361
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
QA-Review: Sean Lewis <slewis@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-11-03 19:35:09 +00:00
Michael Nomitch 65a28679c5 DA - grading rework for performance
fixes CNVS-14865

test plan:
  - with a large class
  - with DA on and off
    - check that the gradebook csv download works
      (grades can be wrong when DA is on)
    - check that gradebook2 & srgb work
    - check that student grade summary pages work

Change-Id: I7a7b4ffe302d912aa2877106295a78ab662868f1
Reviewed-on: https://gerrit.instructure.com/39470
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-08-26 22:46:14 +00:00
Simon Williams e241218d48 revert DA grading to fix grade calc performance regression
this reverts part of b4840c75cc

fixes CNVS-14840

test plan:
- with differentiated assignments off, grading should work correctly
- in a course with many assignments, you should be able to download the
  gradebook csv
- with differentiated assignments on, grading will not work correctly, this is
  intentional.

Change-Id: Id910ff28763ba13c529a21d4c125a164e094aeac
Reviewed-on: https://gerrit.instructure.com/39436
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-08-17 21:25:20 +00:00
Michael Nomitch b4840c75cc DA - grade calculation works on backend
fixes CNVS-13715

test plan:
  - create a student who is in one group and not another
  - create an assignment only visible to each group
  - grade the student for both assignments
  - turn DA on
    - as the student and teacher, go to the student grades page
      - both of the assignments should be visible
      - final grade should be correct (factoring in both)
        * final grade = ungraded assignments count too
    - delete one of the grades and return
      - only one of the assignments should be visible
      - final grade should be correct (using just one assignment)
  - turn DA off
    - as the student and teacher, go to the student grades page
      - both assignments are visible
      - final grade should factor in both assignments
  - with DA on and off, ensure that the following work:
    - drop rules
    - never drop rules
    - assignment stats (mean median etc)
    - what if scores

Change-Id: I727aff943b14c91089ccffa6d3b63ba026abbeec
Reviewed-on: https://gerrit.instructure.com/36762
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Mike Nomitch <mnomitch@instructure.com>
2014-07-17 21:27:59 +00:00
Michael Nomitch 9c8c42b952 DA - assignment indices
fixes CNVS-13708

test plan:
  - create a student who is in one section and not another
  - create an assignment only visible to each section
    (1 section => 1 assignment)
  - grade the student for both assignments
  - turn DA on
    - as the student, go to the assignment index page
      - both assignments should be visible initially
      - delete the grades for both assignments and return
        - only the overridden assignment should be visible
      - only one of the assignments should be visible
    - as the student, go to the grades page
      - only the overridden assignment should be visible
      - regrade the assignment whose grade you had deleted
        - both assignments should be visible now
      - (fyi: final grade wont be correct)
  - turn DA off
    - as the student, go to the assignment index page
      - both assignments are visible
    - as the student, go to the grades page
      - both assignments are visible
      - final grade should factor in both assignments

Change-Id: I32e3fea4d6fd3db9a512e0d170779b48418f90cf
Reviewed-on: https://gerrit.instructure.com/36728
Reviewed-by: Liz Abinante <labinante@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Mike Nomitch <mnomitch@instructure.com>
2014-07-17 18:23:25 +00:00
Rob Orton 9418d9d0fb split grade calculations into groups of 1000
also only send user_ids one time per course
and don't run if there are no user_ids

test plan
 - specs should pass

Change-Id: I168758ff00413380b1bf1b2729488a7f95a4a9b1
Reviewed-on: https://gerrit.instructure.com/31985
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2014-03-21 20:12:15 +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
Cameron Matheson 1662f446f6 fix wrong grade calculator comment
Change-Id: I45709bd6dc2fd91bc8d178a38eaab6e088100445
Reviewed-on: https://gerrit.instructure.com/29011
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2014-01-22 00:24:57 +00:00
Cameron Matheson b862ea30b6 add assignment group information to gradebook.csv
closes CNVS-9968

Test plan:
  Download gradebook.csv, it should include grades for each assignment
  group.  Points will be included for courses with  unweighted
  assignment groups (just like for current/final grades)

Change-Id: Ic47a4cd6cfb62726d3ec6e015b1d3ecfd71f79cc
Reviewed-on: https://gerrit.instructure.com/28579
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2014-01-21 21:14:37 +00:00
Simon Williams c99bb855f0 ignore scores for unpublished assignments
fixes CNVS-10244

test plan:
- create a new course with a teacher and student
- create two assignments, and publish them
- grade them both
- unpublish one of them
- look at all the places you can see grades, and make sure they all
  consistently show only the grades for the published assignment (the
  unpublished assignment should be completely ignored)
  * GB2 with and without 'treat ungraded as 0'
  * GB1 with and without 'incluce ungraded'
  * GB csv download
  * student grades summary page with and without what-if scores
  * /grades page as a student and as a teacher

Change-Id: I32aca28fe377e59cb2e0c6278b59eb74c87c73b4
Reviewed-on: https://gerrit.instructure.com/28047
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-01-08 18:05:04 +00:00
Cody Cutrer b6d5d77fe5 avoid select submissions.* when we're explicitly asking for certain columns
test plan:
 * sanity check on final grades when grades are changed

Change-Id: I1c40eaec666426a4a200ebb9de7aa1f3c96e9ba2
Reviewed-on: https://gerrit.instructure.com/27280
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-12-13 18:53:56 +00:00
Cody Cutrer 36d8bdb9d6 only select necessary columns for gradecalculator
instead of fulling in some possibly large columns that we ignore

also, we don't care about the order, so don't make the db sort
them

test plan:
 * change some scores
 * final scores as shown on csv exports or other places should
   reflect said changes

Change-Id: Ic5c8876aab3d3eed261d9b4714642302f25e0f3e
Reviewed-on: https://gerrit.instructure.com/21153
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-06-06 20:46:35 +00:00
Cameron Matheson 63bde155b4 include points accumulated in gradebook csv
closes CNVS-2049

Test plan:
  * download the gradebook csv in a course with unweighted assignment
    groups. you should see "Current Points" and "Final Points" columns
  * download the gradebook csv in a course with weighted assignment
  * groups. there should not be any points columns

Change-Id: If795ab3dc0ae8a4fb84f29c9e759b463b7a14d04
Reviewed-on: https://gerrit.instructure.com/20189
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2013-05-03 22:28:13 +00:00
Simon Williams b35b70580d fix performance regression in gradebook csv
fixes CNVS-5492

test plan (external):
- download the gradebook csv with and without sis ids
- it should still work

test plan (internal):
- run gradebook csv with sis ids from the console and watch the db queries
- it should not load quiz submissions
- it should not load the account once per student

Change-Id: I2665041d8733856d8b32547b49d5af5b69292076
Reviewed-on: https://gerrit.instructure.com/20007
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-04-25 15:33:49 +00:00
Cody Cutrer 5ffbcbeb05 arel-ify lib
excluding api_find, which needs more work

refs CNVS-4706

Change-Id: I013d0660ff2b8dbe2abf6a5c973bd1203f432f99
Reviewed-on: https://gerrit.instructure.com/18921
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-04-01 19:12:22 +00:00
Simon Williams 8555a0a7c4 tweak comment wording
Change-Id: I1bd37d2e60590e35477657e0b809c97b73e36093
Reviewed-on: https://gerrit.instructure.com/18627
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
QA-Review: Cameron Matheson <cameron@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2013-03-27 14:48:51 +00:00
Cameron Matheson 92d49c5cbe fix endless loop in grade calculators
Test plan:
  * make an assignment in an assignment_group with grade_dropping rules
    that has some stupid number of points possible (like
    100000000000000000000000000000000000000000000000000)
  * make sure the gradebook and api can both return grades for that
    course

Change-Id: I89ea9ce504392a0f2f95b412089e636629dff501
Reviewed-on: https://gerrit.instructure.com/17810
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2013-02-18 15:23:07 -07:00
Cameron Matheson 0b9e0d2f5e gradebook_to_csv: order assignments like gb2
refs CNVS-3606

this commit also removes the unused assignment_id option

Test plan:
  download some gradebook csv, make sure the column order is the same as
  gb2

Change-Id: I8dde6122805498a4513126bf288f93713b745c58
Reviewed-on: https://gerrit.instructure.com/17620
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
2013-02-15 10:34:25 -07:00
Cameron Matheson 906a59c8f5 make gradebook.csv less slow
fixes CNVS-3606

Test plan:
  * download some gradebook csv in a large class
  * experience euphoria and surprise as your gradebook csv is quickly
    delivered

Change-Id: I44e5fe14d73993d669eb6600072d6e2d125ad3cc
Reviewed-on: https://gerrit.instructure.com/17593
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
2013-02-11 16:44:16 -07:00
Cameron Matheson 394f39ed50 drop submissions in consistent order
closes CNVS-3096

This doesn't affect grades, but it does prevent confusion if a different
assignment is dropped on the student grades page vs gradebook.

Test plan:
* set up an assignment group with grade drop rules that multiple
  submissions satisfy (for example, all assignments are 10/10)
* make sure the same submission is dropped in the gradebooks and student
  grades page

Change-Id: I1567460c3d107934fb32670eddda95bc18786d9a
Reviewed-on: https://gerrit.instructure.com/16789
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2013-01-18 12:09:29 -07:00
Cameron Matheson 0de839e3fc ignore invalid assignment groups
refs #CNVS-1924

* If a course uses weighted assignment groups, assignment groups with 0
  points possible are always ignored.
* If the sum of assignment group weights in a course is less than 100%,
  scale the grade up to 100%

Test plan:
  Set up assignment groups to that match the above scenarios and make
  sure the totals are good.

Change-Id: I81ed523df79a863ba234c66cde367d2fb7def323
Reviewed-on: https://gerrit.instructure.com/16735
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
2013-01-17 15:58:35 -07:00
Cameron Matheson ecc80bf1d3 assignment dropping: really support never_drop
fixes #CNVS-2649

Test plan:
  * set up some non-trivial assortment of assignments in a
    assignment group with drop rules and never_drop rules
  * make sure the never_drop assignments are never dropped, and that the
    kept assignments result in the highest possible grade

Change-Id: Ia1963812d74cd547e9859dda78e1d8dacb4e9223
Reviewed-on: https://gerrit.instructure.com/16618
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2013-01-14 10:39:28 -07:00
Cameron Matheson 4581302751 properly handle assignments with no points possible
fixes #CNVS-2475

* these assignments were previously being ignored in ruby-land
* caused an infinite loop in the js grade-dropper

Test plan:
  * make an assignment with 0 points possible in an assignment group
    with grade dropping rules
  * make sure the grades in js and ruby are correct

Change-Id: Id9f478f79ea83c7382b2fa5dbca8c0b45dbb6fc4
Reviewed-on: https://gerrit.instructure.com/16417
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-01-11 22:49:31 -07:00
Cameron Matheson 105a4ae0a9 don't ignore muted assignments in gradebook csv
closes #CNVS-2397

Test plan:
  - set up a course with assignments
  - mute some assignments
  - set grades for students
  - make sure the gradebook csv totals and the gradebooks match
  - the student's grade page (when masquerading) should *not* match
    (it should ignore muted assignments)

Change-Id: Iebe15c5d108dcfa899bd501cc6dd45ceb688fa25
Reviewed-on: https://gerrit.instructure.com/16197
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Tested-by: Simon Williams <simon@instructure.com>
2012-12-26 10:11:50 -07:00
Cameron Matheson 34878c564e fix ruby calculation of grades (grade-dropping)
fixes #CNVS-1546

Test plan:
  * set up some assignments in an assignment group with grade-dropping
    rules configured
  * use the courses api to check the current and final scores in the
    course, and compare those to the values in the gradebook
    - note that computed_final_score is equivalent to the score in
      gradebook when 'Treat ungraded as 0s' is enabled.

Change-Id: Icdd67d18ab0f00d9b333d523752ebe1f489a9917
Reviewed-on: https://gerrit.instructure.com/16141
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
2012-12-21 16:45:07 -07:00
Bryan Madsen c835ccd39a revert several grade calculation changes
Revert "make grade_summary page use GradeCalculator"

This reverts commit 4776cb2880.

Revert "fix gradebook bug in ie8"

This reverts commit c927237458.

Revert "gb2: don't lie about which assignments are dropped"

This reverts commit da37933079.

Revert "fix ruby calculation of grades (grade-dropping)"

This reverts commit 63f75597a2.

Revert "fix grade-dropping in gradebooks"

This reverts commit 4a4a2f53c1.

Conflicts:

	spec/selenium/grading_standards_spec.rb

Change-Id: I597d777fee23c4dc57bb915c6cbe5185dc18d0af
Reviewed-on: https://gerrit.instructure.com/13716
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
2012-09-18 09:20:51 -06:00
Cameron Matheson 63f75597a2 fix ruby calculation of grades (grade-dropping)
fixes #9577

Test plan:
  * set up some assignments in an assignment group with grade-dropping
    rules configured
  * use the courses api to check the current and final scores in the
    course, and compare those to the values in the gradebook
    - note that computed_final_score is equivalent to the score in
      gradebook when 'Treat ungraded as 0s' is enabled.

Change-Id: I2f60f26ae849caf5325466171639274148d6bc56
Reviewed-on: https://gerrit.instructure.com/12416
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2012-08-27 10:21:50 -06:00
Cody Cutrer cb5fd45d58 optimize gradebook downloads
fixes #6576, #6577

 * don't recompute grades every time
 * when recomputing grades, don't do a separate query per user
 * when recomputing grades, only grab submissions pertinent to
   the course
 * don't load a bunch of data that's used for the html when
   generating the csv
 * preload pseudonyms instead of a doing a query per user
 * use the correct sis pseudonym

test plan:
 * merge sis users (with different sis ids) from different accounts
   together
 * add the user to courses in both accounts
 * download the gradebook csv for both courses
 * the sis id should be the correct one for each course

Change-Id: I0b2b5b26f3167da7de176270bf93a89e7f6f6437
Reviewed-on: https://gerrit.instructure.com/8960
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-03-01 14:55:54 -07:00
Bracken Mosbacker 58c5ab27a7 don't include muted assignments in cached grade calculations
Test Plan:
 * Have canvas and delayed jobs running
 * Create a course with some assignments
 * Give scores to some students
 * Before muting an assignment download the CSV and make sure it's same as UI
 * Mute an assignment
 * Download CSV again and the final/current scores should be different than UI
 * In gradebook UI remove grades from muted assignment (so it's as if they weren't graded)
 * The UI grades should now be the same as the CSV grades

closes #6578

Change-Id: I5774ecb899318278a02e1bc12caaa9d02fa3dac0
Reviewed-on: https://gerrit.instructure.com/7379
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-02-16 14:18:06 -07:00
Jacob Fugal 1a761c2d1f explicit utc db times in update_all
update_all's update hash doesn't have any magic performed on bare Time
objects; it assumes any Time object it's given is already in UTC. using
a TimeWithZone object (regardless of timezone), which Fixnum#ago and
friends happen to return, is still fine.

Change-Id: I297b2a3211b896b5225ebcfaaee3c1eb56e55fb6
Reviewed-on: https://gerrit.instructure.com/5351
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2011-08-30 16:46:25 -06:00
Brian Palmer 92feb2bcdb replace ActiveRecord::Base calls with subclass calls where it makes sense
This was already a small issue if the job queue was on a different
database driver than the main database, and it'll become more important
as more AR connections are introduced.

Change-Id: I204becadd32bb935df096e8c937a04bb6962f0b2
Reviewed-on: https://gerrit.instructure.com/4601
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-07-18 13:56:08 -06:00
Bracken Mosbacker 02be112119 don't use 'not graded' assignments when calculating grades
closes #4594

Change-Id: I80ff152810c9318f7e44858dc7f680aea25a1850
Reviewed-on: https://gerrit.instructure.com/3712
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-05-19 08:56:24 -06:00
Bracken Mosbacker af08b162c3 handle submissions with no score correctly in grade calc
An assignment can have a submission but no score, if that
happened the calculator dropped those submissions for
the final_grade instead of using a score of 0

closes #4491

Change-Id: Ic49816c887aec001ecdd9d99412dc588e2c891e6
Reviewed-on: https://gerrit.instructure.com/3552
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
2011-05-09 15:34:53 -06:00
JT Olds 3a171d27d2 renaming final_grade to final_score in relevant places. adding computed_final_grade
Change-Id: I09cfecc6ec075b1b45e872a6a1f2efa7e4bd63b9
Reviewed-on: https://gerrit.instructure.com/3034
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
2011-04-12 12:58:28 -06:00
Brian Palmer 56cdc28afe fix grade calculations if an assignment group has 0 points possible
This was causing all students in the course to have final grades of null
(NaN).

Change-Id: I2bc268926579ce8c129a8c997f683a9e9097bffc
Reviewed-on: https://gerrit.instructure.com/3016
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
2011-04-11 12:43:52 -06:00
Brian Whitmer 8b8173dcc9 Initial commit.
closes #6988138
2011-01-31 18:57:29 -07:00