Commit Graph

21 Commits

Author SHA1 Message Date
Cody Cutrer e73cf9ddf4 RuboCop: Style/HashSyntax
[skip-stages=Flakey]

auto-corrected

Change-Id: I9371a61046aee6b148f89dd434114a8ba2b1188c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279533
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
2021-11-25 14:02:35 +00:00
Cody Cutrer c302dd8bc1 RuboCop: Style/SymbolArray, Style/WordArray
[skip-stages=Flakey]

auto-corrected

Change-Id: Id187ed60c5590025e780d81b85b5212f51368f27
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279196
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
2021-11-23 14:30:08 +00:00
Cody Cutrer ff99d18138 RuboCop: Style/RedundantSelf
[skip-stages=Flakey]

auto-corrected

Change-Id: I5f26ad1f8210a74c2198b514235d5134dcd0dae1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279070
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-11-20 16:41:21 +00:00
Cody Cutrer bb548e0b2c RuboCop: Style/NilComparison, Style/NonNilCheck
auto-corrected

Change-Id: If8c067e5b9bd4d21131c6699900a7a14a988efeb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279000
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-19 22:38:10 +00:00
Cody Cutrer 5851dc6497 RuboCop: Style/EachWithObject
auto-corrected

Change-Id: I3f1a71b7b521b9cd7ddc37f4460d83855c93001f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278777
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-18 21:37:54 +00:00
Cody Cutrer 294d98c6fd RuboCop: Style/MutableConstant
auto-corrected

Change-Id: Ib1b3c85711578a33014ea90f0662bd46f7b2288b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278214
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-16 16:19:54 +00:00
Cody Cutrer b70d3ab89d RuboCop: Style/SingleLineMethods, Style/Semicolon
[skip-stages=Flakey]

auto-corrected

Change-Id: Ib94ed586a0d5bf4985a5367144d398eeee706303
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278138
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-12 18:39:32 +00:00
Cody Cutrer bb9fe29416 RuboCop: Lint/IneffectiveAccessModifier
all manual

note that for any methods moved/re-indented, I made no other changes
(except possibly a remove of a `self.` on a method call to call another
now-private method) for ease of review

Change-Id: I0cca6644264a0b46a45a1a5c99021c9deb64fca0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277532
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-08 15:50:15 +00:00
Cody Cutrer c65d57737a RuboCop: Layout lib
Change-Id: I0655d9a9d750f2debd6378b03d8ddc1403ebc31b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274158
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-22 20:01:52 +00:00
Cody Cutrer 06763dd519 add # frozen_string_literal: true for lib
Change-Id: I59b751cac52367a89e03f572477f0cf1d607b405
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251155
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-10-27 20:49:50 +00:00
James Williams e4671dc1c3 skip unnecessary computation for upcoming assignments
also improve the unsubmitted call when actually called

when course home is set to assignments it was doing
everything in SortsAssignments including checking
:grade rights on every single assignment

Change-Id: Iec8aed1f671859a33cde4d7d8c868588e6a780a7
Reviewed-on: https://gerrit.instructure.com/161995
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2018-08-24 19:07:11 +00:00
Landon Wilkins e26843ff95 da licença part 34
add consistent license headers to all source files
(ruby, coffeescript, javascript)

except for vendor files

Change-Id: Ic6b3be7861a2c91d76889c1740f964e401638e04
Reviewed-on: https://gerrit.instructure.com/110061
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 22:00:30 +00:00
Matthew Berns 14fdcd0878 adds unsubmitted and ungraded filters to assignments api
closes OUT-346

test plan:
- create some assignments
- as a student, submit to some of the assignments
- as a teacher, grade some of the submissions

go to api endpoint:
users/(student_id)/courses/(course_id)/assignments
?include%5B%5D=submission&bucket=unsubmitted

- the endpoint should list the assignments the student
  has not yet submitted to

go to api endpoint:
users/(student_id)/courses/(course_id)/assignments
?include%5B%5D=submission&bucket=ungraded

- the endpoint should list the assignments the teacher
  has not yet graded
- assignments the student does not have access to,
  such as those restricted by section, should not appear
  regardles of status

Change-Id: Ia0d27b01a5124e68a98dc5af8776ead6714e4772
Reviewed-on: https://gerrit.instructure.com/86359
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Tyler Pickett <tpickett@instructure.com>
Tested-by: Jenkins
QA-Review: Alex Ortiz-Rosado <aortiz@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2016-08-04 16:55:51 +00:00
Michael Nomitch 8a59a3769d change symbol array syntax for ruby 1.9
Change-Id: I5ca2eb4e8d12aa91413cd4214f3fb91e60c72265
Reviewed-on: https://gerrit.instructure.com/49765
Reviewed-by: Benjamin Porter <bporter@instructure.com>
Tested-by: Jenkins
Product-Review: Mike Nomitch <mnomitch@instructure.com>
QA-Review: Mike Nomitch <mnomitch@instructure.com>
2015-03-03 20:47:03 +00:00
Michael Nomitch dd4c2006b8 bucketing assignment index api
fixes CNVS-17809

test plan:
  - make a request to the assignments index api
    with the param bucket=
    - "ungraded"
    - "upcoming"
    - "future"
    - "past"
    - "overdue"
  - as a student, the assignments in each bucket
    accurately reflect assignment overrides for
    this student
  - as a teacher, default assignment due dates
    are applied
  - as an observer watching a single student, buckets
    reflect that student's submissions
  - as a full course observer, due dates reflect which
    section they are in

Change-Id: I69ed0fe063173324a2e848f4b3b49ea42d843744
Reviewed-on: https://gerrit.instructure.com/47437
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Adam Stone <astone@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
2015-03-02 20:04:53 +00:00
Ethan Vizitei 173ab80f3a needs_grading by section for mobile
fixes CNVS-14375

Previously grading counts were only available
aggregated as a count for the assignment. This
lets you consume them split out by section
rather than.

needs_grading_count_by_section is the flag
to send.  This also splits out the needs_grading
query off into it's own object to reduce the
cognitive load of working in the assignment model.

TEST PLAN:
 - setup a course with multiple sections and
    assignments that need grading for students in
    each
 - hit the assignments API index with the
    "needs_grading_count_by_section" parameter set
    to true
 - the JSON response should include a
     "needs_grading_count_by_section" key for
     each assignment and it should have a hash
     of section ids and counts

Change-Id: I290a080b5f657996423798cacfb37660f5ed427c
Reviewed-on: https://gerrit.instructure.com/39627
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
2014-09-08 13:21:31 +00:00
Joel Hough 5dfe5bc96f make "Upcoming Assignments" lists vdd aware
fixes CNVS-1220

test plan
when checking for an assignment listed as upcoming, check:
- the "Coming Up" sidebar on the right of the user's or course's
  "Recent Activity" page
- the "Upcoming Assignments" sidebar on the right of the user's
  or course's Assignments page
- the "Upcoming Assignments" section on the main listing on the
  user's or course's Assignments page

ensure assignments can be overridden to be upcoming
- create an assignment that is due more than one week from now
- as a student, ensure the assignment is not listed as upcoming
- create an override that applies to the student that makes the
  assignment's due date less than one week from now
- As a student, ensure that the assignment is listed as upcoming

ensure assignments can be overridden to not be upcoming
- create an assignment that is due less than one week from now
- as a student, ensure the assignment is listed as upcoming
- create an override that applies to the student that makes the
  assignment's due date more than one week from now
- As a student, ensure that the assignment is not listed as upcoming

Change-Id: Ia517d87f0a8ed48f6ce3ca466258e7ad8ebe650c
Reviewed-on: https://gerrit.instructure.com/17168
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-02-06 13:21:58 -07:00
Dave Donahue 6ab15d087b bug: if override due date is before default due date on an assignment, it is not applied
fixes #CNVS-2309

Problem:
Overriding a due date to be earlier than the default was having no
effect because the default date was getting lumped in with the overrides
and treated the same way when deciding which to use.

Solution:
If there are applicable overrides, don't take the default into account.

Notes:
The issue was happening as a result of the way the VariedDueDate class
indiscriminately lumped due dates together and returned the last one.
Part of the solution was removing the VariedDueDate class and instead
relying on the override methods on an Assignment. This was done not
only to fix the bug at hand but also to move toward a more consistent
interface for handling varied due dates.

Change-Id: If9d24725a19b134d5d92d3a5c08d6794f466fa9c
Reviewed-on: https://gerrit.instructure.com/16406
QA-Review: Myller de Araujo <myller@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2013-01-09 09:37:00 -07:00
Stanley Stuart aa64f1c91b add presenters folder
Added a presenters folder so that complex view logic that doesn't fit
within the scope of a helper can have its own place in the project tree.

Change-Id: Ibd4caa969b94b33b10f0a5afd1f2dd7163bc8bf7
Reviewed-on: https://gerrit.instructure.com/15347
Reviewed-by: Stanley Stuart <stanley+gerrit@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-11-29 16:08:47 -07:00
Stanley Stuart 53431cda5a fix submitted assignments randomly showing as overdue
fixes #11953

This fixes a typo in sorts_assignments which got the wrong key out of
the passed hash in SortsAssignments.by_varied_due_date.

The spec has been updated as well to take a list of submissions. It
now also checks that #by_varied_due_date will raise an error if any
fields it requires are missing.

test plan:
  create an assignment with an overdue due date ( due_at < Time.now )
  create an assignment with a non-overdue due date ( due_at > Time.now )
  as a student in the course, visit the Course Asssignment page
  make sure that the overdue assignment appears under "Overdue
  Assignments"
  make sure that the non-overdue assignment is not in the "Overdue
  Assignments" section on the page.

Change-Id: I74bc99521e4675b5f4f92bfdfa7c175daa99b3aa
Reviewed-on: https://gerrit.instructure.com/15586
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-11-26 16:27:21 -07:00
Stanley Stuart 1a2779eb12 add varied due date functionality to the main assignments page
test plan:
  REFERENCE:
    * "Main Assignments Page": "localhost:3000/assignments", or click on
    "Assignments" in the menu bar near the top of the page.
    * "Right Side Bar": Go to the Main Assignments Page, it's on your
    right.
    * "Course Assignments Page": Hover over "Courses" in the menu bar
    * near the top of the page, click on the course you set up. Once
    that page loads, click on "Assignments" tab on the left hand side.
  STEPS:
    * https://gist.github.com/f12b3694016f3dcc979e

Change-Id: I9a5884ec1057f196ba5b731a2978c874141bec5b
Reviewed-on: https://gerrit.instructure.com/15006
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-11-09 23:21:44 -07:00