[skip-stages=Flakey]
Change-Id: I6abefdfa9fed6dd4525c8786e93efa548b3710f2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/319603
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
Build-Review: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
closes EVAL-2790
flag=assignments_2_student
Test Plan:
* Prerequisite: Published course with a student and assignment enhancements
enabled.
1. Create a group file upload assignment with the student assigned to one
of the groups.
2. As the student, select to upload to the assignment and select a big
file. While that file is uploading, select the same file to upload
again.
3. Notice that no "Error updating submission draft" message appears, and
you can submit without issues.
Change-Id: I58b30e4e4734dd974c39b096bbb633b6e32bfd0c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/314014
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
Reviewed-by: Cameron Ray <cameron.ray@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Sam Garza <sam.garza@instructure.com>
Add several fields to submission drafts to facilitate saving LTI launch
submissions, and allow drafts to be of the type basic_lti_launch. (To
avoid breaking the new workflow, we don't yet let drafts with this type
be saved as actual submissions.)
To avoid accumulating content from a potentially infinite number of
external tools, a draft may only contain data from a single external
tool at a time. This is fine since drafts of this type will be a link to
work done somewhere else, rather than local work that could be lost.
closes EVAL-1998
flag=assignments_2_student
Test plan:
- Test that the migration works
- Smoke test creating and submitting a draft with one of the existing
types in the UI to make sure nothing has broken
Change-Id: I2f9d66af5f479812177d47aa1b925fbecbd95d97
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275253
QA-Review: Adrian Packel <apackel@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
closes DEMO-114
flag=none
test plan:
- make sure `Assignment Enhancements - Student` FF is enabled in Canvas
- create online assignments with text entry (or file uploads ...)
- in Canvas rails console, find the text entry draft (SubmissionDraft)
- create another SubmissionDraft records with the same submission and attempt
(see new addtions in create_submission_draft_spec.rb, to bypass activerecord
validations)
- add a new text entry draft without submitting
- update the text entry, draft is persited without errors
Change-Id: I47a9aa2420e6e2e9f200c0c66b60d80bf5ad8a3e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257920
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: Han Yan <hyan@instructure.com>
Test Plan
- run migrations
- Create a course and add a student to it
- Create an assignment with a media_recording submission type
- Masquerade as the student and navigate to the assignment
- Upload/record a new media entry
- In the rails console find the MediaObject you just uploaded and grab
the media_id from it. Also grab the Submission id.
m = MediaObject.last
m.media_id
s = Submission.last
s.id
- Navigate to /graphiql
- Create a new submission draft
mutation MyMutation {
__typename
createSubmissionDraft(input: {
activeSubmissionType: media_recording,
submissionId: <your_submission_id>,
mediaId: <your_media_id>,
attempt: 1
}) {
submissionDraft {
mediaObject {
_id
canAddCaptions
id
mediaType
title
}
}
}
}
- Verify that the mediaObject looks good
refs COMMS-2502
flag=assignments_2_student
Change-Id: I93e86d7d7914fe9aeaa68223c752f09c323938e4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/214136
Tested-by: Jenkins
QA-Review: Ben Nelson <bnelson@instructure.com>
Product-Review: Matthew Lemon <mlemon@instructure.com>
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
TEST PLAN
- create a course and add a student to it
- Create an assignment with an online url submission type
- Masquerade as the student and navigate to the assignment
- Open the network tab in your dev tools
- Enter an invalid url e.g. 'ooooooh eeeeee'
- You should see a helpful message with an example of what a valid url
looks like
- Refresh the page. Note that despite being invalid the draft is still
saved
- Enter a valid url e.g. http://www.reddit.com and then wait 1 second or
click out of the input.
- You should see a graphql mutation to create the submission draft in
the network tab
- You should also see the submit button show up
- Enter something else e.g. google.com
- The input should update to show http://google.com
- Click the submit button
- You should see the graphql mutation to create the submission in the
network tab
- The pizza tracker should also reflect the submitted status
fixes COMMS-2331
flag=assignments_2
Change-Id: I8fc19df31112e3fc504da88f65b5ef609ed35869
Reviewed-on: https://gerrit.instructure.com/209181
Tested-by: Jenkins
QA-Review: Steven Burnett <sburnett@instructure.com>
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
Product-Review: Matthew Lemon <mlemon@instructure.com>
when there are multiple submission types and the user updates
a submission type, we should persist that choice the next time
they access the assignment.
Test Plan:
* run the db migration to add active_submission_type to the
submission draft:
** bundle exec rake db:migrate:up VERSION=20191001164744
* as a teacher, create an assignment with multiple submission
types (i.e. file upload, text entry)
* as a student in A2, navigate to the assignment
* you should see the landing page requesting you choose a
submission type
* select a type but do not create a draft
* on refreshing the page, you should be taken back to the landing
page
* select the File type
* add a file to the draft
* on refreshing the page, you should be taken to the file upload
component
* select the Text Entry type
* create a text entry draft
* on refreshing the page, you should be taken to the text entry
component
* re-select the File type
* remove the file you added
* on refreshing the page, you should be taken to the file upload
component again
* re-select the Text Entry type
* do not modify the draft
* on refreshing the page, you should be taken to the file upload
component again
* re-select the Text Entry type
* remove the text draft
* on refreshing the page, you should be taken to the text entry
component again
Misc Confirmations:
* when adding drafts to multiple submission types, the drafts
persist and are not erased when adding a draft to a different
type
* in the rails console, if you manually set the active submission
type to something that is not a valid submission type on the
assignment, you should be taken to the landing page
```
sd = SubmissionDraft.last # or whatever draft you're working against
sd.active_submission_type = 'online_url'
sd.save!
```
flag=assignments_2_student
fixes COMMS-2476
Change-Id: Iebf78fc785a2df0acc03c0ce8a13efd34060f341
Reviewed-on: https://gerrit.instructure.com/211701
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: Ryan Norton <rnorton@instructure.com>
Test Plan
- run the db migration to add url to the SubmissionDraft table
- bundle exec rake db:migrate:up VERSION=20190916193616
- Create a course and add a student to it
- Create an assignment with a submission type of online url
- Masquerade as the student and navigate to the /graphiql endpoint
- Run the following mutation updated with the appropriate submissionID:
```
mutation MyMutation {
__typename
createSubmissionDraft(input: {submissionId: <your_submission_id>, url: "http://www.google.com", attempt: 1}) {
errors {
attribute
message
}
submissionDraft {
_id
url
submissionAttempt
}
}
}
```
- The mutation should return 0 errors and the submission draft should
reflect the given url
- Run the following query updated with the appropriate submissionID:
```
query MyQuery {
__typename
legacyNode(_id: <your_submission_id>, type: Submission) {
... on Submission {
id
submissionDraft {
url
submissionAttempt
_id
}
}
}
}
```
- The query result should show the url you entered in the previous
mutation
refs COMMS-2331
flag=assignments_2
Change-Id: I60d756a9f0a29ea5aece960416edbb43c0949ddc
Reviewed-on: https://gerrit.instructure.com/209727
Tested-by: Jenkins
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
QA-Review: Ben Nelson <bnelson@instructure.com>
Product-Review: Matthew Lemon <mlemon@instructure.com>
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>
This changes the workflow around submission drafts. You will now always
create the draft for the attempt one ahead of the current submission
instead of parity for the current submission.
Closes COMMS-2218
Test Plan:
- Jenkins passes
Change-Id: I2045847a974457a093a2ebf62f137f80dbdcf493
Reviewed-on: https://gerrit.instructure.com/202238
Tested-by: Jenkins
Reviewed-by: Michelle Simmons <misimmons@instructure.com>
Reviewed-by: Matthew Lemon <mlemon@instructure.com>
QA-Review: Landon Gilbert-Bland <lbland@instructure.com>
Product-Review: Landon Gilbert-Bland <lbland@instructure.com>
Fixes COMMS-1986
Test Plan:
* Create an assignment
* As a student navigate to the assignment
* Submit the assignment a couple times
* Use the `Load Next` and `Load Previous` buttons at the bottom of the
page to cycle between submissions, and make sure that is working as
expected
* Notice that it now says `Attempt x` in the header depending on what
attempt you are currently on
Change-Id: I6e8263505450e8e85b7ce2bd93b9559bbc0fb2ac
Reviewed-on: https://gerrit.instructure.com/194153
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Michelle Simmons <misimmons@instructure.com>
Product-Review: Landon Gilbert-Bland <lbland@instructure.com>
fixes COMMS-2066
Test Plan:
* create a course and create an assignment in that course
* add a student to the course
* masquerade as the student and navigate to Account > Files and upload a
few files for the user
* Open the rails console
`bundle exec rails c`
* look up the files you had uploaded in the previous step
`attachments = Attachment.where(user_id: <your_student_id>)`
* grab the file ids of those attachments
`ids = attachments.map(&:id)`
* Also grab the submission id
`submission_id = Submission.last.id`
* while still masquerading as the student navigate to the /graphiql
endpoint
* in the mutation list select creatSubmissionDraft or just copy and
paste the following, updating the query params with the values we found
in the previous steps (attempt should be 0):
```
mutation {
createSubmissionDraft(input: {
submissionId: "47",
attempt: 0,
fileIds: ["28", "29", "31"]
}) {
errors {
message
}
submissionDraft {
submission {
_id
user {
name
}
}
submissionAttempt
attachments {
_id
url
}
_id
}
}
}
```
* press play and run the mutation
* note the returned submission draft
* validate that the submission draft exists in the rails console. The
draft and its attachments should match the return values from running
the mutation
```
s = Submission.find(<the_submission_id>)
draft = s.submission_drafts.last
draft.attachments
```
* remove or add some of the files and run the mutation again
* note the returned submission draft
* validate that the submission draft was updated in the rails console
Change-Id: I0df1b12325f635e89ba2a28212dac651fb5d3ae9
Reviewed-on: https://gerrit.instructure.com/194267
Tested-by: Jenkins
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
QA-Review: Michelle Simmons <misimmons@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>