search the right namespace for this constant

We're in the Delayed::Backend module here, and there's also a
Delayed::Backend::ActiveRecord class, so this call was ambiguous if
ActiveRecord wasn't already fully loaded.

Change-Id: I7071e2b1af454b2837e52204ef8282fb312002e1
Reviewed-on: https://gerrit.instructure.com/24424
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
fix more intermittent selenium failures

Change-Id: Ib1fd305e726cd13285446373f561aac8c4ff094f
Reviewed-on: https://gerrit.instructure.com/24488
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
maintain the root attachment namespace on clone

Cloning A -> B would not preserve A's namespace on B. Cloning B back to
A would also modify A's existing namespace. This fixes both issues.

fixes CNVS-7878

test plan:
You can emulate this without a shard split by using change_namespace.
* Upload a new, unique attachment
* Attachment.find(<id>).change_namespace("my_test")
* Copy the course, including that attachment
* In the new course, the clone of the attachment should be downloadable
* Import the second course back into the first course
* Back in the old course, the clone of the attachment should be downloadable
* Verify in script/console that Attachment.find(<id>).namespace is still
  "my_test" for both copies of the attachment

Change-Id: Ibbe7bb3df413e2f25c7d0085b41bf69e9f3e5e48
Reviewed-on: https://gerrit.instructure.com/23923
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
don't submit imported/unzipped attachments to scribd

test plan:
* ensure scribd documents are rendered automatically
 when uploading single files to a course

* ensure scribd documents are not rendered automatically
when uploading a zip file full of documents to a course

* ensure scribd documents are not rendered automatically
when files are imported with a content migration package

* ensure scribd documents that were not rendered
automatically will be rendered on demand
(i.e., the first time they'll view with google docs
if available, or a "processing, try again" message
otherwise; later page loads should view the
document in scribd once it's done rendering)

fixes #CNVS-8078

Change-Id: Ibe821783e45dfa32b9bfdeb23b125237b45e9890
Reviewed-on: https://gerrit.instructure.com/24404
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Hannah Bottalla <hannah@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
make jst css files play nicely with guard

now when you update or delete a jst s[ac]ss file:
1. guard recompiles (or deletes) the css (don't need to wait for compass
   middleware)
2. guard recompiles the corresponding .handlebars so that it has the
   correct embedded css

test plan:
it should no longer be ridiculously painful to use jst css files. in other
words, change your file, refresh the page, voila!

Change-Id: I61e245dc827fd5006cc7cd0af4e074bb8c5108cc
Reviewed-on: https://gerrit.instructure.com/24459
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
group category create/edit dialogs, fixes CNVS-6659

feature parity with the old UI

also add account setting to enable the new UI

reorg some code so we can more easily rip out all the old stuff once we
are done

sass->scss since it's the new hotness

add reorder() method to CollectionView for when things change

test plan:
1. in the console, set the enable_manage_groups2 setting to true on your
   account
2. run delayed_jobs
3. go to the manage groups page
4. you should see the new groups UI
5. you should be able to add a new group set
6. you should be able to edit a group set
7. the tabs should be alphabetical (adding/updating a set should put it in
   the correct spot)
8. auto-creating/splitting groups should work when creating a set

Change-Id: I55f9e7785a0114954a3583257a78f71e78f47b5f
Reviewed-on: https://gerrit.instructure.com/22458
Reviewed-by: Mark Ericksen <marke@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
fix speedgrader regression when viewing quizzes

fixes CNVS-8204

Test plan:
  * Make a quiz
  * give students a score for the quiz in gradebook (do not take the
    quiz)
  * open the quiz in speedgrader
  * the gradebook should load with no errors

Change-Id: I6328fb786a2ba27d80e04ebeaecd85c579e7b4cd
Reviewed-on: https://gerrit.instructure.com/24463
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
quiz questions now soft-delete

Adds workflow state to QuizQuestion models.

Test plan:
  - Make a quiz, have a student take the quiz.
  - Set some regrade options on the quiz and republish the quiz.
  - Go back to the edit page for the quiz and delete a quiz question.
    You should not get a error when you do this.
  - Make sure the quiz question does not show up by refreshing the
    quiz's edit page.

Change-Id: If4bcb0ad28217a527080da9aa32ce6bf7921bfdb
Reviewed-on: https://gerrit.instructure.com/24111
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
add missing i18n on migration page

The course name placeholder text should be translated now

Test Plan:
 * look that the course name input box for course copy is i18n'd

refs CNVS-3188

Change-Id: I91dfe0f69262384f3de2b022d32e792cb38551d6
Reviewed-on: https://gerrit.instructure.com/24490
Reviewed-by: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Hannah Bottalla <hannah@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
don't show empty conversations in new inbox

fixes CNVS-8116

test plan
- you will need a student and a teacher who do not have a
 conversation with each other
- create an assignment
- as a student, make a submission
- make a submission comment on that submission
- as a teacher, reply to that submission comment
- ensure that a conversation with the submission comments and no
 other messages appears in the teacher's old conversations inbox
- ensure that the conversation does not appear in new conversations

Change-Id: I046c387d39b2e8affcb6572cdb5e049d666bdc9f
Reviewed-on: https://gerrit.instructure.com/24486
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
use new wiki ui for course front page

fixes CNVS-8105

test plan:
 - enable draft state for a course
 - set a wiki page to be the course front page
 - confirm you get the new page UI,
   with the toolbar up top with "View All Pages" and the
   gear menu at right
 - confirm the course name is shown in place of the wiki page title
 - confirm the "Published" and "Front Page" markers are not shown
   (they're redundant on the course home page)
 - confirm the module sequence footer is not shown on the course
   home page
 - confirm the gear menu doens't have a "delete" option
   on the front page
 - set a Creative Commons license and ensure it shows up correctly
   on the bottom of the home page
 - view the front page in Pages and confirm that the page shows
   normally there (Published, Front Page, sequence footer present,
   delete is in the gear menu)
 - also make sure the course home page still works properly
   (with the old ui) when draft state is disabled

Change-Id: I28c2ee6a373d1b9b83c42775665ceca058ede2de
Reviewed-on: https://gerrit.instructure.com/24269
QA-Review: Hannah Bottalla <hannah@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Severson <markse@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
fix icon screenreader text in question editing

fixes CNVS-6535
this commit adds text for the screenreader to utilize to various icon
links in question editing and question bank editing. links affected:
"Edit this Question", "Delete this Question", "Collapse Group",
"Add Question to this Group", "Edit Group Details", "Delete Group"
See ticket for screenshots.

Test Plan
1. Edit an existing quiz
2. Create a quiz question and a question bank
- The icon links described above should be read by screenreaders.

Change-Id: I5e7d6c2af9de6b6cde725c2d9109c889c15652e7
Reviewed-on: https://gerrit.instructure.com/24423
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
verbage/english fixes on quiz regrade messaging

fixes CNVS-8106
this commit addresses the documentation team's concerns regarding
the proper use of English in Quiz Regrade flash messaging.  It also
adds a method (#last_regrade_performed) that's a pointer to the latest
regrade created for the particular instance. Please refer to the ticket
to see the particulars of the directed message changes. A test plan is
included for 'counted questions' messaging.

Test plan
1. Create a quiz with multiple questions
2. Take the quiz as a student
3. Regrade the quiz a first time, regrading one question
- The messaging to the student should be proper (use of the singular)
4. Regrade the quiz a second time, regrading multiple questions
- The messaging to the student should be proper (pluralized)
- And should have the right number of regraded questions in the message.

Change-Id: I0b5323699f9741df009e7e036890496d93faa6a9
Reviewed-on: https://gerrit.instructure.com/24471
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
Updated ja translation
add "x" to remove user from a group

fixes CNVS-8117

testing steps:
- add a user to a group, users in a group
  should now have an "x" to the right
  of their name
- clicking the "x" to remove should remove
  the user from the group, updating the group
  total, and the user should appear in the
  unassigned list.

Change-Id: I3063a925b92657175f308e6a907aae7adc6ef079
Reviewed-on: https://gerrit.instructure.com/24359
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
add only common use-case for selenium tests

fixes CNVS-7303

testing steps: (none) just updating automated specs

Change-Id: I0e8c2fe3d7aecf435ff502dedb90c83c8d327434
Reviewed-on: https://gerrit.instructure.com/24294
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Mark Ericksen <marke@instructure.com>
QA-Review: Mark Ericksen <marke@instructure.com>
clean up old bad data before adding an FK

Change-Id: I9cce44b7bd9072da2b7329ae87034a86318d8bb1
Reviewed-on: https://gerrit.instructure.com/24507
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
swagger: handle 'array' return types in API docs

Our generated json did not handle array data types for @return tags.
This adds support, for example, for '@return [User]'

Change-Id: I3f9bee95c49fc737d07b220b99c9083d28d0ffde
Reviewed-on: https://gerrit.instructure.com/24500
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Duane Johnson <duane@instructure.com>
QA-Review: Duane Johnson <duane@instructure.com>