fixed Mandarin Chinese translation file

Many of the 'count' keys were missing in the translation file, e.g.

  other: |-
    1 个活动注册
    %{count} 个活动注册

Needs to be:
  one: "1 个活动注册"
  other: "%{count} 个活动注册"

Refs #CNVS-1187

Change-Id: Ied5c4e0219cb4082e5dbb7e0a34edaa4cdefd7da
Reviewed-on: https://gerrit.instructure.com/16408
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Duane Johnson <duane@instructure.com>
Add Mandarin Chinese and Arabic to locales.yml file.

Depends on https://gerrit.instructure.com/#/c/16371/

Refs #CNVS-1187

Change-Id: Ia7e45bc0ecad2bb1a3d1492fdfa90f4a92202127
Reviewed-on: https://gerrit.instructure.com/16399
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Duane Johnson <duane@instructure.com>
Add Mandarin Chinese and Arabic to locales.yml file.

Depends on https://gerrit.instructure.com/#/c/16371/

Refs #CNVS-1187

Change-Id: Ia7e45bc0ecad2bb1a3d1492fdfa90f4a92202127
Reviewed-on: https://gerrit.instructure.com/16399
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Duane Johnson <duane@instructure.com>
fixed Mandarin Chinese translation file

Many of the 'count' keys were missing in the translation file, e.g.

  other: |-
    1 个活动注册
    %{count} 个活动注册

Needs to be:
  one: "1 个活动注册"
  other: "%{count} 个活动注册"

Refs #CNVS-1187

Change-Id: Ied5c4e0219cb4082e5dbb7e0a34edaa4cdefd7da
Reviewed-on: https://gerrit.instructure.com/16408
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Duane Johnson <duane@instructure.com>
move course full check so already-enrolled users see the right thing

refs #CNVS-1360

Change-Id: I71d78c514715c741ab1956bfe8406e94d6d04e2e
Reviewed-on: https://gerrit.instructure.com/16409
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
move course full check so already-enrolled users see the right thing

refs #CNVS-1360

Change-Id: I71d78c514715c741ab1956bfe8406e94d6d04e2e
Reviewed-on: https://gerrit.instructure.com/16409
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
don't load unncessary assignment information for js grade calc

we load the assignment groups, which include assignments, which by default
includes the discussion topic info the the assignment is linked to
a discussion. this was unncessary, and was causing an error because the
discussion topic json does a select for update, and this is all happening in
a slave block.

fixes #CNVS-2430

test plan:
- in an environment with a master and slave database (user)
- try to load gradebook1; it should work
- try to load a student's grade summary page; it should work

Change-Id: I2fb9a202d1b30660871708ace16cb3be4cebb445
Reviewed-on: https://gerrit.instructure.com/16396
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley+gerrit@instructure.com>
QA-Review: Stanley Stuart <stanley+gerrit@instructure.com>
don't load unncessary assignment information for js grade calc

we load the assignment groups, which include assignments, which by default
includes the discussion topic info the the assignment is linked to
a discussion. this was unncessary, and was causing an error because the
discussion topic json does a select for update, and this is all happening in
a slave block.

fixes #CNVS-2430

test plan:
- in an environment with a master and slave database (user)
- try to load gradebook1; it should work
- try to load a student's grade summary page; it should work

Change-Id: I2fb9a202d1b30660871708ace16cb3be4cebb445
Reviewed-on: https://gerrit.instructure.com/16396
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley+gerrit@instructure.com>
QA-Review: Stanley Stuart <stanley+gerrit@instructure.com>

Conflicts:

	app/models/assignment.rb
	spec/controllers/gradebooks_controller_spec.rb
fix intermittent failure on submission api spec

fix a timing issue, being caused by matching created_at
and updated_at on the wrong object (that happens to usually
be created/updated at the same time, but not always

Change-Id: Idc026cfd6b0e37f535182e1bfe5287040558bed3
Reviewed-on: https://gerrit.instructure.com/16444
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Bracken Mosbacker <bracken@instructure.com>
move default help links from js -> ruby, refs #CNVS-2331

no user-visible changes, just a tweak to make it easier for plugins to
override the default help links

test plan:
1. click on the help dialog
2. confirm that you see the appropriate links based on your role
3. add a custom link (via account settings)
4. confirm that it shows up correctly

Change-Id: I6e93b2fa9c2ebd32dc6eb485d50bd3f1118f2364
Reviewed-on: https://gerrit.instructure.com/16385
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
fix for "unknown author" when a post is required to see replies

"Unknown Author" typically shows up when you fetch a discussion
before the background jobs have processed it. In this case, we
were fetching the discussion immediately after adding the
student's reply, so the background jobs didn't have a chance to
get to the new reply yet.

Normally this isn't a problem because the reply is added to the
discussion without refetching the discussion. In this case, we
need to remember the new reply, which has all the good
information in it, so we can replace bad fetched reply with the
good data.

fixes #CNVS-2406

test plan:
 - As a teacher, create a discussion topic with "Users must
   post before seeing replies" checked
 - As a teacher, create reply to the discussion
 - View the discussion as a student (shouldn't see replies)
 - Reply to the discussion as a student
 - Replies should load and you should see student's reply with
   the student's name

Change-Id: Id1189eabc0e8e1ff90c3764f2d0d92b425b50672
Reviewed-on: https://gerrit.instructure.com/16413
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
successfully redirect after deleting a quiz from the show page

a typo was preventing the redirect from working.

fixes #CNVS-2424

test plan:
- create a quiz.
- go to the /courses/:id/quizzes/:id page
- hit the delete button in the right side bar
- you should be redirected to the quiz index page

Change-Id: If8768c11658eea473bfeb48dbb50d61e8e3e756c
Reviewed-on: https://gerrit.instructure.com/16416
QA-Review: Myller de Araujo <myller@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
document the outcomes/outcome_groups API

fixes #CNVS-2156

test-plan:
  - rake doc:api
  - view the /doc/api/outcomes.html and /doc/api/outcome_groups.html
    pages
  - documentation should be intelligible and correct

Change-Id: I7194ef5b9b1b8aeab63e280cb6ad287022743747
Reviewed-on: https://gerrit.instructure.com/16427
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
restrict length of tmpfile filename

an excessively long course short_name or assignment title could cause a
filename over the 256 character limit.

fixes #CNVS-2365

test-plan:
 - create a course with a 250+ character course code (aka short name)
 - create an assignment in that course
 - create a submission for that assignment
 - go to the assignment page and click "Download Submissions"
 - zipfile should successfully create and download
 - repeat with short course code but 250+ character assignment title

Change-Id: Idcf0bdc303e8b467fc29196c52081f2070344811
Reviewed-on: https://gerrit.instructure.com/16362
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ethan Vizitei <ethan@12spokes.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
spec: update spec for the possiblility of more being added to the string

Change-Id: If8f812a16bc3e8ef087a2d230da19ed3217fb68c
Reviewed-on: https://gerrit.instructure.com/16466
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
don't send notifications to students for locked/hidden files

notifications will no longer be sent to students if:
 * the file's folder is locked (and thus inaccessible
 to students), or
 * the files tab has been hidden on the navigation
 and is thus inaccessible by students

test plan:
 * as a student, set file notification to ASAP
 * as an admin, create a folder and lock it
 * add a file
 * confirm that the student account did not receive
 an email notification

 * repeat the above, but instead of locking the file,
 hide the file navigation tab in the course settings

closes #CNVS-1688

Change-Id: Ic4398f2dadca0892d7e0643ec5e9b3eba6991dbd
Reviewed-on: https://gerrit.instructure.com/16243
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
update guard and coffeescript.

also include notification libraries for all platforms to
avoid polling.

test plan:
  * run guard (bundle exec guard);
  * edit a coffeescript file and verify that it is properly
    compiled.

Change-Id: I125c744b2d342eaeb5550ce10cd089a64272b44f
Reviewed-on: https://gerrit.instructure.com/16361
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
apply Rails security patch

see https://groups.google.com/forum/?fromgroups=#!topic/rubyonrails-security/DCNTNp_qjFM

Change-Id: I711f1182195d1847408636ab2f9e77a7f0047ac3
Reviewed-on: https://gerrit.instructure.com/16478
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Stanley Stuart <stanley+gerrit@instructure.com>
Reviewed-by: Stanley Stuart <stanley+gerrit@instructure.com>
fix for "unknown author" when a post is required to see replies

"Unknown Author" typically shows up when you fetch a discussion
before the background jobs have processed it. In this case, we
were fetching the discussion immediately after adding the
student's reply, so the background jobs didn't have a chance to
get to the new reply yet.

Normally this isn't a problem because the reply is added to the
discussion without refetching the discussion. In this case, we
need to remember the new reply, which has all the good
information in it, so we can replace bad fetched reply with the
good data.

fixes #CNVS-2406

test plan:
 - As a teacher, create a discussion topic with "Users must
   post before seeing replies" checked
 - As a teacher, create reply to the discussion
 - View the discussion as a student (shouldn't see replies)
 - Reply to the discussion as a student
 - Replies should load and you should see student's reply with
   the student's name

Change-Id: Id1189eabc0e8e1ff90c3764f2d0d92b425b50672
Reviewed-on: https://gerrit.instructure.com/16413
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
apply Rails security patch

see https://groups.google.com/forum/?fromgroups=#!topic/rubyonrails-security/DCNTNp_qjFM

Change-Id: I711f1182195d1847408636ab2f9e77a7f0047ac3
Reviewed-on: https://gerrit.instructure.com/16478
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Stanley Stuart <stanley+gerrit@instructure.com>
Reviewed-by: Stanley Stuart <stanley+gerrit@instructure.com>