Commit Graph

3236 Commits

Author SHA1 Message Date
Charley Kline 46d4489a65 Update en.json file
flag=none

The fallback English translation file has changed from I18n
so it needs to be updated or the update script will re-dirty
it every time it runs.

Test plan:
* none

Change-Id: I83dd6209706dc7bfc07c497a0b05db49cad445d5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/336244
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Hulse <michael.hulse@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
2024-01-03 17:39:57 +00:00
Evan Battaglia 02af1dfd65 postMessage forwarder iframe: eliminate excess JS
Why:
- The current way of including the forwarder code involves using a
  bundle, All the extra unnecessary Canvas code slows things down, costs
  more to serve, and can cause errors because some things it expects to
  work don't in the iframe.
- This includes the script as a static asset which will be served from
  the CDN and only be refetched by the client when the the script
  content changes, otherwise it will be cached for a year
  (365.2425 days). It will also be gzip-compressed when delivered to
  web browsers.

Credit to Jacob Burroughs for figuring out this approach.

Test plan:
Note: this is pretty much the same test plan as the next commit so you
can test just test that commit.
- after checking out code, run `yarn gulp rev` (this may also be done as
  part of building assets?).
- to make sure you get the new code, clear your browser's cache, load a
  canvas page, and open dev tools. In Network find the (web/doc) request
  for /post_message_forwarding?target=... and visit the page to make
  sure it has the new code (with script
  src="/...lti_post_message_forwarding-1244...js" tag)
- launch an LTI tool and send messages to the forwarder iframe (platform
  storage target) and make sure you get the appropriate response. You
  can use can use messages like:
    {"subject":"lti.put_data","key":"a","value":"b","message_id":"12"}
    {"subject":"lti.get_data","key":"a","message_id":"12"}
- send messages from the tool to the parent window and make sure those
  work too.
- embed an LTI tool in RCE content and while still editing the content,
  send messages from the tool to both the platform storage target and
  the parent window, as in the previous 2 steps.

refs INTEROP-8279
flag=none

Change-Id: I0d4ced28efc3c0c7d8180e72d56bab54557d3cce
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/334733
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2023-12-20 22:37:40 +00:00
Charley Kline 804404e9c2 Update en.json file
flag=none

The fallback English translation file has changed from I18n
so it needs to be updated or the update script will re-dirty
it every time it runs.

Test plan:
* none

Change-Id: I11096642e48302c662ca528e4b21728aa4b2e4ba
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/335688
Reviewed-by: Michael Hulse <michael.hulse@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>
2023-12-19 23:02:35 +00:00
Charley Kline daa065c4a1 Update en.json file
flag=none

The fallback English translation file has changed from I18n
so it needs to be updated or the update script will re-dirty
it every time it runs.

Test plan:
* none

Change-Id: Ie6bbcbfaf76676c6b6210b92ccfd28de49af8884
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/333802
Reviewed-by: Jeremy Stanley <jeremy@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>
2023-11-27 18:16:49 +00:00
Charley Kline 7cf8fafa48 Update en.json file
flag=none

The fallback English translation file has changed from I18n
so it needs to be updated or the update script will re-dirty
it every time it runs.

Test plan:
* none

Change-Id: Ia7de2ed6e961a3b26a5fefc621cbb2233643a784
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/330986
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
Reviewed-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2023-10-23 21:50:19 +00:00
Charley Kline b53ebece66 Update en.json file
flag=none

The fallback English translation file has changed from I18n
so it needs to be updated or the update script will re-dirty
it every time it runs.

Test plan:
* none

Change-Id: Ia65d2793487ba1270f56e1b9a82ccf82e032ebb9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/327817
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
2023-09-14 18:06:50 +00:00
Hitesh Rawal 33d01dcde9 New decaying_average calculation
Existing decaying_average method
is renamed as weighted_average
and added new standard_decaying_average method
for standard decay calculation.

These changes will be reflected only
if outcomes_new_decaying_average_calculation,
feature_flag is turned on

refs: PFS-21869, PFS-21871

Test Plan
* Create outcome
* it should have default calculation method weighted_average
* Mastery calculation dropdown should show weighted_average
and decaying_average

flag=none

Change-Id: I84a90a58c1b5d311564921af78729480141744ee
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/321346
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Mark Valentine <mvalentine@instructure.com>
Reviewed-by: Chrystal Langston <chrystal.langston@instructure.com>
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
QA-Review: Mark Valentine <mvalentine@instructure.com>
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
2023-07-31 15:06:45 +00:00
Charley Kline 1c5d0b418d Refresh the en.json fallback translations
flag=none

We've got a new locale-sensitive URL which added a line
to the static en.json file, so it gets dirty every time
translations are built. The "correct" version needs to
be on master to avoid dirtying local dev repos.

This is just one big long one-line JSON, but Gerrit's
change highlighting will make it easy to see what has
been made different.

Test plan:
* You agree with the change

Change-Id: Icdffe47a17eea4e0cb78c23ebded2348dd88947a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/310852
Reviewed-by: Aaron Shafovaloff <ashafovaloff@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>
2023-02-10 18:45:45 +00:00
Ed Schiebel 4211c88e92 prep for publishing rce 5.6.14
flag=none

test plan: passes jenkins

Change-Id: I9ddf6f94e000bceba316ddeebb7db0ea9da9bad8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/310383
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jake Oeding <jake.oeding@instructure.com>
QA-Review: Jake Oeding <jake.oeding@instructure.com>
Product-Review: Jake Oeding <jake.oeding@instructure.com>
2023-02-06 14:31:15 +00:00
Charley Kline 29a341cf8c Refresh the en.json fallback translations
Refs FOO-3069
flag=none

We've got a new locale-sensitive URL which added a line
to the static en.json file, so it gets dirty every time
translations are built. The "correct" version needs to
be on master to avoid dirtying local dev repos.

To make this easier to review, the actual change in en.json
was the addition of the line:

  "community.basics_find_url" : "https://community.canvaslms.com/t5/Canvas-Basics-Guide/Where-do-I-find-my-institution-s-URL-to-access-Canvas/ta-p/82",

That can be a little hard to pick out from the smashed-
together one line version.

Test plan:
* run script/canvas_update
* your master branch should still be clean

Change-Id: I233b91432e8a7e89c3b3a118472fc2907306071e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/310065
Reviewed-by: August Thornton <august@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>
2023-01-31 23:26:16 +00:00
Ed Schiebel 0f018da4fb Remove unsplash code from canvas
One tricky bit I had to deal with here was migrating developer_key scopes

refs MAT-1140
flag=none

test plan:
  - jenkins passes
  - canvas still runs
  - you can set|change the course image on the course settings page
  - you can upload an image from the rce
  - Unsplash does not show up on the /plugins page

Change-Id: I36a88bcba0cd6f39a45a61ea38ede39f99d58a42
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/308631
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Tucker Mcknight <tmcknight@instructure.com>
Reviewed-by: Deyvison Penha <deyvison.penha@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Deyvison Penha <deyvison.penha@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2023-01-18 17:51:51 +00:00
Charley Kline 85a84529a6 Update en.json
Refs QO-896
Closes FOO-3063
flag=none

The JSON generator for I18n translations was fixed
to include explicit objects for the various language
plurals, which forced a change in the fallback English
translation JSON. This change should be committed.

Test plan:
* none

Change-Id: I78e751348a843d348c1418f2f5c560153a7e8062
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/299289
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
2022-08-23 14:54:19 +00:00
Charley Kline 5851c2a47c Update en.json file
Refs FOO-2801
flag=none

The "flatten translation files" commit caused i18n_generate_js to
alter the en.json file. Assuming it won't change very much, this
just commits the new one.

Test plan:
* builds succeed

Change-Id: Ife3d6dd47774bcc6be1ba32d595487f2c4266585
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/294907
Reviewed-by: Jacob Burroughs <jburroughs@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>
2022-06-27 21:23:34 +00:00
Ahmad Amireh 6edd1fc788 (i18n-js:5) flatten translation files
refs FOO-2801
flag = none

[change-merged][build-registry-path=jenkins/canvas-lms/foo-2801]
[pin-commit-analytics=4fd9e2fbb7fc2790ba7985bb4025e901bf33a9e3]

this part reaches the goal of this series where we turn the locale
files that are used by our JS engine into plain JSON files that don't
need any special processing and are also of a simpler structure

before, translations were stored in a tree structure that we needed to
traverse in order to look up a translation, which we did by
deconstructing keys through the "." operator:

    I18n.lookup("foo.bar.baz")

    {
      en: {
        foo: {
          bar: {
            baz: "Hello!" // <-- this
          }
        }
      }
    }

now, translations are stored in a flat dictionary structure where the
keys are not processed in any special way but are instead "fully
qualified":

    I18n.lookup("foo.bar.baz")

    {
      en: {
        "foo.bar.baz": "Hello!"
      }
    }

this is nice when you consider that the previous structure contained a
mixture of nested keys and flat ones, based on different conditions:

    {
      en: {
        "asdf_1234": "ASDF", // inferred, so it was never "nested"
        "foo": {
          "bar": {
            "baz": {
              "one": "One banana",
              "other": "Many many bananas"
            }
          }
        }
      }
    }

because, for example, keys that are inferred by i18nliner end up at
the root level and not nested. You also never knew whether a key was a
container or a phrase that was pluralized, because they both had the
shape of an object.

Now these distinctions are gone; a key is always fully-qualified
regardless of how it was specified:

1)   inferred: I18n.t("Inferred key")
               // => inferred_key_c49e3743
2)   absolute: I18n.t('#buttons.cancel')
               // => buttons.cancel
3)   relative: I18n = useScope('outer')
               I18n.t('something', 'Something')
               // => outer.something
4)     nested: I18n = useScope('outer');
               I18n.t('something.inside', 'Something inside')
               // => outer.something.inside
5) pluralized: I18n.t({
                 one: 'One banana',
                 other: 'Many bananas'
               })
               // => many_many_bananas_ce8e7fb7.one
               // => many_many_bananas_ce8e7fb7.other

Change-Id: I7c33fbd2321d7d56994223d65f2572db0ac12ed5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/293675
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
2022-06-27 18:35:04 +00:00
Ahmad Amireh 14faf088c0 (i18n-js:4) use i18nliner-canvas from npm
refs FOO-2801
flag = none

[change-merged][build-registry-path=jenkins/canvas-lms/foo-2801]

gems/canvas_i18nliner is now a package @instructure/i18nliner-canvas and
lives in the same repo on github along with the 3 other i18nliner
libraries.. this was done to make it easier for maintainers to deal with
this code, since changing one part may break the other due to how
they're architected

the source on github: https://github.com/instructure/i18nliner-js

~ test plan ~

build is still OK, this only affects the generation of files, and those
i manually verified to be identical before and after

Change-Id: I78afa8a808f1699c10aced8466cfade066848bc9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/294209
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
2022-06-23 18:42:23 +00:00
Ahmad Amireh a80415e931 (i18n-js:1) reorganize rake tasks
refs FOO-2801
flag = none

move implementation of Rake tasks into their own Ruby modules so that we
may more easily test them; the Rake tasks will do any necessary IO while
the stuff in lib/ will be confined to the logic

~ test plan ~

we can still run i18n:check and i18n:generate_js

Change-Id: I14526acb41d3efec3a27cd6435a853a515ba41b6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/292205
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
QA-Review: Ahmad Amireh <ahmad@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2022-06-22 16:57:33 +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
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