fix intermittent spec failure

... i think

Change-Id: If872327a311def6896d9df1ab2afebee6b37659e
Reviewed-on: https://gerrit.instructure.com/9166
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
include concluded enrollments in interaction report; fixes #7024

allow admins to view interaction reports on concluded courses, and include
concluded enrollments in the interaction reports.

test-plan:
- create a course with a concluded student
- should be able to view interaction reports from course user page
- conclude the course
- as an admin, should be able to view teacher activity report for teacher.

Change-Id: I8722ca86a5836da03994db31e5c7753a86516824
Reviewed-on: https://gerrit.instructure.com/9107
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
increase height of swf files on module pages. fixes #5991

change hard height of 500px for swf files to a 600px min height
and change height to 80% of the container to allow larger browser
windows to display larger swf files.

all of this is to hopefully avoid or delay having to determine the
height and width of swf files on upload (because we'd have to read
the swf into memory and store it somewhere and it's nasty).

Change-Id: I6686dd7291e659599e8a84720e1c2717ab60afab
Reviewed-on: https://gerrit.instructure.com/9152
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
loosen spec that didn't play nice with plugins

test-plan: run the spec

Change-Id: I56b7036a81e2f5e8bb566da822fabb3841d4a1f6
Reviewed-on: https://gerrit.instructure.com/9173
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
correctly update quiz submisison when changing grade in gradebook

Before only the Submission was being updated and not the
QuizSubmission. Now the fudge points on the current QS are
updated to reflect the score set in the gradebook.

This prevented modules from progressing if the value was
changed in the gradebook.

Because the score set there should be the absolute score,
if the quiz is set to take the highest a flag is set to
prevent a previously-higher score from being the kept_score

Test Plan:
 * Create a quiz with a question with 5 points and publish it
 * Create a module item to to that quiz that needs 10 points to complete
 * Take the quiz as a student, the module should not unlock
 * As the teacher set the grade to 11 in the gradebook
 * The module item should be unlocked for the student

closes #7331 #4174

Change-Id: I30d92bfe865584b5b526cda36ef336348a647de4
Reviewed-on: https://gerrit.instructure.com/9091
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
don't include api urls in hrefs for hiding todo items

test plan:
 * Ensure you can still hide todo items from your dashboard. (There is also an
   existing selenium spec).

Change-Id: Idef5ec52c90d52c8a586f610c167a8cddfe54bbf
Reviewed-on: https://gerrit.instructure.com/9178
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
do gradebook upload diffing server side

close #6088, fixes #7244

test plan:
 * upload a gradebook with no changes; should show no changes
 * upload a gradebook changing a single score; should only show
   the assignment with the score that changed
 * upload a gradebook with a new assignment; that assignment should
   show
 * upload a gradebook with a changed assignment name, but no score
   changes; should show no changes
 * upload a gradebook with a changed assignment name, and one score
   change; should show assignment
 * upload a gradebook with a name changed, and ids nulled out; once
   matched with the correct user, it should show no changes
 * upload a gradebook with a name changed, and ids nulled out, with
   one score changed; once matched with the correct user, it should
   show only the assignment with the changed score
 * in a course with > 100 students, upload a gradebook with a new
   assignment; it should upload correctly, and only create a single
   new assignment

Change-Id: Id8167a106c302b486c9f5043693975b2d413cc3a
Reviewed-on: https://gerrit.instructure.com/7372
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
require -> define in public/javascripts

Change-Id: I66f37744c278fac29fcf6f8e85326c84512da468
Reviewed-on: https://gerrit.instructure.com/9174
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
step up transition warning to red

refs #7166

test plan:
 * create user in a non-default account
 * login at the default account with that user
 * should get a red flash telling you to log in at the correct place

Change-Id: I80805b5a08a96b67bc1193a4961aaf90c110eca9
Reviewed-on: https://gerrit.instructure.com/9181
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
upgraded mathquill, fixes #7391, refs #6462, #6858

latest mathquill:
 1. fixes copy/paste oddity
 2. reverts broken \left / \right / bracket behavior
 3. implements more commands
 4. various other fixes/features (refer to
    https://github.com/laughinghan/mathquill git history)

test plan:
 1. paste latex into the equation editor (within the subset mathquill
    supports) and confirm that it renders correctly and creates a valid
    codecogs image after you save
 2. type and click buttons in the equation editor and confirm that it
    renders correctly and creates a valid codecogs image after you save
 3. ensure you can still edit previously inserted equations

Change-Id: Ia7a771ec24f3ec691ee313ff359a9f302a462633
Reviewed-on: https://gerrit.instructure.com/9099
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
cache notifications in memory

test plan:
* use canvas and ensure that notifications work

Change-Id: Ie46f049aab5dde7167c3ea4228e503c7a686c839
Reviewed-on: https://gerrit.instructure.com/9154
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
add a hidden_dialog helper to handle dialogs that we only want one of on a page

There are several places where we want to add a hidden <div> that will later
be used as a dialog. Normally that div would have an id, and would be
displayed using the id. Where to place the div is a problem in cases where the
dialog might be invoked from several different places - we only want one and
only want copy of the div on the page.

This helper will let you specify content for a hidden div and an id, and will
only place one instance on the page. That means you can specify the div close
to a help button that might invoke it, and you don't have to worry about if
it's added twice.

The helper will raise a warning if you try to add a div with an id matching an
existing one, but with different content.

The other change is fixing some bad indentation in _full_assignment.html.erb
which led to somebody adding an extra </div> while trying to add another
instance of a dialog div.

Change-Id: If91428db89f92f890ea5917028331040d12741a6
Reviewed-on: https://gerrit.instructure.com/9138
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
reorder questions in quizzes with drag and drop

fixes #7310

jQueryUI .sortable change event fires before stop,
moved change logic to the stop handler so the dom
is completely updated before sending data back to
the server.

also, we weren't sorting properly on page load
within question groups (even though we were
updating the database properly)

test plan:
1. create a quiz with two questions and one group
2. reorder the items, refresh page, verify order
3. nest questions into the group, refresh, verify
   order
4. reorder items in the group, refresh, verify
5. move one question out of the group, refresh,
   verify

Change-Id: I5624c4ed24c20d3109d4ce1252b048ea9b635e21
Reviewed-on: https://gerrit.instructure.com/9151
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
fix workflow_state filter in enrollments api. fixes #7548

affects: enrollments_api

test plan:
  * create a course and a user;
  * enroll user in course and then complete the enrollment;
  * make an api call to return completed enrollments for the course
    and verify that the enrollment is returned;
  * make an api call to return completed enrollments for the user
    and verify that the enrollment is returned.

Change-Id: I7d13cf52a526d1639cc3ed16585bd930cb5b4e12
Reviewed-on: https://gerrit.instructure.com/9156
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
hide content until scripts are loaded

Because RequireJS loads scripts asynchronously the
page renders but the JS hasn't been evaluated. In this
commit we hide all <a> and <button> tags until all
resources are loaded.

Previously the script tags blocked the page from
rendering while they loaded and executed.

When we have a single top-level require we can
remove this logic from the layout, and do it there
without all the polling fanfare.

Change-Id: I13771caf588508bacc6a70e4609c4af03bf522cd
Reviewed-on: https://gerrit.instructure.com/9191
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
run UseAssetUserAccessLastAccess as a delayed job

this table, it is large

test plan: run the migration, verify a job is just created. run the job,
verify it updates null last_access rows as expected.

Change-Id: Id134d6795c8eef76181c20f5e3c0920dd51dda21
Reviewed-on: https://gerrit.instructure.com/9192
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
remove some database columns from long ago

Change-Id: I8340310cb5a4ede0097e92bd1d3691644c3d460c
Reviewed-on: https://gerrit.instructure.com/9196
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
fix public course home page fixes #7589

test plan:
 * create a public course, publish it, create an assignment
 * go to the course without logging in
 * it should not give a page error

Change-Id: I075acf19e196ef5de9eebdc1218c6d1b82c9ba5d
Reviewed-on: https://gerrit.instructure.com/9219
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
ensure conversations with deleted users load correctly

fixes regression from #7471

test plan:
1. start a conversation with another one or more users
2. delete one of the users
3. ensure the conversation still loads (you should see all participants
   and messages)

Change-Id: Ic0e567f22010864054f7396553b43173110be317
Reviewed-on: https://gerrit.instructure.com/9211
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
load account javascript ourselves

Change-Id: Ifeae50a64035edecf81a5f97eee13c2f64cbdb65
Reviewed-on: https://gerrit.instructure.com/9220
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>