fix announcements for logged out users in public courses

fixes CNVS-6133

test plan:
- in a public course, make an announcement
- view it as a logged out user
- it should work

Change-Id: Ic887760066b58745e2d541194a72da6874b69bcc
Reviewed-on: https://gerrit.instructure.com/21134
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Allow users to resurrect a retired email, closes #CNVS-6045

Really resurrect retired communication channels.
Fixes some callbacks that should've returned true.

test plan:
1) in rails console:
    u = User.find(<some user id>)
    cc = u.communication_channels.detect{|cc| cc.path_type == 'email'}
    cc.bounce_count = 5
    cc.workflow_state = 'retired'
    cc.save
2) take note of the email on the cc
3) start up the server and go to /about/<user id>
4) click 'Add Email Address' and enter the email noted in #2
5) it should be successful

Change-Id: I0b4572545859eacd823a46b326303860069b00f1
Reviewed-on: https://gerrit.instructure.com/21102
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
assignment groups API

fixes CNVS-6064

test plan
- using the API, create, get, and update an assignment group
- using the API, delete an assignment group with and without assignments
and both specify an assignment group to move the assignments to
and don't specify an assignment group
- it should throw an error if there are no other active assignment groups

Change-Id: I0d637d73255115258dc42e73541146c889a68afc
Reviewed-on: https://gerrit.instructure.com/20993
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
spec: conversation_context_filtering pending

Change-Id: I45c2808ba959940d8b825fe20c492e58a76ffb33
Reviewed-on: https://gerrit.instructure.com/21139
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
Change edu-apps linke to point to www.edu-apps.org

fixes #CNVS-6158

Change-Id: I6736e5891f1eb3432755fb43311e50d22e0d1afa
Reviewed-on: https://gerrit.instructure.com/21160
Reviewed-by: Eric Berry <ericb@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
add group category index to groups

the association isn't smart enough to include conditions on
context_type and context_id in order to utilize the existing index

Change-Id: I62bef79de1b729c6717dadced9a122e856832504
Reviewed-on: https://gerrit.instructure.com/21162
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
fix lengthen submissions attachment_id migration

closes CNVS-6155

test plan:
- make sure you can upload files for a submission

Change-Id: Id3043682a0784bc5064c8fda1ba09329facea4e5
Reviewed-on: https://gerrit.instructure.com/21154
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
optimize stream item deletion

add an index on updated_at, and effectively use it

Change-Id: I0830a9c6089ba21f0b79a83e36fd0fe8e0d08348
Reviewed-on: https://gerrit.instructure.com/21165
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
remove fixture from remoteselect spec.

also call server.restore() on fakeServer.

Change-Id: Ic1728adcdb7ac4b8b7f5f81311b8267ed0b84cfe
Reviewed-on: https://gerrit.instructure.com/21130
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
QA-Review: Zach Pendleton <zachp@instructure.com>
do not fetch BBB recordings if conference has not started

fixes CNVS-6129

test plan:
 - configure BBB plugin with an account with existing recordings
 - create a new BBB conference
 - start the console, find the new conference, and call the
   recordings method.
   - should return an empty array.
 - should still return the recordings for concluded conferences
   with recordings.

Change-Id: I47534aa77616858ae5fdc47aefe9792cd1552376
Reviewed-on: https://gerrit.instructure.com/21109
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
finish removing course.publish_grades_immediately

this was removed from the UI in Mar 2011 but was never completely ripped out.
we'd like to remove it now since it was adding extra complexity for no benefit.

closes CNVS-5929
refs #3974

test plan:
- create/update/delete an assignment from the index page, and the show page
- grade an assignment (with and without muting)
- test assignment notifications (with and without muting)
  - creating an assignment
  - editing an assignment
  - changing a due date (after 3 hours of being edited)
  - grading an assignment

Change-Id: Ie455bed41154018b5bd2c9c0e69e1e3285a0ac09
Reviewed-on: https://gerrit.instructure.com/20778
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Extract Assignment Broadcast Policy

FIXES CNVS-6037

moving the complicated conditions for the
broadcast policy into it's own class and
adding some isolation tests.

TEST PLAN:
  This is just a refactor, there should be
no new behavior.  Doing a regression of
notifications dispatched from assignments
should be all that's needed.

Change-Id: Ie8bc424d7ad02ed579e31df4d024ba998c7160b2
Reviewed-on: https://gerrit.instructure.com/20908
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
fix user filtering for cross-shard conversations or without sharding

test plan:
 * without sharding, filter conversations by user; it should work
 * with sharding:
   * create a conversation between users on the same shard
   * from another shard, create a conversation with one of the
     users from the first shard
   * from the first shard, search for the conversation with
     the user from the other shard
   * it should work

Change-Id: I92b67f5974af96daf952d95e14c4350bd4225d07
Reviewed-on: https://gerrit.instructure.com/21155
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
use sass for jammit css compression, no more java!

jammit can use sass to minify css.  this is great
because now we don't need the yui-compressor.
which means that we don't need java.

Change-Id: I22d0f35340077a866ffe1000443bc5a061a9e613
Reviewed-on: https://gerrit.instructure.com/11588
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
added the ability for users to review app center apps

test steps:
- enable the app center with a valid access token
- visit the app center under account settings
- click on a tool and ensure the reviews appear in the list at the
  bottom
- click the link 'Rate this tool' and add a review
- ensure that the review list reloads

** note: you will not see the actual app star rating or review
count change when you add/modify a review. this is expected behavior.

Change-Id: I79ab0769f56b3a17b6eb2056de1416eb1a0a71ca
Reviewed-on: https://gerrit.instructure.com/21054
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
remove openobject from turnitin

Replaces OpenObject with a struct in order to gain performance.

test plan:
  - as a site admin, go to the account settings page
  - under the Turnitin settings, set it up with valid turnitin settings
  - make sure the turnitin confirmation link works

Change-Id: Ie71cc2faf8c34c3c43de66b133058c7781c4e86b
Reviewed-on: https://gerrit.instructure.com/16483
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
add data-api-endpoint for external tool launch links

test plan:
 - in rich text somewhere (wiki page, assignment, etc.),
   embed a link to launch an LTI tool.
   a suitable test tool can be found at
   http://lti-tool-provider.herokuapp.com
 - retrieve that text through the appropriate API
   (pages, assignments, etc.)
 - the link should have added data-api-return-type
   (SessionlessLaunchUrl) and data-api-endpoint attributes.
 - the data-api-endpoint should contain a link to the
   generate-sessionless-launch API. hit this link with
   curl or postman or whatever (authenticating with your
   token as is normal for API requests)
 - the above API should return a URL with a big scary
   verifier in it.  (you should be able to launch *that*
   URL to get into the LTI tool without a Canvas session)

fixes CNVS-5944

Change-Id: I2e51312341b08f87ff2be7bee57370318be72b65
Reviewed-on: https://gerrit.instructure.com/21075
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
add data-api-endpoint for quiz / quiz list links

test plan:
 - have a course with a quiz
 - in rich content (like a wiki page), use the wiki sidebar
   to insert a link to the quiz list and a link to the quiz
 - retrieve the wiki page via the pages API
 - the quiz list link should have added attributes
   * data-api-returntype="[Quiz]" (with brackets)
   * data-api-endpoint: valid API link to the quiz index
 - the quiz link should have added attributes
   * data-api-returntype="Quiz"
   * data-api-endpoint: valid API link to the quiz
 - the API documentation should mention "Quiz" in the list
   of supported data-api-returntype values, found in the
   "Basics" section under "API Endpoint Attributes"

fixes CNVS-6115

Change-Id: If405f6779f1b3f3719503a9987cceaf29a508ed8
Reviewed-on: https://gerrit.instructure.com/21080
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
redesign discussions index page. fixes CNVS-5709

index page now displays topics in two groups: open and
locked. all discussions also now load lazily.

test plan:
  * navigate to a course's discussion topics page and
    verify that all current topics load and display
    in the appropriate group;
  * as a teacher or admin, verify that the lock/delete
    gear menu options work as expected;
  * in a course with more than 50 topics, verify that
    the topics load/display lazily.
  * as a student, verify that the discussion gear menu
    only appears on discussions that you've created.

Change-Id: I24cb256da7a552d0c137cd9522e758617f8d1b8e
Reviewed-on: https://gerrit.instructure.com/21095
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
only strand quiz_stats jobs per quiz

fixes CNVS-6175

test plan:
- submit a quiz, and then generate stats for it
- it should work

Change-Id: I07d6ca8eaa7c05cef45cea5539ba899697a627d4
Reviewed-on: https://gerrit.instructure.com/21208
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>