Index: lams_tool_assessment/conf/language/lams/ApplicationResources_en_AU.properties
===================================================================
diff -u -r24ffa43545be19c176ebcc4cc16286e59dbf1306 -r3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f
--- lams_tool_assessment/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision 24ffa43545be19c176ebcc4cc16286e59dbf1306)
+++ lams_tool_assessment/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f)
@@ -123,7 +123,6 @@
label.authoring.advance.grade.boundary =Grade boundary
label.authoring.advance.feedback =Feedback
label.authoring.advance.add.feedback.field =Add feedback field
-
label.authoring.cancel.button =Cancel
label.authoring.basic.answer.options =Answer Options
label.authoring.heading.instructions =Instructions
@@ -151,15 +150,22 @@
error.msg.default.content.not.find =Could not retrieve default content record for this tool.
msg.no.instruction =No instruction available.
authoring.msg.cancel.save =Do you want to close this window without saving?
+label.learning.page =Page:
label.learning.comment.or.instruction =Comment/Instruction
label.learning.title =Share Resource Learning
label.learning.heading =Share Resources
-label.resoruce.to.review =Resources to view
-label.learning.minimum.review =You must view at least {0} of the resources.
-label.check.for.new =Check for new
-label.suggest.new =Suggest a new
-label.learning.new.file =New file details:
-label.learning.new.url =New URL details:
+label.learning.choose.one.answer =Choose one of the following answers.
+label.learning.choose.at.least.one.answer =Choose at least one answer.
+label.learning.submit.page =Submit page
+label.learning.submit.all =Submit all
+label.learning.matching.pairs.pick.up =Pick up the corresponding answers
+label.learning.matching.pairs.choose =Choose
+label.learning.short.answer.answer =Answer:
+label.learning.true.false.true =True
+label.learning.true.false.false =False
+label.learning.ordering.sort.answers =Sort answers in the right order
+label.learning.marks.penalty =Marks for this submission: {0}/{1}. This submission attracted a penalty of {2}.
+label.learning.marks =Marks for this submission: {0}/{1}.
monitoring.tab.summary =Summary
monitoring.tab.instructions =Instruction
monitoring.tab.statistics =Statistic
@@ -178,6 +184,7 @@
label.monitoring.edit.activity.cancel =Cancel
label.monitoring.edit.activity.update =Update
label.monitoring.edit.activity.edit =Edit
+label.resoruce.to.review =Resources to view
message.monitoring.edit.activity.not.editable =This Activity is no longer editable
export.label.resource =Resource
export.label.no.learning.object =No offline package available
Index: lams_tool_assessment/conf/xdoclet/struts-actions.xml
===================================================================
diff -u -r24ffa43545be19c176ebcc4cc16286e59dbf1306 -r3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f
--- lams_tool_assessment/conf/xdoclet/struts-actions.xml (.../struts-actions.xml) (revision 24ffa43545be19c176ebcc4cc16286e59dbf1306)
+++ lams_tool_assessment/conf/xdoclet/struts-actions.xml (.../struts-actions.xml) (revision 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f)
@@ -129,9 +129,9 @@
-
+ parameter="addOption">
-
+
+
+
+
+
+
+
+
+
+
@@ -219,6 +234,16 @@
+
+
+
+
+
+
org/lamsfoundation/lams/tool/assessment/model/AssessmentUser.hbm.xml
org/lamsfoundation/lams/tool/assessment/model/Assessment.hbm.xml
org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestion.hbm.xml
- org/lamsfoundation/lams/tool/assessment/model/AssessmentAnswerOption.hbm.xml
+ org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestionOption.hbm.xml
org/lamsfoundation/lams/tool/assessment/model/AssessmentOverallFeedback.hbm.xml
org/lamsfoundation/lams/tool/assessment/model/AssessmentUnit.hbm.xml
- org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestionVisitLog.hbm.xml
+ org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestionResult.hbm.xml
+ org/lamsfoundation/lams/tool/assessment/model/AssessmentAnswer.hbm.xml
org/lamsfoundation/lams/tool/assessment/model/AssessmentAttachment.hbm.xml
org/lamsfoundation/lams/tool/assessment/model/AssessmentSession.hbm.xml
@@ -43,7 +44,7 @@
-
+
@@ -80,8 +81,8 @@
-
-
+
+
@@ -138,6 +139,8 @@
PROPAGATION_REQUIRED,-java.lang.Exception
PROPAGATION_REQUIRED,-java.lang.Exception
PROPAGATION_REQUIRED,-java.lang.Exception
+ PROPAGATION_REQUIRED,-java.lang.Exception
+ PROPAGATION_REQUIRED,-java.lang.Exception
PROPAGATION_REQUIRED,-java.lang.Exception
PROPAGATION_REQUIRED,-java.lang.Exception
PROPAGATION_REQUIRED,-java.lang.Exception
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/AssessmentQuestionResultDAO.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/AssessmentQuestionResultDAO.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/AssessmentQuestionResultDAO.java (revision 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f)
@@ -0,0 +1,45 @@
+/****************************************************************
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ *
+ * http://www.gnu.org/licenses/gpl.txt
+ * ****************************************************************
+ */
+/* $$Id$$ */
+package org.lamsfoundation.lams.tool.assessment.dao;
+
+import java.util.List;
+import java.util.Map;
+
+import org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestionResult;
+
+public interface AssessmentQuestionResultDAO extends DAO {
+
+ public AssessmentQuestionResult getAssessmentQuestionResult(Long questionUid, Long userId);
+
+ /**
+ * Return list which contains key pair which key is assessment question uid, value is number view.
+ *
+ * @param contentId
+ * @return
+ */
+ public Map getSummary(Long contentId);
+
+ public List getAssessmentQuestionResultBySession(Long sessionId, Long questionUid);
+
+}
Fisheye: Tag 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f refers to a dead (removed) revision in file `lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/AssessmentQuestionVisitDAO.java'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/hibernate/AssessmentQuestionResultDAOHibernate.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/hibernate/AssessmentQuestionResultDAOHibernate.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/hibernate/AssessmentQuestionResultDAOHibernate.java (revision 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f)
@@ -0,0 +1,85 @@
+/****************************************************************
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ *
+ * http://www.gnu.org/licenses/gpl.txt
+ * ****************************************************************
+ */
+/* $$Id$$ */
+package org.lamsfoundation.lams.tool.assessment.dao.hibernate;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.lamsfoundation.lams.tool.assessment.dao.AssessmentQuestionResultDAO;
+import org.lamsfoundation.lams.tool.assessment.model.Assessment;
+import org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestionResult;
+import org.lamsfoundation.lams.tool.assessment.model.AssessmentSession;
+
+public class AssessmentQuestionResultDAOHibernate extends BaseDAOHibernate implements AssessmentQuestionResultDAO {
+
+ private static final String FIND_BY_QUESTION_AND_USER = "from " + AssessmentQuestionResult.class.getName()
+ + " as r where r.user.userId = ? and r.assessmentQuestion.uid=?";
+
+ private static final String FIND_BY_QUESTION_AND_SESSION = "from " + AssessmentQuestionResult.class.getName()
+ + " as r where r.sessionId = ? and r.assessmentQuestion.uid=?";
+
+// private static final String FIND_VIEW_COUNT_BY_USER = "select count(*) from "
+// + AssessmentQuestionResult.class.getName() + " as r where r.sessionId=? and r.user.userId =?";
+
+ private static final String FIND_SUMMARY = "select v.assessmentQuestion.uid, count(v.assessmentQuestion) from "
+ + AssessmentQuestionResult.class.getName() + " as v , " + AssessmentSession.class.getName() + " as s, "
+ + Assessment.class.getName() + " as r " + " where v.sessionId = s.sessionId "
+ + " and s.assessment.uid = r.uid " + " and r.contentId =? "
+ + " group by v.sessionId, v.assessmentQuestion.uid ";
+
+ public AssessmentQuestionResult getAssessmentQuestionResult(Long questionUid, Long userId) {
+ List list = getHibernateTemplate().find(FIND_BY_QUESTION_AND_USER, new Object[] { userId, questionUid });
+ if (list == null || list.size() == 0)
+ return null;
+ return (AssessmentQuestionResult) list.get(0);
+ }
+
+// public int getUserViewLogCount(Long toolSessionId, Long userUid) {
+// List list = getHibernateTemplate().find(FIND_VIEW_COUNT_BY_USER, new Object[] { toolSessionId, userUid });
+// if (list == null || list.size() == 0)
+// return 0;
+// return ((Number) list.get(0)).intValue();
+// }
+
+ public Map getSummary(Long contentId) {
+
+ // Note: Hibernate 3.1 query.uniqueResult() returns Integer, Hibernate 3.2 query.uniqueResult() returns Long
+ List result = getHibernateTemplate().find(FIND_SUMMARY, contentId);
+ Map summaryList = new HashMap(result.size());
+ for (Object[] list : result) {
+ if (list[1] != null) {
+ summaryList.put((Long) list[0], new Integer(((Number) list[1]).intValue()));
+ }
+ }
+ return summaryList;
+
+ }
+
+ public List getAssessmentQuestionResultBySession(Long sessionId, Long questionUid) {
+
+ return getHibernateTemplate().find(FIND_BY_QUESTION_AND_SESSION, new Object[] { sessionId, questionUid });
+ }
+
+}
Fisheye: Tag 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f refers to a dead (removed) revision in file `lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/hibernate/AssessmentQuestionVisitDAOHibernate.java'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dto/Summary.java
===================================================================
diff -u -rc56857991e269aa7f5bd250a05b52c767a9957ad -r3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dto/Summary.java (.../Summary.java) (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dto/Summary.java (.../Summary.java) (revision 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f)
@@ -25,7 +25,6 @@
package org.lamsfoundation.lams.tool.assessment.dto;
import org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestion;
-import org.lamsfoundation.lams.tool.assessment.util.AssessmentWebUtils;
/**
* List contains following element:
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/Assessment.java
===================================================================
diff -u -rc56857991e269aa7f5bd250a05b52c767a9957ad -r3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/Assessment.java (.../Assessment.java) (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/Assessment.java (.../Assessment.java) (revision 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f)
@@ -25,17 +25,18 @@
import java.util.ArrayList;
import java.util.Date;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
+import java.util.TreeSet;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.log4j.Logger;
import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler;
import org.lamsfoundation.lams.tool.assessment.util.AssessmentToolContentHandler;
+import org.lamsfoundation.lams.tool.assessment.util.SequencableComparator;
/**
* Assessment
@@ -119,9 +120,9 @@
*
*/
public Assessment() {
- attachments = new HashSet();
- questions = new HashSet();
- overallFeedbacks = new HashSet();
+ attachments = new TreeSet(new SequencableComparator());
+ questions = new TreeSet(new SequencableComparator());
+ overallFeedbacks = new TreeSet(new SequencableComparator());
}
// **********************************************************
@@ -154,7 +155,7 @@
assessment.setUid(null);
if (questions != null) {
Iterator iter = questions.iterator();
- Set set = new HashSet();
+ Set set = new TreeSet(new SequencableComparator());
while (iter.hasNext()) {
AssessmentQuestion question = (AssessmentQuestion) iter.next();
AssessmentQuestion newQuestion = (AssessmentQuestion) question.clone();
@@ -166,7 +167,7 @@
// clone OverallFeedbacks
if (overallFeedbacks != null) {
Iterator iter = overallFeedbacks.iterator();
- Set set = new HashSet();
+ Set set = new TreeSet(new SequencableComparator());
while (iter.hasNext()) {
AssessmentOverallFeedback overallFeedback = (AssessmentOverallFeedback) iter.next();
AssessmentOverallFeedback newOverallFeedback = (AssessmentOverallFeedback) overallFeedback.clone();
@@ -178,7 +179,7 @@
// clone attachment
if (attachments != null) {
Iterator iter = attachments.iterator();
- Set set = new HashSet();
+ Set set = new TreeSet(new SequencableComparator());
while (iter.hasNext()) {
AssessmentAttachment file = (AssessmentAttachment) iter.next();
AssessmentAttachment newFile = (AssessmentAttachment) file.clone();
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentAnswer.hbm.xml
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentAnswer.hbm.xml (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentAnswer.hbm.xml (revision 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f)
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentAnswer.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentAnswer.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentAnswer.java (revision 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f)
@@ -0,0 +1,110 @@
+/****************************************************************
+ * 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.0
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA
+ *
+ * http://www.gnu.org/licenses/gpl.txt
+ * ****************************************************************
+ */
+
+/* $Id$ */
+package org.lamsfoundation.lams.tool.assessment.model;
+
+import org.apache.log4j.Logger;
+
+/**
+ * AssessmentAnswer
+ *
+ * @author Andrey Balan
+ *
+ * @hibernate.class table="tl_laasse10_assessment_answer"
+ */
+public class AssessmentAnswer implements Cloneable, Sequencable {
+ private static final Logger log = Logger.getLogger(AssessmentAnswer.class);
+
+ private Long uid;
+
+ private Integer sequenceId;
+
+ private int answerInt;
+
+ private boolean answerBoolean;
+
+ // **********************************************************
+ // Get/Set methods
+ // **********************************************************
+
+ /**
+ * @hibernate.id generator-class="native" column="uid"
+ * @return Returns the answer ID.
+ */
+ public Long getUid() {
+ return uid;
+ }
+
+ private void setUid(Long uid) {
+ this.uid = uid;
+ }
+
+ /**
+ * Returns answer's sequence number.
+ *
+ * @return answer's sequence number
+ *
+ * @hibernate.property column="sequence_id"
+ */
+ public int getSequenceId() {
+ return sequenceId;
+ }
+
+ /**
+ * Sets answer's sequence number.
+ *
+ * @param sequenceId
+ * answer's sequence number
+ */
+ public void setSequenceId(int sequenceId) {
+ this.sequenceId = sequenceId;
+ }
+
+ /**
+ * @hibernate.property column="answer_int"
+ *
+ * @return Returns the possible numeric answer.
+ */
+ public int getAnswerInt() {
+ return answerInt;
+ }
+
+ public void setAnswerInt(int answerInt) {
+ this.answerInt = answerInt;
+ }
+
+ /**
+ * @hibernate.property column="answer_boolean"
+ *
+ * @return Returns the boolean answer.
+ */
+ public boolean getAnswerBoolean() {
+ return answerBoolean;
+ }
+
+ public void setAnswerBoolean(boolean answerBoolean) {
+ this.answerBoolean = answerBoolean;
+ }
+}
+
+
\ No newline at end of file
Fisheye: Tag 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f refers to a dead (removed) revision in file `lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentAnswerOption.hbm.xml'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f refers to a dead (removed) revision in file `lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentAnswerOption.java'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentAttachment.java
===================================================================
diff -u -rc56857991e269aa7f5bd250a05b52c767a9957ad -r3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentAttachment.java (.../AssessmentAttachment.java) (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentAttachment.java (.../AssessmentAttachment.java) (revision 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f)
@@ -47,11 +47,6 @@
private String fileName;
private Date created;
- // Default contruction method
- public AssessmentAttachment() {
-
- }
-
// **********************************************************
// Function method for Attachment
// **********************************************************
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentOverallFeedback.java
===================================================================
diff -u -rc56857991e269aa7f5bd250a05b52c767a9957ad -r3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentOverallFeedback.java (.../AssessmentOverallFeedback.java) (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentOverallFeedback.java (.../AssessmentOverallFeedback.java) (revision 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f)
@@ -32,7 +32,7 @@
*
* @hibernate.class table="tl_laasse10_assessment_overall_feedback"
*/
-public class AssessmentOverallFeedback implements Cloneable {
+public class AssessmentOverallFeedback implements Cloneable, Sequencable {
private static final Logger log = Logger.getLogger(AssessmentOverallFeedback.class);
private Long uid;
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestion.hbm.xml
===================================================================
diff -u -rec107e68d150d83edb58b17177679662eb376e44 -r3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestion.hbm.xml (.../AssessmentQuestion.hbm.xml) (revision ec107e68d150d83edb58b17177679662eb376e44)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestion.hbm.xml (.../AssessmentQuestion.hbm.xml) (revision 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f)
@@ -181,7 +181,7 @@
/>
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestion.java
===================================================================
diff -u -r988d9fce322beaf579b828d5694f2260bbc17b51 -r3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestion.java (.../AssessmentQuestion.java) (revision 988d9fce322beaf579b828d5694f2260bbc17b51)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestion.java (.../AssessmentQuestion.java) (revision 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f)
@@ -24,11 +24,12 @@
package org.lamsfoundation.lams.tool.assessment.model;
import java.util.Date;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
+import java.util.TreeSet;
import org.apache.log4j.Logger;
+import org.lamsfoundation.lams.tool.assessment.util.SequencableComparator;
/**
* Assessment Question
@@ -38,11 +39,11 @@
* @hibernate.class table="tl_laasse10_assessment_question"
*
*/
-public class AssessmentQuestion implements Cloneable {
+public class AssessmentQuestion implements Cloneable, Sequencable {
private static final Logger log = Logger.getLogger(AssessmentQuestion.class);
private Long uid;
- // Assessment Type:1=URL,2=File,3=Website,4=Learning Object
+
private short type;
private String title;
@@ -82,16 +83,22 @@
// ***********************************************
// Non persistant fields:
- private Set answerOptions;
+ private Set questionOptions;
- private Set units;
+ private Set units;
// DTO fields:
private boolean complete;
+ private String answerString;
+
+ private float answerFloat;
+
+ private boolean answerBoolean;
+
public AssessmentQuestion() {
- answerOptions = new HashSet();
- units = new HashSet();
+ questionOptions = new TreeSet(new SequencableComparator());
+ units = new TreeSet(new SequencableComparator());
}
public Object clone() {
@@ -100,22 +107,22 @@
obj = (AssessmentQuestion) super.clone();
((AssessmentQuestion) obj).setUid(null);
- // clone answerOptions
- if (answerOptions != null) {
- Iterator iter = answerOptions.iterator();
- Set set = new HashSet();
+ // clone questionOptions
+ if (questionOptions != null) {
+ Iterator iter = questionOptions.iterator();
+ Set set = new TreeSet(new SequencableComparator());
while (iter.hasNext()) {
- AssessmentAnswerOption answerOption = (AssessmentAnswerOption) iter.next();
- AssessmentAnswerOption newAnswerOption = (AssessmentAnswerOption) answerOption.clone();
+ AssessmentQuestionOption answerOption = (AssessmentQuestionOption) iter.next();
+ AssessmentQuestionOption newAnswerOption = (AssessmentQuestionOption) answerOption.clone();
set.add(newAnswerOption);
}
- obj.answerOptions = set;
+ obj.questionOptions = set;
}
// clone units
if (units != null) {
- Iterator iter = units.iterator();
- Set set = new HashSet();
+ Iterator iter = units.iterator();
+ Set set = new TreeSet(new SequencableComparator());
while (iter.hasNext()) {
AssessmentUnit unit = (AssessmentUnit) iter.next();
AssessmentUnit newUnit = (AssessmentUnit) unit.clone();
@@ -397,19 +404,19 @@
*
* @hibernate.set cascade="all" order-by="sequence_id asc"
* @hibernate.collection-key column="question_uid"
- * @hibernate.collection-one-to-many class="org.lamsfoundation.lams.tool.assessment.model.AssessmentAnswerOption"
+ * @hibernate.collection-one-to-many class="org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestionOption"
*
- * @return a set of answerOptions to this AssessmentQuestion.
+ * @return a set of questionOptions to this AssessmentQuestion.
*/
- public Set getAnswerOptions() {
- return answerOptions;
+ public Set getQuestionOptions() {
+ return questionOptions;
}
/**
- * @param answerOptions answerOptions to set.
+ * @param questionOptions questionOptions to set.
*/
- public void setAnswerOptions(Set answerOptions) {
- this.answerOptions = answerOptions;
+ public void setQuestionOptions(Set answerOptions) {
+ this.questionOptions = answerOptions;
}
/**
@@ -420,22 +427,42 @@
*
* @return a set of units to this AssessmentQuestion.
*/
- public Set getUnits() {
+ public Set getUnits() {
return units;
}
/**
- * @param answerOptions units to set.
+ * @param questionOptions units to set.
*/
- public void setUnits(Set units) {
+ public void setUnits(Set units) {
this.units = units;
}
public void setComplete(boolean complete) {
this.complete = complete;
}
-
public boolean isComplete() {
return complete;
}
+
+ public String getAnswerString() {
+ return answerString;
+ }
+ public void setAnswerString(String answerString) {
+ this.answerString = answerString;
+ }
+
+ public float getAnswerFloat() {
+ return answerFloat;
+ }
+ public void setAnswerFloat(float answerFloat) {
+ this.answerFloat = answerFloat;
+ }
+
+ public boolean getAnswerBoolean() {
+ return answerBoolean;
+ }
+ public void setAnswerBoolean(boolean answerBoolean) {
+ this.answerBoolean = answerBoolean;
+ }
}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestionOption.hbm.xml
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestionOption.hbm.xml (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestionOption.hbm.xml (revision 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f)
@@ -0,0 +1,92 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestionOption.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestionOption.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestionOption.java (revision 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f)
@@ -0,0 +1,208 @@
+/****************************************************************
+ * 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.0
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA
+ *
+ * http://www.gnu.org/licenses/gpl.txt
+ * ****************************************************************
+ */
+
+/* $Id$ */
+package org.lamsfoundation.lams.tool.assessment.model;
+
+import org.apache.log4j.Logger;
+
+/**
+ * AssessmentQuestionOption
+ *
+ * @author Andrey Balan
+ *
+ * @hibernate.class table="tl_laasse10_question_option"
+ */
+public class AssessmentQuestionOption implements Cloneable, Sequencable {
+ private static final Logger log = Logger.getLogger(AssessmentQuestionOption.class);
+
+ private Long uid;
+
+ private Integer sequenceId;
+
+ private String question;
+
+ private String optionString;
+
+ private float optionFloat;
+
+ private float acceptedError;
+
+ private float grade;
+
+ private String feedback;
+
+ // *************** NON Persist Fields ********************
+ private int answerInt = -1;
+
+ private boolean answerBoolean;
+
+ // **********************************************************
+ // Get/Set methods
+ // **********************************************************
+
+ /**
+ * @hibernate.id generator-class="native" column="uid"
+ * @return Returns the answer ID.
+ */
+ public Long getUid() {
+ return uid;
+ }
+
+ private void setUid(Long uuid) {
+ uid = uuid;
+ }
+
+ /**
+ * Returns option's sequence number.
+ *
+ * @return option's sequence number
+ *
+ * @hibernate.property column="sequence_id"
+ */
+ public int getSequenceId() {
+ return sequenceId;
+ }
+
+ /**
+ * Sets option's sequence number.
+ *
+ * @param sequenceId
+ * option's sequence number
+ */
+ public void setSequenceId(int sequenceId) {
+ this.sequenceId = sequenceId;
+ }
+
+ /**
+ * @hibernate.property column="question" type="text"
+ *
+ * @return Returns the possible answer.
+ */
+ public String getQuestion() {
+ return question;
+ }
+
+ public void setQuestion(String question) {
+ this.question = question;
+ }
+
+ /**
+ * @hibernate.property column="option_string" type="text"
+ *
+ * @return Returns the possible answer.
+ */
+ public String getOptionString() {
+ return optionString;
+ }
+
+ public void setOptionString(String optionString) {
+ this.optionString = optionString;
+ }
+
+ /**
+ * @hibernate.property column="option_float"
+ *
+ * @return Returns the possible numeric answer.
+ */
+ public float getOptionFloat() {
+ return optionFloat;
+ }
+
+ public void setOptionFloat(float optionFloat) {
+ this.optionFloat = optionFloat;
+ }
+
+ /**
+ * @hibernate.property column="accepted_error"
+ *
+ * @return Returns the possible answer.
+ */
+ public float getAcceptedError() {
+ return acceptedError;
+ }
+
+ public void setAcceptedError(float acceptedError) {
+ this.acceptedError = acceptedError;
+ }
+
+ /**
+ * Returns image grade.
+ *
+ * @return image grade
+ *
+ * @hibernate.property column="grade"
+ */
+ public float getGrade() {
+ return grade;
+ }
+
+ /**
+ * Sets image grade.
+ *
+ * @param grade
+ * image grade
+ */
+ public void setGrade(float grade) {
+ this.grade = grade;
+ }
+
+ /**
+ * @hibernate.property column="feedback" type="text"
+ *
+ * @return Returns feedback on this answer option.
+ */
+ public String getFeedback() {
+ return feedback;
+ }
+
+ public void setFeedback(String feedback) {
+ this.feedback = feedback;
+ }
+
+ public int getAnswerInt() {
+ return answerInt;
+ }
+ public void setAnswerInt(int answerInt) {
+ this.answerInt = answerInt;
+ }
+
+ public boolean getAnswerBoolean() {
+ return answerBoolean;
+ }
+ public void setAnswerBoolean(boolean answerBoolean) {
+ this.answerBoolean = answerBoolean;
+ }
+
+ @Override
+ public Object clone() {
+ AssessmentQuestionOption obj = null;
+ try {
+ obj = (AssessmentQuestionOption) super.clone();
+ obj.setUid(null);
+ } catch (CloneNotSupportedException e) {
+ AssessmentQuestionOption.log.error("When clone " + AssessmentQuestionOption.class + " failed");
+ }
+
+ return obj;
+ }
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestionResult.hbm.xml
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestionResult.hbm.xml (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestionResult.hbm.xml (revision 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f)
@@ -0,0 +1,139 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestionResult.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestionResult.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestionResult.java (revision 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f)
@@ -0,0 +1,227 @@
+/****************************************************************
+ * 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.0
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ *
+ * http://www.gnu.org/licenses/gpl.txt
+ * ****************************************************************
+ */
+
+/* $Id$ */
+package org.lamsfoundation.lams.tool.assessment.model;
+
+import java.util.Date;
+import java.util.LinkedHashSet;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.lamsfoundation.lams.tool.assessment.util.SequencableComparator;
+
+/**
+ * Assessment Question Result
+ *
+ * @author Andrey Balan
+ *
+ * @hibernate.class table="tl_laasse10_question_result"
+ *
+ */
+public class AssessmentQuestionResult {
+
+ private Long uid;
+ private AssessmentUser user;
+ private AssessmentQuestion assessmentQuestion;
+ private String answerString;
+ private float answerFloat;
+ private boolean answerBoolean;
+ private float mark;
+ private float penalty;
+ private Date startDate;
+ private Date finishDate;
+ private Long sessionId;
+ private Set answers;
+
+ // DTO fields:
+ private boolean processed;
+
+ public AssessmentQuestionResult() {
+ answers = new TreeSet(new SequencableComparator());
+ }
+
+ /**
+ * @hibernate.id generator-class="native" type="java.lang.Long" column="uid"
+ * @return Returns the result Uid.
+ */
+ public Long getUid() {
+ return uid;
+ }
+
+ public void setUid(Long uid) {
+ this.uid = uid;
+ }
+
+ /**
+ * @hibernate.many-to-one column="user_uid" cascade="none"
+ * @return
+ */
+ public AssessmentUser getUser() {
+ return user;
+ }
+
+ public void setUser(AssessmentUser user) {
+ this.user = user;
+ }
+
+ /**
+ * @hibernate.many-to-one column="assessment_question_uid" cascade="none"
+ * @return
+ */
+ public AssessmentQuestion getAssessmentQuestion() {
+ return assessmentQuestion;
+ }
+
+ public void setAssessmentQuestion(AssessmentQuestion question) {
+ this.assessmentQuestion = question;
+ }
+
+ /**
+ * @hibernate.property column="answer_string" type="text"
+ *
+ * @return Returns the possible answer.
+ */
+ public String getAnswerString() {
+ return answerString;
+ }
+
+ public void setAnswerString(String answerString) {
+ this.answerString = answerString;
+ }
+
+ /**
+ * @hibernate.property column="answer_float"
+ *
+ * @return Returns the possible answer.
+ */
+ public float getAnswerFloat() {
+ return answerFloat;
+ }
+
+ public void setAnswerFloat(float answerFloat) {
+ this.answerFloat = answerFloat;
+ }
+
+ /**
+ * @hibernate.property column="answer_boolean"
+ *
+ * @return Returns the possible answer.
+ */
+ public boolean getAnswerBoolean() {
+ return answerBoolean;
+ }
+
+ public void setAnswerBoolean(boolean answerBoolean) {
+ this.answerBoolean = answerBoolean;
+ }
+
+ /**
+ * @hibernate.property column="mark"
+ *
+ * @return Returns the mark.
+ */
+ public Float getMark() {
+ return mark;
+ }
+
+ public void setMark(Float mark) {
+ this.mark = mark;
+ }
+
+ /**
+ * @hibernate.property column="penalty"
+ *
+ * @return Returns the possible numeric answer.
+ */
+ public Float getPenalty() {
+ return penalty;
+ }
+
+ public void setPenalty(Float penalty) {
+ this.penalty = penalty;
+ }
+
+ /**
+ * @hibernate.property column="start_date"
+ * @return
+ */
+ public Date getStartDate() {
+ return startDate;
+ }
+
+ public void setStartDate(Date startDate) {
+ this.startDate = startDate;
+ }
+
+ /**
+ * @hibernate.property column="finish_date"
+ * @return
+ */
+ public Date getFinishDate() {
+ return finishDate;
+ }
+
+ public void setFinishDate(Date finishDate) {
+ this.finishDate = finishDate;
+ }
+
+ /**
+ * @hibernate.property column="session_id"
+ * @return
+ */
+ public Long getSessionId() {
+ return sessionId;
+ }
+
+ public void setSessionId(Long sessionId) {
+ this.sessionId = sessionId;
+ }
+
+ /**
+ *
+ * @hibernate.set cascade="all" order-by="sequence_id asc"
+ * @hibernate.collection-key column="result_uid"
+ * @hibernate.collection-one-to-many class="org.lamsfoundation.lams.tool.assessment.model.AssessmentAnswer"
+ *
+ * @return a set of answerOptions to this AssessmentQuestion.
+ */
+ public Set getAnswers() {
+ return answers;
+ }
+
+ /**
+ * @param answerOptions answerOptions to set.
+ */
+ public void setAnswers(Set answers) {
+ this.answers = answers;
+ }
+
+ public boolean isProcessed() {
+ return processed;
+ }
+ public void setProcessed(boolean processed) {
+ this.processed = processed;
+ }
+
+}
Fisheye: Tag 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f refers to a dead (removed) revision in file `lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestionVisitLog.hbm.xml'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f refers to a dead (removed) revision in file `lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestionVisitLog.java'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentUnit.java
===================================================================
diff -u -r988d9fce322beaf579b828d5694f2260bbc17b51 -r3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentUnit.java (.../AssessmentUnit.java) (revision 988d9fce322beaf579b828d5694f2260bbc17b51)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentUnit.java (.../AssessmentUnit.java) (revision 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f)
@@ -32,7 +32,7 @@
*
* @hibernate.class table="tl_laasse10_assessment_unit"
*/
-public class AssessmentUnit implements Cloneable {
+public class AssessmentUnit implements Cloneable, Sequencable {
private static final Logger log = Logger.getLogger(AssessmentUnit.class);
private Long uid;
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/Sequencable.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/Sequencable.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/Sequencable.java (revision 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f)
@@ -0,0 +1,47 @@
+/****************************************************************
+ * 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.0
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA
+ *
+ * http://www.gnu.org/licenses/gpl.txt
+ * ****************************************************************
+ */
+
+/* $Id$ */
+package org.lamsfoundation.lams.tool.assessment.model;
+
+/**
+ * Sequencable
+ *
+ * @author Andrey Balan
+ */
+public interface Sequencable {
+
+ /**
+ * Returns sequence number.
+ *
+ * @return sequence number
+ */
+ public int getSequenceId();
+
+ /**
+ * Sets sequence number.
+ *
+ * @param sequenceId
+ * sequence number
+ */
+ public void setSequenceId(int sequenceId);
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java
===================================================================
diff -u -r988d9fce322beaf579b828d5694f2260bbc17b51 -r3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java (.../AssessmentServiceImpl.java) (revision 988d9fce322beaf579b828d5694f2260bbc17b51)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java (.../AssessmentServiceImpl.java) (revision 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f)
@@ -23,27 +23,24 @@
/* $$Id$$ */
package org.lamsfoundation.lams.tool.assessment.service;
-import java.io.File;
-import java.io.FileFilter;
import java.io.FileNotFoundException;
import java.io.IOException;
-import java.io.InputStream;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.Hashtable;
import java.util.Iterator;
+import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.SortedMap;
import java.util.SortedSet;
import java.util.TreeMap;
import java.util.TreeSet;
-import java.util.Vector;
+import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.apache.struts.upload.FormFile;
@@ -56,7 +53,6 @@
import org.lamsfoundation.lams.contentrepository.NodeKey;
import org.lamsfoundation.lams.contentrepository.RepositoryCheckedException;
import org.lamsfoundation.lams.contentrepository.WorkspaceNotFoundException;
-import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler;
import org.lamsfoundation.lams.contentrepository.service.IRepositoryService;
import org.lamsfoundation.lams.contentrepository.service.SimpleCredentials;
import org.lamsfoundation.lams.events.IEventNotificationService;
@@ -78,19 +74,22 @@
import org.lamsfoundation.lams.tool.assessment.dao.AssessmentAttachmentDAO;
import org.lamsfoundation.lams.tool.assessment.dao.AssessmentDAO;
import org.lamsfoundation.lams.tool.assessment.dao.AssessmentQuestionDAO;
-import org.lamsfoundation.lams.tool.assessment.dao.AssessmentQuestionVisitDAO;
+import org.lamsfoundation.lams.tool.assessment.dao.AssessmentQuestionResultDAO;
import org.lamsfoundation.lams.tool.assessment.dao.AssessmentSessionDAO;
import org.lamsfoundation.lams.tool.assessment.dao.AssessmentUserDAO;
import org.lamsfoundation.lams.tool.assessment.dto.ReflectDTO;
import org.lamsfoundation.lams.tool.assessment.dto.Summary;
import org.lamsfoundation.lams.tool.assessment.model.Assessment;
+import org.lamsfoundation.lams.tool.assessment.model.AssessmentAnswer;
import org.lamsfoundation.lams.tool.assessment.model.AssessmentAttachment;
import org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestion;
-import org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestionVisitLog;
+import org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestionOption;
+import org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestionResult;
import org.lamsfoundation.lams.tool.assessment.model.AssessmentSession;
import org.lamsfoundation.lams.tool.assessment.model.AssessmentUser;
import org.lamsfoundation.lams.tool.assessment.util.AssessmentToolContentHandler;
import org.lamsfoundation.lams.tool.assessment.util.ReflectDTOComparator;
+import org.lamsfoundation.lams.tool.assessment.util.SequencableComparator;
import org.lamsfoundation.lams.tool.exception.DataMissingException;
import org.lamsfoundation.lams.tool.exception.SessionDataExistsException;
import org.lamsfoundation.lams.tool.exception.ToolException;
@@ -99,12 +98,7 @@
import org.lamsfoundation.lams.usermanagement.dto.UserDTO;
import org.lamsfoundation.lams.usermanagement.service.IUserManagementService;
import org.lamsfoundation.lams.util.MessageService;
-import org.lamsfoundation.lams.util.WebUtil;
import org.lamsfoundation.lams.util.audit.IAuditService;
-import org.lamsfoundation.lams.util.wddx.WDDXProcessor;
-import org.lamsfoundation.lams.util.wddx.WDDXProcessorConversionException;
-import org.lamsfoundation.lams.util.zipfile.ZipFileUtil;
-import org.lamsfoundation.lams.util.zipfile.ZipFileUtilException;
/**
*
@@ -125,7 +119,7 @@
private AssessmentSessionDAO assessmentSessionDao;
- private AssessmentQuestionVisitDAO assessmentQuestionVisitDao;
+ private AssessmentQuestionResultDAO assessmentQuestionResultDao;
// tool service
private AssessmentToolContentHandler assessmentToolContentHandler;
@@ -417,46 +411,127 @@
public void retrieveComplete(SortedSet assessmentQuestionList, AssessmentUser user) {
for (AssessmentQuestion question : assessmentQuestionList) {
- AssessmentQuestionVisitLog log = assessmentQuestionVisitDao.getAssessmentQuestionLog(question.getUid(),
+ AssessmentQuestionResult result = assessmentQuestionResultDao.getAssessmentQuestionResult(question.getUid(),
user.getUserId());
- if (log == null) {
+ if (result == null) {
question.setComplete(false);
} else {
- question.setComplete(log.isComplete());
+ question.setComplete(result.isProcessed());
}
}
}
- public void setQuestionComplete(Long assessmentQuestionUid, Long userId, Long sessionId) {
- AssessmentQuestionVisitLog log = assessmentQuestionVisitDao.getAssessmentQuestionLog(assessmentQuestionUid,
+ public void setQuestionStartDate(Long assessmentQuestionUid, Long userId, Long sessionId) {
+ AssessmentQuestionResult result = assessmentQuestionResultDao.getAssessmentQuestionResult(assessmentQuestionUid,
userId);
- if (log == null) {
- log = new AssessmentQuestionVisitLog();
+ if (result == null) {
+ result = new AssessmentQuestionResult();
AssessmentQuestion question = assessmentQuestionDao.getByUid(assessmentQuestionUid);
- log.setAssessmentQuestion(question);
+ result.setAssessmentQuestion(question);
AssessmentUser user = assessmentUserDao.getUserByUserIDAndSessionID(userId, sessionId);
- log.setUser(user);
- log.setSessionId(sessionId);
- log.setAccessDate(new Timestamp(new Date().getTime()));
+ result.setUser(user);
+ result.setProcessed(false);
+ result.setSessionId(sessionId);
+ result.setStartDate(new Timestamp(new Date().getTime()));
+ assessmentQuestionResultDao.saveObject(result);
}
- log.setComplete(true);
- assessmentQuestionVisitDao.saveObject(log);
}
-
- public void setQuestionAccess(Long assessmentQuestionUid, Long userId, Long sessionId) {
- AssessmentQuestionVisitLog log = assessmentQuestionVisitDao.getAssessmentQuestionLog(assessmentQuestionUid,
- userId);
- if (log == null) {
- log = new AssessmentQuestionVisitLog();
- AssessmentQuestion question = assessmentQuestionDao.getByUid(assessmentQuestionUid);
- log.setAssessmentQuestion(question);
+
+ public AssessmentQuestionResult processUserAnswer(AssessmentQuestionResult userResult, Long userId, Long sessionId, boolean isFinish) {
+ Long questionUid = userResult.getAssessmentQuestion().getUid();
+ AssessmentQuestion question = userResult.getAssessmentQuestion();
+ AssessmentQuestionResult result = assessmentQuestionResultDao.getAssessmentQuestionResult(questionUid, userId);
+ if (result != null) {
+ for (AssessmentAnswer dbResultAnswer : result.getAnswers()) {
+ for (AssessmentQuestionOption questionOption : question.getQuestionOptions()) {
+ if (dbResultAnswer.getSequenceId() == questionOption.getSequenceId()) {
+ dbResultAnswer.setAnswerBoolean(questionOption.getAnswerBoolean());
+ dbResultAnswer.setAnswerInt(questionOption.getAnswerInt());
+ break;
+ }
+ }
+ }
+ } else {
+ result = new AssessmentQuestionResult();
+ Set answers = result.getAnswers();
+ for (AssessmentQuestionOption questionOption : question.getQuestionOptions()) {
+ AssessmentAnswer resultAnswer = new AssessmentAnswer();
+ resultAnswer.setSequenceId(questionOption.getSequenceId());
+ resultAnswer.setAnswerBoolean(questionOption.getAnswerBoolean());
+ resultAnswer.setAnswerInt(questionOption.getAnswerInt());
+ answers.add(resultAnswer);
+ }
AssessmentUser user = assessmentUserDao.getUserByUserIDAndSessionID(userId, sessionId);
- log.setUser(user);
- log.setComplete(false);
- log.setSessionId(sessionId);
- log.setAccessDate(new Timestamp(new Date().getTime()));
- assessmentQuestionVisitDao.saveObject(log);
+ result.setUser(user);
+ result.setProcessed(true);
+ result.setSessionId(sessionId);
+ result.setStartDate(new Timestamp(new Date().getTime()));
}
+ if (isFinish) {
+ result.setFinishDate(new Timestamp(new Date().getTime()));
+ }
+ result.setAssessmentQuestion(question);
+ result.setAnswerBoolean(question.getAnswerBoolean());
+ result.setAnswerFloat(question.getAnswerFloat());
+ result.setAnswerString(question.getAnswerString());
+
+ float mark = 0;
+ float maxMark = question.getDefaultGrade();
+ if (question.getType() == AssessmentConstants.QUESTION_TYPE_MULTIPLE_CHOICE) {
+ for (AssessmentQuestionOption option : question.getQuestionOptions()) {
+ if (option.getAnswerBoolean()) {
+ mark += option.getGrade()*maxMark;
+ }
+ }
+ } else if (question.getType() == AssessmentConstants.QUESTION_TYPE_MATCHING_PAIRS) {
+ float maxMarkForCorrectAnswer = maxMark / question.getQuestionOptions().size();
+ for (AssessmentQuestionOption option : question.getQuestionOptions()) {
+ if (option.getAnswerInt() == option.getSequenceId()) {
+ mark += maxMarkForCorrectAnswer;
+ }
+ }
+ } else if (question.getType() == AssessmentConstants.QUESTION_TYPE_SHORT_ANSWER) {
+ for (AssessmentQuestionOption option : question.getQuestionOptions()) {
+ if (option.getOptionString().equals(question.getAnswerString())) {
+ mark = option.getGrade()*maxMark;
+ break;
+ }
+ }
+ } else if (question.getType() == AssessmentConstants.QUESTION_TYPE_NUMERICAL) {
+ try {
+ float answerFloat = Float.valueOf(question.getAnswerString());
+ for (AssessmentQuestionOption option : question.getQuestionOptions()) {
+ if ((answerFloat >= (option.getOptionFloat() - option.getAcceptedError()))
+ && (answerFloat <= (option.getOptionFloat() + option.getAcceptedError()))) {
+ mark = option.getGrade() * maxMark;
+ break;
+ }
+ }
+ //TODO may be NumberFormatException and smth else
+ } catch (Exception e) {
+ }
+ } else if (question.getType() == AssessmentConstants.QUESTION_TYPE_TRUE_FALSE) {
+ if (question.getAnswerBoolean() == question.getCorrectAnswer()) {
+ mark = maxMark;
+ }
+ } else if (question.getType() == AssessmentConstants.QUESTION_TYPE_ORDERING) {
+ float maxMarkForCorrectAnswer = maxMark / question.getQuestionOptions().size();
+ for (AssessmentQuestionOption option : question.getQuestionOptions()) {
+ //TODO correct answer
+ if (option.getAnswerInt() == option.getSequenceId()) {
+ mark += maxMarkForCorrectAnswer*maxMark;
+ }
+ }
+ }
+ if (mark > maxMark) {
+ mark = maxMark;
+ } else if (mark < 0) {
+ mark = 0;
+ }
+ result.setMark(mark);
+
+ assessmentQuestionResultDao.saveObject(result);
+ return result;
}
public String finishToolSession(Long toolSessionId, Long userId) throws AssessmentApplicationException {
@@ -488,7 +563,7 @@
List group = new ArrayList();
// get all question which is accessed by user
- Map visitCountMap = assessmentQuestionVisitDao.getSummary(contentId);
+ Map visitCountMap = assessmentQuestionResultDao.getSummary(contentId);
Assessment assessment = assessmentDao.getByContentId(contentId);
Set resQuestionList = assessment.getQuestions();
@@ -563,12 +638,12 @@
}
public List getUserListBySessionQuestion(Long sessionId, Long questionUid) {
- List logList = assessmentQuestionVisitDao.getAssessmentQuestionLogBySession(
+ List logList = assessmentQuestionResultDao.getAssessmentQuestionResultBySession(
sessionId, questionUid);
List userList = new ArrayList(logList.size());
- for (AssessmentQuestionVisitLog visit : logList) {
+ for (AssessmentQuestionResult visit : logList) {
AssessmentUser user = visit.getUser();
- user.setAccessDate(visit.getAccessDate());
+ user.setAccessDate(visit.getStartDate());
userList.add(user);
}
return userList;
@@ -722,12 +797,12 @@
this.toolService = toolService;
}
- public AssessmentQuestionVisitDAO getAssessmentQuestionVisitDao() {
- return assessmentQuestionVisitDao;
+ public AssessmentQuestionResultDAO getAssessmentQuestionResultDao() {
+ return assessmentQuestionResultDao;
}
- public void setAssessmentQuestionVisitDao(AssessmentQuestionVisitDAO assessmentQuestionVisitDao) {
- this.assessmentQuestionVisitDao = assessmentQuestionVisitDao;
+ public void setAssessmentQuestionResultDao(AssessmentQuestionResultDAO assessmentQuestionResultDao) {
+ this.assessmentQuestionResultDao = assessmentQuestionResultDao;
}
// *******************************************************************************
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/IAssessmentService.java
===================================================================
diff -u -rc56857991e269aa7f5bd250a05b52c767a9957ad -r3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/IAssessmentService.java (.../IAssessmentService.java) (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/IAssessmentService.java (.../IAssessmentService.java) (revision 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f)
@@ -23,20 +23,22 @@
/* $$Id$$ */
package org.lamsfoundation.lams.tool.assessment.service;
+import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.SortedSet;
import org.apache.struts.upload.FormFile;
-import org.lamsfoundation.lams.contentrepository.IVersionedNode;
import org.lamsfoundation.lams.events.IEventNotificationService;
import org.lamsfoundation.lams.notebook.model.NotebookEntry;
import org.lamsfoundation.lams.tool.assessment.dto.ReflectDTO;
import org.lamsfoundation.lams.tool.assessment.dto.Summary;
import org.lamsfoundation.lams.tool.assessment.model.Assessment;
+import org.lamsfoundation.lams.tool.assessment.model.AssessmentAnswer;
import org.lamsfoundation.lams.tool.assessment.model.AssessmentAttachment;
import org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestion;
+import org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestionResult;
import org.lamsfoundation.lams.tool.assessment.model.AssessmentSession;
import org.lamsfoundation.lams.tool.assessment.model.AssessmentUser;
import org.lamsfoundation.lams.usermanagement.User;
@@ -168,10 +170,10 @@
void retrieveComplete(SortedSet assessmentQuestionList, AssessmentUser user);
- void setQuestionComplete(Long assessmentQuestionUid, Long userId, Long sessionId);
+ void setQuestionStartDate(Long assessmentQuestionUid, Long userId, Long sessionId);
+
+ AssessmentQuestionResult processUserAnswer(AssessmentQuestionResult result, Long userId, Long sessionId, boolean isFinish);
- void setQuestionAccess(Long assessmentQuestionUid, Long userId, Long sessionId);
-
/**
* If success return next activity's url, otherwise return null.
*
Fisheye: Tag 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f refers to a dead (removed) revision in file `lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/util/AssessmentAnswerOptionComparator.java'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f refers to a dead (removed) revision in file `lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/util/AssessmentOverallFeedbackComparator.java'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f refers to a dead (removed) revision in file `lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/util/AssessmentQuestionComparator.java'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/util/AssessmentQuestionResultComparator.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/util/AssessmentQuestionResultComparator.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/util/AssessmentQuestionResultComparator.java (revision 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f)
@@ -0,0 +1,50 @@
+/****************************************************************
+ * 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.0
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA
+ *
+ * http://www.gnu.org/licenses/gpl.txt
+ * ****************************************************************
+ */
+
+/* $Id$ */
+package org.lamsfoundation.lams.tool.assessment.util;
+
+import java.util.Comparator;
+
+import org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestionResult;
+import org.lamsfoundation.lams.tool.assessment.model.Sequencable;
+
+/**
+ * AssessmentQuestionResultComparator.
+ *
+ * @author Andrey Balan
+ *
+ */
+public class AssessmentQuestionResultComparator implements Comparator {
+
+ public int compare(AssessmentQuestionResult o1, AssessmentQuestionResult o2) {
+ if ((o1 != null) && (o2 != null)) {
+ return o1.getAssessmentQuestion().getSequenceId() - o2.getAssessmentQuestion().getSequenceId();
+ } else if (o1 != null) {
+ return 1;
+ } else {
+ return -1;
+ }
+ }
+
+}
+
\ No newline at end of file
Fisheye: Tag 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f refers to a dead (removed) revision in file `lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/util/AssessmentUnitComparator.java'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/util/SequencableComparator.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/util/SequencableComparator.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/util/SequencableComparator.java (revision 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f)
@@ -0,0 +1,48 @@
+/****************************************************************
+ * 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.0
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA
+ *
+ * http://www.gnu.org/licenses/gpl.txt
+ * ****************************************************************
+ */
+
+/* $Id$ */
+package org.lamsfoundation.lams.tool.assessment.util;
+
+import java.util.Comparator;
+
+import org.lamsfoundation.lams.tool.assessment.model.Sequencable;
+
+/**
+ * SequencableComparator.
+ *
+ * @author Andrey Balan
+ *
+ */
+public class SequencableComparator implements Comparator {
+
+ public int compare(Sequencable o1, Sequencable o2) {
+ if ((o1 != null) && (o2 != null)) {
+ return o1.getSequenceId() - o2.getSequenceId();
+ } else if (o1 != null) {
+ return 1;
+ } else {
+ return -1;
+ }
+ }
+
+}
\ No newline at end of file
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/LearningAction.java
===================================================================
diff -u -rc437e028a3802f01fa80d40d99813c06944d0e9a -r3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/LearningAction.java (.../LearningAction.java) (revision c437e028a3802f01fa80d40d99813c06944d0e9a)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/LearningAction.java (.../LearningAction.java) (revision 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f)
@@ -25,11 +25,15 @@
package org.lamsfoundation.lams.tool.assessment.web.action;
import java.io.IOException;
-import java.sql.Timestamp;
+import java.io.UnsupportedEncodingException;
+import java.lang.reflect.InvocationTargetException;
+import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Date;
-import java.util.HashSet;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
@@ -39,7 +43,9 @@
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
+import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.math.NumberUtils;
import org.apache.log4j.Logger;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionErrors;
@@ -48,25 +54,23 @@
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;
-import org.lamsfoundation.lams.events.DeliveryMethodMail;
import org.lamsfoundation.lams.notebook.model.NotebookEntry;
import org.lamsfoundation.lams.notebook.service.CoreNotebookConstants;
import org.lamsfoundation.lams.tool.ToolAccessMode;
import org.lamsfoundation.lams.tool.assessment.AssessmentConstants;
import org.lamsfoundation.lams.tool.assessment.model.Assessment;
+import org.lamsfoundation.lams.tool.assessment.model.AssessmentAnswer;
import org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestion;
+import org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestionOption;
+import org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestionResult;
import org.lamsfoundation.lams.tool.assessment.model.AssessmentSession;
import org.lamsfoundation.lams.tool.assessment.model.AssessmentUser;
import org.lamsfoundation.lams.tool.assessment.service.AssessmentApplicationException;
import org.lamsfoundation.lams.tool.assessment.service.IAssessmentService;
-import org.lamsfoundation.lams.tool.assessment.service.UploadAssessmentFileException;
-import org.lamsfoundation.lams.tool.assessment.util.AssessmentQuestionComparator;
-import org.lamsfoundation.lams.tool.assessment.web.form.AssessmentQuestionForm;
+import org.lamsfoundation.lams.tool.assessment.util.AssessmentQuestionResultComparator;
+import org.lamsfoundation.lams.tool.assessment.util.SequencableComparator;
import org.lamsfoundation.lams.tool.assessment.web.form.ReflectionForm;
-import org.lamsfoundation.lams.usermanagement.User;
import org.lamsfoundation.lams.usermanagement.dto.UserDTO;
-import org.lamsfoundation.lams.util.FileUtil;
-import org.lamsfoundation.lams.util.FileValidatorUtil;
import org.lamsfoundation.lams.util.WebUtil;
import org.lamsfoundation.lams.web.session.SessionManager;
import org.lamsfoundation.lams.web.util.AttributeNames;
@@ -77,8 +81,6 @@
/**
*
* @author Andrey Balan
- *
- * @version $Revision$
*/
public class LearningAction extends Action {
@@ -93,22 +95,33 @@
if (param.equals("start")) {
return start(mapping, form, request, response);
}
- if (param.equals("complete")) {
- return complete(mapping, form, request, response);
+ if (param.equals("nextPage")) {
+ return nextPage(mapping, form, request, response);
}
-
+ if (param.equals("submitPage")) {
+ return submitPage(mapping, form, request, response);
+ }
+ if (param.equals("submitAll")) {
+ return submitAll(mapping, form, request, response);
+ }
if (param.equals("finish")) {
return finish(mapping, form, request, response);
}
- if (param.equals("addfile")) {
- return addQuestion(mapping, form, request, response);
+// if (param.equals("addfile")) {
+// return addQuestion(mapping, form, request, response);
+// }
+// if (param.equals("addurl")) {
+// return addQuestion(mapping, form, request, response);
+// }
+// if (param.equals("saveOrUpdateQuestion")) {
+// return saveOrUpdateQuestion(mapping, form, request, response);
+// }
+ if (param.equals("upOption")) {
+ return upOption(mapping, form, request, response);
}
- if (param.equals("addurl")) {
- return addQuestion(mapping, form, request, response);
- }
- if (param.equals("saveOrUpdateQuestion")) {
- return saveOrUpdateQuestion(mapping, form, request, response);
- }
+ if (param.equals("downOption")) {
+ return downOption(mapping, form, request, response);
+ }
// ================ Reflection =======================
if (param.equals("newReflection")) {
@@ -122,85 +135,55 @@
}
/**
- * Initial page for add assessment question (single file or URL).
- *
- * @param mapping
- * @param form
- * @param request
- * @param response
- * @return
- */
- private ActionForward addQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request,
- HttpServletResponse response) {
- AssessmentQuestionForm questionForm = (AssessmentQuestionForm) form;
- questionForm.setMode(WebUtil.readStrParam(request, AttributeNames.ATTR_MODE));
- questionForm.setSessionMapID(WebUtil.readStrParam(request, AssessmentConstants.ATTR_SESSION_MAP_ID));
- return mapping.findForward(AssessmentConstants.SUCCESS);
- }
-
- /**
* Read assessment data from database and put them into HttpSession. It will redirect to init.do directly after this
* method run successfully.
*
* This method will avoid read database again and lost un-saved resouce question lost when user "refresh page",
+ * @throws ServletException
*
*/
private ActionForward start(ActionMapping mapping, ActionForm form, HttpServletRequest request,
- HttpServletResponse response) {
+ HttpServletResponse response) throws ServletException {
- // initial Session Map
+ // initialize Session Map
SessionMap sessionMap = new SessionMap();
request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap);
// save toolContentID into HTTPSession
ToolAccessMode mode = WebUtil.readToolAccessModeParam(request, AttributeNames.PARAM_MODE, true);
- Long sessionId = new Long(request.getParameter(AssessmentConstants.PARAM_TOOL_SESSION_ID));
+ Long toolSessionId = new Long(request.getParameter(AssessmentConstants.PARAM_TOOL_SESSION_ID));
request.setAttribute(AssessmentConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID());
request.setAttribute(AttributeNames.ATTR_MODE, mode);
- request.setAttribute(AttributeNames.PARAM_TOOL_SESSION_ID, sessionId);
+ request.setAttribute(AttributeNames.PARAM_TOOL_SESSION_ID, toolSessionId);
// get back the assessment and question list and display them on page
IAssessmentService service = getAssessmentService();
AssessmentUser assessmentUser = null;
if (mode != null && mode.isTeacher()) {
// monitoring mode - user is specified in URL
// assessmentUser may be null if the user was force completed.
- assessmentUser = getSpecifiedUser(service, sessionId, WebUtil.readIntParam(request,
+ assessmentUser = getSpecifiedUser(service, toolSessionId, WebUtil.readIntParam(request,
AttributeNames.PARAM_USER_ID, false));
} else {
- assessmentUser = getCurrentUser(service, sessionId);
+ assessmentUser = getCurrentUser(service, toolSessionId);
}
- List questions = null;
+ List questionsFromDB = null;
Assessment assessment;
- questions = service.getAssessmentQuestionsBySessionId(sessionId);
- assessment = service.getAssessmentBySessionId(sessionId);
+ questionsFromDB = service.getAssessmentQuestionsBySessionId(toolSessionId);
+ assessment = service.getAssessmentBySessionId(toolSessionId);
// check whehter finish lock is on/off
- //TODO!!
- boolean lock = true;//assessment.getTimeLimit() && assessmentUser != null && assessmentUser.isSessionFinished();
+ // TODO!!
+ boolean lock = true;// assessment.getTimeLimit() && assessmentUser != null &&
+ // assessmentUser.isSessionFinished();
- // check whether there is only one assessment question and run auto flag is true or not.
- boolean runAuto = false;
- int questionsNumber = 0;
- if (assessment.getQuestions() != null) {
- questionsNumber = assessment.getQuestions().size();
-// if (assessment.isRunAuto() && questionsNumber == 1) {
-// AssessmentQuestion question = (AssessmentQuestion) assessment.getAssessmentQuestions().iterator().next();
-// // only visible question can be run auto.
-// if (!question.isHide()) {
-// runAuto = true;
-// request.setAttribute(AssessmentConstants.ATTR_QUESTION_UID, question.getUid());
-// }
-// }
- }
-
// get notebook entry
String entryText = new String();
if (assessmentUser != null) {
- NotebookEntry notebookEntry = service.getEntry(sessionId, CoreNotebookConstants.NOTEBOOK_TOOL,
+ NotebookEntry notebookEntry = service.getEntry(toolSessionId, CoreNotebookConstants.NOTEBOOK_TOOL,
AssessmentConstants.TOOL_SIGNATURE, assessmentUser.getUserId().intValue());
if (notebookEntry != null) {
entryText = notebookEntry.getEntry();
@@ -211,17 +194,16 @@
sessionMap.put(AssessmentConstants.ATTR_TITLE, assessment.getTitle());
sessionMap.put(AssessmentConstants.ATTR_INSTRUCTIONS, assessment.getInstructions());
sessionMap.put(AssessmentConstants.ATTR_FINISH_LOCK, lock);
- sessionMap.put(AssessmentConstants.ATTR_LOCK_ON_FINISH, assessment.getTimeLimit());
+ //sessionMap.put(AssessmentConstants.ATTR_LOCK_ON_FINISH, assessment.getTimeLimit());
sessionMap.put(AssessmentConstants.ATTR_USER_FINISHED, assessmentUser != null
&& assessmentUser.isSessionFinished());
- sessionMap.put(AttributeNames.PARAM_TOOL_SESSION_ID, sessionId);
+ sessionMap.put(AttributeNames.PARAM_TOOL_SESSION_ID, toolSessionId);
sessionMap.put(AttributeNames.ATTR_MODE, mode);
// reflection information
sessionMap.put(AssessmentConstants.ATTR_REFLECTION_ON, assessment.isReflectOnActivity());
sessionMap.put(AssessmentConstants.ATTR_REFLECTION_INSTRUCTION, assessment.getReflectInstructions());
sessionMap.put(AssessmentConstants.ATTR_REFLECTION_ENTRY, entryText);
- sessionMap.put(AssessmentConstants.ATTR_RUN_AUTO, new Boolean(runAuto));
// add define later support
if (assessment.isDefineLater()) {
@@ -241,52 +223,128 @@
sessionMap.put(AssessmentConstants.PARAM_RUN_OFFLINE, false);
}
- // init assessment question list
- SortedSet assessmentQuestionList = getAssessmentQuestionList(sessionMap);
- assessmentQuestionList.clear();
- if (questions != null) {
+ SortedSet questionList = new TreeSet(new SequencableComparator());
+ if (questionsFromDB != null) {
// remove hidden questions.
- for (AssessmentQuestion question : questions) {
+ for (AssessmentQuestion question : questionsFromDB) {
// becuase in webpage will use this login name. Here is just
- // initial it to avoid session close error in proxy object.
+ // initialize it to avoid session close error in proxy object.
if (question.getCreateBy() != null) {
question.getCreateBy().getLoginName();
}
if (!question.isHide()) {
- assessmentQuestionList.add(question);
+ questionList.add(question);
}
}
}
+
+ //paging
+ ArrayList> pagedResults = new ArrayList>();
+ int maxQuestionsPerPage = (assessment.getQuestionsPerPage() != 0) ? assessment.getQuestionsPerPage()
+ : questionList.size();
+ SortedSet resultsForOnePage = new TreeSet(
+ new AssessmentQuestionResultComparator());
+ pagedResults.add(resultsForOnePage);
+ int count = 0;
+ for (AssessmentQuestion question : questionList) {
+ AssessmentQuestionResult result = new AssessmentQuestionResult();
+ result.setAssessmentQuestion(question);
+ resultsForOnePage.add(result);
+ count++;
+ if ((resultsForOnePage.size() == maxQuestionsPerPage) && (count != questionList.size())) {
+ resultsForOnePage = new TreeSet(new AssessmentQuestionResultComparator());
+ pagedResults.add(resultsForOnePage);
+ }
+ }
+
+ sessionMap.put(AssessmentConstants.ATTR_PAGED_QUESTIONS, pagedResults);
+ sessionMap.put(AssessmentConstants.ATTR_PAGE_NUMBER, 1);
+
// set complete flag for display purpose
if (assessmentUser != null) {
- service.retrieveComplete(assessmentQuestionList, assessmentUser);
+ service.retrieveComplete(questionList, assessmentUser);
}
sessionMap.put(AssessmentConstants.ATTR_ASSESSMENT, assessment);
+ sessionMap.put(AssessmentConstants.ATTR_QUESTION_LIST, questionList);
return mapping.findForward(AssessmentConstants.SUCCESS);
}
-
+
/**
- * Mark assessment question as complete status.
+ * Display same entire authoring page content from HttpSession variable.
*
* @param mapping
* @param form
* @param request
* @param response
* @return
+ * @throws ServletException
*/
- private ActionForward complete(ActionMapping mapping, ActionForm form, HttpServletRequest request,
- HttpServletResponse response) {
- String mode = request.getParameter(AttributeNames.ATTR_MODE);
- String sessionMapID = request.getParameter(AssessmentConstants.ATTR_SESSION_MAP_ID);
-
- doComplete(request);
-
- request.setAttribute(AttributeNames.ATTR_MODE, mode);
+ private ActionForward nextPage(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws ServletException {
+ String sessionMapID = WebUtil.readStrParam(request, AssessmentConstants.ATTR_SESSION_MAP_ID);
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID);
+ popupQuestionOptionsWithUserAnswers(request);
+
+
request.setAttribute(AssessmentConstants.ATTR_SESSION_MAP_ID, sessionMapID);
+ sessionMap.put(AssessmentConstants.ATTR_PAGE_NUMBER, WebUtil.readIntParam(request, AssessmentConstants.ATTR_PAGE_NUMBER));
return mapping.findForward(AssessmentConstants.SUCCESS);
}
+
+ /**
+ * Display same entire authoring page content from HttpSession variable.
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return
+ * @throws ServletException
+ */
+ private ActionForward submitPage(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws ServletException {
+ String sessionMapID = WebUtil.readStrParam(request, AssessmentConstants.ATTR_SESSION_MAP_ID);
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID);
+ popupQuestionOptionsWithUserAnswers(request);
+
+ int pageNumber = (Integer) sessionMap.get(AssessmentConstants.ATTR_PAGE_NUMBER);
+ ArrayList> pagedResults = (ArrayList>) sessionMap.get(AssessmentConstants.ATTR_PAGED_QUESTIONS);
+ SortedSet resultList = (SortedSet) pagedResults.get(pageNumber-1);
+ processUserAnswersPage(request, resultList, false);
+
+ request.setAttribute(AssessmentConstants.ATTR_SESSION_MAP_ID, sessionMapID);
+ sessionMap.put(AssessmentConstants.ATTR_PAGE_NUMBER, sessionMap.get(AssessmentConstants.ATTR_PAGE_NUMBER));
+ return mapping.findForward(AssessmentConstants.SUCCESS);
+ }
+
+ /**
+ * Display same entire authoring page content from HttpSession variable.
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return
+ * @throws ServletException
+ */
+ private ActionForward submitAll(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws ServletException {
+ String sessionMapID = WebUtil.readStrParam(request, AssessmentConstants.ATTR_SESSION_MAP_ID);
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID);
+ popupQuestionOptionsWithUserAnswers(request);
+
+ int pageNumber = (Integer) sessionMap.get(AssessmentConstants.ATTR_PAGE_NUMBER);
+ ArrayList> pagedResults = (ArrayList>) sessionMap.get(AssessmentConstants.ATTR_PAGED_QUESTIONS);
+ for (SortedSet resultList : pagedResults) {
+ processUserAnswersPage(request, resultList, true);
+ }
+
+ request.setAttribute(AssessmentConstants.ATTR_SESSION_MAP_ID, sessionMapID);
+ sessionMap.put(AssessmentConstants.ATTR_PAGE_NUMBER, sessionMap.get(AssessmentConstants.ATTR_PAGE_NUMBER));
+ return mapping.findForward(AssessmentConstants.SUCCESS);
+ }
/**
* Finish learning session.
@@ -308,17 +366,18 @@
ToolAccessMode mode = (ToolAccessMode) sessionMap.get(AttributeNames.ATTR_MODE);
Long sessionId = (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID);
- // auto run mode, when use finish the only one assessment question, mark it as complete then finish this activity as
- // well.
- String assessmentQuestionUid = request.getParameter(AssessmentConstants.PARAM_QUESTION_UID);
- if (assessmentQuestionUid != null) {
- doComplete(request);
- // NOTE:So far this flag is useless(31/08/2006).
- // set flag, then finish page can know redir target is parent(AUTO_RUN) or self(normal)
- request.setAttribute(AssessmentConstants.ATTR_RUN_AUTO, true);
- } else {
- request.setAttribute(AssessmentConstants.ATTR_RUN_AUTO, false);
- }
+// // auto run mode, when use finish the only one assessment question, mark it as complete then finish this
+// // activity as
+// // well.
+// String assessmentQuestionUid = request.getParameter(AssessmentConstants.PARAM_QUESTION_UID);
+// if (assessmentQuestionUid != null) {
+// doComplete(request);
+// // NOTE:So far this flag is useless(31/08/2006).
+// // set flag, then finish page can know redir target is parent(AUTO_RUN) or self(normal)
+//// request.setAttribute(AssessmentConstants.ATTR_RUN_AUTO, true);
+// } else {
+//// request.setAttribute(AssessmentConstants.ATTR_RUN_AUTO, false);
+// }
if (!validateBeforeFinish(request, sessionMapID)) {
return mapping.getInputForward();
@@ -340,98 +399,189 @@
return mapping.findForward(AssessmentConstants.SUCCESS);
}
+
+ /**
+ * Move up current option.
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return
+ */
+ private ActionForward upOption(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
+ return switchOption(mapping, request, true);
+ }
/**
- * Save file or url assessment question into database.
+ * Move down current option.
*
* @param mapping
* @param form
* @param request
* @param response
* @return
*/
- private ActionForward saveOrUpdateQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ private ActionForward downOption(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) {
- // get back SessionMap
- String sessionMapID = request.getParameter(AssessmentConstants.ATTR_SESSION_MAP_ID);
- SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID);
- request.setAttribute(AssessmentConstants.ATTR_SESSION_MAP_ID, sessionMapID);
+ return switchOption(mapping, request, false);
+ }
- Long sessionId = (Long) sessionMap.get(AssessmentConstants.ATTR_TOOL_SESSION_ID);
-
- String mode = request.getParameter(AttributeNames.ATTR_MODE);
- AssessmentQuestionForm questionForm = (AssessmentQuestionForm) form;
- ActionErrors errors = validateAssessmentQuestion(questionForm);
-
- if (!errors.isEmpty()) {
- this.addErrors(request, errors);
- return findForward(questionForm.getQuestionType(), mapping);
+ private ActionForward switchOption(ActionMapping mapping, HttpServletRequest request, boolean up) {
+ String sessionMapID = WebUtil.readStrParam(request, AssessmentConstants.ATTR_SESSION_MAP_ID);
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID);
+ int pageNumber = (Integer) sessionMap.get(AssessmentConstants.ATTR_PAGE_NUMBER);
+ ArrayList> pagedResults = (ArrayList>) sessionMap.get(AssessmentConstants.ATTR_PAGED_QUESTIONS);
+ SortedSet resultList = (SortedSet) pagedResults.get(pageNumber-1);
+ Long questionUid = new Long(request.getParameter(AssessmentConstants.PARAM_QUESTION_UID));
+
+ AssessmentQuestionResult result = null;
+ for (AssessmentQuestionResult resultFromSession : resultList) {
+ if (resultFromSession.getAssessmentQuestion().getUid().equals(questionUid)) {
+ result = resultFromSession;
+ break;
+ }
}
- short type = questionForm.getQuestionType();
+
+ Set optionList = result.getAssessmentQuestion().getQuestionOptions();
+
+ int optionIndex = NumberUtils.stringToInt(request.getParameter(AssessmentConstants.PARAM_OPTION_INDEX), -1);
+ if (optionIndex != -1) {
+ List rList = new ArrayList(optionList);
+
+ // get current and the target item, and switch their sequnece
+ AssessmentQuestionOption option = rList.get(optionIndex);
+ AssessmentQuestionOption repOption;
+ if (up) {
+ repOption = rList.get(--optionIndex);
+ } else {
+ repOption = rList.get(++optionIndex);
+ }
+
+ int upSeqId = repOption.getSequenceId();
+ repOption.setSequenceId(option.getSequenceId());
+ option.setSequenceId(upSeqId);
- // create a new Assessmentquestion
- AssessmentQuestion question = new AssessmentQuestion();
- IAssessmentService service = getAssessmentService();
- AssessmentUser assessmentUser = getCurrentUser(service, sessionId);
- question.setType(type);
- question.setTitle(questionForm.getTitle());
- question.setQuestion(questionForm.getQuestion());
- question.setCreateDate(new Timestamp(new Date().getTime()));
- question.setCreateByAuthor(false);
- question.setCreateBy(assessmentUser);
-
- // special attribute for URL or FILE
- if (type == AssessmentConstants.QUESTION_TYPE_MULTIPLE_CHOICE) {
-// try {
-// service.uploadAssessmentQuestionFile(question, questionForm.getFile());
-// } catch (UploadAssessmentFileException e) {
-// LearningAction.log.error("Failed upload Assessment File " + e.toString());
-// return mapping.findForward(AssessmentConstants.ERROR);
-// }
-// } else if (type == AssessmentConstants.QUESTION_TYPE_CHOICE) {
-// question.setUrl(questionForm.getUrl());
-// question.setOpenUrlNewWindow(questionForm.isOpenUrlNewWindow());
+ // put back list, it will be sorted again
+ optionList = new TreeSet(new SequencableComparator());
+ optionList.addAll(rList);
+ result.getAssessmentQuestion().setQuestionOptions(optionList);
}
- // save and update session
- AssessmentSession session = service.getAssessmentSessionBySessionId(sessionId);
- if (session == null) {
- LearningAction.log.error("Failed update AssessmentSession by ID[" + sessionId + "]");
- return mapping.findForward(AssessmentConstants.ERROR);
- }
- Set questions = session.getAssessmentQuestions();
- if (questions == null) {
- questions = new HashSet();
- session.setAssessmentQuestions(questions);
- }
- questions.add(question);
- service.saveOrUpdateAssessmentSession(session);
-
- // update session value
- SortedSet assessmentQuestionList = getAssessmentQuestionList(sessionMap);
- assessmentQuestionList.add(question);
-
- // URL or file upload
- request.setAttribute(AssessmentConstants.ATTR_ADD_ASSESSMENT_TYPE, new Short(type));
- request.setAttribute(AttributeNames.ATTR_MODE, mode);
-
- Assessment assessment = session.getAssessment();
- if (assessment.isNotifyTeachersOnAttemptCompletion()) {
- List monitoringUsers = service.getMonitorsByToolSessionId(sessionId);
- if (monitoringUsers != null && !monitoringUsers.isEmpty()) {
- Long[] monitoringUsersIds = new Long[monitoringUsers.size()];
- for (int i = 0; i < monitoringUsersIds.length; i++) {
- monitoringUsersIds[i] = monitoringUsers.get(i).getUserId().longValue();
- }
- String fullName = assessmentUser.getLastName() + " " + assessmentUser.getFirstName();
- service.getEventNotificationService().sendMessage(monitoringUsersIds, DeliveryMethodMail.getInstance(),
- service.getLocalisedMessage("event.assigment.submit.subject", null),
- service.getLocalisedMessage("event.assigment.submit.body", new Object[] { fullName }));
- }
- }
+ request.setAttribute(AssessmentConstants.ATTR_RESULT_FOR_ORDERING, result);
+ request.setAttribute(AssessmentConstants.ATTR_SESSION_MAP_ID, sessionMapID);
return mapping.findForward(AssessmentConstants.SUCCESS);
- }
+ }
+// /**
+// * Initial page for add assessment question (single file or URL).
+// *
+// * @param mapping
+// * @param form
+// * @param request
+// * @param response
+// * @return
+// */
+// private ActionForward addQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+// HttpServletResponse response) {
+// AssessmentQuestionForm questionForm = (AssessmentQuestionForm) form;
+// questionForm.setMode(WebUtil.readStrParam(request, AttributeNames.ATTR_MODE));
+// questionForm.setSessionMapID(WebUtil.readStrParam(request, AssessmentConstants.ATTR_SESSION_MAP_ID));
+// return mapping.findForward(AssessmentConstants.SUCCESS);
+// }
+//
+// /**
+// * Save file or url assessment question into database.
+// *
+// * @param mapping
+// * @param form
+// * @param request
+// * @param response
+// * @return
+// */
+// private ActionForward saveOrUpdateQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+// HttpServletResponse response) {
+// // get back SessionMap
+// String sessionMapID = request.getParameter(AssessmentConstants.ATTR_SESSION_MAP_ID);
+// SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID);
+// request.setAttribute(AssessmentConstants.ATTR_SESSION_MAP_ID, sessionMapID);
+//
+// Long sessionId = (Long) sessionMap.get(AssessmentConstants.ATTR_TOOL_SESSION_ID);
+//
+// String mode = request.getParameter(AttributeNames.ATTR_MODE);
+// AssessmentQuestionForm questionForm = (AssessmentQuestionForm) form;
+// ActionErrors errors = validateAssessmentQuestion(questionForm);
+//
+// if (!errors.isEmpty()) {
+// this.addErrors(request, errors);
+// return findForward(questionForm.getQuestionType(), mapping);
+// }
+// short type = questionForm.getQuestionType();
+//
+// // create a new Assessmentquestion
+// AssessmentQuestion question = new AssessmentQuestion();
+// IAssessmentService service = getAssessmentService();
+// AssessmentUser assessmentUser = getCurrentUser(service, sessionId);
+// question.setType(type);
+// question.setTitle(questionForm.getTitle());
+// question.setQuestion(questionForm.getQuestion());
+// question.setCreateDate(new Timestamp(new Date().getTime()));
+// question.setCreateByAuthor(false);
+// question.setCreateBy(assessmentUser);
+//
+// // special attribute for URL or FILE
+// if (type == AssessmentConstants.QUESTION_TYPE_MULTIPLE_CHOICE) {
+// // try {
+// // service.uploadAssessmentQuestionFile(question, questionForm.getFile());
+// // } catch (UploadAssessmentFileException e) {
+// // LearningAction.log.error("Failed upload Assessment File " + e.toString());
+// // return mapping.findForward(AssessmentConstants.ERROR);
+// // }
+// // } else if (type == AssessmentConstants.QUESTION_TYPE_CHOICE) {
+// // question.setUrl(questionForm.getUrl());
+// // question.setOpenUrlNewWindow(questionForm.isOpenUrlNewWindow());
+// }
+// // save and update session
+//
+// AssessmentSession session = service.getAssessmentSessionBySessionId(sessionId);
+// if (session == null) {
+// LearningAction.log.error("Failed update AssessmentSession by ID[" + sessionId + "]");
+// return mapping.findForward(AssessmentConstants.ERROR);
+// }
+// Set questions = session.getAssessmentQuestions();
+// if (questions == null) {
+// questions = new HashSet();
+// session.setAssessmentQuestions(questions);
+// }
+// questions.add(question);
+// service.saveOrUpdateAssessmentSession(session);
+//
+// // update session value
+// SortedSet assessmentQuestionList = getAssessmentQuestionList(sessionMap);
+// assessmentQuestionList.add(question);
+//
+// // URL or file upload
+// request.setAttribute(AssessmentConstants.ATTR_ADD_ASSESSMENT_TYPE, new Short(type));
+// request.setAttribute(AttributeNames.ATTR_MODE, mode);
+//
+// Assessment assessment = session.getAssessment();
+// if (assessment.isNotifyTeachersOnAttemptCompletion()) {
+// List monitoringUsers = service.getMonitorsByToolSessionId(sessionId);
+// if (monitoringUsers != null && !monitoringUsers.isEmpty()) {
+// Long[] monitoringUsersIds = new Long[monitoringUsers.size()];
+// for (int i = 0; i < monitoringUsersIds.length; i++) {
+// monitoringUsersIds[i] = monitoringUsers.get(i).getUserId().longValue();
+// }
+// String fullName = assessmentUser.getLastName() + " " + assessmentUser.getFirstName();
+// service.getEventNotificationService().sendMessage(monitoringUsersIds, DeliveryMethodMail.getInstance(),
+// service.getLocalisedMessage("event.assigment.submit.subject", null),
+// service.getLocalisedMessage("event.assigment.submit.body", new Object[] { fullName }));
+// }
+// }
+// return mapping.findForward(AssessmentConstants.SUCCESS);
+// }
+
/**
* Display empty reflection form.
*
@@ -522,8 +672,8 @@
Long userID = new Long(user.getUserID().longValue());
IAssessmentService service = getAssessmentService();
- //TODO
- int miniViewFlag = 0;//service.checkMiniView(sessionId, userID);
+ // TODO
+ int miniViewFlag = 0;// service.checkMiniView(sessionId, userID);
// if current user view less than reqired view count number, then just return error message.
// if it is runOffline content, then need not check minimum view count
Boolean runOffline = (Boolean) sessionMap.get(AssessmentConstants.PARAM_RUN_OFFLINE);
@@ -544,39 +694,23 @@
return (IAssessmentService) wac.getBean(AssessmentConstants.ASSESSMENT_SERVICE);
}
- /**
- * List save current assessment questions.
- *
- * @param request
- * @return
- */
- private SortedSet getAssessmentQuestionList(SessionMap sessionMap) {
- SortedSet list = (SortedSet) sessionMap
- .get(AssessmentConstants.ATTR_QUESTION_LIST);
- if (list == null) {
- list = new TreeSet(new AssessmentQuestionComparator());
- sessionMap.put(AssessmentConstants.ATTR_QUESTION_LIST, list);
- }
- return list;
- }
+// /**
+// * List save current assessment questions.
+// *
+// * @param request
+// * @return
+// */
+// private SortedSet getAssessmentQuestionList(SessionMap sessionMap) {
+// SortedSet list = (SortedSet) sessionMap
+// .get(AssessmentConstants.ATTR_QUESTION_LIST);
+// if (list == null) {
+// list = new TreeSet(new AssessmentQuestionComparator());
+// sessionMap.put(AssessmentConstants.ATTR_QUESTION_LIST, list);
+// }
+// return list;
+// }
/**
- * Get java.util.List
from HttpSession by given name.
- *
- * @param request
- * @param name
- * @return
- */
- private List getListFromSession(SessionMap sessionMap, String name) {
- List list = (List) sessionMap.get(name);
- if (list == null) {
- list = new ArrayList();
- sessionMap.put(name, list);
- }
- return list;
- }
-
- /**
* Return ActionForward
according to assessment question type.
*
* @param type
@@ -624,81 +758,235 @@
return assessmentUser;
}
- /**
- * @param questionForm
- * @return
- */
- private ActionErrors validateAssessmentQuestion(AssessmentQuestionForm questionForm) {
- ActionErrors errors = new ActionErrors();
- if (StringUtils.isBlank(questionForm.getTitle())) {
- errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(AssessmentConstants.ERROR_MSG_QUESTION_NAME_BLANK));
- }
+// /**
+// * @param questionForm
+// * @return
+// */
+// private ActionErrors validateAssessmentQuestion(AssessmentQuestionForm questionForm) {
+// ActionErrors errors = new ActionErrors();
+// if (StringUtils.isBlank(questionForm.getTitle())) {
+// errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(
+// AssessmentConstants.ERROR_MSG_QUESTION_NAME_BLANK));
+// }
+//
+// if (questionForm.getQuestionType() == AssessmentConstants.QUESTION_TYPE_MULTIPLE_CHOICE) {
+// // if (StringUtils.isBlank(questionForm.getUrl())) {
+// // errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(AssessmentConstants.ERROR_MSG_URL_BLANK));
+// // // URL validation: Commom URL validate(1.3.0) work not very well: it can not support http://address:port
+// // // format!!!
+// // // UrlValidator validator = new UrlValidator();
+// // // if(!validator.isValid(questionForm.getUrl()))
+// // // errors.add(ActionMessages.GLOBAL_MESSAGE,new
+// // // ActionMessage(AssessmentConstants.ERROR_MSG_INVALID_URL));
+// // }
+// }
+// // if(questionForm.getquestionType() == AssessmentConstants.RESOURCE_TYPE_WEBSITE
+// // ||questionForm.getquestionType() == AssessmentConstants.RESOURCE_TYPE_LEARNING_OBJECT){
+// // if(StringUtils.isBlank(questionForm.getDescription()))
+// // errors.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage(AssessmentConstants.ERROR_MSG_DESC_BLANK));
+// // }
+// // if (questionForm.getQuestionType() == AssessmentConstants.QUESTION_TYPE_MATCHING_PAIRS
+// // || questionForm.getQuestionType() == AssessmentConstants.QUESTION_TYPE_FILL_THE_GAP
+// // || questionForm.getQuestionType() == AssessmentConstants.QUESTION_TYPE_MULTIPLE_CHOICE) {
+// //
+// // if (questionForm.getFile() != null && FileUtil.isExecutableFile(questionForm.getFile().getFileName())) {
+// // ActionMessage msg = new ActionMessage("error.attachment.executable");
+// // errors.add(ActionMessages.GLOBAL_MESSAGE, msg);
+// // }
+// //
+// // // validate question size
+// // FileValidatorUtil.validateFileSize(questionForm.getFile(), false, errors);
+// //
+// // // for edit validate: file already exist
+// // if (!questionForm.isHasFile()
+// // && (questionForm.getFile() == null || StringUtils.isEmpty(questionForm.getFile().getFileName()))) {
+// // errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(AssessmentConstants.ERROR_MSG_FILE_BLANK));
+// // }
+// // }
+// return errors;
+// }
- if (questionForm.getQuestionType() == AssessmentConstants.QUESTION_TYPE_MULTIPLE_CHOICE) {
-// if (StringUtils.isBlank(questionForm.getUrl())) {
-// errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(AssessmentConstants.ERROR_MSG_URL_BLANK));
-// // URL validation: Commom URL validate(1.3.0) work not very well: it can not support http://address:port
-// // format!!!
-// // UrlValidator validator = new UrlValidator();
-// // if(!validator.isValid(questionForm.getUrl()))
-// // errors.add(ActionMessages.GLOBAL_MESSAGE,new
-// // ActionMessage(AssessmentConstants.ERROR_MSG_INVALID_URL));
-// }
- }
- // if(questionForm.getquestionType() == AssessmentConstants.RESOURCE_TYPE_WEBSITE
- // ||questionForm.getquestionType() == AssessmentConstants.RESOURCE_TYPE_LEARNING_OBJECT){
- // if(StringUtils.isBlank(questionForm.getDescription()))
- // errors.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage(AssessmentConstants.ERROR_MSG_DESC_BLANK));
- // }
-// if (questionForm.getQuestionType() == AssessmentConstants.QUESTION_TYPE_MATCHING_PAIRS
-// || questionForm.getQuestionType() == AssessmentConstants.QUESTION_TYPE_FILL_THE_GAP
-// || questionForm.getQuestionType() == AssessmentConstants.QUESTION_TYPE_MULTIPLE_CHOICE) {
+// /**
+// * Set complete flag for given assessment question.
+// *
+// * @param request
+// * @param sessionId
+// */
+// private void doComplete(HttpServletRequest request) {
+// // get back sessionMap
+// String sessionMapID = request.getParameter(AssessmentConstants.ATTR_SESSION_MAP_ID);
+// SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID);
//
-// if (questionForm.getFile() != null && FileUtil.isExecutableFile(questionForm.getFile().getFileName())) {
-// ActionMessage msg = new ActionMessage("error.attachment.executable");
-// errors.add(ActionMessages.GLOBAL_MESSAGE, msg);
+// Long assessmentQuestionUid = new Long(request.getParameter(AssessmentConstants.PARAM_QUESTION_UID));
+// IAssessmentService service = getAssessmentService();
+// HttpSession ss = SessionManager.getSession();
+// // get back login user DTO
+// UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER);
+//
+// Long sessionId = (Long) sessionMap.get(AssessmentConstants.ATTR_TOOL_SESSION_ID);
+// service.setQuestionComplete(assessmentQuestionUid, new Long(user.getUserID().intValue()), sessionId);
+//
+// SortedSet questionList = (SortedSet) sessionMap
+// .get(AssessmentConstants.ATTR_QUESTION_LIST);
+// SortedSet assessmentQuestionList = questionList;
+// // set assessment question complete tag
+// for (AssessmentQuestion question : assessmentQuestionList) {
+// if (question.getUid().equals(assessmentQuestionUid)) {
+// question.setComplete(true);
+// break;
// }
+// }
+// }
+
+// /**
+// * Set complete flag for given assessment question.
+// *
+// * @param request
+// * @param sessionId
+// */
+// private void setResults(HttpServletRequest request) {
+// // get back sessionMap
+// String sessionMapID = request.getParameter(AssessmentConstants.ATTR_SESSION_MAP_ID);
+// SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID);
//
-// // validate question size
-// FileValidatorUtil.validateFileSize(questionForm.getFile(), false, errors);
+// Long assessmentQuestionUid = new Long(request.getParameter(AssessmentConstants.PARAM_QUESTION_UID));
+// IAssessmentService service = getAssessmentService();
+// HttpSession ss = SessionManager.getSession();
+// // get back login user DTO
+// UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER);
+// Long sessionId = (Long) sessionMap.get(AssessmentConstants.ATTR_TOOL_SESSION_ID);
+// service.setQuestionComplete(assessmentQuestionUid, new Long(user.getUserID().intValue()), sessionId);
//
-// // for edit validate: file already exist
-// if (!questionForm.isHasFile()
-// && (questionForm.getFile() == null || StringUtils.isEmpty(questionForm.getFile().getFileName()))) {
-// errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(AssessmentConstants.ERROR_MSG_FILE_BLANK));
+// SortedSet questionList = (SortedSet) sessionMap
+// .get(AssessmentConstants.ATTR_QUESTION_LIST);
+// SortedSet assessmentQuestionList = questionList;
+// // set assessment question complete tag
+// for (AssessmentQuestion question : assessmentQuestionList) {
+// if (question.getUid().equals(assessmentQuestionUid)) {
+// question.setComplete(true);
+// break;
// }
// }
- return errors;
- }
+// }
+
+ private void popupQuestionOptionsWithUserAnswers(HttpServletRequest request){
+ String sessionMapID = WebUtil.readStrParam(request, AssessmentConstants.ATTR_SESSION_MAP_ID);
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID);
+ int pageNumber = (Integer) sessionMap.get(AssessmentConstants.ATTR_PAGE_NUMBER);
+ ArrayList> pagedResults = (ArrayList>) sessionMap.get(AssessmentConstants.ATTR_PAGED_QUESTIONS);
+ SortedSet resultList = (SortedSet) pagedResults.get(pageNumber-1);
+ int count = resultList.size();
+
+ for (int i = 0; i < count; i++) {
+ Long assessmentQuestionUid = WebUtil.readLongParam(request, AssessmentConstants.PARAM_QUESTION_UID + i);
+ AssessmentQuestion question = null;
+ for (AssessmentQuestionResult result : resultList) {
+ if (result.getAssessmentQuestion().getUid().equals(assessmentQuestionUid)) {
+ question = result.getAssessmentQuestion();
+ break;
+ }
+ }
+ if (question == null) {
+ throw new RuntimeException("You screwed up!");
+ }
+ int questionType = question.getType();
+ if (questionType == AssessmentConstants.QUESTION_TYPE_MULTIPLE_CHOICE) {
+ for (AssessmentQuestionOption option : question.getQuestionOptions()) {
+ boolean answerBoolean = false;
+ if (question.isMultipleAnswersAllowed()) {
+ String answerString = request.getParameter(AssessmentConstants.ATTR_QUESTION_PREFIX + i + "_"
+ + option.getSequenceId());
+ answerBoolean = !StringUtils.isBlank(answerString);
+ } else {
+ String answerString = request.getParameter(AssessmentConstants.ATTR_QUESTION_PREFIX + i);
+ if (answerString != null) {
+ int optionSequenceId = Integer.parseInt(answerString);
+ answerBoolean = (option.getSequenceId() == optionSequenceId);
+ }
+ }
+ option.setAnswerBoolean(answerBoolean);
+ }
+ } else if (questionType == AssessmentConstants.QUESTION_TYPE_MATCHING_PAIRS) {
+ for (AssessmentQuestionOption option : question.getQuestionOptions()) {
+ int answerInt = WebUtil.readIntParam(request, AssessmentConstants.ATTR_QUESTION_PREFIX + i + "_" + option.getSequenceId());
+ option.setAnswerInt(answerInt);
+ }
+ } else if (questionType == AssessmentConstants.QUESTION_TYPE_SHORT_ANSWER) {
+ String answerString = request.getParameter(AssessmentConstants.ATTR_QUESTION_PREFIX + i);
+ question.setAnswerString(answerString);
+ } else if (questionType == AssessmentConstants.QUESTION_TYPE_NUMERICAL) {
+ String answerString = request.getParameter(AssessmentConstants.ATTR_QUESTION_PREFIX + i);
+ question.setAnswerString(answerString);
+ } else if (questionType == AssessmentConstants.QUESTION_TYPE_TRUE_FALSE) {
+ String answerString = request.getParameter(AssessmentConstants.ATTR_QUESTION_PREFIX + i);
+ if (answerString != null) {
+ question.setAnswerBoolean(Boolean.parseBoolean(answerString));
+ question.setAnswerString("not null");
+ }
+ } else if (questionType == AssessmentConstants.QUESTION_TYPE_ESSAY) {
+ String answerString = request.getParameter(AssessmentConstants.ATTR_QUESTION_PREFIX + i);
+ question.setAnswerString(answerString);
+ } else if (questionType == AssessmentConstants.QUESTION_TYPE_ORDERING) {
+ //TODO correct answer
+ for (AssessmentQuestionOption option : question.getQuestionOptions()) {
+ String answerString = request.getParameter(AssessmentConstants.ATTR_QUESTION_PREFIX + i + "_"
+ + option.getSequenceId());
+ option.setAnswerInt(option.getSequenceId());
+ }
+ }
+ }
+ }
+
/**
- * Set complete flag for given assessment question.
+ * Get answer options from HttpRequest
*
* @param request
- * @param sessionId
+ *
*/
- private void doComplete(HttpServletRequest request) {
- // get back sessionMap
- String sessionMapID = request.getParameter(AssessmentConstants.ATTR_SESSION_MAP_ID);
+ private void processUserAnswersPage(HttpServletRequest request, SortedSet resultList, boolean isFinish) {
+ String sessionMapID = WebUtil.readStrParam(request, AssessmentConstants.ATTR_SESSION_MAP_ID);
SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID);
- Long assessmentQuestionUid = new Long(request.getParameter(AssessmentConstants.PARAM_QUESTION_UID));
IAssessmentService service = getAssessmentService();
HttpSession ss = SessionManager.getSession();
// get back login user DTO
UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER);
-
- Long sessionId = (Long) sessionMap.get(AssessmentConstants.ATTR_TOOL_SESSION_ID);
- service.setQuestionComplete(assessmentQuestionUid, new Long(user.getUserID().intValue()), sessionId);
-
- // set assessment question complete tag
- SortedSet assessmentQuestionList = getAssessmentQuestionList(sessionMap);
- for (AssessmentQuestion question : assessmentQuestionList) {
- if (question.getUid().equals(assessmentQuestionUid)) {
- question.setComplete(true);
- break;
+ Long userId = new Long(user.getUserID().intValue());
+ Long sessionId = (Long) sessionMap.get(AssessmentConstants.ATTR_TOOL_SESSION_ID);
+
+ SortedSet savedResultList = new TreeSet(
+ new AssessmentQuestionResultComparator());
+ for (AssessmentQuestionResult result : resultList) {
+ AssessmentQuestionResult savedResult = service.processUserAnswer(result, userId, sessionId, isFinish);
+ savedResultList.add(savedResult);
+ }
+ resultList.clear();
+ resultList.addAll(savedResultList);
+ }
+
+ /**
+ * Split Request Parameter from HttpRequest
+ *
+ * @param request
+ * @param parameterName parameterName
+ */
+ private Map splitRequestParameter(HttpServletRequest request, String parameterName) {
+ String list = request.getParameter(parameterName);
+ String[] params = list.split("&");
+ Map paramMap = new HashMap();
+ String[] pair;
+ for (String item : params) {
+ pair = item.split("=");
+ if (pair == null || pair.length != 2)
+ continue;
+ try {
+ paramMap.put(pair[0], URLDecoder.decode(pair[1], "UTF-8"));
+ } catch (UnsupportedEncodingException e) {
+ log.error("Error occurs when decode instruction string:" + e.toString());
}
}
+ return paramMap;
}
}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/form/AssessmentQuestionForm.java
===================================================================
diff -u -r4c539129df9d6fd79ac3d7ba4d964dc8f0e6a9d6 -r3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/form/AssessmentQuestionForm.java (.../AssessmentQuestionForm.java) (revision 4c539129df9d6fd79ac3d7ba4d964dc8f0e6a9d6)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/form/AssessmentQuestionForm.java (.../AssessmentQuestionForm.java) (revision 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f)
@@ -24,7 +24,6 @@
package org.lamsfoundation.lams.tool.assessment.web.form;
import org.apache.struts.action.ActionForm;
-import org.apache.struts.upload.FormFile;
/**
* Assessment Question Form.
Index: lams_tool_assessment/web/WEB-INF/tags/AuthoringButton.tag
===================================================================
diff -u -rc56857991e269aa7f5bd250a05b52c767a9957ad -r3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f
--- lams_tool_assessment/web/WEB-INF/tags/AuthoringButton.tag (.../AuthoringButton.tag) (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
+++ lams_tool_assessment/web/WEB-INF/tags/AuthoringButton.tag (.../AuthoringButton.tag) (revision 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f)
@@ -68,7 +68,7 @@
location.href=" ";
}
function doSubmit_Form_Only() {
- $("#overallFeedbackList").val($('#advancedInputArea').contents().find('#overallFeedbackForm').serialize(true));
+ $("#overallFeedbackList").val($('#advancedInputArea').contents().find('#overallFeedbackForm').serialize(true));
document.getElementById("${formID}").submit();
}
function doCancel() {
@@ -91,4 +91,4 @@
-
+
\ No newline at end of file
Index: lams_tool_assessment/web/WEB-INF/tags/Passon.tag
===================================================================
diff -u -rc56857991e269aa7f5bd250a05b52c767a9957ad -r3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f
--- lams_tool_assessment/web/WEB-INF/tags/Passon.tag (.../Passon.tag) (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
+++ lams_tool_assessment/web/WEB-INF/tags/Passon.tag (.../Passon.tag) (revision 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f)
@@ -83,4 +83,4 @@
pluginspage="http://www.macromedia.com/go/getflashplayer" />
-
+
\ No newline at end of file
Index: lams_tool_assessment/web/WEB-INF/tags/TabName.tag
===================================================================
diff -u -rc56857991e269aa7f5bd250a05b52c767a9957ad -r3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f
--- lams_tool_assessment/web/WEB-INF/tags/TabName.tag (.../TabName.tag) (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
+++ lams_tool_assessment/web/WEB-INF/tags/TabName.tag (.../TabName.tag) (revision 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f)
@@ -57,4 +57,4 @@
-
+
\ No newline at end of file
Index: lams_tool_assessment/web/WEB-INF/tags/TextSearch.tag
===================================================================
diff -u
--- lams_tool_assessment/web/WEB-INF/tags/TextSearch.tag (revision 0)
+++ lams_tool_assessment/web/WEB-INF/tags/TextSearch.tag (revision 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f)
@@ -0,0 +1,136 @@
+<%
+/****************************************************************
+ * 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.0
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ *
+ * http://www.gnu.org/licenses/gpl.txt
+ * ****************************************************************
+ */
+
+ /**
+ * TextSearch.tag
+ * Author: Marcin Cieslak
+ * Description: Displays form for creating text search conditions.
+ */
+
+ %>
+<%@ tag body-content="scriptless" %>
+<%@ taglib uri="tags-core" prefix="c" %>
+<%@ taglib uri="tags-fmt" prefix="fmt" %>
+<%@ taglib uri="tags-html" prefix="html" %>
+<%@ taglib uri="tags-lams" prefix="lams" %>
+
+<%-- Required attributes --%>
+<%@ attribute name="sessionMapID" required="true" rtexprvalue="true" %>
+<%@ attribute name="wrapInFormTag" required="true" rtexprvalue="true" %>
+
+<%-- Optional attributes --%>
+<%@ attribute name="action" required="false" rtexprvalue="true" %>
+<%@ attribute name="formID" required="false" rtexprvalue="true" %>
+<%@ attribute name="headingLabelKey" required="false" rtexprvalue="true" %>
+<%@ attribute name="allWordsLabelKey" required="false" rtexprvalue="true" %>
+<%@ attribute name="phraseLabelKey" required="false" rtexprvalue="true" %>
+<%@ attribute name="anyWordsLabelKey" required="false" rtexprvalue="true" %>
+<%@ attribute name="excludedWordsLabelKey" required="false" rtexprvalue="true" %>
+<%@ attribute name="saveButtonLabelKey" required="false" rtexprvalue="true" %>
+<%@ attribute name="cancelButtonLabelKey" required="false" rtexprvalue="true" %>
+<%@ attribute name="cancelAction" required="false" rtexprvalue="true" %>
+
+<%-- Default value for message key --%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: lams_tool_assessment/web/WEB-INF/tlds/lams/lams.tld
===================================================================
diff -u -rc56857991e269aa7f5bd250a05b52c767a9957ad -r3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f
--- lams_tool_assessment/web/WEB-INF/tlds/lams/lams.tld (.../lams.tld) (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
+++ lams_tool_assessment/web/WEB-INF/tlds/lams/lams.tld (.../lams.tld) (revision 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f)
@@ -123,6 +123,26 @@
+ Converts role name into form usable as message resources key
+ Converts role name into form usable as message resources key
+
+
+ role
+ org.lamsfoundation.lams.web.tag.RoleTag
+ empty
+
+
+ Converts role name into form usable as message resources key
+ role
+ true
+
+ true
+
+
+
+
+
+
Help tag
Help tag
@@ -167,26 +187,6 @@
- Converts role name into form usable as message assessment key
- Converts role name into form usable as message assessment key
-
-
- role
- org.lamsfoundation.lams.web.tag.RoleTag
- empty
-
-
- Converts role name into form usable as message assessment key
- role
- true
-
- true
-
-
-
-
-
-
Output stylesheet based on the user preferences.
User's chosen stylesheet
@@ -289,11 +289,6 @@
true
- index
- false
- true
-
-
indexed
false
true
@@ -466,6 +461,10 @@
ImgButtonWrapper
/WEB-INF/tags/ImgButtonWrapper.tag
+
+
+ TextSearch
+ /WEB-INF/tags/TextSearch.tag
textarea
Index: lams_tool_assessment/web/includes/images/completeitem.gif
===================================================================
diff -u
Binary files differ
Index: lams_tool_assessment/web/includes/images/incompleteitem.gif
===================================================================
diff -u
Binary files differ
Fisheye: Tag 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f refers to a dead (removed) revision in file `lams_tool_assessment/web/pages/learning/addfile.jsp'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f refers to a dead (removed) revision in file `lams_tool_assessment/web/pages/learning/addurl.jsp'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_tool_assessment/web/pages/learning/learning.jsp
===================================================================
diff -u -rc56857991e269aa7f5bd250a05b52c767a9957ad -r3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f
--- lams_tool_assessment/web/pages/learning/learning.jsp (.../learning.jsp) (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
+++ lams_tool_assessment/web/pages/learning/learning.jsp (.../learning.jsp) (revision 3fdcee6fa67ca8bbbf112bb01a95873fc76a6b0f)
@@ -12,34 +12,15 @@
-
-
+
@@ -87,127 +100,53 @@
<%@ include file="/common/messages.jsp"%>
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
- ${item.title}
-
-
- [${item.createBy.loginName}]
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
- ${assessment.miniViewNumberStr}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <%-- end mode != teacher --%>
-
-
-
+<%--
@@ -236,20 +175,40 @@
+--%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ${status.index + 1}
+
+
+
+
+
-
-
-
+
+
+
+
+
+
-
+
@@ -265,4 +224,4 @@
-
-
-
-
-
-
-
-
-
+