update moodle2cc gem version

Change-Id: I6104e55085bc27fb7151fc33c317f4134ae60947
Reviewed-on: https://gerrit.instructure.com/12730
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
learning outcomes refactor

This list is *NOT* complete, some items may have snuck in that I forgot
to note, and/or some of the noted items may not be completely functional
yet.

Specs need to be written around a lot of this, other specs will no doubt
need to be fixed.

Some things, particularly around LearningOutcomeGroups will need data
migrations that aren't there yet.

 * remove LearningOutcome.non_rubric_outcomes? and replace with false
   where invoked
 * remove LearningOutcome.enabled? and replace with true where invoked
 * remove never-taken branches
 * remove the shared/aligned_outcomes partial and it's supporting
   javascript, since it's now empty
 * remove js handler for add_outcome_alignment_link and supporting
   method since it only occurred in never-taken branches
 * mix LearningOutcomeContext into Course and Account
 * replace LearningOutcomeGroup.default_for(context) with
   LearningOutcomeContext#root_outcome_group
 * rename LearningOutcome#content_tags to LearningOutcome#alignments
 * rename LearningOutcomeGroup#content_tags to
   LearningOutcomeGroup#child_links, and properly restrict
 * remove ContentTag[Alignment]#rubric_association_id, add
   ContentTag[Alignment]#has_rubric_association? that looks at the
   presence of the content's rubric_association_id
 * condition off the assignment having a rubric_association rather than
   filtering tags by has_rubric_association (which just looks back at
   the assignment). all or none of the assignment's alignments are
   forced to have the association (via the assignment). this was true in
   practice before, is now codified (and more efficient)
 * rename AssessmentQuestionBank#learning_outcome_tags to
   AssessmentQuestionBank#learning_outcome_alignments
 * rename Assignment#learning_outcome_tags to
   Assignment#learning_outcome_alignments
 * rename Rubric#learning_outcome_tags to
   Rubric#learning_outcome_alignments
 * move/rename (Course|Account)#learning_outcome_tags to
   LearningOutcomeContext#learning_outcome_links
 * move/rename Account#learning_outcomes (corrected) and
   Course#learning_outcomes to
   LearningOutcomeContext#linked_learning_outcomes
 * move/rename Account#created_learning_outcomes and
   Course#created_learning_outcomes to
   LearningOutcomeContext#created_learning_outcomes
 * clarify and correct usage of linked_learning_outcomes vs.
   created_learning_outcomes
 * move/rename (Account|Account)#learning_outcome_groups to
   LearningOutcomeContext#learning_outcome_groups
 * remove unused Account#associated_learning_outcomes
 * just remove one link to a learning outcome when deleting
 * merge Account#has_outcomes?, Course#has_outcomes? and
   Course#has_outcomes into LearningOutcomeContext#has_outcomes?, add a
   use in Context#active_record_types
 * kill LearningOutcomeGroup#root_learning_outcome_group (unused)
 * rename LearningOutcomeResult#content_tag to
   LearningOutcomeResult#alignment
 * kill unused (and broken) OutcomesController#add_outcome_group
 * kill unused OutcomesController#update_outcomes_for_asset
 * kill unused OutcomesController#outcomes_for_asset
 * remove unused (outside specs, correct specs)
   AssessmentQuestionBank#outcomes=
 * remove unused ContentTag#learning_outcome_content
 * replace ContentTag.learning_outcome_tags_for(asset) (only ever called
   with asset=an assignment) with call to
   Assignment#learning_outcome_alignments
 * remove unused ContentTag.not_rubric
 * remove (now) unused ContentTag.include_outcome
 * remove unused LearningOutcome#learning_outcome_group_associations
 * avoid explicit use of ContentTag in outcome-related specs
 * replace LearningOutcomeGroup#learning_outcome_tags with
   LearningOutcomeGroup#child_outcome_links (and only use for outcome
   links; not tags for child groups)
 * split ContentTag#create_outcome_result into
   Submission#create_outcome_result,
   QuizSubmission#create_outcome_result, and
   RubricAssessment#create_outcome_result. fix some bugs along the way
 * refactor ContentTag.outcome_tags_for_banks and some code from
   QuizSubmission#(track_outcomes|update_outcomes_for_assessment_questions)
   into QuizSubmission#questions_and_alignments
 * refactor RubricAssociation#update_outcome_relations and
   Rubric#update_alignments into LearningOutcome.update_alignments
 * don't use ContentTag#rubric_association with outcome alignments; use
   the tag's content's rubric_association in its place (they should have
   been equal anyways)
 * refactor LearningOutcome.available_in_context and
   @context.root_outcome_group.sorted_all_outcomes (only time
   sorted_all_outcomes is used) into
   LearningOutcomeContext#available_outcomes and
   LearningOutcomeContext#available_outcome
 * overhaul LearningOutcomeGroup#sorted_content and rename to
   LearningOutcomeGroup#sorted_children. it not returns ContentTags
   (outcome links) and LearningOutcomeGroups, vs. LearningOutcomes and
   LearningOutcomeGroups; fix usages appropriately
 * fix UI for arranging/deleting outcome links and groups within a group
   to refer to the outcome link rather than the outcome

Change-Id: I85d99f2634f7206332cb1f5d5ea575b428988d4b
Reviewed-on: https://gerrit.instructure.com/12590
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jacob Fugal <jacob@instructure.com>
export/import and copy new outcome functionality

Change-Id: Id3b056dc527af48b08a514e309b7654da95b3829
Reviewed-on: https://gerrit.instructure.com/12705
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jacob Fugal <jacob@instructure.com>
fix broken sass

older versions of sass would silently ignore the invalid & here. this is
actually how we want it to behave, since the li is inside the
.view_switcher

for the rubrics one, there is no hover element, so the generated sass is
equivalent

test plan:
1. run bundle update
2. it should work
3. go to a discussion topic
4. the icons in the view switcher ("Expand Unread", etc.) should be
   correctly aligned

Change-Id: I418d902f124f754f000f4dd19df8875ea60b3d77
Reviewed-on: https://gerrit.instructure.com/12877
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Reviewed-on: https://gerrit.instructure.com/13088
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jacob Fugal <jacob@instructure.com>
refactor jobs admin functionality to not use AR queries

A set of class functions were added to Delayed::Backend::ActiveRecord
for all the querying a updating functionality that the jobs admin needs,
so that no direct ActiveRecord queries are needed. The /jobs UI is
refactored to use these new functions.

There are a few differences in behavior: The search isn't a combined
wildcard search anymore. Instead, new "flavors" were added to the
drop-down for strand, tag, and ID. The search box searches only the
selected attribute, and it's exact match now.

Specs are being updated to use these new functions as well. Eventually,
no direct AR queries will be done against Jobs anywhere, so that non-AR
jobs backends are possible.

Also as part of this, all jobs require a queue now. Passing nil for the
queue will use the default of Delayed::Worker.queue.

test plan: Load /jobs, and verify that it works as before except where
there are differences as described above.
  * Selecting flavors of jobs lists only those jobs.
  * Searching by ID, strand or tag works.
  * The hold/unhold/delete actions work in the various combinations of
    filtering/searching.
  * Linking to an individual job still works (though the query string
    has changed so old links don't work)
  * Running jobs and list of popular tags still works as expected.

Change-Id: Iffd5b8c7b3d6e4b128792a9dee7b97c6dfb251dc
Reviewed-on: https://gerrit.instructure.com/12632
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Reviewed-on: https://gerrit.instructure.com/13089
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jacob Fugal <jacob@instructure.com>
fixup failing specs and add temporary plugin shims

the shims will be removed in a later commit. that commit will need to
wait for the plugins to be fixed before it can be submitted.

test-plan:
 - specs pass

Change-Id: Ifd6e2a254f0272a58d507c845cdae58b7392801c
Reviewed-on: https://gerrit.instructure.com/12798
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Merge branch 'master' into dev/learning_outcome_refactor

Conflicts:
	public/javascripts/aligned_outcomes.js
	spec/apis/v1/collections_spec.rb
	vendor/plugins/moodle2cc/Gemfile

Change-Id: I2ea31263e4367dd456d12d2d53a297f3c25c9a5b
Outcome API

Change-Id: I6c33d2ab364522930b908d8edd162b20634e54b5
Reviewed-on: https://gerrit.instructure.com/12762
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Merge branch 'master' into dev/learning_outcome_refactor

Change-Id: I48090d9965442b56eb4d73cbca91dfbf7c18517a
create framework for importing standards from a vendor

This adds a migration tool that can import standards from
academic benchmarks, either by giving it a file, or by
using their API.

Test Plan:
 * Run a migration for a specific authority
 * It should import into the global group happily

refs #9866

Change-Id: If654681d60848e1233475f737dc2fadecacdbd98
Reviewed-on: https://gerrit.instructure.com/13421
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
allow sis term parameters fixes #11070

Change-Id: I1b224f99a437b0dec076921cfa78469b18455224
Reviewed-on: https://gerrit.instructure.com/14397
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
VDD: assignment override data structures

refs #10831

test-plan:
  - run specs. this is all infrastructure, no real separate test plan.

Change-Id: Ic67f574b7e4cbffd114f6ed34d306a393a6bd93c
Reviewed-on: https://gerrit.instructure.com/14117
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
VDD: efficient application of assignment overrides

refs #10831

test-plan:
 - create a course, student, and assignment
 - create an assignment override that applies to the student
 - the return value of assignment.overridden_for(student) should act
   just like assignment, but with the overridden values in place
 - the overridden assignment should not be able to be saved
 - create multiple assignment overrides that apply to the student
   (adhoc, group, sections, etc.)
 - the overrides should be applied in the correct order
 - overrides that don't affect a field should let lower priority
   overrides affect it
 - create an override and then delete it (without changing the
   assignment version in between)
 - the override should not apply
 - create an override, then bump the assignment version, then delete the
   override
 - the override should apply to the old version of the assignment but
   not the new one
 - bump the assignment version, then create an override
 - the override should apply to the new version of the assignment but
   not the old one

Change-Id: Ib632903640cb8aeae5bbc8959c244f6923690f29
Reviewed-on: https://gerrit.instructure.com/14135
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
improve delayed_jobs process management

use process groups to be able to differentiate between running and
draining, and to easily stop workers without draining.

 * added --with-prejudice to stop (or restart) without draining first
 * added --with-extreme-prejudice to kill -9 running jobs
 * don't remove the pid file when stopping, so that you can call stop
   again with one of the above
 * improve status to detect the difference between stopped and
   draining
 * don't start a daemon if one is already running

test plan;
 * ensuring you have some long running jobs that would need to be
   drained, use ps to verify that all of the following work correctly:
   * start with no pool running
   * start with a pool running (doesn't allow it)
   * start with a pool draining (allows it)
   * stop (allows jobs to drain)
   * stop --with-prejudice (doesn't allow jobs to drain)
   * status (differentiates between stopped, running, and draining)
   * stop --with-extreme-prejudice (doesn't allow jobs to drain, and
     even kills jobs stuck in IO)
   * restart (drains currently running jobs, but starts the new pool
     immediately)
   * restart --with-prejudice (stops currently running jobs
     immediately, and starts a new pool immediately)

Change-Id: If7aa05f6a81c1cbd27df95777097834095fb406b
Reviewed-on: https://gerrit.instructure.com/14441
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
fix folder name text box size

fixes #11054

test plan:
  1. login as a teacher
  2. go to a course and click Files in
     the left hand nav
  3. click Add Folder
  4. verify that the name text box does not overflow out
     of the right hand frame

Change-Id: I07e9f87a101091f74a8e23a1d38de9667554f801
Reviewed-on: https://gerrit.instructure.com/14400
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
store and query hashed access tokens

refs #8943

This is phase 1. Once this is rolled out and the migrations have
finished, we can implement phase 2, which is dropping the token field so
that plaintext tokens are no longer stored in the database.

There should no longer be any code that reads the token attribute, it's
kept in the database purely to help with the transition.

test plan: before the postdeploy migration runs, access tokens should
still work. after it runs, access tokens should still work.
newly-created access tokens should work as expected. expired access
tokens should still error. For now, the plain-text token field should
still be populated for new tokens.

Change-Id: Icb1b4fdc8e2627ba6540d96d23eb28d874020acb
Reviewed-on: https://gerrit.instructure.com/14491
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
fix api paginatations that were returning a path, not an absolute url

fixes #10693

Also added a test to api_call spec helper to catch these in the future.

test plan: for all available api endpoints that use pagination, the Link
header returned should use absolute urls (http://<canvas>/api/v1/...
rather than just /api/v1/...).

Change-Id: Ia53d32e6902430bd554d322461a36323d5f2d3c3
Reviewed-on: https://gerrit.instructure.com/14502
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
spec: fix sub-second precision bug in assignment_spec

Change-Id: I1c49cc205bae79c62e8fe9067fc704f7f33fd373
Reviewed-on: https://gerrit.instructure.com/14535
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
add missing title element, fixes #11298

test plan:
1. go to /register
2. there should be a page title

Change-Id: I71b234583bf8e84e335b905e164a0d12553b7db5
Reviewed-on: https://gerrit.instructure.com/14483
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
spec: fix access token auto-creation in api spec helper

Change-Id: Idc5275c434123c7d74053e7caf6963cfeffb8ad5
Reviewed-on: https://gerrit.instructure.com/14533
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>