anchored plugin assets

Change-Id: Id7e1a8509b42b5b678e7d23a7dde1d06ed1f2e89
Reviewed-on: https://gerrit.instructure.com/9724
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
hide "add reply to topic" for closed discussions

Change-Id: Ibef1c208d02a91750301b86cd9a1ad691948ce16
Reviewed-on: https://gerrit.instructure.com/9750
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
fix posting to post-first discussions

We were trying to act on an element not on the page. This adds a check for
that and a spec.

test plan:
 * Create a "post first" discussion.
 * As a student, attempt to load it and post to it.
 * It should work.

Change-Id: I68459145ff740562fe07eb71080401981c2285d2
Reviewed-on: https://gerrit.instructure.com/9758
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
fix showing discussion entries without users; fixes #7976

Apparently there are some cases where this can happen, so it needs to be
handled.

test plan:
 * Create a topic with some entries
 * In console, set the user_id of some of those entries to nil
 * Ensure you can still load the topic (and it says Unknown Author for the
   ones with user_id = nil)

Change-Id: Idbcd82204d8b936d5d50af5ff6e5dd338bbba87a
Reviewed-on: https://gerrit.instructure.com/9762
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
update the topic materialized view after the entry save transaction commits

Fixes a race condition where the view might get generated by the job
without the new entry.

test plan: this is difficult to duplicate by hand, but you could put a
breakpoint in and verify the job doesn't get inserted before the
transaction commits.

Change-Id: I6c373553dfae409adab25dd9e3bafc7126169231
Reviewed-on: https://gerrit.instructure.com/9710
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
always search for deprecated api key usage on the default shard

also search for the default developer key on the default shard

refs #7788

test plan:
 * create an api key (on the default shard)
 * access the api on a non-default shard
 * it should still work
 * create an oauth token in the UI on a different
   shard
 * it should work, and reference a key on the default shard

Change-Id: I8c8aa36ab38f45ba9af2422a42552faeff28ac73
Reviewed-on: https://gerrit.instructure.com/9492
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
use ids relative to the default shard for strands refs #6886

test plan:
 * run existing specs

Change-Id: I3b84b15be828975e1c60f976232e3984ccd95a61
Reviewed-on: https://gerrit.instructure.com/9670
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
show the quiz question title on the quiz statistics page

question data should use the :question_name key for question
names, so that key should be used when showing the title.

Test Plan:
 * Import a quiz from a QTI package
 * Take the quiz and view the statistics page
 * The title should be there.

closes #7065

Change-Id: I39a650cf0f0aa8a8534a0158d6b073dc261c87c3
Reviewed-on: https://gerrit.instructure.com/9738
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
add public_description to course model. fixes #7761

affects: course model, api
test plan:
  * add a course with the api, included a public description;
  * verify that public description field is returned and
    exists on the course in the db.

Change-Id: If2766cf7ba946af5cb8a5cafebaa8209754ec2b3
Reviewed-on: https://gerrit.instructure.com/9723
Tested-by: Cody Cutrer <cody@instructure.com>
Tested-by: Zach Wily <zach@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
strip html from .ics descriptions, fixes #7365

for both calendar events and assignments

test plan: create a calendar event and an assignment with rich text
descriptions. download the .ics for the course, verify that you don't
get html tags in the descriptions in ical, outlook, etc

Change-Id: I1d69e2a9338fdc3d8c9228b7e6cb70d58614bdac
Reviewed-on: https://gerrit.instructure.com/9666
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
fix selecting a login when a single user is found fixes #7900

Change-Id: Iee82fd5bdad1d840c2978f4f7ee196ce1c24df9b
Reviewed-on: https://gerrit.instructure.com/9673
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
exclude soft concluded courses from dropdown fixes #7536

test plan
 * create a course that has ended
 * that course should not be in the dropdown
 * other courses should be in drop down
 * old course should be in pst enrollments

Change-Id: Ibf31fe72125eb05fff42dd6d8fbe123f6b6368f6
Reviewed-on: https://gerrit.instructure.com/9448
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
max width on avatar pics

Avatar pictures had an explicit height, but
the width could be whatever. Setting the max-width
will help keep it horizontally bounded for
layout purposes.

test plan:
- pick an avatar image that is really wide
- go to a discussion where you have posted
- make sure the avatar picture is not wider than 50px

Change-Id: I1a3d26bf28f70cb6948010f096c8b940f0a0ca26
Reviewed-on: https://gerrit.instructure.com/9022
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
faster bulk message sending, refs #7277

various tweaks to speed up bulk message sending (~75% backend runtime
reduction, for both current and stale caches. ~55% frontend runtime
reduction. ymmv). highlights:

1. lots of preloading. some vanilla rails stuff, more hand-rolled.
2. conversation model hooks to reuse existing ruby objects if requested
   (e.g. c.conversation_participants[0].conversation.equal?(c)
   when done in a ModelCache.cache block).
3. more (and better) caching. some User# methods are now cached up to a
   day (or until the user is touched).
4. various model tweaks to reduce redundant or unnecessary queries.
5. don't animate existing private conversations after the response
   comes back. for bulk private messages going out to tons of existing
   conversations, this would peg the client CPU and cause sadness.
6. defer delayed job creation

test plan:
1. run rails in production mode (so stream items and notifications
   happen in delayed jobs, otherwise it's going to be *really* slow)
2. confirm that sending a bulk private message to a lot of people (e.g.
   500) is faster
3. also confirm that nothing is broken :)

Change-Id: I92094f27ac51094a8047cb67f2cbb680a1839779
Reviewed-on: https://gerrit.instructure.com/9157
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
fix multiple selection qti question

Some multiple select questions weren't getting the correct
answers set, this fixes that.

It also tests questions that don't have a response condition.

Test Plan:
 * Import a QTI question with no response condition
 * the import should not fail

closes #6612

Change-Id: Ie43b4f9bcfe06be2f86f4eecc3d2e30d9b69ed34
Reviewed-on: https://gerrit.instructure.com/9747
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
don't break when "take quiz" is double-clicked

fixes #7380

test plan:
1. click "take quiz" as fast as you can
2. observe the next page isn't broken

Change-Id: I1dae0414e0db6bc4972f97e6cb56abca347433d1
Reviewed-on: https://gerrit.instructure.com/9735
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
calendar2: fix 'more options' links

fixes #7959

Test plan:
  *  Use firefox
  1. On calendar2, click on a day to create an event.
  2. Click the 'more options' link
  3. Make sure it takes you to the new calendar event page
  4. Repeat steps 1-3 but for assignments
  5. Repeat steps 1-4 for the existing events/assignments

Change-Id: I22eb38b5c3b0ec90815b78cca15452846662f788
Reviewed-on: https://gerrit.instructure.com/9752
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
make appointment event edit dialog less ugly

fixes #7430

Test-plan:
  - create an appointment group
  - click on one of the appointment group calendar events
  - confirm that your eyes aren't bleeding

Change-Id: Ie22bc1a190d2b202a926d1c7c76245bf6e56d478
Reviewed-on: https://gerrit.instructure.com/9445
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
spec: detect when ajax requests will never time out due to a js error

When there is a js error during ajax response handling, the ajaxStop event
never fires. This causes wait_for_ajax_requests to wait until the script
timeout, which appears to kill the selenium thread. This catches the timeout
in javascript before the script timeout fires, and raises an exception to give
a clue about what happened.

Change-Id: I51e0de43e548e1af5a5ca2dfd793878fb3026b9f
Reviewed-on: https://gerrit.instructure.com/9761
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
see file/folder name on hover, fixes: #7770

test plan:
* in files page, add a folder and a file with really
  a really long name, use big words with no spaces,
  so they can't just wrap on whitespace.
* make sure a tooltip pops up when you hover over them
  in the left side.

Change-Id: I201c2da8c263d9cf511055dac5d2c5d786ce11ce
Reviewed-on: https://gerrit.instructure.com/9606
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>