From: <se...@us...> - 2008-05-12 20:24:00
|
Revision: 131 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=131&view=rev Author: sem62 Date: 2008-05-12 13:23:44 -0700 (Mon, 12 May 2008) Log Message: ----------- Finished with logic of summary page Modified Paths: -------------- WebEditor/template/global/SummaryPage.js Modified: WebEditor/template/global/SummaryPage.js =================================================================== --- WebEditor/template/global/SummaryPage.js 2008-05-12 20:05:40 UTC (rev 130) +++ WebEditor/template/global/SummaryPage.js 2008-05-12 20:23:44 UTC (rev 131) @@ -102,24 +102,28 @@ rowNum++; var percents = "0"; - if ((min != null) && (max != null) && (raw != null)){ - percents = 100 * (raw - min) / (max - min) + " %"; + if ((parseInt(min) || min == 0) && (parseInt(max) || max == 0) && (parseInt(raw) || raw == 0)){ + if (max == min){ + percents = "? %"; + } else { + percents = 100 * (raw - min) / (max - min) + " %"; + } } if (modelName == "LectureModel"){ raw = (completionStatus == "completed") ? "read" : "unread"; - percents = "--"; + percents = ""; } - if (min == null){ + if (!parseInt(min) && min != 0){ min = "--"; } - if (max == null){ + if (!parseInt(max) && max != 0){ max = "--"; } - if (raw == null){ + if (!parseInt(raw) && raw != 0){ raw = "--"; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |