remove old roles

refs #CNVS-15481

Change-Id: Ibde582cd21cdd260736dc360857c3eb9464cc126
remove draft state switches

refs #CNVS-15563

Change-Id: I95d41f7b215d72570d3abd451e9dd06b6318c8f1
Reviewed-on: https://gerrit.instructure.com/43728
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
spec: require mocha_spec_adapter when using mocha

fixes CNVS-16772

Change-Id: I0b943760a2e154986ac317c3d292a02bd888dbba
Reviewed-on: https://gerrit.instructure.com/44096
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
optimize analytics course tardiness breakdowns

fixes CNVS-16621

* simplify looping over assignments and students. doesn't change the
  big-O; O(MN) is required and the previous code was in that class. but
  the insides of the loops are more efficient

* prepopulate the assignment association on each (fake) submission. old
  code went to the database for each submission's assignment (whoops)

* don't instantiate actual Submission objects. instead, use
  good-enough-but-cheaper FakeSubmission objects

* also, use pluck instead of instantiation User objects in the
  student_ids method

overall, in a particular problem course with 1800+ students and 66k+
submissions, the run time of the tardiness_breakdowns method, given all
caches empty, drops from 20 minutes to 30 seconds.

test-plan:
 - regression test on the student summaries on the course analytics
   page. should not have any functional changes, but should be much
   faster, especially in large courses

Change-Id: I754721cb2bf0e0bba345d6bba9baf422d78f167b
Reviewed-on: https://gerrit.instructure.com/43964
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
Modifies participations binning to be by hour rather than day

fixes CNVS-16464

Test Plan:
  - Enable analytics plugin
  - Enable analytics ont the account
  - Go to analytics for a student
  - Page Views and Participations should match up in the graph

Change-Id: Ia6fd8fdcc98bceef8e10617363c59240d1bc17d1
Reviewed-on: https://gerrit.instructure.com/44111
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Dan Minkevitch <dan@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
make our redis usage twemproxy compatible

closes CNVS-17062

Basically this means no more transactions, since twemproxy doesn't
support MULTI, use Lua EVAL instead.

We're using the same key (page_views_rollup_keys_set_key) to determine
which node in the ring to hit, which is what the previous code was doing
too, so this will be backwards compatible as far as where the data
lives.

I also had to modify the strategy a bit, to get all the members of the
set up front and iterate over them in ruby. This is necessary because
redis doesn't allow lua scripts to call the SPOP command, since it's
non-deterministic. These sets don't grow extremely large, a few thousand
elements is the largest I've found, so this should be acceptable.

test plan: there should be no change in behavior. With redis page view
rollups enabled, rollups should still get inserted into redis and then
collected into the database in a periodic job, and be viewable in course
analytics.

Change-Id: I57487021f2d56b3f6acff3d7b3a5822ae4f09b47
Reviewed-on: https://gerrit.instructure.com/44764
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
remove test student from assignment stats

fixes CNVS-15320

test plan:
  - give a test student the highest grade for an assignment
  - as a teacher go to analytics page
    - things load okay
    - the high score is not the test students
  - the test student's page loads okay

Change-Id: Ifa2e2548783cf5d8c4dec3777be28d4a73ad899a
Reviewed-on: https://gerrit.instructure.com/45490
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Sean Lewis <slewis@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>