Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McCandidateAnswersDTO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/Attic/McCandidateAnswersDTO.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McCandidateAnswersDTO.java 16 Jun 2006 20:56:38 -0000 1.1 @@ -0,0 +1,74 @@ +/*************************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * ***********************************************************************/ +/* $$Id: McCandidateAnswersDTO.java,v 1.1 2006/06/16 20:56:38 ozgurd Exp $$ */ +package org.lamsfoundation.lams.tool.mc; + + + +/** + *

DTO that holds candiate answers data for summary page + *

+ * + * @author Ozgur Demirtas + */ +public class McCandidateAnswersDTO implements Comparable +{ + /** + * @return Returns the candidateAnswer. + */ + public String getCandidateAnswer() { + return candidateAnswer; + } + /** + * @param candidateAnswer The candidateAnswer to set. + */ + public void setCandidateAnswer(String candidateAnswer) { + this.candidateAnswer = candidateAnswer; + } + /** + * @return Returns the correct. + */ + public String getCorrect() { + return correct; + } + /** + * @param correct The correct to set. + */ + public void setCorrect(String correct) { + this.correct = correct; + } + private String candidateAnswer; + + private String correct; + + + public int compareTo(Object o) + { + McCandidateAnswersDTO mcCandidateAnswersDTO = (McCandidateAnswersDTO) o; + + if (mcCandidateAnswersDTO == null) + return 1; + else + return 0; + } + +} Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McMonitoredAnswersDTO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McMonitoredAnswersDTO.java,v diff -u -r1.4 -r1.5 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McMonitoredAnswersDTO.java 3 Apr 2006 13:31:03 -0000 1.4 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McMonitoredAnswersDTO.java 16 Jun 2006 20:56:38 -0000 1.5 @@ -40,8 +40,12 @@ private String question; + private String weight; + private List candidateAnswers; + private List candidateAnswersCorrect; + private Map questionAttempts; @@ -111,4 +115,28 @@ return (int) (new Long(questionUid).longValue() - new Long(mcMonitoredAnswersDTO.questionUid).longValue()); } + /** + * @return Returns the weight. + */ + public String getWeight() { + return weight; + } + /** + * @param weight The weight to set. + */ + public void setWeight(String weight) { + this.weight = weight; + } + /** + * @return Returns the candidateAnswersCorrect. + */ + public List getCandidateAnswersCorrect() { + return candidateAnswersCorrect; + } + /** + * @param candidateAnswersCorrect The candidateAnswersCorrect to set. + */ + public void setCandidateAnswersCorrect(List candidateAnswersCorrect) { + this.candidateAnswersCorrect = candidateAnswersCorrect; + } } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/IMcOptionsContentDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/IMcOptionsContentDAO.java,v diff -u -r1.14 -r1.15 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/IMcOptionsContentDAO.java 3 Apr 2006 13:31:03 -0000 1.14 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/IMcOptionsContentDAO.java 16 Jun 2006 20:56:38 -0000 1.15 @@ -71,6 +71,10 @@ */ public List getPersistedSelectedOptions(Long mcQueContentId); + public List findMcOptionCorrectByQueId(Long mcQueContentId); + + public List populateCandidateAnswersDTO(Long mcQueContentId); + public List getCorrectOption(Long mcQueContentId); /** Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McOptionsContentDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McOptionsContentDAO.java,v diff -u -r1.15 -r1.16 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McOptionsContentDAO.java 3 Apr 2006 13:31:03 -0000 1.15 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McOptionsContentDAO.java 16 Jun 2006 20:56:38 -0000 1.16 @@ -28,8 +28,9 @@ import org.apache.log4j.Logger; import org.hibernate.FlushMode; -import org.lamsfoundation.lams.tool.mc.pojos.McOptsContent; +import org.lamsfoundation.lams.tool.mc.McCandidateAnswersDTO; import org.lamsfoundation.lams.tool.mc.dao.IMcOptionsContentDAO; +import org.lamsfoundation.lams.tool.mc.pojos.McOptsContent; import org.springframework.orm.hibernate3.HibernateTemplate; import org.springframework.orm.hibernate3.support.HibernateDaoSupport; @@ -91,6 +92,58 @@ return listOptionNames; } + + public List populateCandidateAnswersDTO(Long mcQueContentId) + { + List listCandidateAnswersData= new LinkedList(); + + HibernateTemplate templ = this.getHibernateTemplate(); + if ( mcQueContentId != null) { + List list = getSession().createQuery(FIND_MC_OPTIONS_CONTENT) + .setLong(0,mcQueContentId.longValue()) + .list(); + + if(list != null && list.size() > 0){ + Iterator listIterator=list.iterator(); + while (listIterator.hasNext()) + { + McOptsContent mcOptsContent=(McOptsContent)listIterator.next(); + McCandidateAnswersDTO mcCandidateAnswersDTO= new McCandidateAnswersDTO(); + mcCandidateAnswersDTO.setCandidateAnswer(mcOptsContent.getMcQueOptionText()); + mcCandidateAnswersDTO.setCorrect(new Boolean(mcOptsContent.isCorrectOption()).toString()); + listCandidateAnswersData.add(mcCandidateAnswersDTO); + } + } + } + return listCandidateAnswersData; + } + + + public List findMcOptionCorrectByQueId(Long mcQueContentId) + { + + List listOptionCorrect= new LinkedList(); + + HibernateTemplate templ = this.getHibernateTemplate(); + if ( mcQueContentId != null) { + List list = getSession().createQuery(FIND_MC_OPTIONS_CONTENT) + .setLong(0,mcQueContentId.longValue()) + .list(); + + if(list != null && list.size() > 0){ + Iterator listIterator=list.iterator(); + while (listIterator.hasNext()) + { + McOptsContent mcOptsContent=(McOptsContent)listIterator.next(); + listOptionCorrect.add(new Boolean(mcOptsContent.isCorrectOption()).toString()); + } + } + } + return listOptionCorrect; + } + + + public McOptsContent getOptionContentByOptionText(final String option, final Long mcQueContentUid) { HibernateTemplate templ = this.getHibernateTemplate(); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/IMcService.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/IMcService.java,v diff -u -r1.47 -r1.48 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/IMcService.java 3 Apr 2006 13:31:03 -0000 1.47 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/IMcService.java 16 Jun 2006 20:56:38 -0000 1.48 @@ -121,6 +121,8 @@ public List getMcUserBySessionOnly(final McSession mcSession) throws McApplicationException; + public List populateCandidateAnswersDTO(Long mcQueContentId) throws McApplicationException; + public McSession getMcSessionByUID(Long uid) throws McApplicationException; public void deleteMc(McContent mc) throws McApplicationException; @@ -259,6 +261,8 @@ public List getSessionsFromContent(McContent mcContent) throws McApplicationException; + public List findMcOptionCorrectByQueId(Long mcQueContentId) throws McApplicationException; + public List findMcOptionNamesByQueId(Long mcQueContentId) throws McApplicationException; } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McServicePOJO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McServicePOJO.java,v diff -u -r1.65 -r1.66 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McServicePOJO.java 7 Jun 2006 06:06:26 -0000 1.65 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McServicePOJO.java 16 Jun 2006 20:56:38 -0000 1.66 @@ -614,6 +614,19 @@ + e.getMessage(),e); } } + + public List populateCandidateAnswersDTO(Long mcQueContentId) throws McApplicationException + { + try + { + return mcOptionsContentDAO.populateCandidateAnswersDTO(mcQueContentId); + } + catch (DataAccessException e) + { + throw new McApplicationException("Exception occured when lams is populating candidate answers dto" + + e.getMessage(),e); + } + } public List getPersistedSelectedOptions(Long mcQueContentId) throws McApplicationException { @@ -978,8 +991,22 @@ + e.getMessage(),e); } } + + public List findMcOptionCorrectByQueId(Long mcQueContentId) throws McApplicationException + { + try + { + return mcOptionsContentDAO.findMcOptionCorrectByQueId(mcQueContentId); + } + catch (DataAccessException e) + { + throw new McApplicationException("Exception occured when lams is getting correct/incorrect options list" + + " the mc options content: " + + e.getMessage(),e); + } + + } - public void deleteMcOptionsContent(McOptsContent mcOptsContent) throws McApplicationException { try Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/MonitoringUtil.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/MonitoringUtil.java,v diff -u -r1.13 -r1.14 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/MonitoringUtil.java 15 Jun 2006 17:38:39 -0000 1.13 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/MonitoringUtil.java 16 Jun 2006 20:56:38 -0000 1.14 @@ -117,11 +117,17 @@ McMonitoredAnswersDTO mcMonitoredAnswersDTO= new McMonitoredAnswersDTO(); mcMonitoredAnswersDTO.setQuestionUid(mcQueContent.getUid().toString()); mcMonitoredAnswersDTO.setQuestion(mcQueContent.getQuestion()); + mcMonitoredAnswersDTO.setWeight(mcQueContent.getWeight().toString()); List listCandidateAnswers=mcService.findMcOptionNamesByQueId(mcQueContent.getUid()); logger.debug("listCandidateAnswers:..." + listCandidateAnswers); mcMonitoredAnswersDTO.setCandidateAnswers(listCandidateAnswers); + List listCandidateAnswersDTO=mcService.populateCandidateAnswersDTO(mcQueContent.getUid()); + logger.debug("listCandidateAnswersDTO:..." + listCandidateAnswersDTO); + mcMonitoredAnswersDTO.setCandidateAnswersCorrect(listCandidateAnswersDTO); + + Map questionAttemptData= buildGroupsAttemptData(request, mcContent, mcQueContent, mcQueContent.getUid().toString()); logger.debug("questionAttemptData:..." + questionAttemptData); mcMonitoredAnswersDTO.setQuestionAttempts(questionAttemptData); Index: lams_tool_lamc/web/monitoring/MonitoringMaincontent.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/monitoring/MonitoringMaincontent.jsp,v diff -u -r1.27 -r1.28 --- lams_tool_lamc/web/monitoring/MonitoringMaincontent.jsp 5 Jun 2006 06:03:14 -0000 1.27 +++ lams_tool_lamc/web/monitoring/MonitoringMaincontent.jsp 16 Jun 2006 20:56:38 -0000 1.28 @@ -166,7 +166,7 @@
- + Index: lams_tool_lamc/web/monitoring/Summary.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/monitoring/Attic/Summary.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_lamc/web/monitoring/Summary.jsp 16 Jun 2006 20:56:38 -0000 1.1 @@ -0,0 +1,135 @@ +<%-- +Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) +License Information: http://lamsfoundation.org/licensing/lams/2.0/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + USA + + http://www.gnu.org/licenses/gpl.txt +--%> +<%@ taglib uri="tags-bean" prefix="bean"%> +<%@ taglib uri="tags-html" prefix="html"%> +<%@ taglib uri="tags-logic" prefix="logic" %> +<%@ taglib uri="tags-logic-el" prefix="logic-el" %> +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-fmt" prefix="fmt" %> +<%@ taglib uri="fck-editor" prefix="FCK" %> +<%@ taglib uri="tags-lams" prefix="lams" %> + + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
   
+ +   + +
+ + + + + + +
+         + + + +   + + + + +
+
+ +
+
+ + + \ No newline at end of file