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

OO-3645: fix query to get attempts for the reminders rules

parent e069661a
No related branches found
No related tags found
No related merge requests found
...@@ -51,7 +51,7 @@ public class ReminderRuleDAO { ...@@ -51,7 +51,7 @@ public class ReminderRuleDAO {
public Map<Long,Float> getScores(RepositoryEntryRef entry, CourseNode node, List<Identity> identities) { public Map<Long,Float> getScores(RepositoryEntryRef entry, CourseNode node, List<Identity> identities) {
if(identities == null || identities.isEmpty()) { if(identities == null || identities.isEmpty()) {
return new HashMap<Long,Float>(); return new HashMap<>();
} }
Set<Long> identityKeySet = null; Set<Long> identityKeySet = null;
...@@ -88,7 +88,7 @@ public class ReminderRuleDAO { ...@@ -88,7 +88,7 @@ public class ReminderRuleDAO {
public Map<Long,Integer> getAttempts(RepositoryEntryRef entry, CourseNode node, List<Identity> identities) { public Map<Long,Integer> getAttempts(RepositoryEntryRef entry, CourseNode node, List<Identity> identities) {
if(identities == null || identities.isEmpty()) { if(identities == null || identities.isEmpty()) {
return new HashMap<Long,Integer>(); return new HashMap<>();
} }
Set<Long> identityKeySet = null; Set<Long> identityKeySet = null;
...@@ -115,7 +115,11 @@ public class ReminderRuleDAO { ...@@ -115,7 +115,11 @@ public class ReminderRuleDAO {
Long identityKey = (Long)infos[0]; Long identityKey = (Long)infos[0];
if(identityKeySet == null || identityKeySet.contains(identityKey)) { if(identityKeySet == null || identityKeySet.contains(identityKey)) {
Number attempts = (Number)infos[1]; Number attempts = (Number)infos[1];
dateMap.put(identityKey, new Integer(attempts.intValue())); if(attempts != null) {
dateMap.put(identityKey, Integer.valueOf(attempts.intValue()));
} else {
dateMap.put(identityKey, Integer.valueOf(0));
}
} }
} }
return dateMap; return dateMap;
...@@ -123,7 +127,7 @@ public class ReminderRuleDAO { ...@@ -123,7 +127,7 @@ public class ReminderRuleDAO {
public Map<Long,Date> getInitialAttemptDates(RepositoryEntryRef entry, CourseNode node, List<Identity> identities) { public Map<Long,Date> getInitialAttemptDates(RepositoryEntryRef entry, CourseNode node, List<Identity> identities) {
if(identities == null || identities.isEmpty()) { if(identities == null || identities.isEmpty()) {
return new HashMap<Long,Date>(); return new HashMap<>();
} }
Set<Long> identityKeySet = null; Set<Long> identityKeySet = null;
...@@ -158,7 +162,7 @@ public class ReminderRuleDAO { ...@@ -158,7 +162,7 @@ public class ReminderRuleDAO {
public Map<Long,Boolean> getPassed(RepositoryEntryRef entry, CourseNode node, List<Identity> identities) { public Map<Long,Boolean> getPassed(RepositoryEntryRef entry, CourseNode node, List<Identity> identities) {
if(identities == null || identities.isEmpty()) { if(identities == null || identities.isEmpty()) {
return new HashMap<Long,Boolean>(); return new HashMap<>();
} }
Set<Long> identityKeySet = null; Set<Long> identityKeySet = null;
......
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