Commit Graph

1965 Commits

Author SHA1 Message Date
Ryan Shaw 1e91b8860b fix css loading inside tinyMCE editors
fixes: CNVS-21910

test plan:

* load a page with a tinymce editor
* make sure the content inside of it is styled like
  it is currently in production

Change-Id: I7640575a21929ea6b3f80e09b5036c38d54f9b59
Reviewed-on: https://gerrit.instructure.com/58585
Tested-by: Jenkins
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2015-07-17 03:50:32 +00:00
Andrew Huff faa2dfd775 remove duplicate score display on individual view grade summary
fixes CNVS-20215

This fixes a bug with the individual view grade summary page
(/courses/:course_id/grades/:student_id#tab-assignments)

Previously, when a grade was marked "Display grade as: Letter Grade" or
"Display grade as: GPA scale", and the score earned on the assignment
was equal to the grade earned on the assignment (according to the
assignment's grading scheme) the amount of points earned would be shown
twice on the grade summary page.

For example, if a student earned 2 out of 3 points on an assignment,
which translates to a grade of "2.0" on that assignment's grading scale,
the entry for that assignment would be displayed as "2 2 (2.0)" instead
of "2 (2.0)"

See JIRA ticket CNVS-20215 for pictures.

Also, changes blank grade display in the gradebook history from '--' to
'-' for consistency

Test Plan:
* Create different assignments with different "Display Grade as"
settings (e.g. "points", "percentage", "gpa scale") and different
grading schemes, including at least one grading scheme where the grades
are numbers (e.g. replace "A", "A-", etc. in the default grading scheme
with "4.0", "3.7", etc.)
* Grade a student on these assignments
* Make sure that the score and grade displayed in the student's
grade summary page is displayed as expected for each assignment

* Test this from both the student view (including "What-If"
calculations) and the teacher view

Change-Id: I4a76c721d0dbb7d71f3c3db25970ce9533f61707
Reviewed-on: https://gerrit.instructure.com/55116
Tested-by: Jenkins
Reviewed-by: Cody Poll <cpoll@instructure.com>
QA-Review: Jason Carter <jcarter@instructure.com>
Product-Review: Christi Wruck
2015-07-16 16:31:07 +00:00
Andrew Huff 2e773af8d7 make grade summary round displayed grades
fixes CNVS-21106

Changed the rounding of total scores on the grade summary page
from 1 digit to 2 digits (See the pictures in the JIRA ticket)

Note that trailing zeros will not be shown. For example, a score of
exactly 73.3% will be shown as "73.3%" rather than "73.30%"

Also, changes a bunch of hacky JS rounding to use compiled/util/round.js

Test plan:
* Ensure that all percentages shown in the gradebook and on the grade
  summary page are rounded to 2 decimal places

Change-Id: I622e894e76c4c7c46a9d8820ff4a7ad791d79868
Reviewed-on: https://gerrit.instructure.com/56382
Tested-by: Jenkins
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
QA-Review: Jason Carter <jcarter@instructure.com>
Product-Review: Christi Wruck
2015-07-16 16:31:00 +00:00
Brock Cooper a65074fa2c Fix issue with non-updating 'all' value from Teacher view in Modules
Refs CNVS-21865

Test Plan:
- Navigate to the Modules teacher view and create a
  new module with a module item
- Edit module and add a requirement then select the radio button
  where you only need to complete one item
- Ensure message in the pill in the header of the module now says
  "Complete One Item"

Change-Id: Idf7c0feea35ddbcf33c526dd1828b4700445b575
Reviewed-on: https://gerrit.instructure.com/58390
Reviewed-by: Dan Minkevitch <dan@instructure.com>
Tested-by: Jenkins
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Brock Cooper <bcooper@instructure.com>
2015-07-16 14:46:33 +00:00
Cameron Matheson d5284d03b1 gradebook csv: support excused assignments
closes CNVS-21267

Test plan:
  * excuse some assignments in a course
  * download the gradebook
  * excuse/unexcuse students in the gradebook
  * upload the gradebook

Change-Id: I624f48415f0be524da70d0ea41ccd6216e06ed68
Reviewed-on: https://gerrit.instructure.com/57158
QA-Review: Adam Stone <astone@instructure.com>
Tested-by: Jenkins
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2015-07-15 03:41:23 +00:00
Josh Simpson 35cc61e40d add excused assignment support to grading history
closes CNVS-21065
This commit accounts for excused assignments in the grading history.
Now, if an assignment has been excused, the grading history will
report 'EX', as opposed to a blank value.

Test plan
- Check grading history for both graded assignments and
excused assignments.
- They should reflect prior behavior, except for excused assignments,
which should be shown as an "EX" value.

Change-Id: I8f8cc2f2f807414ae063e176fae301cb9a7ea19a
Reviewed-on: https://gerrit.instructure.com/58284
Tested-by: Jenkins
Reviewed-by: Derek Bender <dbender@instructure.com>
QA-Review: Adrian Foong <afoong@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2015-07-14 15:14:53 +00:00
Chris Hart b11f1ff4d4 Update dashboard toggle to new ic-Super-Toggle
Fixes: CNVS-21840

No change in functionality - just replace the existing
toggle on the dashboard header with the new and improved
toggle from the styleguide.

Test Plan:
- Make sure the Use New Styles feature flag is ON.
- Log into Canvas.
- The toggle at the top-right of the dashboard should
  now look like this:
  http://screencast.com/t/lrvrehPgqY3c
- It should work exactly the same as before when you
  click it.

Change-Id: Ib6b03cdf2314869cfa48596a922036ae56ca2178
Reviewed-on: https://gerrit.instructure.com/58245
Tested-by: Jenkins
Reviewed-by: Jennifer Stern <jstern@instructure.com>
Product-Review: Jennifer Stern <jstern@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
2015-07-13 22:36:58 +00:00
Rob Orton e597ac8f88 s/availible/available
Change-Id: I2a4d61a897f648a1ce8c587487083f210637b96f
Reviewed-on: https://gerrit.instructure.com/58073
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2015-07-13 20:43:26 +00:00
Cameron Matheson ff4b281c96 speedgrader: show "graded" checkbox for excused assignments
fixes CNVS-21448

Test plan:
  * Excuse some assignments
  * Open speedgrader
  * The excused assignments should show they are graded in the dropdown

Change-Id: Idbec25587ebf64574a7c38bf38ddcca22e9ccb6d
Reviewed-on: https://gerrit.instructure.com/58292
Tested-by: Jenkins
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Adrian Foong <afoong@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2015-07-13 20:17:35 +00:00
James Williams 417329b3b4 s/visibile/visible
lul

Change-Id: I303e168053ec058cdbf40acc6337b3d3404034ad
Reviewed-on: https://gerrit.instructure.com/58065
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-07-13 15:24:07 +00:00
Stephen Jensen 21ba974ef4 New UI: Fix Roll Call iFrame height
Fixes: CNVS-21594

Code Review Test Plan:
- You will need to install Roll Call locally

- Lucky for you, the instructions are awesome, and it
  takes all of 10 minutes:
  https://gollum.instructure.com/Rollcall
  https://gollum.instructure.com/OtherServiceTestAccounts

- Make sure the Use New Styles feature flag is ON

- Go to a course, and click on Attendance in the
  context menu

- The Roll Call layout should now look like this,
  with the LTI tool iframe taking up any available
  space between the breadcrumbs and the footer:
  http://cl.ly/image/1j1B2t1W0Y2M

***
QA Note: I was unable to test this on IE10 because
Virtual Box wouldn't load Roll Call inside Canvas
due to security restrictions. If possible, please
test in IE10 to make sure we're good there. Thanks!
***

Change-Id: I3a0ef522f1fd72a367d867a1674ca43b1cfcacb5
Reviewed-on: https://gerrit.instructure.com/57429
Reviewed-by: Jennifer Stern <jstern@instructure.com>
Tested-by: Jenkins
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Chris Hart <chart@instructure.com>
2015-07-09 19:10:35 +00:00
Ryan Shaw d7d3ccf9e3 extract smartbanner out of 'common' into it's own bundle
this change does a few things:
* removes 'smartbanner' from the 'common' css and
  js bundles into it's own that is only loaded on
  android devices.  (this is a win since we only
  use it for android anyway so we won't be sending
  that needless css/js on every page load now)
* uses bower to load 'smartbanner'. this is good
  since it makes upgrading easier and makes it clear
  where the separation of our code and vendor code is.
* now, there are no files in our repo that are just
  copy-pasted from 'smartbanner'

test plan:

* load canvas on a web browser on an android device,
  it should show the "install the canvas native app"
  just like it used to.
* load canvas on a normal browser, the banner should
  not appear.
* aka, there is no observable change to users.

Change-Id: Ifed35a255d774a9148a90b1daf7b4c8e09af91ce
Reviewed-on: https://gerrit.instructure.com/54806
Tested-by: Jenkins
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2015-07-07 20:54:15 +00:00
Ryan Shaw 84a7192a36 A new way of doing css/sass & New Canvas Theme Editor
what this does:
* Changes the way we generate css so we are able to generate custom
  css for people that use the theme editor.
* Sets everything up so we can push all of our static assets
  (js, fonts, css, images, etc) to s3 pre-deploy and serve them
  from cloudfront. Yay! faster canvas for everyone!
* as part of that, this enables the rails asset pipeline just so we
  can use it to put md5s in our urls.  we don't use it for any of the
  coffeescript/sass/sprockets transformer stuff.
* adds a new "Theme editor" functionality (only for people that have
  have the use-new-styles feature flag turned on) where an admin for
  an account can pick their own colors/images for all the users
  at their account/school.
* when the user is done saving things in theme editor, it will,
  in a delayed job, generate all the css with against the variables
  that user specified and push it to s3 so it will be available to
  anyone else that requests it.  (the delayed job will shell
  out to a node.js executable called `brandable_css`).
* ability to pick an existing shared theme and to reset to
  blank theme. closes: CNVS-19685
* gets rid of jammit.

test plan:
(this is exaustive, so not every person has to do every step
but we should make sure at least someone does each of these things.
maybe as part of the review add a comment if you have done one of these
bulletpoints)

* before you check this out, compile all css and copy the
  public/stylsheets_compiled directory somewhere. after you check out
  this code and regenerate all the css. make sure there are no
  significant changes to the css output. (we updated the versions of
  node-sass and autoprefixer that we use so we want to make sure they
  don't change things in a way we weren't expecting)

* make sure the way we load css for handlebars templates still works.
  eg: if there is a handlebars template at
  app/views/jst/some/template.handlebars
  if there is also a scss file at
  app/stylesheets/jst/some/template.scss
  then that stylesheet should get loaded when that template is rendered

* check out the code and run migrations. browse around canvas,
  make sure css and js files load correctly as before.

* cody, jacob, or someone on queso: look at the db migrations and
  make sure everything looks good and that I am handling sharding
  correctly.
* verify that both rake canvas:compile_assets and guard, works as well
  as `node_modules/.bin/brandable_css` (note: if you have
  "node_modules/.bin" in your PATH (which you should), it will also
  work with just `brandable_css`)

* verify that passing the --watch option to
  `.bin/node_modules/brandable_css` works and picks up changes to
  sass files, images, fonts, or any other resource that goes into
  a css file. and that it only recompiles the css files that actually
  depend on that file.

* go to https://github.com/ryankshaw/brandable_css and check out the
  code there. that is what is actually doing the sass compiling

* create a config/canvas_cdn.yml file and add aws access creds and
  an s3 bucket and cdn hostname (for testing, you can use the credentials
  for instructure_uploads_engineering from
  https://gollum.instructure.com/OtherServiceTestAccounts ). for a test
  cdn hostname you can use https://diu0rq5m1weh1.cloudfront.net. that
  is a cloudfront bucket I set up on my personal account that points to
  instructure_uploads_engineering

* run rake canvas:compile_assets again, this time, at the end, you
  should see it run the assets:precompile task that puts md5s in filenames
  and, gzipps them, and copys them to public/assets.
  then you should see it run canvas:cdn:upload_to_s3
  (look at log/development.log for progress),
  which pushes everything to s3.
  closes: CNVS-17333 CNVS-17430 CNVS-17337

* try out the theme editor: turn on new styles, go to accounts/x
  (where x is the @domain root acount you are testing from) and click
  the "theme editor" button on the right side of the page.
  that should take you to a page that has the ability to pick colors/images
  on the left side and preview your changes in an iframe on the right
  closes: CNVS-19360 CNVS-20551

* test the "preview", "save", "reset", and "choose existing" functionality
  closes: CNVS-17339 CNVS-17338 CNVS-19685

* make sure that the themeeditor works both if you have
  config/canvas_cdn.yml set up and enabled as well as if you don't.
  if it is enabled, you should see it push the css for just that new
  brand config to s3 when you hit preview, and the css
  should be accessible from the cdn you configured.

Change-Id: Ie0a812d04f5eeb40e7df7e71941ff63ea51a4d22
Reviewed-on: https://gerrit.instructure.com/53873
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2015-07-02 22:42:18 +00:00
Dan Minkevitch cf3d13fb53 Fixes issue with setting "or" condition
for "OR" module feature flag

Test Plan:
* Enable "OR" Condition Feature Flag
* Create a module and specify completion
  requirements with the default setting
  that ALL requirements must be met to be
  marked as completed
* Log in as a student that has access
  to the modules; it should not be marked
  as completed if the student hasn't compeleted
  the requirement

Change-Id: I0c45d13c8dd21a0d5c80c4deb49a6c2c68030342
Reviewed-on: https://gerrit.instructure.com/57506
Reviewed-by: Brock Cooper <bcooper@instructure.com>
Tested-by: Jenkins
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Brock Cooper <bcooper@instructure.com>
2015-07-01 19:04:21 +00:00
Abhishek Singh ac2118e36f Negative quiz group question points
Fixes CNVS-19918

Test Plan
 - User should not be able to create quiz group with negative question points

Change-Id: Iff7dd1b8ca952a2fc1e7b81350dfb73b8d308939
Reviewed-on: https://gerrit.instructure.com/57146
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
Tested-by: Jenkins
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Jason Sparks <jsparks@instructure.com>
2015-06-30 21:08:26 +00:00
Dan Minkevitch 56e494f789 Fix permissions issue for changing user login
fixes CNVS-21551

Test Plan:
* Create an Account Role with only
  "Modify login details for users"
  and "See the list of users"
  permissions
* Create a user and assign them to
  the custom role you just created
* Log in as the new user and go to
  another user's profile
* Add/update the one of the login's
  passwords
* It should work successfully and
  show a success message

Change-Id: I3bfa41cbfcfac7a8a5375e8d67e2c59f8b39bfd9
Reviewed-on: https://gerrit.instructure.com/57426
Tested-by: Jenkins
Reviewed-by: Sterling Cobb <sterling@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Dan Minkevitch <dan@instructure.com>
2015-06-30 19:05:19 +00:00
Brock Cooper 23a5d93239 Teacher Edit Module Settings form for CNVS-20853
- Adds radio button for Edit Settings Module for CNVS-20853
- Changes prerequisite list to the header of the module
- adds "pill" info section that says if this is an ALL or OR type of module
- Features will be behind a feature flag

Change-Id: Iee0c32234a49eb3d4ac7fcd5d7ff7b1309d0d53f
Reviewed-on: https://gerrit.instructure.com/56297
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Dan Minkevitch <dan@instructure.com>
Tested-by: Jenkins
2015-06-29 20:14:23 +00:00
Jennifer Stern 780517e63f Update icons for tinymce editor
refs CNVS-19605

Note: added two new icons to the canvas iconset (equation, equella)

Test plan:

- Enable the kaltura plugin at /plugins/kaltura (see https://gollum.instructure.com/OtherServiceTestAccounts#Notorious-(NO-MORE-KALTURA-YAY))
- Enable the Equella feature for the account
- Verify that the link, image, equation, record video and equella icons are updated (http://cl.ly/image/2H3m331w0f1O)
- Hover states should match the other menu buttons

Change-Id: I91c298f3dcb2146748d6104342aa265eb43462e9
Reviewed-on: https://gerrit.instructure.com/56283
Tested-by: Jenkins
Reviewed-by: Colleen Palmer <colleen@instructure.com>
Product-Review: Colleen Palmer <colleen@instructure.com>
QA-Review: August Thornton <august@instructure.com>
2015-06-29 19:48:39 +00:00
Brock Cooper 5a51f6e09f Fixes accessibility shortcut keys for modules
Fixes CNVS-206051

Testing Plan:
1. Go to the Modules page.
2. Press the "," key to open the menu to see what the hotkeys are.
3. Try out all the listed shortcut keys (j, k, e, d, i, o, n, up, down, space)
   to ensure they work as expected

Change-Id: I45cde62c38684394008a01a08ddb5d9a9e1d1342
Reviewed-on: https://gerrit.instructure.com/55094
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Dan Minkevitch <dan@instructure.com>
2015-06-29 18:16:58 +00:00
Jeremy Stanley 1d858ae41c disallow deleting accounts that recursively contain courses
test plan:
 - in a root account's Sub-Accounts tab,
  - create a subaccount containing no courses (directly),
    but a sub-sub-account with courses
  - try to delete the subaccount
  - you should get an error message indicating the subaccount
    can't be deleted because it contains courses

fixes CNVS-21463

Change-Id: I8542d51d992658e4fa852d9a7aaa1e72798ab769
Reviewed-on: https://gerrit.instructure.com/57149
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2015-06-26 21:51:14 +00:00
Strand McCutchen db27cb6462 make online url submissions display as external links
fixes CNVS-18645

When a teacher clicks on a online url submission link
it should behave like an external link and open in
a new tab. This behavior should be maintained even if
the link is internal.

Test plan:

0. In a published course with students…
1. Add a URL submission assignment and publish it.
2. As a student submit http://placekitten.com as
   the assignment submission.
3. As a teacher view the submission in speedgrader,
   and click the submission links in the left frame.
4. Confirm that these links open in a new tab or window.

Change-Id: Id2dc922b0b942344bcc88f56e565bd71105cb48f
Reviewed-on: https://gerrit.instructure.com/53115
Tested-by: Jenkins
Reviewed-by: Dylan Ross <dross@instructure.com>
QA-Review: Adrian Foong <afoong@instructure.com>
Product-Review: Christi Wruck
2015-06-26 21:26:47 +00:00
Brian Finney 773aba7079 Be more specific about where to fill in comments
Fixes CNVS-20858 and CNVS-20711

Test plan:
 - Create a quiz with a matching question
 - Add comments on the matching answers and save
 - Edit matching question and save
 - Edit and preview quiz, maching prompts should be correct

Change-Id: I9ce30aef94769bf353fface3e5ea656af3dfbc5b
Reviewed-on: https://gerrit.instructure.com/57238
Tested-by: Jenkins
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Brian Finney <bfinney@instructure.com>
2015-06-26 19:17:04 +00:00
Brad Horrocks 2481c938eb JS tests for lti content-items in tinymce
LTI link in iframe with thumbnail
LTI link as url to new window
LTI link as iframe
Regular URL in current frame
Regular URL in iframe with thumbnail

Fixes: PLAT-1122

Test Plan:
Regression test LTI Launches in TinyMCE :D

Change-Id: I2b43398a2cdc4707e898a68848e7260adc9a4079
Reviewed-on: https://gerrit.instructure.com/57122
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
2015-06-26 18:50:28 +00:00
Rob Orton 468335ce13 add danish and swedish languages
closes CNVS-21324

javascript timezone locale file for swedish already existed, and used it
as a template for danish given their similarities, then updated based on
http://std.dkuug.dk/cultreg/registrations/narrative/da_DK,_4.3.html

Change-Id: I28d03ee26f04e7802b31992a63ec8051f43f29ce
Reviewed-on: https://gerrit.instructure.com/56981
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
2015-06-25 21:39:48 +00:00
Chris Hart 8d3c65e563 Add loading spinner to new nav trays
Refs: CNVS-21198

I ended up using text as well as the panda-loader
image because I found the loader image would
generally load after or at the same time as the
course data. Please see the screencast below.

http://screencast.com/t/QAVAmxAy9

UPDATE - Jen suggested CSS-only preloading, which
seems to have worked great. The panda-on-a-bike is
now being loaded as a background of another element
and then is positioned off-screen.

QA Test Plan:
- Make sure the Use New Styles feature flag is on
  and your cache is cleared
- Load the Canvas dashboard (or any other page)
- Before everything has finished loading, click
  on the Courses, Accounts or Groups links in the
  primary navigation
- You should now see the word "Loading ..." before
  the content loads. If the content takes long
  enough to load, the animated GIF of the panda on
  a bike should appear.

Change-Id: Ib8c8cd73c94e7d735db505d7ba2e2276c48597e0
Reviewed-on: https://gerrit.instructure.com/57100
Reviewed-by: Jennifer Stern <jstern@instructure.com>
Tested-by: Jenkins
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Chris Hart <chart@instructure.com>
2015-06-25 20:11:30 +00:00
Ethan Vizitei aa349e812a fix rce image linking in Firefox
closes CNVS-21204

make firefox treat rce image linking appropriately.  Prior to this
patchset it would make the alt text a link instead of wrapping the image
tag in a link tag.  The reason is the way we decide whether to wrap
DOM content, or make a new text link and replace existing DOM.  In the
case of some DOM element which has HTML, but for which
"editor.selectContent({format: 'text'})" returns a blank string, we've
usually interpreted that as something image-like that should probably
just be wrapped.  The problem is that Firefox gives us the alt
text when we ask for the "text" of that node, throwing off our
check.  This patchset makes the text extraction explicitly check
for the case of an image node with alt text and treat that the same
for the purpose of content sniffing, and seems to fix the problem.

TEST PLAN:
 1) use firefox
 2) go to any RCE
 3) embed an image
 4) now select the image and try to make it a link
 5) it should work

Change-Id: I65695b1d73d3c4855c8d63848578ba94a4c5c672
Reviewed-on: https://gerrit.instructure.com/57181
Tested-by: Jenkins
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: August Thornton <august@instructure.com>
2015-06-25 19:26:55 +00:00
Cameron Sutter d93cf89e3b preview quiz doesn't show time's up
fixes CNVS-19373

test plan:
 * as a teacher
 * create a quiz that is locked after the next minute or less
 - preview the quiz
 > there should not be a little dialog that pops up and says
   that you only have 9 seconds left to take the quiz
 - leave the preview and try it again, making sure the locked
   date/time has passed

Change-Id: I8a75a63e41f49c64a62442b5fed77e26e52c358e
Reviewed-on: https://gerrit.instructure.com/56663
Reviewed-by: Brian Finney <bfinney@instructure.com>
Tested-by: Jenkins
QA-Review: Adam Stone <astone@instructure.com>
Product-Review: Jason Sparks <jsparks@instructure.com>
2015-06-25 15:52:52 +00:00
Sterling Cobb c0bebb97c5 add error message for duplicate SIS ID
fixes CNVS-21330

Error messages for duplicate sis id's were not being displayed when
creating a new user for sub accounts. Error messages should now show up.

Test Plan

Given you have SIS accounts enabled for your account
And you have a sub-account created
And you have a user with 1000 as the SIS id created
When you attempt to create another user
And you use 1000 for it's SIS id
Then you should get an error message that says that id is taken
And that user should have not been created

Change-Id: I91300d67867a0213ae0763cdd1e51cfa26c50ba4
Reviewed-on: https://gerrit.instructure.com/57097
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2015-06-25 15:49:30 +00:00
Weston Dransfield 25540dd05a Support window presentaiton_document_target for module items.
Fixes PLAT-1128

Test Plan:
 - Install lti test tool (https://github.com/rivernate/lti_tool_provider_example) and make sure the module item placement is selected
 - Add a module item and choose 'External Tool' as the type.
 - Find the app you just installed and click on it.
 - When the modal pops up click the green '+' in the top right cortner to add a content-item
 - Fill in the values however you want, just make sure 'Presentation Target' is set to 'window'
 - Click 'submit' and then 'Add Item'
 - Click the link in the module item and make sure it goes to a page with a button that says 'load <tool name> in a new window.'
 - Click the button and make sure the tool loads in a new tab
 - add another content item but this time set 'Presentation Target' to 'frame'. Make sure this tool loads in an iframe rather than a new tab

Change-Id: Ic6654bf40dd5aef0141aa4199b13bb58e03906eb
Reviewed-on: https://gerrit.instructure.com/56971
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2015-06-24 15:16:16 +00:00
Chris Hart c656a3a41f Newer, better checkbox toggles
Refs: CNVS-21032

This commit introduces a new and improved checkbox-that-
looks-like-a-toggle-switch, designed to address the
problems with the original .ic-Toggle.

Note: This toggle is NOT being used anywhere right
now except the styleguide.

Test Plan:
- In either Canvas UI, go to
  [canvas-url]/styleguide#forms
- Scroll down until you reach the Super Toggle
  Checkbox section.
- Test the new super toggle checkbox in supported
  browsers.

Change-Id: I092fd0d45c6efef178a276d78e618391a3cfa715
Reviewed-on: https://gerrit.instructure.com/56219
Reviewed-by: Jennifer Stern <jstern@instructure.com>
Tested-by: Jenkins
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Chris Hart <chart@instructure.com>
2015-06-24 13:32:55 +00:00
Nathan Mills 376c395c48 fix bug in ie where it won't return content-items
fixes: PLAT-1121

test-plan
*try to add a (content-item/resource selection) from modules usin ie 10/11
*it should add the item

Change-Id: Ia3bba2f321d77735913954c8b001d6935a382661
Reviewed-on: https://gerrit.instructure.com/56965
Tested-by: Jenkins
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2015-06-23 17:19:37 +00:00
Ethan Vizitei 63bf93a3f7 replace google-plus icons with google icons
closes CNVS-21027

TEST PLAN:
1) add google as an authentication provider
2) get a pseudonym for your user affiliated
3) on the login page for canvas (/login/canvas) there should be a
  google icon (no "+") next to the "Login with google" text
4) on the pseudonyms page, your google pseudonym should have a google
 icon (no "+")

Change-Id: I95450a969d74fa0cb687fc1e9d5003c53a28f69a
Reviewed-on: https://gerrit.instructure.com/56862
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2015-06-22 18:44:08 +00:00
Ethan Vizitei d066f4b7f2 remove dead code
closes CNVS-19331
refs CNVS-15543

The plan was to make date pickers in shared/_add_assignment accessible,
but when I tried to use the partial in the one place it still
gets included (context module inline assignment creation), it
doesn't even get used anymore.  Removing
this code entirely.

TEST PLAN:
  1) context module editing and assignment adding should not break
  2) tests should all pass

Change-Id: Ib1c88a963aecbbe4f15f3b6824ffb6a9e9eea4e9
Reviewed-on: https://gerrit.instructure.com/56673
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2015-06-18 19:20:19 +00:00
Jacob Fugal 0459456e36 localize datepicker UI
fixes CNVS-3194

test-plan:
 - lolcalize!
 - open the widget for a date+time datepicker
 - the following should be localized:
   - hover text for arrow to navigate to previous month
   - hover text for arrow to navigate to next month
   - month name
   - column headings
   - hover text (full day name) for column headings
   - "Time:" label at bottom (though this should have been already)
   - "Done" button at bottom (though also should have been already)
   - hover text for hours field
   - hover text for minutes field
   - value in hours field (24-hour behavior, not 12-hour)
   - presence of am/pm dropdown

Change-Id: Ie0c379dc6d2a3947c64a1b00a8db63632e51f6af
Reviewed-on: https://gerrit.instructure.com/53818
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2015-06-18 17:46:27 +00:00
Ethan Vizitei e2dba409f0 remove dead code
closes CNVS-19322
refs CNVS-15543

Was going to make the datepicker here more accessible, but it
looks like we no longer do assignments with a type of 'attendance', so
all this code for creating new ones like that is dead and should go
away.

TEST PLAN:

 1) tests should pass
 2) /courses/x/attendance should not be broken for any courses that have
   assignments with a type of "attendance" (only very old courses should
have this), but they shouldn't be able to create *new* assignments like
this (which is what we removed)

Change-Id: I78c3ce794f387e15af8ef4f064cb36fc1b675718
Reviewed-on: https://gerrit.instructure.com/56603
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2015-06-17 17:52:41 +00:00
Dan Minkevitch a63e6a6ec4 Removed old files javascript
With fire!  (For sanitization)

Change-Id: Iea39f04aa85b2f145123734918a9154827e6929c
Reviewed-on: https://gerrit.instructure.com/55717
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Dan Minkevitch <dan@instructure.com>
2015-06-17 02:16:54 +00:00
Brad Horrocks 468f48475a Create LtiThumbnailLauncher
This plugin will load on every page. It adds a delegate click handler
for 'lti-thumbnail-launch' to the body. The handler will replace the
element clicked with an iframe to the launch URL, it uses the target
attribute to store the placement info.

Ref: PLAT-1083

Test Plan:
Create different lti launches with a mixture of the following options
target: [window, iframe]
thumbnail: [{
      "@id": "http://developers.imsglobal.org/images/imscertifiedsm.png",
      "width" : 147,
      "height" : 184
    }, null]

This can easily be accomplished with the lti test tool

Change-Id: I408fac500b6a38de0ea81ef79e8c0e46e105b4a7
Reviewed-on: https://gerrit.instructure.com/56344
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
2015-06-17 01:59:44 +00:00
Brad Horrocks 4eae0d0d9b Create thumnail link for LTI launch inside the RCE
When we get a ConentItemSelection response that supports a
thumbnail we need to create an HTML element with the information
necessary to allow a plugin to create the actual overlay.

This is only for LtiLink Content Items, with a presentation document
target of "iframe" and a thumbnail or icon attribute

Ref: PLAT-1082

Test Plan:
use the test tool to create an lti link with a thumbnail
make sure it shows up with a thumbnail.
PLAT-1083 will civer testing the actual functionality

Change-Id: Id90f11e26571a61a153d5a825670ef8e1636d38e
Reviewed-on: https://gerrit.instructure.com/56343
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
2015-06-17 01:59:33 +00:00
Ethan Vizitei 93c612b822 fix auth selector for AACs
closes CNVS-21177

Turns the auth type selector into a react component
and makes sure it responds correctly in a couple
corner cases (with specs!)

TEST PLAN:

1) go to the authentication providers config page
2) add several authentication providers
3) you should always be scrolled down to your new
  form when you add a new one

Change-Id: Ia520ee358dbc8a469e29e13fcd653cf11f9259b3
Reviewed-on: https://gerrit.instructure.com/56377
Tested-by: Jenkins
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2015-06-16 15:49:24 +00:00
Ryan Taylor a4103e27e2 Fixes bad JS ajax attempts to QLA for admin/teacher users
Closes CNVS-21056

Test Plan:
  - Visit quiz#show page and see no JS console errors (404 or 401)
  - Preview a quiz and see no JS console errors (and no events logging)

Change-Id: I4c756a2ec1ca1f2ee9d374b9a6b3a6d29f998f5f
Reviewed-on: https://gerrit.instructure.com/56068
Tested-by: Jenkins
Reviewed-by: Brian Finney <bfinney@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Jason Sparks <jsparks@instructure.com>
2015-06-16 15:37:13 +00:00
Steven Burnett 4afb53e6ab fixes screenreader with collaborations
fixes the screenreader interaction with deletion of
collaborations

fixes CNVS-20924

test plan:
- create a collaboration (any/all collaborations)
- with screen reader turn on delete the collaboration
- notice screen reader informs you once its deleted
- notice you are redirected correctly to the next item
  or previous item

Change-Id: I6e965e9eb6cb79dae0759090eeb2581ffac5efbe
Reviewed-on: https://gerrit.instructure.com/56020
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
Tested-by: Jenkins
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: Aaron Cannon <acannon@instructure.com>
2015-06-12 20:28:13 +00:00
Sterling Cobb be3a2572a5 notify screenreaders when module item is deleted
fixes CNVS-20922

When you delete a module item it should tell the screenreader that a
module item has been deleted as well as show a notification at the top
of the page for normal users.

Test Plan
Senario: Deleting a module item with a screenreader
So I know that the module item I tried to delete was really deleted as
a screenreader user
Given I have a module with a module item in it
And I'm on the modules page
And I'm using VoiceOver with Safari
When I open a module item's admin cog
And deleted a module item via the cog
Then a notification should appear on the top of the page saying iv'e
deleted a module item
And the screenreader should announce the message on the top of the page
And the message should include the name of the module item

Change-Id: I67b9f5fc9ec2354e6a7cfe875d6135632907d2d9
Reviewed-on: https://gerrit.instructure.com/56220
Tested-by: Jenkins
Reviewed-by: Dan Minkevitch <dan@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
2015-06-12 17:54:08 +00:00
Sterling Cobb 0aec063141 display a notification when deleting a module
fixes CNVS-20920

Screenreaders should be notified when a module is deleted

Test Plan
Senario: Deleting a module with a screenreader
So screenreaders know that a module has been deleted when deleting
modules
Given I have a module
And I'm on the modules page
And I'm using a VoiceOver in Safari
When I navigate to the module admin cog
And I deleted that module
Then a notification message should appear at the top
And it should be read by the screenreader
And it should tell me my module has been deleted
And the module name should be read in the message

Change-Id: I415a67ca98267018f95c09900da835dc05fb3974
Reviewed-on: https://gerrit.instructure.com/56217
Tested-by: Jenkins
Reviewed-by: Dan Minkevitch <dan@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
2015-06-12 17:54:03 +00:00
Ethan Vizitei e35a5d29b1 double submit protection for oauth access
closes CNVS-20999

when a user goes through the oauth flow and gets redirected to some
third party service that takes a long time, they may hit the submit button again.
This can cause requests to stack because "oauth accept" is not
idempotent, it wipes out the oauth session data after the first access
grant.  This does a typical "change the text and disable the button"
response in the confirmation form.

TEST PLAN:

1) introduce a long delay to "login/oauth2/accept" with a sleep or
something to simulate a long-running 3rd party redirect
2) Create or find a DeveloperKey for your account, make sure it has
a redirect uri, and start the oauth flow with something like:
"http://localhost:3000/login/oauth2/auth?response_type=code&client_id=[developer_key_id]&redirect_uri=[uri_that_matches_developer_key_redirect_uri]"
3) make sure that you can't click the accept button over and over again.

Change-Id: Ic08861254f15934c109b2b1a6229183330829cf3
Reviewed-on: https://gerrit.instructure.com/55911
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2015-06-11 17:25:11 +00:00
Tyson Brown d71945faad Register Parents and Add Observees when configured for SAML
authentication

Fixes PFS-1084

Parent Registration:
When a Saml config is designated for Parent Registration the parent
signing up will be redirected to a Saml login page where they will log
in with their child's credentials.  After login the child user's
Saml session will be ended and the parent registration process will complete.

Parent Adding Student:
When a Saml config is designated for Parent Registration the parent
adding another observee will be redirected to a Saml login page
where they will log in with their child's credentials.  After login the child user's
Saml session will be ended and the observee creation process
will complete.

---------------------------------------
TEST PLAN:
SETUP:
1) In your account settings check the box for 'Self Registration' (and
either of the sub-options)

2) Add the following users to your account (these will be the students):
billyjoel
eltonjohn

3) In Authentication Settings add a SAML authentication service
and enter the following fields (I've set up a remote SAML Idp):

IdP Entity ID:  http://107.170.212.143/saml2/idp/metadata.php
Log On URL:  http://107.170.212.143/simplesaml/saml2/idp/SSOService.php
Log Out URL:
http://107.170.212.143/simplesaml/saml2/idp/SingleLogoutService.php
Certificate Fingerprint:
9C:11:68:93:95:CD:18:01:EC:52:2B:9E:22:7F:73:55:ED:6D:82:D4
Parent Registration:  check

TEST:
Parent Registration:
* Go to '/login/canvas'
* Click on the signup banner
* sign up as a parent for billyjoel or eltonjohn
  (on SAML login page the password for either user is: tantrum)

Add Student:
* Log in as a parent user w/ a Canvas Auth login
* Go to '/profile/observees'
* Add Student 'billyjoel' or 'eltonjohn'

Authentication Settings (new parent reg checkbox):
* Go to Authentication Settings
* Add a second SAML config
* check the parent registration checkbox
  - it should warn that selection will deselect the other
    and in fact do so upon save.
  - the selected config is the one used for
    parent reg/add student
---------------------------------------

Change-Id: Ief83b604fc252c88dbb912c56de65d8620fe802f
Reviewed-on: https://gerrit.instructure.com/49691
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2015-06-11 15:25:19 +00:00
Colleen Palmer e8dd470a72 Dashboard Cards Dashboard
fixes CNVS-20119; fixes CNVS-20139; fixes CNVS-20140;
fixes CNVS-20424; fixes CNVS-20426

This adds a new Dashboard view when using New UI.

Note: This is for New UI only. Legacy UI should only show Recent Activity on
dashboard (as it always has).

Test Plan:

- Login and make sure new UI is on
- Go to / and see the new Dashcard view.
It should look similar to: http://cl.ly/image/2R2K28183h2G

- Switch to "Recent Activity" by using the toggle
It should look similar to: http://cl.ly/image/2l1V1h421b0d

- Dashboard Cards have quick links on the bottom to quickly let you
navigate to within a course. These include:

- Discussions (if available)
- Announcements (if available)
- Files (if available)
- Assignments (if available)

If activity has happened in Announcements, Assignments or Discussions, an
active state is given to the quick link that makes it look like this:

http://cl.ly/image/1d3Y0T3w1Q01

Change-Id: Ia07f7f2711d6e0625d26d7ea5d050ccb51dc0128
Reviewed-on: https://gerrit.instructure.com/53043
Reviewed-by: Jennifer Stern <jstern@instructure.com>
Product-Review: Colleen Palmer <colleen@instructure.com>
Tested-by: Jenkins
QA-Review: Adam Stone <astone@instructure.com>
2015-06-10 22:55:43 +00:00
Ryan Shaw b941e61993 delete contextColors, it wasn't being used.
...by anything other than a spec to test it.

Change-Id: Iff2be8b0f5fe943d507ba0fb72487579bb3bef4b
Reviewed-on: https://gerrit.instructure.com/55884
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2015-06-10 21:20:03 +00:00
Spencer Olson b97f28ab57 warn user of unsaved comments in speedgrader
when a user is leaving speedgrader (exiting the window, linking
to another page, or refreshing the page), they will be prompted
with a message if they have unsaved comments on the page. the prompt
will give the user the option to 1) stay on the current page, or
2) continue on to the next page. If all comments have been saved,
however, the page will not prompt the user with a message.

note: firefox versions 4+ will always display the same generic
message: 'This page is asking you to confirm that you want to
leave - data you have entered may not be saved.' this is a
documented feature and there is no way to customize the message
for FF (see 'Notes' section at https://developer.mozilla.org/en-US
/docs/Web/Events/beforeunload)

closes CNVS-10809

test plan:

create a quiz as a teacher, and then log in as a student and take
the quiz. then log back in as a teacher and go to the speedgrader.
enter some text in the 'Add Comment' section on the right-hand side
of the screen but _don't_ click the 'Submit Comment' button. try
navigating away from the page (x out of the window, refresh the
page, or click on a link that takes you to another page) and verify
that a prompt shows up telling you that there are unsaved comments.
this prompt should not show up if you have saved all your comments
before navigating away from the page.

edge cases considered: try entering a comment of ONLY space characters,
and don't click the 'Submit Comment' button. when you navigate away
from the page you should _not_ get a prompt, since a blank comment is
not considered a comment that needs saving.

Change-Id: I198738814cdec9e6ca78a670ba06b15c5a1af836
Reviewed-on: https://gerrit.instructure.com/55553
Tested-by: Jenkins
QA-Review: Adrian Foong <afoong@instructure.com>
Reviewed-by: Strand McCutchen <smccutchen@instructure.com>
Product-Review: Spencer Olson <solson@instructure.com>
2015-06-08 19:42:19 +00:00
Ryan Shaw 09a32ccb6d fix js syntax warning in tinymce.command.js
without this, jenkins was saying:
public/javascripts/tinymce.commands.js(44): lint 
warning: regular expressions should be preceded by 
a left parenthesis, assignment, colon, or comma
...
(!/^<a [^>]+>[^<]+</a>$/.test(maybeHtml) ||

Change-Id: I8274a860b3bb66dfa0985d86e8faa556e106d2f2
Reviewed-on: https://gerrit.instructure.com/55885
Tested-by: Jenkins
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2015-06-08 18:04:36 +00:00
Ryan Shaw 50054fb25b mv public/font public/fonts (so it works with asset pipeline)
the rails asset pipeline expects fonts to be
in the 'fonts' directory of it's assets folder.

since we're using it to put md5s in our urls,
I'm moving it there

test plan:
* no changes, 
* load page and ensure icons and fonts still work

Change-Id: Iec3a1b04259b1d74fbfa98f9ecc53d98e972e02a
Reviewed-on: https://gerrit.instructure.com/54805
Tested-by: Jenkins
Reviewed-by: Jennifer Stern <jstern@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2015-06-08 18:02:55 +00:00