Commit Graph

19 Commits

Author SHA1 Message Date
Ben Nelson fa7d042761 add data for NP overrides on upcoming_assignment
Need to pass course ID and root account ID for the notification
preference overrides to correctly look up their data

fixes VICE-607

Change-Id: I9afaf77d95d009eb8847294518b61027f872e2da
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/242221
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Matthew Lemon <mlemon@instructure.com>
QA-Review: Matthew Lemon <mlemon@instructure.com>
Product-Review: Matthew Lemon <mlemon@instructure.com>
2020-07-09 01:02:28 +00:00
Ahmad Amireh cf98f71cd3 send upcoming assignment alert to unaware students
Fills in the stub for actually sending the notification to the selected
students.

Test Plan:
In a Rails console
 - Grab a student who has Due Date notifications set to Immediate (u)
 - Grab an assignment that the student is assigned, but has not
     submitted and is due in the future (a)
 - `s = Submission.find_by(user_id: u.id, assignment_id: a.id)`
 - `n = BroadcastPolicy.notification_finder.by_name('Upcoming Assignment Alert')`
 - `AssignmentUtil.alert_unaware_student(n, assignment: a, submission: s)`
 - Verify that a notification was sent

fixes VICE-445, VICE-446
flag  = smart_alerts

Change-Id: I56032152c8f9a0c4c2387d28420c419f990440d1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/240397
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Matthew Lemon <mlemon@instructure.com>
QA-Review: Matthew Lemon <mlemon@instructure.com>
Product-Review: Matthew Lemon <mlemon@instructure.com>
2020-07-07 19:31:53 +00:00
Ahmad Amireh e590f4e04f identify asmt students who need to be alerted
fixes KNO-444
flag  = smart_alerts

this patch implements a simplified version of what was discussed in the
RFC[1] where we use the 2 following conditions to decide whether a
student should be alerted:

1. they didn't make a submission AND
2. they didn't interact with the assignment in the last 3 days

.
. TEST PLAN
. .... ....

you'll need the console for this since there's no UI yet:

- edit assignment_util.rb:77 and insert a log statement there like:

    puts "alerting student #{student.id} for assignment #{assignment.id}"

- create an assignment and assign it to some students
- run AssignmentUtil.process_due_date_reminder('Assignment', id) and
  verify it logs for the students you expect
- (optional) enable page views[2] and visit the assignment page as a
  student, now upon running the function again verify it excludes that
  student (since they've "seen the assignment recently")

for overrides:

- create a group and add 1-2 students to it
- create an assignment exclusively for that group
- run #process_due_date_reminder with the AssignmentOverride object this
  time and verify it logs only the students for that group

[1]: https://docs.google.com/document/u/1/d/1fEO54slgHENTFS-vPfPqhGgr7ysS976u1koDjr9jdX4
[2]: run "Setting.set('enable_page_views', 'db')" in console

Change-Id: Ie2cd6b5ff47baf03faf2da9576c5f9204311a5d5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239465
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ben Nelson <bnelson@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Caleb Guanzon <cguanzon@instructure.com>
2020-06-17 06:36:51 +00:00
Anju Reddy 8308ad99c6 update validation for due and unlock dates
flag=none

closes: LA-939

test plan:
-- Atempt 1
- Create or edit an Assignment
- let lock_at date be before due date
- Try save and ensure there is an error
-- Attempt 2
- Repeat attempt1 with unlock_at date after the due date(no lock_at)
-- Attempt 3
- Repeat by entering both invalid lock_at and unlock_at dates
-- Attempt 4
- Ensure you can save when entering valid dates
-- Attempt 5
- Ensure you can save with no due date and no lock_at and unlock_at dates

Change-Id: Ic6e2f88313e5831fbb184fa15cf0ddf0423b5d55
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/234841
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Anju Reddy <areddy@instructure.com>
2020-04-24 20:27:28 +00:00
James Williams 3af5109cdf don't allow saving invalid assignment dates
sending an empty "assignment_overrides" array
in the api bypassed date validation so it
was allowed to create an invalid assignment

refs #COMMS-1008

Change-Id: I838819b6db8fb9080e51af825f1be25e0afdf3cf
Reviewed-on: https://gerrit.instructure.com/145390
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2018-04-05 16:59:19 +00:00
Rob Orton ad746af569 consider dates to be equal when in the same minute
fixes QO-336

test plan
 - Create a quiz
 - Select Graded Quiz as the type
 - Enter in a date for Available, Due and Until
 - Save the quiz
 - Edit the quiz
 - Change the Until date use the Calendar to match
  the Due date
 - it should work

Change-Id: I0d94e751008f06c19d25c0772bd322a5cc66419c
Reviewed-on: https://gerrit.instructure.com/145005
Tested-by: Jenkins
Reviewed-by: Davis Lynn McClellan <dmcclellan@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2018-03-31 06:26:09 +00:00
Rob Orton 377d4f0ceb validate dates on assignment model
fixes CNVS-41165

test plan
 - should allow updating due date to invalid lock
   range if lock range is also updated

Change-Id: I928918be6079e431ac38d471a68ed86a6991201d
Reviewed-on: https://gerrit.instructure.com/139788
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
QA-Review: Venk Natarajan <vnatarajan@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2018-02-06 16:57:48 +00:00
Landon Wilkins 014cc7368c da licença part 25
add consistent license headers to all source files
(ruby, coffeescript, javascript)

except for vendor files

Change-Id: Ic87c252aa2a2e2739d61ee9164431698e8d7e547
Reviewed-on: https://gerrit.instructure.com/110048
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-04-27 21:51:40 +00:00
Nick Houle 32241acdde Fix Post to SIS toggle without new settings on
Fixes: SIS-2826

Test plan:
- Navigate to account settings
- Go to the Feature Options tab
- Disable 'Enable new SIS integration settings'
- Navigate back to the Settings tab
- Update Settings
- Navigate to a course
- Create an assignment without a due date
- Navigate to the Assignment index page
- Click the `Post to SIS` icon to enable the setting
- Confirm the due date/name too long validation warning does not
  show

Change-Id: I5e1da0e1a2357a0584253acd455c953658222ce8
Reviewed-on: https://gerrit.instructure.com/107884
Reviewed-by: Brad Humphrey <brad@instructure.com>
Tested-by: Jenkins
QA-Review: Mark McDermott <mmcdermott@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
2017-04-11 18:35:11 +00:00
Nick Houle 52ff436ba7 Due Date Validation should not prevent saving assignment or quiz
Fixes: SIS-2811

Test plan:
- Turn the following account settings on:
-- "Default SIS Sync for assignments, quizzes, grade discussion"
-- "Require assignment due date"
- Navigate to a course
- Create a 'Not Graded' Assignment
- Confirm you can save the assignment without a due date
- Create a quiz of grading type 'Practice Quiz'
- Confirm you can save the quiz without a due date
- Create a quiz of grading type 'Ungraded Survey'
- Confirm you can save the quiz without a due date

Change-Id: I4b0705e0d1f5714c6ed5686292e26a264d58ce33
Reviewed-on: https://gerrit.instructure.com/106451
Tested-by: Jenkins
QA-Review: Mark McDermott <mmcdermott@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
2017-03-29 19:45:16 +00:00
Nick Houle bbb1c30574 Use context to find sis settings in AssignmentUtil
Fixes: SIS-2800

Test plan:
- Confirm all existing SIS account settings work as intended

Change-Id: I8adcc62fbc5fcc012bf3d6fa13ca58f01a4120e5
Reviewed-on: https://gerrit.instructure.com/105069
Reviewed-by: Brad Humphrey <brad@instructure.com>
Tested-by: Jenkins
QA-Review: Mark McDermott <mmcdermott@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
2017-03-17 18:02:22 +00:00
Nick Houle 62ac3d970b Add friendly SIS name for 'Post to SIS' options
Fixes: SIS-2694

Test plan:
- Navigate to the account settings page
- Navigate to the `Feature Options` tab
- Turn the `Enable new SIS integration settings` feature flag on
- Navigate back to the `Settings` tab
- Enter a name for the 'SIS friendly name' setting
- Save the settings
- Navigate to a course
- For Assignments, Discussions and Quizzes confirm the post_to_sis
  option has been renamed to 'Post to #{name_you_entered}'
- Confirm if you remove that setting on the account the options
  go back to their original verbiage "Post to SIS"

Change-Id: Iccb2e89f201ef2750605a1396d238c9a0a8ca243
Reviewed-on: https://gerrit.instructure.com/102480
QA-Review: Mark McDermott <mmcdermott@instructure.com>
Reviewed-by: Stewie aka Nicholas Stewart <nstewart@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
Tested-by: Jenkins
2017-02-17 18:38:26 +00:00
Nick Houle b664a85bbc Add front end max_name_length validations for Discussions
Fixes: SIS-2743

Test plan:
- Navigate to the account settings page
- Navigate to the `Feature Options` tab
- Turn the `Enable new SIS integration settings` feature flag on
- Navigate back to the `Settings` tab
- Check "Limit assignment names lengths (max 255)" option
- Enter a max assignment name length value
- Save the settings
- Navigate to a course
- Create a Discussion
- Enter a name that is longer than the value you entered
- Check the 'Graded' option
- Check the `Post to SIS` optiona
- Click Save/Save & Publish
- Confirm the save fails and you are presented with a UI error
  "Name is too long, must be under #{the_value_you_entered} characters"
- Confirm upon changing the name you are able to save the discussion

Change-Id: Iafd578a5923fce35761065d3088ae1b2e8c4bbcd
Reviewed-on: https://gerrit.instructure.com/101040
Tested-by: Jenkins
Reviewed-by: Stewie aka Nicholas Stewart <nstewart@instructure.com>
QA-Review: Mark McDermott <mmcdermott@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
2017-02-14 22:11:50 +00:00
Stewie (Nicholas Stewart) fe79fce0e6 Merge commit for due date validation
Merge remote-tracking branch
'origin/dev/stewie/2017-02-10-differentiated-assignment-override-due-dates'

Due date validation works for differentiated assignments.

Quiz and Discussion Topic due date validation will come later.

Mastery path assignment due date validation will also come later.

Refs: SIS-2636

Test Plan:
Due dates for new differentiated assignments should be required when:
  assignment.post_to_sis = true
  account's sis_require_assignment_due_date is true
  the new_sis_integrations feature flag is on

Change-Id: I874c37a2acbea6297a80ba2efb953d0ec3e54490
2017-02-13 11:56:54 -07:00
Stewie (Nicholas Stewart) 067e4204ae Add sis_syncing to the list of checks
due_date_required_for_account now uses the sis_syncing value in
determining its own return value.

Refs: SIS-2636

Test Plan: QA will review the functionality in the merge commit to
master.

Change-Id: Ia5c021cfd2039abb80b8a876d916a87e89b3a207
Reviewed-on: https://gerrit.instructure.com/101897
Reviewed-by: Nick Houle <nhoule@instructure.com>
Tested-by: Jenkins
Product-Review: Stewie aka Nicholas Stewart <nstewart@instructure.com>
QA-Review: Stewie aka Nicholas Stewart <nstewart@instructure.com>
2017-02-13 17:30:06 +00:00
Nick Houle 7f1d7a0471 Add front end max_name_length validations for Assignments
Refs: SIS-2692

Test plan:
- Navigate to the account settings page
- Navigate to the `Feature Options` tab
- Turn the `Enable new SIS integration settings` feature flag on
- Navigate back to the `Settings` tab
- Check "Limit assignment names lengths (max 255)" option
- Enter a max assignment name length value
- Save the settings
- Navigate to a course
- Create an assignment
- Enter a name that is longer than the value you entered
- Check the `Post to SIS` option
- Click Save/Save & Publish
- Confirm the save fails and you are presented with a UI error
  "Name is too long, must be under #{the_value_you_entered} characters"
- Confirm upon changing the name you are able to save the assignment

Change-Id: Ie446b1878a882274c7617789db62b3d271f864f4
Reviewed-on: https://gerrit.instructure.com/100530
Product-Review: Brad Humphrey <brad@instructure.com>
Reviewed-by: Stewie aka Nicholas Stewart <nstewart@instructure.com>
QA-Review: Mark McDermott <mmcdermott@instructure.com>
Tested-by: Jenkins
2017-02-11 00:43:47 +00:00
Stewie (Nicholas Stewart) e894f4e0dc Add DUE_DATE_REQUIRED_FOR_ACCOUNT to the js_env
Added DUE_DATE_REQUIRED_FOR_ACCOUNT to the js_env in the assignments
controller.  This will be used in to verify if a date is required for
the assignment, and this functionality will appear in the next commit.

Refs: SIS-2636

Test Plan: QA will review the functionality in the final commit.

Change-Id: I320337aa6fc8779adb5e022b6d846736e603da69
Reviewed-on: https://gerrit.instructure.com/101392
Tested-by: Jenkins
Reviewed-by: Ken Romney <kromney@instructure.com>
Product-Review: Stewie aka Nicholas Stewart <nstewart@instructure.com>
QA-Review: Stewie aka Nicholas Stewart <nstewart@instructure.com>
2017-02-08 23:11:13 +00:00
Nick Houle abd2c336d6 Add max_name_length to Assignment
Refs: SIS-2692

Test plan:
- Verify that an assignment requires name to be shorter or equal
  to the name length setting on the account with post to sis
  checked, the sis sync settings is checked, the assignment name
  length setting is checked on the account, there's a value for
  the name length setting and the new_sis_integrations feature
  flag is on

Change-Id: I8eea8c1087d9798f3893776e358e5cfb966717f5
Reviewed-on: https://gerrit.instructure.com/100056
Tested-by: Jenkins
Reviewed-by: Stewie aka Nicholas Stewart <nstewart@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
2017-02-03 23:42:36 +00:00
Stewie (Nicholas Stewart) 89bc88ad6a Add due_date_required? to Assignment
This commit is largely a refactor of my previous commit and lays
the groundwork for future which will include adding
due_date_required? to the assignment api

Refs: SIS-2636

Test Plan:
  Verify that an assignment requires a due date under certain
  conditions:
  assignment.post_to_sis = true
  account's sis_require_assignment_due_date is true
  the new_sis_integrations feature flag is on

Change-Id: I4366db1d67c76cf433120cf767225ff80c955c21
Reviewed-on: https://gerrit.instructure.com/99593
Tested-by: Jenkins
QA-Review: <mmcdermott@instructure.com>
Reviewed-by: Nick Houle <nhoule@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
2017-01-18 23:44:07 +00:00