Commit Graph

6002 Commits

Author SHA1 Message Date
Brad Horrocks d3d4cc58e0 Set lti_context_id on course copy, set previous ids recursively
Previous context ids variable substitution, is now recursive

Fixes GOOF-255
Fixes GOOF-238

Test plan:
- Create "Course A" as "teacher 1", add cloud assignment
- Create "Course B" as "teacher 2", Import "Course A"
- Create "Course C" as "teacher 2", Import "Course B", visit "Course C" Cloud Assignment

It should work

Change-Id: I23590d298f8c79e7b5b008ee3cb748d19c58f6c7
Reviewed-on: https://gerrit.instructure.com/132670
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: Mark McDermott <mmcdermott@instructure.com>
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
2017-11-17 21:24:56 +00:00
James Williams 71fefb3cd0 optimize query for Assignment#assignment_ids_with_submissions
also use it in the calendar where we're doing an equivalent query

closes #ADMIN-558

Change-Id: I6fed726ee2daa1d9b616cf41b106e51c14b90530
Reviewed-on: https://gerrit.instructure.com/133237
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-11-17 21:12:12 +00:00
wdransfield 28f9f4c021 Show resubmit button for more originality report states
Closes PLAT-2894

Test Plan:
- Install a plagiarism detection tool and
  associate it with an assignment.
- As a student submit to the assignment.
- As a teacher navigate to speedgrader and
  verify the resubit to plagiarism tool
  button appears for the submission.
- Verify that when clicked Canvas emits a
  `plagiarism_resubmit` event.
- Create an originality report for the
  submission with a workflow state of pending
  and no originality score.
- Verify the button still apears
- Change the workflow state to error
- Verify the button still appears and
  functions
- Give the originality report a score
- Verify the button no longer appears.
- Verify old TII and Vericite integrations
  still get the old resubmit button.

Change-Id: Ic2a15eff5d473700e07f6910ad65e7232fa7a398
Reviewed-on: https://gerrit.instructure.com/130044
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2017-11-17 19:05:03 +00:00
James Williams a2cca04924 master courses: fix updating question bank questions
test plan:
* create a blueprint course
* create a question bank with a question
* create a quiz with a group linked to the bank
 and lock the quiz

* sync to associated course
* in the associated course,
 update a question in the question bank
* preview the quiz
* it should not kersplode

closes #ADMIN-328

Change-Id: Ib2c611dc16472c83acc8c590b0584c0820ef2317
Reviewed-on: https://gerrit.instructure.com/131591
Tested-by: Jenkins
Reviewed-by: Mysti Sadler <mysti@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-11-17 17:11:08 +00:00
James Williams 8a6639ef70 only assign graded group discussion peer reviews in-group
test plan:
* have a graded group discussion
* have multiple groups in the assigned group set, with
 multiple students in the groups
* have each student post a reply to the discussion
 (i.e. "submit" to the assignment)
* automatically assign peer reviews for the discussion
* it should only have students peer review entries
 made by other students in their group

closes #COMMS-423

Change-Id: Id4f916e27ee2387904301404379e73f755c1e0b3
Reviewed-on: https://gerrit.instructure.com/132883
Tested-by: Jenkins
Reviewed-by: Mysti Sadler <mysti@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-11-17 16:10:31 +00:00
Weston Dransfield 50e604a8a9 Revert "Accept signed JWT tokens as the sourcedid for basic outcomes"
This reverts commit 57a70424f5.

Change-Id: Id4f590f720423b1cbe873590466a42f06f440e07
Reviewed-on: https://gerrit.instructure.com/133150
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
2017-11-17 16:02:55 +00:00
Cody Cutrer 94abfb09ce fix remember me for /auth/userinfo tokens
fixes CORE-630

reverts commit d5e851f

test plan:
 * create a new developer key (one with auto_expire_tokens=true, which
   should be the default)
 * go through the oauth flow, without checking remember me, but with
   specifying scope=/auth/userinfo
 * the token you get back should have access_token= null, and
   expires_at= null
 * go through the process again, but check remember me this time
 * same result
 * go through the process a third time, and this time it shouldn't even
   prompt you to approve the login

Change-Id: Ia55833f179783d385e73a193f03548bd4bc33f25
Reviewed-on: https://gerrit.instructure.com/132664
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2017-11-16 18:48:03 +00:00
wdransfield 5ad754bd8f Tool settings import/export
Closes PLAT-2886

Test Plan:
- Install a plagiarism detection tool in a course.
_ Create an assignment associated with the tool.
- Create a tool setting associated with the tool
  proxy that contains custom data/params.
- Export the course
- In a blank course install the same plagiarism
  tool.
- Import the the coures export package into the
  blank course.
- Verify the tool proxy in the previously blank course
  now has a tool setting.
- Verify the resource_link_id of the tool setting is
  set to the lti_context_id of the assignment it is
  associated with.
- Verify the custom params/data was copied to the new
  tool setting.

Change-Id: I757c4057618442b5b6714a1073fe66ee2487eb25
Reviewed-on: https://gerrit.instructure.com/131525
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2017-11-15 19:22:17 +00:00
James Williams 579ea9305f master courses: sync workflow states consistentishly
test plan:
* have a blueprint course
* have some objects
 (assignment, discussion, page, quiz, file, module, module item)
* sync them to a child course
* unpublish/publish them in the blueprint
* make sure that their publish/unpublish states sync over

* in the child course, publish/unpublish the objects
* syncs should no longer be carried over

closes #ADMIN-343

Change-Id: Ide1a58fed6eb52b34b31be6352613dfb57fc7696
Reviewed-on: https://gerrit.instructure.com/131920
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-11-15 17:41:53 +00:00
James Williams 22a088b172 fix updating unpublished quiz points_possible
test plan:
* have an unpublished quiz in a course
 with a quiz question
* copy the course
* update the original quiz question's points
 (which should update the original quiz points
 on the quiz index)
* re-copy the course
* confirm that the copied course's quiz index
 shows the updated points for the quiz

closes #ADMIN-302

Change-Id: I5399ab9e97aee36679e4698e4236d0d0c1d31f93
Reviewed-on: https://gerrit.instructure.com/132226
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
2017-11-15 13:39:52 +00:00
Andrew Huff ab1acc4f73 trigger live events on change to section_limited
closes RECNVS-67

Changing an enrollment's section_limited status now fires a live event.

This will fix a bug in address-book where the data wasn't being updated

test plan:
* Set up live events (see ./doc/live_events.md)
* Run the `tail_kinesis` script as suggested by live_events.md
  (`docker-compose run --rm web script/tail_kinesis http://kinesis:4567 live-events`)
* Create a student; enroll them in a course
  (without section restrictions)
* In the canvas UI:
  * Go to the course's "People" page
  * Click on the student's name
  * Click "More user details"
  * Click the "limit this user to only see fellow section users" link
    under the appropriate enrollment
* Verify that a live event was generated with the following attributes:
  {
    "event_name"=>"enrollment_updated",
    "body" => {
      "limit_privileges_to_course_section"=>true,
      ...
    },
    ...
  }

Change-Id: Ie23ac614781e776cbaf6aeebc30eca013be8a284
Reviewed-on: https://gerrit.instructure.com/131736
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Jonathan Featherstone <jfeatherstone@instructure.com>
Tested-by: Jenkins
Product-Review: Andrew Huff <ahuff@instructure.com>
2017-11-14 22:51:30 +00:00
James Williams 1b1faa218d fix assignment auto peer review jobs after date change
test plan:
* have an assignment with peer reviews set up to
automatically assign at a time in the near future
* before that time, update the assignment to
 automatically assign peer reviews at a later time
 (but still in the near future)
* it should automatically assign peer reviews at the
 later time and not the initially set time

closes #ADMIN-518

Change-Id: If8fbd46044dbc90f318e8adff86018d506f320e0
Reviewed-on: https://gerrit.instructure.com/132598
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-11-14 17:07:28 +00:00
Spencer Olson 32ac498c1b limit students to visible sections in gradebook history
For teachers restricted to specific sections, gradebook history will
now only return results for students in those sections.

closes GRADE-386

Test Plan:
1. Create a course with 2 sections. Have students enrollments in one
   section and a teacher enrollment in the other. Restrict the teacher
   from seeing enrollments outside of their section.
2. Publish a graded assignment. Navigate to the gradebook and grade all
   students for the assignment.
3. As the teacher, go to the Gradebook History page. Verify the grade
   history does not show events for the students in the other section.
   Filter by student, assignment, or any other criteria. Verify the
   grade history does not show events for the students in the other
   section.

Change-Id: Ie933ec9e1b7d10668cd756e6373a6a5015a10c46
Reviewed-on: https://gerrit.instructure.com/132311
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
QA-Review: Indira Pai <ipai@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
Tested-by: Jenkins
2017-11-13 23:17:01 +00:00
Steven Burnett e29c1e09c8 grandfather soc2 compliant users from accepting
fixes COMMS-509

Test Plan:
- have a user who created_at date is before 2015 and
  has accepted the terms once before.
  (you will probably have to do this through console)
- login
- notice you don't have to accept terms
- update terms again
- relogin again
- notice still doesn't have to accept terms

Change-Id: I0180034357e0c25c2444103dad4211c7554769bd
Reviewed-on: https://gerrit.instructure.com/132592
Reviewed-by: Felix Milea-Ciobanu <fmileaciobanu@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
2017-11-13 22:04:08 +00:00
Jeremy Neander aaa6bb43a5 include user attachments with group submissions
fixes GRADE-655

QA Notes:

The path used to show a submission is:

  /courses/<course id>
  … /assignments/<assignment id>
  … /submissions/<user id>?preview=true

This is the same path used to show a submission is SpeedGrader,
which can also be tested.

test plan:
 A. Setup
    1. Select or create a Course
    2. Add two Students
    3. Create a Group for the Course
    4. Add the two Students to the Group
    5. Create an Assignment:
       * Set Submission Type to "File Uploads"
       * Check "This is a Group Assignment"
       * Check "Assign Grades to Each Student Individually"
       * Assign to the Group above

 B. Do Your Homework, Part 1
    1. Act as Student 1
    2. Visit /files
    3. Upload a file
    4. Visit the assignment page
    5. Click (Re-)submit Assignment
    6. Click on "… find a file you've already uploaded"
    7. Select the previously-uploaded file
    8. Complete the homework submission

 C. Verify
    1. Log in as the Teacher or Admin (either works)
    2. Visit the "show submission" path above for Student 1
    3. Verify Student 1's attachment is visible
    5. Visit the "show submission" path above for Student 2
    6. Verify Student 1's attachment is visible

 D. Do Your Homework, Part 2
    1. Act as Student 2
    2. Visit /files
    3. Upload a file
    4. Visit the assignment page
    5. Click (Re-)submit Assignment
    6. Click on "… find a file you've already uploaded"
    7. Select the previously-uploaded file
    8. Complete the homework submission

 E. Verify
    1. Log in as the Teacher or Admin (either works)
    2. Visit the "show submission" path above for Student 1
    3. Verify Student 2's attachment is visible
    5. Visit the "show submission" path above for Student 2
    6. Verify Student 2's attachment is visible

Change-Id: I46ae3be1258b0e32a93c19259f8b9658f9c89e4c
Reviewed-on: https://gerrit.instructure.com/132368
Tested-by: Jenkins
Reviewed-by: Derek Bender <djbender@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Indira Pai <ipai@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2017-11-10 20:11:51 +00:00
Rob Orton e91dec1a99 should not error for all_day events without date
fixes CORE-622
fixes CANVAS-3EPA

test plan
 - specs should pass

Change-Id: Ib824d38d51d35c8e97052019db6bcde2d5d37f8e
Reviewed-on: https://gerrit.instructure.com/132186
Tested-by: Jenkins
Reviewed-by: Felix Milea-Ciobanu <fmileaciobanu@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2017-11-10 14:29:09 +00:00
Brad Horrocks c8b66084b0 Prevent the creation of external avatars
Fixes: CNVS-37946
refs: SEC-426
Fixes: SEC-312

Test Plan:

Gravatars should still work
File upoloads should still work
You should be able to use API to set you avatar to something in *.instructure.com
I used https://www.instructure.com/img/FBicon.png
You should be able use avatar urls if they match any pattern in the avatar_external_url_patterns setting


Change-Id: I417e2e991e9b722973590fd8347c28e4d81550e2
Reviewed-on: https://gerrit.instructure.com/118009
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Matt Hillary <mhillary@instructure.com>
2017-11-09 23:16:35 +00:00
Cody Cutrer 6a94d11936 cross-shard user observer support
closes CORE-42

test plan:
 * have two root accounts on different shards that trust each other,
   both using canvas auth
 * have a student in account A, enrolled in a course
 * on account B's login page, click the link, and set up a new user
   linked to the student
 * upon login, you should see the student's course(s)

Change-Id: I2bb8feb948862ce419450ffdc79ca52385f3e473
Reviewed-on: https://gerrit.instructure.com/130332
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2017-11-09 21:51:30 +00:00
Rob Orton 3545c77520 also destroy thumbnails on destroy_and_replace
fixes CORE-624

test plan
 - have an attachment that has a thumbnail
 - destroy it with replace
 - the thumbnail should be gone

Change-Id: I7bf09bc722f9af54e043389748da8999530ae69a
Reviewed-on: https://gerrit.instructure.com/132328
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2017-11-09 18:37:02 +00:00
Venk Natarajan 70df115e1f Make course home page go to modules if wiki home page unset.
When a wiki front page is set to the front page of a course, make
the wiki page go to the default for the context (by clearing out
to nil).  In the case of a course home page, this will be the
wiki.

Fixes COMMS-486

Test Plan:
* Have a course.
* Have a page for it, make it the front page.  Set this to further
  be the home page for the course.
* Now unset the page as the "front page" (go to pages->view all
  pages and use the cog next to the page)
* Go to the course home page.
* It should be modules!

Change-Id: Ie2b5e5d44d3d2f6077b193289b385cb58811e261
Reviewed-on: https://gerrit.instructure.com/132314
Tested-by: Jenkins
Reviewed-by: Aaron Kc Hsu <ahsu@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Venk Natarajan <vnatarajan@instructure.com>
2017-11-09 18:13:15 +00:00
Jeremy Neander 0dcc7aaeb2 recompute grades when quizzes become ungraded
fixes GRADE-650

test plan:
 A. Setup
    1. Select or create a Course
    2. Ensure the Course has a Student
    3. Create an Assignment worth 10 points
    4. Create a graded Quiz worth 5 points
       * of type "Assignment"
    5. Grade the Student on the Assignment
       * a score of 9 / 10
    6. Act as the Student
    7. Complete the Quiz

 B. Verification
    1. Log in as the Admin
    2. Visit the enrollments API for the Course
       * /api/v1/courses/<course id>/enrollments/
    3. Verify the course score includes
       * the Assignment grade
       * the Quiz grade
    4. Change the Quiz type to "Practice Quiz"
    5. Visit the enrollments API for the Course
       * /api/v1/courses/<course id>/enrollments/
    6. Verify the course score does not include the Quiz

Change-Id: Ib6890dec082fa418660e061ef39b6c151870024e
Reviewed-on: https://gerrit.instructure.com/132272
Tested-by: Jenkins
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2017-11-09 00:57:47 +00:00
Rob Orton 7c0042d20f handle empty grading types
fixes CORE-621
fixes CANVAS-3ETQ

test plan
 - specs should pass

Change-Id: I52265a1257c066a4eb0e1133bea61f7f087dea24
Reviewed-on: https://gerrit.instructure.com/132185
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2017-11-08 21:40:39 +00:00
Cameron Matheson b27525db0f properly resolve Attachment#root_account_id
closes GRADE-387

Test plan:
  * be a site-admin user on a shard that is not the birth shard
  * export the gradebook for a course on the birth shard
  * it should work

Change-Id: I49849bfca485f4dc4d0b407b52eeaf74be73f956
Reviewed-on: https://gerrit.instructure.com/131859
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Indira Pai <ipai@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2017-11-08 21:38:23 +00:00
Spencer Olson 0952197e69 restore submissions and scores for restored enrollments
Fixes a bug where submissions and scores were not restored when an
enrollment was updated from a "deleted" to "completed" state.

closes GRADE-394

Test Plan:
1. Set up a course with at least one published graded assignment and an
   enrolled student. Both course and student must have a SIS ID.
2. Navigate to the Gradebook and grade the student for the assignment.
3. Run a SIS Import to change the enrollment state from "active" to
   "deleted" for the student.
4. Run a second SIS Import to change the enrollment state from
   "deleted" to "completed" for the student.
5. Navigate into the course's gradebook and enable the option to
   "Show Concluded Enrollments."
6. Verify the grade awarded in step 2 is visible in the Gradebook.
7. On the global grades page for the student, verify the final grade
   for the course is accurate.

Change-Id: I95acf98f829f62388bffb61a8a09a29c2dbc8c82
Reviewed-on: https://gerrit.instructure.com/132001
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Shahbaz Javeed <sjaveed@instructure.com>
Tested-by: Jenkins
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2017-11-08 21:28:51 +00:00
Jeremy Stanley c94b159f09 use opaque tokens rather than ids to mass-enroll users
make user_lists v2 and invite_users return a `user_token`
in addition to id, and make enroll_users accept an array
of these instead of ids

test plan:
 - regression test the "+ People" functionality on the
   course People page
   - using each way to find people
   - when finding existing users and creating new users
   - when finding a user in another shard

fixes ADMIN-265

Change-Id: I792a50d2d9504d13471794889708a69d11144fdd
Reviewed-on: https://gerrit.instructure.com/131933
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2017-11-08 20:29:07 +00:00
Cody Cutrer 180267af84 include outer scope conditions in User.name_like query
fixes CORE-616

it's still not super fast, but at least it's usable

Change-Id: I55b6626b0c4f8d6c32f3466468d72bdcb5e87a3d
Reviewed-on: https://gerrit.instructure.com/132225
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-11-08 18:24:08 +00:00
Cody Cutrer ea1e234f22 filter page views by accessible accounts
fixes CNVS-39916

test plan:
 * enable page views (repeat once each for db, cassandra, pv4)
 * have a user associated with multiple root accounts
 * as that user, browse around both accounts
 * as a site admin, view the user; you should see all page views
 * as an admin in only one of the accounts, you should see only
   the page views from the same account

Change-Id: I79c5788c30ef87c7ff6a2ad31a909f9947e7b35c
Reviewed-on: https://gerrit.instructure.com/129850
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2017-11-08 18:22:38 +00:00
Venk Natarajan 3b666a93ba Include inactive users in group members.
In the groups index page for a course, we were not displaying
inactive users.  This caused problems when a student tried to
sign up for a full group that had inactive users in it, since
we told them that the group had spaces.

This change now displays inactive as well as active users, so
the student is now told that the group is full.  It is up to
the teacher to remove such students if they see fit.

Fixes COMMS-4

Test plan:
* Have a course with some self sign-up groups, with a limit.
* Fill the group up to the limit with active students, making
  sure you have a student left that is not in the group.
* Now, deactivate one of the students in the group.
* With the student *not* in the group, act as that user.
* Go to the "people" page for the course and click on groups.
* Now the student will be told that the group is full.
* Become the teacher again.
* Go to the group in question, the inactive users in it should
  be marked as such.

Change-Id: If54df1e22779a5c0a4a97ed79245e7d5a6d76713
Reviewed-on: https://gerrit.instructure.com/131728
Tested-by: Jenkins
Reviewed-by: Felix Milea-Ciobanu <fmileaciobanu@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
2017-11-08 18:21:15 +00:00
James Williams cd8a29d12a include parent sub-account chain in global announcement search
test plan:
* set up a sub-account with a sub-account of its own
* create a course in the bottom level sub-account
* create a global announcement for the parent sub-account
(go to account setttings, "Announcements" tab)
* should be able to see the announcement on the main page
 as a student enrolled in the child sub-account course

closes #COMMS-480

Change-Id: I4f35e32039cd2ad41cfb92dcd195305a630f37ff
Reviewed-on: https://gerrit.instructure.com/132197
Tested-by: Jenkins
Reviewed-by: Venk Natarajan <vnatarajan@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-11-08 18:18:54 +00:00
James Williams 30f8f5cced create quiz submission events on same shard
closes #QO-165

Change-Id: Ic23e5245902ac6df7e44059bb26a42fcea2996c0
Reviewed-on: https://gerrit.instructure.com/132117
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-11-08 17:39:30 +00:00
Andrew Butterfield 2e1c33e63c Ensure nil domain is not used to match external tools
fixes PLAT-2872

Test plan:
* Install the test tool without a domain in a context
* Fabricate a launch using the /retrieve?url=... endpoint
* Ensure the domain in your url has a `.` following it
* Ensure that the launch does not succeed

Change-Id: Ibb6da38dd2c4b1cec441fc4b106a60a6ce33fdb9
Reviewed-on: https://gerrit.instructure.com/131964
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Andrew Butterfield <abutterfield@instructure.com>
2017-11-08 17:02:52 +00:00
Steven Burnett 26b1886cf1 allow practice quizzes that have been graded
fixes ADMIN-102

Test Plan:
- Create a practice quiz
- Take a practice quiz
- Go to planner
- Notice it shows

Change-Id: I42d20ebf33f50678a40a012bdac4be2f8e92b1f5
Reviewed-on: https://gerrit.instructure.com/132022
Tested-by: Jenkins
Reviewed-by: Dan Minkevitch <dan@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2017-11-08 16:56:23 +00:00
James Williams 863834b905 decrease attachment download window
closes #ADMIN-263

Change-Id: I46919ae7d3615813a8b131b29b29e5a1caf43709
Reviewed-on: https://gerrit.instructure.com/132102
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-11-08 13:29:07 +00:00
Cody Cutrer 48b59d08a8 fix splitting users to not do unnecessary updates
fixes CORE-608

Change-Id: I99487f010bf9dc4a6ef03c40d6e48504f18fc06d
Reviewed-on: https://gerrit.instructure.com/132145
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-11-08 00:33:04 +00:00
Ryan Shaw 3c30c9b6df Clean up account course/user search pages
Closes: CORE-334 CORE-211

* takes out tabs from page
* changes “Courses & People” tab back to separate
  “Courses” and “People” tabs. They are still a single page app
  between those 2 tabs
* changes urls back to accounts/x for “Courses” tab and
  accounts/x/users for “People” tab (like they were previously)

Test plan:
* turn on MRA, Make sure the “suspend/unsuspend account”
  button on account settings page still works
* make sure the “find a user anywhere for siteAdmin/consortium root
  accounts” still works
* check to make sure going to the “People” and “courses” tab on the
  Left of the account nav works correctly
* verify that you can copy/paste the url showing for a given
  search result and it will come up with the same search results in
  another tab
* general regression on the account course & user pages.

Change-Id: Idfade57b2abd189a84ba5372d8e4aad1fb3ea49b
Reviewed-on: https://gerrit.instructure.com/128822
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2017-11-07 18:50:50 +00:00
Cody Cutrer 2edd2d3ad0 don't try to find accounts with nil id
fixes CORE-599

Change-Id: Ib4d13922cf56ec30ec794935061be15b40224d10
Reviewed-on: https://gerrit.instructure.com/131971
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-11-06 22:21:31 +00:00
wdransfield 3f8f1cad83 Use relative path in originality report launch redirect
Fixes PLAT-2910

Test Plan:
- Create a sub-account that has a different domain
  than its root account.
- Install a plagiarism detection tool in the sub-account
  and associate it win an assignment.
- As a student submit to the assignment
- Create an originality report that does an LTI
  launch for the submission
- As the student click on the originality score.
  Verify the URL you are eventually redirected to matches
  the domain of the sub-account, not the root account.

Change-Id: I2928e2c5a3ed167c4f0ee72291449d855aa53535
Reviewed-on: https://gerrit.instructure.com/131757
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2017-11-06 22:14:26 +00:00
Dan Minkevitch 8aa167dcfb Add Observers and Unenrolled options for help link availability
Fixes ADMIN-342

Test Plan:
* As an account admin (not site admin)
* Go to the account's settings page
* Under "Help menu options", add six new links for each of the
  options under "Available to" (i.e. make separate links for
  everyone, students, teachers, admins, observers, and unenrolled)
* Masquerade as a user in the account that doesn't have any
  enrollments
* Click the help menu link in the sidebar
* The links should include the default links, as well as the links
  for "everyone" and "unenrolled"
* Repeat the above process for users with only one the following:
  a teacher enrollment, student enrollment, observer enrollment,
  and account admin
* The links with their "available to" checked for the correlating
  enrollments should show up in the help menu
* Note that designers & TAs fall under the "available to teacher"
  option (this was existing behavior)

Change-Id: I294bd0c0fe341697136cfaf9984c30440985b843
Reviewed-on: https://gerrit.instructure.com/131742
Tested-by: Jenkins
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Christi Wruck
2017-11-06 22:05:31 +00:00
Keith Garner 69a4a8db7e update the assessor on regrading/reassessing a rubric
This patchset updates the assessor on re-assessment/re-grading a
rubric assessment. It also seeds the submission when updated to record
for grade change purposes who is making the change.

fixes GRADE-369

test plan:
 - Make sure you have Cassandra configured
 - Have a course with a student, two teachers, and an assignment that
   has a rubric.
 - As the first teacher, grade the student using the rubric
 - As the second teacher, regrade the student using the rubric
 - As the first teacher, regrade the student using the rubic
 - As the second teacher, regrade the student using the rubric
 - Go into gradebook history and note that the grader in the report
   matches the pattern of grading above and isn't just the first
   grader

Change-Id: Ia167d282c7e7284039b07d74b8f764044c362800
Reviewed-on: https://gerrit.instructure.com/131894
Tested-by: Jenkins
Reviewed-by: Shahbaz Javeed <sjaveed@instructure.com>
Reviewed-by: Jeremy Neander <jneander@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2017-11-06 21:09:37 +00:00
Keith Garner 2a977a9f37 fix courses users end point to only get active group memberships
Using the user api preloader and user_json methods, all group
memberships for a user are retrieved, both for other courses as well
as deleted group memberships. This patchset changes the courses users
end point to only retrive active group membership scoped to the
course.

fixes GRADE-374

test plan:
 - Have a course with students divided into groups and some
   assignments with at least one being a group assignment.
 - Confirm the gradebook loads
 - Grade the group assignment and confirm all students in the group
   are graded properly

Change-Id: I0085de3455b090f0c526d8fcbe7d311a21078a78
Reviewed-on: https://gerrit.instructure.com/131237
Reviewed-by: Derek Bender <djbender@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jeremy Neander <jneander@instructure.com>
QA-Review: Indira Pai <ipai@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2017-11-06 18:23:00 +00:00
Rob Orton e7af8c638a ensure that enrollment is in context for permissions
test plan
 - delete an enrollment using the api
 - should only allow deleting from the specified course

Change-Id: I40eeb3402a0dbc9abaa9c1dcd26c4677cf512f68
Reviewed-on: https://gerrit.instructure.com/31475
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2017-11-06 17:59:08 +00:00
Brad Humphrey 57a70424f5 Accept signed JWT tokens as the sourcedid for basic outcomes
Add sourcedid class

load sourcedid from token with validation

this supports both jwt and legacy sourcedids

use sourcedid class in in basic_outcomes

Test Plan:
  - Execute an LTI basic outcomes request
  - It should update grades and/or create a submission in canvas
  - It should still use the OLD sourced_ids (i.e.
    %r{^(\d+)-(\d+)-(\d+)-(\d+)-(\w+)$})
  - Enable the "Encrypted Sourcedids for Basic Outcomes"
    on the root account.
  - Execute an LTI baic outcomes request
  - It should use the NEW sourcdids (an encrypted JWT)
  - It should update grades ando/or create a submisison in canvas

refs PLAT-2747

Change-Id: I1b6223611228c8a078bcfa73976329365ebb1b7c
Reviewed-on: https://gerrit.instructure.com/128167
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2017-11-06 16:55:03 +00:00
Matthew Berns 7d7cf8d334 avoid mastery scaling if mastery pts or pts possible is 0
fixes OUT-1591

test plan:
- create an outcome that uses either decaying avg or
  n mastery
- set its points possible to 0 (set all criterion to 0)
- create another outcome using one of the above methods
  and set its mastery score to 0
- create a question bank, add questions, and align it to
  the two newly created outcomes. Due to the setup of
  the outcomes, any mastery percent set on the alighment
  should suffice
- align the bank questions to a quiz
- as a student, take the quiz
- as the teacher, the LMGB should properly load

NOTE: The scores shown for this specific bank will not
look correct in the LMGB, since the percentage on the question
will be trying to multiply by 0, thus coming back as 0 even if the
student did not get a 0 on the bank. This is due to the percentage
scaling system not anticipating someone having 0 points possible
on an Outcome rubric. This issue will be addressed in a separate
ticket.

Change-Id: I61dd49e8fba62bb960cadff6af790c402bfced3b
Reviewed-on: https://gerrit.instructure.com/129455
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
QA-Review: Andrew Porter <hporter-c@instructure.com>
Tested-by: Jenkins
Product-Review: Sidharth Oberoi <soberoi@instructure.com>
2017-11-06 16:22:11 +00:00
Spencer Olson 2f8872d4ee show totals as percentage for weighted grading periods
Disallows showing the total grade as points in Gradebook (new and old)
and the student grades page when weighted grading periods are in use.

closes GRADE-193

Test Plan:
1. Create a course with 2 assignment groups and 2 grading periods.
   Neither the assignment groups nor the grading periods should be
   weighted.
2. Create an assignment in the first assignment group and make it due
   in the first grading period. Give a student 10/10.
3. Create an assignment in the second assignmetn group and make it due
   in the second grading period. Give a student 5/10.
4. In the Gradebook (old and new), verify you can toggle between
   showing the total as points or percentage.
5. Select "Display as Points". Verify totals show up as points.
6. In Individual Gradebook, verify there is a 'Show Totals as Points
   on Student Grade Page' option, and you can toggle it. Also verify
   the final grade for the student includes the points possible, i.e.
   41.94% (26 / 62 points). Note that Individual Gradebook will always
   show the final grade for a student as a percent followed by points
   possible, regardless of the 'Show Totals as Points on Student Grade
   Page' option.
7. Go to the Account Grading Standards page and update the Grading
   Period Set to be weighted.
8. In the Gradebook (old and new), verify the totals are shown as
   percent. Verify there is no option to toggle between points and
   percentage.
9. In Individual Gradebook, verify there is no longer a 'Show Totals as
   Points on Student Grade Page' option. Verify the final grade for the
   student does not include the points possible if 'All Grading
   Periods' is selected. Verify the final grade for the student
   includes the points possible if an individual Grading Period is
   selected.
10. Go to the student grades page for a student and verify the total
    is shown as a percent. As with the Individual Gradebook, points
    possible should not be shown next to the final grade if 'All
    Grading Periods' is selected, and they should be shown next to the
    final grade if an individual Grading Period is selected.
11. Go to the Account Grading Standards page and update the Grading
    Period Set to not be weighted.
12. In the Gradebook (old and new), verify there is an option to
    toggle between points and percentage.
13. In Individual Gradebook, verify there is a 'Show Totals as Points
    on Student Grade Page' option, and you can toggle it.
14. Go to the assignments page for the course and update the assignment
    groups to be weighted.
15. In the Gradebook (old and new), verify the totals are shown as
    percent. Verify there is no option to toggle between points and
    percentage.
16. In Individual Gradebook, verify there is not a 'Show Totals as
    Points on Student Grade Page' option. Verify the final grade for the
    student does not include the points possible (regardless of Grading
    Period selection).
17. Go to the student grades page for a student and verify the total
    is shown as a percent. As with the Individual Gradebook, points
    possible should not be shown next to the final grade (regardless of
    Grading Period selection).

Change-Id: Ic0614643edabee2f175ae701bf2593120c6db40a
Reviewed-on: https://gerrit.instructure.com/131565
Reviewed-by: Derek Bender <djbender@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jeremy Neander <jneander@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2017-11-06 14:31:32 +00:00
Rob Orton 1574dfe834 make account_id sticky for courses
fixes CNVS-39947

test plan
 - account_id should be sticky for course imports

Change-Id: I667bd9a5d43a0b7db587edbd0316681e000780d0
Reviewed-on: https://gerrit.instructure.com/129944
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2017-11-03 21:30:17 +00:00
Clay Diffrient 961689cb5d Add bmp and ico image mappings to attachments
closes CORE-6

Test Plan:
  - Make sure Sidebar Enhancements feature flag is on
  - Go to a page and upload (using the sidebar) an image
    in the `bmp` and `ico` formats
  - The image should show in the RCE, not a link to a file

Change-Id: Ib74cf008d825a7ccda77998bd356f8ee2b846498
Reviewed-on: https://gerrit.instructure.com/131768
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
QA-Review: Collin Parrish <cparrish@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2017-11-03 19:20:12 +00:00
Rob Orton 8069dbba16 update asset_user_access asset title on update
fixes CNVS-15316

test plan
 * with cassandra and page views enabled
 - log user access to an by viewing an item as a student
 - change the name of the item/asset
 - log user access to the item again
 - user access report asset name should have new name

Change-Id: I3fb72673905f2329341fa049649c58d63ecf0c17
Reviewed-on: https://gerrit.instructure.com/42489
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2017-11-03 17:11:23 +00:00
Venk Natarajan d352cfbd8b Add the ability to duplicate modules.
Closes COMMS-148
Closes COMMS-147

Test Plan:
* Create a module with a variety of items in it.
* Duplicate it.
* The new module should appear now.
* Make sure that this all works in conjunction with
  various other ui actions on the page without needing
  a refresh.
* The "duplicate" option should appear iff the module
  in question has no quizzes in it.  Modules with
  quizzes cannot be duplicated for the moment.
* Make sure that the ability to "duplicate" is updated
  properly if quizzes are added to/removed from the
  module.

Change-Id: I288c56f42a89abad5c725fa3cbd91b02ea11a460
Reviewed-on: https://gerrit.instructure.com/128960
Reviewed-by: Felix Milea-Ciobanu <fmileaciobanu@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Tested-by: Jenkins
Product-Review: Christi Wruck
2017-11-03 15:52:43 +00:00
Cameron Matheson 4cc08bf4f3 don't tell students about discussions they can't see
closes CORE-38

Test plan:
  * make a graded discussion that is only assigned to some members of
    the class
  * post in the discussion as the teacher
  * students that are assigned the discussion should see a notification
    on their course dashboard card
  * students that aren't assigned should not see an indicator on their
    dashboard card

Change-Id: Id3505c80d675d80dcd10709ebaea88cbacfc6c6e
Reviewed-on: https://gerrit.instructure.com/131647
Tested-by: Jenkins
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Collin Parrish <cparrish@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2017-11-02 22:38:00 +00:00
Derek Bender 7a96d3ba70 hide entered_score entered_grade when muted
closes: GRADE-633

test plan:
- Given a muted assignment
- When requesting the student's submission via the API
- Then 'entered_score' and 'entered_grade' are not present in the API

Change-Id: I3936e3285da0f96132f1c0f297a760317ac9f877
Reviewed-on: https://gerrit.instructure.com/131540
Tested-by: Jenkins
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
Reviewed-by: Jeremy Neander <jneander@instructure.com>
QA-Review: Indira Pai <ipai@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2017-11-02 20:40:55 +00:00