only allow deleting enrollments from course in path

fixes CNVS-11685

test plan
 - delete an enrollment using the api
 - should only allow deleting from the specified course

Change-Id: I5ae0754b0322a2f6fa0817ce15e41a885c88cf2d
Reviewed-on: https://gerrit.instructure.com/31468
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
add unique index to enrollments users per section

index should be unique per user, section, role,
type, and associated_user_id

fixes CNVS-7698
fixes CNVS-7700

test plan
 - add duplicate enrollment in script console
   - run migrations
   - duplicates should be removed
   - attempt to add duplicate enrollment in console
   - duplicate enrollment should fail
 - test user merge with conflicting enrollments
 - test creating, deleting, and restoring enrollments
 - enrollment regression testing

Change-Id: I0fb600ba6ff98054f71dc41a8519680413507494
Reviewed-on: https://gerrit.instructure.com/30986
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
re-add id back to allowed fields for assignment/quiz api results

Test plan:
  - make sure ids show up for "all_dates" in quiz and assignment APIs

Change-Id: I9c3c65c044b9411c18ef018e6305c727be7ff320
Reviewed-on: https://gerrit.instructure.com/31221
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
provide helper method and hooks for lead form updates

refs CNVS-11309

Test Plan
  1. Navigate to '/register'
  2. Click a signup link (teacher, student, parent)
  3. Modal should function without regression

Change-Id: Id409e4b0b8c23b02a334ec9569e13f50869b1086
Reviewed-on: https://gerrit.instructure.com/31253
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
discussions: show availability dates on index page

fixes CNVS-9932

test plan:
  * enable draft state
  * create discussions with variations on Available From and Until
  * open the discussions index page
  * verify that the discussions are listed with status change dates
      as on the assignments and quizzes indexes

Change-Id: Ic8a20ec5cb78087f38e36f5980776e7ae8430e4c
Reviewed-on: https://gerrit.instructure.com/31134
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joel Hough <joel@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
remove publish ui from announcements

fixes CNVS-10882

test plan
- with draftstate on, make a new announcement
- ensure that the edit page does not have a "Not Published" icon
- ensure that the show page does not show a publish button
- ensure that the announcement is immediately visible to students
 if not delay posted
- ensure that the announcement is not visible if delay posted
- ensure that the announcement delay posts properly

Change-Id: I9378c7aece007df04ad7806ee0936a62a6304542
Reviewed-on: https://gerrit.instructure.com/31189
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
compare login id using the db on sis user import

fixes CNVS-11680

test plan
 - import user.csv with a different case than
   existing user's unique_id
 - no import warning errors should be shown

Change-Id: I64a3a84f6874ec88c4f28bc046f80cad9219fc43
Reviewed-on: https://gerrit.instructure.com/31453
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Eric Adams <eadams@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
unbreak db:initial_setup on rails 2

fixes gh-412

Change-Id: Icb9e334214480c20ca4aed0c43111629ab620f35
Reviewed-on: https://gerrit.instructure.com/31497
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
fix respondus endpoint spec for rails 3

calling Marshal.load before the RespondusAPIPort class is
defined seems to cause all its dynamically defined methods
to be run with $SAFE = 4

Change-Id: If6890616354af2bb92893585ddfc325bc69d2a75
Reviewed-on: https://gerrit.instructure.com/31510
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
rails3: fix question_bank selenium specs

Change-Id: I5cabbe9e33cf5a8359c485d3383cdc7be10ff498
Reviewed-on: https://gerrit.instructure.com/31506
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
rails3: remove bad (and unused) url

Change-Id: I2671be06d83d66f4a01a670b398430c0a035a7ed
Reviewed-on: https://gerrit.instructure.com/31507
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
override Quiz#context_module_tags to find both content_types

test plan:
 - have a quiz that was added to a module prior to the
   Quizzes::Quiz refactor
   (or manually update the ContentTag's content_type to 'Quiz')
 - set up a completion requirement (must submit, or must score)
 - verify that a student can complete the requirement

fixes CNVS-11613

Change-Id: I2bb5271e6b263173d98c9df8913044640698e7fb
Reviewed-on: https://gerrit.instructure.com/31424
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
spec: test InstructureMetadata sanitization in qti converter

correlates with qti_migration_tool commit
I7934a036f9f96c83ae013c1881736a2f579c40a3

refs CNVS-11196

Change-Id: I70ce963366414d10277526e6af62ce20141d57fb
Reviewed-on: https://gerrit.instructure.com/30874
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Bracken Mosbacker <bracken@instructure.com>
srgb - group weights affect grade

fixes CNVS-11324

test plan:
  - go to srgb as a teacher
    - before selecting a student, change a group weight
      - should save score properly
    - select a student
      - change assignment group weight
      - final grade should reflect new weights
      - change to new student, final grade should be accurate

Change-Id: I4082aac943b75bdcec58bbaa265bb51a932759f5
Reviewed-on: https://gerrit.instructure.com/30744
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Mike Nomitch <mnomitch@instructure.com>
remove move_question

it's never used; only the move multiple endpoint is

Change-Id: Idf481693e18a2e0531479a47be8733c2e15d1b78
Reviewed-on: https://gerrit.instructure.com/31481
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
fix conditional

Change-Id: Ib8324b9b47efa5d37f39fbb1aa2b7c7acd608b9b
Reviewed-on: https://gerrit.instructure.com/31517
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
pend i18n spec in rails 3

until rails 3 becomes the default, at which point we should regenerate
_core_en.js, and pend it for rails 2

Change-Id: I2956965832545ccd8bca847638c6ca7ed4d5e5bd
Reviewed-on: https://gerrit.instructure.com/31515
Reviewed-by: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
bump folio for rails 3

Change-Id: I56bec77c83b3ec7bb2af425a684caf8d281b6a8e
Reviewed-on: https://gerrit.instructure.com/31476
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
fix a submissions api spec for rails 3

rails 3 includes 'id': null in the json; rails 2 does not.
I don't consider this a breaking changing (and if it is, it's
rails 2 that's broken)

Change-Id: I2b28ad794ac71d9bd6464323635b54cdc9f0ca4a
Reviewed-on: https://gerrit.instructure.com/31474
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
don't taint classes when unmarshalling from memory_cache in rails 3

fixes the underlying problem for g/31510

Change-Id: Ic7b9f050c54436a8204a2771bf1bc7c04ef89d15
Reviewed-on: https://gerrit.instructure.com/31525
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>