Commit Graph

36275 Commits

Author SHA1 Message Date
Ryan Norton b54f9f6a8f add body to submission draft mutation in graphql
we need to allow setting a 'body' in the submission draft
mutation in graphql for text entry assignments

Test Plan:
* create an assignment as a teacher
* add a student to that assignment
* as a student, navigate to /graphiql
* run the following mutation
** set the submissionId to whatever your latest submissionId is
```
mutation {
  createSubmissionDraft(input: {submissionId: "1", attempt: 1, body: "stuff"}) {
    errors {
      message
      attribute
    }
    submissionDraft {
      _id
      body
    }
  }
}
```

* you should get a result like:
```
{
  "data": {
    "createSubmissionDraft": {
      "errors": null,
      "submissionDraft": {
        "_id": "42"
        "body": "stuff",
      }
    }
  }
}
```

* in the rails console, confirm the data (especially the body)
  is correct: SubmissionDraft.find(<id>)

fixes COMMS-2265

Change-Id: I6ba6a67e3a592e295c62365ca7fa13250d05e837
Reviewed-on: https://gerrit.instructure.com/203731
QA-Review: Matthew Lemon <mlemon@instructure.com>
Reviewed-by: Matthew Lemon <mlemon@instructure.com>
Tested-by: Jenkins
Product-Review: Ryan Norton <rnorton@instructure.com>
2019-08-06 18:14:20 +00:00
Ryan Norton d790a76222 add body to submission draft in graphql
we need to add a 'body' field to the submission draft type
in graphql to allow us to store text entry drafts going forward.

Test Plan:
* run the db migration to add body to submission draft:
** bundle exec rake db:migrate:up VERSION=20190801215707

* create an assignment as a teacher
* add a student to that assignment
* run the following in the /graphiql endpoint to locate the
  submissions for that assignment

  ```query MyQuery {
  assignment(id: "1") {
    submissionsConnection(filter: {states: [unsubmitted, submitted, graded, pending_review]}) {
      nodes {
        _id
        submissionDraft {
          body
        }
      }
    }
  }
}```

** you should see a submission with a null submission draft

* in the rails console, you will need to add a submission
  draft with a body to that submission
** sub = Submission.find(1) // or whatever your submission ID is
** draft = SubmissionDraft.create!(submission: sub,
   submission_attempt = sub.attempt + 1)
** draft.body = 'some text'
** draft.save!
** sub.submission_drafts = [draft]
** sub.save!

* run the query in graphql again, and you should see something
  like:

```
{
  "data": {
    "assignment": {
      "submissionsConnection": {
        "nodes": [
          {
            "_id": "31",
            "submissionDraft": {
              "body": "some text"
            }
          }
        ]
      }
    }
  }
}
```

fixes COMMS-2263

Change-Id: I62877ac43727f02191c84a98e2609bd8f9987733
Reviewed-on: https://gerrit.instructure.com/203674
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Tested-by: Jenkins
QA-Review: Matthew Lemon <mlemon@instructure.com>
Product-Review: Ryan Norton <rnorton@instructure.com>
2019-08-06 17:37:15 +00:00
Ed Schiebel 7e41826748 fix <Select> deprecation in NewCourseModal
Replace Select with CanvasSelect
Replace legacy TextInput with the new TextInput

fixes ADMIN-2771

test plan:
  - go to account courses page, /accounts/self
  - click the "+Course" button
  > expect the 2 TextInputs to accept input
  > expect the subaccount and term selects to work as expected
  > expect some nice screenreader messages as you interact with the
    selects
  > expect the course to be created with the right data
    when clicking on the "Add Course" button
  - try it again, but do something to make it fail (I set a breakpoint
    at courses_controller.rb line 791 and set @course=nil)
  > expect to get an error flash message
  - click on the "details" button
  > expect the details popup to be above the Modal's overlay and you
    can dismiss it.

Change-Id: I8612b086a8812660c82c9d243746ed211deb5a59
Reviewed-on: https://gerrit.instructure.com/202575
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2019-08-06 17:23:46 +00:00
Matt Sessions eec763a245 Add grading status filter to submissions connection
refs: MBL-12809

Test Plan:
 - Create an assignment with a submission that needs grading, and
   a submission that is already graded
 - request submissions for the assignment through gql using the
   gradingStatus filter for needs_grading
 - It should return the submission requiring grading and
   not the other one

Change-Id: I2ac6b7e95819122d085898255a352a002aefa9f7
Reviewed-on: https://gerrit.instructure.com/202156
Tested-by: Jenkins
Reviewed-by: Cameron Matheson <cameron@instructure.com>
QA-Review: Matt Sessions <msessions@instructure.com>
Product-Review: Matt Sessions <msessions@instructure.com>
2019-08-06 16:27:32 +00:00
Ryan Shaw f0858936ab Backport instUI fix to allow themeable w/ `class`es
We made this change in @instructure/ui-themeable in g/203714
but that is for the current master on instUI 6, we need it now even
though we are still on instUI 5 so this will back port it in so we can
use it now.

Test plan:
* Things that use `themeable` should work both with and without the
  “Drop ie11” commit applied.

Specifically:
bin/rspec ./spec/selenium/dashboard/planner/student_planner_assignments_spec.rb:88
Should not fail with
TypeError: Class constructor Yr cannot be invoked without 'new'

Change-Id: I7ef8ef9eda1057badabbb08fcdd6875ad8064e89
Reviewed-on: https://gerrit.instructure.com/203950
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Tested-by: Jenkins
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-06 16:07:55 +00:00
Ryan Shaw 0da4de9d32 fix more specs relying on babel ie11 transpilation
Change-Id: I8141f30b9da5ba2a91791f02e4755d5df13a0ea1
Reviewed-on: https://gerrit.instructure.com/203949
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-06 15:34:17 +00:00
Jeremy Neander 0ddb2f5e62 recalculate grades when assignment groups load
fixes GRADE-2064

test plan:
 A. Setup
    1. Create a course
    2. Enroll 11 students
    3. Ensure two assignment groups exist (A and B)
    4. Keep the first assignment group empty (A)
    5. Create 100 assignments in group B
       * all worth 10 points
    6. Ensure the assignment groups are ordered A, then B

 B. Verify
    1. Visit Default Gradebook
    2. Grade each student for at least one assignment
    3. Visit Screenreader Gradebook
    4. For each student:
       a. Select the student in the dropdown menu
       b. Verify the student's course grade is calculated

Change-Id: Icc880e3c83a9fda549664be7083a551a018541c5
Reviewed-on: https://gerrit.instructure.com/203617
Tested-by: Jenkins
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
QA-Review: Jeremy Neander <jneander@instructure.com>
Product-Review: Jonathan Fenton <jfenton@instructure.com>
2019-08-06 15:21:45 +00:00
Ubuntu a74c80da48 [i18n] update locales with new translations
Change-Id: Idc5b9b2e6aa6bf03d5166836af2567a1f1d3cdb5
Reviewed-on: https://gerrit.instructure.com/203980
Tested-by: Jenkins
2019-08-06 07:42:43 +00:00
Cameron Matheson c1eaff1069 basic mutation audit log ui
Test plan:
  - make some mutations in graphql
  - search for those mutations in the graphql mutations audit log

refs GQL-60
flag = GraphQL Mutation Log

Change-Id: I8e94b55a3f4fc8688f4290163ffd6da984926713
Reviewed-on: https://gerrit.instructure.com/203012
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Cameron Matheson <cameron@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2019-08-05 22:46:26 +00:00
Michelle Simmons 06cb1f784c conditionally render rubrics tab depending on associated rubric
In the content tabs for an assignment, the Rubric tab should only
be rendered if the assignment has an associated rubric. Otherwise,
the rubric tab will not be rendered.

Test Plan:
* As a teacher, create two assignments; one with a rubric, and one
  without.
* As a student, view the assignment with a rubric. Notice the
  Rubric tab is rendered; click on it to view the rubric. Verify
  that the rubric is correct.
* Now view the assignment without a rubric. Notice there is no
  Rubric tab to click on. There should be no rubric information
  anywhere on the page.

fixes COMMS-2184
flag Assignments 2

Change-Id: Ib7db1fb05882b5f13325ba0e2a7cf4222f42d559
Reviewed-on: https://gerrit.instructure.com/203891
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2019-08-05 22:41:53 +00:00
Michelle Simmons 86c5b26ba2 connect assi_2 rubric with real rubrics data
Populate ungraded Assignments 2 rubrics with the appropriate data,
rather than the hard-coded data currently on master. Ungraded
rubrics still display an image of a rubric.

Test plan:
* Create an assignment and a rubric for the assignment.
* As a student, open the assignment; view the rubric under the
  Rubric Tab. The fields of the rubric should reflect the data you
  entered. The rubric should look identical to its counterpart in
  Old Assignments.
* As the teacher, grade the assignment.
* As the student, view the assignment and return to the Old
  Assignments view. Click 'Submission Details.' Click 'Show
  Rubric.' This rubric should be identical to its counterpart on
  master.

flag Assignments 2
fixes COMMS-2181

Change-Id: I3a4bab4fb09ff1f101d554fd582df3bd508937d7
Reviewed-on: https://gerrit.instructure.com/203517
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
Tested-by: Jenkins
2019-08-05 21:20:51 +00:00
Cody Cutrer bc9eb5d954 bump switchman
Change-Id: I5a44b8d52a225852170d0a378569750a745b7236
Reviewed-on: https://gerrit.instructure.com/203899
Reviewed-by: Derek Bender <djbender@instructure.com>
Tested-by: Jenkins
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2019-08-05 21:20:36 +00:00
Ryan Shaw 10a4516082 Use jsdom 14 instead of 11 in jest tests
Test plan:
* `yarn jest` should pass

Change-Id: I157a55be009bae71e574ed0e9b9ff18f9e2c048b
Reviewed-on: https://gerrit.instructure.com/203860
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Tested-by: Jenkins
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-05 20:36:16 +00:00
Ryan Shaw dba6a000e4 Fix a couple things that were relying on babel
These 2 things would not work if they were untranspiled but because of
The way babel transpiles them for ie11 the worked

Test plan:
* these should work with or without the drop ie 11 commit applied

Change-Id: Ifb2c9ad6cfeb9ad68194b72b13e1f58415d87f22
Reviewed-on: https://gerrit.instructure.com/203830
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-05 20:18:29 +00:00
Matthew Lemon 1f903ce7aa update files API for uploading via url
fixes COMMS-2257

This adds a flag to the Files API when uploading a file via a url to be
able to avoid automatically submitting the assignment associated with
the file. The flag is defaulted to true to avoid any issues that could
arrise from other services depending on the current API.

Test Plan:
* passes jenkins

Change-Id: I40e569a5126a0d9e5607f1a799269dc7d20204ed
Reviewed-on: https://gerrit.instructure.com/203105
Tested-by: Jenkins
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2019-08-05 20:16:19 +00:00
Han Yan e26f9ee0f9 Update Canvas FF to be consistent with marketing
closes QUIZ-6538

test plan:
- go to feature flag page, make sure Quizzes.Next
  is replaced by New Quizzes
- go to course "Import Content" page, select "Common
  Cartridge 1.x Package", and make sure Quizzes.Next
  in Import options is replaced with New Quizzes

Change-Id: I40e95dff1a9f7fd27bdc9f57479a6586dfb6f22f
Reviewed-on: https://gerrit.instructure.com/202982
Tested-by: Jenkins
Reviewed-by: Jim Simon <jsimon@instructure.com>
Product-Review: Kevin Dougherty III <jdougherty@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
2019-08-05 19:33:18 +00:00
Landon Gilbert-Bland 95ef4f897c Add ability to re-submit assignment in A2
Fixes COMMS-2077, COMMS-2222

Test Plan
---------
  - Make sure submission drafts work for a brand new unsubmitted
    assignment
  - Make sure you can submit a brand new unsubmitted assignment
  - Make sure the new attempt button only shows up only when it makes
    sense for it to. Specifically after you have already submitted the
    assignment, and not after you have already started a new submission
    attempt
  - Clicking the new attempt button and reloading your page should cause
    the previously submitted assignment to be displayed
  - Click the new attempt button and upload a file to create a
    submission draft
  - Reload the page. The saved submission draft should now be what is
    displayed by default
    - Notice that if you delete everything from the submission draft and
      reload the page, it will still display the 'empty' submission
      draft. This will be fixed in a future version when we have more of
      an idea about how the other submission types will play with the
      submission drafts
  - Notice that when you create a new attempt, it properly increments
    the attempt number on the header
  - Make sure that actually submitting a new attempt works
  - Make sure that you can navigate back and forth between submitted
    submissions, dummy new attempts, and new attempts backed by a
    submission draft
  - Make sure that you can still navigate back and forth between
    submissions after resubmitting the assignment without having to
    reload the page
  - Notice that you cannot leave comments on a new attempt until it has
    actually been submitted

Change-Id: Ib7a6c028464e146cf5555cef110431d9b8cbb09f
Reviewed-on: https://gerrit.instructure.com/202563
Tested-by: Jenkins
Reviewed-by: Matthew Lemon <mlemon@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2019-08-05 19:31:32 +00:00
Ed Schiebel 28ea3000ef Fix Select deprecations with CanvaSelect
this commit add the new CanvasSelect which wraps the new controlled-only
INSTUI Select (single select only) to provide a nearly drop-in
replacement for the deprecated INSTUI Select used in canvas.

This new CanvasSelect is then used in people_search.js and
TimeZoneSelect/index.js to resolve the
deprectation warnings.

changes include an upgrade to ui-select 6.8

closes ADMIN-2775, COREFE-186 COREFE-184

test plan:
  - nav to a course's people page
  - click on the +People button
  > expect the Role and Section selects to work as expected
  - nav to the account's people page
  - click on the pencil icon to the right of a user
  > expect the Time Zone select to show a blank line, then 2 groups
    of time zones
  > expect the select to work as expected
  > expect screenreaders to tell you interesting things as you
    interact with the select

Change-Id: I5dcfb2c1c8ca64071ce9dbf0a194777f10c711cf
Reviewed-on: https://gerrit.instructure.com/202508
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2019-08-05 19:30:43 +00:00
Ed Schiebel 62ebbad0ae Upgrade instui to 6.8.1 for canvas-rce
closes COREFE-193

test plan:
  - the RCE still works and the tests pass
  - in particular, be sure trays and dialogs open (this was
    broken by instui 6.8.0)

Change-Id: Ic4bc52686adbe1ae182f706e2146d7cae57ffb98
Reviewed-on: https://gerrit.instructure.com/203461
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2019-08-05 19:30:20 +00:00
James Williams f888621298 add streaming templates: part 2
adds template streaming to the following endpoints:

assignments#show
context_modules#index
courses#show
discussion_topics#show
quizzes/quizzes#show
quizzes/quizzes#edit
quizzes/quizzes#history

Change-Id: I2481f3f738077fb0eaef16e6b5f0db3ea6f60c16
Reviewed-on: https://gerrit.instructure.com/202708
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2019-08-05 19:10:20 +00:00
Matthew Lemon e962475942 create modal to display external tools in A2
I ammended the External Tool query because it turns out we only really
need the `_id`, `name`, and possibly the `description` of the tool.

fixes COMMS-2228
flag Assignments 2

Test Plan:
* Create an assignment with an online upload submission type
* Install an LTI tool on the course with a placement of Homework
  Submission (I can help you figure out how to do this)
* Masquerade as a student in the course and navigate to the assignment
* In the file drop component click the `More Options` button
* See the modal pop up and display the external tool

Change-Id: I240890d8ebfa1d3816d0d4ad7ee490814c6d82cc
Reviewed-on: https://gerrit.instructure.com/202340
Tested-by: Jenkins
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
QA-Review: Landon Gilbert-Bland <lbland@instructure.com>
Product-Review: Matthew Lemon <mlemon@instructure.com>
2019-08-05 19:02:45 +00:00
Ryan Norton 37e6e801a4 open RCE when starting text entry in A2
when we click the Start Entry button in a text entry assignment
in a2 we should launch the RCE for editing.

When the Cancel button is clicked the RCE should close and the
Start Entry page should render.

*note* the console errors that display should reportedly go
away when RCE enters production

Test Plan:
* as a teacher, create a Text Entry assignment
* as a student, navigate to the assignment in A2
* click on the "Start Entry" button
* confirm that the RCE loads on the page and is interactable

* click the "Cancel" button
* confirm that the "Start Entry" page renders again
* confirm that you can toggle between the two pages

* the Save button currently does nothing
* this does not currently interact with the pizza tracker
  until we add the text draft state to the submission

fixes COMMS-2209

Change-Id: Icf179e6d7d9eff0b0fd48e066bdf9efc482e5887
Reviewed-on: https://gerrit.instructure.com/203472
Tested-by: Jenkins
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
Reviewed-by: Matthew Lemon <mlemon@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2019-08-05 18:57:35 +00:00
Carl Kibler 2143962ac9 tell SR users of module title button purpose
Previously the purpose of clickable button on Module titles wasn't
clear as it was on other pages. Now gives same message as other pages.

fixes ADMIN-2788

test plan:
 - On Modules page, when moving focus to module title, should now
   read '<module title> toggle module visibility' then say
   'expanded' or 'collapsed'.

Change-Id: I49a135a8cd47adb804259e8d55b90272aecfe0d9
Reviewed-on: https://gerrit.instructure.com/203483
Tested-by: Jenkins
QA-Review: Daniel Sasaki <dsasaki@instructure.com>
Product-Review: Daniel Sasaki <dsasaki@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2019-08-05 16:55:26 +00:00
Jon Willesen de24e581bd direct share quizzes menu items
On the quizzes index page, each quiz has two new menu items for direct
sharing.

flag: direct_share
closes: ADMIN-2785

test plan:
- new menu items are only there when the feature flag is on
- new menu items are only there when the user can actually manage
  quizzes

Change-Id: I437d3d918fea94559702c2817b84812305574746
Reviewed-on: https://gerrit.instructure.com/203187
Tested-by: Jenkins
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
2019-08-05 16:52:45 +00:00
Jon Willesen 003f28e1f4 modules direct share menu items
closes: ADMIN-2781
flag: direct_share

test plan:
- NOTE: the modules page is cached, so you might have to wait a minute
  or refresh a couple times in order for changes to show up after you
  change the flag.
- teacher view of modules should have new menu items only when the
  feature flag is on
- This applies to both modules and module items
- Should also work when modules is the course home page

Change-Id: I5db1ff3c5ffffaaef19b01e9f6e1f54fa3b6026b
Reviewed-on: https://gerrit.instructure.com/203460
Tested-by: Jenkins
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
2019-08-05 16:52:28 +00:00
Jon Willesen bb392e94f7 Add direct share menu items to pages index
On the pages index page, each page will have two new menu items: "Send
to..." and "Copy to...". Right now these do nothing except log a console
message.

flag: direct_share
closes: ADMIN-2784

test plan:
- with the feature flag off, there are no new menu items
- with the feature flag on, the new menu items show up
- clicking on the menu items just sends a message to the console

Change-Id: I7de2affb9326cabe6ebf02aa1da927fb5bab51d8
Reviewed-on: https://gerrit.instructure.com/202889
Tested-by: Jenkins
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
2019-08-05 16:51:38 +00:00
Cody Cutrer 8ca0f38caa tweak canvas_rails_switcher.rb
* drop 5.1 flag
 * include non-environment-specific keys in fallbacks

Change-Id: I32b1caf651b65c0d26f2d6850dbf32152594bedd
flag: none
Reviewed-on: https://gerrit.instructure.com/203515
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2019-08-05 16:34:16 +00:00
Steven Burnett 746c3c39b8 add comment read state to a2
Note we modified the submission comment tests to be without a role query
selector.  This is because instui 5 has a bug this will be fixed in
instui 6

fixes COMMS-1945 COMMS-1942

Test Plan:
- Create a submission make sure its unread by your student
  `submission.mark_unread(user)`
- create several comments for the submission
- as the student visit the a2 student view with comments
- notice there is a count of all the unread dots
- notice all the dots next to the comments
- mark them read via console by creating a
  ViewedSubmissionComment with user and submission comment
  `ViewedSubmissionComment.create!(user:user, submission_comment:sc)

Change-Id: Ica2fb9432941e3f48a46da508698720c17d4b7e4
Reviewed-on: https://gerrit.instructure.com/203593
Tested-by: Jenkins
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
QA-Review: Landon Gilbert-Bland <lbland@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2019-08-05 15:40:04 +00:00
Jeremy Stanley 0dcb35c968 use correct name for dropped column
fixes ADMIN-2803

Change-Id: Ie3702a6369e42ba044861daf1f7fe941cd7b96ce
Reviewed-on: https://gerrit.instructure.com/203782
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
Tested-by: Jenkins
2019-08-05 13:35:25 +00:00
James Williams e1baed0c25 allow blueprint add/remove course api to use sis_course_id
test plan:
* use the API to associate a course with an sis id
  to a blueprint course using the format "sis_course_id:X"
* should work

closes #ADMIN-2799

Change-Id: Idc3708fa873ed1355bc786213fd953f2aa84f8fb
Reviewed-on: https://gerrit.instructure.com/203432
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Mysti Lilla <mysti@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2019-08-05 12:48:59 +00:00
Jeremy Stanley 4e928c7757 per-environment overrides for feature definitions
this is a more flexible replacement for `development` and
`hidden_in_prod` - any feature registration option can be
customized based on the environment

test plan:
 - this feature replaces "hidden_in_prod" and "development"
   and these changes are covered in specs
 - experiment with other customizations to feature
   definitions in the YAML

closes ADMIN-2760

Change-Id: Ie2c76f4b7da2ccc43bb244000dc0a490d78de9de
Reviewed-on: https://gerrit.instructure.com/202933
Tested-by: Jenkins
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2019-08-02 21:59:44 +00:00
Michael Brewer-Davis 398ca11a8c add i18n to outcome reports, lmgb export
closes OUT-3197

Test plan:
With permutations of the following feature flags
 - Account:
   Enable i18n features in outcomes exports
 - User:
   Include BOM in compatible exports
   Use semicolons in compatible exports
   Autodetect separators in compatible exports

Test that the following reports obey the
requested settings:
 - Account reports
   - Outcome Results
   - Student Competency
 - Learning Mastery Gradebook
   - Export report
   
See g/199468 for details on how reports should respond
to each setting

Change-Id: Iea942bdbc6d1efc560b0c4fc422c7c14a8fd90c4
Reviewed-on: https://gerrit.instructure.com/203101
Tested-by: Jenkins
Reviewed-by: Nathan Prabhu <nprabhu@instructure.com>
Reviewed-by: Frank Murphy III <fmurphy@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>
2019-08-02 21:42:51 +00:00
Landon Gilbert-Bland 360914f0a9 Add setting to limit number of communication channels
After merging this we need to:
  - Set the setting on FFT with a CC limit of 5
  - Prune CCs for existing users on FFT down to our limit

Refs COMMS-2259

Test Plan:
  - Set the max_communication_channels setting on your accont. In a
    rails console, run:

    ```
    Account.default.settings[:max_communication_channels] = 3
    ```

  - Make a new user, and make sure you cannot create more then 3
    communication channels
  - Delete one of the communication channels, and make suer  you still
    cannot create an additional communication channel
  - Set the `created_at` date to more then one hour ago for the deleted
    communication channel. in the rails console:

    ```
    cc = CommunicationChannel.find <deleted_cc_id>
    cc.update_columns(created_at: 2.hours.ago)
    ```

  - Try to make a communcation channel as that user again. It should now
    allow you to do so
  - Delete the max_communication_channels setting:

    ```
    Account.default.settings[:max_communication_channels] = nil
    ```

  - Make sure you can now freely create communication channels again

Change-Id: I186daccc7bd560fd2eca5181a45c16c67627eaee
Reviewed-on: https://gerrit.instructure.com/203118
Reviewed-by: Ryan Norton <rnorton@instructure.com>
Reviewed-by: Matthew Lemon <mlemon@instructure.com>
Tested-by: Jenkins
QA-Review: Ben Nelson <bnelson@instructure.com>
Product-Review: Landon Gilbert-Bland <lbland@instructure.com>
2019-08-02 21:34:35 +00:00
Ryan Shaw 84e71e95df simplify/modernize google analytics & load faster
now that we have streaming working, by loading google analytics
like this in the <head> it will load sooner but not block any of our
scripts from running.

this commit also upgrades us to use the analytics.js instead of the
legacy ga.js library.

it also actually imports it as a named export instead of just relying
on it being on the jQuery global `$` object

note: I actually took the time to set this up with a testing google
analytics account and verified that it got all the page views recorded
as before. Doing so even exposed one place where we were currently
sending PII to google analytics (in the “Act As” page) and I fixed that
https://cl.ly/e869a25266fc

test plan:
* in the console do: Setting.set('google_analytics_key', 'testing123')
  but replace “testing123” with a real valid google analytics account id
* google analytics tracking data should post to your google analytics
  account exactly the same as it did before this commit

Change-Id: I3ca51642c622ce72992159646f9d9338c58b44ba
Reviewed-on: https://gerrit.instructure.com/203581
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-02 20:07:18 +00:00
Ryan Shaw f7e074925e don’t use js_env for terms_of_service
For a couple reasons:
1. It is wasteful and slows down a lot of page loads. We only actually
   need it after someone clicks the “view terms of service” link on
   one of these pages. No point in querying it until then
2. with streaming, we want to move to where we can start running our js
   sooner, instead of waiting until after the end of the </html>.
   That means that we will not be able to js_env from <view>.html.erb
   files.


Test plan:
* the terms of service stuff should work exactly as it did before
* but if you notice, if you simulate a slow internet connection,
  There will be a small moment where it says “loading…” while it is
  Loading the custom terms of service

Change-Id: Id3df52c3a802899819dc9d25d0778b09239e11cb
Reviewed-on: https://gerrit.instructure.com/203252
Tested-by: Jenkins
Reviewed-by: James Williams <jamesw@instructure.com>
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-02 19:55:02 +00:00
Ryan Shaw 6f65d4b016 remove babel hacks so we can drop IE 11
Change-Id: Ic721333ce396faa23cf7453e18717b5e1792cb2a
Reviewed-on: https://gerrit.instructure.com/203583
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-02 19:52:52 +00:00
Ryan Shaw 8cf0a61f57 Get specs to work when using real async/await
if you applied the commit that drops support for ie11 (g/197827), 
these specs would start failing, see: 
https://jenkins.instructure.com/job/canvas__linters-and-js/67378/testReport/

The pattern seemed like something would break if you used an `async`
function as a beforeEach hook in qUnit. By just returning the promise
or using a .then, it fixed it

Test plan:
* With or without the “drop IE11” commit applied,
* Run:  
yarn jspec-watch spec/javascripts/jsx/grading/AssignmentPostingPolicyTray/AssignmentPostingPolicyTraySpec.js
  (Or any of these other changed files)

* It should work

Change-Id: I838cb7f5178496ac9c021b32ce80845094d63111
Reviewed-on: https://gerrit.instructure.com/203582
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-02 19:52:33 +00:00
Ryan Shaw 982e193cc6 remove babel hack in MultipleChoiceToggle
Change-Id: I3be43b3d9b2363deb7126c0f7322eb21f80bd7b1
Reviewed-on: https://gerrit.instructure.com/203404
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-02 19:52:20 +00:00
Cameron Matheson 4b0a3d2677 graphql: allow opting out of overrides
Test plan:
  - make an assignment with overrides:
    - querying for dueAt/lockAt/unlockAt should return overridden dates
    - passing `applyOverrides: false` to those fields should:
      - return unoverridden dates for teachers/admins
      - continue returning overridden dates for students
  - make an assignment without overrides
    - the applyOverrides argument should be ignored

flag: none
closes GQL-75
refs GQL-75

Change-Id: I245d34a1aece9b1818938c4a8fda16ab5a8d9a69
Reviewed-on: https://gerrit.instructure.com/203538
Tested-by: Jenkins
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
QA-Review: Cameron Matheson <cameron@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2019-08-02 19:20:32 +00:00
Carl Kibler 465933c132 read column sorting changes aloud in Files page
fixes ADMIN-2618

test plan:
 - On Files page with screenreader, verify clicking column header
   reads a message like "Sort ascending by name"

Change-Id: Id95b9f0668069b26a39a446f8bd2cbd33afcfe8f
Reviewed-on: https://gerrit.instructure.com/203175
Tested-by: Jenkins
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Daniel Sasaki <dsasaki@instructure.com>
Product-Review: Daniel Sasaki <dsasaki@instructure.com>
2019-08-02 19:07:24 +00:00
Ed Schiebel b410ebc4fe Focus tinymce generated context toolbars with alt-f7
There was code in the RCE to map an editor instance to the instance of a
context toolbar, but since context toolbars are only displayed when the
editor has focus with the cursor in the object, only one can be
displayed at a time making it unnecessary and we can use a css selector
to find it.

closes COREFE-102

test plan:
  - have an rce
  - add a course document, an image, and a table
  - you could even put a document link or image inside a table cell
  - put the cursor w/in each and the corresponding context toolbar
    will open
  - press alt-f7
  > expect focus to be put on the first button of the context toolbar

Change-Id: I8a52b09d593a2af846bf7ff9e15729a7f75bdb1d
Reviewed-on: https://gerrit.instructure.com/203329
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2019-08-02 18:52:34 +00:00
Cameron Matheson 189f4ed4bf revert assignment override base dates
This didn't end up being as useful for assignments-2 as we thought.

This reverts commit b468ae3561.
This reverts commit 81a29b61ba.

Change-Id: Ic98db7f9090cb64a914109a779f0f6c870a5933d
Reviewed-on: https://gerrit.instructure.com/203511
Tested-by: Jenkins
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
QA-Review: Cameron Matheson <cameron@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2019-08-02 18:08:59 +00:00
Ryan Shaw 3c0612f310 fix <Select> deprecation in AuthTypePicker
Fixes: COREFE-183

See existing spec coverage in:
spec/javascripts/jsx/authentication_providers/AuthTypePickerSpec.js
And 
spec/selenium/accounts_spec.rb

TEST PLAN:

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

Change-Id: I45d044b5b45b5a901a6dc5c759031efcf771d185
Reviewed-on: https://gerrit.instructure.com/202179
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Tested-by: Jenkins
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-02 16:44:07 +00:00
Clay Diffrient bab8ea1b44 Update .commitmessage template
This makes sure we get a consistent footer in
gerrit.

Test Plan:
  - Make a commit using flag = none
  - The Change-Id footer should appear below

flag = none

Change-Id: I20f382928f2bb20aab52f4f25260a58d80082250
Reviewed-on: https://gerrit.instructure.com/203559
Tested-by: Jenkins
Reviewed-by: Cameron Matheson <cameron@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2019-08-02 13:37:39 +00:00
Gary Mei ff0c405da7 fix muted assignments not used in points possible
The points possible being calculated in the student grades page
was not including submissions that were not posted.

fixes GRADE-2139

Test Plan
- Create 2 assignments with different points possible.
- Hide grades for 1 assignment.
- View the student grades page.
- Note the points possible.
- Uncheck "Calculate based only on graded assignments".
- Verify that the points possible increased by the amount of points
  possible for the unposted submission.

Change-Id: I4aaa1dd4b511328880daab5f9764682dd9a634f7
Reviewed-on: https://gerrit.instructure.com/203061
Tested-by: Jenkins
QA-Review: Gary Mei <gmei@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
2019-08-01 20:03:56 +00:00
Michelle Simmons 1965bef1b3 populate assi_2 rubric with hard-coded props
*** This rubric does not yet reflect Assi_2 Rubrics design ***
For an ungraded submission, the rubric (under the Rubric tab)
should be filled with hard-coded data; the values for the props
can be found in RubricProp.js, a temporary file that will be
removed once static props are no longer needed. These values
represent all the text currently seen in the rubric.
For a graded submission, the Rubric tab should display an image.

Test Plan:
* Create two assignments. As a student, make a submission to each
  assignment.
* As a teacher, grade one of the student's assignments but not the
  other.
* As the student, view the rubric for the ungraded assignment. The
  rubric should look like the rubric in old Assignments, but should
  be populated with constant data. These data can be found in
  RubricProps.js
* View the rubric for the graded assignment. The rubric should be
  an image.
* Now, in the graded assignment, switch back to old Assignments
  (/?assignments_2=false). Click 'Submission Details.' Click 'Show
  Rubric.' This rubric should be no different than its counterpart
  on master.

fixes COMMS-2179
flag Assignments 2

Change-Id: I21e3b05ece47d4d912b9354f191e60e5780409a1
Reviewed-on: https://gerrit.instructure.com/201889
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Landon Gilbert-Bland <lbland@instructure.com>
Product-Review: Michelle Simmons <misimmons@instructure.com>
2019-08-01 18:42:54 +00:00
Adrian Packel 326d1da9b3 Restrict available groups for group assignments
When the SpeedGrader group filter setting is enabled and we require a
group to be selected on the assignments page before opening SG, have
group assignments limit the list of selectable groups to only groups
with the group category specified for that assignment.

fixes GRADE-2351

Test plan:
- Have a course with new gradebook and the "Filter SpeedGrader by
  student groups" option enabled
- Create at least two group sets (GS1, GS2)
  - Create some groups for each group set
- Create the following assignments:
  - A boring old non-group assignment (A1)
  - A group assignment (A2)
  - A group assignment that grades students individually (A3)
  - For A2 and A3, select one of your group sets above
- Check the following behavior for the SpeedGrader link on the
  right-hand side of the assignment page for each assignment:
  - A1: The available groups should include groups from both group sets
  - A2/A3: The available groups should only include groups from the
    group set associated with the assignment(*)
    - If you open the assignment page having already selected a group
      from that assignment's group set, it should be pre-selected
    - If you open the page having selected a group from a *different*
      group set, "Select One" should instead be selected since your
      previous choice is not valid for this assignment

* This is probably not the behavior we ultimately want for A2--we
  probably don't want to require a group at all since the assignment is
  graded by group--but it will stay until we have a chance to change the
  behavior in all the relevant places.

Change-Id: I313f4a8f2911ca39d32196ec2790c3219745cae5
Reviewed-on: https://gerrit.instructure.com/203117
Tested-by: Jenkins
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: Gary Mei <gmei@instructure.com>
Product-Review: Jonathan Fenton <jfenton@instructure.com>
2019-08-01 18:07:48 +00:00
Adrian Packel fcd29e4ff7 Wrap SpeedGrader filter behind feature flag
closes GRADE-2359

Test plan:
- Have a course with New Gradebook enabled and some groups
- WITHOUT the new root account feature flag enabled:
  - Open the course settings page for the course
  - The "Large Course" section should not be present
  - Forcibly flip on the setting for the course:
    > course.update!(filter_speed_grader_by_student_group: true)
  - Open the Assignments page
    - You should *not* be required to select a group before launching
      SpeedGrader
  - Open New Gradebook and filter by a student group
  - Open SpeedGrader
    - It should not restrict students to that group, but should load all
      students as usual
- WITH the new root account feature flag enabled:
  - The "Large Course" section on the course settings page should appear
    for all courses in the account (assuming they have New Gradebook
    enabled)
  - The assignments page should force you to select a student group
    before clicking the SpeedGrader link
  - SpeedGrader should only load students in the group you selected

feature_flags: filter_speed_grader_by_student_group

Change-Id: I24e614d39514b0cfa912d879ddd549c757346838
Reviewed-on: https://gerrit.instructure.com/203433
Tested-by: Jenkins
Reviewed-by: Keith Garner <kgarner@instructure.com>
Reviewed-by: Jeremy Neander <jneander@instructure.com>
QA-Review: Keith Garner <kgarner@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
2019-08-01 18:02:23 +00:00
Ryan Shaw 9634de5732 Ignore a deprecation warning from selenium
Test plan:
* Jenkins selenium should pass

Change-Id: I08b464baedfafe92721766ecd39b3def0e3b0522
Reviewed-on: https://gerrit.instructure.com/203340
Tested-by: Jenkins
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
2019-08-01 17:07:46 +00:00
Steven Burnett ab630c4836 add viewed submission comments table
fixes COMMS-1943
Test Plan:
- Keep in mind this has no visual or graphql portions to it yet
  this is only getting the infrastructure around it.
- Create a submission
- Create a submission comment on the submission
- notice you can mark the comment as read by calling comment.mark_read!(@user)
- notice you can also mark the comment as read by marking its submission
  as read.  Do this by calling @submission.mark_read(@user)
- you can check the comments read status by calling comment.read?
- the end

Change-Id: If1d11f04d4db0b318582a59eb4454b1225d3eb2b
Reviewed-on: https://gerrit.instructure.com/202950
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: James Williams <jamesw@instructure.com>
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
Tested-by: Jenkins
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2019-08-01 17:04:17 +00:00