Commit Graph

3406 Commits

Author SHA1 Message Date
James Williams 0373e72d3a relock associated module when assignment overrides change
test plan:
* create a course with two sections
* create an assignment that is only assigned
 for one course section

* create two modules and make the first a prerequisite
 for the second
* add the assignment as a requirement for the first

* add a student in the other course section
* the second module should be unlocked for them since
 they can't see the required assignment

* edit the assignment to be assigned to the other
 course section
* revisit the modules page as the student
* the assignment should be visible and the second module locked

closes #CNVS-27470

Change-Id: I366592d11302362b7d92019f211915ce2c29266e
Reviewed-on: https://gerrit.instructure.com/73076
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2016-03-02 18:03:10 +00:00
Ethan Vizitei 3df3a34b56 allow services to pass their Request ID
refs CNVS-27581

this ensures we have one correlation ID for a request coming
through the ecosystem rather than a seperate ID for each request
at each service. Each request id must be signed to make sure
others can't just submit whatever they want.

TEST PLAN:
 1) make an API request and provide the header 'X-Request-Context-Id'
 2) make sure to include the X-Request-Context-Signature header, which
    should have the value of the sha512 signature with the shared
    secret for the services ecosystem
 2) the logs should show your provided value as the context Id for that
     canvas request

Change-Id: I610fbe8c4df355d43c05360670f80971d1459644
Reviewed-on: https://gerrit.instructure.com/73166
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2016-03-01 22:30:45 +00:00
Ethan Vizitei c9eae629ed consul caching
closes CNVS-27597

We need to not slam consul for rarely changing data.
the '#find' method still gets the value from consul everytime.
Cache can be infinite or with timeout.

TEST PLAN:
 1) have some data in consul for what the signing secret is for canvas
 2) Make sure to query it (Canvas::Security::ServicesJwt.signing_secret)
 3) change the consul data
 4) query it again, it should not have updated
 5) send a SIGHUP
 6) query it again, it should have changed

Change-Id: I5b923b8e44ab90692e87969c494a7c65fafcad72
Reviewed-on: https://gerrit.instructure.com/73198
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins
Reviewed-by: David Adams <dadams@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2016-03-01 21:34:32 +00:00
James Williams 325d6a1ed5 validate permissions for role override population
refs #CNVS-27475

Change-Id: I241b4c5454fb9d1e306a5a6281dca6f1da439f7c
Reviewed-on: https://gerrit.instructure.com/73357
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-03-01 18:12:08 +00:00
Ethan Vizitei effe2317b6 gradual feature flags for rce service
closes CNVS-27212

Gives us the ability to turn on RCE integration
for one category of use case at a time rather than all
at once

TEST PLAN:
 1) nothing uses the higher level feature flags yet
 2) make sure you can enable and disable the new feature flags?
Change-Id: I187f2da931a1374ff0893000849a6dbef3332c0b
Reviewed-on: https://gerrit.instructure.com/73065
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2016-02-29 18:07:00 +00:00
Keith Garner db15d1c9bc escape student names that begin with equals sign in gradebook exporter
When exporting to a CSV when a student name beings with an equals, the
gradebook exporter will set the name to be a forumula that explicity
sets the cell to name. This will allow a teacher using Excel to be
safe from potential security issues caused by a student changing their
student name name to a function or macro.

This commit also contains a fix to an existing spec that didn't test
what it was intending to.

fixes CNVS-25317

test plan:
 - Have a course and gradebook that has a student with the name of
   =sum(A)
 - Export the gradebook to a CSV.
 - Open the CSV in a text file and note that the name looks like
   ="=sum(A)"
 - Open the CSV in excel and note the student name is properly
   displayed in the grid as =sum(A)

Change-Id: I1ff77f1c49f93d997cb5dcde8ad0d2239edbc4c7
Reviewed-on: https://gerrit.instructure.com/72914
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
Tested-by: Jenkins
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2016-02-29 17:30:32 +00:00
Marc Alan Phillips 0fad3e1db6 fix assignment edit for multi-section course
Fix the edit for a multi-section course where an assignment
override is made for a student in another section than the
teacher who is editing the assignment.

fixes CNVS-23944

Test Plan:
  -Create a course with two sections.
  -Add a teacher that can only grade their section.
  -Create a quiz or assignment
  -Override with only student(s) that the sub-teacher cant see
  -Masquerade as the teacher and go attempt to edit the assignment.
  -Make a change
  -Click save and see that it now saves..
  -Repeat with override with mix of students that the sub-teacher
     can/cannot see
  -Repeat with various combos not stated that you can think of
  -Make sure to also test that groups and section overrides still work

Change-Id: I360368bf3340a15452da5e60e734817841df139c
Reviewed-on: https://gerrit.instructure.com/71526
Tested-by: Jenkins
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Jason Sparks <jsparks@instructure.com>
2016-02-28 05:50:18 +00:00
Ethan Vizitei 2ba6be4c38 check nbf for JWT processing
closes CNVS-27576

TEST PLAN:
 1) JWT with nbf in the future should get rejected (tests prove this)

Change-Id: I55f5bde030a6be4caee323a14988e3fbb49cfa95
Reviewed-on: https://gerrit.instructure.com/73132
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
2016-02-27 14:26:35 +00:00
Nathan Mills e893a488c8 gracefully handle missing sourcedid for grade passback
fixes PLAT-1356

test plan:
send a grade passback with no sourcedid
canvas shouldn't return a 500

Change-Id: I21436d679e05a5fa837167b163212a729c10a3a8
Reviewed-on: https://gerrit.instructure.com/72998
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Brad Horrocks <bhorrocks@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2016-02-26 18:29:52 +00:00
Jeremy Stanley 5a458d729e extension point for analytics links
test plan: sanity check the following pages to ensure
they load properly:
 - account index (/accounts/X)
 - account statistics (/accounts/X/statistics)
 - courses index (/courses/X)
 - courses people page (/courses/X/users)
 - student profile page (courses/X/users/Y)
   test this with "Enable Profiles" in account settings
   on and off.

This commit enables the analytics plugin to add links in all
these places without manipulating the DOM after the page renders.
(Not all these places have analytics links now. They used to,
before page changes broke the DOM injection that this commit
prepares us to get rid of...)

refs CNVS-6298

Change-Id: Ib252655220b017c2f60c9f4aa08d65a516a82f83
Reviewed-on: https://gerrit.instructure.com/72285
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2016-02-26 16:14:06 +00:00
James Williams 85518dc397 migrate yaml in database into a psych compatible format
from now on dumps all yaml with psych and inserts a tag to
differentiate between syck and psych yaml on load

also runs through the database and converts all
incompatible yaml to psych format

after the migrations have run we will be able to switch
to psych fully and clean up the tags

test plan:
* the migrations should work

closes #CNVS-27229

Change-Id: I79ce0691dd455396ca39422051ff79b8fbaebef6
Reviewed-on: https://gerrit.instructure.com/72012
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
2016-02-25 20:07:15 +00:00
Cody Cutrer 4b93e99a4d add db:skipped_migrations rake task
to easily see migrations that aren't currently runnable

test plan:
 * run the task
 * you'll likely see some output (such as cassandra migrations)

Change-Id: I03ebe98aa24828f67b4945b9262096a7888f52d4
Reviewed-on: https://gerrit.instructure.com/72854
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-02-25 16:14:57 +00:00
Cody Cutrer 4f9b4f1805 vastly simplify ActiveRecord::Migrator extensions
we no longer need to replace the entire Migrator#migrate method

test plan:
 * check your pending migrations; they should make sense
 * revert a postdeploy migration
 * it should ask you to confirm the revert
 * run db:migrate:predeploy; it shouldn't re-run the postdeploy
 * run db:migrate; it should run it now

Change-Id: Ia78ad21d10f4e89786b8c4751828fe9f264caecc
Reviewed-on: https://gerrit.instructure.com/72853
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-02-24 23:48:40 +00:00
Cody Cutrer 9c7d006437 optimize several N+1 queries in CalendarEventsApiController#index
refs CNVS-27010

Change-Id: I74df150c660f1c72e6aa0701c063eebe9a910197
Reviewed-on: https://gerrit.instructure.com/71331
Tested-by: Jenkins
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-02-24 17:55:09 +00:00
Keith Garner b824a36778 add include[]=group to SubmissionApiController#index
This adds a check for a 'include[]=group' param in the
SubmissionApiController#index action so that the group_id and
group_name are returned with the other submission information.

fixes CNVS-25579
ref CNVS-23203

Test Plan:
 - Have a course with a few students enrolled
 - Create user groups and put at least two students in one group.
 - Create an assignment set to be graded as a group
 - Have a student from one of the groups submit to the assignment on
   behalf of the group.
 - With a teacher or admin token, ping the Submissions list API with
   include[]=group
 - Verify that group_id and group_name information was passed with the
   submission entries

Change-Id: I3484af661506c0733dc456ff7611f5e4659db573
Reviewed-on: https://gerrit.instructure.com/72288
Tested-by: Jenkins
Reviewed-by: Cameron Matheson <cameron@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2016-02-23 17:36:08 +00:00
James Williams a350566a67 include inactive student grades in gradebook export
test plan:
* create an assignment in a course
* add a student to the course
* grade the student on the gradebook
* make the student inactive on the people page

* go back to the gradebook and export grades
* it should list the student's grade in the csv file

closes #CNVS-27254

Change-Id: I79f580b5068ea7d3699ff5918409d381dd0f5647
Reviewed-on: https://gerrit.instructure.com/72465
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
2016-02-23 16:58:31 +00:00
James Williams 0ecc78be4a show inactive students in speedgrader
also should fix submission downloading

test plan:
* create a course with a file upload assignment
* add a student
* submit to the assignment as the student

* make the student inactive in the people page
* should still be able to see the student in
 speedgrader and grade them

* also click on the "Download Submissions" link
 on the assignment page
* it should include the students submission
* the "Download Submission" dialog on the gradebook
 should work the same way

closes #CNVS-27249 #CNVS-27250 #CNVS-27251

Change-Id: Id58e28e85aa05da102e76b7ec40ed3f36acafef5
Reviewed-on: https://gerrit.instructure.com/72464
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
2016-02-23 16:58:21 +00:00
Rob Orton 568e87e5fa give a useful warning for mismatched section and course
fixes CNVS-27396

test plan
 - run an enrollment import that has a course sis 
   id and a section sis id that belongs to a
   different course than the one provided
 - the warning should say the sis id for each the
   course, section, and user

Change-Id: I4c7ae135465da0a534fda58e0e013d5c5a85c8fc
Reviewed-on: https://gerrit.instructure.com/72647
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Rob Orton <rob@instructure.com>
2016-02-23 05:53:22 +00:00
Michael Nomitch d8ff7b1712 dont factor concluded enrollments into due dates
fixes CNVS-26855

test plan:
  - create a course with two sections
  - enroll a student in both sections
  - create an assignment that has different
    due dates for each section
  - conclude the student enrollment in the
    section that has the latest due date
  - Check the assignment as the student and
    see that the due date for the concluded
    section doe not appear
  - note: its possible that the old date
    will get cached for a bit

Change-Id: I2d708cbd08a9a5071a32fe66cd8c7214a28002c2
Reviewed-on: https://gerrit.instructure.com/71396
Tested-by: Jenkins
Reviewed-by: Chris Wang <cwang@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Jason Sparks <jsparks@instructure.com>
2016-02-23 04:05:39 +00:00
Spencer Olson 94eb0d90c3 optimize assignment student visibilities
avoid a chunk of student visibility logic if an
assignment is visible to all students. instead,
if an assignment is visible to all students, set
its associated visibility array to all students
in the course and sidestep the logic that was
previously run.

closes CNVS-19971

test plan:
- create a course that contains assignments with
  no overrides, student overrides, section
  overrides, group overrides, and combinations of
  different types of overrides.
- verify the gradebook loads without issue.
- verify grade cells are correctly greyed out
  in the gradebook (students that do not have an
  assignment assigned to them should have their
  cell greyed out in that assignment's column)

Change-Id: I14f363351ac2a3b631c74f027003fda2bd79d81a
Reviewed-on: https://gerrit.instructure.com/72281
Tested-by: Jenkins
Reviewed-by: Cameron Matheson <cameron@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Spencer Olson <solson@instructure.com>
2016-02-23 01:17:29 +00:00
James Williams 6fdb7e11ef fix plugins jsx compilation
Change-Id: I840e27820d944b0d2cc61ead425404bb060e139a
Reviewed-on: https://gerrit.instructure.com/72725
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-02-22 22:06:37 +00:00
James Williams fd7a2d9bf0 fix media comments in course section media events
* add a calendar event to a course with varied due dates by
 section and a media comment in the description
* as a student, click on the calendar feed link on the calendar
 and then click on "click here to view the feed"
* it should download successfully

closes #CNVS-24717

Change-Id: I58c6b7dac2d88e9c08ea56efc62ce8de9a5c8d48
Reviewed-on: https://gerrit.instructure.com/72565
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2016-02-22 19:36:51 +00:00
James Williams b33b538d82 don't flag url encoded wiki pages in course link validator
test plan:
* use the wiki sidebar to "Link to a new page", using a page
 title with a special character (e.g. ";" or "?")
* click the link and create the page
* run the link validator
* it should not flag the page link

closes #CNVS-27203

Change-Id: Ib0d33771bbaa5d83b60adaaf59eca46f49e59322
Reviewed-on: https://gerrit.instructure.com/72675
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2016-02-22 17:41:49 +00:00
James Williams 9de10e44ba don't run course link validator on questions in deleted banks
test plan:
* create a question bank
* create a question in the bank with an invalid link
* the course link validator should find it
* delete the question bank
* the course link validator should not flag the link
 in the question anymore

closes #CNVS-27389

Change-Id: Icab0298a071dc4c668ebbd0bfaab1e616e0c71af
Reviewed-on: https://gerrit.instructure.com/72677
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2016-02-22 17:32:06 +00:00
James Williams 93ba139e31 fix copied references to folders named "course files"
test plan:
* create a folder named "course files"
* add a file
* add a link to the file in html content
* copy the course
* it should copy the link correctly

closes #CNVS-27314

Change-Id: I3ff9a800ec2e19f9548b9ca0935b5ed920ba49ef
Reviewed-on: https://gerrit.instructure.com/72491
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2016-02-22 13:53:57 +00:00
Alex Boyd 098e6f9c85 spec: include rails logs with spec failure pages
Change-Id: I266edba9fa98305d94c80a16bf68d8c64a3b3468
Reviewed-on: https://gerrit.instructure.com/72542
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins
2016-02-20 00:16:30 +00:00
Jon Willesen b039c7b632 add conditional_release feature flag
initially, the feature flag only toggles a button on the course
settings sidebar.

test plan:
 - enroll as a teacher
 - check there is no conditional release button on course
   settings right sidebar
 - enable conditional release feature
 - check there is a conditional release button
 - revoke "manage all other content" permission for teachers
 - check there is no longer a conditional release button

 fixes: CYOE-44

Change-Id: Ic8299ba179bf6331ce9a2da5d40e60ac0bc88ee6
Reviewed-on: https://gerrit.instructure.com/72474
Reviewed-by: Dan Minkevitch <dan@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
QA-Review: Jon Willesen <jonw@instructure.com>
Tested-by: Jenkins
2016-02-19 16:00:37 +00:00
Cody Cutrer b7f00ab032 document and extend usage of integration_id for users
refs CNVS-26735

test plan:
 * create a user, pseudonym, and update a pseudonym via API
   setting integration_id
 * it should work
 * with a user with an integration id set, launch an LTI tool
   with the Canvas.user.sisIntegrationId variable being sent;
   ensure it gets sent

Change-Id: I549ba6e64e993c4867acfe33577722c1118b8988
Reviewed-on: https://gerrit.instructure.com/70874
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
Reviewed-by: Brad Humphrey <brad@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2016-02-18 20:11:01 +00:00
James Williams b166aa96ff don't flag links to public paths in course link validator
test plan:
* create a page or other html content with a link to a
 file in the /public directory (e.g. "/images/avatar.png")
* the course link validator should not mark it as a broken link

closes #CNVS-26982

Change-Id: Ibba746679810ba93256e39635ebf8e5826bacd56
Reviewed-on: https://gerrit.instructure.com/72370
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2016-02-18 19:46:36 +00:00
James Williams ab75744a6f fix folders with leading spaces as well as trailing ones
closes #CNVS-27257

Change-Id: I21f88c87400cda576f233c57b88026995bf391b5
Reviewed-on: https://gerrit.instructure.com/72224
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-02-17 16:18:27 +00:00
James Williams 4fbb52d681 prevent stream item instance duplicates
test plan:
* basic regressions on dashboard stream items

closes #CNVS-27239

Change-Id: Id173d9c8e117941dabb7b79f681bad6a1d1b2f67
Reviewed-on: https://gerrit.instructure.com/72153
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2016-02-16 19:50:52 +00:00
Nathan Mills fbb91fdfcd allow tii lti originality scores to be resubmitted
if there is already a submission for grade passback
then keep the original submission_type

fixes PLAT-1313

test plan:
setup the turnitin lti tool and submit an assignmnet
wait until you get an originality score back
edit the db to change the status of the result to error
resubmit the assignment in speed grader
you should get the score again, and the status in the db should change
then go into turnitin as a teacher and submit a grade for the submission
check the database the submission_type should still be 'online_upload'

Change-Id: I2bc609bc5559e80f678cf00370f6a04af4d3b6aa
Reviewed-on: https://gerrit.instructure.com/71118
Reviewed-by: Brad Horrocks <bhorrocks@instructure.com>
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
Tested-by: Jenkins
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2016-02-16 19:37:31 +00:00
James Williams 878e91cca1 fix course link references for users without :manage_content
test plan:
* create a course with a locked discussion topic
* add a link to the discussion topic to a wiki page

* create a term with dates for teachers in the past
* add the course to the past term

* as a teacher, copy the course
* the link in the wiki page should point to the
 correct discussion topic in the copied course

closes #CNVS-27143

Change-Id: Ic7e72276e88c54a35346f5863fb141eedd44905f
Reviewed-on: https://gerrit.instructure.com/72014
Tested-by: Jenkins
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2016-02-16 16:20:21 +00:00
Cody Cutrer ac8d12d4d3 spec: ensure temporary models protect attributes
Change-Id: Ib31e29d329b2319109affca2904a7da0a0346a21
Reviewed-on: https://gerrit.instructure.com/72136
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-02-15 16:35:32 +00:00
James Williams ec2d8056bb remove uses of Rails.version
also removes rails 3 specific code that was leftover

refs #CNVS-26056

Change-Id: I9750865f1f9eca03d0514781a6ecf3e73aafdbf6
Reviewed-on: https://gerrit.instructure.com/72143
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-02-12 21:26:36 +00:00
Cody Cutrer 1d722f1dd1 improve polymorphic extensions to belongs_to
particularly, allows passing specific types to `joins` in queries,
instead of having to manually create the SQL

refs CNVS-26480

Change-Id: Iccb2eb47d88c55befbadb5bdb7086e21718c59fd
Reviewed-on: https://gerrit.instructure.com/71879
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-02-12 16:48:54 +00:00
Brad Horrocks 11824511d2 Use `system` instead of `Bundler.clean_system` for dress_code
Bundler.clean_system doesnt have BUNDLE_PATH set correctly

Change-Id: Ib2760786e5dfbc7909f55ddd5f401a96fcf2a430
Reviewed-on: https://gerrit.instructure.com/71927
Reviewed-by: Tyler Pickett <tpickett@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
2016-02-11 23:07:32 +00:00
Ethan Vizitei 76c2779f2d add host to services jwt entry
refs CNVS-24823

having the host in the token means we don't need to pass multiple
parameters to give a service context for proxying API calls.

TEST PLAN:
 1) jwt should still be able to be generated
 2) decypted/decoded JWT should include a 'domain' entry

Change-Id: Ib886e37a12aba23f4f938a4b5cfa10adb44083af
Reviewed-on: https://gerrit.instructure.com/71727
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
2016-02-11 00:02:03 +00:00
Ethan Vizitei ad75b72c28 make canvas pull secrets from consul, not env vars
closes CNVS-26734

distributing env vars through production is harder
than updating a shared highly available store.  We put this stuff
in consul now so it's easy to update everywhere at once.

also clean up webmock spec usage, it causes a lot of errors
because it's configuration seeps outside the specs it's currently used
in

TEST PLAN:
  1) no production changes (does not touch app code)
  2) clean install, clean config directory
  3) copy docker-compose/config/ files to your config directory
  4) you shouldn't be missing any config files when you start your
     compose file up
  5) Canvas::DynamicSettings.find("canvas") should give you a hash
      with your secrets from the init values in your config file
  6) ServicesJwt.signing_secret and ServicesJwt.encryption secret
      should pull those same values
  7) if you have env vars for ECOSYSTEM_KEY or ECOSYSTEM_SECRET, they
      should be ignored

Change-Id: I3b3c1b19d6e2a05af3e6caa2e0af6c5d1dc6df66
Reviewed-on: https://gerrit.instructure.com/71559
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
2016-02-11 00:01:48 +00:00
Brian Palmer 6de246cb0d limit the data sent to sentry/error_reports
The request body params can be unbounded in size, so if they're too
large, truncate the string.

Change-Id: Icc3a7bc27227f38a05cc5fc67789616cd3c71fd3
Reviewed-on: https://gerrit.instructure.com/71867
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2016-02-10 21:46:23 +00:00
Cody Cutrer d8f3e7cdf8 remove locking_account_id from feature flags
it's never used

keep it in the API response for back-compat reasons

test plan:
 * regression test feature flags; nothing should be broken

Change-Id: I6b023c04148dc6bdb686199d1891e13fcdc8ffa8
Reviewed-on: https://gerrit.instructure.com/70442
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
2016-02-10 21:15:06 +00:00
Michael Nomitch 7dc3c90aaf DA - support student groups
fixes CNVS-22360

Test Plan:
  - create a course with multiple course
    sections, multiple group sets (each with
    many groups), and students in these
  - create an assignment with overrides
    for groups
    - they work as expected
    - adhoc and section overrides continue
      to work as expected
  - ditto for graded discussions
    - check that discussion
      alerts go out properly
    - check that individually graded
      group discussions work as intended
      as well
    - note: child discussions will still
      be made for groups that dont have
      overrides (this is unfortunate
      but known)
  - note: quizzes not included
    in this PS

  - when editing an assignment try to
    assign a due date to a group not
    in the assigned group set
    - you cannot
  - when editing an assignment that
    is not a group assignment
    - confirm that you cannot
      assign a group override

  - if an assignment override for a group
    exists (and nobody else is assigned)
    - check that a student not in that group
      - does not have a spot in the GB
      - gets redirected away from that assignment
        if they go to the show page
      - does not have that assignment factored
        into their individual grade
      - does not have that assignment show
        up on their assignment index
    - if the student is then added to that group
      - all of the above conditions are reversed
    NOTE: if a student has a grade already, they
    will not 'lose visibility' until their grade is
    taken away (so removing a student from a group
    will reverse the above conditions only if they
    are gradeless)

  - check that the calendar accurately
    reflects the due dates for group
    overrides

  - with MGP on
    - test that group overrides act in the
      same way as course_section overrides
      in regards to grading period

Change-Id: Ia32f57feabbc719568901e0763130b3c2304c7ce
Reviewed-on: https://gerrit.instructure.com/69060
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Jason Sparks <jsparks@instructure.com>
2016-02-10 19:20:52 +00:00
Rob Orton 23b9c963d0 add applies_to_self and applies_to_descendants to role api
closes CNVS-23598

test plan
 - set applies_to_self true and false on create
   and update in api
 - set applies_to_descendants true and false on
   create and update in api

Change-Id: I8743c4085010da2982a9aaf380329ea96682e08c
Reviewed-on: https://gerrit.instructure.com/70675
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2016-02-10 17:26:54 +00:00
Michael Nomitch 267cad5787 add scoping overrides by active enrollment
Add scoping overrides by active enrollment to prevent
unenrolled students with overrides from preventing
assignments from saving.

fixes CNVS-21655

test plan:
- Create an assignment
- Assign a due date to a particular student
- Remove that user from the course
- Edit that assignment.
- Assignments override should no longer show.
- Save the assignment should now work.

Change-Id: If08da7119172c7918b15238195e39e07ae75ea16
Reviewed-on: https://gerrit.instructure.com/71305
Tested-by: Jenkins
Reviewed-by: Davis McClellan <dmcclellan@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Jason Sparks <jsparks@instructure.com>
2016-02-10 17:26:46 +00:00
James Williams 6274d438c8 don't count student attachments in graded discussions for quota
test plan:
* create and publish a course with a graded discussion topic
* enroll a student in the course
* as the student, post a reply to the topic and attach a file
* it should not count toward the quota

closes #CNVS-27114

Change-Id: I6fb847a61a7a10a69dc035d5f5e1f15dda107a04
Reviewed-on: https://gerrit.instructure.com/71691
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
2016-02-10 15:39:52 +00:00
Cody Cutrer da57843b6c fix unread conversations count data fixup for qualified table names
refs CNVS-26480

Change-Id: I8567f11ef6eae2bd88f1138d1c2eea640dd678ef
Reviewed-on: https://gerrit.instructure.com/71836
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-02-10 05:19:57 +00:00
Cody Cutrer 4400c7dd1a use modules and super instead of method renaming for time zone attributes
there are already specs that cover the logic of the methods I changed

test plan:
 * change a course and account's time zone
 * it should work

Change-Id: I0780ee1b705e1cf341b7d0fc34aa23b4c9344be6
Reviewed-on: https://gerrit.instructure.com/71418
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-02-09 17:38:07 +00:00
James Williams 2280ee7428 require students to be active to complete requirements
test plan:
* create a future course (but one that isn't restricted)
* create a module with a view requirement for an item
* add a student to the course, they should be able to look around
 but not participate
* confirm that viewing the module item does not fulfill the
 module item requirement

closes #CNVS-26326

Change-Id: Ibe58be1280d377a587e41b45e39ca38168f6093b
Reviewed-on: https://gerrit.instructure.com/71302
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
2016-02-08 18:12:47 +00:00
Stewie (Nicholas Stewart) c324f041c2 Fix user XXX didn’t exist for user enrollment
In order to facilitate better and more efficient debugging, this commit
improves the quality of the error messages reported by SIS imports. When
a user does not exist in users.csv, and enrollments in enrollments.csv
reference that user, the message "User XXX didn't exist for enrollment"
is not particularly useful. This commit adds course and section IDs to
the message to make it easier to search for broken rows.

Test plan:
  * Create or change an existing enrollments.csv file so that it
    references a user that doesn't exist.
  * Run the CSV through the SIS importer.
  * Check the error messages for the last import; the new error message
    should show up instead of the old one.

Change-Id: Ie3ea4d95c6877ef8c5b27cee9d530a6fdf0e6e6e
Fixes: SIS-1733
Reviewed-on: https://gerrit.instructure.com/71116
Tested-by: Jenkins
Reviewed-by: Ken Romney <kromney@instructure.com>
Reviewed-by: Tyler Pickett <tpickett@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Ken Romney <kromney@instructure.com>
2016-02-08 17:50:05 +00:00
Ken Romney 5ad7cd9a56 Improve invalid unique_id message for user imports in
Test Plan:
  Create a user.csv file to import via SIS Imports with a row
  containing an invalid login_id.

  Note that the message is not "unique_id is invalid"

  Note that the message contains contextual login_id and
  sis_id / user_id information

Fixes: SIS-1732

Change-Id: I16f47d57f4dbe2550d979e6f6552d164a8709631
Reviewed-on: https://gerrit.instructure.com/71056
Product-Review: Linda Feng <lfeng@instructure.com>
Tested-by: Jenkins
Reviewed-by: Max Stahl <mstahl@instructure.com>
Reviewed-by: Nick Houle <nhoule@instructure.com>
QA-Review: Kausty Saxena <kausty@instructure.com>
2016-02-06 00:09:09 +00:00