diff --git a/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/select/SelectActionListener.java b/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/select/SelectActionListener.java index ef79ad20000e..3a12117351e2 100755 --- a/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/select/SelectActionListener.java +++ b/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/select/SelectActionListener.java @@ -554,11 +554,11 @@ private void processSortInfo(SelectAssessmentBean bean) { // agent is authorizaed and filter out the one that does not meet the // takeable criteria. // SAK-1464: we also want to filter out assessment released To Anonymous Users - private List getTakeableList(List assessmentList, Map h, List updatedAssessmentNeedResubmitList, List updatedAssessmentList) { + private List getTakeableList(List assessmentList, Map h, List updatedAssessmentNeedResubmitList, List updatedAssessmentList) { List takeableList = new ArrayList(); GradingService gradingService = new GradingService(); Map numberRetakeHash = gradingService.getNumberRetakeHash(AgentFacade.getAgentString()); - Map actualNumberRetake = gradingService.getActualNumberRetakeHash(AgentFacade.getAgentString()); + Map actualNumberRetake = gradingService.getActualNumberRetakeHash(AgentFacade.getAgentString()); ExtendedTimeDeliveryService extendedTimeDeliveryService; for (int i = 0; i < assessmentList.size(); i++) { PublishedAssessmentFacade f = (PublishedAssessmentFacade)assessmentList.get(i); @@ -584,7 +584,7 @@ private List getTakeableList(List assessmentList, Map h, List updatedAssessmentN return takeableList; } - public boolean isAvailable(PublishedAssessmentFacade f, Map h, Map numberRetakeHash, Map actualNumberRetakeHash, List updatedAssessmentNeedResubmitList, List updatedAssessmentList) { + public boolean isAvailable(PublishedAssessmentFacade f, Map h, Map numberRetakeHash, Map actualNumberRetakeHash, List updatedAssessmentNeedResubmitList, List updatedAssessmentList) { boolean returnValue = false; //1. prepare our significant parameters Integer status = f.getStatus(); @@ -651,7 +651,7 @@ public boolean isAvailable(PublishedAssessmentFacade f, Map h, Map numberRetakeH } else { int actualNumberRetake = 0; if (actualNumberRetakeHash.get(f.getPublishedAssessmentId()) != null) { - actualNumberRetake = ((Integer) actualNumberRetakeHash.get(f.getPublishedAssessmentId())); + actualNumberRetake = (actualNumberRetakeHash.get(f.getPublishedAssessmentId())); } if (actualNumberRetake < numberRetake) { returnValue = true; @@ -664,7 +664,7 @@ public boolean isAvailable(PublishedAssessmentFacade f, Map h, Map numberRetakeH if (retractDate == null || retractDate.after(currentDate)) { int actualNumberRetake = 0; if (actualNumberRetakeHash.get(f.getPublishedAssessmentId()) != null) { - actualNumberRetake = ((Integer) actualNumberRetakeHash.get(f.getPublishedAssessmentId())); + actualNumberRetake = (actualNumberRetakeHash.get(f.getPublishedAssessmentId())); } if (actualNumberRetake < numberRetake) { returnValue = true; diff --git a/samigo/samigo-services/src/java/org/sakaiproject/tool/assessment/facade/AssessmentGradingFacadeQueries.java b/samigo/samigo-services/src/java/org/sakaiproject/tool/assessment/facade/AssessmentGradingFacadeQueries.java index 6201ee8e1cd1..0f5c2d516cbf 100644 --- a/samigo/samigo-services/src/java/org/sakaiproject/tool/assessment/facade/AssessmentGradingFacadeQueries.java +++ b/samigo/samigo-services/src/java/org/sakaiproject/tool/assessment/facade/AssessmentGradingFacadeQueries.java @@ -1802,8 +1802,8 @@ public Map> getSiteActualNumberRetakeHash(final String s return actualNumberRetakeHash; } - public Map getActualNumberRetakeHash(final String agentIdString) { - Map actualNumberRetakeHash = new HashMap<>(); + public Map getActualNumberRetakeHash(final String agentIdString) { + Map actualNumberRetakeHash = new HashMap<>(); final HibernateCallback> hcb = session -> { Query q = session.createQuery( "select a.publishedAssessmentId, count(*) from AssessmentGradingData a, StudentGradingSummaryData s " + @@ -1817,7 +1817,7 @@ public Map getActualNumberRetakeHash(final String agentIdString) { }; List countList = getHibernateTemplate().execute(hcb); for (Object[] o : countList) { - actualNumberRetakeHash.put((Long) o[0], (Long) o[1]); + actualNumberRetakeHash.put((Long) o[0], (Integer) o[1]); } return actualNumberRetakeHash; } diff --git a/samigo/samigo-services/src/java/org/sakaiproject/tool/assessment/facade/AssessmentGradingFacadeQueriesAPI.java b/samigo/samigo-services/src/java/org/sakaiproject/tool/assessment/facade/AssessmentGradingFacadeQueriesAPI.java index e7f8b1daacec..d798704c3f52 100644 --- a/samigo/samigo-services/src/java/org/sakaiproject/tool/assessment/facade/AssessmentGradingFacadeQueriesAPI.java +++ b/samigo/samigo-services/src/java/org/sakaiproject/tool/assessment/facade/AssessmentGradingFacadeQueriesAPI.java @@ -227,7 +227,7 @@ public AssessmentGradingData getHighestSubmittedAssessmentGrading( public int getActualNumberRetake(Long publishedAssessmentId, String agentIdString); - public Map getActualNumberRetakeHash(String agentIdString); + public Map getActualNumberRetakeHash(String agentIdString); public Map> getSiteActualNumberRetakeHash(String siteIdString); diff --git a/samigo/samigo-services/src/java/org/sakaiproject/tool/assessment/services/GradingService.java b/samigo/samigo-services/src/java/org/sakaiproject/tool/assessment/services/GradingService.java index ce0385d21cea..8ff7f658ae19 100644 --- a/samigo/samigo-services/src/java/org/sakaiproject/tool/assessment/services/GradingService.java +++ b/samigo/samigo-services/src/java/org/sakaiproject/tool/assessment/services/GradingService.java @@ -2533,15 +2533,15 @@ public int getActualNumberRetake(Long publishedAssessmentId, String agentIdStrin return actualNumberReatke; } - public Map getActualNumberRetakeHash(String agentIdString) { - Map actualNumberReatkeHash = new HashMap<>(); + public Map getActualNumberRetakeHash(String agentIdString) { + Map actualNumberRetakeHash = new HashMap<>(); try { - actualNumberReatkeHash = PersistenceService.getInstance(). + actualNumberRetakeHash = PersistenceService.getInstance(). getAssessmentGradingFacadeQueries().getActualNumberRetakeHash(agentIdString); } catch (Exception e) { log.error(e.getMessage(), e); } - return actualNumberReatkeHash; + return actualNumberRetakeHash; } public Map> getSiteActualNumberRetakeHash(String siteIdString) {