Commit Graph

18 Commits

Author SHA1 Message Date
Samuel Lee 28929d9a45 fix concluded observers unable to view grades
fix where observers with concluded enrollments are unable to view
grades of linked students who are also concluded

closes EVAL-3319
flag=none

test plan:
- have a course with an enrolled student and an observer linked to that
  student
- conclude the enrollment for both the observer and the student
- go to Prior Enrollments and act as the observer
- go to the grades page and see that it does not give the unauthorized
  error and instead shows the grades page for the student

Change-Id: If6bd9e250f2bb02f4d1449f65803bd6a2e1f40ee
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/325927
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jackson Huang <jackson.huang@instructure.com>
Product-Review: Ravi Koll <ravi.koll@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
2023-09-12 16:37:37 +00:00
Cody Cutrer c2cba46851 RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation
[skip-stages=Flakey]

auto-corrected

Change-Id: I4a0145abfd50f126669b20f3deaeae8377bac24d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279535
Tested-by: Cody Cutrer <cody@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:03:06 +00:00
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 dc12b29899 RuboCop: RSpec/EmptyLineAfterExampleGroup, RSpec/EmptyLineAfterSubject
[skip-stages=Flakey]

auto-corrected

Change-Id: I3723d4c743da33bd2d6255be9d8c176a4fb84d9c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278689
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 14:58:17 +00:00
Cody Cutrer 06a2c9df42 spec: remove manual requires of spec_helper
[skip-stages=Flakey]

Change-Id: Id65c835b72e1c0a4bb825b58490ce0ff7c8d9873
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276829
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-10-26 20:38:27 +00:00
Cody Cutrer b6e406ddcf RuboCop: RSpec/ExampleWording
[skip-stages=Flakey]

Change-Id: I291432cd1f51fdaefb3cf6160d423879fb858c11
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274253
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-24 02:15:35 +00:00
Cody Cutrer 8e0327867e RuboCop: Layout spec/models
[skip-stages=Flakey]

Change-Id: I25b7f97dc3bb7fd9f24e63e372d7127c42cd3147
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274147
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 19:17:48 +00:00
Kai Bjorkman 782ab054bb filters out future sections in observer grades
Observers were able to filter by students who were enrolled in a future
section causing a error to be thrown in some cases. Now students in
future sections with the 'Students can only participate in the course
between these dates' will not be an option in the student drop down or
in the case of that being the only student being observed the observer
would not be given access and shown the 'Not yet available' screen.

fixes EVAL-1404
flag=none

Test Plan:
1. Have a course with 2 students enrolled and another course with 1 of
  those students also enrolled
2. Create 2 sections in the course with both aforementioned students
    - 1 current section with dates including the present day
    - 1 future section with a start date in the future
    - both with the 'Students can only participate in the course
      between these dates' selected
3. Add the student in both courses to the future section and the other
  to the current section
4. Create an observer and link them to both students
5. As the observer navigate to the grades page of the course with both
  students
6. Ensure that only the student in the current section is shown
7. Unselect the 'Students can only participate in the course
    between these dates' in the future section
8. Check to ensure both students are shown on that grade page now

Change-Id: Ia2f7ca68bd93ac5e6780ef8708727ea3372aecc7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256582
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
QA-Review: Spencer Olson <solson@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
2021-02-03 22:28:15 +00:00
Cody Cutrer 81d0bbc465 add # frozen_string_literal: true for specs
Change-Id: Id508bec1817937b1c24c29f1db7221e09cb9c2ab
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251157
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:48:35 +00:00
Landon Wilkins 242581edd3 da licença part 48
add consistent license headers to all source files

Change-Id: Ib581cddb21430cf4971aeb14980727c2935e31e4
Reviewed-on: https://gerrit.instructure.com/110154
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-28 18:59:33 +00:00
Simon Williams 57497719a7 spec: rename the `course` helper to `course_factory`
closes CNVS-34046

test plan: specs should pass

Change-Id: I8684d30e5af7be04566b2d3903db2b7f4b14b24b
Reviewed-on: https://gerrit.instructure.com/98439
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2016-12-27 20:25:29 +00:00
Simon Williams ece65b5a89 spec: rename the `user` helper to `user_factory`
closes CNVS-34042

test plan: specs should pass

Change-Id: I20709a69f0cb28fb55eba18ca81f89f4d7673b56
Reviewed-on: https://gerrit.instructure.com/98426
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2016-12-27 20:25:25 +00:00
James Williams 095ae3a62d don't auto-activate observer enrollments for unregistered users
test plan:
* use the course people page to create a new user as an
 observer in a course
* they should recieve an invitation

closes #CNVS-26611

Change-Id: I3f919a9b9907a57efa03d140f789359d0d63b92c
Reviewed-on: https://gerrit.instructure.com/74401
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Allison Weiss <allison@instructure.com>
2016-03-14 20:58:02 +00:00
Keith Garner 5ebf61684c add observed_users to courses and favorite api calls
Adds the ability for observed_users to be returned to the
courses_controller#index and
favorites_controller#list_favorite_courses when
include[]=observed_users is passed to the calls.

fixes CNVS-24881

test plan:
 - Create a course with two users besides the teacher: one student and
   one observer.
 - Set the observer to be an observer of the student
 - Create an assignment and create a submission for the assignment
   from the student

 - Call the API at /api/v1/courses?include[]=observed_users&include[]=term&include[]=total_scores&include[]=license&include[]=is_public&include[]=needs_grading_count&include[]=permissions&include[]=favorites
 - Observe in the enrollments section of the return there is data
   for the observed student

 - Call the API at /api/v1/users/self/favorites/courses?include[]=observed_users&include[]=term&include[]=total_scores&include[]=license&include[]=is_public&include[]=needs_grading_count&include[]=permissions
 - Observe in the enrollments section of the return there is data
   for the observed student

Change-Id: Ic2472cab56e6de7359e9cb908e20fd733112faf5
Reviewed-on: https://gerrit.instructure.com/66878
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-12-08 15:39:16 +00:00
Joel Hough 0211a5caa5 don't send enrollment notifications to observers
fixes CNVS-24185

test plan
- enroll an observer in a course
- ensure that the observer does not get any notifications about
 the enrollment

Change-Id: I6404e589f89197ffc4e437fb1b90f540ec5cf50b
Reviewed-on: https://gerrit.instructure.com/66084
Tested-by: Jenkins
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
QA-Review: Adrian Russell <arussell@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2015-12-01 15:48:37 +00:00
Cody Cutrer 912a2cb083 rspec 3-ify spec/models
refs CNVS-16239

Change-Id: I0dc5ac9cb86fbb5dd0335d9e21d77d4a48ecb774
Reviewed-on: https://gerrit.instructure.com/42697
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2014-10-14 20:10:03 +00:00
Michael Nomitch dfebb4972a DA - quiz/submission/discussion notifications
fixes CNVS-15156

test plan:
  - with DA on:
    - submission:
      - make a differentiated assignment
      - turn in a submission as a student
      - give the student a grade
        - as the student, ensure you have the notification, and then
          delete it
      - as a teacher, take away visibility and delete their grade
        - as the student, you should not have a new notification for grade
          changing
      - as a teacher, comment on this submission
        - as the student, you get notified about the comment
    - quiz:
      - as a teacher make a differentiated quiz
        - students without visibility dont get notified about it
    - discussion:
      - discussion notifications are broken so we cant QA
  - with DA off:
    - submission:
      - comment on a submission as a teacher and make sure the
        student is notified
      - grade a student as a teacher and make sure the student
        is notified
    - quiz:
      - making & assignment a quiz sends out notifications properly
    - discussion:
      - discussion notifications are broken so we cant QA

Change-Id: I891f9782b5ae70252e7949a6858896b73ac28871
Reviewed-on: https://gerrit.instructure.com/41025
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
QA-Review: Sean Lewis <slewis@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
2014-10-03 22:08:27 +00:00
Cody Cutrer 8486aeadb4 fix page error if observed is not an active student
fixes #7666

test plan:
 * add a student and observer to a class; link the observer to the
   student
 * remove the student from the class
 * masquerade as the observer, and go the grades page
 * it should not error

Change-Id: I67af21e236d834511860538b89c01d313f31ac8f
Reviewed-on: https://gerrit.instructure.com/9321
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-03-09 10:46:56 -07:00