improve moodle 2 handling of missing file references

test plan:
* import the packages referenced in the ticket
* should not fail catastrophically

fixes #CNVS-13226

Change-Id: Ib66ec7c7d5eea3331349f069db6035e592ab84c4
Reviewed-on: https://gerrit.instructure.com/35448
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
fix issue with publishing a module not publishing quiz item correctly

this was fixed by changing two things.

1. all objects except quizzes are published by setting workflow_state to
   'published'. Quizzes differ in that it also needs to generate the question
   data and set the published at time. We have the Quiz#publish! method to do
   exactly this, but nobody uses it. So the code now just checks the workflow
   state and always triggers the correct code if someone changes it directly

2. Quizzes use 'available' instead of 'published' for the published workflow
   state. Content tags was checking for 'active' first and since quizzes
   responded to that method it was setting the state to active, which was
   messing things up. I switched the logic to check for responds_to :available
   first, so that quizzes get set correctly.

fixes CNVS-13003

test plan:
  - turn off draft state
  - as a teacher
    - create a new quiz with questions (leave unpublished)
    - create a new module (leave unpublished)
    - add the quiz to the module
    - publish the module
  - as a student
    - take the quiz
    - the questions should show up fine when taking the quiz

  - make sure that publish/unpublish of a quiz with DS continues to work
    as expected
  - mess around with any way you can think to publish the quiz via modules
    etc.

Change-Id: I734e2499d58891fda952b608a13e856d469ebca2
Reviewed-on: https://gerrit.instructure.com/35479
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
fix module unlocking via date

test plan:
 * create a module that unlocks in the future
 * wait until the module unlocks

 * as a student (not student view)
 * from the modules page, access the module
 - the module should be unlocked and accessible by the student

fixes CNVS-13292

Change-Id: I890289f5248faab52ae5291a7a0c197c6881bc48
Reviewed-on: https://gerrit.instructure.com/35477
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
force gradebook transition

this commit forces on the new, accessible, individual gradebook view and forces
of the old GB1

closes CNVS-12327

test plan:
- make sure that individual gradebook view is on and GB1 is off and that you
  can't change it from the UI as a teacher or site admin
- now run the following (to simulate not already having the flag set to on):

  FeatureFlag.where(feature: "screenreader_gradebook").destroy_all

- check again to make sure it is on and can't be turned off

Change-Id: I23cb476d051b4e7697de47432dbe4a408b9800ef
Reviewed-on: https://gerrit.instructure.com/35464
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
treesame commit of origin/stable/2014-05-24

Treesame-Commit-Id: 1cc0e6006cbab4b5570691a2e2cf333d7af801e2