Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metrics hotfix #1572

Merged
merged 2 commits into from
Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/metrics_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def index
@max_consecutive_assessments = if course_max.nil?
0
else
course_max[1] - 1
course_max[1]
end
end

Expand Down
14 changes: 7 additions & 7 deletions app/models/watchlist_instance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,8 @@ def self.add_new_instances_for_conditions(conditions, course, category_blocklist
case condition.condition_type

when "grace_day_usage"
grace_day_threshold = condition.parameters[:grace_day_threshold].to_i
date = condition.parameters[:date]
grace_day_threshold = condition.parameters["grace_day_threshold"].to_i
date = condition.parameters["date"]
asmts_before_date = course.asmts_before_date(date)
asmts_before_date = asmts_before_date.reject do |asmt|
category_blocklist.include?(asmt.category_name)
Expand All @@ -377,8 +377,8 @@ def self.add_new_instances_for_conditions(conditions, course, category_blocklist
cur_instances << new_instance unless new_instance.nil?

when "grade_drop"
percentage_drop = condition.parameters[:percentage_drop].to_f
consecutive_counts = condition.parameters[:consecutive_counts].to_i
percentage_drop = condition.parameters["percentage_drop"].to_f
consecutive_counts = condition.parameters["consecutive_counts"].to_i

categories = course.assessment_categories - category_blocklist
asmt_arrs = categories.map do |category|
Expand All @@ -391,16 +391,16 @@ def self.add_new_instances_for_conditions(conditions, course, category_blocklist
cur_instances << new_instance unless new_instance.nil?

when "no_submissions"
no_submissions_threshold = condition.parameters[:no_submissions_threshold].to_i
no_submissions_threshold = condition.parameters["no_submissions_threshold"].to_i

new_instance = add_new_instance_for_cud_no_submissions(course, category_blocklist,
condition.id, cud,
no_submissions_threshold)
cur_instances << new_instance unless new_instance.nil?

when "low_grades"
grade_threshold = condition.parameters[:grade_threshold].to_f
count_threshold = condition.parameters[:count_threshold].to_i
grade_threshold = condition.parameters["grade_threshold"].to_f
count_threshold = condition.parameters["count_threshold"].to_i

new_instance = add_new_instance_for_cud_low_grades(course, category_blocklist,
condition.id, cud,
Expand Down