From: <se...@us...> - 2008-05-02 23:10:07
|
Revision: 78 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=78&view=rev Author: sem62 Date: 2008-05-02 16:09:45 -0700 (Fri, 02 May 2008) Log Message: ----------- Fixed bug: objectives list in Summary page was not correct. Summary page is ready for 90 %. Modified Paths: -------------- WebEditor/src/edu/lnu/FireFly/WebEditor/Data/SummaryPageManager.java WebEditor/src/template/SummaryPageModel.html WebEditor/src/template/global/SummaryPage.js Modified: WebEditor/src/edu/lnu/FireFly/WebEditor/Data/SummaryPageManager.java =================================================================== --- WebEditor/src/edu/lnu/FireFly/WebEditor/Data/SummaryPageManager.java 2008-05-02 22:35:58 UTC (rev 77) +++ WebEditor/src/edu/lnu/FireFly/WebEditor/Data/SummaryPageManager.java 2008-05-02 23:09:45 UTC (rev 78) @@ -114,6 +114,7 @@ ItemModel childModel = ItemModels.getModelFromItem(child); if (childModel.getShowOnSummaryPage(child)) { + result.add(getItemId(child)); result.addAll(getShowingItemsIds(child)); } } Modified: WebEditor/src/template/SummaryPageModel.html =================================================================== --- WebEditor/src/template/SummaryPageModel.html 2008-05-02 22:35:58 UTC (rev 77) +++ WebEditor/src/template/SummaryPageModel.html 2008-05-02 23:09:45 UTC (rev 78) @@ -4,12 +4,50 @@ <meta http-equiv="Content-Type" content="text/html; charset=utf8" /> <script type="text/javascript" src="global/APIWrapper.js"></script> <script type="text/javascript" src="global/SummaryPage.js"></script> + +<style> +.tbl-border { + color: #555; + background-color: #bbb; +} + +.tbl { + font-size: 11px; + color: #555; + background-color: #fdfced; + padding: 4px; +} + +.tbl1 { + font-size: 11px; + background-color: #fdfced; + padding: 4px; +} + +.tbl2 { + font-size: 11px; + background-color: #fbf8ca; + padding: 4px; +} + +</style> </head> <body onload="Initialize();" onunload="Terminate();"> <div id="page_content"> + <table align='center' cellpadding='0' cellspacing='1' width='85%' class='tbl-border'> + <tr> + <td align='center' width='35' class='tbl2' style='white-space:nowrap'><b>#</b></td> + <td align='center' width='*' class='tbl2' style='white-space:nowrap'><b>Item title</b></td> + <td align='center' width='70' class='tbl2' style='white-space:nowrap'><b>Min</b></td> + <td align='center' width='70' class='tbl2' style='white-space:nowrap'><b>Max</b></td> + <td align='center' width='70' class='tbl2' style='white-space:nowrap'><b>Raw score</b></td> + <td align='center' width='70' class='tbl2' style='white-space:nowrap'><b>%</b></td> + </tr> + <!--content start--> <!--content end--> + </table> </div> </body> </html> \ No newline at end of file Modified: WebEditor/src/template/global/SummaryPage.js =================================================================== --- WebEditor/src/template/global/SummaryPage.js 2008-05-02 22:35:58 UTC (rev 77) +++ WebEditor/src/template/global/SummaryPage.js 2008-05-02 23:09:45 UTC (rev 78) @@ -1,3 +1,6 @@ +var deep = 0; +var rowNum = 0; + function out(s){ document.write(s); } @@ -2,29 +5,49 @@ +function ins(title, min, max, raw){ + var percents = 100*(raw-min)/(max-min) + " %"; + rowNum++; + + var td = "<td class='tbl"; + td += 1 - (rowNum % 2) + 1; + td += "'>"; + + document.write("<TR>" + td + rowNum); + document.write(td + title); + document.write(td + min); + document.write(td + max); + document.write(td + raw); + document.write(td + percents); +} + function openBlock(title){ - out("Opened block with title = "+title+"<br>\n"); + deep++; } function closeBlock(title){ - out("Closed block with title = "+title+"<br>\n"); + deep--; } function add(title, modelName, id){ - out(title + ". item id = " + id + "(" + modelName + ")<br>\n"); - out("score is: "); - out(getScore(id)); - out("<br>\n"); + for (i=0; i < deep; i++){ + title = " " + title; + } + + ins(title, getScore(id, "min"), getScore(id, "max"), getScore(id, "raw")); } function getObjectiveIndex(id){ var count = GetValue("cmi.objectives._count"); - for (i = 0; i < count; i++) - if (GetValue("cmi.objectives." + i + ".id") == id) + for (i = 0; i < count; i++){ + var curr = GetValue("cmi.objectives." + i + ".id"); + if (curr == id){ return i; + } + } return -1; } -function getScore(objectiveID){ - var index = getObjectiveIndex(objectiveID); - var res = GetValue("cmi.objectives." + index + ".score.scaled"); +function getScore(objectiveID, field){ + var index = getObjectiveIndex(objectiveID); + var res = GetValue("cmi.objectives." + index + ".score." + field); return res != null ? res : 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |