[Ils-source] r1594 - trunk/webapp

scribe at crosswire.org scribe at crosswire.org
Mon Jul 23 13:56:01 MST 2018


Author: scribe
Date: 2018-07-23 13:56:01 -0700 (Mon, 23 Jul 2018)
New Revision: 1594

Modified:
   trunk/webapp/aicc.jsp
Log:
updated to use new variable VarGlobalElapsedTime for saving total course time.


Modified: trunk/webapp/aicc.jsp
===================================================================
--- trunk/webapp/aicc.jsp	2018-07-21 13:57:16 UTC (rev 1593)
+++ trunk/webapp/aicc.jsp	2018-07-23 20:56:01 UTC (rev 1594)
@@ -258,11 +258,12 @@
 	String status = CourseAttempt.getINIValue(aicc_data, "lesson_status");
 	if (status != null && status.length() > 1) status = status.substring(0,1);
 	String score = CourseAttempt.getINIValue(aicc_data, "score");
-	String seatTime = CourseAttempt.getINIValue(aicc_data, "time");
+	String seatTime = CourseAttempt.getINIValue(aicc_data, "VarGlobalElapsedTime");
+	if (seatTime == null || seatTime.trim().length() == 0) seatTime = CourseAttempt.getINIValue(aicc_data, "time");
 	int seatSeconds = 0;
 	if (seatTime != null && seatTime.trim().length() > 0 && seatTime.split(":").length > 1) {
 		if (seatTime.split(":").length == 2) try { seatSeconds = (int)Duration.parse("PT"+seatTime.split(":")[0]+"M"+seatTime.split(":")[1]+"S").getSeconds(); } catch (Exception e) { logger.error("error parsing seat time: " + seatTime, e); }
-		if (seatTime.split(":").length == 3) try { seatSeconds = (int)Duration.parse("PT"+seatTime.split(":")[0]+"H"+seatTime.split(":")[1]+"M"+seatTime.split(":")[2]+"S").getSeconds(); } catch (Exception e) { logger.error("error parsing seat time: " + seatTime, e); }
+		if (seatTime.split(":").length >= 3) try { seatSeconds = (int)Duration.parse("PT"+seatTime.split(":")[0]+"H"+seatTime.split(":")[1]+"M"+seatTime.split(":")[2]+"S").getSeconds(); } catch (Exception e) { logger.error("error parsing seat time: " + seatTime, e); }
 	  if (seatSeconds > ca.getCourseAttemptSeatSeconds() && ca.getCourseAttemptStatusID() != ca.STATUS_PASSED) ca.setCourseAttemptSeatSeconds(seatSeconds);
 	}
 	int index = -1;




More information about the Ils-source mailing list