fed8e96adc
Adds an option `require_resource_selection` for the `submission_type_selection` placement to force a user to select a resource (by launching the tool) before saving the assignment. closes INTEROP-8626 flag=none Note that the validation error message is intentionally brief to avoid overflowing the allotted size for the error message popup/tooltip. Test plan: - have a tool with the submission_type_selection placement. In accordance with ContextExternalTool#placement_allowed?, you may need to add the domain or dev key to the allowed keys or allowed domains setting. - edit the tool config (dev key config if the tool is 1.3) to have "require_resource_selection": true in the submission_type_selection placement settings. - start creating a new assignment. Test out lots of different scenarios, but attempting to save the tool (for just testing whether the new validation triggers or not without actually saving the tool, you can always set the assignment title to be empty so the form won't actually submit), such as: - choosing submission type = "My Tool" and not doing anything else. there should be a validation error "Please click below to launch the tool and select a resource." - choosing submission type = "My Tool" and then launching and selecting a resource (no validation error) - selecting a resource and then hitting the 'x' to remove it (validation error) - selecting a resource, hitting the 'x' to remove it, choosing 'No Submission' and choosing 'My Tool' again. there shouldn't be any resource shown, and there should be a validation error. - selecting a resource, hitting the 'x' to remove it, clicking the button to launch the tool but closing the window before choosing another ressource. IT should show no resource and the validation error should trigger. Before this commit, it was showing the old (removed) resource. - selecting a resource, then choosing "External Tool". the URL should field should be emptied out and saving should fail with the (already existing) 'no URL' validation error. - selecting a resource, then choosing "External URL", and entering in some URL. this should succeed (make sure neither the "no URL" error or the new validation error are triggered) - choosing "External Tool" in the dropdown, then launching the tool in the normal assignment_selection placement and selecting a resource there. saving should succeed (this commit should only affect the submission_type_selection placement) - selecting a resource through assignment_selection as in the last step, and then choosing the tool in the dropdown (submission_type_selection placement). It should not show a resource and the validation should fail. - when you are done testing, choose the tool (as submission type selection) with content and save the assignment. ideally, send some custom variables in the deep linking response so you can test that those are maintained when editing the assignment. - edit the assignment and test a variety of scenarios, including: - changing only title or description (don't type submission type at all). Save the tool. Check the Lti::ResourceLink in the database to make sure that the custom URL and/or custom parameters there have been preserved - switching to "No Submission" and back to the tool. This should show the resource preserved. Save and make sure the Lti::ResourceLink has been preserved. - switching to "External Tool". this should empty out the URL field and make the validation fail. - switching to "External Tool" as in the last check, but then set the dropdown back to the tool. There should not be a resource shown and saving should fire the validation. - edit again (reload the page if necessary) and just clear out the resource by clicking the 'x' under in the resource card. validation should fail. - remove and add back the resource. that should succeed (database Lti::ResourceLink should be updated with new data) - choose "External Tool" and choose the tool in assignment_selection. choose a resource and save the assignment. That should succeed and the Lti::ResourceLink in the DB should be updated. - make an assignment with some other (ideally LTI 1.3) tool that doesn't have the submission_type_selection placement (or temporarily remove/disable submission_type_placement on your tool). edit the assignment without changing anything regarding submission type to make sure that still doesn't modify the resource link (if LTI 1.3) - remove the require_resource_selection option on the tool and make sure you can create a new assignment using that tool's submission_type_selection placement without selecting a resource. - if possible, to make sure we didn't severely make anything with MasteryConnect, test with a tool that acts like mastery connect: - change this line in the EditView.jsx: const mc_ext = item[LTI_EXT_MASTERY_CONNECT] to: const mc_ext = {points: 1, title: "foo", objectives: [], trackerName: 'foo', trackerAlignment: 'foo', studentCount: 0} - add an LTI 1.1 (cannot be 1.3) tool (such as Xander's vercel app) with the submission_type_selection placement and use Setting.set("submission_type_selection_allowed_launch_domains", ...) to allow it to use the placement (or stub out allowed_placement?) - play around with editing and editing a tool in the submission type selection placement. You will probably notice some difference (URL isn't cleared when you choose 'External Tool', values still exist when you choose the tool in the dropdown) but nothing should be too broken. At the very least, make sure you create an assignment with the tool, and then can edit the assignment and edit the description/title without changing the LTI stuff. Change-Id: I86966abe815f6370db9e5723802398491c6fb66d Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/348871 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Bence Árpási <bence.arpasi@instructure.com> QA-Review: Bence Árpási <bence.arpasi@instructure.com> Product-Review: Alexis Nast <alexis.nast@instructure.com> |
||
---|---|---|
.github | ||
.storybook | ||
.vscode | ||
Gemfile.d | ||
app | ||
bin | ||
build | ||
config | ||
db/migrate | ||
doc | ||
docker-compose | ||
gems | ||
hooks | ||
inst-cli | ||
jest | ||
lib | ||
log | ||
packages | ||
patches | ||
public | ||
script | ||
spec | ||
tmp | ||
ui | ||
ui-build | ||
vendor/gems/bundler-multilock | ||
.codeclimate.yml | ||
.dependency-cruiser.js | ||
.devcontainer.json | ||
.dive-ci | ||
.dockerignore | ||
.editorconfig | ||
.eslintignore | ||
.eslintrc.js | ||
.git-blame-ignore-revs | ||
.gitignore | ||
.gitmessage | ||
.groovylintrc.json | ||
.i18nignore | ||
.i18nrc | ||
.irbrc | ||
.lintstagedrc.js | ||
.npmrc | ||
.nvmrc | ||
.prettierrc | ||
.rspec | ||
.rubocop.yml | ||
.sentryignore | ||
.stylelintrc | ||
CONTRIBUTING.md | ||
COPYRIGHT | ||
Courses | ||
Dockerfile | ||
Dockerfile.githook | ||
Dockerfile.jenkins | ||
Dockerfile.jenkins-cache | ||
Dockerfile.jenkins.final | ||
Dockerfile.jenkins.js | ||
Dockerfile.jenkins.linters | ||
Dockerfile.jenkins.ruby-runner | ||
Dockerfile.jenkins.webpack-assets | ||
Dockerfile.jenkins.webpack-builder | ||
Dockerfile.jenkins.webpack-cache | ||
Dockerfile.jenkins.webpack-runner | ||
Dockerfile.jenkins.yarn-runner | ||
Dockerfile.package-translations | ||
Dockerfile.production | ||
Dockerfile.puma | ||
Gemfile | ||
Gemfile.lock | ||
Gemfile.rails71.lock | ||
Jenkinsfile | ||
Jenkinsfile.axe | ||
Jenkinsfile.cassandra | ||
Jenkinsfile.contract-tests | ||
Jenkinsfile.coverage | ||
Jenkinsfile.coverage-js | ||
Jenkinsfile.crystalball | ||
Jenkinsfile.dive | ||
Jenkinsfile.docker-smoke | ||
Jenkinsfile.docker-sync | ||
Jenkinsfile.dynamodb | ||
Jenkinsfile.js | ||
Jenkinsfile.junit-uploader | ||
Jenkinsfile.master-bouncer-check-all | ||
Jenkinsfile.package-translations | ||
Jenkinsfile.postgres | ||
Jenkinsfile.redis | ||
Jenkinsfile.rspecq | ||
Jenkinsfile.selenium.flakey_spec_catcher | ||
Jenkinsfile.selenium.performance.chrome | ||
Jenkinsfile.test-subbuild | ||
Jenkinsfile.vendored-gems | ||
Jenkinsfile.xbrowser | ||
LICENSE | ||
README.md | ||
Rakefile | ||
SECURITY.md | ||
bower.json | ||
code_of_conduct.md | ||
config.ru | ||
docker-compose.new-jenkins-flakey-spec-catcher.yml | ||
docker-compose.new-jenkins-js.yml | ||
docker-compose.new-jenkins-package-translations.yml | ||
docker-compose.new-jenkins-selenium.yml | ||
docker-compose.new-jenkins.consumer.yml | ||
docker-compose.new-jenkins.vendored-gems.yml | ||
docker-compose.new-jenkins.yml | ||
docker-compose.spring.yml | ||
docker-compose.yml | ||
gulpfile.js | ||
issue_template.md | ||
jest.config.js | ||
karma.conf.js | ||
package.json | ||
renovate.json | ||
rspack.config.js | ||
tsconfig.json | ||
vitest.config.ts | ||
vitest.workspace.ts | ||
yarn.lock |
README.md
Canvas LMS
Canvas is a modern, open-source LMS developed and maintained by Instructure Inc. It is released under the AGPLv3 license for use by anyone interested in learning more about or using learning management systems.
Please see our main wiki page for more information
Installation
Detailed instructions for installation and configuration of Canvas are provided on our wiki.