Commit Graph

35704 Commits

Author SHA1 Message Date
Adrian Packel 93fc19368b Set post policies for existing assignments
Set post policies on existing assignments and courses as appropriate,
and update the posted_at values of submissions belonging to the
asignments to match.

closes GRADE-1946

Test plan:

NOTE: This patchset will enable automatic creation of PostPolicy objects
for new assignments and courses. For your test data to be in the proper
form (i.e., with no PostPolicy objects attached), you should either
create it with a previous patchset or--if you use this patchset--delete
the resultant PostPolicy objects via the console.

(In the test plan below, a "manual post policy" refers to a PostPolicy
object for the specified course or assignment with post_manually set to
true, while an "automatic post policy" refers to one with post_manually
set to false.)

- Set up a course (C1) that:
  - Does *not* have a default_post_policy object (i.e., no PostPolicy
    object exists with course_id = C1 and assignment_id = nil)
  - Has the following assignments:
    - A non-moderated, non-anonymous assignment (A1)
    - A non-moderated, non-anonymous MUTED assignment (A2)
    - A moderated assignment (A3)
  - Assign grades for some (not all) submissions on each assignment
  - For A3, have the moderator do some moderating and then post
    all grades
- Set up a course (C2) that *does* have a default_post_policy
- Run the migration, and then check the following
  - For C1:
    - The course itself should have an automatic post policy created
    - For A1:
      - An automatic post policy should be created
      - The posted_at date of *graded* submissions should be set to
        their graded_at date
      - The posted_at date of ungraded submissions should be nil
    - For A2:
      - A manual post policy should be created
      - The posted_at date on all submissions should be nil
    - For A3:
      - A manual post policy should be created
      - The posted_at date on all submissions should be set to their
        graded_at time (which should be when grades were published)
  - C2, since it has a post policy already, should be ignored entirely,
    and all assignments within it should be ignored
- On further runs, C1 should be ignored since it has a post policy now

Testing new behavior:
- With the post policies flag NOT enabled, check that:
  - Muting an assignment assigns it a manual post policy
  - Unmuting an assignment assigns it an automatic post policy
    - ...UNLESS it is anonymous
  - Creating a new assignment should create a post policy for it
    - If anonymous/moderated, the policy should be manual
    - Otherwise it should default to the course's post policy
      (or to automatic if the course inexplicably has none)
  - Creating a new course should always create an automatic
    post policy for the course
- Check that the same behavior holds with the flag enabled

Change-Id: Ib2fbfc2342a1282c1a6942cc68b2aeccbbc73b70
Reviewed-on: https://gerrit.instructure.com/196237
Tested-by: Jenkins
Reviewed-by: Keith Garner <kgarner@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
QA-Review: Gary Mei <gmei@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
2019-06-10 18:25:32 +00:00
Ryan Shaw 2b80747e47 Also handle data: urls in returnToHelper
Fixes: CORE-3006

in g/176856 we fixed an xss vulnerability but we only fixed it for
javascript: links. This also fixes it for data: links

test plan:
- add 
?return_to=data:text/html;base64,PHNjcmlwdD5hbGVydCgiaGkiKTwvc2NyaXB0Pg== 
  to the end of the url for:
  - editing a discussion topic
  - editing an assignment
- click save
- should not show the alert

Change-Id: Ib8959d457ecd973761c0ebbba86cc5b15f072b56
Reviewed-on: https://gerrit.instructure.com/195417
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
2019-06-10 18:16:28 +00:00
Ryan Shaw d4b2ae0020 Make sure return_to is safe for quiz edit cancel btn
Fixes: CORE-2959

Test plan:

* Follow the repro steps in the linked jira ticket
* you should not be able to reproduce it

Change-Id: I60799db6f2e573411ef5c7daa9b4620e58a2523e
Reviewed-on: https://gerrit.instructure.com/195411
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
2019-06-10 18:16:15 +00:00
Ryan Shaw e73195d0f9 Use an attribute we can trust for prereqs lookup
Fixes: CORE-2936

Test Plan:
Login as student.

Must be participant of the any group.

Open group.

Open pages of the group.

Create (or edit existent) page with following content: 
<p>
  <a id="module_prerequisites_lookup_link" 
    href="https://test.ddv.in.ua/xssCanvasJSON.php"></a>
</p> <div class="spinner"></div>

Save.

Wait until page loaded and click XSS link.

You should NOT See alert with your cookie & domain.

Change-Id: I9f89ad13e6ae9fdc2efce703500ba1065a7ad176
Reviewed-on: https://gerrit.instructure.com/194849
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
2019-06-10 18:16:05 +00:00
Mysti Lilla c185cb5ab5 Update visual on override summary
closes ADMIN-2648

Test plan
- Set up some overrides in an assignment
- Load up the assignments 2 view
  and verify it looks like the summary
  mockup in this ticket

Change-Id: Ib71f6f2ba98adef4608f4813cfce7dd9a8d29767
Reviewed-on: https://gerrit.instructure.com/196975
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Mary Anderson <manderson@instructure.com>
2019-06-10 17:43:34 +00:00
James Williams a93b54b55b use cache register for course permission enrollment queries
Change-Id: I75ea0ed7d2f3a41108079d0cc58db444387fc518
Reviewed-on: https://gerrit.instructure.com/196606
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2019-06-10 17:24:06 +00:00
Jeremy Stanley dc7a511c8a conditionally render prev/next in course card image search
test plan:
 - in a course card image search,
   - the prev/next buttons appear only at the bottom
   - the prev/next buttons are on the left/right sides of the page
     instead of the middle
   - the prev button does not appear on the first page
   - the next button does not appear on the last page
     (actually I don't think it's possible to find a last page)
   - after selecting the next page button, it should retain
     keyboard focus after the next page loads
   - after selecting the prev page button, it should retain
     keyboard focus, unless you just went to the first page,
     in which case the next page button should be focused
   - If the next/previous page direction fails for some
     reason and both next and previous buttons disappear
     it will go to the input

fixes ADMIN-2673

Change-Id: I65fb39454d2f736cd75b310af93c2e06ce7f28c8
Reviewed-on: https://gerrit.instructure.com/196101
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Carl Kibler <ckibler@instructure.com>
QA-Review: Daniel Sasaki <dsasaki@instructure.com>
Product-Review: Lauren Williams <lcwilliams@instructure.com>
2019-06-10 17:13:27 +00:00
Ryan Norton a1eee72914 add fake Calculated By string in a2 header
to visually demonstrate what the 'Calculated by' element
will look like for the InstructureCon demo we are adding a
non-functional string into the header.

this is not intended to be interactable, but per designs we want
it to look like a link and are using an empty anchor tag for this
purpose. empty anchor tags should never be used as they're not
keyboard accessible, but because this will be replaced shortly
after the demo and will never be interactable it is sufficient.

fixes COMMS-2097

Change-Id: I38bec1a796f897969f86949e63b52016c07aa5ba
Reviewed-on: https://gerrit.instructure.com/197014
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Tested-by: Jenkins
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Ryan Norton <rnorton@instructure.com>
2019-06-10 16:40:15 +00:00
James Williams b0c770470d add variable substitution for section restriction
test plan:
* set up a tool with the "$Canvas.course.sectionRestricted"
 LTI variable substitution
* it should correspond to whether the user was enrolled
 with "Can interact with users in their section only" checked

closes #PLYT-2349

Change-Id: I567a57927f0e5ec1b2dd34529262257f7dc9b527
Reviewed-on: https://gerrit.instructure.com/196878
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: Nathan Mills <nathanm@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2019-06-10 16:35:12 +00:00
bootstraponline cd6026df2c Update auto_assign.yml 2019-06-10 10:08:39 -06:00
James Williams 5f9d0253e6 create system to modify up-front request cost by path
closes #CORE-3058

Change-Id: Ie516ce40572cc363a13e613f387319e9c60a97af
Reviewed-on: https://gerrit.instructure.com/196909
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2019-06-10 15:29:10 +00:00
James Williams 1fe47aa0cd validate group sis_source_id uniqueness
test plan:
* try to create a group via the api with a sis id already in use
* should return a useful error

closes #COMMS-2119

Change-Id: I8caf2f8f835de7f3fdab7a09f54212acfb5d8773
Reviewed-on: https://gerrit.instructure.com/197043
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2019-06-10 15:25:33 +00:00
Ryan Shaw 8c04a20537 canvas-rce: Fix table resizing
Closes: CORE-3043

Test plan:
* go to an editor
* add a table
* you should be able to resize it
* like this: 
https://instructure.slack.com/files/U0296D4BU/FKF7R559C/got_table_resizing_working.mov

Change-Id: Idafa033adce845f939487825a797a41de7600992
Reviewed-on: https://gerrit.instructure.com/196989
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Ed Schiebel <eschiebel@instructure.com>
Tested-by: Jenkins
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-06-10 15:08:27 +00:00
Erin Hallmark 2030dc1d00 Update description for course content - view permission
Closes: DOC-1065

Test plan:
- In global navigation, open Permissions link
- Click Account Roles tab
- Click Course Content - view permission
- Expand What it Does heading in sidebar
- View New Gradebook addition

Change-Id: I54a74ff547767e791d8f5115a096bb5c546b7210
Reviewed-on: https://gerrit.instructure.com/197024
Tested-by: Jenkins
QA-Review: Erin Hallmark <erin@instructure.com>
Product-Review: Erin Hallmark <erin@instructure.com>
Reviewed-by: Steven Burnett <sburnett@instructure.com>
2019-06-10 14:23:56 +00:00
Transifreq bc3f6c8898 update tr translation
Change-Id: I0c0ee7ddaf5796cb1b545648acfdf1917d7674ea
2019-06-10 05:52:14 -06:00
Transifreq 18f8c06813 update tr translation
Change-Id: I8644f0640c64ea2fa6353d3a17415c378faafe16
2019-06-09 05:52:42 -06:00
Erin Hallmark a85b7972f7 Update API changelog 2019-06-22
CLOSES: DOC-1071

Test plan:
- check change log page for 2019-06-22 entry
- Jenkins is happy

Change-Id: I1f392594c65aa3d781aa3ed648617c78303d43e0
Reviewed-on: https://gerrit.instructure.com/197021
Tested-by: Jenkins
QA-Review: Erin Hallmark <erin@instructure.com>
Product-Review: Erin Hallmark <erin@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
2019-06-08 21:22:19 +00:00
Ed Schiebel e6097b44ee Add keyboard handles to click tray buttons
The buttons in the course links and course documents panels
are actually divs with role="button" and were missing a keyboard
event handler to click

closes CORE-3042

test plan:
  - load a course page with the rce
  - select Links > Course Links
  - tab until you're on a link
  - type <Enter> or <Space>
  > expect the link to be added to the rce
  - repeat from Documents > Course Documents

Change-Id: Icc6f251327ce424e8debaaf23b516668f9c5584b
Reviewed-on: https://gerrit.instructure.com/196698
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2019-06-08 12:18:55 +00:00
Ed Schiebel fa06c7614a Update course link icons
Pages -> documents icon
Navigaion -> no icon

closes CORE-2872

test plan
  - open /courses/:course_id/assignments/new in a course with some pages
  - select Links > Course Links from the RCE toolbar
  - expand the Pages section in the tray
  > expect the document icon
  - expand the Navigation section in the tray
  > expect no icon, but the items are lined up correctly because
    the space is properly taken up by a blank icon

Change-Id: I92265f017249aac64271f14e5439989f6e59a33a
Reviewed-on: https://gerrit.instructure.com/196704
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2019-06-08 12:18:33 +00:00
Ubuntu 1cdde9a40a update locales with new translations
Change-Id: I1546c0be415800d7f0a67a95a79dcb6d2d486e78
Reviewed-on: https://gerrit.instructure.com/197019
Tested-by: Jenkins
2019-06-08 10:43:45 +00:00
Kai Bjorkman 032b64f39e fixes PLAT-4566
unskipped a tests that checks for ability for
duplicate originality report attachment ids

Change-Id: I81f2bdec5f13b86e5cb4158246bdb47b722b96de
Signed-off-by: Kai Bjorkman <kbjorkman@instructure.com>
Reviewed-on: https://gerrit.instructure.com/196910
Tested-by: Jenkins
Reviewed-by: Tucker Mcknight <tmcknight@instructure.com>
2019-06-07 22:51:28 +00:00
Jon Willesen 8d46ea28c1 rce: add external tools toolbar button
Note: this does not handle LTI icons. We are only displaying the title
of the tool for now until we implement the dialog we'd like.

fixes CORE-2988

test plan:
- If there are no external tools configured, there should not be a plug
  icon in the rce toolbar.
- If there is at least one external tool configured, there should be a
  plug icon dropdown menu in the toolbar that contains all the
  configured lti tools.
- Clicking on a tool should open up the existing LTI dialog and it
  should be able to embed the tool into the rce.

Change-Id: Ibbfb412b1485a459e74cdc52ea903507b8ab2fd1
Reviewed-on: https://gerrit.instructure.com/196827
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
2019-06-07 22:18:04 +00:00
Drake Harper 540db8d275 Create Developer Key update endpoint for public_jwk update
fixes PLAT-4492

Test Plan
-Create test tool
-Use tool to create developer key in canvas
-Change tool credential oauth_client_id to match
	client id from developer key
-Go to http://lti13testtool.docker/developer_key/update_public_jwk/21
-Verify that public JWK was changed:

Change-Id: Ic09a665d4ab14d3423b7e4b2a3a51296c0617981
Reviewed-on: https://gerrit.instructure.com/194447
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Jesse Poulos <jpoulos@instructure.com>
2019-06-07 21:43:56 +00:00
Mysti Lilla 03b0bb604d Ensure focus indicator works in Firefox
fixes ADMIN-2675

Test plan
- Ensure focus styles work and look nice
  in all supported browsers

Change-Id: I54f1d46e422322bad1adc9d240e9f565465f5654
Reviewed-on: https://gerrit.instructure.com/196728
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Daniel Sasaki <dsasaki@instructure.com>
2019-06-07 20:26:28 +00:00
Ryan Shaw 421b142f19 Only load findLinkForService when it is used
This commit moves findLinkForService and getUserServices out of 
`public/javascripts/jquery.instructure_misc_helpers.js`, which is 
included and loaded on every page before anything else is ran, into
a spot where just the 2 things that actually use it can load it and
no other page has to. There is no actual code changes other than moving
these 2 methods.

Test plan:
* the select content dialog should work the same as it always has
* the “main” javascript webpack entry should be smaller

Change-Id: Ie2f35812fd6d473fc16c44ad1c2bdd986a441bdf
Reviewed-on: https://gerrit.instructure.com/194381
Tested-by: Jenkins
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
Reviewed-by: Steven Burnett <sburnett@instructure.com>
2019-06-07 19:57:50 +00:00
Ryan Shaw cae895c9e4 fix $.fudgeDateForProfileTimezone for safari
Fixes: CORE-3061

Safari doesn’t handle passing strings to `new Date(<string>)` like other
browsers do. When you pass a string like that to `new Date()` in Safari,
it gives you back `Invalid Date`  So for this method to continue working
like it historically did, in safari, we need to fall back to Date.js’s 
nonstandard monkeypatched version of Date.parse(<string>).

Test plan:
Dev test:
*run `yarn jspec-watch spec/coffeescripts/instructureDateAndTimeSpec.js`
* when the chrome browser opens, copy the url in the url bar and then
  open that in Safari 
  (it’ll be something like: http://localhost:9876/?id=87294339)
* all the tests should run in safari and they all should pass

Manual test:
* in Safari
* upload a file to your course
* go to /courses/x/files
* the page should load properly and the `Date Created` and 
  `Date Modified` columns for that uploaded file should be correct and 
  the same as what you see when you load the page in chrome

Change-Id: I11bf5291617d881254fc34c4555ec640a623e733
Reviewed-on: https://gerrit.instructure.com/196896
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
2019-06-07 19:28:15 +00:00
James Butters 0e0642e45b spec: revert the framerate change back to 4
Change-Id: If9371cb5e6821c863aaac9a6ecf85a2290fc2a78
Reviewed-on: https://gerrit.instructure.com/196923
Reviewed-by: Gentry Beckmann <gbeckmann@instructure.com>
Tested-by: Jenkins
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2019-06-07 18:34:25 +00:00
Ed Schiebel d79c6a919b Fix rgb color picker focus ring
closes CORE-3045

test plan
  - load the rce
  - click on text color or background color
  - click on the palette icon in the lower-right corner
  - focus on each of the text input boxes
  > expect the focus ring to be fully visible

Change-Id: I33deae968a93bff2cd001607394b84a1d7e73cf5
Reviewed-on: https://gerrit.instructure.com/196792
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2019-06-07 18:15:42 +00:00
Jeremy Putnam 2d4bed3c98 spec: add test for rce-next preformatted format dropdown
Change-Id: Iee25e40e76273966f7b3032081004cb7c2293a3c
refs: CORE-2633
Reviewed-on: https://gerrit.instructure.com/196135
Tested-by: Jenkins
Reviewed-by: Robert Lamb <rlamb@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Jeremy Putnam <jeremyp@instructure.com>
2019-06-07 15:47:34 +00:00
Jeremy Putnam b8e1915c53 spec: add test for rce-next small header format dropdown
Change-Id: Ie40628b1a867fc685b817159bf07c0273c37f9c2
refs: CORE-2633
Reviewed-on: https://gerrit.instructure.com/196134
Tested-by: Jenkins
Reviewed-by: Robert Lamb <rlamb@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Jeremy Putnam <jeremyp@instructure.com>
2019-06-07 15:47:14 +00:00
Jeremy Putnam 14c0f05545 spec: add test for rce-next subheader format dropdown
Change-Id: I2fffd0e527d24c58ea372df5c38bd66ee85e6cd2
refs: CORE-2633
Reviewed-on: https://gerrit.instructure.com/196133
Tested-by: Jenkins
Reviewed-by: Robert Lamb <rlamb@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Jeremy Putnam <jeremyp@instructure.com>
2019-06-07 15:46:55 +00:00
Jeremy Putnam 974829ad55 spec: add test for rce-next header format dropdown
Change-Id: I8b276d8d627775b19d30416b6567bcf6d9590fff
refs: CORE-2633
Reviewed-on: https://gerrit.instructure.com/196130
Tested-by: Jenkins
Reviewed-by: Robert Lamb <rlamb@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Jeremy Putnam <jeremyp@instructure.com>
2019-06-07 15:46:41 +00:00
Jeremy Putnam 2ee9d607dd spec: add test for alt text added from image options tray
Change-Id: I242c8b1be8578c6b45567176c54af48853894841
refs: CORE-2653
Reviewed-on: https://gerrit.instructure.com/194919
Tested-by: Jenkins
Reviewed-by: Robert Lamb <rlamb@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Jeremy Putnam <jeremyp@instructure.com>
2019-06-07 15:46:26 +00:00
wdransfield 782f7eeabc Set editing to false on request error
Closes PLAT-4574

Test Plan:
Create an LTI key via pasting JSON. Use invalid JSON on first
attempt. Verify you can then use valid JSON without refreshing.

Change-Id: Ic0be5675951649aeafda3002d47f4aac786354b5
Reviewed-on: https://gerrit.instructure.com/196889
Reviewed-by: Drake Harper <dharper@instructure.com>
Reviewed-by: Marc Phillips <mphillips@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
QA-Review: Marc Phillips <mphillips@instructure.com>
Tested-by: Jenkins
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2019-06-07 15:39:13 +00:00
Gary Mei 209719210c check graded status when determining hidden status
The hidden count in the PostAssignmentGradesTray checks for lack of
posted, but the rules for whether a grade is hidden should be if it
has a grade, but is not posted.

closes GRADE-2177

Test Plan
- Create an assignment with a manual post policy.
- Create an assignment with an automatic post policy.

- For the manual assignment:
- Grade a number of students.
- Submit for a number of students.
- Verify that the hidden count in the Post tray is the number of
  students that have grades.
- Verify that those submissions have a Hidden pill in the Submission
  Tray and SpeedGrader.
- Post all grades.
- Verify that the hidden count is gone, the eye indicator in the
  column header is no longer orange, that the Submission Tray no
  longer contains the Hidden pill, and that SpeedGrader no longer
  contains the Hidden pill.

- For the automatic assignment:
- Grade a number of students.
- Submit for a number of students.
- Verify that nothing is currently hidden.
- Hide grades for a subset of the students.
- Verify that the hidden count in the Post tray is the number of
  students that were hidden for, that also had a grade.
- Verify that those submissions have a Hidden pill in the Submission
  Tray and SpeedGrader.

Change-Id: Iccc45b11fc356933db8082a739766b53b7c52494
Reviewed-on: https://gerrit.instructure.com/194836
Tested-by: Jenkins
Product-Review: Jonathan Fenton <jfenton@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
2019-06-07 15:25:03 +00:00
Ubuntu 5882a2129a update locales with new translations
Change-Id: I24cab316235b6018ccb769710c3e84ee838271e4
Reviewed-on: https://gerrit.instructure.com/196877
Tested-by: Jenkins
2019-06-07 10:43:38 +00:00
Ubuntu 797f6613c0 [i18n] update locales with new translations
Change-Id: Ibfda2c527c8b7124666280bff32dced73ad3f138
Reviewed-on: https://gerrit.instructure.com/196871
Tested-by: Jenkins
2019-06-07 07:42:13 +00:00
Ed Schiebel 399cb5df5a Upload Documents
closes CORE-2973

This implements the Upload Documents modal dialog. In the process,
it moves the Image Upload dialog from plugins/instructure_image to
plugins/shared and updates the image plugin to use it from there.

To do this, the dialog and its child components needed some updating to
generalize the implmemetation to be reused.

test plan:
  - open a page with the rce
  - select Documents -> Upload Documents from the toolbar
  > expect the Upload File modal dialog with only the Computer tab
  - click in the Upload File panel
  > expect the system file picker
  > expect that you can select any type of file
  - pick a file
  > expect:
    > to see the filename, a preview, and a trashcan button
    > if it's a text file the preview is the first few lines
      of the file
    > it it's an image, expect the preview to maintain its
      aspect ratio
    > if it's something else, the preview is a document icon
  - click the trashcan
  > expect the preview to be replaced by the rocket
  - do the file picking thing again, selecting a non-iimage file
  - this time click on Submit
  > expect a link to the file to be inserted in the RCE at the
    text cursor's location.
  > expect the dialog to close
  - start over, then click cancel
  > expect the dialog to close
  - start over, but select an image file and click submit
  > expect the image to be embedded in the rce at the text
    cursor's position
  Sanity check:
  - the Upload Image dialog is now implemented by a common Upload File
    dialog, so let's make sure it still works as expected
  - select Images -> Upload Image from the toolbar
  > expct the Upload Image modal dialog to open with the Computer tab
    and URL tab
  - in the Computer tab, click and the system file picker opens
  > expect that you can only select image files
  - try to drag and drop an image file
  > expect it to work
  - try to drag and drop a non-image file
  > expect an invalid file type error message
  - click submit with a file selected
  > expect the image to be embedded in the rce
  - switch to the URL tab
  - enter the URL to a file (https://placekitten.com/90/50 works)
    and click submit
  > expect a kitten image embedded in the rce

Change-Id: I3c4ec763a8f1e0063facc0f7542bbe94f2579ffa
Reviewed-on: https://gerrit.instructure.com/196089
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2019-06-07 01:42:38 +00:00
Landon Gilbert-Bland a3790f177c Fix submission histories in graphql
Fixes COMMS-2090

Test Plan:
  - Create an assignment
  - Make a few submission attempts on the assignment
  - Grade the latest attempt as the teacher
  - Make a few more attempts on the assignment.
  - Run a graphql query like

    ```
    node(id: <submissionID>) {
      ... on Submission {
        submissionHistoriesConnection(includeCurrentSubmission: true) {
          pageInfo {
            startCursor
            endCursor
            hasPreviousPage
            hasNextPage
          }
          edges {
            cursor
            node {
              attempt
              submittedAt
            }
          }
        }
      }
    }
    ```

  - Make sure there are no duplicate attempts
  - Make sure the cursors are all properly set and unique
  - change the includeCurrentSubmission to true in the query, and make
    sure that the most current submission is no longer returned from the
    graphql query results
  - Make sure the student view for assignment v2 still works

Change-Id: Ic83a78dc0384b96014d1a407b1982ad8078ba58d
Reviewed-on: https://gerrit.instructure.com/196763
Reviewed-by: Carl Kibler <ckibler@instructure.com>
Reviewed-by: Ryan Norton <rnorton@instructure.com>
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Tested-by: Jenkins
QA-Review: Landon Gilbert-Bland <lbland@instructure.com>
Product-Review: Landon Gilbert-Bland <lbland@instructure.com>
2019-06-06 23:50:57 +00:00
Ryan Norton c331a1a5dd refactor a2 content upload tab
we need to refactor the ContentUploadTab in a2 to allow a better
separation between the graphql mutations and the component
rendering.

this will also set us up with a better foundation to add more
submission types down the line and provides a better separation for
testing purposes.

Test Plan:
* When you do things right, people won't be sure you've done
  anything at all.

* This is just a refactor, all functionality should remain
  unchanged in the a2 content upload tab and all behavior around
  uploading and submitting a file.

fixes COMMS-2110

Change-Id: Id4651bb8fbeb7d1f0e6fbb9903c1621133dde6a8
Reviewed-on: https://gerrit.instructure.com/196455
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Matthew Lemon <mlemon@instructure.com>
Product-Review: Ryan Norton <rnorton@instructure.com>
2019-06-06 19:31:21 +00:00
Michelle Simmons 617266a92b remove the grade and time of submission from pizza tracker
fixes COMMS-2103

In the 'Submitted' step container, the pizza tracker displays the
time and date of submission. In the 'Graded' step containter, the
pizza tracker displays the grade received. This info is being
moved to the attempt grading area in a separate ticket; this
ticket sees the removal of the date/time from the 'Submitted' step
container and of the grade info from the 'Graded step container.

Test Plan:
* As a teacher, create an assignment
* As a student, submit two attempts to the assignment
* As the teacher, grade on of the student's two attempts; leave
  the other attempt ungraded.
* As a student, note that for the ungraded attempt, the date and
  time of your submission no longer appear; the step is labeled
  only "Submitted." Note that for the graded attempt, the grade
  received no longer appears in the pizza tracker; the step is
  labeled only "Graded."

Change-Id: Ibb3e152e50054a036f4e2a4ee0d7978388d96716
Reviewed-on: https://gerrit.instructure.com/196667
Reviewed-by: Ryan Norton <rnorton@instructure.com>
Tested-by: Jenkins
Product-Review: Michelle Simmons <misimmons@instructure.com>
QA-Review: Landon Gilbert-Bland <lbland@instructure.com>
2019-06-06 19:16:45 +00:00
Carl Kibler 780c4f46f8 show each submission attempt for an assignment
closes ADMIN-2646

test plan:
 - Have assignment with a student who has not submitted yet
 - In A2 as Teacher, view Students table, should see nothing for
   that student in Attempts, Score, and Submission Date columns
 - Submit as student & refresh. Should now see Attempt 1 with score
   and Submission Date.
 - Attempt 1 is a link to speedgrader, though it won't deep-link
   to that actual attempt, it does have date on the link for now.
 - Submit again. See new, correct data for that 2nd submission.

Change-Id: I85712a3e754d6a018866ecb9e371577f8a995f6f
Reviewed-on: https://gerrit.instructure.com/195915
Tested-by: Jenkins
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Daniel Sasaki <dsasaki@instructure.com>
Product-Review: Carl Kibler <ckibler@instructure.com>
2019-06-06 18:31:30 +00:00
Ryan Shaw cd0467a1b1 Don’t let page_views slow down page unload
See this? https://cl.ly/68e723db54c8 that’s a beforeuload in
page_views.js that is taking 335ms in prod to run _before_ the browser 
can navigate to any other pages.

what we are trying to do there in page_views is log the last page view
And we can’t use an xhr to do so because it would get aborted when we
go to a new page. Where there is a browser API to solve that exact 
problem: 

https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon

This is a screenshot of after: https://cl.ly/fed0076a15eb 
that sendBeacon call only takes 0.4ms

Oh, and we don’t need to do any of this unless ENV.page_view_update_url
Is set, so we can defer loading any of it unless that is present

Test plan:
* page views should work exactly as before
* turn on page views
* go to a page and sit there for more than 30 seconds
* clear your rails log and your browser log
* click to go to a new page
* you should see a request in your browser Network log to
  page_views/xxxx-xxxx-xxx-xx-xxx?page_view_token=xxxx
* look at your rails server logs, you should see something like:
  Processing by PageViewsController#update as */*
  Parameters: {"interaction_seconds"=>"1005”, …
  ”id"=>"36bcbd62-3a11-44bc-8dd2-69410050ff74"}
   

Change-Id: Ie67cc01dd1524c75916a26fbeffa67a01f490adc
Reviewed-on: https://gerrit.instructure.com/196416
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-06-06 18:22:21 +00:00
Steven Burnett 3a9c4a833c add embed pannel functionality
fixes CORE-2662

Test Plan:
- go here https://www.w3schools.com/html/html_youtube.asp
- copy some embed html code
- paste it into the rce last panel and click submit
- notice it embeds your video into the rce

Change-Id: I8ad95d0ff9524f95db6f9247d9c47538b33129e2
Reviewed-on: https://gerrit.instructure.com/196683
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
Product-Review: Steven Burnett <sburnett@instructure.com>
2019-06-06 16:30:42 +00:00
Jon Willesen 4e9c702d45 rce: add the resize handle to the status bar
One technical issue was the rce's iframe would swallow mouse events if
the mouse was dragged fast enough to wind up over the iframe before it
was resized. The solution was to temporarily add a div that covers the
window so that iframes won't take over mouse events.

closes CORE-2882

test plan:
- Find the new drag handle in the lower right corner and drag it around.
  The editor should resize vertically.
- Quickly drag into the RCE window. The resize should continue to work
  and not get stuck.

Change-Id: Id915f013737d98f0bf5e2b54a7e856a060d0c7e3
Reviewed-on: https://gerrit.instructure.com/194118
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
2019-06-06 14:54:36 +00:00
James Butters 7dda0e9288 spec: remove one extra have_size
Change-Id: Ie41111fb15705c64f00e8211a42f7affe05e6ae6
Reviewed-on: https://gerrit.instructure.com/196700
Tested-by: Jenkins
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
2019-06-06 14:31:13 +00:00
James Butters c4f0028f35 spec: find elements text, then check for include
sometimes the order of the outcomes are different
causing failure, instead let's grab the grades and verify
that each grade is include in the array.

Change-Id: Id18d78a4bb6bed9e15801ddb349d161654a5c2a5
Reviewed-on: https://gerrit.instructure.com/196460
Tested-by: Jenkins
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2019-06-06 13:46:09 +00:00
Ubuntu 37dbf1d8cd update locales with new translations
Change-Id: Ie3a57626ec89e8b4e9e82cc3c51a547662c7091a
Reviewed-on: https://gerrit.instructure.com/196690
Tested-by: Jenkins
2019-06-06 10:43:29 +00:00
Steven Burnett c11b31c95c allow rce to fetch media player from canvas
fixes CORE-2659 CORE-2661

Test Plan:
- upload a video recording
- notice it shows up in the rce and is fully functional

Change-Id: I852ccccec6582c7f490e5e024b8cbe24ae372f04
Reviewed-on: https://gerrit.instructure.com/196165
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
Tested-by: Jenkins
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2019-06-05 23:39:30 +00:00
Michael Brewer-Davis f25abf25d4 restrict eportfolio export to downloadable files
closes SEC-2197, OUT-3131

Test plan:
- open network debugging tools
- create a course as teacher
- add a file to the course and unpublish it
- in network tools find the unpublish request
  and note the file id
   PUT /api/v1/files/<id>
- create an eportfolio as student
- add an image in the rich text editor
- in network tools find the file creation
  request and note the file id
   GET /api/v1/files/<id>/create_success
- save eportfolio
- find save request
   POST /eportfolios/.../entries/...
- copy request as cURL
- paste into terminal, add cookie header
   -H 'Cookie: canvas_session=...'
  where canvas_session can be found in the
  Application debugging tools
- change the file id of the image uploaded
  to match the unpublished image in the course.
  it will be buried in URL-encoded HTML
- submit the curl request
- verify that the request succeeded by reloading
  the eportfolio and noting that the image is
  a broken link
- go back to the eportfolio dashboard
- download the eportfolio as zip file
- unzip the file
- verify that the unpublished file is not present in the
  zipped contents

Change-Id: Id5c7384035e7b91a35bc427871b167777d0d9528
Reviewed-on: https://gerrit.instructure.com/196518
Tested-by: Jenkins
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: Augusto Callejas <acallejas@instructure.com>
Product-Review: Jonathan Fenton <jfenton@instructure.com>
2019-06-05 21:42:31 +00:00