Commit Graph

3468 Commits

Author SHA1 Message Date
Kai Bjorkman b45fdcc3f5 update mastery connect icon in assignments
closes EVAL-2304
flag=updated_mastery_connect_icon

Test Plan:
    - Turn FF OFF
    - Create a Mastery Connect Assignment
    - ensure the old icon is displayed in the assignments and modules
    list for students and teachers
    - Turn FF ON
    - ensure the new icon is displayed in the assignments and modules
    list forstudents and teachers

Change-Id: Ic8aba10592c0cba3fae393d00b8768355a83519f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/287726
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Syed Hussain <shussain@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
2022-03-30 20:20:51 +00:00
Charley Kline 0f92634856 Commit proper core_en translation file
Refs FOO-2645
flag = none

Looks like something messed with the _core_en.js translations file
in a previous commit, which is now making a test fail. This fixes that.

Test plan:
* Tests pass

Change-Id: I0d5dae00f9d90417437c783a9d7561f2867592d3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/286062
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
2022-02-28 21:47:21 +00:00
Ahmad Amireh 5b90b39cf5 [instui8] address deprecations
refs FOO-2645
flag = none

this applies the first two codemods: updatePropNames and updateV7Props.
We can still remain on v7 at this point.

To reproduce this:

- clone github.com/instructure/instructure-ui
- activate node 14 and run "yarn install"
- apply the first mod with this command:

npx jscodeshift \
 -t packages/ui-codemods/lib/updatePropNames.ts \
 --config=packages/instui-config/codemod-configs/v7/propNames.config.json\
 ~/src/canvas-lms/ui

- apply the second mod with this command:

    npx jscodeshift \
      -t packages/ui-codemods/lib/updateV7Props.ts \
      -fileName updateV7PropsWarnings.txt \
      ~/src/canvas-lms/ui

substitute ~/src/canvas-lms with the path to ur canvas installation

~ TEST PLAN ~
  ~~~~~~~~~

not sure if it's reasonable to be spot-checking all the affected sites,
we should be able to rely on the test suite for that, but it won't hurt
to look and click through things

Change-Id: Ie120b773550633f418fae5635d1943083a65005e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/285028
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
Reviewed-by: Sean Scally <sean.scally@instructure.com>
QA-Review: Ahmad Amireh <ahmad@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2022-02-28 19:04:05 +00:00
Aaron Ogata 1e8f45e3ed use per-language instead of per-scope translation files
refs FOO-2720
refs DE-1022

Currently, translations are compiled on a per-scope level. The primary problem by doing this is that each generated scope file contains the translations for all languages, leading users to needing to download translations for languages they will never use.

Instead, we now generate a single translations file per language. This file is loaded and cached by the browser at the beginning of page load.

[change-merged]
[build-registry-path=jenkins/canvas-lms/de-1022]

Change-Id: I64b0d054b04e3d81bb7263650481d1d3fe9a4868
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/284285
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Ahmad Amireh <ahmad@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2022-02-18 00:10:23 +00:00
Jacob Burroughs ac099719c0 Stop using google fonts on user-facing pages
fixes FOO-2704

Change-Id: I4894c8177a9644c4e037bd81e015bb0273d59c14
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/284587
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
2022-02-07 20:55:16 +00:00
Gonzalo Penaranda d5aa1af887 Replace CSS colors with new values
fixes MAT-525
flag=none

Test Plan 1:
 - Click on 'Admin' option and click on the user
 - Go to 'Themes' and select 'Minimalist'. It is possible
 that you need to save it with an alias before applying
 changes
 - On 'Themes', right-click on the 'Current' card for the
 applied theme. Check for the following property:
.ic-ThemeCard-status.ic-ThemeCard-status--is-active-theme
- The "background" value is #0B874B (one of the required
values)

NOTE: this also applies for the 'Apply theme' button

Test plan 2
 - Click on 'Account'
 - Right-click on the avatar element and check for the
 property --Avatar__elMgc-Color. Value is #0374b5.
 Changes apply as expected

** ADDITIONAL DETAILS **

- Considering the number of modified files, the
changes made may affect many different options
that aren't listed here, so the support and
validation from other teams related to the
nature of this fix is being requested.

Change-Id: I973a081d18fee74fa1e4f4b904760276e303b124
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/280894
Reviewed-by: Juan Chavez <juan.chavez@instructure.com>
QA-Review: Juan Chavez <juan.chavez@instructure.com>
Product-Review: David Lyons <lyons@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-12-22 20:10:56 +00:00
Pat Renner 6042e1c8ce add action drilldown to Find Outcomes Modal
closes OUT-4483

flag=improved_outcomes_management

test-plan:
- enable flag
- visit accounts/self/outcomes
- switch to mobile viewport
- open up the Find modal
- verify you can navigate groups and click on the
action link to view outcomes within that group
- verify exiting and reopening the modal resets the state
and restores the default view
- verify the Find Outcomes Billboard is present until
the action link is clicked
- repeat steps for a course

Change-Id: If5ccfcf21d713b354efed101bc39212280dbf6ce
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269884
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Chrystal Langston <chrystal.langston@instructure.com>
Reviewed-by: Martin Yosifov <martin.yosifov@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Ben Friedman <ben.friedman@instructure.com>
2021-08-04 13:53:53 +00:00
Pat Renner bfc7228bfd add no outcomes message to manage view
flag=improved_outcomes_management

closes OUT-4595

test-plan:
> enable flag
> click on an outcome group at the account or course level
> create a new group within it via the move modal
> refresh the page
> click on the newly created group via the tree browser
> verify there is a message indicating that there are no
outcomes in the group

Change-Id: I6ffe17a33d809ce7945d4f276f4a39d77485b5d9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269892
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Martin Yosifov <martin.yosifov@instructure.com>
QA-Review: Martin Yosifov <martin.yosifov@instructure.com>
Product-Review: Ben Friedman <ben.friedman@instructure.com>
2021-07-26 13:37:38 +00:00
Pat Renner f1b23f399f Add outcome proficiency filter to new LMGB
closes OUT-4486

flag=improved_lmgb

test-plan:
- run a canvas:compile_assets before testing
- with the flag off, visit the LMGB within a course
- verify no change to functionality
- enable the flag
- verify visiting the lmgb now gives a outcome
proficiency rating filter at the top of the screen
- verify each rating can be disabled
- verify the ratings shown reflect the resolved
outcome proficiency of the course and that there is
another rating for 'not assessed'

Change-Id: I684f6f0b86bd9df2de7177a8b7fbe1bd63d89778
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/265643
QA-Review: Martin Yosifov <martin.yosifov@instructure.com>
Product-Review: Jody Sailor
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Manoel Quirino <manoel.quirino@instructure.com>
Reviewed-by: Martin Yosifov <martin.yosifov@instructure.com>
2021-06-02 22:28:11 +00:00
Ahmad Amireh cff25c4b26 free dinosaur from surrounding text
refs FOO-1808
flag = none

Change-Id: Ia45e21324fca452f43ed000f5daa8bead27a3505
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/263015
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2021-04-19 19:50:05 +00:00
Ahmad Amireh 4243097b21 rename some things
fixes FOO-1265

[skip-eslint=true]
[pin-commit-analytics=7e49eefd7f59cbf43fd03bf8957bbbfa76f8d9d5]
[pin-commit-demo_site=adade2e38e46a358a4643cd3db2fe5ccffe39ec5]
[pin-commit-instructure_misc_plugin=47a3161102b0611af56d134fbd0c828ddc1b8abf]
[pin-commit-migration_tool=0dbac2f5b421d894395605ce4b583ef0f7d60b22]
[pin-commit-multiple_root_accounts=cc96d28c0d59bbe47acc64de4fdd8e1d2b029805]

Change-Id: I14c07f20bd260cf0de1f48ceb70b3c2313edf2d2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258807
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Ziwisky <mziwisky@instructure.com>
QA-Review: Michael Ziwisky <mziwisky@instructure.com>
Product-Review: Michael Ziwisky <mziwisky@instructure.com>
2021-04-06 01:12:49 +00:00
Edwin Ramirez 9778bb718a Show "missing" in Speedgrader for missing submissions
fixes: EVAL-522
flag=none

Test Plan:
Prerequisite: Have a course with any number of students enrolled.
1.  Create an online submission assignment with a past or soon due date.
2.  Wait until the due date has passed.
3.  Go into SpeedGrader and notice the 'Missing' label is present.

Change-Id: I6086877b4b7f2ecbca75e64803945093f4197f52
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/259106
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
Reviewed-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
2021-04-05 21:08:43 +00:00
Xander Moffatt 811a1194ca launch LTI tool in new tab or popup if requested
refs INTEROP-6636
flag=none

* open new tab/window or a popup window depending on the message
the tool sends
* include new data from the tool like placement (so that deep linking
launches work), type of window, and width/height of popup
* keep a reference to opened window and close it when the dialog that
opened it also closes
* send postMessages to window.opener if present, instead of
window.parent - helps with tabs/popups opened by the page
* include the canvas placement in the LTI 1.3 launch token, in the
custom claims section - this is required so that the tool can pass it
in the full window launch request, so that Canvas knows whether it
should use a normal launch or a deep linking launch

test plan:
* make sure associated commits for the test tool and safari gem are
checked out and set up, see the test plan for those
* in safari, create a new assignment of type external tool
* choose the test tool from the list of tools
* it should tell you that it needs to open in a popup
* click the button and a popup should open (note: you should not have
Safari in fullscreen mode which is a bummer)
* you should click submit on that form to return a resource link
* the popup should close and the external tool dialog should have a
url in it, like normal

Change-Id: I46dc47cca7f26140041b6a638a8056a7cc0843db
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261771
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Wagner Goncalves <wagner.goncalves@instructure.com>
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
2021-04-05 16:46:53 +00:00
Jackson Howe 41c69f956f Show modules in k5 course
Renders the modules server-side and puts them in a hidden div, which
is set to be visible when the modules tab is active.

closes LS-2024
flag=canvas_for_elementary

Test plan:
 - As a teacher, visit a k5 course
 - Click on the modules tab, expect to see the modules (as you'd see
   them in a classic course)
 - Also, expect expand/collapse button to work as expected (had to
   tweak some of that code)

Change-Id: I4f5c9ae885f6cddca4020d14aef8e13c0c5cad8a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261880
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jackson Howe <jackson.howe@instructure.com>
Reviewed-by: Jeff Largent <jeff.largent@instructure.com>
QA-Review: Jeff Largent <jeff.largent@instructure.com>
2021-04-05 15:26:03 +00:00
Ed Schiebel 8c370eb496 Do not skip MathJax generated content when sending stuff to MathJax
closes LS-2111
flag=new_math_equation_handling

I thought we'd get into trouble asking MathJax to process nodes
it had generated, but it was breaking existing content where there
is legitimate content inside <div class="MathJax_Displah"> divs
(see https://coastdistrict.instructure.com/courses/79832/discussion_topics/835725)
Let's not do that for now, and think some more about how that got in there.

test plan:
  - create some content with the RCE
  - in the HTML editor, add something like
    <div class="MathJax_Display">
    	 <use eq editor to insert equation here
   </div>
  - save
  > expect it to get typeset by MathJax

Change-Id: Ifea3cf25c93692a64265ba66b5683b179f673a13
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262217
Reviewed-by: Nate Armstrong <narmstrong@instructure.com>
QA-Review: Nate Armstrong <narmstrong@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2021-04-03 13:14:13 +00:00
Ed Schiebel 5d8632bb84 Recover MathJax from Math Processing Errors
closes LS-2105
flag=new_math_equation_handling

This change adds a math processing error handler that will remove
offending the MathJax output.

test plan:
  - i have no idea how to trigger the error. All I know is that
    it worked on
    https://coastdistrict.instructure.com/courses/79832/discussion_topics/835725

Change-Id: Ifbf763b51733ea0f7622975a4d902bb9d3fb6ef7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262142
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Nate Armstrong <narmstrong@instructure.com>
QA-Review: Nate Armstrong <narmstrong@instructure.com>
Product-Review: Nate Armstrong <narmstrong@instructure.com>
2021-04-02 22:21:13 +00:00
Ed Schiebel 20b1e4e975 Handle jquery form validation on new RCE correctly
closes LS-2002
flag=rce_enhancements

The location of the div containing the RCE is before the textarea
in the old RCE and after in the new. Tweak the jquery form validation
to find the div in either case.

test plan:
  - create a text entry assignment
  - as a student go to submit, but click Submit with nothing
    in the RCE
  > expect the "Required Field" top to be pointing at the RCE
  > expect 1 TAB to put you inside the RCE's content area

  - the same should work with creating a global announcement

  - if you can think of a place where there's a textarea that's
    NOT associated with an RCE and undergoes jquery form validation,
    (I don't think there are any) it would be good to test that too

Change-Id: Ibcffa37cd8bb957c68313e593ef69c66c4a90d57
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262109
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeff Largent <jeff.largent@instructure.com>
QA-Review: Jeff Largent <jeff.largent@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2021-04-02 15:31:41 +00:00
Charley Kline 4800b96c05 Update InstUI import sources in speed_grader
Closes FOO-1803
flag = none

Even though speed_grader.js is in public/javascripts instead
of app/jsx, it still makes use of React and InstUI. No code
changes, just the imports.

Test plan:
* speedgrader still works, especially Buttons, TextAreas, Pills,
  and Tooltips.

Change-Id: I0b82e219b721fd65b64a5946c915664f83d7a78c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262054
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Ed Schiebel <eschiebel@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
2021-04-01 14:07:22 +00:00
Han Yan 11a685b524 fix missing file upload question answers
closes QO-714

flag=none

test plan:
- create an OAAT old quiz with file upload questions
- upload a file and click Next before file upload is done
- a confirm box is pop up with warning messages

Change-Id: Ib34838463a8965c50a44f174364d4e5b8de9c58f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261751
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Stephen Kacsmark <skacsmark@instructure.com>
QA-Review: Mark McDermott <mmcdermott@instructure.com>
Product-Review: Susan Sorensen <susan.sorensen@instructure.com>
2021-03-31 19:28:04 +00:00
Aaron Shafovaloff 367d6190f0 Prettier lint-fix speed_grader.js
flag=noflag

Change-Id: I2b29dfb2fdbb1754f1a693452dfe42371af68f29
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261876
Reviewed-by: Spencer Olson <solson@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
2021-03-30 18:53:49 +00:00
Nate Armstrong e2fa7e963b Fix previewing legacy /preview inline links
refs LS-2076
flag=none

test plan: it's automated so should be good but if you want...
- make sure RCE Better File Previewing is ON
- create a new page
- add a link to a previewable course document (like a pdf)
- switch to html editor
- edit the href to end in `/:fileID/preview`
  - eg `/courses/1/files/1/preview`
- switch back to rce editor
- select the link > Link Options > preview inline
- save the page
- click the file link > should open previewer inline

Change-Id: Iebe67af22f0a4fd83d6be98386b6eea2714fda60
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261809
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Nate Armstrong <narmstrong@instructure.com>
2021-03-29 23:01:47 +00:00
Nate Armstrong 186d3621e1 RCE: Fix legacy file links with /preview suffix
fixes LS-2076
flag=rce_better_file_downloading

test plan:
- Create a new page
- Link to a course document
- Switch to html editor
- Change the href of the a tag to end in `/:fileID/preview`
- Save the page
- Verify that link has a download button
- Clicking the link should preview the file
- Clicking the download button should download the file

Change-Id: I4751f2ffc1043c1c3bd23310817b82ef34a7ed7c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261674
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Nate Armstrong <narmstrong@instructure.com>
2021-03-26 20:21:36 +00:00
Jackson Howe a4eb25534b Swizzle homeroom announcement attachments
When the two respective flags are on, add the file download button
next to announcement attachment links on the homeroom page, and
clicking on attachment will open preview overlay.

flag=rce_better_file_downloading,rce_better_file_previewing
closes LS-1946

Test plan:
 - Create an announcement with an attachment in a homeroom course
 - Go to the (k5) dashboard
 - Under the announcement, expect to see a link to the file
 - Clicking the link should open a preview overlay (though the file
   won't show unless you have canvadocs enabled)
 - There should be a download button next to the link which downloads
   the attachment

Change-Id: I0076550de559a9537e6c0c865ca405ca222d17cd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261535
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Nate Armstrong <narmstrong@instructure.com>
QA-Review: Nate Armstrong <narmstrong@instructure.com>
Product-Review: Jackson Howe <jackson.howe@instructure.com>
2021-03-24 23:47:58 +00:00
Nate Armstrong ea3bab6d46 Hide download button on internal links
closes LS-2055
flag=rce_better_file_downloading

test plan: automated :)

If you want extra credit:
- Enable 'RCE Better File Downloading'
- Create a new page with:
  - course link (like a page)
    - edit html and add class='instructure_file_link' to the `a` tag
  - external link (like http://google.com)
  - link to a document (like a pdf) and keep it a link
- The Course Link should not have a download button
- The external link should not have a download button
- The document link should have a download button

Change-Id: I8136175164341cb844ad9036b371b956db810ff0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261507
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jonathan Guardado <jonathan.guardado@instructure.com>
QA-Review: Jonathan Guardado <jonathan.guardado@instructure.com>
Product-Review: Nate Armstrong <narmstrong@instructure.com>
2021-03-24 19:43:07 +00:00
Aaron Shafovaloff 9d0f66b525 Add student view for annotated document assignment
Test plan:
 - Create an annotated document assignment
 - Open the assignment as a student
 - The document iframe should display

Refs EVAL-1366

flag=annotated_document_submissions

Change-Id: I781038d78ed95965a57b417388fe1288e9557a28
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260502
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
Reviewed-by: Syed Hussain <shussain@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Jody Sailor
2021-03-24 18:57:36 +00:00
Ryan Shaw 485acb0a05 remove “while(1);” json protection
Closes: COREFE-212

The attack vector this was trying to fix has been fixed in all browsers
since 2011 (https://security.stackexchange.com/questions/155518/)
and so is not a problem in any of the browsers we support

See this answer for more details of what the attack was and how
it is no longer a problem: https://stackoverflow.com/a/2669766/7159335

This will make it a lot easier for all of our api request so we don’t
Have to worry about that anymore

Test plan:
* in a browser where you are logged into canvas
* go to /api/v1/users/self
* it should not have a “while(1);” in front of the json

Change-Id: I3750672c41791040f7fb09b2e35bad7966060101
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/205090
Reviewed-by: Charley Kline <ckline@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-03-23 16:21:44 +00:00
Jonathan Guardado 69934d22a9 Formula alignment gets ignored when Math: Updated Equation flag is on
When replacing the image for the math_equation_latex wrapper, the
style from the image is copied to the wrapper before removing the
Image from the DOM, with this the new wrapper will keep the style
including the alignment.

fixes LS-1941
flag=none

Test Plan:
- Enable the feature flag Math: Updated equation handling on the
account level
- Edit or create a page in a course to see the RCE
- Use the "insert math equation" button on the toolbar to insert an
equation image
- Use the "Align" button on the toolbar to center the image on the
page and save the content
- Notice the formula gets rendered in the expected position keeping
the alignment.

Change-Id: Ie2a90dc4b24236dacb34d8183b7c0066eaa8b196
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260985
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Nate Armstrong <narmstrong@instructure.com>
QA-Review: Nate Armstrong <narmstrong@instructure.com>
Product-Review: Jonathan Guardado <jonathan.guardado@instructure.com>
2021-03-18 17:32:17 +00:00
Ed Schiebel 2e78b3f846 Omit download button for external links
closes LS-2032
flag=rce_better_file_downloading

test plan:
  - with the rce better file downloading flag on
  - in the rce, add an external link
  - in the rce, add another external link, edit the HTML and add
    class="instructure_file_link" to the <a> element
  - in the rce, add a file link
  - in the rce, add a youtube link using the external link dialog
  - save
  > expect only the file link to get a download button
  > expect the youtube link not to get a preview thing

Change-Id: Ifab8f8957ca1c7b1fcc9a84b81254dc73fbbcd22
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260719
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Robin Kuss <rkuss@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2021-03-16 14:13:07 +00:00
Ed Schiebel df4ead0aad Fix link preview for old RCE content
closes LS-2020
flag=none

test plan:
  - in the RCE, add a file link and enable auto-open of the inline preview
  - edit the HTML and remove the instructure_file_link class name from
    the link
  - save
  > expect the link's preview to auto-open
  > expect this to  work with the rce_better_file_previewing and
    _downloading flags on or off

Change-Id: I2c17561cd0f6d6ec534031187624f8fc6feed598
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260632
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Nate Armstrong <narmstrong@instructure.com>
QA-Review: Nate Armstrong <narmstrong@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2021-03-15 19:58:34 +00:00
Jonathan Guardado 5407fe6b5d LTI icon shows as a 'bomb' instead of the tool's icon
When adding the icons for the LTIs in the RCE, there is a parse
error trying to assign an object when a string is expected, the
provided fix is to validate the parameter before the assignation.
For fixing the second problem about blocking the possibility to add
an LTI with ‘Editor button’ placement inactive to the RCE, some
callbacks and validations were added when the placement is set
to active/inactive.

fixes LS-1940
flag=none
 
Test Plan: 
Issue 1:

- Having a course with RCE Enhancements enabled
- Go to your account configuration and add one LTI to RCE
- Set at least one of the placements for the added LTI to inactive
- Create or edit a course to display the RCE
- Then the LTI icon should be rendered in the toolbar

Issue 2:

- Go to your account configuration and add another LTI to the RCE
- Set the ‘Editor Button’ placement for the added to inactive
- Then the toggle button is removed from the UI
- Change the ‘Editor Button’ placement to active
- Then the toggle button is added back to the UI
- Add a LTI to RCE and then set the ‘Editor Button’ placement to
inactive
- Then the LTI will be removed from the favorite apps list and
the toggle button will be removed from the UI

Change-Id: I83599f6a6d3feff2ef403b9fcd18e7d0b5626a51
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260197
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Nate Armstrong <narmstrong@instructure.com>
QA-Review: Nate Armstrong <narmstrong@instructure.com>
Product-Review: Jonathan Guardado <jonathan.guardado@instructure.com>
2021-03-12 17:58:07 +00:00
Ahmad Amireh 5a9a4f3470 (re) decentralize i18nliner configuration
refs FOO-1408
flag = none

This reverts commit c904d83673.
Original commit 9af1badd2f.

I've also made an adjustment where you may only include a directory and
not a specific file so that we don't make it possible to configure
outside of an ".i18nrc" file (a measure to eliminate surprises that's
all)

before:

    { "include": [ "path/to/dir/.i18nrc" ] }

now:

    { "include": [ "path/to/dir" ] }

:: test plan

run "rake canvas:compile_assets" and visit any page with JavaScript
text, that text should display correctly

Change-Id: I320ec4056270647835035f45501d310b18d9cb25
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258178
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Ziwisky <mziwisky@instructure.com>
QA-Review: Michael Ziwisky <mziwisky@instructure.com>
Product-Review: Michael Ziwisky <mziwisky@instructure.com>
2021-03-10 18:52:49 +00:00
Augusto Callejas 6ffcf19741 Limit reassigning on max allowed attempts
fixes OUT-4268

flag=reassign_assignments

test plan:
  - Enable "Reassign Assignments" and  "Assignment Allowed Attempts"
    feature options
  - Create an assignment that allows up to 2 attempts with
    a due date
  - As a student, submit to the assignment
  - As a teacher, reassign the submission in SpeedGrader
  - As a student, resubmit to the assignment
  - As a teacher, confirm that the assignment cannot be
    reassigned anymore.

Change-Id: I7632a569b33ae555f01b2ffca8f024ac84cabb6c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/259301
Reviewed-by: Pat Renner <prenner@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
QA-Review: Pat Renner <prenner@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jody Sailor
2021-02-26 01:16:50 +00:00
Augusto Callejas 1ffe7fed4d Better indicate when an assignment is reassigned
closes OUT-4269

flag=reassign_assignments

test plan:
  - Enable "Reassign Assignments" feature option
  - Create an assignment with a due date
  - As a student, submit to the assignment
  - As a teacher, reassign the submission in SpeedGrader
  - Confirm that the reassign button now displays "Reassigned"

Change-Id: Iebc6c52114a0265b86ab8bd3cc7f137af591f229
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/259331
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Pat Renner <prenner@instructure.com>
Product-Review: Jody Sailor
2021-02-24 21:04:13 +00:00
Ed Schiebel 918284ba0f Guarantee download URLs include /download
closes LS-1925
flag=rce_better_file_downloading

This fixes a bug introduced with LS-1910.  We mistakenly removed
/download from the end of the file download URL. While this works
in a dev environment, it does not in a prod-like env.
This change ensures the URL's path ends with 1 and only 1 /download

test plan:
  - either create a file link in the old rce, or create one in the
    new rce and edit the href to append /download to the url's path
  - save
  > expect the path part of the href on the link behind the download
    icon to end in /download
  - click on the download icon
  > expect the file to be downloaded

Change-Id: I7e73aa46ec04f8c6c7914e7d020d84cc37d83ff2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/259292
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeff Largent <jeff.largent@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2021-02-23 15:47:45 +00:00
Wagner Gonçalves 1eb9475aad persist resource_link_lookup_uuid at homework submission
closes INTEROP-6315, INTEROP-6319
flag=none

test plan:
* Have an LTI tool installed with homework submission and RCE editor
  placement enabled;
* Have a Course recorded;
* Have a Student enrolled to this Course;
* Have an Assignment recorded to this Course;
* Have LTI links added to the RCE editor in that assignment (later,
  we'll check if this link still working because we're changing the
  resource_link_lookup_id to resource_link_lookup_uuid LTI tool launch
  parameter)
* As a Student you should be able to access the Assignment to submit your
  homework. At the submission homework page you should be able to find
  LTI tool (usually rendered in a tab);
* Specify the custom params do you want to record, and submit it from the
  tool. You can add some comment too, and click to the submit assignment
  button;
* When accessing the Submission Details page you should be able to see
  that the tool was launched. At this point, the tool is launched via m
  eta refresh tag  https://www.w3.org/TR/WCAG20-TECHS/H76.html.
  You can check the application logs to see that a request was performed
  with resource_link_lookup_uuid parameter and you could check that the
  custom claim contains all custom params specified in the previous step;
* As a Teacher/SiteAdmin when accessing the SpeedGrader via Gradebook
  page you should be able to acces the homework submission via tray.
  After selecting the desired student you should be able to see the tool
  launched via iframe and the src URL should have the
  resource_link_lookup_uuid (I did this by inspecting the HTML elements)
  parameter. You should check if the custom claim has all expected
  parameters;
* You can Re-Submit a homework with different custom params to check
  that the custom claim was changed and was generate a new resource link
  (resource_link_lookup_uuid);
* Check if the LTI links added to the RCE editor still working;
* Add new links to the RCE editor and check if is working as expected;

[fsc-timeout=30]

Change-Id: I00c2bcdc02c7a5134efff1deff836657071067fa
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256716
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Product-Review: Karl Lloyd <karl@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
2021-02-19 17:58:11 +00:00
Ed Schiebel 4de95d4aa5 Generate the new download button for non-preview-able files
closes LS-1911
flag=rce_better_downloading

test plan:
  - with rce_better_downloading flag on
  - in the old rce, create a link to a .txt and a .pdf file
  - view the result
  > expect the download icon next to both files

Change-Id: Icbc0d15f34fcfb1433bb5a80299c4f2408f4892b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/259023
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Nate Armstrong <narmstrong@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2021-02-19 15:44:47 +00:00
Ed Schiebel 8a090cd3f5 Fix new download button with files created in the old rce
closes LS-1910
flag=rce_better_file_downloading

The old RCE included '/download' in the file URL's path, and the
download buttton added another '/download'. We don't really need
/download in the URL to make the file download, so don't add it.

test plan:
  - either create a file link in the old rce, or create one in the
    new rce and edit the href to append /download to the url's path
  - save
  - click on the download icon
  > expect the file to be downloaded

Change-Id: Ib8eb9db70950b1f4341668b2b256bdb76a69008b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/259009
Reviewed-by: Nate Armstrong <narmstrong@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Nate Armstrong <narmstrong@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2021-02-18 15:48:58 +00:00
Adrian Diaz 4064e372e1 removes unwanted auto-generated decimal places
fixes QO-667
flag=none

test plan:

  - create a classic quiz and add a numerical answer
       question
  - add a precision answer with at least two numbers
       to the left of the decimal and at least one
       to the right
    - e.g. 99.9 with precision 3
  - preview the quiz and attempt to answer correctly
  - after entering an answer, see that trailing zeroes
      are not added to a total of 16 decimal points
    - e.g. 99.9 must not change to 99.9000000000000057

Change-Id: I575843ee6d115d9966558c78b649a539c7d58d36
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257300
Reviewed-by: Stephen Kacsmark <skacsmark@instructure.com>
QA-Review: Mark McDermott <mmcdermott@instructure.com>
Product-Review: Susan Sorensen <susan.sorensen@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-02-17 19:12:46 +00:00
Adrian Diaz 6c2679029c some mathematical formulas not rounding correctly
with formula questions in classic quizzes

fixes: QO-630
flag=none

test plan:
  - create a quiz and create a formula question.
  - in the stem of your question define 2 variables.
    - for the first variable, in both the min and max,
        put 14.2 (with 1 decimal place)
    - for the second, put 3.3 with 1 decimal place.
  - for the formula enter the first variable minus
        the second divided by 2.
  - when you generate the results, set them to show up to 1 decimal place.
    - the result must be 12.6

Change-Id: I42e1831814bdf82f8fd19268d1857d0e6c34aa57
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258249
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Stephen Kacsmark <skacsmark@instructure.com>
QA-Review: Mark McDermott <mmcdermott@instructure.com>
Product-Review: Susan Sorensen <susan.sorensen@instructure.com>
2021-02-17 19:12:08 +00:00
Kai Bjorkman 14e5ef2c95 show correct reason for date locked assignments being unavailable
When an assignment is date locked and in a future module, it displays as
locked due to prerequisites instead and links to the previous assignment
in module order. It should instead display that the assignment is locked
until a specific date.

closes EVAL-1416
flag=assignments_2_student

Test Plan:
- Have course with at least one student
- Create an assignment that is not yet available until a future date
- Create two modules
- Put the assignment just created in the second module and anything else
in the first module besides the title
- Navigate to the assignment created as the student and make sure the
correct date is displayed as to when the assignment will be available
- Ensure it doesn't mention or link to any prerequisites

Change-Id: Ib4a4d4a977d38135838c44ff97adfce650b175fa
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257710
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Adrian Packel <apackel@instructure.com>
Product-Review: Jody Sailor
Reviewed-by: Gary Mei <gmei@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
2021-02-17 16:10:14 +00:00
Augusto Callejas 92e03a64cd Allow reassignment from SpeedGrader
closes OUT-4033

[fsc-timeout=50]

flag=reassign_assignments

This feature allows teachers to reassign an assignment
to a student after they've submitted to the assignment
and the teacher has provided feedback via comments.

The reassignment will appear in their planner with
a "Redo" tag visible next to the assignment.

Only supports assignments of submission type "Online".

test plan:
  - enable "Reassign Assignments" feature option
  - in a course, create a student account
  - as a teacher, create an assignment with a due date
  - as a student, confirm the assignment appears in
    their planner
  - as a student, submit to the assignment
  - as a teacher, open the submission in SpeedGrader
  - reassign the assignment to the student by:
    * adding a comment to the assignment
    * clicking the "Reassign Assignment" button
  - as a student, confirm the assignment appears
    with a "Redo" pill in the planner, along with
    the comment from the teacher
  - as a student, resubmit to the assignment and
    confirm the assignment shows as completed again
    in the planner without the "Redo" pill
  - repeat the above steps, except with an assignment
    that has "Anonymous Grading" enabled and it should
    behave in the same way
  - repeat the above steps but with more students and
    no due date on the assignment, but with various
    assignment overrides with due dates and some students
    assigned to those overrides (using course sections)
    and confirm the "Resassign Assignment" button only
    appears for those students with assignment overrides
    (and hence due dates), with the button being disabled
    until the student both submits to the assignment and
    the teacher has provided a comment.

Change-Id: Id745b50f3810378804e0728e544ebf6bff8f756a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251663
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Jody Sailor
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Pat Renner <prenner@instructure.com>
2021-02-17 00:28:25 +00:00
Ed Schiebel f2c60750e7 New better file previewing UI
closes: LS-1834
flag=rce_better_file_previewing

Update th Link Options tray and tweak the resulting file link UI
to match the design

test plan:
  - with the "RCE better file previewing" flag off
  > expect file links to behave just like before
    - clicking the link opens the file in a new tab
    - clicking the inline preview icon hides the link and
      shows the file preview inline
    - clicking the "Hide preview" link hides the preview and
      restores the file link

  - with the flag on
  - create a canvas file link with link display option
    "Preview in overlay"
  - create a canvas file link with link display option
    "Preview inline"
  - create a canvas file link with link display option
    "Preview inline, expand by default"
  - create a link to an external file and/or website.
  - save
  > expect no "preview" icon on any of the links
  > expect an "external" icon next to the external link
  > expect a "download" icon next to the canvas file links

  - click the "Preview in overlay" link
  > expect the file to open in an overlay

  - focus the "preview inline" link
  > expect a screenreader to tell you it's collapsed
  - click the "preview inline" link
  > expect a screenreader to tell you it's expanded
  > expect a spinner adjacent to the link while the file loads
  > expect the spinner to disappear after the file loads
  > expect the file to be displayed below the link
    - click the "minimize file preview" link
    > expect the preview to close
    - click the link again
    > expect the preview to open again
    - click the link again
    > expect the preview to close

  > expect the "preview inline, expand by default" file to have
    opened automatically.
  > when focused, expect a screenreader to tell you it's expanded
    - click the link
    > expect nothing to happen
    - click the "minimize file preview" link
    > expect the preview to close

  - ctrl, alt, cmd, or shift click a file link
  > expect the browser to take its default action

  - load a page with an inline preview link in a RTL language
  > expect the download button to be after the link (e.g. to the left)
  - click on the link
  > expect the spinner to appear between the link and the download button
  NOTE: this only really makes sense if you create content in a RTL
  language as ltr text in a rtl context is confusing and hinky.
  I do this by putting the UI in Hebrew and copy/pasting text
  from elsewhere on the page

 - disable file previews
   - /accounts/:your_root_account_id/settings and
     uncheck "Google Docs Preview"
   - /acconts/site_admin/plugins and ensure Crododoc is disabled
 - load the page
 > expect the download icon to be next to each file link
   (this is fixed in PS 12)
 - click on any of the file links
 > expect the files all to open in a new browser tab

Change-Id: I00154916f5a6c7eca911d0cc2958f91d46584f8c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258304
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeff Largent <jeff.largent@instructure.com>
QA-Review: Jeff Largent <jeff.largent@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2021-02-16 17:56:18 +00:00
Ed Schiebel 0b63f3990a Better file previewing
closes LS-1882
flag=rce_better_file_previewing

This commit changes file preview from opening in a new browse tab
to opening in an overlay on the current page. It is part of the
ongoing work to improve canvas file link handling.

test plan:
  - in the RCE, add some file links and save
  - with the rce_better_file_previewing flag off
    - click the link
    > expect the file to open in a new tab
  - with fie rce_better_file_previewing flag on
    - click the link
    > expect the file to open in the overlay
    - click on the Info button
    > expect the file's info
    - click Close or type ESC
    > expect the file preview to close
    - click on a different file link
    > expect the preview to open on the new file

Change-Id: I2951c10e00c4524c287cdd1603538e4f0c3a8762
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258271
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
Reviewed-by: Jeff Largent <jeff.largent@instructure.com>
2021-02-09 22:24:02 +00:00
Martin Yosifov 9a5a1b89d1 Add radio buttons to individual outcomes in Find Outcomes modal
Include radio buttons when rendering each outcome. The buttons
should be clickable but have no functionality

closes OUT-4152
flag=improved_outcomes_management

Test plan:
- Make sure you have an Account with associated outcome groups
- Go to Account > Settings > Feature Options
- Enable Improved Outcomes Management FF
- Go to Account > Outcomes and click on Find button
- when modal opens select any outcome group via the Tree Browser
- a list of mocked outcomes should appear below the searchbar
- select an outcome and click on its truncated description;
it should expand to HTML formatted description
- click on expanded description; it should collapse
- click the caret button (>) to left of outcome title;
the description should expand
- click again the caret button; the description should collapse
- click on outcome toggle; it should switch to active
- click again on outcome toggle; it should switch to inactive
- verify that visualization and responsiveness of the
outcome list is similar under Chrome, Firefox and Safari

Change-Id: Ib18ec6c4e1535a229f6577285346c2a88e3d251a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257886
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
Reviewed-by: Pat Renner <prenner@instructure.com>
QA-Review: Pat Renner <prenner@instructure.com>
Product-Review: Jody Sailor
2021-02-09 19:47:38 +00:00
Cody Cutrer be437fabe8 switch _core_en.js to rails 6
and spec to match, now that rails 6 is default

Change-Id: Ic44f3fa370da80e363bd3085e559b8dfc9a04837
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258426
Reviewed-by: Robin Kuss <rkuss@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-02-09 15:16:59 +00:00
Ed Schiebel 8b5027dc1a Add download icon to RCE file links
closes: ls-1743
flag="rce_better_file_downloading"

test plan:
  - turn on the "RCE Better File Downloading" flag
  - in the RCE add a course or user file link
  - add another, but check the "disable in-line preview" checkbox
    in link options
  - add another , but check "Automatically open" checkbox in
    link options
  - save
  > expect a download button next to each file
  > expect the preview button next to the first file
  > expect no preveiw button next to the next file
  > expect the last file to have its preview open
  - click the download button
  > expect the file to be downloaded
  - click the link
  > expect the file to be opened in a new tab/window

  - turn off the flag and expect all the above to be true,
    but there's no download button

Change-Id: Ia93b0bd751b9051fbb6b0bd4fed713ccd6a9a0de
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257910
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Nate Armstrong <narmstrong@instructure.com>
QA-Review: Nate Armstrong <narmstrong@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
2021-02-05 16:31:56 +00:00
Eric Saupe 8abd548b5f Support MathML render on new modules
There was no feature flag check when a new module was
created via the modal. This fixes it by checking for the
feature flag and rendering mathml if needed after a successful
request.

fixes LS-1776
flag=none

Change-Id: I867e65abee7d78f15e66dc003ec28dd903982ef9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257906
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Eric Saupe <eric.saupe@instructure.com>
2021-02-03 16:44:13 +00:00
Manoel Quirino Neto c276a0f613 Use webcam to submit photo
closes OUT-4122
flag=enable_webcam_submission

test plan:
  - Enable enable_webcam_submission ff
  - create an assignment with submission type "file uploads"
  - as a student, open the assignment > submit assignment
  - Assert Send File or Use Webcam button are displayed
  - Click in Send File
    Assert the legacy file upload is displayed
    Assert the input works (submit)
  - Click in Use Webcam
    Assert you can take picture using webcam
  - Click Add another file
    Assert you see Send File or Use Webcam
  - Click Submit assignment
    Assert you can download the webcam image and
    the file in the legacy input

Change-Id: I71d12a5de7d62c7b2774f9588da9ab086de7888d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/254862
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Chrystal Langston <chrystal.langston@instructure.com>
Product-Review: Jody Sailor
Reviewed-by: Stephen Kacsmark <skacsmark@instructure.com>
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
2021-02-03 14:56:47 +00:00
Ed Schiebel db8b19814e Math equation handling tweaks
closes LS-1864
flag=new_math_equation_handling
with a touch of inline_math_everywhere

updates:
  - get inline math in links underlined
  - prevent MathJax from typesetting equations when editing a quiz
  - prevent MathJax from loading on rubrics or files pages

test plan:
  - go to /courses/:id/rubrics
  - put inline math in a rubric
  > expect it to never get typeset by mathjax

  - create an assignment with inline math in the title
  - go to /courses/:id/assignments
  - hover over the assignment's title
  > expect the text and the equation to be underlined

  - to to /courses/:id/quizzes
  - create a quiz, add a question
  - put put inline math in answers and an answer comment
  - save the question and quiz
  - preview the quiz and take it
  > expect the math to be typeset
  - edit the quiz, go to questions tab
  - show question details
  - using the equation editor, add or edit an equation in the question
  - save the question and quiz
  - preview/take the quiz
  > expect the equations to be typeset and look correct
  - edit the quiz and go to questions tab again
  - show question details
  > expect the inline equations to be the expected not typeset source

  - go to a files page
  - rename a file to \(x^2\).whatever
  - refresh the page
  > the filename should be "\(x^2\)" and not be typeset by MathJax

Change-Id: I62d3d7fb94c91d46de4e6e9689ba345b279c1f2f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257981
Reviewed-by: Jeff Largent <jeff.largent@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2021-02-03 14:09:33 +00:00
Jonathan Guardado 1169a3b9f4 RCE is not responsive in comments for Answers in Quiz page
Removing the fixed width in the RCE at the moment of loading the
page and Refactoring a bit the HTML table in answers form to make
the RCE use a row instead of a column to the RCE fits the container
width automatically

fixes LS-1803
flag=none

Test Plan:
- In a course, enable the RCE enhancements feature.
- Create a Quiz and add a new question.
- On the Answers section add a comment to an answer to Display the
RCE.
- Expand or contract the window.
- The RCE of all of the answers gets responsive and adapts to the
width of the window

Change-Id: I8f014e4059cfc9ca33516da4aa189a039949a3cb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257595
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jonathan Guardado <jonathan.guardado@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Ed Schiebel <eschiebel@instructure.com>
2021-02-01 21:31:01 +00:00