transpose ids to default shard when filtering conversations

fixes CNVS-3969

test-plan:
  * create user A on shard 1
  * create user B on shard 2
  * create course C on shard 2 and enroll both A and B
  * create a conversation between A and B
  * have A open his inbox on shard 2 and filter by course C
  * the conversation between A and B should show up

Change-Id: I0289ba8ecd44b50928ae35bfb9006c7e75fa774d
Reviewed-on: https://gerrit.instructure.com/17970
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
close file descriptors when compiling coffeescript

test plan:
  - you should not get an error for having too many files open during
    rake js:generate. for good measure, do something that opens a bunch
    of files like rake canvas:compile_assets and make sure you don't get
    an error about having too many file descriptors open.

Change-Id: Ifc08195ba7a9c21176d9fc1990858ded659eefb3
Reviewed-on: https://gerrit.instructure.com/18276
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Stanley Stuart <stanley@instructure.com>
only filter google docs list by extension if extensions are given

This restores the previous filtering behavior that
google_docs_list_deprecated used.

This also fixes a regression with google docs at the top level (not in
any folder) not appearing in the list.

fixes CNVS-4295

test plan:
  - set up an assignment for file upload turn in with no list of allowed
    file extensions, and all your google docs should appear in the list.
  - set up an assignment for file upload turn in with a list of allowed
    extensions for example "doc,ppt" and only the google docs that are
    word processor and presentation files should appear in the list.
  - put some google docs in your top level google docs (not in any
    folder). make sure they show up in canvas and can be submitted.

Change-Id: I71d4f3db7114b427e282be2b1b40e61f1c94f7f7
Reviewed-on: https://gerrit.instructure.com/18280
Reviewed-by: Duane Johnson <duane@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
fix bug preventing students from creating discussions

fixes CNVS-4401

test plan:
- as a student, try to create a new discussion
- it should work

Change-Id: If9572db8d7ae0d68b0278c4f8c5f59d60a3eab7c
Reviewed-on: https://gerrit.instructure.com/18279
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
remove TEST_ENV_NUMBER hardcoding in config files

instead, you should be putting ERB in the config files

Change-Id: I75ddb75a77a6c7192583dd5eec88f4686d869e48
hide datepicker icon for assignment quick edit

test plan:
  - as a teacher, go to the course assignments page
    (/courses/x/assignments) and use the quick edit for a multiple due
    dates assignment. when you click the edit icon, you shouldn't see
    the datepicker icon, and you should see the text "Multiple Due
    Dates". You should also not see the "suggest text", e.g. the grey
    text that usually shows up underneath datepicker input fields.

fixes CNVS-4357

Change-Id: I7c723a490905c4292d975e772b24a3f4cd5e0dcf
Reviewed-on: https://gerrit.instructure.com/18267
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
added testem for fancier JS dev/testing

1. install testem
   `npm install -g testem`

2. start the runner
   `rake js:dev`
   
   run a specific test(s):
   `JS_SPEC_MATCHER=**/*ViewSpec.js rake js:dev`

3. follow instructions on screen

Change-Id: I63c330dc4a92bc2eca70e18c903e497edd5bc453
Reviewed-on: https://gerrit.instructure.com/18291
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Ryan Florence <ryanf@instructure.com>
fix cog menu button on quiz show page

fixes CNVS-4359

test plan:
- go to a quiz show page as a teacher
- the button next to edit should have a cog icon

Change-Id: Id179b7179514a74ec3acfa7b55247da0f77d9f04
Reviewed-on: https://gerrit.instructure.com/18251
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
fix bug not warning of missing sections in discussion vdd

fixes CNVS-4408

test plan:
- try to make a discussion with vdd so that sections are missing dates
- you should get the warning dialog

Change-Id: Idf15db66b397ebc4585a6b5e68a6deb5be86b1ff
Reviewed-on: https://gerrit.instructure.com/18285
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
fix course form regression, fixes CNVS-4254

ensure course code field appears when the course name is long

test plan:
1. on the dashboard, click "Start a new course"
2. type in a really long course name
3. the short code field should show up

Change-Id: I0814c18ad086110a4cf2a122e289c41a44f22701
Reviewed-on: https://gerrit.instructure.com/18256
Reviewed-by: Joe Tanner <joe@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
ldap settings js_block -> .js, refs CNVS-4380

no changes, just moving code around

test plan:
1. go to Account -> Authorization
2. add an LDAP config, but leave everything blank
3. click "Test Authentication"
4. the first test should fail and the rest should be canceled
5. set up LDAP according to: https://gist.github.com/jenseng/1b2ab5f505c54b9cf57c
6. click "Test Authentication" again
7. three tests should pass, and when you enter the credentials: user / pass
   the last test should pass

Change-Id: Ia612797a290dc932abd0380f63997cf6599f24fe
Reviewed-on: https://gerrit.instructure.com/18298
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
stop encoding errors on non-ASCII incoming mail.

fixes CNVS-4374

update mail gem to 2.5.3 for ruby 1.9, and patch the
broken parse_message method in it.

test plan:
  * send a mail message with non-ASCII characters in it;
  * verify that it is processed and doesn't throw any
    errors re: encoding.

Change-Id: Iaa5a992b4bb9b6c183c02f43201f8aeb9515d92c
Reviewed-on: https://gerrit.instructure.com/18235
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
fix fonts in dropdown menu in gradebook

test plan:
  - as a teacher, use gradebook 2.
  - open the gear menu next to the "Showing:All Sections" menu
  - fonts should look consistent.

fixes CNVS-4377

Change-Id: Ie6ca802a738992b60283fdef3440a3e703d13212
Reviewed-on: https://gerrit.instructure.com/18258
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
accept html entities in quiz short-answer question answers

>> THE CAUSE

Answers supplied by users for short-answer quiz questions were not
being properly scored because the student answer was being HTML escaped,
while the 'correct' one (supplied by the teacher) wasn't.

>> THE FIX

The #matching_answer routine now escapes the *correct* answer as well as
the student-supplied one. I believe there is a good reason why the
answer was being escaped in the first place, so instead of removing the
escaping act entirely, now both sides are escaped.

If there's no reason for escaping the student-supplied answer, this
patch has to be amended.

>> TESTING

[ as a teacher ]:
  1. set up a quiz with a 'fill in the blank' question
  2. provide some acceptable answer(s), one of them being (or including)
     an html entity like: 'M&Ms'.

[ as a student ]:
  1. take the quiz
  2. fill in the correct answer ('M&Ms')
  3. the grading report should reflect a correct score for that question

>> META

closes CNVS-708

Change-Id: I6a12e79a7bcb7455a1b46abbbf17a4e64c68184b
Reviewed-on: https://gerrit.instructure.com/17814
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
fix grouping and common context id interpretation

in messageable users. if a user has multiple enrollments in a course,
don't return multiple MessageableUser rows. also, make sure
interpretation of shard-local common context ids occur relative to the
shard the row comes from.

refs CNVS-3969

test-plan:
 - create a course (course1)
 - create a user (user1) that's enrolled multiple times course1 (e.g. as
   a TA in one section and a student in another)
 - create another user (user2) in course1 that can see both of the first
   user's enrollments (e.g. a teacher without section-limited
   visibility)
 - call user2.messageable_users_in_context(course.global_asset_string)
 - the result should contain user1
 - the result should contain user1 only once
 - the result for user1 should have both roles in the common_courses

Change-Id: Ic8ce5f07e5ce3a0d56998da0876d12333d97f6e6
Reviewed-on: https://gerrit.instructure.com/18238
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
open the XML file and look at the namespaces for is_qti_2 query

Before we were just running a regex against the raw file text, but the
XML isn't necessarily UTF-8 encoded so that could blow up. This now runs
it through an actual XML parser, which takes encodings into account.

fixes CNVS-4422

test plan: i've verified that there are specs testing this method. you
should be able to still import QTI packages into quizzes and question
banks, including through the respondus tool. the packages attached to
CNVS-4340 should import correctly in spite of their non-UTF8-ness.

Change-Id: Ibac9c4fbe4b2bc7625d16e636b90db23c7e4e704
Reviewed-on: https://gerrit.instructure.com/18314
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
api: allow section overrides for group assignments

fixes CNVS-4407

test plan:
- create a new assignment as a group assignment, with section overrides
- it should work

Change-Id: Icb4f497de7ef24b9d9e756b1f0255b4fce16d017
Reviewed-on: https://gerrit.instructure.com/18324
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
show points possible for graded discussions

fixes CNVS-4435

test plan:
- go to a graded discussion show page
- it should show the points possible

Change-Id: I5dbe30f5d61421c21241e970cc180ac13fdb7a80
Reviewed-on: https://gerrit.instructure.com/18347
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
calendar event with > 58 chars title truncated in undated list

when an undated event is created on caledar2 month view with a very
long name, the name will be truncated in the undated list and will
retain the truncation when dragging the event to a date.

fixes CNVS-1256

test steps:
- create a new course
- go to calendar2
- create an undated event with a title that is > 58 charactes
- ensure that the event on the right hand side is truncated
- click and drag the event out to a date and ensure the name is
  truncated

Change-Id: I94b36736d87acd7d5afb8501bfa78d02f182d2b9
Reviewed-on: https://gerrit.instructure.com/18210
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
spec: pend utf8 spec in ruby 1.8

fixes #CNVS-4458

Change-Id: I36000bbabf9535df11e8df10bd106f012f6b35c2
Reviewed-on: https://gerrit.instructure.com/18372
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>