Skip to content
Snippets Groups Projects
Commit bd4d8302 authored by srosse's avatar srosse
Browse files

OO-1602: better detection of task for the reminder

parent 94c52444
No related branches found
No related tags found
No related merge requests found
...@@ -163,15 +163,27 @@ public class BeforeDateTaskRuleEditor extends RuleEditorFragment { ...@@ -163,15 +163,27 @@ public class BeforeDateTaskRuleEditor extends RuleEditorFragment {
if(AssignTaskRuleSPI.class.getSimpleName().equals(ruleType)) { if(AssignTaskRuleSPI.class.getSimpleName().equals(ruleType)) {
boolean assignment = config.getBooleanSafe(GTACourseNode.GTASK_ASSIGNMENT); boolean assignment = config.getBooleanSafe(GTACourseNode.GTASK_ASSIGNMENT);
Date dueDate = config.getDateValue(GTACourseNode.GTASK_ASSIGNMENT_DEADLINE); if(assignment) {
if(assignment && dueDate != null) { Date dueDate = config.getDateValue(GTACourseNode.GTASK_ASSIGNMENT_DEADLINE);
nodes.add(courseNode); int numOfDays = config.getIntegerSafe(GTACourseNode.GTASK_ASSIGNMENT_DEADLINE_RELATIVE, -1);
String relativeTo = config.getStringValue(GTACourseNode.GTASK_ASSIGNMENT_DEADLINE_RELATIVE_TO);
if(dueDate != null) {
nodes.add(courseNode);
} else if(numOfDays >= 0 && StringHelper.containsNonWhitespace(relativeTo)) {
nodes.add(courseNode);
}
} }
} else if(SubmissionTaskRuleSPI.class.getSimpleName().equals(ruleType)) { } else if(SubmissionTaskRuleSPI.class.getSimpleName().equals(ruleType)) {
boolean submit = config.getBooleanSafe(GTACourseNode.GTASK_SUBMIT); boolean submit = config.getBooleanSafe(GTACourseNode.GTASK_SUBMIT);
Date dueDate = config.getDateValue(GTACourseNode.GTASK_SUBMIT_DEADLINE); if(submit) {
if(submit && dueDate != null) { Date dueDate = config.getDateValue(GTACourseNode.GTASK_SUBMIT_DEADLINE);
nodes.add(courseNode); int numOfDays = config.getIntegerSafe(GTACourseNode.GTASK_SUBMIT_DEADLINE_RELATIVE, -1);
String relativeTo = config.getStringValue(GTACourseNode.GTASK_SUBMIT_DEADLINE_RELATIVE_TO);
if(dueDate != null) {
nodes.add(courseNode);
} else if(numOfDays >= 0 && StringHelper.containsNonWhitespace(relativeTo)) {
nodes.add(courseNode);
}
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment