Index: lams_tool_vote/conf/language/ApplicationResources.properties
===================================================================
diff -u -r9d3b73b44f51fa4497afbc5a84a74dde79a25503 -r63c1c2dbe54c8eed67ddd6d429886e7ca3daef5d
--- lams_tool_vote/conf/language/ApplicationResources.properties (.../ApplicationResources.properties) (revision 9d3b73b44f51fa4497afbc5a84a74dde79a25503)
+++ lams_tool_vote/conf/language/ApplicationResources.properties (.../ApplicationResources.properties) (revision 63c1c2dbe54c8eed67ddd6d429886e7ca3daef5d)
@@ -119,8 +119,16 @@
label.view.barchart =View Bar Chart
label.visible =Visible
label.select.statsSession =Please select a group to view class statistics
+label.export.learner =Portfolio Export for Learner
+label.export.teacher =Portfolio Export for Teacher
+label.export =Portfolio Export
+label.class.summary =Class Votes Summary
+label.class.summaryAll =All Votes Summary
+label.individual.learnerVotes =Individual Learner Votes
+label.all.learnerVotes =All Learner Votes
+
#======= End labels: Exported 96 labels for en AU =====
#======= Add on 16/05/2006 =====
authoring.msg.cancel.save=Do you want to close this window without saving?
\ No newline at end of file
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUsrAttemptDAO.java
===================================================================
diff -u -rca438ee67636fd831f44725bdb36bb7ff5108ebf -r63c1c2dbe54c8eed67ddd6d429886e7ca3daef5d
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUsrAttemptDAO.java (.../IVoteUsrAttemptDAO.java) (revision ca438ee67636fd831f44725bdb36bb7ff5108ebf)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUsrAttemptDAO.java (.../IVoteUsrAttemptDAO.java) (revision 63c1c2dbe54c8eed67ddd6d429886e7ca3daef5d)
@@ -45,14 +45,16 @@
public List getUserRecords(final String userEntry);
- public Set getContentEntries(final Long voteContentUid);
+ public List getContentEntries(final Long voteContentUid);
public Set getUserEntries();
public int getAllEntriesCount();
- public Set getSessionUserEntries(final Long voteSessionUid);
+ public List getSessionUserEntries(final Long voteSessionUid);
+ public Set getSessionUserEntriesSet(final Long voteSessionUid);
+
public List getUserEnteredVotesForSession(final String userEntry, final Long voteSessionUid);
public VoteUsrAttempt getAttemptByUID(Long uid);
@@ -61,6 +63,8 @@
public int getSessionEntriesCount(final Long voteSessionId);
+ public int getStandardAttemptsForQuestionContentAndContentUid(final Long voteQueContentId, final Long voteContentUid);
+
public int getSessionUserRecordsEntryCount(final String userEntry, final Long voteSessionUid, IVoteService voteService);
public int getUserRecordsEntryCount(final String userEntry);
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUsrAttemptDAO.java
===================================================================
diff -u -rca438ee67636fd831f44725bdb36bb7ff5108ebf -r63c1c2dbe54c8eed67ddd6d429886e7ca3daef5d
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUsrAttemptDAO.java (.../VoteUsrAttemptDAO.java) (revision ca438ee67636fd831f44725bdb36bb7ff5108ebf)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUsrAttemptDAO.java (.../VoteUsrAttemptDAO.java) (revision 63c1c2dbe54c8eed67ddd6d429886e7ca3daef5d)
@@ -108,13 +108,13 @@
return list;
}
- public Set getContentEntries(final Long voteContentUid)
+ public List getContentEntries(final Long voteContentUid)
{
HibernateTemplate templ = this.getHibernateTemplate();
List list = getSession().createQuery(LOAD_ALL_ENTRIES)
.list();
- Set contentEntries= new HashSet();
+ List contentEntries= new ArrayList();
Iterator listIterator=list.iterator();
logger.debug("looking for voteContentUid: " + voteContentUid);
while (listIterator.hasNext())
@@ -142,6 +142,7 @@
}
+
public Set getUserEntries()
{
HibernateTemplate templ = this.getHibernateTemplate();
@@ -165,46 +166,31 @@
}
- public Set getUserEntriesByContentId(final Long voteQueContentId)
+ public List getSessionUserEntries(final Long voteSessionUid)
{
HibernateTemplate templ = this.getHibernateTemplate();
- List list = getSession().createQuery(LOAD_USER_ENTRIES)
+ List list = getSession().createQuery(LOAD_ALL_ENTRIES)
.list();
-
- Set set= new HashSet();
-
- Set userEntries= new HashSet();
+
+ List sessionUserEntries= new ArrayList();
if(list != null && list.size() > 0){
Iterator listIterator=list.iterator();
while (listIterator.hasNext())
{
- String entry=(String)listIterator.next();
- logger.debug("entry: " + entry);
- if ((entry != null) && (entry.length() > 0))
- userEntries.add(entry);
+ VoteUsrAttempt attempt=(VoteUsrAttempt)listIterator.next();
+ logger.debug("attempt: " + attempt);
+ if (attempt.getVoteQueUsr().getVoteSession().getUid().toString().equals(voteSessionUid.toString()))
+ {
+ if ((attempt.getUserEntry() != null) && (attempt.getUserEntry().length() > 0))
+ sessionUserEntries.add(attempt.getUserEntry());
+ }
}
}
-
- Set contentEntries= new HashSet();
- if(userEntries != null && userEntries.size() > 0){
- Iterator setIterator=userEntries.iterator();
- while (setIterator.hasNext())
- {
- String entry=(String)setIterator.next();
- logger.debug("entry: " + entry);
- if ((entry != null) && (entry.length() > 0))
-
- contentEntries.add(entry);
- }
- }
-
- return userEntries;
+ return sessionUserEntries;
}
-
-
- public Set getSessionUserEntries(final Long voteSessionUid)
- {
+ public Set getSessionUserEntriesSet(final Long voteSessionUid)
+ {
HibernateTemplate templ = this.getHibernateTemplate();
List list = getSession().createQuery(LOAD_ALL_ENTRIES)
.list();
@@ -223,9 +209,8 @@
}
}
}
- return sessionUserEntries;
- }
-
+ return sessionUserEntries;
+ }
public int getUserRecordsEntryCount(final String userEntry)
{
@@ -354,7 +339,33 @@
}
+
+ public int getStandardAttemptsForQuestionContentAndContentUid(final Long voteQueContentId, final Long voteContentUid)
+ {
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(LOAD_ATTEMPT_FOR_QUESTION_CONTENT)
+ .setLong("voteQueContentId", voteQueContentId.longValue())
+ .list();
+
+ List userEntries= new ArrayList();
+ if(list != null && list.size() > 0){
+ Iterator listIterator=list.iterator();
+ while (listIterator.hasNext())
+ {
+ VoteUsrAttempt attempt=(VoteUsrAttempt)listIterator.next();
+
+ if (attempt.getVoteQueUsr().getVoteSession().getVoteContent().getUid().toString().equals(voteContentUid.toString()))
+ {
+ userEntries.add(attempt);
+ }
+ }
+ }
+ return userEntries.size();
+
+ }
+
+
public VoteUsrAttempt getAttemptsForUserAndQuestionContent(final Long queUsrId, final Long voteQueContentId)
{
HibernateTemplate templ = this.getHibernateTemplate();
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/IVoteService.java
===================================================================
diff -u -rca438ee67636fd831f44725bdb36bb7ff5108ebf -r63c1c2dbe54c8eed67ddd6d429886e7ca3daef5d
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/IVoteService.java (.../IVoteService.java) (revision ca438ee67636fd831f44725bdb36bb7ff5108ebf)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/IVoteService.java (.../IVoteService.java) (revision 63c1c2dbe54c8eed67ddd6d429886e7ca3daef5d)
@@ -80,6 +80,8 @@
public List getAttemptsListForUserAndQuestionContent(final Long queUsrId, final Long voteQueContentId) throws VoteApplicationException;
public int getLastNominationCount(Long userId) throws VoteApplicationException;
+
+ public Set getSessionUserEntriesSet(final Long voteSessionUid) throws VoteApplicationException;
public void createVoteUsrAttempt(VoteUsrAttempt voteUsrAttempt) throws VoteApplicationException;
@@ -127,11 +129,13 @@
public Set getUserEntries() throws VoteApplicationException;
- public Set getContentEntries(final Long voteContentUid) throws VoteApplicationException;
+ public List getContentEntries(final Long voteContentUid) throws VoteApplicationException;
+ public int getStandardAttemptsForQuestionContentAndContentUid(final Long voteQueContentId, final Long voteContentUid);
+
public int getSessionUserRecordsEntryCount(final String userEntry, final Long voteSessionUid, IVoteService voteService) throws VoteApplicationException;
- public Set getSessionUserEntries(final Long voteSessionId) throws VoteApplicationException;
+ public List getSessionUserEntries(final Long voteSessionId) throws VoteApplicationException;
public VoteQueContent getQuestionContentByQuestionText(final String question, final Long voteContentUid);
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java
===================================================================
diff -u -rca438ee67636fd831f44725bdb36bb7ff5108ebf -r63c1c2dbe54c8eed67ddd6d429886e7ca3daef5d
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java (.../VoteServicePOJO.java) (revision ca438ee67636fd831f44725bdb36bb7ff5108ebf)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java (.../VoteServicePOJO.java) (revision 63c1c2dbe54c8eed67ddd6d429886e7ca3daef5d)
@@ -235,7 +235,7 @@
}
- public Set getContentEntries(final Long voteContentUid) throws VoteApplicationException
+ public List getContentEntries(final Long voteContentUid) throws VoteApplicationException
{
try
{
@@ -279,7 +279,7 @@
}
}
- public Set getSessionUserEntries(final Long voteSessionUid) throws VoteApplicationException
+ public List getSessionUserEntries(final Long voteSessionUid) throws VoteApplicationException
{
try
{
@@ -294,6 +294,20 @@
}
+ public Set getSessionUserEntriesSet(final Long voteSessionUid) throws VoteApplicationException
+ {
+ try
+ {
+ return voteUsrAttemptDAO.getSessionUserEntriesSet(voteSessionUid);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is getting session user entries: "
+ + e.getMessage(),
+ e);
+ }
+ }
+
public VoteQueContent getVoteQueContentByUID(Long uid) throws VoteApplicationException
{
try
@@ -530,6 +544,22 @@
}
}
+
+ public int getStandardAttemptsForQuestionContentAndContentUid(final Long voteQueContentId, final Long voteContentUid)
+ {
+ try
+ {
+ return voteUsrAttemptDAO.getStandardAttemptsForQuestionContentAndContentUid(voteQueContentId, voteContentUid);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is getting all standard attempts entries count: "
+ + e.getMessage(),
+ e);
+ }
+
+ }
+
public int getSessionEntriesCount(final Long voteSessionUid) throws VoteApplicationException
{
try
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/ExportServlet.java
===================================================================
diff -u -rca438ee67636fd831f44725bdb36bb7ff5108ebf -r63c1c2dbe54c8eed67ddd6d429886e7ca3daef5d
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/ExportServlet.java (.../ExportServlet.java) (revision ca438ee67636fd831f44725bdb36bb7ff5108ebf)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/ExportServlet.java (.../ExportServlet.java) (revision 63c1c2dbe54c8eed67ddd6d429886e7ca3daef5d)
@@ -111,7 +111,7 @@
VoteMonitoringAction voteMonitoringAction= new VoteMonitoringAction();
voteMonitoringAction.refreshSummaryData(request, content, voteService, true, true, toolSessionID.toString(), userID.toString() , true);
- MonitoringUtil.prepareChartDataForExport(request, voteService, null, content.getVoteContentId(), voteSession.getUid());
+ MonitoringUtil.prepareChartDataForExportLearner(request, voteService, null, content.getVoteContentId(), voteSession.getUid());
logger.debug("post prepareChartDataForExport");
logger.debug("ending learner mode: ");
@@ -147,8 +147,9 @@
logger.debug("starting refreshSummaryData.");
voteMonitoringAction.refreshSummaryData(request, content, voteService, true, false, null, null, false);
- //MonitoringUtil.prepareChartDataForExport(request, voteService, null, content.getVoteContentId(), voteSession.getUid());
- logger.debug("post prepareChartDataForExport");
+ logger.debug("teacher uses content id: " + content.getVoteContentId());
+ MonitoringUtil.prepareChartDataForExportTeacher(request, voteService, null, content.getVoteContentId(), null);
+ logger.debug("post prepareChartDataForExportTeacher");
logger.debug("ending teacher mode: ");
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java
===================================================================
diff -u -rca438ee67636fd831f44725bdb36bb7ff5108ebf -r63c1c2dbe54c8eed67ddd6d429886e7ca3daef5d
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision ca438ee67636fd831f44725bdb36bb7ff5108ebf)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision 63c1c2dbe54c8eed67ddd6d429886e7ca3daef5d)
@@ -658,7 +658,7 @@
logger.debug("process for session: " + toolSessionUid);
entriesCount=voteService.getSessionEntriesCount(toolSessionUid);
logger.debug("entriesCount: " + entriesCount);
- userEntries=voteService.getSessionUserEntries(toolSessionUid);
+ userEntries=voteService.getSessionUserEntriesSet(toolSessionUid);
logger.debug("sessionUserCount: " + userEntries.size());
int completedSessionUserCount=voteService.getCompletedVoteUserBySessionUid(toolSessionUid);
@@ -687,13 +687,6 @@
}
}
}
- else
- {
- sessionLevelCharting=false;
- logger.debug("process for content: ");
- userEntries=voteService.getContentEntries(voteContent.getUid());
- entriesCount=userEntries.size();
- }
logger.debug("entriesCount: " + entriesCount);
logger.debug("userEntries: " + userEntries);
@@ -787,10 +780,10 @@
}
- public static void prepareChartDataForExport(HttpServletRequest request, IVoteService voteService, VoteMonitoringForm voteMonitoringForm, Long toolContentId, Long toolSessionUid)
+ public static void prepareChartDataForExportLearner(HttpServletRequest request, IVoteService voteService, VoteMonitoringForm voteMonitoringForm, Long toolContentId, Long toolSessionUid)
{
- logger.debug("starting prepareChartDataForExport, toolContentId: " + toolContentId);
- logger.debug("starting prepareChartDataForExport, toolSessionUid: " + toolSessionUid);
+ logger.debug("starting prepareChartDataForExportLearner, toolContentId: " + toolContentId);
+ logger.debug("starting prepareChartDataForExportLearner, toolSessionUid: " + toolSessionUid);
VoteContent voteContent=voteService.retrieveVote(toolContentId);
logger.debug("starting prepareChartData, voteContent uid: " + voteContent.getUid());
@@ -813,7 +806,7 @@
logger.debug("process for session: " + toolSessionUid);
entriesCount=voteService.getSessionEntriesCount(toolSessionUid);
logger.debug("entriesCount: " + entriesCount);
- userEntries=voteService.getSessionUserEntries(toolSessionUid);
+ userEntries=voteService.getSessionUserEntriesSet(toolSessionUid);
logger.debug("sessionUserCount: " + userEntries.size());
int completedSessionUserCount=voteService.getCompletedVoteUserBySessionUid(toolSessionUid);
@@ -825,21 +818,12 @@
int potentialUserCount=voteService.getVoteSessionPotentialLearnersCount(toolSessionUid);
logger.debug("potentialUserCount: " + potentialUserCount);
-
- //request.getSession().setAttribute("sessionUserCount", Integer.toString(potentialUserCount));
- ///request.getSession().setAttribute("completedSessionUserCount", new Integer(completedSessionUserCount).toString());
-
if (potentialUserCount != 0)
{
double completedPercent=(completedSessionUserCount * 100) / potentialUserCount;
logger.debug("completed percent: " + completedPercent);
- //request.getSession().setAttribute("completedSessionUserPercent", new Double(completedPercent).toString());
- }
- else
- {
- //request.getSession().setAttribute("completedSessionUserPercent", "Not Available");
- }
+ }
}
logger.debug("entriesCount: " + entriesCount);
@@ -958,6 +942,99 @@
request.getSession().setAttribute(MAP_STANDARD_USER_COUNT, mapStandardUserCount);
logger.debug("test2: MAP_STANDARD_USER_COUNT: " + request.getSession().getAttribute(MAP_STANDARD_USER_COUNT));
}
+
+ public static void prepareChartDataForExportTeacher(HttpServletRequest request, IVoteService voteService, VoteMonitoringForm voteMonitoringForm, Long toolContentId, Long toolSessionUid)
+ {
+ logger.debug("starting prepareChartDataForExportTeacher, toolContentId: " + toolContentId);
+ logger.debug("starting prepareChartDataForExportTeacher, toolSessionUid: " + toolSessionUid);
+ VoteContent voteContent=voteService.retrieveVote(toolContentId);
+ logger.debug("starting prepareChartData, voteContent uid: " + voteContent.getUid());
+ logger.debug("starting prepareChartDataForExport, voteMonitoringForm: " + voteMonitoringForm);
+ logger.debug("existing voteContent:" + voteContent);
+
+ Map mapOptionsContent= new TreeMap(new VoteComparator());
+ Map mapVoteRatesContent= new TreeMap(new VoteComparator());
+ Map mapStandardUserCount= new TreeMap(new VoteComparator());
+
+ Iterator queIterator=voteContent.getVoteQueContents().iterator();
+ Long mapIndex=new Long(1);
+ int totalStandardVotesCount=0;
+ int totalStandardContentVotesCount=0;
+ int entriesCount=0;
+
+ logger.debug("get all entries for content: " + voteContent);
+ List setEntriesCount=voteService.getContentEntries(voteContent.getUid());
+ logger.debug("setEntriesCount: " +setEntriesCount);
+ entriesCount=setEntriesCount.size();
+ logger.debug("entriesCount: " + entriesCount);
+
+ while (queIterator.hasNext())
+ {
+ VoteQueContent voteQueContent=(VoteQueContent) queIterator.next();
+ if (voteQueContent != null)
+ {
+ logger.debug("question: " + voteQueContent.getQuestion());
+ mapOptionsContent.put(mapIndex.toString(),voteQueContent.getQuestion());
+
+ int votesCount=voteService.getStandardAttemptsForQuestionContentAndContentUid(voteQueContent.getUid(), voteContent.getUid());
+ logger.debug("standardContentAttemptCount: " + votesCount);
+
+ mapStandardUserCount.put(mapIndex.toString(),new Integer(votesCount).toString());
+ totalStandardVotesCount=totalStandardVotesCount + votesCount;
+
+
+ double voteRate=0d;
+ if (entriesCount != 0)
+ {
+ voteRate=((votesCount * 100)/ entriesCount);
+ }
+
+ logger.debug("voteRate" + voteRate);
+
+ mapVoteRatesContent.put(mapIndex.toString(), new Double(voteRate).toString());
+
+ mapIndex=new Long(mapIndex.longValue()+1);
+ }
+ }
+ logger.debug("test1: Map initialized with existing contentid to: " + mapOptionsContent);
+ Map mapStandardNominationsContent= new TreeMap(new VoteComparator());
+ mapStandardNominationsContent=mapOptionsContent;
+ logger.debug("mapStandardNominationsContent: " + mapStandardNominationsContent);
+
+ Map mapStandardRatesContent= new TreeMap(new VoteComparator());
+ mapStandardRatesContent=mapVoteRatesContent;
+ logger.debug("test1: mapStandardRatesContent: " + mapStandardRatesContent);
+ logger.debug("test1: mapStandardUserCount: " + mapStandardUserCount);
+
+ int mapVoteRatesSize=mapVoteRatesContent.size();
+ logger.debug("mapVoteRatesSize: " + mapVoteRatesSize);
+ mapIndex=new Long(mapVoteRatesSize+1);
+ logger.debug("updated mapIndex: " + mapIndex);
+
+ double total=MonitoringUtil.calculateTotal(mapVoteRatesContent);
+ logger.debug("updated mapIndex: " + mapIndex);
+ double share=100d-total ;
+ logger.debug("share: " + share);
+
+ logger.debug("totalStandardVotesCount: " + totalStandardVotesCount);
+ int userEnteredVotesCount=entriesCount - totalStandardVotesCount;
+ logger.debug("userEnteredVotesCount for this session: " + userEnteredVotesCount);
+
+ mapStandardNominationsContent.put(mapIndex.toString(), "Open Vote");
+ mapStandardRatesContent.put(mapIndex.toString(), new Double(share).toString());
+ mapStandardUserCount.put(mapIndex.toString(), new Integer(userEnteredVotesCount).toString());
+
+
+ request.getSession().setAttribute(MAP_STANDARD_NOMINATIONS_CONTENT, mapStandardNominationsContent);
+ logger.debug("test2: MAP_STANDARD_NOMINATIONS_CONTENT: " + request.getSession().getAttribute(MAP_STANDARD_NOMINATIONS_CONTENT));
+
+ request.getSession().setAttribute(MAP_STANDARD_RATES_CONTENT, mapStandardRatesContent);
+ logger.debug("test2: MAP_STANDARD_RATES_CONTENT: " + request.getSession().getAttribute(MAP_STANDARD_RATES_CONTENT));
+
+ request.getSession().setAttribute(MAP_STANDARD_USER_COUNT, mapStandardUserCount);
+ logger.debug("test2: MAP_STANDARD_USER_COUNT: " + request.getSession().getAttribute(MAP_STANDARD_USER_COUNT));
+ }
+
}
Index: lams_tool_vote/web/export/ExportContent.jsp
===================================================================
diff -u -rca438ee67636fd831f44725bdb36bb7ff5108ebf -r63c1c2dbe54c8eed67ddd6d429886e7ca3daef5d
--- lams_tool_vote/web/export/ExportContent.jsp (.../ExportContent.jsp) (revision ca438ee67636fd831f44725bdb36bb7ff5108ebf)
+++ lams_tool_vote/web/export/ExportContent.jsp (.../ExportContent.jsp) (revision 63c1c2dbe54c8eed67ddd6d429886e7ca3daef5d)
@@ -31,12 +31,25 @@
+