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>
rename user_(is|has_been)_teacher to instructor

also, make the implementations of those and user_(is|has_been)_student
consistent, and fix a bad cache key.

test-plan:
 - everything but the cache key is just a refactor
 - create and then delete a student enrollment in a course so that
   user_is_student? and user_has_been_student? should be different
 - enable caching
 - call user_is_student?; should be false
 - call user_has_been_student?; should be true

Change-Id: Ia9458605273741ef3971d8701fe3cff56453f9b4
Reviewed-on: https://gerrit.instructure.com/14580
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
VDD: Assignment#due_dates_for(user), et al.

a convenience method to get all due dates applicable to and/or visible
to a specific user for an assignment. new named scopes on
AssignmentOverride to facilitate it, and minor bug fixes

Change-Id: I7f400fd13b7903b362e9ca0e6991f1d287f5f783
Reviewed-on: https://gerrit.instructure.com/14581
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
[Fixes #10597] Make course modules section more accessible

Issues:
* Screen readers cannot detect the indent, edit or delete buttons when navigating by keyboard.
* On the Edit Module Settings/Add Module box, none of the fields or dropdowns have labels. Additionally, the "Before students can view this module: No prerequisites defined" and "This module is complete when: You'll need to add items before you can specify how a user will complete this module No requirements defined" text is no detected by a screen reader.
* On the Add Item to Module box the text in the combo box is not detected. The screen reader can detect the dropdown lists but none of them are labeled.
* When creating a new item, the field to enter a name for the item also has no label.

Changes:
* Adds labels to all fields on 'add module' and 'add module item' dialog boxes
* Enables tab access to hidden hover icons on index for modules and module items by making elements visible but off screen (matching behavior of 'assignments' section)
* Adds alt text to icons that didn't used to have it
* Adds tabindex to non-label text that was being bypassed by JAWS
* Fixes unrelated bug - module icon controls not linked to hover state
* A few unrelated JS/CSS refactors
* Tweaks selenium tests to use new with_focus_icons_visible helper to show off-screen icons

Change-Id: Idb8151ef97c726b1f56d98270b6eb430f4dec5d4
Reviewed-on: https://gerrit.instructure.com/14322
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Reviewed-by: Clare Hetherington <clare@instructure.com>
add api for listing visible navigation tabs

test plan:
- fetch tab list using some command like:
curl -H 'Authorization: Bearer <token>' \
 https://<canvas>/api/v1/courses/<course_id>/tabs\?include\="external"
- ensure that the returned list corresponds to the left-hand tab list on the
  web interface

fixes #10891

Change-Id: If3371472b58f849a9736ab6747f69551178e99a4
Reviewed-on: https://gerrit.instructure.com/14615
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
[#5773] multiple ruby 1.9 spec fixes

Fix 'translation missing' helper spec
Fix intermittent timeout issue on 1.8.7
Send ZipFile::CREATE rather than true for 1.9 compatibility

Solve 2 more specs for 1.9.3 in the "lib/cc"
(the main problem here was that both files
used require strategies that assumed 1.8 style
load path configuration.  Wrapping them with
'expand_path' makes them able to find the helper.
Also, in the cc_helper, a spec was passing
in a string that needed to be specified as
UTF-8 in order to not confuse nokogiri.)

Fixed google doc id access
(in 1.8.7 the Atom::SimpleExtensions::ValueProxy
representing a document's ID was being to_s'd as
a single value.  In 1.9.3, it was including Array
braces around the value, causing the URL for
editing to be malformed.  Updating the
GoogleDocEntry class to pull the "first"
value from the ValueProxy allowed it to function
correctly (and is backwards compatible to 1.8))

Fix multiple helper requirement issues
Fix spec string encoding for incoming message processor spec
Fix the counts_report_spec for 1.9
Fix ruby 1.9 errors when testing text_helper.rb

Fix the splat handling for the notification 
policy data fixer

Change-Id: Ib70291442eaf2855565db6e451570c0a7670c6ed
Reviewed-on: https://gerrit.instructure.com/14517
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
fix the selective migration ui

When unchecking an item in the migration UI the uncheck
didn't propagate up so "copy everything" was still checked
causing everything to be copied anyway.

Test Plan:
 * Import some course package
 * on the content select page deselect an individual file/quiz/assignment or something
 * the category should get unchecked, and the "Copy Everything" at the top should be unchecked

closes #11219

Change-Id: Iaa040d7d6f19e6c7a25d2c707675c48ce7c1f7a7
Reviewed-on: https://gerrit.instructure.com/14623
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Fix deleted admin enrollments enabling student to see discussion topics without a post. Fixes #11192

Fixed the DiscussionTopic#user_ids_who_have_posted_and_admins method to only
look at active admin enrollments. Was picking up the TA's deleted admin enrollment.

Testing Steps:
===========
* Create a course as a teacher and add a TA
* Create a Discussion Topic that requires a user to post before
   seeing other user's responses.
* As a student, add a response
* Verify that the TA can see the other student's response
   without having created a post themselves.
* Remove the TA's enrollment in the course and
   add the TA as a Student.
* As the TA-turned-student, visit the discussion
  and verify that you cannot see the replies
  without first making a post.

Change-Id: I35ed1a6b05128e8e3636574df3779449a5ee3c69
Reviewed-on: https://gerrit.instructure.com/14617
Reviewed-by: Joel Hough <joel@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
Reviewed-by: Marc LeGendre <marc@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
gemfile update for new parallelized_specs gem

Change-Id: Ie79086c2fe919ed616d0e07deca4ea12cf5abc72
Reviewed-on: https://gerrit.instructure.com/14470
Reviewed-by: Jake Sorce <jake@instructure.com>
Tested-by: Jake Sorce <jake@instructure.com>
Revert "gemfile update for new parallelized_specs gem"

This reverts commit b6e372762b8f7a3accb4a6835bb952804098f7f4

Change-Id: Iabb65a035b96f6179d4bbac5317662c503c1a0a9
Reviewed-on: https://gerrit.instructure.com/14658
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Tested-by: Bryan Madsen <bryan@instructure.com>
spec: label kaltura dependant specs as pending

Change-Id: Ide28af7196293d743f55f85e7d07e7a55ee66aa2
Reviewed-on: https://gerrit.instructure.com/14661
Reviewed-by: Shawn Meredith <shawn@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>