canvas-lms/lib
Brian Park 54b9ec859b apply deductions for missing submissions periodically
closes CNVS-36153

Test Plan

NOTE: If you don't feel like waiting 5 minutes for the missing
deductions job to run open config/initializers/period_jobs.rb
and change */5 * * * * to */1 * * * * on line 183. This will
make the job run once per minute. This change will need to be
made prior to starting the rails server.

1. Create a course with some students in it
2. Create some quiz and non-quiz assignments
  a. Mix grading types and submission types
  b. Make sure at least one of the assignments is complete/incomplete
     and has some kind of online submission type
  c. Set the due dates for some of the assignments/quizzes to be in
     the past within the last 24 hours, some further in the past,
     some in the future. Make sure at least one complete/incomplete
     assignment has a due date within the last 24 hours and one
     other grading type within the last 24 hours.
  d. Create at least one assignment due within the last 24 hours and
  	 manually grade one of the students in your course, but not the
  	 others.
  d. Create at least one assignment due within the last 24 hours and:
     1. Mark one of its submissions as missing via the rails
     	console with:
     	Assignment.find(4).submissions.first.update(
     		late_policy_status: 'missing'
     	)
     2. Mark one if its submissions as late via the rails console:
       Assignment.find(4).submissions.second.update(
     		late_policy_status: 'late'
     	)
  f. Wait for the missing deductions job to run in the console you'll
     see output that starts with:
  	"periodic: MissingPolicyApplicator.apply_missing_deductions...."
  g. Visit Gradezilla.
  h. Verify that none of the assignments were automatically graded.
3. Create a LatePolicy for your course via the rails console like so:
   LatePolicy.create(
   	course_id: <COURSE_ID>,
   	missing_submission_deduction_enabled: true,
   	missing_submission_deduction: 90
   )
4. Wait for the job to run again.
5. Visit Gradezilla
6. Verify that grades have been correctly assigned based on missing
   policy. If you created the LatePolicy with the command given in
   step 3 you should see each assignment/quiz given a score of 10%
   of total points. Complete / Incomplete assignments should always
   be given a score of zero and grade of Incomplete. Verify that
   the Total score for the course has been updated.
7. The submission where you set late_policy_status to late should
   not have been graded but the other submissions for that
   assignment should have been.
8. Verify that the manually graded assignment did not have its score
   overridden by the missing policy.
9. Grading periods
  a. Create an assignment in an open grading period that is due
     within the last 24 hours.
  b. Verify that it gets automatically graded when the job runs.
  c. Create an assignment in a closed grading period due within
     the last 24 hours.
  d. Verify that it is not automatically graded when the job runs.
10. Due date overrides
  a. Create assignments with overrides for individual students.
  b. Verify that if the override is due within the last 24 hours
     the submission gets automatically graded.
  c. Verify that if the override is not due within the last 24 hours
     it is not automatically graded.
11. Create a couple more courses and run through some of the above
    scenarios to verify that all courses with a missing policy have
    their missing policy applied correctly.

Change-Id: I39fd9e4c641df83a3bb222fc4b4f48d1c35a767b
Reviewed-on: https://gerrit.instructure.com/109727
Reviewed-by: Neil Gupta <ngupta@instructure.com>
Tested-by: Jenkins
Reviewed-by: Shahbaz Javeed <sjaveed@instructure.com>
QA-Review: Shahbaz Javeed <sjaveed@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2017-05-31 19:21:22 +00:00
..
address_book da licença part 25 2017-04-27 21:51:40 +00:00
api teacher-side index, show, and details APIs 2017-05-31 15:08:01 +00:00
app_center da licença part 25 2017-04-27 21:51:40 +00:00
basic_lti da licença part 26 2017-04-27 21:52:25 +00:00
canvadocs add users crocodoc id if they have one 2017-05-25 16:25:36 +00:00
canvas upgrade to aws-sdk v3 2017-05-26 15:30:08 +00:00
cc propagate removal of due/available dates in blueprint sync 2017-05-23 15:34:53 +00:00
data_fixup ensure google hosted_domain is nil for empty str 2017-05-26 19:52:38 +00:00
external_auth_observation da licença part 29 2017-04-27 21:59:53 +00:00
features da licença part 29 2017-04-27 21:59:53 +00:00
latex stringify request ids before signing for mathman 2017-05-16 20:42:39 +00:00
lti Merge branch 'dev/platform/content-item' into HEAD 2017-05-15 13:30:25 -06:00
messageable_user da licença part 32 2017-04-27 22:00:01 +00:00
outcomes da licença part 32 2017-04-27 22:00:01 +00:00
reporting da licença part 33 2017-04-27 22:00:04 +00:00
scribd da licença part 34 2017-04-27 22:00:30 +00:00
services upgrade to aws-sdk v3 2017-05-26 15:30:08 +00:00
sis reset pseudo_by_integration_id for each user on import 2017-05-24 23:14:33 +00:00
stubs da licença part 34 2017-04-27 22:00:30 +00:00
support_helpers da licença part 34 2017-04-27 22:00:30 +00:00
tasks upgrade mediaelement.js to instructure/mediaelement#1a177ed2cc 2017-05-25 15:13:20 +00:00
turnitin da licença part 35 2017-04-28 17:30:19 +00:00
user_content da licença part 36 2017-04-28 17:31:17 +00:00
utils da licença part 36 2017-04-28 17:31:17 +00:00
account_services.rb da licença part 25 2017-04-27 21:51:40 +00:00
action_controller_test_process.rb da licença part 25 2017-04-27 21:51:40 +00:00
address_book.rb da licença part 25 2017-04-27 21:51:40 +00:00
api.rb allow canvas api to take uuid as a user request param 2017-05-12 16:04:48 +00:00
api_route_set.rb da licença part 25 2017-04-27 21:51:40 +00:00
asset_signature.rb da licença part 25 2017-04-27 21:51:40 +00:00
assignment_override_applicator.rb da licença part 25 2017-04-27 21:51:40 +00:00
assignment_util.rb da licença part 25 2017-04-27 21:51:40 +00:00
authentication_methods.rb refactor and unify User#find_pseudonym_for_account and SisPseudonym 2017-05-02 18:50:31 +00:00
basic_lti.rb da licença part 26 2017-04-27 21:52:25 +00:00
brand_config_helpers.rb da licença part 26 2017-04-27 21:52:25 +00:00
brand_config_regenerator.rb da licença part 26 2017-04-27 21:52:25 +00:00
brandable_css.rb da licença part 26 2017-04-27 21:52:25 +00:00
browser.rb da licença part 26 2017-04-27 21:52:25 +00:00
canvadocs.rb Canvadocs hijack crocodoc sessions 2017-05-03 22:11:01 +00:00
canvas.rb da licença part 27 2017-04-27 21:53:31 +00:00
canvas_logger.rb da licença part 27 2017-04-27 21:53:31 +00:00
canvas_yaml.rb da licença part 27 2017-04-27 21:53:31 +00:00
cc.rb da licença part 27 2017-04-27 21:53:31 +00:00
config_file.rb da licença part 27 2017-04-27 21:53:31 +00:00
content_licenses.rb da licença part 27 2017-04-27 21:53:31 +00:00
content_notices.rb da licença part 27 2017-04-27 21:53:31 +00:00
content_zipper.rb da licença part 27 2017-04-27 21:53:31 +00:00
copy_authorized_links.rb da licença part 27 2017-04-27 21:53:31 +00:00
course_link_validator.rb da licença part 27 2017-04-27 21:53:31 +00:00
custom_validations.rb da licença part 27 2017-04-27 21:53:31 +00:00
cuty_capt.rb da licença part 27 2017-04-27 21:53:31 +00:00
dates_overridable.rb da licença part 28 2017-04-27 21:53:35 +00:00
delayed_message_scrubber.rb da licença part 28 2017-04-27 21:53:35 +00:00
delicious.rb da licença part 28 2017-04-27 21:53:35 +00:00
differentiable_assignment.rb da licença part 28 2017-04-27 21:53:35 +00:00
due_date_cacher.rb re-apply late policies to any late submissions as needed 2017-05-26 18:53:26 +00:00
effective_due_dates.rb Limit EffectiveDueDates query to subset of users 2017-05-26 16:40:26 +00:00
email_address_validator.rb da licença part 29 2017-04-27 21:59:53 +00:00
enrollments_from_user_list.rb da licença part 29 2017-04-27 21:59:53 +00:00
eportfolio_page.rb da licença part 29 2017-04-27 21:59:53 +00:00
external_feed_aggregator.rb da licença part 29 2017-04-27 21:59:53 +00:00
external_statuses.rb da licença part 29 2017-04-27 21:59:53 +00:00
feature.rb allow gradezilla to be default gradebook at a course level 2017-05-31 17:03:29 +00:00
feature_flags.rb da licença part 29 2017-04-27 21:59:53 +00:00
file_in_context.rb da licença part 29 2017-04-27 21:59:53 +00:00
file_splitter.rb da licença part 29 2017-04-27 21:59:53 +00:00
grade_calculator.rb Limit EffectiveDueDates query to subset of users 2017-05-26 16:40:26 +00:00
gradebook_exporter.rb refactor and unify User#find_pseudonym_for_account and SisPseudonym 2017-05-02 18:50:31 +00:00
gradebook_importer.rb da licença part 30 2017-04-27 21:59:55 +00:00
gradebook_settings_helpers.rb da licença part 30 2017-04-27 21:59:55 +00:00
grading_period_helper.rb da licença part 30 2017-04-27 21:59:55 +00:00
has_content_tags.rb da licença part 30 2017-04-27 21:59:55 +00:00
host_url.rb da licença part 30 2017-04-27 21:59:55 +00:00
i18n_time_zone.rb da licença part 30 2017-04-27 21:59:55 +00:00
imported_html_converter.rb da licença part 30 2017-04-27 21:59:55 +00:00
job_live_events_context.rb symbolize live events 2017-05-14 01:30:14 +00:00
late_policy_applicator.rb re-apply late policies to any late submissions as needed 2017-05-26 18:53:26 +00:00
latex.rb da licença part 31 2017-04-27 21:59:58 +00:00
learning_outcome_context.rb da licença part 31 2017-04-27 21:59:58 +00:00
locale_selection.rb da licença part 31 2017-04-27 21:59:58 +00:00
logging_filter.rb da licença part 31 2017-04-27 21:59:58 +00:00
login_hooks.rb da licença part 31 2017-04-27 21:59:58 +00:00
math_man.rb da licença part 32 2017-04-27 22:00:01 +00:00
message_dispatcher.rb da licença part 32 2017-04-27 22:00:01 +00:00
message_scrubber.rb da licença part 32 2017-04-27 22:00:01 +00:00
messageable_user.rb da licença part 32 2017-04-27 22:00:01 +00:00
missing_policy_applicator.rb apply deductions for missing submissions periodically 2017-05-31 19:21:22 +00:00
model_cache.rb da licença part 32 2017-04-27 22:00:01 +00:00
multi_cache.rb da licença part 32 2017-04-27 22:00:01 +00:00
must_view_module_progressor.rb da licença part 32 2017-04-27 22:00:01 +00:00
mutable.rb da licença part 32 2017-04-27 22:00:01 +00:00
net_ldap_extensions.rb da licença part 32 2017-04-27 22:00:01 +00:00
notification_message_creator.rb da licença part 32 2017-04-27 22:00:01 +00:00
open_object.rb da licença part 32 2017-04-27 22:00:01 +00:00
outcome_attributes.rb da licença part 32 2017-04-27 22:00:01 +00:00
outcome_importer.rb da licença part 32 2017-04-27 22:00:01 +00:00
permissions.rb da licença part 33 2017-04-27 22:00:04 +00:00
plannable.rb add ungraded discussion topics to planner 2017-05-30 22:01:46 +00:00
progress_runner.rb da licença part 33 2017-04-27 22:00:04 +00:00
request_cache.rb da licença part 33 2017-04-27 22:00:04 +00:00
request_error.rb da licença part 33 2017-04-27 22:00:04 +00:00
rubric_context.rb da licença part 33 2017-04-27 22:00:04 +00:00
scope_filter.rb da licença part 34 2017-04-27 22:00:30 +00:00
search_term_helper.rb da licença part 34 2017-04-27 22:00:30 +00:00
send_to_stream.rb da licença part 34 2017-04-27 22:00:30 +00:00
sentry_proxy.rb da licença part 34 2017-04-27 22:00:30 +00:00
simple_stats.rb da licença part 34 2017-04-27 22:00:30 +00:00
simple_tags.rb da licença part 34 2017-04-27 22:00:30 +00:00
sis.rb da licença part 34 2017-04-27 22:00:30 +00:00
sorts_assignments.rb da licença part 34 2017-04-27 22:00:30 +00:00
ssl_common.rb da licença part 34 2017-04-27 22:00:30 +00:00
stats.rb da licença part 34 2017-04-27 22:00:30 +00:00
sticky_sis_fields.rb da licença part 34 2017-04-27 22:00:30 +00:00
submission_list.rb da licença part 34 2017-04-27 22:00:30 +00:00
submittable.rb da licença part 34 2017-04-27 22:00:30 +00:00
submittables_grading_period_protection.rb da licença part 34 2017-04-27 22:00:30 +00:00
summary_message_consolidator.rb da licença part 34 2017-04-27 22:00:30 +00:00
syslog_wrapper.rb da licença part 34 2017-04-27 22:00:30 +00:00
temp_cache.rb da licença part 35 2017-04-28 17:30:19 +00:00
text_helper.rb da licença part 35 2017-04-28 17:30:19 +00:00
time_zone_helper.rb da licença part 35 2017-04-28 17:30:19 +00:00
timed_cache.rb da licença part 35 2017-04-28 17:30:19 +00:00
turnitin.rb da licença part 35 2017-04-28 17:30:19 +00:00
turnitin_id.rb da licença part 35 2017-04-28 17:30:19 +00:00
unzip_attachment.rb da licença part 36 2017-04-28 17:31:17 +00:00
user_content.rb da licença part 36 2017-04-28 17:31:17 +00:00
user_list.rb da licença part 36 2017-04-28 17:31:17 +00:00
user_list_v2.rb refactor and unify User#find_pseudonym_for_account and SisPseudonym 2017-05-02 18:50:31 +00:00
user_merge.rb da licença part 36 2017-04-28 17:31:17 +00:00
user_search.rb da licença part 36 2017-04-28 17:31:17 +00:00
vericite.rb VeriCite: get all scores for an assignment in bulk 2017-05-24 17:09:57 +00:00
visibility_plucking_helper.rb da licença part 36 2017-04-28 17:31:17 +00:00
zip_extractor.rb da licença part 36 2017-04-28 17:31:17 +00:00