[Ils-source] r1494 - trunk/webapp

scribe at crosswire.org scribe at crosswire.org
Wed Oct 26 13:31:46 MST 2016


Author: scribe
Date: 2016-10-26 13:31:45 -0700 (Wed, 26 Oct 2016)
New Revision: 1494

Modified:
   trunk/webapp/report_employeecourseatt.jsp
Log:
only compute curriculum status if we don't have a stored course attept record with a passed or failed status.


Modified: trunk/webapp/report_employeecourseatt.jsp
===================================================================
--- trunk/webapp/report_employeecourseatt.jsp	2016-10-26 17:49:22 UTC (rev 1493)
+++ trunk/webapp/report_employeecourseatt.jsp	2016-10-26 20:31:45 UTC (rev 1494)
@@ -19,10 +19,10 @@
 <%@ page import="org.apache.log4j.Logger" %>
 
 <%!
-    static SimpleDateFormat df  = new SimpleDateFormat("MM/dd/yyyy");
+	static SimpleDateFormat df  = new SimpleDateFormat("MM/dd/yyyy");
+	Logger logger = Logger.getLogger(this.getClass());
 %>
 <%
-	Logger logger = Logger.getLogger(this.getClass());
     ILSSession ilsSession = (ILSSession)session.getAttribute("ilsSession");
     if (ilsSession == null) {
         out.print("<html><head><META HTTP-EQUIV=\"Refresh\" CONTENT=\"0;URL=login.jsp\"></head></html>");
@@ -198,6 +198,10 @@
 	.curriculumHeader {
 		background: lightgrey;
 	}
+
+	.curHeader, .courseHeader {
+		cursor: pointer;
+	}
 </style>
 <script type="text/javascript" src="crosswire.js"></script>
 <script type="text/javascript" src="js/jquery/jquery.min.js"></script>
@@ -298,8 +302,8 @@
                       <tr>
                         <td><table class="tableDataList">
                             <tr>
-                              <th>&nbsp;</th>
-                              <th>&nbsp;</th>
+                              <th title="Hide/Show Courses within Curriculum">C</th>
+                              <th title="Hide/Show All History for an Item">H</th>
 <% if (managing) { %>                            
                               <th>Comments</th>
 <% } %>                              
@@ -394,7 +398,7 @@
 	if (headerAddition != null) out.write(headerAddition);
 	out.write("</td><td>");
 	if (moreHTML.length() > 0) {
-		out.write("<span class=\"courseHeader\" id=\"courseHeader_"+ca.getCourseAttemptCourseID()+"\" onclick=\"toggleCourseDetails('"+ca.getCourseAttemptCourseID()+"');return false;\"> ▶ </span>");
+		out.write("<span class=\"courseHeader\" title=\"Show / Hide history for this item.\" id=\"courseHeader_"+ca.getCourseAttemptCourseID()+"\" onclick=\"toggleCourseDetails('"+ca.getCourseAttemptCourseID()+"');return false;\"> ▶ </span>");
 	}
 	out.write("</td>");
 	out.write(html);
@@ -409,7 +413,7 @@
 	Logger logger = Logger.getLogger("getCurriculumHTML");
 
 	StringWriter out = new StringWriter();
-	String headerAddition = ("<span id=\"curriculumHeader_"+caCur.getCourseAttemptCourseID()+"\" onclick=\"toggleCurriculumDetails('"+caCur.getCourseAttemptCourseID()+"');return false;\"> ▶ </span>");
+	String headerAddition = ("<span class=\"curHeader\" id=\"curriculumHeader_"+caCur.getCourseAttemptCourseID()+"\" title=\"Show / Hide Courses within this Curriculum\" onclick=\"toggleCurriculumDetails('"+caCur.getCourseAttemptCourseID()+"');return false;\"> ▶ </span>");
 	String html = getCourseHTML(courseAttempts, caCur, managing, user, wordNum, headerAddition, "curriculumHeader", false, courseCurriculum, curriculaList, courses, courseCourseAttempts);
 	String moreHTML = "";
 	for (int j = 0; j < courseAttempts.size(); ++j) {
@@ -449,6 +453,7 @@
 	// are we a curriculum?
 	Course curr = curriculaList.get(ca.getCourseAttemptCourseID());
 	if (curr != null) {
+		supressCert = !curr.isCourseCurriculumCertificate();
 		HashMap<String, Object>values = new HashMap<String, Object>();
 		computeCurriculumStats(curr.getCourseID(), courses, courseCurriculum, courseCourseAttempts, values);
 		int  timeFrame         = (Integer)values.get("timeFrame");
@@ -459,7 +464,13 @@
 		int  passedCourseCount = (Integer)values.get("passedCourseCount");
 		int  totalCourseCount  = (Integer)values.get("totalCourseCount");
 		ca.setValue("seattimetext", Course.getNiceTimeText(timeFrame));
-		ca.setValue("status", passedCourseCount == totalCourseCount ? "Passed" : (inProgressCourseCount == 0 && passedCourseCount == 0) ? "New" : "In Progress");
+		// if we have a stored history of passed or failed, use it.  Otherwise, compute curriculum status based on course progress
+		if (
+			   ca.getCourseAttemptStatusID() != CourseAttempt.STATUS_PASSED
+			&& ca.getCourseAttemptStatusID() != CourseAttempt.STATUS_FAILED
+		) {
+			ca.setValue("status", passedCourseCount == totalCourseCount ? "Passed" : (inProgressCourseCount == 0 && passedCourseCount == 0) ? "New" : "In Progress");
+		}
 		if ("In Progress".equals(ca.getValue("status"))) ca.setCourseAttemptStartDate(new Date(sDate));
 	}
 




More information about the Ils-source mailing list