+
+
+
+
+
Index: lams_tool_assessment/db/sql/activity_insert.sql
===================================================================
diff -u
--- lams_tool_assessment/db/sql/activity_insert.sql (revision 0)
+++ lams_tool_assessment/db/sql/activity_insert.sql (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,82 @@
+# Connection: ROOT LOCAL
+# Host: localhost
+# Saved: 2005-04-07 11:08:32
+#
+INSERT INTO lams_learning_activity
+(
+activity_ui_id
+, description
+, title
+, help_text
+, xcoord
+, ycoord
+, parent_activity_id
+, parent_ui_id
+, learning_activity_type_id
+, grouping_support_type_id
+, apply_grouping_flag
+, grouping_id
+, grouping_ui_id
+, order_id
+, define_later_flag
+, learning_design_id
+, learning_library_id
+, create_date_time
+, run_offline_flag
+, max_number_of_options
+, min_number_of_options
+, options_instructions
+, tool_id
+, tool_content_id
+, activity_category_id
+, gate_activity_level_id
+, gate_open_flag
+, gate_start_time_offset
+, gate_end_time_offset
+, gate_start_date_time
+, gate_end_date_time
+, library_activity_ui_image
+, create_grouping_id
+, create_grouping_ui_id
+, library_activity_id
+, language_file
+)
+VALUES
+(
+NULL
+, 'Assessment'
+, 'Assessment'
+, 'Put some help text here.'
+, NULL
+, NULL
+, NULL
+, NULL
+, 1
+, 2
+, 0
+, NULL
+, NULL
+, NULL
+, 0
+, NULL
+, ${learning_library_id}
+, NOW()
+, 0
+, NULL
+, NULL
+, NULL
+, ${tool_id}
+, NULL
+, 4
+, NULL
+, NULL
+, NULL
+, NULL
+, NULL
+, NULL
+, 'tool/laasse10/images/icon_assessment.swf'
+, NULL
+, NULL
+, NULL
+, 'org.lamsfoundation.lams.tool.assessment.ApplicationResources'
+)
Index: lams_tool_assessment/db/sql/create_lams_tool_assessment.sql
===================================================================
diff -u
--- lams_tool_assessment/db/sql/create_lams_tool_assessment.sql (revision 0)
+++ lams_tool_assessment/db/sql/create_lams_tool_assessment.sql (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,141 @@
+SET FOREIGN_KEY_CHECKS=0;
+drop table if exists tl_laasse10_attachment;
+drop table if exists tl_laasse10_assessment;
+drop table if exists tl_laasse10_assessment_question;
+drop table if exists tl_laasse10_answer_options;
+drop table if exists tl_laasse10_assessment_overall_feedback;
+drop table if exists tl_laasse10_assessment_question_visit_log;
+drop table if exists tl_laasse10_session;
+drop table if exists tl_laasse10_user;
+create table tl_laasse10_attachment (
+ uid bigint not null auto_increment,
+ file_version_id bigint,
+ file_type varchar(255),
+ file_name varchar(255),
+ file_uuid bigint,
+ create_date datetime,
+ assessment_uid bigint,
+ primary key (uid)
+)type=innodb;
+create table tl_laasse10_assessment (
+ uid bigint not null auto_increment,
+ create_date datetime,
+ update_date datetime,
+ create_by bigint,
+ title varchar(255),
+ run_offline tinyint,
+ time_limit integer DEFAULT 0,
+ attempts_allowed integer DEFAULT 0,
+ instructions text,
+ online_instructions text,
+ offline_instructions text,
+ content_in_use tinyint,
+ define_later tinyint,
+ content_id bigint unique,
+ allow_question_feedback tinyint,
+ allow_overall_feedback tinyint,
+ allow_right_wrong_answers tinyint,
+ allow_grades_after_attempt tinyint,
+ questions_per_page integer DEFAULT 0,
+ shuffled tinyint,
+ reflect_instructions varchar(255),
+ reflect_on_activity smallint,
+ attempt_completion_notify tinyint DEFAULT 0,
+ primary key (uid)
+)type=innodb;
+create table tl_laasse10_assessment_question (
+ uid bigint not null auto_increment,
+ question_type smallint,
+ title varchar(255),
+ question text,
+ sequence_id integer,
+ default_grade integer DEFAULT 1,
+ penalty_factor float DEFAULT 0.1,
+ general_feedback text,
+ feedback_on_correct text,
+ feedback_on_partially_correct text,
+ feedback_on_incorrect text,
+ shuffle tinyint,
+ case_sensitive tinyint,
+ hide tinyint,
+ create_by_author tinyint,
+ create_date datetime,
+ create_by bigint,
+ assessment_uid bigint,
+ session_uid bigint,
+ primary key (uid)
+)type=innodb;
+create table tl_laasse10_answer_options (
+ uid bigint not null unique auto_increment,
+ question_uid bigint,
+ sequence_id integer,
+ question text,
+ answer_string text,
+ answer_long bigint,
+ accepted_error bigint,
+ grade float,
+ feedback text,
+ primary key (uid)
+)type=innodb;
+create table tl_laasse10_assessment_overall_feedback (
+ uid bigint not null unique auto_increment,
+ assessment_uid bigint,
+ sequence_id integer,
+ grade_boundary integer,
+ feedback text,
+ primary key (uid)
+)type=innodb;
+create table tl_laasse10_question_log (
+ uid bigint not null auto_increment,
+ access_date datetime,
+ assessment_question_uid bigint,
+ user_uid bigint,
+ complete tinyint,
+ session_id bigint,
+ primary key (uid)
+)type=innodb;
+create table tl_laasse10_session (
+ uid bigint not null auto_increment,
+ session_end_date datetime,
+ session_start_date datetime,
+ status integer,
+ assessment_uid bigint,
+ session_id bigint,
+ session_name varchar(250),
+ primary key (uid)
+)type=innodb;
+create table tl_laasse10_user (
+ uid bigint not null auto_increment,
+ user_id bigint,
+ last_name varchar(255),
+ first_name varchar(255),
+ login_name varchar(255),
+ session_finished smallint,
+ session_uid bigint,
+ assessment_uid bigint,
+ primary key (uid)
+)type=innodb;
+alter table tl_laasse10_attachment add index FK_NEW_1720029621_1E7009430E79035 (assessment_uid), add constraint FK_NEW_1720029621_1E7009430E79035 foreign key (assessment_uid) references tl_laasse10_assessment (uid);
+alter table tl_laasse10_assessment add index FK_NEW_1720029621_89093BF758092FB (create_by), add constraint FK_NEW_1720029621_89093BF758092FB foreign key (create_by) references tl_laasse10_user (uid);
+alter table tl_laasse10_assessment_question add index FK_NEW_1720029621_F52D1F93758092FB (create_by), add constraint FK_NEW_1720029621_F52D1F93758092FB foreign key (create_by) references tl_laasse10_user (uid);
+alter table tl_laasse10_assessment_question add index FK_NEW_1720029621_F52D1F9330E79035 (assessment_uid), add constraint FK_NEW_1720029621_F52D1F9330E79035 foreign key (assessment_uid) references tl_laasse10_assessment (uid);
+alter table tl_laasse10_assessment_question add index FK_NEW_1720029621_F52D1F93EC0D3147 (session_uid), add constraint FK_NEW_1720029621_F52D1F93EC0D3147 foreign key (session_uid) references tl_laasse10_session (uid);
+alter table tl_laasse10_answer_options add index FK_tl_laasse10_answer_options_1 (question_uid), add constraint FK_tl_laasse10_answer_options_1 foreign key (question_uid) references tl_laasse10_assessment_question (uid);
+alter table tl_laasse10_assessment_overall_feedback add index FK_tl_laasse10_assessment_overall_feedback_1 (assessment_uid), add constraint FK_tl_laasse10_assessment_overall_feedback_1 foreign key (assessment_uid) references tl_laasse10_assessment (uid);
+alter table tl_laasse10_question_log add index FK_NEW_1720029621_693580A438BF8DFE (assessment_question_uid), add constraint FK_NEW_1720029621_693580A438BF8DFE foreign key (assessment_question_uid) references tl_laasse10_assessment_question (uid);
+alter table tl_laasse10_question_log add index FK_NEW_1720029621_693580A441F9365D (user_uid), add constraint FK_NEW_1720029621_693580A441F9365D foreign key (user_uid) references tl_laasse10_user (uid);
+alter table tl_laasse10_session add index FK_NEW_1720029621_24AA78C530E79035 (assessment_uid), add constraint FK_NEW_1720029621_24AA78C530E79035 foreign key (assessment_uid) references tl_laasse10_assessment (uid);
+alter table tl_laasse10_user add index FK_NEW_1720029621_30113BFCEC0D3147 (session_uid), add constraint FK_NEW_1720029621_30113BFCEC0D3147 foreign key (session_uid) references tl_laasse10_session (uid);
+alter table tl_laasse10_user add index FK_NEW_1720029621_30113BFC309ED320 (assessment_uid), add constraint FK_NEW_1720029621_30113BFC309ED320 foreign key (assessment_uid) references tl_laasse10_assessment (uid);
+
+
+
+INSERT INTO `tl_laasse10_assessment` (`uid`, `create_date`, `update_date`, `create_by`, `title`, `run_offline`,
+ `instructions`, `online_instructions`, `offline_instructions`, `content_in_use`, `define_later`, `content_id`, `allow_question_feedback`,
+ `allow_overall_feedback`, `allow_right_wrong_answers`, `allow_grades_after_attempt`, `shuffled`,`reflect_on_activity`) VALUES
+ (1,NULL,NULL,NULL,'Assessment','0','Instructions ',null,null,0,0,${default_content_id},0,0,0,0,0,0);
+
+INSERT INTO `tl_laasse10_assessment_question` (`uid`, `question_type`, `title`, `question`, `sequence_id`, `general_feedback`, `feedback_on_correct`, `feedback_on_partially_correct`, `feedback_on_incorrect`, `shuffle`, `case_sensitive`, `hide`, `create_by_author`, `create_date`, `create_by`, `assessment_uid`, `session_uid`) VALUES
+ (1,1,'Title','Question',1,'general_feedback','feedback_on_correct','feedback_on_partially_correct','feedback_on_incorrect',0,0,0,0,NOW(),NULL,1,NULL);
+
+SET FOREIGN_KEY_CHECKS=1;
Index: lams_tool_assessment/db/sql/db_version_insert.sql
===================================================================
diff -u
--- lams_tool_assessment/db/sql/db_version_insert.sql (revision 0)
+++ lams_tool_assessment/db/sql/db_version_insert.sql (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,2 @@
+-- $Id$
+INSERT INTO patches VALUES ('@signature@', '@tool_version@', NOW(), 'F');
Index: lams_tool_assessment/db/sql/drop_lams_tool_assessment.sql
===================================================================
diff -u
--- lams_tool_assessment/db/sql/drop_lams_tool_assessment.sql (revision 0)
+++ lams_tool_assessment/db/sql/drop_lams_tool_assessment.sql (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,13 @@
+SET FOREIGN_KEY_CHECKS=0;
+drop table if exists tl_laasse10_attachment;
+drop table if exists tl_laasse10_assessment;
+drop table if exists tl_laasse10_assessment_question;
+drop table if exists tl_laasse10_question_log;
+drop table if exists tl_laasse10_session;
+drop table if exists tl_laasse10_user;
+SET FOREIGN_KEY_CHECKS=1;
+
+
+
+
+
Index: lams_tool_assessment/db/sql/library_insert.sql
===================================================================
diff -u
--- lams_tool_assessment/db/sql/library_insert.sql (revision 0)
+++ lams_tool_assessment/db/sql/library_insert.sql (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,18 @@
+# Connection: ROOT LOCAL
+# Host: localhost
+# Saved: 2005-04-07 10:50:55
+#
+INSERT INTO lams_learning_library
+(
+description,
+title,
+valid_flag,
+create_date_time
+)
+VALUES
+(
+'Assessment',
+'Assessment',
+0,
+NOW()
+)
Index: lams_tool_assessment/db/sql/table-schema.sql
===================================================================
diff -u
--- lams_tool_assessment/db/sql/table-schema.sql (revision 0)
+++ lams_tool_assessment/db/sql/table-schema.sql (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1 @@
\ No newline at end of file
Index: lams_tool_assessment/db/sql/tool_insert.sql
===================================================================
diff -u
--- lams_tool_assessment/db/sql/tool_insert.sql (revision 0)
+++ lams_tool_assessment/db/sql/tool_insert.sql (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,64 @@
+# Connection: ROOT LOCAL
+# Host: localhost
+# Saved: 2005-04-07 10:42:43
+#
+INSERT INTO lams_tool
+(
+tool_signature,
+service_name,
+tool_display_name,
+description,
+tool_identifier,
+tool_version,
+learning_library_id,
+default_tool_content_id,
+valid_flag,
+grouping_support_type_id,
+supports_run_offline_flag,
+learner_url,
+learner_preview_url,
+learner_progress_url,
+author_url,
+monitor_url,
+define_later_url,
+export_pfolio_learner_url,
+export_pfolio_class_url,
+contribute_url,
+moderation_url,
+help_url,
+language_file,
+classpath_addition,
+context_file,
+create_date_time,
+modified_date_time
+)
+VALUES
+(
+'laasse10',
+'assessmentService',
+'Shared Assessment',
+'Shared Assessment',
+'sharedassessment',
+'@tool_version@',
+NULL,
+NULL,
+0,
+2,
+1,
+'tool/laasse10/learning/start.do?mode=learner',
+'tool/laasse10/learning/start.do?mode=author',
+'tool/laasse10/learning/start.do?mode=teacher',
+'tool/laasse10/authoring/start.do',
+'tool/laasse10/monitoring/summary.do',
+'tool/laasse10/definelater.do',
+'tool/laasse10/exportPortfolio?mode=learner',
+'tool/laasse10/exportPortfolio?mode=teacher',
+'tool/laasse10/contribute.do',
+'tool/laasse10/moderate.do',
+'http://wiki.lamsfoundation.org/display/lamsdocs/laasse10',
+'org.lamsfoundation.lams.tool.assessment.ApplicationResources',
+'lams-tool-laasse10.jar',
+'/org/lamsfoundation/lams/tool/assessment/assessmentApplicationContext.xml',
+NOW(),
+NOW()
+)
Index: lams_tool_assessment/db/sql/updatescripts/updateTo20070227.sql
===================================================================
diff -u
--- lams_tool_assessment/db/sql/updatescripts/updateTo20070227.sql (revision 0)
+++ lams_tool_assessment/db/sql/updatescripts/updateTo20070227.sql (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,4 @@
+-- Update the Assessment tables to 20070227
+-- This is for the LAMS 2.0.1 release.
+
+UPDATE lams_tool set modified_date_time = now(), classpath_addition = 'lams-tool-laasse10.jar', context_file = '/org/lamsfoundation/lams/tool/assessment/assessmentApplicationContext.xml' where tool_signature = 'laasse10';
Index: lams_tool_assessment/db/sql/updatescripts/updateTo20080229.sql
===================================================================
diff -u
--- lams_tool_assessment/db/sql/updatescripts/updateTo20080229.sql (revision 0)
+++ lams_tool_assessment/db/sql/updatescripts/updateTo20080229.sql (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,2 @@
+UPDATE lams_tool SET modified_date_time = NOW() WHERE tool_signature = "laasse10";
+UPDATE lams_tool SET tool_version = "20080229" WHERE tool_signature = "laasse10";
Index: lams_tool_assessment/lib/jaxen/jaxen-full.jar
===================================================================
diff -u
Binary files differ
Index: lams_tool_assessment/lib/jaxen/sax.jar
===================================================================
diff -u
Binary files differ
Index: lams_tool_assessment/lib/jaxen/saxpath.jar
===================================================================
diff -u
Binary files differ
Index: lams_tool_assessment/lib/reload_2_0_1/castor-0.9.5.3-xml.jar
===================================================================
diff -u
Binary files differ
Index: lams_tool_assessment/lib/reload_2_0_1/jdom.jar
===================================================================
diff -u
Binary files differ
Index: lams_tool_assessment/lib/reload_2_0_1/moonunitsrc.jar
===================================================================
diff -u
Binary files differ
Index: lams_tool_assessment/lib/reload_2_0_1/reload-diva.jar
===================================================================
diff -u
Binary files differ
Index: lams_tool_assessment/lib/reload_2_0_1/reload-editor.jar
===================================================================
diff -u
Binary files differ
Index: lams_tool_assessment/lib/reload_2_0_1/reload-jdom.jar
===================================================================
diff -u
Binary files differ
Index: lams_tool_assessment/lib/reload_2_0_1/reload-moonunit.jar
===================================================================
diff -u
Binary files differ
Index: lams_tool_assessment/lib/reload_2_0_1/xercesImpl.jar
===================================================================
diff -u
Binary files differ
Index: lams_tool_assessment/lib/reload_2_0_1/xml-apis.jar
===================================================================
diff -u
Binary files differ
Index: lams_tool_assessment/licenses/Jaxen LICENSE.txt
===================================================================
diff -u
--- lams_tool_assessment/licenses/Jaxen LICENSE.txt (revision 0)
+++ lams_tool_assessment/licenses/Jaxen LICENSE.txt (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,33 @@
+/*
+ $Id$
+
+ Copyright 2003-2006 The Werken Company. All Rights Reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ * Neither the name of the Jaxen Project nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ */
Index: lams_tool_assessment/licenses/castor license.txt
===================================================================
diff -u
--- lams_tool_assessment/licenses/castor license.txt (revision 0)
+++ lams_tool_assessment/licenses/castor license.txt (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,38 @@
+Copyright 2000-2002 (C) Intalio Inc. All Rights Reserved.
+
+Redistribution and use of this software and associated documentation
+("Software"), with or without modification, are permitted provided
+that the following conditions are met:
+
+1. Redistributions of source code must retain copyright statements
+ and notices. Redistributions must also contain a copy of this
+ document.
+
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+3. The name "ExoLab" must not be used to endorse or promote products
+ derived from this Software without prior written permission of
+ Intalio Inc. For written permission, please contact info@exolab.org.
+
+4. Products derived from this Software may not be called "Castor"
+ nor may "Castor" appear in their names without prior written
+ permission of Intalio Inc. Exolab, Castor and Intalio are
+ trademarks of Intalio Inc.
+
+5. Due credit should be given to the ExoLab Project
+ (http://www.exolab.org/).
+
+THIS SOFTWARE IS PROVIDED BY INTALIO AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTALIO OR ITS
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
Index: lams_tool_assessment/licenses/jdom licence.txt
===================================================================
diff -u
--- lams_tool_assessment/licenses/jdom licence.txt (revision 0)
+++ lams_tool_assessment/licenses/jdom licence.txt (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,54 @@
+/*--
+
+ Copyright (C) 2000-2002 Brett McLaughlin & Jason Hunter.
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions, and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions, and the disclaimer that follows
+ these conditions in the documentation and/or other materials
+ provided with the distribution.
+
+ 3. The name "JDOM" must not be used to endorse or promote products
+ derived from this software without prior written permission. For
+ written permission, please contact license@jdom.org.
+
+ 4. Products derived from this software may not be called "JDOM", nor
+ may "JDOM" appear in their name, without prior written permission
+ from the JDOM Project Management (pm@jdom.org).
+
+ In addition, we request (but do not require) that you include in the
+ end-user documentation provided with the redistribution and/or in the
+ software itself an acknowledgement equivalent to the following:
+ "This product includes software developed by the
+ JDOM Project (http://www.jdom.org/)."
+ Alternatively, the acknowledgment may be graphical using the logos
+ available at http://www.jdom.org/images/logos.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE JDOM AUTHORS OR THE PROJECT
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+ This software consists of voluntary contributions made by many
+ individuals on behalf of the JDOM Project and was originally
+ created by Brett McLaughlin and
+ Jason Hunter . For more information on the
+ JDOM Project, please see .
+
+ */
+
Index: lams_tool_assessment/licenses/library_licenses.txt
===================================================================
diff -u
--- lams_tool_assessment/licenses/library_licenses.txt (revision 0)
+++ lams_tool_assessment/licenses/library_licenses.txt (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,28 @@
+Tigra Tree Javascript license description:
+There is no license fee or royalty fee to be paid at any time for using the Tigra Tree Menu v1.x
+You may include the source code or modified source code within your own projects for either personal or commercial use but excluding the restrictions outlined below. The following restrictions apply to all parts of the component, including all source code, samples and documentation.
+
+ * Header block of script file (tree.js) CAN NOT be modified or removed.
+ * The above items CAN NOT be sold as are, either individually or together.
+ * The above items CAN NOT be modified and then sold as a library component, either individually or together.
+
+
+For more detail, http://www.softcomplex.com/products/tigra_tree_menu/docs/
+
+Library/Package License
+
+Used for the IMSCP functionality (Reload Project)
+castor-0.9.5.3-xml.jar Castor License
+jdom.jar Jdom Jar License
+moonunitsrc.jar Reload License
+reload-diva.jar Reload License
+reload-editor.jar Reload License
+reload-jdom.jar Reload License
+reload-moonunit.jar Reload License
+xercesImpl.jar Apache Software License 1.1
+xml-apis.jar Apache Software License 1.1
+
+Other libraries
+jaxen-full.jar Jaxen Jar License (The Werken Company)
+sax.jar Public Domain
+saxpath.jar Jaxen Jar License (The Werken Company)
Index: lams_tool_assessment/licenses/reload licence.txt
===================================================================
diff -u
--- lams_tool_assessment/licenses/reload licence.txt (revision 0)
+++ lams_tool_assessment/licenses/reload licence.txt (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,45 @@
+RELOAD Tools and Libraries
+
+Copyright (c) 2002-2004 Oleg Liber, Bill Olivier, Phillip Beauvoir
+
+This licence covers:
+
+The Reload "jdom" library
+The Reload "diva" library
+The Reload "dweezil" library
+The Reload "jdom" library
+The Reload "moonunit" library
+The Reload "xindice" library
+The Reload Editor
+The Reload SCORM Player
+The Reload Schema Viewer Eclipse Plugin
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Project Management Contact:
+
+Oleg Liber
+Bolton Institute of Higher Education
+Deane Road
+Bolton BL3 5AB
+UK
+
+e-mail: o.liber@bolton.ac.uk
+
+
+Technical Contact:
+
+Phillip Beauvoir
+Bolton Institute of Higher Education
+Deane Road
+Bolton BL3 5AB
+UK
+
+e-mail: p.beauvoir@bolton.ac.uk
+
+
+Web: http://www.reload.ac.uk
Index: lams_tool_assessment/licenses/xerces licence.txt
===================================================================
diff -u
--- lams_tool_assessment/licenses/xerces licence.txt (revision 0)
+++ lams_tool_assessment/licenses/xerces licence.txt (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,56 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ *
+ * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ * if any, must include the following acknowledgment:
+ * "This product includes software developed by the
+ * Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowledgment may appear in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ * not be used to endorse or promote products derived from this
+ * software without prior written permission. For written
+ * permission, please contact apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ * nor may "Apache" appear in their name, without prior written
+ * permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com. For more
+ * information on the Apache Software Foundation, please see
+ * .
+ */
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/AssessmentConstants.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/AssessmentConstants.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/AssessmentConstants.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,191 @@
+/****************************************************************
+ * 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;
+
+public class AssessmentConstants {
+ public static final String TOOL_SIGNATURE = "laasse10";
+
+ public static final String ASSESSMENT_SERVICE = "assessmentService";
+
+ public static final String TOOL_CONTENT_HANDLER_NAME = "assessmentToolContentHandler";
+
+ public static final int COMPLETED = 1;
+
+ public static final int INITIAL_OPTIONS_NUMBER = 3;
+
+ public static final int INITIAL_OVERALL_FEEDBACK_NUMBER = 3;
+
+ // question type;
+ public static final short QUESTION_TYPE_CHOICE = 1;
+
+ public static final short QUESTION_TYPE_MULTIPLE_CHOICE = 2;
+
+ public static final short QUESTION_TYPE_MATCHING_PAIRS = 3;
+
+ public static final short QUESTION_TYPE_FILL_THE_GAP = 4;
+
+ public static final short QUESTION_TYPE_SHORT_ANSWER = 5;
+
+ public static final short QUESTION_TYPE_NUMERICAL = 6;
+
+ public static final short QUESTION_TYPE_TRUE_FALSE = 7;
+
+ public static final short QUESTION_TYPE_ESSAY = 8;
+
+ // for action forward name
+ public static final String SUCCESS = "success";
+
+ public static final String ERROR = "error";
+
+ public static final String DEFINE_LATER = "definelater";
+
+ // for parameters' name
+ public static final String PARAM_TOOL_CONTENT_ID = "toolContentID";
+
+ public static final String PARAM_TOOL_SESSION_ID = "toolSessionID";
+
+ public static final String PARAM_FILE_VERSION_ID = "fileVersionId";
+
+ public static final String PARAM_FILE_UUID = "fileUuid";
+
+ public static final String PARAM_QUESTION_INDEX = "questionIndex";
+
+ public static final String PARAM_QUESTION_UID = "questionUid";
+
+ public static final String PARAM_OPTION_INDEX = "optionIndex";
+
+ public static final String PARAM_RUN_OFFLINE = "runOffline";
+
+ public static final String PARAM_OPEN_URL_POPUP = "popupUrl";
+
+ public static final String PARAM_TITLE = "title";
+
+ // for request attribute name
+ public static final String ATTR_TOOL_CONTENT_ID = "toolContentID";
+
+ public static final String ATTR_TOOL_SESSION_ID = "toolSessionID";
+
+ public static final String ATTR_OPTION_LIST = "optionList";
+
+ public static final String ATTR_OPTION_COUNT = "optionCount";
+
+ public static final String ATTR_OPTION_ANSWER_PREFIX = "optionAnswer";
+
+ public static final String ATTR_OPTION_GRADE_PREFIX = "optionGrade";
+
+ public static final String ATTR_OPTION_FEEDBACK_PREFIX = "optionFeedback";
+
+ public static final String ATTR_OPTION_SEQUENCE_ID_PREFIX = "optionSequenceId";
+
+ public static final String ATTR_QUESTION_TYPE = "questionType";
+
+ public static final String ATTR_QUESTION_LIST = "questionList";
+
+ public static final String ATT_ATTACHMENT_LIST = "instructionAttachmentList";
+
+ public static final String ATTR_DELETED_QUESTION_LIST = "deleteAssessmentList";
+
+ public static final String ATTR_DELETED_ATTACHMENT_LIST = "deletedAttachmmentList";
+
+ public static final String ATTR_DELETED_QUESTION_ATTACHMENT_LIST = "deletedQuestionAttachmmentList";
+
+ public static final String ATTR_OVERALL_FEEDBACK_LIST = "overallFeedbackList";
+
+ public static final String ATTR_OVERALL_FEEDBACK_COUNT = "overallFeedbackCount";
+
+ public static final String ATTR_OVERALL_FEEDBACK_GRADE_BOUNDARY_PREFIX = "overallFeedbackGradeBoundary";
+
+ public static final String ATTR_OVERALL_FEEDBACK_FEEDBACK_PREFIX = "overallFeedbackFeedback";
+
+ public static final String ATTR_OVERALL_FEEDBACK_SEQUENCE_ID_PREFIX = "overallFeedbackSequenceId";
+
+ public static final String ATT_LEARNING_OBJECT = "cpPackage";
+
+ public static final String ATTR_ASSESSMENT = "assessment";
+
+ public static final String ATTR_RUN_AUTO = "runAuto";
+
+ public static final String ATTR_QUESTION_UID = "questionUid";
+
+ public static final String ATTR_NEXT_ACTIVITY_URL = "nextActivityUrl";
+
+ public static final String ATTR_SUMMARY_LIST = "summaryList";
+
+ public static final String ATTR_USER_LIST = "userList";
+
+ public static final String ATTR_FINISH_LOCK = "finishedLock";
+
+ public static final String ATTR_LOCK_ON_FINISH = "lockOnFinish";
+
+ public static final String ATTR_SESSION_MAP_ID = "sessionMapID";
+
+ public static final String ATTR_ASSESSMENT_FORM = "assessmentForm";
+
+ public static final String ATTR_ADD_ASSESSMENT_TYPE = "addType";
+
+ public static final String ATTR_FILE_TYPE_FLAG = "fileTypeFlag";
+
+ public static final String ATTR_TITLE = "title";
+
+ public static final String ATTR_INSTRUCTIONS = "instructions";
+
+ public static final String ATTR_USER_FINISHED = "userFinished";
+
+ // error message keys
+ public static final String ERROR_MSG_QUESTION_NAME_BLANK = "error.question.name.blank";
+
+ public static final String ERROR_MSG_QUESTION_TEXT_BLANK = "error.question.text.blank";
+
+ public static final String ERROR_MSG_DEFAULT_GRADE_WRONG_FORMAT = "error.default.grade.wrong.format";
+
+ public static final String ERROR_MSG_PENALTY_FACTOR_WRONG_FORMAT = "error.penalty.factor.wrong.format";
+
+ public static final String ERROR_MSG_NOT_ENOUGH_OPTIONS = "error.not.enough.options";
+
+ public static final String ERROR_MSG_FILE_BLANK = "error.resource.item.file.blank";
+
+ public static final String ERROR_MSG_INVALID_URL = "error.resource.item.invalid.url";
+
+ public static final String ERROR_MSG_UPLOAD_FAILED = "error.upload.failed";
+
+ public static final String PAGE_EDITABLE = "isPageEditable";
+
+ public static final String MODE_AUTHOR_SESSION = "author_session";
+
+ public static final String ATTR_REFLECTION_ON = "reflectOn";
+
+ public static final String ATTR_REFLECTION_INSTRUCTION = "reflectInstructions";
+
+ public static final String ATTR_REFLECTION_ENTRY = "reflectEntry";
+
+ public static final String ATTR_REFLECT_LIST = "reflectList";
+
+ public static final String ATTR_USER_UID = "userUid";
+
+ public static final String DEFUALT_PROTOCOL_REFIX = "http://";
+
+ public static final String ALLOW_PROTOCOL_REFIX = new String("[http://|https://|ftp://|nntp://]");
+
+ public static final String EVENT_NAME_NOTIFY_TEACHERS_ON_ASSIGMENT_SUBMIT = "notify_teachers_on_assigment_submit";
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/assessmentApplicationContext.xml
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/assessmentApplicationContext.xml (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/assessmentApplicationContext.xml (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,156 @@
+
+
+
+
+
+
+
+
+ org.lamsfoundation.lams.tool.assessment.ApplicationResources
+
+
+
+
+
+
+
+
+
+
+
+ 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/AssessmentOverallFeedback.hbm.xml
+ org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestionVisitLog.hbm.xml
+ org/lamsfoundation/lams/tool/assessment/model/AssessmentAttachment.hbm.xml
+ org/lamsfoundation/lams/tool/assessment/model/AssessmentSession.hbm.xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ false
+
+
+
+ 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
+ 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/AssessmentAttachmentDAO.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/AssessmentAttachmentDAO.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/AssessmentAttachmentDAO.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,28 @@
+/****************************************************************
+ * 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;
+
+public interface AssessmentAttachmentDAO extends DAO {
+
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/AssessmentDAO.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/AssessmentDAO.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/AssessmentDAO.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,36 @@
+/****************************************************************
+ * 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 org.lamsfoundation.lams.tool.assessment.model.Assessment;
+
+public interface AssessmentDAO extends DAO {
+
+ Assessment getByContentId(Long contentId);
+
+ Assessment getByUid(Long assessmentUid);
+
+ void delete(Assessment assessment);
+
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/AssessmentQuestionDAO.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/AssessmentQuestionDAO.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/AssessmentQuestionDAO.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,42 @@
+/****************************************************************
+ * 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 org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestion;
+
+public interface AssessmentQuestionDAO extends DAO {
+
+ /**
+ * Return all assessment questions which is uploaded by author in given assessmentUid.
+ *
+ * @param assessmentUid
+ * @return
+ */
+ List getAuthoringQuestions(Long assessmentUid);
+
+ AssessmentQuestion getByUid(Long assessmentQuestionUid);
+
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/AssessmentQuestionVisitDAO.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/AssessmentQuestionVisitDAO.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/AssessmentQuestionVisitDAO.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -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 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.AssessmentQuestionVisitLog;
+
+public interface AssessmentQuestionVisitDAO extends DAO {
+
+ public AssessmentQuestionVisitLog getAssessmentQuestionLog(Long questionUid, Long userId);
+
+ public int getUserViewLogCount(Long sessionId, Long userUid);
+
+ /**
+ * 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 getAssessmentQuestionLogBySession(Long sessionId, Long questionUid);
+
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/AssessmentSessionDAO.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/AssessmentSessionDAO.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/AssessmentSessionDAO.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,40 @@
+/****************************************************************
+ * 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 org.lamsfoundation.lams.tool.assessment.model.AssessmentSession;
+
+public interface AssessmentSessionDAO extends DAO {
+
+ AssessmentSession getSessionBySessionId(Long sessionId);
+
+ List getByContentId(Long toolContentId);
+
+ void delete(AssessmentSession session);
+
+ void deleteBySessionId(Long toolSessionId);
+
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/AssessmentUserDAO.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/AssessmentUserDAO.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/AssessmentUserDAO.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,37 @@
+/****************************************************************
+ * 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 org.lamsfoundation.lams.tool.assessment.model.AssessmentUser;
+
+public interface AssessmentUserDAO extends DAO {
+
+ AssessmentUser getUserByUserIDAndSessionID(Long userID, Long sessionId);
+
+ AssessmentUser getUserByUserIDAndContentID(Long userId, Long contentId);
+
+ List getBySessionID(Long sessionId);
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/DAO.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/DAO.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/DAO.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,76 @@
+/****************************************************************
+ * 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.io.Serializable;
+import java.util.List;
+
+/**
+ * Data Access Object (DAO) interface. This is an interface used to tag our DAO classes and to provide common methods to
+ * all DAOs.
+ *
+ * @author Andrey Balan
+ */
+public interface DAO {
+
+ /**
+ * Generic method used to get all objects of a particular type. This is the same as lookup up all rows in a table.
+ *
+ * @param clazz
+ * the type of objects (a.k.a. while table) to get data from
+ * @return List of populated objects
+ */
+ public List getObjects(Class clazz);
+
+ /**
+ * Generic method to get an object based on class and identifier. An ObjectRetrievalFailureException Runtime
+ * Exception is thrown if nothing is found.
+ *
+ * @param clazz
+ * model class to lookup
+ * @param id
+ * the identifier (primary key) of the class
+ * @return a populated object
+ * @see org.springframework.orm.ObjectRetrievalFailureException
+ */
+ public Object getObject(Class clazz, Serializable id);
+
+ /**
+ * Generic method to save an object - handles both update and insert.
+ *
+ * @param o
+ * the object to save
+ */
+ public void saveObject(Object o);
+
+ /**
+ * Generic method to delete an object based on class and id
+ *
+ * @param clazz
+ * model class to lookup
+ * @param id
+ * the identifier (primary key) of the class
+ */
+ public void removeObject(Class clazz, Serializable id);
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/hibernate/AssessmentAttachmentDAOHibernate.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/hibernate/AssessmentAttachmentDAOHibernate.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/hibernate/AssessmentAttachmentDAOHibernate.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,30 @@
+/****************************************************************
+ * 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 org.lamsfoundation.lams.tool.assessment.dao.AssessmentAttachmentDAO;
+
+public class AssessmentAttachmentDAOHibernate extends BaseDAOHibernate implements AssessmentAttachmentDAO {
+
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/hibernate/AssessmentDAOHibernate.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/hibernate/AssessmentDAOHibernate.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/hibernate/AssessmentDAOHibernate.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,57 @@
+/****************************************************************
+ * 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.List;
+
+import org.lamsfoundation.lams.tool.assessment.dao.AssessmentDAO;
+import org.lamsfoundation.lams.tool.assessment.model.Assessment;
+
+/**
+ *
+ * @author Andrey Balan
+ *
+ * @version $Revision$
+ */
+public class AssessmentDAOHibernate extends BaseDAOHibernate implements AssessmentDAO {
+ private static final String GET_RESOURCE_BY_CONTENTID = "from " + Assessment.class.getName()
+ + " as r where r.contentId=?";
+
+ public Assessment getByContentId(Long contentId) {
+ List list = getHibernateTemplate().find(GET_RESOURCE_BY_CONTENTID, contentId);
+ if (list.size() > 0)
+ return (Assessment) list.get(0);
+ else
+ return null;
+ }
+
+ public Assessment getByUid(Long assessmentUid) {
+ return (Assessment) getObject(Assessment.class, assessmentUid);
+ }
+
+ public void delete(Assessment assessment) {
+ this.getHibernateTemplate().delete(assessment);
+ }
+
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/hibernate/AssessmentQuestionDAOHibernate.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/hibernate/AssessmentQuestionDAOHibernate.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/hibernate/AssessmentQuestionDAOHibernate.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -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.hibernate;
+
+import java.util.List;
+
+import org.lamsfoundation.lams.tool.assessment.dao.AssessmentQuestionDAO;
+import org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestion;
+
+public class AssessmentQuestionDAOHibernate extends BaseDAOHibernate implements AssessmentQuestionDAO {
+
+ private static final String FIND_AUTHORING_QUESTIONS = "from " + AssessmentQuestion.class.getName()
+ + " where assessment_uid = ? order by create_date asc";
+
+ public List getAuthoringQuestions(Long assessmentUid) {
+
+ return this.getHibernateTemplate().find(FIND_AUTHORING_QUESTIONS, assessmentUid);
+ }
+
+ public AssessmentQuestion getByUid(Long assessmentQuestionUid) {
+ return (AssessmentQuestion) this.getObject(AssessmentQuestion.class, assessmentQuestionUid);
+ }
+
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/hibernate/AssessmentQuestionVisitDAOHibernate.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/hibernate/AssessmentQuestionVisitDAOHibernate.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/hibernate/AssessmentQuestionVisitDAOHibernate.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -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.AssessmentQuestionVisitDAO;
+import org.lamsfoundation.lams.tool.assessment.model.Assessment;
+import org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestionVisitLog;
+import org.lamsfoundation.lams.tool.assessment.model.AssessmentSession;
+
+public class AssessmentQuestionVisitDAOHibernate extends BaseDAOHibernate implements AssessmentQuestionVisitDAO {
+
+ private static final String FIND_BY_QUESTION_AND_USER = "from " + AssessmentQuestionVisitLog.class.getName()
+ + " as r where r.user.userId = ? and r.assessmentQuestion.uid=?";
+
+ private static final String FIND_BY_QUESTION_AND_SESSION = "from " + AssessmentQuestionVisitLog.class.getName()
+ + " as r where r.sessionId = ? and r.assessmentQuestion.uid=?";
+
+ private static final String FIND_VIEW_COUNT_BY_USER = "select count(*) from "
+ + AssessmentQuestionVisitLog.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 "
+ + AssessmentQuestionVisitLog.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 AssessmentQuestionVisitLog getAssessmentQuestionLog(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 (AssessmentQuestionVisitLog) 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
+ *
+ * @author Andrey Balan
+ */
+public class BaseDAOHibernate extends HibernateDaoSupport implements DAO {
+ protected final Log log = LogFactory.getLog(getClass());
+
+ /**
+ * @see com.edgenius.paradise.dao.DAO#saveObject(java.lang.Object)
+ */
+ public void saveObject(Object o) {
+ getHibernateTemplate().saveOrUpdate(o);
+ }
+
+ /**
+ * @see com.edgenius.paradise.dao.DAO#getObject(java.lang.Class, java.io.Serializable)
+ */
+ public Object getObject(Class clazz, Serializable id) {
+ Object o = getHibernateTemplate().get(clazz, id);
+ return o;
+ }
+
+ /**
+ * @see com.edgenius.paradise.dao.DAO#getObjects(java.lang.Class)
+ */
+ public List getObjects(Class clazz) {
+ return getHibernateTemplate().loadAll(clazz);
+ }
+
+ /**
+ * @see com.edgenius.paradise.dao.DAO#removeObject(java.lang.Class, java.io.Serializable)
+ */
+ public void removeObject(Class clazz, Serializable id) {
+ getHibernateTemplate().delete(getObject(clazz, id));
+ }
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dto/ReflectDTO.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dto/ReflectDTO.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dto/ReflectDTO.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,80 @@
+package org.lamsfoundation.lams.tool.assessment.dto;
+
+import org.lamsfoundation.lams.tool.assessment.model.AssessmentUser;
+
+/**
+ *
+ * @author Andrey Balan
+ *
+ */
+public class ReflectDTO {
+ private Long userUid;
+ private String fullName;
+ private String loginName;
+ private boolean hasRefection;
+ private String reflectInstrctions;
+ private boolean finishReflection;
+ private String reflect;
+
+ public ReflectDTO(AssessmentUser user) {
+ this.setLoginName(user.getLoginName());
+ this.setFullName(user.getFirstName() + " " + user.getLastName());
+ this.setUserUid(user.getUid());
+ }
+
+ public boolean isFinishReflection() {
+ return finishReflection;
+ }
+
+ public void setFinishReflection(boolean finishReflection) {
+ this.finishReflection = finishReflection;
+ }
+
+ public String getFullName() {
+ return fullName;
+ }
+
+ public void setFullName(String fullName) {
+ this.fullName = fullName;
+ }
+
+ public boolean isHasRefection() {
+ return hasRefection;
+ }
+
+ public void setHasRefection(boolean hasRefection) {
+ this.hasRefection = hasRefection;
+ }
+
+ public String getLoginName() {
+ return loginName;
+ }
+
+ public void setLoginName(String loginName) {
+ this.loginName = loginName;
+ }
+
+ public String getReflect() {
+ return reflect;
+ }
+
+ public void setReflect(String reflect) {
+ this.reflect = reflect;
+ }
+
+ public String getReflectInstrctions() {
+ return reflectInstrctions;
+ }
+
+ public void setReflectInstrctions(String reflectInstrctions) {
+ this.reflectInstrctions = reflectInstrctions;
+ }
+
+ public Long getUserUid() {
+ return userUid;
+ }
+
+ public void setUserUid(Long userUid) {
+ this.userUid = userUid;
+ }
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dto/Summary.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dto/Summary.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dto/Summary.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,239 @@
+/****************************************************************
+ * 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.dto;
+
+import org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestion;
+import org.lamsfoundation.lams.tool.assessment.util.AssessmentWebUtils;
+
+/**
+ * List contains following element:
+ *
+ *
session_id
session_name
AssessmentQuestion.uid
AssessmentQuestion.question_type
+ * AssessmentQuestion.create_by_author
AssessmentQuestion.is_hide
AssessmentQuestion.title
+ * User.login_name
count(assessment_question_uid)
+ *
+ * @author Andrey Balan
+ */
+public class Summary {
+
+ private Long sessionId;
+ private String sessionName;
+ private Long questionUid;
+ private short questionType;
+ private boolean questionCreateByAuthor;
+ private boolean questionHide;
+ private String questionTitle;
+ private String username;
+ private int viewNumber;
+
+ // following is used for export portfolio programs:
+// private String url;
+// private Long fileUuid;
+// private Long fileVersionId;
+// private String fileName;
+ private String attachmentLocalUrl;
+
+ // true: initial group question, false, belong to some group.
+ private boolean isInitGroup;
+
+ public Summary() {
+ }
+
+ /**
+ * Contruction method for monitoring summary function.
+ *
+ * Don't not set isInitGroup and viewNumber fields
+ *
+ * @param sessionName
+ * @param question
+ * @param isInitGroup
+ */
+ public Summary(Long sessionId, String sessionName, AssessmentQuestion question) {
+ this.sessionId = sessionId;
+ this.sessionName = sessionName;
+ if (question != null) {
+ this.questionUid = question.getUid();
+ this.questionType = question.getType();
+ this.questionCreateByAuthor = question.isCreateByAuthor();
+ this.questionHide = question.isHide();
+ this.questionTitle = question.getTitle();
+ this.username = question.getCreateBy() == null ? "" : question.getCreateBy().getLoginName();
+// this.url = AssessmentWebUtils.protocol(question.getUrl());
+// this.fileName = question.getFileName();
+// this.fileUuid = question.getFileUuid();
+// this.fileVersionId = question.getFileVersionId();
+ } else
+ this.questionUid = new Long(-1);
+ }
+
+ /**
+ * Contruction method for export profolio function.
+ *
+ * Don't not set sessionId and viewNumber fields
+ *
+ * @param sessionName
+ * @param question
+ * @param isInitGroup
+ */
+ public Summary(Long sessionId, String sessionName, AssessmentQuestion question, boolean isInitGroup) {
+ this.sessionId = sessionId;
+ this.sessionName = sessionName;
+ if (question != null) {
+ this.questionUid = question.getUid();
+ this.questionType = question.getType();
+ this.questionCreateByAuthor = question.isCreateByAuthor();
+ this.questionHide = question.isHide();
+ this.questionTitle = question.getTitle();
+ this.username = question.getCreateBy() == null ? "" : question.getCreateBy().getLoginName();
+// this.url = AssessmentWebUtils.protocol(question.getUrl());
+// this.fileName = question.getFileName();
+// this.fileUuid = question.getFileUuid();
+// this.fileVersionId = question.getFileVersionId();
+ } else
+ this.questionUid = new Long(-1);
+ this.isInitGroup = isInitGroup;
+ }
+
+ public boolean isQuestionCreateByAuthor() {
+ return questionCreateByAuthor;
+ }
+
+ public void setQuestionCreateByAuthor(boolean questionCreateByAuthor) {
+ this.questionCreateByAuthor = questionCreateByAuthor;
+ }
+
+ public boolean isQuestionHide() {
+ return questionHide;
+ }
+
+ public void setQuestionHide(boolean questionHide) {
+ this.questionHide = questionHide;
+ }
+
+ public String getQuestionTitle() {
+ return questionTitle;
+ }
+
+ public void setQuestionTitle(String questionTitle) {
+ this.questionTitle = questionTitle;
+ }
+
+ public short getQuestionType() {
+ return questionType;
+ }
+
+ public void setQuestionType(short questionType) {
+ this.questionType = questionType;
+ }
+
+ public Long getQuestionUid() {
+ return questionUid;
+ }
+
+ public void setQuestionUid(Long questionUid) {
+ this.questionUid = questionUid;
+ }
+
+ public Long getSessionId() {
+ return sessionId;
+ }
+
+ public void setSessionId(Long sessionId) {
+ this.sessionId = sessionId;
+ }
+
+ public String getSessionName() {
+ return sessionName;
+ }
+
+ public void setSessionName(String sessionName) {
+ this.sessionName = sessionName;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public int getViewNumber() {
+ return viewNumber;
+ }
+
+ public void setViewNumber(int viewNumber) {
+ this.viewNumber = viewNumber;
+ }
+
+// public Long getFileUuid() {
+// return fileUuid;
+// }
+//
+// public void setFileUuid(Long fileUuid) {
+// this.fileUuid = fileUuid;
+// }
+//
+// public Long getFileVersionId() {
+// return fileVersionId;
+// }
+//
+// public void setFileVersionId(Long fileVersionId) {
+// this.fileVersionId = fileVersionId;
+// }
+//
+// public String getUrl() {
+// return url;
+// }
+//
+// public void setUrl(String url) {
+// this.url = url;
+// }
+
+ public boolean isInitGroup() {
+ return isInitGroup;
+ }
+
+ public void setInitGroup(boolean isInitGroup) {
+ this.isInitGroup = isInitGroup;
+ }
+
+ public String getAttachmentLocalUrl() {
+ return attachmentLocalUrl;
+ }
+
+ public void setAttachmentLocalUrl(String attachmentLocalUrl) {
+ this.attachmentLocalUrl = attachmentLocalUrl;
+ }
+
+// public String getFileName() {
+// return fileName;
+// }
+//
+// public void setFileName(String fileName) {
+// this.fileName = fileName;
+// }
+
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/Assessment.hbm.xml
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/Assessment.hbm.xml (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/Assessment.hbm.xml (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,274 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/Assessment.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/Assessment.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/Assessment.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,654 @@
+/****************************************************************
+ * 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.model;
+
+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 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;
+
+/**
+ * Assessment
+ *
+ * @author Andrey Balan
+ *
+ * @hibernate.class table="tl_laasse10_assessment"
+ *
+ */
+public class Assessment implements Cloneable {
+
+ private static final Logger log = Logger.getLogger(Assessment.class);
+
+ // key
+ private Long uid;
+
+ // tool contentID
+ private Long contentId;
+
+ private String title;
+
+ private String instructions;
+
+ // advance
+ private int timeLimit;
+
+ private int questionsPerPage;
+
+ private int attemptsAllowed;
+
+ private boolean runOffline;
+
+ private boolean shuffled;
+
+ private boolean allowQuestionFeedback;
+
+ private boolean allowOverallFeedbackAfterQuestion;
+
+ private boolean allowRightWrongAnswersAfterQuestion;
+
+ private boolean allowGradesAfterAttempt;
+
+ private boolean defineLater;
+
+ private boolean contentInUse;
+
+ private boolean notifyTeachersOnAttemptCompletion;
+
+ // instructions
+ private String onlineInstructions;
+
+ private String offlineInstructions;
+
+ private Set attachments;
+
+ // general infomation
+ private Date created;
+
+ private Date updated;
+
+ private AssessmentUser createdBy;
+
+ // assessment questions
+ private Set questions;
+
+ private Set overallFeedbacks;
+
+ private boolean reflectOnActivity;
+
+ private String reflectInstructions;
+
+ // *************** NON Persist Fields ********************
+ private IToolContentHandler toolContentHandler;
+
+ private List onlineFileList;
+
+ private List offlineFileList;
+
+ /**
+ * Default contruction method.
+ *
+ */
+ public Assessment() {
+ attachments = new HashSet();
+ questions = new HashSet();
+ overallFeedbacks = new HashSet();
+ }
+
+ // **********************************************************
+ // Function method for Assessment
+ // **********************************************************
+ public static Assessment newInstance(Assessment defaultContent, Long contentId,
+ AssessmentToolContentHandler assessmentToolContentHandler) {
+ Assessment toContent = new Assessment();
+ defaultContent.toolContentHandler = assessmentToolContentHandler;
+ toContent = (Assessment) defaultContent.clone();
+ toContent.setContentId(contentId);
+
+ // reset user info as well
+ if (toContent.getCreatedBy() != null) {
+ toContent.getCreatedBy().setAssessment(toContent);
+ Set questions = toContent.getQuestions();
+ for (AssessmentQuestion question : questions) {
+ question.setCreateBy(toContent.getCreatedBy());
+ }
+ }
+ return toContent;
+ }
+
+ @Override
+ public Object clone() {
+
+ Assessment assessment = null;
+ try {
+ assessment = (Assessment) super.clone();
+ assessment.setUid(null);
+ if (questions != null) {
+ Iterator iter = questions.iterator();
+ Set set = new HashSet();
+ while (iter.hasNext()) {
+ AssessmentQuestion question = (AssessmentQuestion) iter.next();
+ AssessmentQuestion newQuestion = (AssessmentQuestion) question.clone();
+ // just clone old file without duplicate it in repository
+ set.add(newQuestion);
+ }
+ assessment.questions = set;
+ }
+ // clone OverallFeedbacks
+ if (overallFeedbacks != null) {
+ Iterator iter = overallFeedbacks.iterator();
+ Set set = new HashSet();
+ while (iter.hasNext()) {
+ AssessmentOverallFeedback overallFeedback = (AssessmentOverallFeedback) iter.next();
+ AssessmentOverallFeedback newOverallFeedback = (AssessmentOverallFeedback) overallFeedback.clone();
+ // just clone old file without duplicate it in repository
+ set.add(newOverallFeedback);
+ }
+ assessment.overallFeedbacks = set;
+ }
+ // clone attachment
+ if (attachments != null) {
+ Iterator iter = attachments.iterator();
+ Set set = new HashSet();
+ while (iter.hasNext()) {
+ AssessmentAttachment file = (AssessmentAttachment) iter.next();
+ AssessmentAttachment newFile = (AssessmentAttachment) file.clone();
+ // just clone old file without duplicate it in repository
+
+ set.add(newFile);
+ }
+ assessment.attachments = set;
+ }
+ // clone ReourceUser as well
+ if (createdBy != null) {
+ assessment.setCreatedBy((AssessmentUser) createdBy.clone());
+ }
+ } catch (CloneNotSupportedException e) {
+ Assessment.log.error("When clone " + Assessment.class + " failed");
+ }
+
+ return assessment;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof Assessment)) {
+ return false;
+ }
+
+ final Assessment genericEntity = (Assessment) o;
+
+ return new EqualsBuilder().append(uid, genericEntity.uid).append(title, genericEntity.title).append(
+ instructions, genericEntity.instructions).append(onlineInstructions, genericEntity.onlineInstructions)
+ .append(offlineInstructions, genericEntity.offlineInstructions).append(created, genericEntity.created)
+ .append(updated, genericEntity.updated).append(createdBy, genericEntity.createdBy).isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(uid).append(title).append(instructions).append(onlineInstructions).append(
+ offlineInstructions).append(created).append(updated).append(createdBy).toHashCode();
+ }
+
+ /**
+ * Updates the modification data for this entity.
+ */
+ public void updateModificationData() {
+
+ long now = System.currentTimeMillis();
+ if (created == null) {
+ this.setCreated(new Date(now));
+ }
+ this.setUpdated(new Date(now));
+ }
+
+ public void toDTO() {
+ onlineFileList = new ArrayList();
+ offlineFileList = new ArrayList();
+ Set fileSet = this.getAttachments();
+ if (fileSet != null) {
+ for (AssessmentAttachment file : fileSet) {
+ if (StringUtils.equalsIgnoreCase(file.getFileType(), IToolContentHandler.TYPE_OFFLINE)) {
+ offlineFileList.add(file);
+ } else {
+ onlineFileList.add(file);
+ }
+ }
+ }
+ }
+
+ // **********************************************************
+ // get/set methods
+ // **********************************************************
+ /**
+ * Returns the object's creation date
+ *
+ * @return date
+ * @hibernate.property column="create_date"
+ */
+ public Date getCreated() {
+ return created;
+ }
+
+ /**
+ * Sets the object's creation date
+ *
+ * @param created
+ */
+ public void setCreated(Date created) {
+ this.created = created;
+ }
+
+ /**
+ * Returns the object's date of last update
+ *
+ * @return date updated
+ * @hibernate.property column="update_date"
+ */
+ public Date getUpdated() {
+ return updated;
+ }
+
+ /**
+ * Sets the object's date of last update
+ *
+ * @param updated
+ */
+ public void setUpdated(Date updated) {
+ this.updated = updated;
+ }
+
+ /**
+ * @return Returns the userid of the user who created the Share assessment.
+ *
+ * @hibernate.many-to-one cascade="save-update" column="create_by"
+ *
+ */
+ public AssessmentUser getCreatedBy() {
+ return createdBy;
+ }
+
+ /**
+ * @param createdBy
+ * The userid of the user who created this Share assessment.
+ */
+ public void setCreatedBy(AssessmentUser createdBy) {
+ this.createdBy = createdBy;
+ }
+
+ /**
+ * @hibernate.id column="uid" generator-class="native"
+ */
+ public Long getUid() {
+ return uid;
+ }
+
+ public void setUid(Long uid) {
+ this.uid = uid;
+ }
+
+ /**
+ * @return Returns the title.
+ *
+ * @hibernate.property column="title"
+ *
+ */
+ public String getTitle() {
+ return title;
+ }
+
+ /**
+ * @param title
+ * The title to set.
+ */
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ /**
+ * @return Returns the runOffline.
+ *
+ * @hibernate.property column="run_offline"
+ *
+ */
+ public boolean getRunOffline() {
+ return runOffline;
+ }
+
+ /**
+ * @param runOffline
+ * The forceOffLine to set.
+ *
+ *
+ */
+ public void setRunOffline(boolean forceOffline) {
+ runOffline = forceOffline;
+ }
+
+ /**
+ * @return Returns the time limitation, that students have to complete an attempt.
+ *
+ * @hibernate.property column="time_limit"
+ *
+ */
+ public int getTimeLimit() {
+ return timeLimit;
+ }
+
+ /**
+ * @param timeLimit
+ * the time limitation, that students have to complete an attempt.
+ */
+ public void setTimeLimit(int timeLimit) {
+ this.timeLimit = timeLimit;
+ }
+
+ /**
+ * @return Returns the instructions set by the teacher.
+ *
+ * @hibernate.property column="instructions" type="text"
+ */
+ public String getInstructions() {
+ return instructions;
+ }
+
+ public void setInstructions(String instructions) {
+ this.instructions = instructions;
+ }
+
+ /**
+ * @return Returns the onlineInstructions set by the teacher.
+ *
+ * @hibernate.property column="online_instructions" type="text"
+ */
+ public String getOnlineInstructions() {
+ return onlineInstructions;
+ }
+
+ public void setOnlineInstructions(String onlineInstructions) {
+ this.onlineInstructions = onlineInstructions;
+ }
+
+ /**
+ * @return Returns the onlineInstructions set by the teacher.
+ *
+ * @hibernate.property column="offline_instructions" type="text"
+ */
+ public String getOfflineInstructions() {
+ return offlineInstructions;
+ }
+
+ public void setOfflineInstructions(String offlineInstructions) {
+ this.offlineInstructions = offlineInstructions;
+ }
+
+ /**
+ *
+ * @hibernate.set lazy="true" cascade="all" inverse="false" order-by="create_date desc"
+ * @hibernate.collection-key column="assessment_uid"
+ * @hibernate.collection-one-to-many class="org.lamsfoundation.lams.tool.assessment.model.AssessmentAttachment"
+ *
+ * @return a set of Attachments to this Message.
+ */
+ public Set getAttachments() {
+ return attachments;
+ }
+
+ /*
+ * @param attachments The attachments to set.
+ */
+ public void setAttachments(Set attachments) {
+ this.attachments = attachments;
+ }
+
+ /**
+ *
+ * @hibernate.set lazy="true" inverse="false" cascade="all" order-by="create_date desc"
+ * @hibernate.collection-key column="assessment_uid"
+ * @hibernate.collection-one-to-many class="org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestion"
+ *
+ * @return
+ */
+ public Set getQuestions() {
+ return questions;
+ }
+
+ public void setQuestions(Set assessmentQuestions) {
+ this.questions = assessmentQuestions;
+ }
+
+ /**
+ *
+ * @hibernate.set lazy="true" inverse="false" cascade="all" order-by="create_date desc"
+ * @hibernate.collection-key column="assessment_uid"
+ * @hibernate.collection-one-to-many class="org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestion"
+ *
+ * @return
+ */
+
+ /**
+ *
+ * @hibernate.set cascade="all" order-by="sequence_id asc"
+ * @hibernate.collection-key column="assessment_uid"
+ * @hibernate.collection-one-to-many class="org.lamsfoundation.lams.tool.assessment.model.AssessmentOverallFeedback"
+ *
+ * @return a set of OverallFeedbacks for this Assessment.
+ */
+ public Set getOverallFeedbacks() {
+ return overallFeedbacks;
+ }
+
+ public void setOverallFeedbacks(Set assessmentOverallFeedbacks) {
+ this.overallFeedbacks = assessmentOverallFeedbacks;
+ }
+
+ /**
+ * @hibernate.property column="content_in_use"
+ * @return
+ */
+ public boolean isContentInUse() {
+ return contentInUse;
+ }
+
+ public void setContentInUse(boolean contentInUse) {
+ this.contentInUse = contentInUse;
+ }
+
+ /**
+ * @hibernate.property column="define_later"
+ * @return
+ */
+ public boolean isDefineLater() {
+ return defineLater;
+ }
+
+ public void setDefineLater(boolean defineLater) {
+ this.defineLater = defineLater;
+ }
+
+ /**
+ * @hibernate.property column="content_id" unique="true"
+ * @return
+ */
+ public Long getContentId() {
+ return contentId;
+ }
+
+ public void setContentId(Long contentId) {
+ this.contentId = contentId;
+ }
+
+ /**
+ * @hibernate.property column="allow_question_feedback"
+ * @return
+ */
+ public boolean isAllowQuestionFeedback() {
+ return allowQuestionFeedback;
+ }
+
+ public void setAllowQuestionFeedback(boolean allowQuestionFeedback) {
+ this.allowQuestionFeedback = allowQuestionFeedback;
+ }
+
+ /**
+ * @hibernate.property column="allow_overall_feedback"
+ * @return
+ */
+ public boolean isAllowOverallFeedbackAfterQuestion() {
+ return allowOverallFeedbackAfterQuestion;
+ }
+
+ public void setAllowOverallFeedbackAfterQuestion(boolean allowOverallFeedbackAfterQuestion) {
+ this.allowOverallFeedbackAfterQuestion = allowOverallFeedbackAfterQuestion;
+ }
+
+ /**
+ * @hibernate.property column="allow_right_wrong_answers"
+ * @return
+ */
+ public boolean isAllowRightWrongAnswersAfterQuestion() {
+ return allowRightWrongAnswersAfterQuestion;
+ }
+
+ public void setAllowRightWrongAnswersAfterQuestion(boolean allowRightWrongAnswersAfterQuestion) {
+ this.allowRightWrongAnswersAfterQuestion = allowRightWrongAnswersAfterQuestion;
+ }
+
+ /**
+ * @hibernate.property column="allow_grades_after_attempt"
+ * @return
+ */
+ public boolean isAllowGradesAfterAttempt() {
+ return allowGradesAfterAttempt;
+ }
+
+ public void setAllowGradesAfterAttempt(boolean allowGradesAfterAttempt) {
+ this.allowGradesAfterAttempt = allowGradesAfterAttempt;
+ }
+
+ /**
+ * @hibernate.property column="questions_per_page"
+ * @return
+ */
+ public int getQuestionsPerPage() {
+ return questionsPerPage;
+ }
+
+ public void setQuestionsPerPage(int questionsPerPage) {
+ this.questionsPerPage = questionsPerPage;
+ }
+
+ /**
+ * number of allow students attempts
+ *
+ * @hibernate.property column="attempts_allowed"
+ * @return
+ */
+ public int getAttemptsAllowed() {
+ return attemptsAllowed;
+ }
+
+ public void setAttemptsAllowed(int attemptsAllowed) {
+ this.attemptsAllowed = attemptsAllowed;
+ }
+
+ /**
+ * @hibernate.property column="shuffled"
+ * @return
+ */
+ public boolean isShuffled() {
+ return shuffled;
+ }
+
+ public void setShuffled(boolean shuffled) {
+ this.shuffled = shuffled;
+ }
+
+ public List getOfflineFileList() {
+ return offlineFileList;
+ }
+
+ public void setOfflineFileList(List offlineFileList) {
+ this.offlineFileList = offlineFileList;
+ }
+
+ public List getOnlineFileList() {
+ return onlineFileList;
+ }
+
+ public void setOnlineFileList(List onlineFileList) {
+ this.onlineFileList = onlineFileList;
+ }
+
+ public void setToolContentHandler(IToolContentHandler toolContentHandler) {
+ this.toolContentHandler = toolContentHandler;
+ }
+
+ /**
+ * @hibernate.property column="reflect_instructions"
+ * @return
+ */
+ public String getReflectInstructions() {
+ return reflectInstructions;
+ }
+
+ public void setReflectInstructions(String reflectInstructions) {
+ this.reflectInstructions = reflectInstructions;
+ }
+
+ /**
+ * @hibernate.property column="reflect_on_activity"
+ * @return
+ */
+ public boolean isReflectOnActivity() {
+ return reflectOnActivity;
+ }
+
+ public void setReflectOnActivity(boolean reflectOnActivity) {
+ this.reflectOnActivity = reflectOnActivity;
+ }
+
+ /**
+ * @hibernate.property column="attempt_completion_notify"
+ * @return
+ */
+ public boolean isNotifyTeachersOnAttemptCompletion() {
+ return notifyTeachersOnAttemptCompletion;
+ }
+
+ public void setNotifyTeachersOnAttemptCompletion(boolean notifyTeachersOnAttemptCompletion) {
+ this.notifyTeachersOnAttemptCompletion = notifyTeachersOnAttemptCompletion;
+ }
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentAnswerOption.hbm.xml
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentAnswerOption.hbm.xml (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentAnswerOption.hbm.xml (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,92 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentAnswerOption.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentAnswerOption.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentAnswerOption.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,189 @@
+/****************************************************************
+ * 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;
+
+/**
+ * AssessmentAnswerOption
+ *
+ * @author Andrey Balan
+ *
+ * @hibernate.class table="tl_laasse10_answer_options"
+ */
+public class AssessmentAnswerOption implements Cloneable {
+ private static final Logger log = Logger.getLogger(AssessmentAnswerOption.class);
+
+ private Long uid;
+
+ private Integer sequenceId;
+
+ private String question;
+
+ private String answerString;
+
+ private Long answerLong;
+
+ private Long acceptedError;
+
+ private float grade;
+
+ private String feedback;
+
+ // **********************************************************
+ // 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 image sequence number.
+ *
+ * @return image sequence number
+ *
+ * @hibernate.property column="sequence_id"
+ */
+ public int getSequenceId() {
+ return sequenceId;
+ }
+
+ /**
+ * Sets image sequence number.
+ *
+ * @param sequenceId
+ * image 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="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_long"
+ *
+ * @return Returns the possible numeric answer.
+ */
+ public Long getAnswerLong() {
+ return answerLong;
+ }
+
+ public void setAnswerLong(Long answerLong) {
+ this.answerLong = answerLong;
+ }
+
+ /**
+ * @hibernate.property column="accepted_error"
+ *
+ * @return Returns the possible answer.
+ */
+ public Long getAcceptedError() {
+ return acceptedError;
+ }
+
+ public void setAcceptedError(Long 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;
+ }
+
+ @Override
+ public Object clone() {
+ AssessmentAnswerOption obj = null;
+ try {
+ obj = (AssessmentAnswerOption) super.clone();
+ obj.setUid(null);
+ } catch (CloneNotSupportedException e) {
+ AssessmentAnswerOption.log.error("When clone " + AssessmentAnswerOption.class + " failed");
+ }
+
+ return obj;
+ }
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentAttachment.hbm.xml
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentAttachment.hbm.xml (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentAttachment.hbm.xml (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentAttachment.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentAttachment.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentAttachment.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,159 @@
+/****************************************************************
+ * 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.model;
+
+import java.util.Date;
+
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.log4j.Logger;
+
+/**
+ * @author Andrey Balan
+ *
+ * A Wrapper class for uploaded files. An Attachment cannot exist independently and must belong to a Assessment.
+ *
+ * @hibernate.class table="tl_laasse10_attachment"
+ *
+ */
+public class AssessmentAttachment implements Cloneable {
+ private static final Logger log = Logger.getLogger(AssessmentAttachment.class);
+
+ private Long uid;
+ private Long fileUuid;
+ private Long fileVersionId;
+ private String fileType;
+ private String fileName;
+ private Date created;
+
+ // Default contruction method
+ public AssessmentAttachment() {
+
+ }
+
+ // **********************************************************
+ // Function method for Attachment
+ // **********************************************************
+ public Object clone() {
+ Object obj = null;
+ try {
+ obj = super.clone();
+ ((AssessmentAttachment) obj).setUid(null);
+ } catch (CloneNotSupportedException e) {
+ log.error("When clone " + AssessmentAttachment.class + " failed");
+ }
+
+ return obj;
+ }
+
+ public boolean equals(Object o) {
+ if (this == o)
+ return true;
+ if (!(o instanceof AssessmentAttachment))
+ return false;
+
+ final AssessmentAttachment genericEntity = (AssessmentAttachment) o;
+
+ return new EqualsBuilder().append(this.uid, genericEntity.uid).append(this.fileVersionId,
+ genericEntity.fileVersionId).append(this.fileName, genericEntity.fileName).append(this.fileType,
+ genericEntity.fileType).append(this.created, genericEntity.created).isEquals();
+ }
+
+ public int hashCode() {
+ return new HashCodeBuilder().append(uid).append(fileVersionId).append(fileName).append(fileType)
+ .append(created).toHashCode();
+ }
+
+ // **********************************************************
+ // get/set methods
+ // **********************************************************
+ /**
+ * @hibernate.id column="uid" generator-class="native"
+ */
+ public Long getUid() {
+ return uid;
+ }
+
+ public void setUid(Long uid) {
+ this.uid = uid;
+ }
+
+ /**
+ * @hibernate.property column="file_version_id"
+ *
+ */
+ public Long getFileVersionId() {
+ return fileVersionId;
+ }
+
+ public void setFileVersionId(Long version) {
+ this.fileVersionId = version;
+ }
+
+ /**
+ * @hibernate.property column="file_type"
+ */
+ public String getFileType() {
+ return fileType;
+ }
+
+ public void setFileType(String type) {
+ this.fileType = type;
+ }
+
+ /**
+ * @hibernate.property column="file_name"
+ */
+ public String getFileName() {
+ return fileName;
+ }
+
+ public void setFileName(String name) {
+ this.fileName = name;
+ }
+
+ /**
+ * @hibernate.property column="file_uuid"
+ * @return
+ */
+ public Long getFileUuid() {
+ return fileUuid;
+ }
+
+ public void setFileUuid(Long uuid) {
+ this.fileUuid = uuid;
+ }
+
+ /**
+ * @hibernate.property column="create_date"
+ * @return
+ */
+ public Date getCreated() {
+ return created;
+ }
+
+ public void setCreated(Date created) {
+ this.created = created;
+ }
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentOverallFeedback.hbm.xml
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentOverallFeedback.hbm.xml (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentOverallFeedback.hbm.xml (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentOverallFeedback.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentOverallFeedback.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentOverallFeedback.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,123 @@
+/****************************************************************
+ * 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;
+
+/**
+ * AssessmentOverallFeedback
+ *
+ * @author Andrey Balan
+ *
+ * @hibernate.class table="tl_laasse10_assessment_overall_feedback"
+ */
+public class AssessmentOverallFeedback implements Cloneable {
+ private static final Logger log = Logger.getLogger(AssessmentOverallFeedback.class);
+
+ private Long uid;
+
+ private Integer sequenceId;
+
+ private Integer gradeBoundary;
+
+ private String feedback;
+
+ // **********************************************************
+ // 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 image sequence number.
+ *
+ * @return image sequence number
+ *
+ * @hibernate.property column="sequence_id"
+ */
+ public int getSequenceId() {
+ return sequenceId;
+ }
+
+ /**
+ * Sets image sequence number.
+ *
+ * @param sequenceId
+ * image sequence number
+ */
+ public void setSequenceId(int sequenceId) {
+ this.sequenceId = sequenceId;
+ }
+
+ /**
+ * @hibernate.property column="grade_boundary"
+ *
+ * @return Returns grade Boundary.
+ */
+ public Integer getGradeBoundary() {
+ return gradeBoundary;
+ }
+
+ public void setGradeBoundary(Integer gradeBoundary) {
+ this.gradeBoundary = gradeBoundary;
+ }
+
+ /**
+ * @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;
+ }
+
+ @Override
+ public Object clone() {
+ AssessmentOverallFeedback obj = null;
+ try {
+ obj = (AssessmentOverallFeedback) super.clone();
+ obj.setUid(null);
+ } catch (CloneNotSupportedException e) {
+ AssessmentOverallFeedback.log.error("When clone " + AssessmentOverallFeedback.class + " failed");
+ }
+
+ return obj;
+ }
+}
+
+
\ No newline at end of file
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestion.hbm.xml
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestion.hbm.xml (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestion.hbm.xml (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,186 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestion.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestion.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestion.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,381 @@
+/****************************************************************
+ * 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.model;
+
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Assessment Question
+ *
+ * @author Andrey Balan
+ *
+ * @hibernate.class table="tl_laasse10_assessment_question"
+ *
+ */
+public class AssessmentQuestion implements Cloneable {
+ 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;
+
+ private String question;
+
+ private int sequenceId;
+
+ private int defaultGrade;
+
+ private float penaltyFactor;
+
+ private String generalFeedback;
+
+ private String feedbackOnCorrect;
+
+ private String feedbackOnPartiallyCorrect;
+
+ private String feedbackOnIncorrect;
+
+ private boolean shuffle;
+
+ private boolean caseSensitive;
+
+ private boolean hide;
+ private boolean isCreateByAuthor;
+
+ private Date createDate;
+ private AssessmentUser createBy;
+
+ // ***********************************************
+ // Non persistant fields:
+
+ private Set answerOptions;
+
+ private Set units;
+
+ // DTO fields:
+ private boolean complete;
+
+ public AssessmentQuestion() {
+ answerOptions = new HashSet();
+ units = new HashSet();
+ }
+
+ public Object clone() {
+ AssessmentQuestion obj = null;
+ try {
+ obj = (AssessmentQuestion) super.clone();
+ ((AssessmentQuestion) obj).setUid(null);
+
+ // clone answerOptions
+ if (answerOptions != null) {
+ Iterator iter = answerOptions.iterator();
+ Set set = new HashSet();
+ while (iter.hasNext()) {
+ AssessmentAnswerOption answerOption = (AssessmentAnswerOption) iter.next();
+ AssessmentAttachment newAnswerOption = (AssessmentAttachment) answerOption.clone();
+ set.add(newAnswerOption);
+ }
+ obj.answerOptions = set;
+ }
+
+ // clone units
+ if (units != null) {
+ Iterator iter = units.iterator();
+ Set set = new HashSet();
+ //TODO!!
+// while (iter.hasNext()) {
+// AssessmentAnswerOption answerOption = (AssessmentAnswerOption) iter.next();
+// AssessmentAttachment newAnswerOption = (AssessmentAttachment) answerOption.clone();
+// set.add(newAnswerOption);
+// }
+ obj.units = set;
+ }
+
+ // clone AssessmentUser as well
+ if (this.createBy != null) {
+ ((AssessmentQuestion) obj).setCreateBy((AssessmentUser) this.createBy.clone());
+ }
+ } catch (CloneNotSupportedException e) {
+ log.error("When clone " + AssessmentQuestion.class + " failed");
+ }
+
+ return obj;
+ }
+
+ // **********************************************************
+ // Get/Set methods
+ // **********************************************************
+ /**
+ * @hibernate.id generator-class="native" type="java.lang.Long" column="uid"
+ * @return Returns the uid.
+ */
+ public Long getUid() {
+ return uid;
+ }
+
+ /**
+ * @param uid
+ * The uid to set.
+ */
+ public void setUid(Long userID) {
+ this.uid = userID;
+ }
+
+ /**
+ * @hibernate.property column="question_type"
+ * @return
+ */
+ public short getType() {
+ return type;
+ }
+
+ public void setType(short type) {
+ this.type = type;
+ }
+
+ /**
+ * @hibernate.property column="title" length="255"
+ * @return
+ */
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ /**
+ * @hibernate.property column="question" type="text"
+ * @return
+ */
+ public String getQuestion() {
+ return question;
+ }
+
+ public void setQuestion(String question) {
+ this.question = question;
+ }
+
+ /**
+ * Returns image sequence number.
+ *
+ * @return image sequence number
+ *
+ * @hibernate.property column="sequence_id"
+ */
+ public int getSequenceId() {
+ return sequenceId;
+ }
+
+ /**
+ * Sets image sequence number.
+ *
+ * @param sequenceId
+ * image sequence number
+ */
+ public void setSequenceId(int sequenceId) {
+ this.sequenceId = sequenceId;
+ }
+
+ /**
+ * @hibernate.property column="default_grade"
+ *
+ * @return
+ */
+ public int getDefaultGrade() {
+ return defaultGrade;
+ }
+
+ public void setDefaultGrade(int defaultGrade) {
+ this.defaultGrade = defaultGrade;
+ }
+
+ /**
+ * @hibernate.property column="penalty_factor"
+ * @return
+ */
+ public float getPenaltyFactor() {
+ return penaltyFactor;
+ }
+
+ public void setPenaltyFactor(float penaltyFactor) {
+ this.penaltyFactor = penaltyFactor;
+ }
+
+ /**
+ * @hibernate.property column="general_feedback" type="text"
+ * @return
+ */
+ public String getGeneralFeedback() {
+ return generalFeedback;
+ }
+
+ public void setGeneralFeedback(String generalFeedback) {
+ this.generalFeedback = generalFeedback;
+ }
+
+ /**
+ * @hibernate.property column="feedback_on_correct" type="text"
+ * @return
+ */
+ public String getFeedbackOnCorrect() {
+ return feedbackOnCorrect;
+ }
+
+ public void setFeedbackOnCorrect(String feedbackOnCorrect) {
+ this.feedbackOnCorrect = feedbackOnCorrect;
+ }
+
+ /**
+ * @hibernate.property column="feedback_on_partially_correct" type="text"
+ * @return
+ */
+ public String getFeedbackOnPartiallyCorrect() {
+ return feedbackOnPartiallyCorrect;
+ }
+
+ public void setFeedbackOnPartiallyCorrect(String feedbackOnPartiallyCorrect) {
+ this.feedbackOnPartiallyCorrect = feedbackOnPartiallyCorrect;
+ }
+
+ /**
+ * @hibernate.property column="feedback_on_incorrect" type="text"
+ * @return
+ */
+ public String getFeedbackOnIncorrect() {
+ return feedbackOnIncorrect;
+ }
+
+ public void setFeedbackOnIncorrect(String feedbackOnIncorrect) {
+ this.feedbackOnIncorrect = feedbackOnIncorrect;
+ }
+
+ /**
+ * @hibernate.property column="shuffle"
+ * @return
+ */
+ public boolean isShuffle() {
+ return shuffle;
+ }
+
+ public void setShuffle(boolean shuffle) {
+ this.shuffle = shuffle;
+ }
+
+ /**
+ * @hibernate.property column="case_sensitive"
+ * @return
+ */
+ public boolean isCaseSensitive() {
+ return caseSensitive;
+ }
+
+ public void setCaseSensitive(boolean caseSensitive) {
+ this.caseSensitive = caseSensitive;
+ }
+
+ /**
+ * @hibernate.property column="hide"
+ * @return
+ */
+ public boolean isHide() {
+ return hide;
+ }
+
+ public void setHide(boolean hide) {
+ this.hide = hide;
+ }
+
+ /**
+ * @hibernate.property column="create_by_author"
+ * @return
+ */
+ public boolean isCreateByAuthor() {
+ return isCreateByAuthor;
+ }
+
+ public void setCreateByAuthor(boolean isCreateByAuthor) {
+ this.isCreateByAuthor = isCreateByAuthor;
+ }
+
+ /**
+ * @hibernate.property column="create_date"
+ * @return
+ */
+ public Date getCreateDate() {
+ return createDate;
+ }
+
+ public void setCreateDate(Date createDate) {
+ this.createDate = createDate;
+ }
+
+ /**
+ * @hibernate.many-to-one cascade="none" column="create_by"
+ *
+ * @return
+ */
+ public AssessmentUser getCreateBy() {
+ return createBy;
+ }
+
+ public void setCreateBy(AssessmentUser createBy) {
+ this.createBy = createBy;
+ }
+
+ /**
+ *
+ * @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"
+ *
+ * @return a set of answerOptions to this AssessmentQuestion.
+ */
+ public Set getAnswerOptions() {
+ return answerOptions;
+ }
+
+ /**
+ * @param answerOptions answerOptions to set.
+ */
+ public void setAnswerOptions(Set answerOptions) {
+ this.answerOptions = answerOptions;
+ }
+
+ public void setComplete(boolean complete) {
+ this.complete = complete;
+ }
+
+ public boolean isComplete() {
+ return complete;
+ }
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestionVisitLog.hbm.xml
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestionVisitLog.hbm.xml (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestionVisitLog.hbm.xml (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestionVisitLog.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestionVisitLog.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentQuestionVisitLog.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,118 @@
+/****************************************************************
+ * 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;
+
+/**
+ * Assessment
+ *
+ * @author Andrey Balan
+ *
+ * @hibernate.class table="tl_laasse10_question_log"
+ *
+ */
+public class AssessmentQuestionVisitLog {
+
+ private Long uid;
+ private AssessmentUser user;
+ private AssessmentQuestion assessmentQuestion;
+ private boolean complete;
+ private Date accessDate;
+ private Long sessionId;
+
+ /**
+ * @hibernate.property column="access_date"
+ * @return
+ */
+ public Date getAccessDate() {
+ return accessDate;
+ }
+
+ public void setAccessDate(Date accessDate) {
+ this.accessDate = accessDate;
+ }
+
+ /**
+ * @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.id generator-class="native" type="java.lang.Long" column="uid"
+ * @return Returns the log 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.property column="complete"
+ * @return
+ */
+ public boolean isComplete() {
+ return complete;
+ }
+
+ public void setComplete(boolean complete) {
+ this.complete = complete;
+ }
+
+ /**
+ * @hibernate.property column="session_id"
+ * @return
+ */
+ public Long getSessionId() {
+ return sessionId;
+ }
+
+ public void setSessionId(Long sessionId) {
+ this.sessionId = sessionId;
+ }
+
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentSession.hbm.xml
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentSession.hbm.xml (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentSession.hbm.xml (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,107 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentSession.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentSession.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentSession.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,164 @@
+/****************************************************************
+ * 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.model;
+
+import java.util.Date;
+import java.util.Set;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Assessment session
+ *
+ * @author Andrey Balan
+ *
+ * @hibernate.class table="tl_laasse10_session"
+ *
+ */
+public class AssessmentSession {
+
+ private static Logger log = Logger.getLogger(AssessmentSession.class);
+
+ private Long uid;
+ private Long sessionId;
+ private String sessionName;
+ private Assessment assessment;
+ private Date sessionStartDate;
+ private Date sessionEndDate;
+ // finish or not
+ private int status;
+ // assessment Questions
+ private Set assessmentQuestions;
+
+ // **********************************************************
+ // Get/Set methods
+ // **********************************************************
+ /**
+ * @hibernate.id generator-class="native" type="java.lang.Long" column="uid"
+ * @return Returns the learnerID.
+ */
+ public Long getUid() {
+ return uid;
+ }
+
+ public void setUid(Long uuid) {
+ this.uid = uuid;
+ }
+
+ /**
+ * @hibernate.property column="session_end_date"
+ * @return
+ */
+ public Date getSessionEndDate() {
+ return sessionEndDate;
+ }
+
+ public void setSessionEndDate(Date sessionEndDate) {
+ this.sessionEndDate = sessionEndDate;
+ }
+
+ /**
+ * @hibernate.property column="session_start_date"
+ *
+ * @return
+ */
+ public Date getSessionStartDate() {
+ return sessionStartDate;
+ }
+
+ public void setSessionStartDate(Date sessionStartDate) {
+ this.sessionStartDate = sessionStartDate;
+ }
+
+ /**
+ * @hibernate.property
+ * @return
+ */
+ public int getStatus() {
+ return status;
+ }
+
+ public void setStatus(int status) {
+ this.status = status;
+ }
+
+ /**
+ * @hibernate.many-to-one column="assessment_uid" cascade="none"
+ * @return
+ */
+ public Assessment getAssessment() {
+ return assessment;
+ }
+
+ public void setAssessment(Assessment assessment) {
+ this.assessment = assessment;
+ }
+
+ /**
+ * @hibernate.property column="session_id"
+ * @return
+ */
+ public Long getSessionId() {
+ return sessionId;
+ }
+
+ public void setSessionId(Long sessionId) {
+ this.sessionId = sessionId;
+ }
+
+ /**
+ * @hibernate.property column="session_name" length="250"
+ * @return Returns the session name
+ */
+ public String getSessionName() {
+ return sessionName;
+ }
+
+ /**
+ *
+ * @param sessionName
+ * The session name to set.
+ */
+ public void setSessionName(String sessionName) {
+ this.sessionName = sessionName;
+ }
+
+ /**
+ *
+ *
+ * @hibernate.set lazy="true" inverse="false" cascade="all" order-by="create_date desc"
+ * @hibernate.collection-key column="session_uid"
+ * @hibernate.collection-one-to-many class="org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestion"
+ *
+ * @return
+ */
+ public Set getAssessmentQuestions() {
+ return assessmentQuestions;
+ }
+
+ public void setAssessmentQuestions(Set assessmentQuestions) {
+ this.assessmentQuestions = assessmentQuestions;
+ }
+
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentUser.hbm.xml
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentUser.hbm.xml (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentUser.hbm.xml (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentUser.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentUser.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/model/AssessmentUser.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,232 @@
+/****************************************************************
+ * 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.model;
+
+import java.util.Date;
+
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.log4j.Logger;
+import org.lamsfoundation.lams.usermanagement.dto.UserDTO;
+
+/**
+ * Assessment User
+ *
+ * @author Andrey Balan
+ *
+ * @hibernate.class table="tl_laasse10_user"
+ *
+ */
+public class AssessmentUser implements Cloneable {
+ private static final long serialVersionUID = -7043502180037866257L;
+ private static Logger log = Logger.getLogger(AssessmentUser.class);
+
+ private Long uid;
+ private Long userId;
+ private String firstName;
+ private String lastName;
+ private String loginName;
+ private boolean sessionFinished;
+
+ private AssessmentSession session;
+ private Assessment assessment;
+
+ // =============== NON Persisit value: for display use ===========
+ // the user access some reousrce question date time. Use in monitoring summary page
+ private Date accessDate;
+
+ public AssessmentUser() {
+ }
+
+ public AssessmentUser(UserDTO user, AssessmentSession session) {
+ this.userId = new Long(user.getUserID().intValue());
+ this.firstName = user.getFirstName();
+ this.lastName = user.getLastName();
+ this.loginName = user.getLogin();
+ this.session = session;
+ this.assessment = null;
+ this.sessionFinished = false;
+ }
+
+ public AssessmentUser(UserDTO user, Assessment content) {
+ this.userId = new Long(user.getUserID().intValue());
+ this.firstName = user.getFirstName();
+ this.lastName = user.getLastName();
+ this.loginName = user.getLogin();
+ this.session = null;
+ this.assessment = content;
+ this.sessionFinished = false;
+ }
+
+ /**
+ * Clone method from java.lang.Object
+ */
+ public Object clone() {
+
+ AssessmentUser user = null;
+ try {
+ user = (AssessmentUser) super.clone();
+ user.setUid(null);
+ // never clone session
+ user.setSession(null);
+ } catch (CloneNotSupportedException e) {
+ log.error("When clone " + AssessmentUser.class + " failed");
+ }
+
+ return user;
+ }
+
+ // **********************************************************
+ // Get/Set methods
+ // **********************************************************
+ /**
+ * @hibernate.id generator-class="native" type="java.lang.Long" column="uid"
+ * @return Returns the uid.
+ */
+ public Long getUid() {
+ return uid;
+ }
+
+ /**
+ * @param uid
+ * The uid to set.
+ */
+ public void setUid(Long userID) {
+ this.uid = userID;
+ }
+
+ /**
+ * @hibernate.property column="user_id" length="20"
+ * @return Returns the userId.
+ */
+ public Long getUserId() {
+ return userId;
+ }
+
+ /**
+ * @param userId
+ * The userId to set.
+ */
+ public void setUserId(Long userID) {
+ this.userId = userID;
+ }
+
+ /**
+ * @hibernate.property length="255" column="last_name"
+ * @return
+ */
+ public String getLastName() {
+ return lastName;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+ /**
+ * @hibernate.property length="255" column="first_name"
+ * @return
+ */
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ /**
+ * @hibernate.property column="login_name"
+ * @return
+ */
+ public String getLoginName() {
+ return loginName;
+ }
+
+ public void setLoginName(String loginName) {
+ this.loginName = loginName;
+ }
+
+ /**
+ * @hibernate.many-to-one column="session_uid" cascade="none"
+ * @return
+ */
+ public AssessmentSession getSession() {
+ return session;
+ }
+
+ public void setSession(AssessmentSession session) {
+ this.session = session;
+ }
+
+ /**
+ * @hibernate.many-to-one column="assessment_uid" cascade="none"
+ * @return
+ */
+ public Assessment getAssessment() {
+ return assessment;
+ }
+
+ public void setAssessment(Assessment content) {
+ this.assessment = content;
+ }
+
+ /**
+ * @hibernate.property column="session_finished"
+ * @return
+ */
+ public boolean isSessionFinished() {
+ return sessionFinished;
+ }
+
+ public void setSessionFinished(boolean sessionFinished) {
+ this.sessionFinished = sessionFinished;
+ }
+
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (!(obj instanceof AssessmentUser))
+ return false;
+
+ final AssessmentUser user = (AssessmentUser) obj;
+
+ return new EqualsBuilder().append(this.uid, user.uid).append(this.firstName, user.firstName).append(
+ this.lastName, user.lastName).append(this.loginName, user.loginName).isEquals();
+
+ }
+
+ public int hashCode() {
+ return new HashCodeBuilder().append(uid).append(firstName).append(lastName).append(loginName).toHashCode();
+ }
+
+ public Date getAccessDate() {
+ return accessDate;
+ }
+
+ public void setAccessDate(Date accessDate) {
+ this.accessDate = accessDate;
+ }
+
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentApplicationException.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentApplicationException.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentApplicationException.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -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 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.service;
+
+public class AssessmentApplicationException extends Exception {
+
+ public AssessmentApplicationException() {
+ super();
+
+ }
+
+ public AssessmentApplicationException(String message, Throwable cause) {
+ super(message, cause);
+
+ }
+
+ public AssessmentApplicationException(String message) {
+ super(message);
+
+ }
+
+ public AssessmentApplicationException(Throwable cause) {
+ super(cause);
+
+ }
+
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,1026 @@
+/****************************************************************
+ * 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.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.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.lang.StringUtils;
+import org.apache.log4j.Logger;
+import org.apache.struts.upload.FormFile;
+import org.lamsfoundation.lams.contentrepository.AccessDeniedException;
+import org.lamsfoundation.lams.contentrepository.ICredentials;
+import org.lamsfoundation.lams.contentrepository.ITicket;
+import org.lamsfoundation.lams.contentrepository.IVersionedNode;
+import org.lamsfoundation.lams.contentrepository.InvalidParameterException;
+import org.lamsfoundation.lams.contentrepository.LoginException;
+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;
+import org.lamsfoundation.lams.learning.service.ILearnerService;
+import org.lamsfoundation.lams.learningdesign.service.ExportToolContentException;
+import org.lamsfoundation.lams.learningdesign.service.IExportToolContentService;
+import org.lamsfoundation.lams.learningdesign.service.ImportToolContentException;
+import org.lamsfoundation.lams.lesson.service.ILessonService;
+import org.lamsfoundation.lams.notebook.model.NotebookEntry;
+import org.lamsfoundation.lams.notebook.service.CoreNotebookConstants;
+import org.lamsfoundation.lams.notebook.service.ICoreNotebookService;
+import org.lamsfoundation.lams.tool.ToolContentImport102Manager;
+import org.lamsfoundation.lams.tool.ToolContentManager;
+import org.lamsfoundation.lams.tool.ToolOutput;
+import org.lamsfoundation.lams.tool.ToolOutputDefinition;
+import org.lamsfoundation.lams.tool.ToolSessionExportOutputData;
+import org.lamsfoundation.lams.tool.ToolSessionManager;
+import org.lamsfoundation.lams.tool.assessment.AssessmentConstants;
+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.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.AssessmentAttachment;
+import org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestion;
+import org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestionVisitLog;
+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.exception.DataMissingException;
+import org.lamsfoundation.lams.tool.exception.SessionDataExistsException;
+import org.lamsfoundation.lams.tool.exception.ToolException;
+import org.lamsfoundation.lams.tool.service.ILamsToolService;
+import org.lamsfoundation.lams.usermanagement.User;
+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;
+
+/**
+ *
+ * @author Andrey Balan
+ *
+ */
+public class AssessmentServiceImpl implements IAssessmentService, ToolContentManager, ToolSessionManager,
+ ToolContentImport102Manager {
+ static Logger log = Logger.getLogger(AssessmentServiceImpl.class.getName());
+
+ private AssessmentDAO assessmentDao;
+
+ private AssessmentQuestionDAO assessmentQuestionDao;
+
+ private AssessmentAttachmentDAO assessmentAttachmentDao;
+
+ private AssessmentUserDAO assessmentUserDao;
+
+ private AssessmentSessionDAO assessmentSessionDao;
+
+ private AssessmentQuestionVisitDAO assessmentQuestionVisitDao;
+
+ // tool service
+ private AssessmentToolContentHandler assessmentToolContentHandler;
+
+ private MessageService messageService;
+
+ // system services
+ private IRepositoryService repositoryService;
+
+ private ILamsToolService toolService;
+
+ private ILearnerService learnerService;
+
+ private IAuditService auditService;
+
+ private IUserManagementService userManagementService;
+
+ private IExportToolContentService exportContentService;
+
+ private ICoreNotebookService coreNotebookService;
+
+ private IEventNotificationService eventNotificationService;
+
+ private ILessonService lessonService;
+
+ // *******************************************************************************
+ // Service method
+ // *******************************************************************************
+ /**
+ * Try to get the file. If forceLogin = false and an access denied exception occurs, call this method again to get a
+ * new ticket and retry file lookup. If forceLogin = true and it then fails then throw exception.
+ *
+ * @param uuid
+ * @param versionId
+ * @param relativePath
+ * @param attemptCount
+ * @return file node
+ */
+ private IVersionedNode getFile(Long uuid, Long versionId, String relativePath)
+ throws AssessmentApplicationException {
+
+ ITicket tic = getRepositoryLoginTicket();
+
+ try {
+
+ return repositoryService.getFileItem(tic, uuid, versionId, relativePath);
+
+ } catch (AccessDeniedException e) {
+
+ String error = "Unable to access repository to get file uuid " + uuid + " version id " + versionId
+ + " path " + relativePath + ".";
+
+ error = error + "AccessDeniedException: " + e.getMessage() + " Unable to retry further.";
+ AssessmentServiceImpl.log.error(error);
+ throw new AssessmentApplicationException(error, e);
+
+ } catch (Exception e) {
+
+ String error = "Unable to access repository to get file uuid " + uuid + " version id " + versionId
+ + " path " + relativePath + "." + " Exception: " + e.getMessage();
+ AssessmentServiceImpl.log.error(error);
+ throw new AssessmentApplicationException(error, e);
+
+ }
+ }
+
+ /**
+ * This method verifies the credentials of the Assessment Tool and gives it the Ticket to login and
+ * access the Content Repository.
+ *
+ * A valid ticket is needed in order to access the content from the repository. This method would be called evertime
+ * the tool needs to upload/download files from the content repository.
+ *
+ * @return ITicket The ticket for repostory access
+ * @throws AssessmentApplicationException
+ */
+ private ITicket getRepositoryLoginTicket() throws AssessmentApplicationException {
+ ICredentials credentials = new SimpleCredentials(assessmentToolContentHandler.getRepositoryUser(),
+ assessmentToolContentHandler.getRepositoryId());
+ try {
+ ITicket ticket = repositoryService.login(credentials, assessmentToolContentHandler
+ .getRepositoryWorkspaceName());
+ return ticket;
+ } catch (AccessDeniedException ae) {
+ throw new AssessmentApplicationException("Access Denied to repository." + ae.getMessage());
+ } catch (WorkspaceNotFoundException we) {
+ throw new AssessmentApplicationException("Workspace not found." + we.getMessage());
+ } catch (LoginException e) {
+ throw new AssessmentApplicationException("Login failed." + e.getMessage());
+ }
+ }
+
+ public Assessment getAssessmentByContentId(Long contentId) {
+ Assessment rs = assessmentDao.getByContentId(contentId);
+ if (rs == null) {
+ AssessmentServiceImpl.log.error("Could not find the content by given ID:" + contentId);
+ }
+ return rs;
+ }
+
+ public Assessment getDefaultContent(Long contentId) throws AssessmentApplicationException {
+ if (contentId == null) {
+ String error = messageService.getMessage("error.msg.default.content.not.find");
+ AssessmentServiceImpl.log.error(error);
+ throw new AssessmentApplicationException(error);
+ }
+
+ Assessment defaultContent = getDefaultAssessment();
+ // save default content by given ID.
+ Assessment content = new Assessment();
+ content = Assessment.newInstance(defaultContent, contentId, assessmentToolContentHandler);
+ return content;
+ }
+
+ public List getAuthoredQuestions(Long assessmentUid) {
+ return assessmentQuestionDao.getAuthoringQuestions(assessmentUid);
+ }
+
+ public AssessmentAttachment uploadInstructionFile(FormFile uploadFile, String fileType)
+ throws UploadAssessmentFileException {
+ if (uploadFile == null || StringUtils.isEmpty(uploadFile.getFileName())) {
+ throw new UploadAssessmentFileException(messageService.getMessage("error.msg.upload.file.not.found",
+ new Object[] { uploadFile }));
+ }
+
+ // upload file to repository
+ NodeKey nodeKey = processFile(uploadFile, fileType);
+
+ // create new attachement
+ AssessmentAttachment file = new AssessmentAttachment();
+ file.setFileType(fileType);
+ file.setFileUuid(nodeKey.getUuid());
+ file.setFileVersionId(nodeKey.getVersion());
+ file.setFileName(uploadFile.getFileName());
+ file.setCreated(new Date());
+
+ return file;
+ }
+
+ public void createUser(AssessmentUser assessmentUser) {
+ assessmentUserDao.saveObject(assessmentUser);
+ }
+
+ public AssessmentUser getUserByIDAndContent(Long userId, Long contentId) {
+
+ return assessmentUserDao.getUserByUserIDAndContentID(userId, contentId);
+
+ }
+
+ public AssessmentUser getUserByIDAndSession(Long userId, Long sessionId) {
+
+ return assessmentUserDao.getUserByUserIDAndSessionID(userId, sessionId);
+
+ }
+
+ public void deleteFromRepository(Long fileUuid, Long fileVersionId) throws AssessmentApplicationException {
+ ITicket ticket = getRepositoryLoginTicket();
+ try {
+ repositoryService.deleteVersion(ticket, fileUuid, fileVersionId);
+ } catch (Exception e) {
+ throw new AssessmentApplicationException("Exception occured while deleting files from" + " the repository "
+ + e.getMessage());
+ }
+ }
+
+ public void saveOrUpdateAssessment(Assessment assessment) {
+ assessmentDao.saveObject(assessment);
+ }
+
+ public void deleteAssessmentAttachment(Long attachmentUid) {
+ assessmentAttachmentDao.removeObject(AssessmentAttachment.class, attachmentUid);
+
+ }
+
+ public void saveOrUpdateAssessmentQuestion(AssessmentQuestion question) {
+ assessmentQuestionDao.saveObject(question);
+ }
+
+ public void deleteAssessmentQuestion(Long uid) {
+ assessmentQuestionDao.removeObject(AssessmentQuestion.class, uid);
+ }
+
+ public List getAssessmentQuestionsBySessionId(Long sessionId) {
+ AssessmentSession session = assessmentSessionDao.getSessionBySessionId(sessionId);
+ if (session == null) {
+ AssessmentServiceImpl.log.error("Failed get AssessmentSession by ID [" + sessionId + "]");
+ return null;
+ }
+ // add assessment questions from Authoring
+ Assessment assessment = session.getAssessment();
+ List questions = new ArrayList();
+ questions.addAll(assessment.getQuestions());
+
+ // add assessment questions from AssessmentSession
+ questions.addAll(session.getAssessmentQuestions());
+
+ return questions;
+ }
+
+ public List exportBySessionId(Long sessionId, boolean skipHide) {
+ AssessmentSession session = assessmentSessionDao.getSessionBySessionId(sessionId);
+ if (session == null) {
+ AssessmentServiceImpl.log.error("Failed get AssessmentSession by ID [" + sessionId + "]");
+ return null;
+ }
+ // initial assessment questions list
+ List questionList = new ArrayList();
+ Set resList = session.getAssessment().getQuestions();
+ for (AssessmentQuestion question : resList) {
+ if (skipHide && question.isHide()) {
+ continue;
+ }
+ // if question is create by author
+ if (question.isCreateByAuthor()) {
+ Summary sum = new Summary(session.getSessionId(), session.getSessionName(), question, false);
+ questionList.add(sum);
+ }
+ }
+
+ // get this session's all assessment questions
+ Set sessList = session.getAssessmentQuestions();
+ for (AssessmentQuestion question : sessList) {
+ if (skipHide && question.isHide()) {
+ continue;
+ }
+
+ // to skip all question create by author
+ if (!question.isCreateByAuthor()) {
+ Summary sum = new Summary(session.getSessionId(), session.getSessionName(), question, false);
+ questionList.add(sum);
+ }
+ }
+
+ return questionList;
+ }
+
+ public List> exportByContentId(Long contentId) {
+ Assessment assessment = assessmentDao.getByContentId(contentId);
+ List> groupList = new ArrayList();
+
+ // create init assessment questions list
+ List initList = new ArrayList();
+ groupList.add(initList);
+ Set resList = assessment.getQuestions();
+ for (AssessmentQuestion question : resList) {
+ if (question.isCreateByAuthor()) {
+ Summary sum = new Summary(null, null, question, true);
+ initList.add(sum);
+ }
+ }
+
+ // session by session
+ List sessionList = assessmentSessionDao.getByContentId(contentId);
+ for (AssessmentSession session : sessionList) {
+ List group = new ArrayList();
+ // get this session's all assessment questions
+ Set sessList = session.getAssessmentQuestions();
+ for (AssessmentQuestion question : sessList) {
+ // to skip all question create by author
+ if (!question.isCreateByAuthor()) {
+ Summary sum = new Summary(session.getSessionId(), session.getSessionName(), question, false);
+ group.add(sum);
+ }
+ }
+ if (group.size() == 0) {
+ group.add(new Summary(session.getSessionId(), session.getSessionName(), null, false));
+ }
+ groupList.add(group);
+ }
+
+ return groupList;
+ }
+
+ public Assessment getAssessmentBySessionId(Long sessionId) {
+ AssessmentSession session = assessmentSessionDao.getSessionBySessionId(sessionId);
+ // to skip CGLib problem
+ Long contentId = session.getAssessment().getContentId();
+ Assessment res = assessmentDao.getByContentId(contentId);
+ return res;
+ }
+
+ public AssessmentSession getAssessmentSessionBySessionId(Long sessionId) {
+ return assessmentSessionDao.getSessionBySessionId(sessionId);
+ }
+
+ public void saveOrUpdateAssessmentSession(AssessmentSession resSession) {
+ assessmentSessionDao.saveObject(resSession);
+ }
+
+ public void retrieveComplete(SortedSet assessmentQuestionList, AssessmentUser user) {
+ for (AssessmentQuestion question : assessmentQuestionList) {
+ AssessmentQuestionVisitLog log = assessmentQuestionVisitDao.getAssessmentQuestionLog(question.getUid(),
+ user.getUserId());
+ if (log == null) {
+ question.setComplete(false);
+ } else {
+ question.setComplete(log.isComplete());
+ }
+ }
+ }
+
+ public void setQuestionComplete(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);
+ AssessmentUser user = assessmentUserDao.getUserByUserIDAndSessionID(userId, sessionId);
+ log.setUser(user);
+ log.setSessionId(sessionId);
+ log.setAccessDate(new Timestamp(new Date().getTime()));
+ }
+ 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);
+ 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);
+ }
+ }
+
+ public String finishToolSession(Long toolSessionId, Long userId) throws AssessmentApplicationException {
+ AssessmentUser user = assessmentUserDao.getUserByUserIDAndSessionID(userId, toolSessionId);
+ user.setSessionFinished(true);
+ assessmentUserDao.saveObject(user);
+
+ // AssessmentSession session = assessmentSessionDao.getSessionBySessionId(toolSessionId);
+ // session.setStatus(AssessmentConstants.COMPLETED);
+ // assessmentSessionDao.saveObject(session);
+
+ String nextUrl = null;
+ try {
+ nextUrl = this.leaveToolSession(toolSessionId, userId);
+ } catch (DataMissingException e) {
+ throw new AssessmentApplicationException(e);
+ } catch (ToolException e) {
+ throw new AssessmentApplicationException(e);
+ }
+ return nextUrl;
+ }
+
+ public AssessmentQuestion getAssessmentQuestionByUid(Long questionUid) {
+ return assessmentQuestionDao.getByUid(questionUid);
+ }
+
+ public List> getSummary(Long contentId) {
+ List> groupList = new ArrayList>();
+ List group = new ArrayList();
+
+ // get all question which is accessed by user
+ Map visitCountMap = assessmentQuestionVisitDao.getSummary(contentId);
+
+ Assessment assessment = assessmentDao.getByContentId(contentId);
+ Set resQuestionList = assessment.getQuestions();
+
+ // get all sessions in a assessment and retrieve all assessment questions under this session
+ // plus initial assessment questions by author creating (resquestionList)
+ List sessionList = assessmentSessionDao.getByContentId(contentId);
+ for (AssessmentSession session : sessionList) {
+ // one new group for one session.
+ group = new ArrayList();
+ // firstly, put all initial assessment question into this group.
+ for (AssessmentQuestion question : resQuestionList) {
+ Summary sum = new Summary(session.getSessionId(), session.getSessionName(), question);
+ // set viewNumber according visit log
+ if (visitCountMap.containsKey(question.getUid())) {
+ sum.setViewNumber(visitCountMap.get(question.getUid()).intValue());
+ }
+ group.add(sum);
+ }
+ // get this session's all assessment questions
+ Set sessQuestionList = session.getAssessmentQuestions();
+ for (AssessmentQuestion question : sessQuestionList) {
+ // to skip all question create by author
+ if (!question.isCreateByAuthor()) {
+ Summary sum = new Summary(session.getSessionId(), session.getSessionName(), question);
+ // set viewNumber according visit log
+ if (visitCountMap.containsKey(question.getUid())) {
+ sum.setViewNumber(visitCountMap.get(question.getUid()).intValue());
+ }
+ group.add(sum);
+ }
+ }
+ // so far no any question available, so just put session name info to Summary
+ if (group.size() == 0) {
+ group.add(new Summary(session.getSessionId(), session.getSessionName(), null));
+ }
+ groupList.add(group);
+ }
+
+ return groupList;
+
+ }
+
+ public Map> getReflectList(Long contentId, boolean setEntry) {
+ Map> map = new HashMap>();
+
+ List sessionList = assessmentSessionDao.getByContentId(contentId);
+ for (AssessmentSession session : sessionList) {
+ Long sessionId = session.getSessionId();
+ boolean hasRefection = session.getAssessment().isReflectOnActivity();
+ Set list = new TreeSet(new ReflectDTOComparator());
+ // get all users in this session
+ List users = assessmentUserDao.getBySessionID(sessionId);
+ for (AssessmentUser user : users) {
+ ReflectDTO ref = new ReflectDTO(user);
+
+ if (setEntry) {
+ NotebookEntry entry = getEntry(sessionId, CoreNotebookConstants.NOTEBOOK_TOOL,
+ AssessmentConstants.TOOL_SIGNATURE, user.getUserId().intValue());
+ if (entry != null) {
+ ref.setReflect(entry.getEntry());
+ }
+ }
+
+ ref.setHasRefection(hasRefection);
+ list.add(ref);
+ }
+ map.put(sessionId, list);
+ }
+
+ return map;
+ }
+
+ public List getUserListBySessionQuestion(Long sessionId, Long questionUid) {
+ List logList = assessmentQuestionVisitDao.getAssessmentQuestionLogBySession(
+ sessionId, questionUid);
+ List userList = new ArrayList(logList.size());
+ for (AssessmentQuestionVisitLog visit : logList) {
+ AssessmentUser user = visit.getUser();
+ user.setAccessDate(visit.getAccessDate());
+ userList.add(user);
+ }
+ return userList;
+ }
+
+ public void setQuestionVisible(Long questionUid, boolean visible) {
+ AssessmentQuestion question = assessmentQuestionDao.getByUid(questionUid);
+ if (question != null) {
+ // createBy should be null for system default value.
+ Long userId = 0L;
+ String loginName = "No user";
+ if (question.getCreateBy() != null) {
+ userId = question.getCreateBy().getUserId();
+ loginName = question.getCreateBy().getLoginName();
+ }
+ if (visible) {
+ auditService.logShowEntry(AssessmentConstants.TOOL_SIGNATURE, userId, loginName, question.toString());
+ } else {
+ auditService.logHideEntry(AssessmentConstants.TOOL_SIGNATURE, userId, loginName, question.toString());
+ }
+ question.setHide(!visible);
+ assessmentQuestionDao.saveObject(question);
+ }
+ }
+
+ public Long createNotebookEntry(Long sessionId, Integer notebookToolType, String toolSignature, Integer userId,
+ String entryText) {
+ return coreNotebookService.createNotebookEntry(sessionId, notebookToolType, toolSignature, userId, "",
+ entryText);
+ }
+
+ public NotebookEntry getEntry(Long sessionId, Integer idType, String signature, Integer userID) {
+ List list = coreNotebookService.getEntry(sessionId, idType, signature, userID);
+ if (list == null || list.isEmpty()) {
+ return null;
+ } else {
+ return list.get(0);
+ }
+ }
+
+ /**
+ * @param notebookEntry
+ */
+ public void updateEntry(NotebookEntry notebookEntry) {
+ coreNotebookService.updateEntry(notebookEntry);
+ }
+
+ public AssessmentUser getUser(Long uid) {
+ return (AssessmentUser) assessmentUserDao.getObject(AssessmentUser.class, uid);
+ }
+
+ // *****************************************************************************
+ // private methods
+ // *****************************************************************************
+ private Assessment getDefaultAssessment() throws AssessmentApplicationException {
+ Long defaultAssessmentId = getToolDefaultContentIdBySignature(AssessmentConstants.TOOL_SIGNATURE);
+ Assessment defaultAssessment = getAssessmentByContentId(defaultAssessmentId);
+ if (defaultAssessment == null) {
+ String error = messageService.getMessage("error.msg.default.content.not.find");
+ AssessmentServiceImpl.log.error(error);
+ throw new AssessmentApplicationException(error);
+ }
+
+ return defaultAssessment;
+ }
+
+ private Long getToolDefaultContentIdBySignature(String toolSignature) throws AssessmentApplicationException {
+ Long contentId = null;
+ contentId = new Long(toolService.getToolDefaultContentIdBySignature(toolSignature));
+ if (contentId == null) {
+ String error = messageService.getMessage("error.msg.default.content.not.find");
+ AssessmentServiceImpl.log.error(error);
+ throw new AssessmentApplicationException(error);
+ }
+ return contentId;
+ }
+
+ /**
+ * Process an uploaded file.
+ *
+ * @throws AssessmentApplicationException
+ * @throws FileNotFoundException
+ * @throws IOException
+ * @throws RepositoryCheckedException
+ * @throws InvalidParameterException
+ */
+ private NodeKey processFile(FormFile file, String fileType) throws UploadAssessmentFileException {
+ NodeKey node = null;
+ if (file != null && !StringUtils.isEmpty(file.getFileName())) {
+ String fileName = file.getFileName();
+ try {
+ node = assessmentToolContentHandler.uploadFile(file.getInputStream(), fileName, file.getContentType(),
+ fileType);
+ } catch (InvalidParameterException e) {
+ throw new UploadAssessmentFileException(messageService.getMessage("error.msg.invaid.param.upload"));
+ } catch (FileNotFoundException e) {
+ throw new UploadAssessmentFileException(messageService.getMessage("error.msg.file.not.found"));
+ } catch (RepositoryCheckedException e) {
+ throw new UploadAssessmentFileException(messageService.getMessage("error.msg.repository"));
+ } catch (IOException e) {
+ throw new UploadAssessmentFileException(messageService.getMessage("error.msg.io.exception"));
+ }
+ }
+ return node;
+ }
+
+ // *****************************************************************************
+ // set methods for Spring Bean
+ // *****************************************************************************
+ public void setAuditService(IAuditService auditService) {
+ this.auditService = auditService;
+ }
+
+ public void setLearnerService(ILearnerService learnerService) {
+ this.learnerService = learnerService;
+ }
+
+ public void setMessageService(MessageService messageService) {
+ this.messageService = messageService;
+ }
+
+ public void setRepositoryService(IRepositoryService repositoryService) {
+ this.repositoryService = repositoryService;
+ }
+
+ public void setAssessmentAttachmentDao(AssessmentAttachmentDAO assessmentAttachmentDao) {
+ this.assessmentAttachmentDao = assessmentAttachmentDao;
+ }
+
+ public void setAssessmentDao(AssessmentDAO assessmentDao) {
+ this.assessmentDao = assessmentDao;
+ }
+
+ public void setAssessmentQuestionDao(AssessmentQuestionDAO assessmentQuestionDao) {
+ this.assessmentQuestionDao = assessmentQuestionDao;
+ }
+
+ public void setAssessmentSessionDao(AssessmentSessionDAO assessmentSessionDao) {
+ this.assessmentSessionDao = assessmentSessionDao;
+ }
+
+ public void setAssessmentToolContentHandler(AssessmentToolContentHandler assessmentToolContentHandler) {
+ this.assessmentToolContentHandler = assessmentToolContentHandler;
+ }
+
+ public void setAssessmentUserDao(AssessmentUserDAO assessmentUserDao) {
+ this.assessmentUserDao = assessmentUserDao;
+ }
+
+ public void setToolService(ILamsToolService toolService) {
+ this.toolService = toolService;
+ }
+
+ public AssessmentQuestionVisitDAO getAssessmentQuestionVisitDao() {
+ return assessmentQuestionVisitDao;
+ }
+
+ public void setAssessmentQuestionVisitDao(AssessmentQuestionVisitDAO assessmentQuestionVisitDao) {
+ this.assessmentQuestionVisitDao = assessmentQuestionVisitDao;
+ }
+
+ // *******************************************************************************
+ // ToolContentManager, ToolSessionManager methods
+ // *******************************************************************************
+
+ public void exportToolContent(Long toolContentId, String rootPath) throws DataMissingException, ToolException {
+ Assessment toolContentObj = assessmentDao.getByContentId(toolContentId);
+ if (toolContentObj == null) {
+ try {
+ toolContentObj = getDefaultAssessment();
+ } catch (AssessmentApplicationException e) {
+ throw new DataMissingException(e.getMessage());
+ }
+ }
+ if (toolContentObj == null) {
+ throw new DataMissingException("Unable to find default content for the assessment tool");
+ }
+
+ // set AssessmentToolContentHandler as null to avoid copy file node in repository again.
+ toolContentObj = Assessment.newInstance(toolContentObj, toolContentId, null);
+ toolContentObj.setToolContentHandler(null);
+ toolContentObj.setOfflineFileList(null);
+ toolContentObj.setOnlineFileList(null);
+ try {
+ exportContentService.registerFileClassForExport(AssessmentAttachment.class.getName(), "fileUuid",
+ "fileVersionId");
+ exportContentService.registerFileClassForExport(AssessmentQuestion.class.getName(), "fileUuid",
+ "fileVersionId");
+ exportContentService.exportToolContent(toolContentId, toolContentObj, assessmentToolContentHandler,
+ rootPath);
+ } catch (ExportToolContentException e) {
+ throw new ToolException(e);
+ }
+ }
+
+ public void importToolContent(Long toolContentId, Integer newUserUid, String toolContentPath, String fromVersion,
+ String toVersion) throws ToolException {
+
+ try {
+ exportContentService.registerFileClassForImport(AssessmentAttachment.class.getName(), "fileUuid",
+ "fileVersionId", "fileName", "fileType", null, null);
+ exportContentService.registerFileClassForImport(AssessmentQuestion.class.getName(), "fileUuid",
+ "fileVersionId", "fileName", "fileType", null, "initialItem");
+
+ Object toolPOJO = exportContentService.importToolContent(toolContentPath, assessmentToolContentHandler,
+ fromVersion, toVersion);
+ if (!(toolPOJO instanceof Assessment)) {
+ throw new ImportToolContentException(
+ "Import Share assessment tool content failed. Deserialized object is " + toolPOJO);
+ }
+ Assessment toolContentObj = (Assessment) toolPOJO;
+
+ // reset it to new toolContentId
+ toolContentObj.setContentId(toolContentId);
+ AssessmentUser user = assessmentUserDao.getUserByUserIDAndContentID(new Long(newUserUid.longValue()),
+ toolContentId);
+ if (user == null) {
+ user = new AssessmentUser();
+ UserDTO sysUser = ((User) userManagementService.findById(User.class, newUserUid)).getUserDTO();
+ user.setFirstName(sysUser.getFirstName());
+ user.setLastName(sysUser.getLastName());
+ user.setLoginName(sysUser.getLogin());
+ user.setUserId(new Long(newUserUid.longValue()));
+ user.setAssessment(toolContentObj);
+ }
+ toolContentObj.setCreatedBy(user);
+
+ // reset all assessmentquestion createBy user
+ Set questions = toolContentObj.getQuestions();
+ for (AssessmentQuestion question : questions) {
+ question.setCreateBy(user);
+ }
+ assessmentDao.saveObject(toolContentObj);
+ } catch (ImportToolContentException e) {
+ throw new ToolException(e);
+ }
+ }
+
+ /**
+ * Get the definitions for possible output for an activity, based on the toolContentId. These may be definitions
+ * that are always available for the tool (e.g. number of marks for Multiple Choice) or a custom definition created
+ * for a particular activity such as the answer to the third question contains the word Koala and hence the need for
+ * the toolContentId
+ *
+ * @return SortedMap of ToolOutputDefinitions with the key being the name of each definition
+ */
+ public SortedMap getToolOutputDefinitions(Long toolContentId) throws ToolException {
+ return new TreeMap();
+ }
+
+ public void copyToolContent(Long fromContentId, Long toContentId) throws ToolException {
+ if (toContentId == null) {
+ throw new ToolException("Failed to create the SharedAssessmentFiles tool seession");
+ }
+
+ Assessment assessment = null;
+ if (fromContentId != null) {
+ assessment = assessmentDao.getByContentId(fromContentId);
+ }
+ if (assessment == null) {
+ try {
+ assessment = getDefaultAssessment();
+ } catch (AssessmentApplicationException e) {
+ throw new ToolException(e);
+ }
+ }
+
+ Assessment toContent = Assessment.newInstance(assessment, toContentId, assessmentToolContentHandler);
+ assessmentDao.saveObject(toContent);
+
+ // save assessment questions as well
+ Set questions = toContent.getQuestions();
+ if (questions != null) {
+ Iterator iter = questions.iterator();
+ while (iter.hasNext()) {
+ AssessmentQuestion question = (AssessmentQuestion) iter.next();
+ // createRootTopic(toContent.getUid(),null,msg);
+ }
+ }
+ }
+
+ public void setAsDefineLater(Long toolContentId, boolean value) throws DataMissingException, ToolException {
+ Assessment assessment = assessmentDao.getByContentId(toolContentId);
+ if (assessment == null) {
+ throw new ToolException("No found tool content by given content ID:" + toolContentId);
+ }
+ assessment.setDefineLater(value);
+ }
+
+ public void setAsRunOffline(Long toolContentId, boolean value) throws DataMissingException, ToolException {
+ Assessment assessment = assessmentDao.getByContentId(toolContentId);
+ if (assessment == null) {
+ throw new ToolException("No found tool content by given content ID:" + toolContentId);
+ }
+ assessment.setRunOffline(value);
+ }
+
+ public void removeToolContent(Long toolContentId, boolean removeSessionData) throws SessionDataExistsException,
+ ToolException {
+ Assessment assessment = assessmentDao.getByContentId(toolContentId);
+ if (removeSessionData) {
+ List list = assessmentSessionDao.getByContentId(toolContentId);
+ Iterator iter = list.iterator();
+ while (iter.hasNext()) {
+ AssessmentSession session = (AssessmentSession) iter.next();
+ assessmentSessionDao.delete(session);
+ }
+ }
+ assessmentDao.delete(assessment);
+ }
+
+ public void createToolSession(Long toolSessionId, String toolSessionName, Long toolContentId) throws ToolException {
+ AssessmentSession session = new AssessmentSession();
+ session.setSessionId(toolSessionId);
+ session.setSessionName(toolSessionName);
+ Assessment assessment = assessmentDao.getByContentId(toolContentId);
+ session.setAssessment(assessment);
+ assessmentSessionDao.saveObject(session);
+ }
+
+ public String leaveToolSession(Long toolSessionId, Long learnerId) throws DataMissingException, ToolException {
+ if (toolSessionId == null) {
+ AssessmentServiceImpl.log.error("Fail to leave tool Session based on null tool session id.");
+ throw new ToolException("Fail to remove tool Session based on null tool session id.");
+ }
+ if (learnerId == null) {
+ AssessmentServiceImpl.log.error("Fail to leave tool Session based on null learner.");
+ throw new ToolException("Fail to remove tool Session based on null learner.");
+ }
+
+ AssessmentSession session = assessmentSessionDao.getSessionBySessionId(toolSessionId);
+ if (session != null) {
+ session.setStatus(AssessmentConstants.COMPLETED);
+ assessmentSessionDao.saveObject(session);
+ } else {
+ AssessmentServiceImpl.log.error("Fail to leave tool Session.Could not find shared assessment "
+ + "session by given session id: " + toolSessionId);
+ throw new DataMissingException("Fail to leave tool Session."
+ + "Could not find shared assessment session by given session id: " + toolSessionId);
+ }
+ return learnerService.completeToolSession(toolSessionId, learnerId);
+ }
+
+ public ToolSessionExportOutputData exportToolSession(Long toolSessionId) throws DataMissingException, ToolException {
+ return null;
+ }
+
+ public ToolSessionExportOutputData exportToolSession(List toolSessionIds) throws DataMissingException,
+ ToolException {
+ return null;
+ }
+
+ public void removeToolSession(Long toolSessionId) throws DataMissingException, ToolException {
+ assessmentSessionDao.deleteBySessionId(toolSessionId);
+ }
+
+ /**
+ * Get the tool output for the given tool output names.
+ *
+ * @see org.lamsfoundation.lams.tool.ToolSessionManager#getToolOutput(java.util.List, java.lang.Long,
+ * java.lang.Long)
+ */
+ public SortedMap getToolOutput(List names, Long toolSessionId, Long learnerId) {
+ return new TreeMap();
+ }
+
+ /**
+ * Get the tool output for the given tool output name.
+ *
+ * @see org.lamsfoundation.lams.tool.ToolSessionManager#getToolOutput(java.lang.String, java.lang.Long,
+ * java.lang.Long)
+ */
+ public ToolOutput getToolOutput(String name, Long toolSessionId, Long learnerId) {
+ return null;
+ }
+
+ /* ===============Methods implemented from ToolContentImport102Manager =============== */
+
+ /**
+ * Import the data for a 1.0.2 Noticeboard or HTMLNoticeboard
+ */
+ public void import102ToolContent(Long toolContentId, UserDTO user, Hashtable importValues) {
+ }
+
+ /** Set the description, throws away the title value as this is not supported in 2.0 */
+ public void setReflectiveData(Long toolContentId, String title, String description) throws ToolException,
+ DataMissingException {
+
+ Assessment toolContentObj = getAssessmentByContentId(toolContentId);
+ if (toolContentObj == null) {
+ throw new DataMissingException("Unable to set reflective data titled " + title
+ + " on activity toolContentId " + toolContentId + " as the tool content does not exist.");
+ }
+
+ toolContentObj.setReflectOnActivity(Boolean.TRUE);
+ toolContentObj.setReflectInstructions(description);
+ }
+
+ /* =================================================================================== */
+
+ public IExportToolContentService getExportContentService() {
+ return exportContentService;
+ }
+
+ public void setExportContentService(IExportToolContentService exportContentService) {
+ this.exportContentService = exportContentService;
+ }
+
+ public IUserManagementService getUserManagementService() {
+ return userManagementService;
+ }
+
+ public void setUserManagementService(IUserManagementService userManagementService) {
+ this.userManagementService = userManagementService;
+ }
+
+ public ICoreNotebookService getCoreNotebookService() {
+ return coreNotebookService;
+ }
+
+ public void setCoreNotebookService(ICoreNotebookService coreNotebookService) {
+ this.coreNotebookService = coreNotebookService;
+ }
+
+ public IEventNotificationService getEventNotificationService() {
+ return eventNotificationService;
+ }
+
+ public void setEventNotificationService(IEventNotificationService eventNotificationService) {
+ this.eventNotificationService = eventNotificationService;
+ }
+
+ public String getLocalisedMessage(String key, Object[] args) {
+ return messageService.getMessage(key, args);
+ }
+
+ public ILessonService getLessonService() {
+ return lessonService;
+ }
+
+ public void setLessonService(ILessonService lessonService) {
+ this.lessonService = lessonService;
+ }
+
+ /**
+ * Finds out which lesson the given tool content belongs to and returns its monitoring users.
+ *
+ * @param sessionId
+ * tool session ID
+ * @return list of teachers that monitor the lesson which contains the tool with given session ID
+ */
+ public List getMonitorsByToolSessionId(Long sessionId) {
+ return getLessonService().getMonitorsByToolSessionId(sessionId);
+ }
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceProxy.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceProxy.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceProxy.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,69 @@
+/****************************************************************
+ * 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.service;
+
+import javax.servlet.ServletContext;
+
+import org.lamsfoundation.lams.tool.ToolContentManager;
+import org.lamsfoundation.lams.tool.ToolSessionManager;
+import org.lamsfoundation.lams.tool.assessment.AssessmentConstants;
+import org.springframework.web.context.WebApplicationContext;
+import org.springframework.web.context.support.WebApplicationContextUtils;
+
+/**
+ * @author Andrey Balan
+ *
+ *
+ * This class act as the proxy between web layer and service layer. It is designed to decouple the presentation
+ * logic and business logic completely. In this way, the presentation tier will no longer be aware of the
+ * changes in service layer. Therefore we can feel free to switch the business logic implementation.
+ *
+ */
+public class AssessmentServiceProxy {
+ /**
+ * Return the domain service object. It will delegate to the Spring helper method to retrieve the proper bean from
+ * Spring bean factory.
+ *
+ * @param servletContext
+ * the servletContext for current application
+ * @return Shared assessment service object.
+ */
+ public static final IAssessmentService getAssessmentService(ServletContext servletContext) {
+ return (IAssessmentService) getAssessmentDomainService(servletContext);
+ }
+
+ public static final ToolSessionManager getSessionManager(ServletContext servletContext) {
+ return (ToolSessionManager) getAssessmentDomainService(servletContext);
+ }
+
+ public static final ToolContentManager getContentManager(ServletContext servletContext) {
+ return (ToolContentManager) getAssessmentDomainService(servletContext);
+ }
+
+ private static Object getAssessmentDomainService(ServletContext servletContext) {
+ WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
+ return wac.getBean(AssessmentConstants.ASSESSMENT_SERVICE);
+ }
+
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/IAssessmentService.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/IAssessmentService.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/IAssessmentService.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,283 @@
+/****************************************************************
+ * 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.service;
+
+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.AssessmentAttachment;
+import org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestion;
+import org.lamsfoundation.lams.tool.assessment.model.AssessmentSession;
+import org.lamsfoundation.lams.tool.assessment.model.AssessmentUser;
+import org.lamsfoundation.lams.usermanagement.User;
+
+/**
+ * @author Andrey Balan
+ *
+ * Interface that defines the contract that all ShareAssessment service provider must follow.
+ */
+public interface IAssessmentService {
+
+ /**
+ * Get Assessment by toolContentID.
+ *
+ * @param contentId
+ * @return
+ */
+ Assessment getAssessmentByContentId(Long contentId);
+
+ /**
+ * Get a cloned copy of tool default tool content (Assessment) and assign the toolContentId of that copy as the
+ * given contentId
+ *
+ * @param contentId
+ * @return
+ * @throws AssessmentApplicationException
+ */
+ Assessment getDefaultContent(Long contentId) throws AssessmentApplicationException;
+
+ /**
+ * Get list of assessment questions by given assessmentUid. These assessment questions must be created by author.
+ *
+ * @param assessmentUid
+ * @return
+ */
+ List getAuthoredQuestions(Long assessmentUid);
+
+ /**
+ * Upload instruciton file into repository.
+ *
+ * @param file
+ * @param type
+ * @return
+ * @throws UploadAssessmentFileException
+ */
+ AssessmentAttachment uploadInstructionFile(FormFile file, String type) throws UploadAssessmentFileException;
+
+ // ********** for user methods *************
+ /**
+ * Create a new user in database.
+ */
+ void createUser(AssessmentUser assessmentUser);
+
+ /**
+ * Get user by given userID and toolContentID.
+ *
+ * @param long1
+ * @return
+ */
+ AssessmentUser getUserByIDAndContent(Long userID, Long contentId);
+
+ /**
+ * Get user by sessionID and UserID
+ *
+ * @param long1
+ * @param sessionId
+ * @return
+ */
+ AssessmentUser getUserByIDAndSession(Long long1, Long sessionId);
+
+ // ********** Repository methods ***********************
+ /**
+ * Delete file from repository.
+ */
+ void deleteFromRepository(Long fileUuid, Long fileVersionId) throws AssessmentApplicationException;
+
+ /**
+ * Save or update assessment into database.
+ *
+ * @param Assessment
+ */
+ void saveOrUpdateAssessment(Assessment Assessment);
+
+ /**
+ * Delete reource attachment(i.e., offline/online instruction file) from database. This method does not delete the
+ * file from repository.
+ *
+ * @param attachmentUid
+ */
+ void deleteAssessmentAttachment(Long attachmentUid);
+
+ /**
+ * Delete resoruce question from database.
+ *
+ * @param uid
+ */
+ void deleteAssessmentQuestion(Long uid);
+
+ /**
+ * Return all reource questions within the given toolSessionID.
+ *
+ * @param sessionId
+ * @return
+ */
+ List getAssessmentQuestionsBySessionId(Long sessionId);
+
+ /**
+ * Get assessment which is relative with the special toolSession.
+ *
+ * @param sessionId
+ * @return
+ */
+ Assessment getAssessmentBySessionId(Long sessionId);
+
+ /**
+ * Get assessment toolSession by toolSessionId
+ *
+ * @param sessionId
+ * @return
+ */
+ AssessmentSession getAssessmentSessionBySessionId(Long sessionId);
+
+ /**
+ * Save or update assessment session.
+ *
+ * @param resSession
+ */
+ void saveOrUpdateAssessmentSession(AssessmentSession resSession);
+
+ void retrieveComplete(SortedSet assessmentQuestionList, AssessmentUser user);
+
+ void setQuestionComplete(Long assessmentQuestionUid, Long userId, Long sessionId);
+
+ void setQuestionAccess(Long assessmentQuestionUid, Long userId, Long sessionId);
+
+ /**
+ * If success return next activity's url, otherwise return null.
+ *
+ * @param toolSessionId
+ * @param userId
+ * @return
+ */
+ String finishToolSession(Long toolSessionId, Long userId) throws AssessmentApplicationException;
+
+ AssessmentQuestion getAssessmentQuestionByUid(Long questionUid);
+
+ /**
+ * Return monitoring summary list. The return value is list of assessment summaries for each groups.
+ *
+ * @param contentId
+ * @return
+ */
+ List> getSummary(Long contentId);
+
+ List getUserListBySessionQuestion(Long sessionId, Long questionUid);
+
+ /**
+ * Set a assessment question visible or not.
+ *
+ * @param questionUid
+ * @param visible
+ * true, question is visible. False, question is invisible.
+ */
+ void setQuestionVisible(Long questionUid, boolean visible);
+
+ /**
+ * Get assessment question Summary list according to sessionId and skipHide flag.
+ *
+ * @param sessionId
+ * @param skipHide
+ * true, don't get assessment question if its isHide flag is true. Otherwise, get all assessment
+ * question
+ * @return
+ */
+ public List exportBySessionId(Long sessionId, boolean skipHide);
+
+ public List> exportByContentId(Long contentId);
+
+ /**
+ * Create refection entry into notebook tool.
+ *
+ * @param sessionId
+ * @param notebook_tool
+ * @param tool_signature
+ * @param userId
+ * @param entryText
+ */
+ public Long createNotebookEntry(Long sessionId, Integer notebookToolType, String toolSignature, Integer userId,
+ String entryText);
+
+ /**
+ * Get reflection entry from notebook tool.
+ *
+ * @param sessionId
+ * @param idType
+ * @param signature
+ * @param userID
+ * @return
+ */
+ public NotebookEntry getEntry(Long sessionId, Integer idType, String signature, Integer userID);
+
+ /**
+ * @param notebookEntry
+ */
+ public void updateEntry(NotebookEntry notebookEntry);
+
+ /**
+ * Get Reflect DTO list grouped by sessionID.
+ *
+ * @param contentId
+ * @return
+ */
+ Map> getReflectList(Long contentId, boolean setEntry);
+
+ /**
+ * Get user by UID
+ *
+ * @param uid
+ * @return
+ */
+ AssessmentUser getUser(Long uid);
+
+ public IEventNotificationService getEventNotificationService();
+
+ /**
+ * Gets a message from assessment bundle. Same as in JSP pages.
+ *
+ * @param key
+ * key of the message
+ * @param args
+ * arguments for the message
+ * @return message content
+ */
+ String getLocalisedMessage(String key, Object[] args);
+
+ /**
+ * Finds out which lesson the given tool content belongs to and returns its monitoring users.
+ *
+ * @param sessionId
+ * tool session ID
+ * @return list of teachers that monitor the lesson which contains the tool with given session ID
+ */
+ public List getMonitorsByToolSessionId(Long sessionId);
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/UploadAssessmentFileException.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/UploadAssessmentFileException.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/UploadAssessmentFileException.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -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 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.service;
+
+public class UploadAssessmentFileException extends Exception {
+
+ public UploadAssessmentFileException() {
+ super();
+
+ }
+
+ public UploadAssessmentFileException(String message, Throwable cause) {
+ super(message, cause);
+
+ }
+
+ public UploadAssessmentFileException(String message) {
+ super(message);
+
+ }
+
+ public UploadAssessmentFileException(Throwable cause) {
+ super(cause);
+
+ }
+
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/util/AssessmentAnswerOptionComparator.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/util/AssessmentAnswerOptionComparator.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/util/AssessmentAnswerOptionComparator.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,46 @@
+/****************************************************************
+ * 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.AssessmentAnswerOption;
+
+/**
+ *
+ * @author Andrey Balan
+ *
+ */
+public class AssessmentAnswerOptionComparator implements Comparator {
+
+ public int compare(AssessmentAnswerOption o1, AssessmentAnswerOption 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/util/AssessmentOverallFeedbackComparator.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/util/AssessmentOverallFeedbackComparator.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/util/AssessmentOverallFeedbackComparator.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -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.util;
+
+import java.util.Comparator;
+
+import org.lamsfoundation.lams.tool.assessment.model.AssessmentOverallFeedback;
+
+/**
+ *
+ * @author Andrey Balan
+ *
+ */
+public class AssessmentOverallFeedbackComparator implements Comparator {
+
+ public int compare(AssessmentOverallFeedback o1, AssessmentOverallFeedback 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/util/AssessmentQuestionComparator.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/util/AssessmentQuestionComparator.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/util/AssessmentQuestionComparator.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,23 @@
+package org.lamsfoundation.lams.tool.assessment.util;
+
+import java.util.Comparator;
+
+import org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestion;
+
+/**
+ *
+ * @author Andrey Balan
+ *
+ */
+public class AssessmentQuestionComparator implements Comparator {
+
+ public int compare(AssessmentQuestion o1, AssessmentQuestion o2) {
+ if (o1 != null && o2 != null) {
+ return o1.getSequenceId() - o2.getSequenceId();
+ } else if (o1 != null)
+ return 1;
+ else
+ return -1;
+ }
+
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/util/AssessmentToolContentHandler.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/util/AssessmentToolContentHandler.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/util/AssessmentToolContentHandler.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,75 @@
+/****************************************************************
+ * 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.util;
+
+import org.lamsfoundation.lams.contentrepository.client.ToolContentHandler;
+
+/**
+ * Simple client for accessing the content repository.
+ *
+ * @author Fiona Malikoff
+ */
+public class AssessmentToolContentHandler extends ToolContentHandler {
+
+ private static String repositoryWorkspaceName = "sharedassessmentworkspace";
+ private static String repositoryUser = "sharedassessment";
+ // sharedassessment
+ private static char[] repositoryId = { 'l', 'a', 'm', 's', '-', 's', 'h', 'a', 'r', 'e', 'd', 'r', 'e', 's', 'o',
+ 'u', 'r', 'c', 'e', 's' };
+
+ /**
+ *
+ */
+ public AssessmentToolContentHandler() {
+ super();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.lamsfoundation.lams.contentrepository.client.ToolContentHandler#getRepositoryWorkspaceName()
+ */
+ public String getRepositoryWorkspaceName() {
+ return repositoryWorkspaceName;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.lamsfoundation.lams.contentrepository.client.ToolContentHandler#getRepositoryUser()
+ */
+ public String getRepositoryUser() {
+ return repositoryUser;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.lamsfoundation.lams.contentrepository.client.ToolContentHandler#getRepositoryId()
+ */
+ public char[] getRepositoryId() {
+ return repositoryId;
+ }
+
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/util/AssessmentWebUtils.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/util/AssessmentWebUtils.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/util/AssessmentWebUtils.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,53 @@
+/****************************************************************
+ * 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 org.lamsfoundation.lams.tool.assessment.AssessmentConstants;
+
+/**
+ * Contains helper methods used by the Action Servlets
+ *
+ * @author Anthony Sukkar
+ *
+ */
+public class AssessmentWebUtils {
+
+ /**
+ * If there is not url prefix, such as http://, https:// or ftp:// etc, this method will add default url protocol.
+ *
+ * @param url
+ * @return
+ */
+ public static String protocol(String url) {
+ if (url == null)
+ return "";
+
+ if (!url.matches("^" + AssessmentConstants.ALLOW_PROTOCOL_REFIX + ".*"))
+ url = AssessmentConstants.DEFUALT_PROTOCOL_REFIX + url;
+
+ return url;
+ }
+
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/util/ReflectDTOComparator.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/util/ReflectDTOComparator.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/util/ReflectDTOComparator.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,38 @@
+/****************************************************************
+ * 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
+ * ****************************************************************
+ */
+package org.lamsfoundation.lams.tool.assessment.util;
+
+import java.util.Comparator;
+
+import org.lamsfoundation.lams.tool.assessment.dto.ReflectDTO;
+
+public class ReflectDTOComparator implements Comparator {
+ public int compare(ReflectDTO o1, ReflectDTO o2) {
+ if (o1 != null && o2 != null) {
+ return o1.getFullName().compareTo(o2.getFullName());
+ } else if (o1 != null)
+ return 1;
+ else
+ return -1;
+ }
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/AuthoringAction.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/AuthoringAction.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/AuthoringAction.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,1385 @@
+/****************************************************************
+ * 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.web.action;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+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;
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+import org.apache.struts.action.ActionMessage;
+import org.apache.struts.action.ActionMessages;
+import org.apache.struts.upload.FormFile;
+import org.lamsfoundation.lams.authoring.web.AuthoringConstants;
+import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler;
+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.AssessmentAnswerOption;
+import org.lamsfoundation.lams.tool.assessment.model.AssessmentAttachment;
+import org.lamsfoundation.lams.tool.assessment.model.AssessmentOverallFeedback;
+import org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestion;
+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.AssessmentAnswerOptionComparator;
+import org.lamsfoundation.lams.tool.assessment.util.AssessmentOverallFeedbackComparator;
+import org.lamsfoundation.lams.tool.assessment.util.AssessmentQuestionComparator;
+import org.lamsfoundation.lams.tool.assessment.web.form.AssessmentForm;
+import org.lamsfoundation.lams.tool.assessment.web.form.AssessmentQuestionForm;
+import org.lamsfoundation.lams.usermanagement.dto.UserDTO;
+import org.lamsfoundation.lams.util.FileValidatorUtil;
+import org.lamsfoundation.lams.util.NumberUtil;
+import org.lamsfoundation.lams.util.WebUtil;
+import org.lamsfoundation.lams.web.session.SessionManager;
+import org.lamsfoundation.lams.web.util.AttributeNames;
+import org.lamsfoundation.lams.web.util.SessionMap;
+import org.springframework.web.context.WebApplicationContext;
+import org.springframework.web.context.support.WebApplicationContextUtils;
+
+/**
+ * @author Andrey Balan
+ */
+public class AuthoringAction extends Action {
+
+ private static Logger log = Logger.getLogger(AuthoringAction.class);
+
+ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws Exception {
+
+ String param = mapping.getParameter();
+ // -----------------------Assessment Author functions ---------------------------
+ if (param.equals("start")) {
+ ToolAccessMode mode = getAccessMode(request);
+ // teacher mode "check for new" button enter.
+ if (mode != null)
+ request.setAttribute(AttributeNames.ATTR_MODE, mode.toString());
+ else
+ request.setAttribute(AttributeNames.ATTR_MODE, ToolAccessMode.AUTHOR.toString());
+ return start(mapping, form, request, response);
+ }
+ if (param.equals("definelater")) {
+ // update define later flag to true
+ Long contentId = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID));
+ IAssessmentService service = getAssessmentService();
+ Assessment assessment = service.getAssessmentByContentId(contentId);
+
+ assessment.setDefineLater(true);
+ service.saveOrUpdateAssessment(assessment);
+
+ request.setAttribute(AttributeNames.ATTR_MODE, ToolAccessMode.TEACHER.toString());
+ return start(mapping, form, request, response);
+ }
+ if (param.equals("initPage")) {
+ return initPage(mapping, form, request, response);
+ }
+ if (param.equals("updateContent")) {
+ return updateContent(mapping, form, request, response);
+ }
+ if (param.equals("uploadOnlineFile")) {
+ return uploadOnline(mapping, form, request, response);
+ }
+ if (param.equals("uploadOfflineFile")) {
+ return uploadOffline(mapping, form, request, response);
+ }
+ if (param.equals("deleteOnlineFile")) {
+ return deleteOnlineFile(mapping, form, request, response);
+ }
+ if (param.equals("deleteOfflineFile")) {
+ return deleteOfflineFile(mapping, form, request, response);
+ }
+ // ----------------------- Add assessment question functions ---------------------------
+ if (param.equals("newQuestionInit")) {
+ return newQuestionInit(mapping, form, request, response);
+ }
+ if (param.equals("editQuestion")) {
+ return editQuestion(mapping, form, request, response);
+ }
+ if (param.equals("saveOrUpdateQuestion")) {
+ return saveOrUpdateQuestion(mapping, form, request, response);
+ }
+ if (param.equals("removeQuestion")) {
+ return removeQuestion(mapping, form, request, response);
+ }
+ if (param.equals("upQuestion")) {
+ return upQuestion(mapping, form, request, response);
+ }
+ if (param.equals("downQuestion")) {
+ return downQuestion(mapping, form, request, response);
+ }
+ // -----------------------Assessment Answer Option functions ---------------------------
+ if (param.equals("newOption")) {
+ return newOption(mapping, form, request, response);
+ }
+ if (param.equals("removeOption")) {
+ return removeOption(mapping, form, request, response);
+ }
+ if (param.equals("upOption")) {
+ return upOption(mapping, form, request, response);
+ }
+ if (param.equals("downOption")) {
+ return downOption(mapping, form, request, response);
+ }
+ // -----------------------Assessment Overall Feedback functions ---------------------------
+ if (param.equals("initOverallFeedback")) {
+ return initOverallFeedback(mapping, form, request, response);
+ }
+ if (param.equals("newOverallFeedback")) {
+ return newOverallFeedback(mapping, form, request, response);
+ }
+
+ return mapping.findForward(AssessmentConstants.ERROR);
+ }
+
+ /**
+ * 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) throws ServletException {
+
+ // save toolContentID into HTTPSession
+ Long contentId = new Long(WebUtil.readLongParam(request, AssessmentConstants.PARAM_TOOL_CONTENT_ID));
+
+ // get back the assessment and question list and display them on page
+ IAssessmentService service = getAssessmentService();
+
+ List questions = null;
+ Assessment assessment = null;
+ AssessmentForm assessmentForm = (AssessmentForm) form;
+
+ // initial Session Map
+ SessionMap sessionMap = new SessionMap();
+ request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap);
+ assessmentForm.setSessionMapID(sessionMap.getSessionID());
+
+ // Get contentFolderID and save to form.
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+ sessionMap.put(AttributeNames.PARAM_CONTENT_FOLDER_ID, contentFolderID);
+ assessmentForm.setContentFolderID(contentFolderID);
+
+ try {
+ assessment = service.getAssessmentByContentId(contentId);
+ // if assessment does not exist, try to use default content instead.
+ if (assessment == null) {
+ assessment = service.getDefaultContent(contentId);
+ if (assessment.getQuestions() != null) {
+ questions = new ArrayList(assessment.getQuestions());
+ } else
+ questions = null;
+ } else
+ questions = service.getAuthoredQuestions(assessment.getUid());
+
+ assessmentForm.setAssessment(assessment);
+
+ // initialize instruction attachment list
+ List attachmentList = getAttachmentList(sessionMap);
+ attachmentList.clear();
+ attachmentList.addAll(assessment.getAttachments());
+ } catch (Exception e) {
+ log.error(e);
+ throw new ServletException(e);
+ }
+
+ // init it to avoid null exception in following handling
+ if (questions == null)
+ questions = new ArrayList();
+ else {
+ AssessmentUser assessmentUser = null;
+ // handle system default question: createBy is null, now set it to current user
+ for (AssessmentQuestion question : questions) {
+ if (question.getCreateBy() == null) {
+ if (assessmentUser == null) {
+ // get back login user DTO
+ HttpSession ss = SessionManager.getSession();
+ UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER);
+ assessmentUser = new AssessmentUser(user, assessment);
+ }
+ question.setCreateBy(assessmentUser);
+ }
+ }
+ }
+ // init assessment question list
+ SortedSet questionList = getQuestionList(sessionMap);
+ questionList.clear();
+ questionList.addAll(questions);
+
+ sessionMap.put(AssessmentConstants.ATTR_ASSESSMENT_FORM, assessmentForm);
+ 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 initPage(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);
+ AssessmentForm existForm = (AssessmentForm) sessionMap.get(AssessmentConstants.ATTR_ASSESSMENT_FORM);
+
+ AssessmentForm assessmentForm = (AssessmentForm) form;
+ try {
+ PropertyUtils.copyProperties(assessmentForm, existForm);
+ } catch (Exception e) {
+ throw new ServletException(e);
+ }
+
+ ToolAccessMode mode = getAccessMode(request);
+ if (mode.isAuthor())
+ return mapping.findForward(AssessmentConstants.SUCCESS);
+ else
+ return mapping.findForward(AssessmentConstants.DEFINE_LATER);
+ }
+
+ /**
+ * This method will persist all inforamtion in this authoring page, include all assessment question, information etc.
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return
+ * @throws ServletException
+ */
+ private ActionForward updateContent(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws Exception {
+ AssessmentForm assessmentForm = (AssessmentForm) (form);
+
+ // get back sessionMAP
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(assessmentForm.getSessionMapID());
+
+ ToolAccessMode mode = getAccessMode(request);
+
+ ActionMessages errors = validate(assessmentForm, mapping, request);
+ if (!errors.isEmpty()) {
+ saveErrors(request, errors);
+ if (mode.isAuthor())
+ return mapping.findForward("author");
+ else
+ return mapping.findForward("monitor");
+ }
+
+ Assessment assessment = assessmentForm.getAssessment();
+ IAssessmentService service = getAssessmentService();
+
+ // **********************************Get Assessment PO*********************
+ Assessment assessmentPO = service.getAssessmentByContentId(assessmentForm.getAssessment().getContentId());
+ if (assessmentPO == null) {
+ // new Assessment, create it.
+ assessmentPO = assessment;
+ assessmentPO.setCreated(new Timestamp(new Date().getTime()));
+ assessmentPO.setUpdated(new Timestamp(new Date().getTime()));
+ } else {
+ if (mode.isAuthor()) {
+ Long uid = assessmentPO.getUid();
+ PropertyUtils.copyProperties(assessmentPO, assessment);
+ // get back UID
+ assessmentPO.setUid(uid);
+ } else { // if it is Teacher, then just update basic tab content (definelater)
+ assessmentPO.setInstructions(assessment.getInstructions());
+ assessmentPO.setTitle(assessment.getTitle());
+ // change define later status
+ assessmentPO.setDefineLater(false);
+ }
+ assessmentPO.setUpdated(new Timestamp(new Date().getTime()));
+ }
+
+ // *******************************Handle user*******************
+ // try to get form system session
+ HttpSession ss = SessionManager.getSession();
+ // get back login user DTO
+ UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER);
+ AssessmentUser assessmentUser = service.getUserByIDAndContent(new Long(user.getUserID().intValue()),
+ assessmentForm.getAssessment().getContentId());
+ if (assessmentUser == null) {
+ assessmentUser = new AssessmentUser(user, assessmentPO);
+ }
+
+ assessmentPO.setCreatedBy(assessmentUser);
+
+ // **********************************Handle Authoring Instruction Attachement *********************
+ // merge attachment info
+ // so far, attPOSet will be empty if content is existed. because PropertyUtils.copyProperties() is executed
+ Set attPOSet = assessmentPO.getAttachments();
+ if (attPOSet == null)
+ attPOSet = new HashSet();
+ List attachmentList = getAttachmentList(sessionMap);
+ List deleteAttachmentList = getDeletedAttachmentList(sessionMap);
+
+ // current attachemnt in authoring instruction tab.
+ Iterator iter = attachmentList.iterator();
+ while (iter.hasNext()) {
+ AssessmentAttachment newAtt = (AssessmentAttachment) iter.next();
+ attPOSet.add(newAtt);
+ }
+ attachmentList.clear();
+
+ // deleted attachment. 2 possible types: one is persist another is non-persist before.
+ iter = deleteAttachmentList.iterator();
+ while (iter.hasNext()) {
+ AssessmentAttachment delAtt = (AssessmentAttachment) iter.next();
+ iter.remove();
+ // it is an existed att, then delete it from current attachmentPO
+ if (delAtt.getUid() != null) {
+ Iterator attIter = attPOSet.iterator();
+ while (attIter.hasNext()) {
+ AssessmentAttachment att = (AssessmentAttachment) attIter.next();
+ if (delAtt.getUid().equals(att.getUid())) {
+ attIter.remove();
+ break;
+ }
+ }
+ service.deleteAssessmentAttachment(delAtt.getUid());
+ }// end remove from persist value
+ }
+
+ // copy back
+ assessmentPO.setAttachments(attPOSet);
+ // ************************* Handle assessment questions *******************
+ // Handle assessment questions
+ Set questionList = new LinkedHashSet();
+ SortedSet topics = getQuestionList(sessionMap);
+ iter = topics.iterator();
+ while (iter.hasNext()) {
+ AssessmentQuestion question = (AssessmentQuestion) iter.next();
+ if (question != null) {
+ // This flushs user UID info to message if this user is a new user.
+ question.setCreateBy(assessmentUser);
+ questionList.add(question);
+ }
+ }
+ assessmentPO.setQuestions(questionList);
+ // delete instructino file from database.
+ List deletedQuestionList = getDeletedQuestionList(sessionMap);
+ iter = deletedQuestionList.iterator();
+ while (iter.hasNext()) {
+ AssessmentQuestion question = (AssessmentQuestion) iter.next();
+ iter.remove();
+ if (question.getUid() != null)
+ service.deleteAssessmentQuestion(question.getUid());
+ }
+ // handle assessment question attachment file:
+ List delQuestionAttList = getDeletedQuestionAttachmentList(sessionMap);
+ iter = delQuestionAttList.iterator();
+ while (iter.hasNext()) {
+ AssessmentQuestion delAtt = (AssessmentQuestion) iter.next();
+ iter.remove();
+ }
+
+ // ************************* Handle assessment overall feedbacks *******************
+ TreeSet overallFeedbackList = getOverallFeedbacksFromForm(request, true);
+ assessmentPO.setOverallFeedbacks(overallFeedbackList);
+
+ // **********************************************
+ // finally persist assessmentPO again
+ service.saveOrUpdateAssessment(assessmentPO);
+
+ // initialize attachmentList again
+ attachmentList = getAttachmentList(sessionMap);
+ attachmentList.addAll(assessment.getAttachments());
+ assessmentForm.setAssessment(assessmentPO);
+
+ request.setAttribute(AuthoringConstants.LAMS_AUTHORING_SUCCESS_FLAG, Boolean.TRUE);
+ if (mode.isAuthor())
+ return mapping.findForward("author");
+ else
+ return mapping.findForward("monitor");
+ }
+
+ /**
+ * Handle upload online instruction files request.
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return
+ * @throws UploadAssessmentFileException
+ */
+ public ActionForward uploadOnline(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws UploadAssessmentFileException {
+ return uploadFile(mapping, form, IToolContentHandler.TYPE_ONLINE, request);
+ }
+
+ /**
+ * Handle upload offline instruction files request.
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return
+ * @throws UploadAssessmentFileException
+ */
+ public ActionForward uploadOffline(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws UploadAssessmentFileException {
+ return uploadFile(mapping, form, IToolContentHandler.TYPE_OFFLINE, request);
+ }
+
+ /**
+ * Common method to upload online or offline instruction files request.
+ *
+ * @param mapping
+ * @param form
+ * @param type
+ * @param request
+ * @return
+ * @throws UploadAssessmentFileException
+ */
+ private ActionForward uploadFile(ActionMapping mapping, ActionForm form, String type, HttpServletRequest request)
+ throws UploadAssessmentFileException {
+
+ AssessmentForm assessmentForm = (AssessmentForm) form;
+ // get back sessionMAP
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(assessmentForm.getSessionMapID());
+
+ FormFile file;
+ if (StringUtils.equals(IToolContentHandler.TYPE_OFFLINE, type))
+ file = (FormFile) assessmentForm.getOfflineFile();
+ else
+ file = (FormFile) assessmentForm.getOnlineFile();
+
+ if (file == null || StringUtils.isBlank(file.getFileName()))
+ return mapping.findForward(AssessmentConstants.SUCCESS);
+
+ // validate file size
+ ActionMessages errors = new ActionMessages();
+ FileValidatorUtil.validateFileSize(file, true, errors);
+ if (!errors.isEmpty()) {
+ this.saveErrors(request, errors);
+ return mapping.findForward(AssessmentConstants.SUCCESS);
+ }
+
+ IAssessmentService service = getAssessmentService();
+ // upload to repository
+ AssessmentAttachment att = service.uploadInstructionFile(file, type);
+ // handle session value
+ List attachmentList = getAttachmentList(sessionMap);
+ List deleteAttachmentList = getDeletedAttachmentList(sessionMap);
+ // first check exist attachment and delete old one (if exist) to deletedAttachmentList
+ Iterator iter = attachmentList.iterator();
+ AssessmentAttachment existAtt;
+ while (iter.hasNext()) {
+ existAtt = (AssessmentAttachment) iter.next();
+ if (StringUtils.equals(existAtt.getFileName(), att.getFileName())
+ && StringUtils.equals(existAtt.getFileType(), att.getFileType())) {
+ // if there is same name attachment, delete old one
+ deleteAttachmentList.add(existAtt);
+ iter.remove();
+ break;
+ }
+ }
+ // add to attachmentList
+ attachmentList.add(att);
+
+ return mapping.findForward(AssessmentConstants.SUCCESS);
+
+ }
+
+ /**
+ * Delete offline instruction file from current Assessment authoring page.
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return
+ */
+ public ActionForward deleteOfflineFile(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
+ return deleteFile(mapping, request, response, form, IToolContentHandler.TYPE_OFFLINE);
+ }
+
+ /**
+ * Delete online instruction file from current Assessment authoring page.
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return
+ */
+ public ActionForward deleteOnlineFile(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
+ return deleteFile(mapping, request, response, form, IToolContentHandler.TYPE_ONLINE);
+ }
+
+ /**
+ * General method to delete file (online or offline)
+ *
+ * @param mapping
+ * @param request
+ * @param response
+ * @param form
+ * @param type
+ * @return
+ */
+ private ActionForward deleteFile(ActionMapping mapping, HttpServletRequest request, HttpServletResponse response,
+ ActionForm form, String type) {
+ Long versionID = new Long(WebUtil.readLongParam(request, AssessmentConstants.PARAM_FILE_VERSION_ID));
+ Long uuID = new Long(WebUtil.readLongParam(request, AssessmentConstants.PARAM_FILE_UUID));
+
+ // get back sessionMAP
+ String sessionMapID = WebUtil.readStrParam(request, AssessmentConstants.ATTR_SESSION_MAP_ID);
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID);
+
+ // handle session value
+ List attachmentList = getAttachmentList(sessionMap);
+ List deleteAttachmentList = getDeletedAttachmentList(sessionMap);
+ // first check exist attachment and delete old one (if exist) to deletedAttachmentList
+ Iterator iter = attachmentList.iterator();
+ AssessmentAttachment existAtt;
+ while (iter.hasNext()) {
+ existAtt = (AssessmentAttachment) iter.next();
+ if (existAtt.getFileUuid().equals(uuID) && existAtt.getFileVersionId().equals(versionID)) {
+ // if there is same name attachment, delete old one
+ deleteAttachmentList.add(existAtt);
+ iter.remove();
+ }
+ }
+
+ request.setAttribute(AssessmentConstants.ATTR_FILE_TYPE_FLAG, type);
+ request.setAttribute(AssessmentConstants.ATTR_SESSION_MAP_ID, sessionMapID);
+ return mapping.findForward(AssessmentConstants.SUCCESS);
+ }
+
+ /**
+ * Display empty page for new assessment question.
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return
+ */
+ private ActionForward newQuestionInit(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
+ String sessionMapID = WebUtil.readStrParam(request, AssessmentConstants.ATTR_SESSION_MAP_ID);
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID);
+ AssessmentQuestionForm questionForm = (AssessmentQuestionForm) form;
+ questionForm.setSessionMapID(sessionMapID);
+ questionForm.setContentFolderID((String) sessionMap.get(AttributeNames.PARAM_CONTENT_FOLDER_ID));
+ questionForm.setDefaultGrade("1");
+ questionForm.setPenaltyFactor("0.1");
+
+ List optionList = new ArrayList();
+ for (int i = 0; i < AssessmentConstants.INITIAL_OPTIONS_NUMBER; i++) {
+ AssessmentAnswerOption option = new AssessmentAnswerOption();
+ option.setSequenceId(i+1);
+ option.setGrade(0);
+ optionList.add(option);
+ }
+ request.setAttribute(AssessmentConstants.ATTR_OPTION_LIST, optionList);
+
+ short type = (short) NumberUtils.stringToInt(request.getParameter(AssessmentConstants.ATTR_QUESTION_TYPE));
+ return findForward(type, mapping);
+ }
+
+ /**
+ * Display edit page for existed assessment question.
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return
+ */
+ private ActionForward editQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
+
+ // get back sessionMAP
+ String sessionMapID = WebUtil.readStrParam(request, AssessmentConstants.ATTR_SESSION_MAP_ID);
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID);
+
+ int questionIdx = NumberUtils.stringToInt(request.getParameter(AssessmentConstants.PARAM_QUESTION_INDEX), -1);
+ AssessmentQuestion question = null;
+ if (questionIdx != -1) {
+ SortedSet assessmentList = getQuestionList(sessionMap);
+ List rList = new ArrayList(assessmentList);
+ question = rList.get(questionIdx);
+ if (question != null) {
+ AssessmentQuestionForm questionForm = (AssessmentQuestionForm) form;
+ populateQuestionToForm(questionIdx, question, questionForm, request);
+ questionForm.setContentFolderID((String) sessionMap.get(AttributeNames.PARAM_CONTENT_FOLDER_ID));
+ }
+ }
+ return findForward(question == null ? -1 : question.getType(), mapping);
+ }
+
+ /**
+ * This method will get necessary information from assessment question form and save or update into
+ * HttpSession AssessmentQuestionList. Notice, this save is not persist them into database, just save
+ * HttpSession temporarily. Only they will be persist when the entire authoring page is being
+ * persisted.
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return
+ * @throws ServletException
+ */
+ private ActionForward saveOrUpdateQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
+ // get instructions:
+ Set optionList = getOptionsFromRequest(request, true);
+
+ AssessmentQuestionForm questionForm = (AssessmentQuestionForm) form;
+ ActionErrors errors = validateAssessmentQuestion(questionForm, optionList);
+
+ if (!errors.isEmpty()) {
+ this.addErrors(request, errors);
+ request.setAttribute(AssessmentConstants.ATTR_OPTION_LIST, optionList);
+ return findForward(questionForm.getQuestionType(), mapping);
+ }
+
+ try {
+ extractFormToAssessmentQuestion(request, questionForm, optionList);
+ } catch (Exception e) {
+ // any upload exception will display as normal error message rather then throw exception directly
+ errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(AssessmentConstants.ERROR_MSG_UPLOAD_FAILED, e
+ .getMessage()));
+ if (!errors.isEmpty()) {
+ this.addErrors(request, errors);
+ return findForward(questionForm.getQuestionType(), mapping);
+ }
+ }
+ // set session map ID so that questionlist.jsp can get sessionMAP
+ request.setAttribute(AssessmentConstants.ATTR_SESSION_MAP_ID, questionForm.getSessionMapID());
+ // return null to close this window
+ return mapping.findForward(AssessmentConstants.SUCCESS);
+ }
+
+ /**
+ * Remove assessment question from HttpSession list and update page display. As authoring rule, all persist only happen
+ * when user submit whole page. So this remove is just impact HttpSession values.
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return
+ */
+ private ActionForward removeQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
+
+ // get back sessionMAP
+ String sessionMapID = WebUtil.readStrParam(request, AssessmentConstants.ATTR_SESSION_MAP_ID);
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID);
+
+ int questionIdx = NumberUtils.stringToInt(request.getParameter(AssessmentConstants.PARAM_QUESTION_INDEX), -1);
+ if (questionIdx != -1) {
+ SortedSet assessmentList = getQuestionList(sessionMap);
+ List rList = new ArrayList(assessmentList);
+ AssessmentQuestion question = rList.remove(questionIdx);
+ assessmentList.clear();
+ assessmentList.addAll(rList);
+ // add to delList
+ List delList = getDeletedQuestionList(sessionMap);
+ delList.add(question);
+ }
+
+ request.setAttribute(AssessmentConstants.ATTR_SESSION_MAP_ID, sessionMapID);
+ return mapping.findForward(AssessmentConstants.SUCCESS);
+ }
+
+ /**
+ * Move up current question.
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return
+ */
+ private ActionForward upQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
+ return switchQuestion(mapping, request, true);
+ }
+
+ /**
+ * Move down current question.
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return
+ */
+ private ActionForward downQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
+ return switchQuestion(mapping, request, false);
+ }
+
+ private ActionForward switchQuestion(ActionMapping mapping, HttpServletRequest request, boolean up) {
+ // get back sessionMAP
+ String sessionMapID = WebUtil.readStrParam(request, AssessmentConstants.ATTR_SESSION_MAP_ID);
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID);
+
+ int questionIdx = NumberUtils.stringToInt(request.getParameter(AssessmentConstants.PARAM_QUESTION_INDEX), -1);
+ if (questionIdx != -1) {
+ SortedSet questionList = getQuestionList(sessionMap);
+ List rList = new ArrayList(questionList);
+ // get current and the target item, and switch their sequnece
+ AssessmentQuestion question = rList.get(questionIdx);
+ AssessmentQuestion repQuestion;
+ if (up)
+ repQuestion = rList.get(--questionIdx);
+ else
+ repQuestion = rList.get(++questionIdx);
+ int upSeqId = repQuestion.getSequenceId();
+ repQuestion.setSequenceId(question.getSequenceId());
+ question.setSequenceId(upSeqId);
+
+ // put back list, it will be sorted again
+ questionList.clear();
+ questionList.addAll(rList);
+ }
+
+ request.setAttribute(AssessmentConstants.ATTR_SESSION_MAP_ID, sessionMapID);
+ return mapping.findForward(AssessmentConstants.SUCCESS);
+ }
+
+ /**
+ * Ajax call, will add one more input line for new resource item instruction.
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return
+ */
+ private ActionForward newOption(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
+ TreeSet optionList = getOptionsFromRequest(request, false);
+ AssessmentAnswerOption option = new AssessmentAnswerOption();
+ int maxSeq = 1;
+ if (optionList != null && optionList.size() > 0) {
+ AssessmentAnswerOption last = optionList.last();
+ maxSeq = last.getSequenceId() + 1;
+ }
+ option.setSequenceId(maxSeq);
+ option.setGrade(0);
+ optionList.add(option);
+
+ request.setAttribute(AssessmentConstants.ATTR_OPTION_LIST, optionList);
+ return mapping.findForward(AssessmentConstants.SUCCESS);
+ }
+
+ /**
+ * Ajax call, remove the given line of instruction of resource item.
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return
+ */
+ private ActionForward removeOption(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
+ Set optionList = getOptionsFromRequest(request, false);
+ int optionIndex = NumberUtils.stringToInt(request.getParameter(AssessmentConstants.PARAM_OPTION_INDEX), -1);
+ if (optionIndex != -1) {
+ List rList = new ArrayList(optionList);
+ AssessmentAnswerOption question = rList.remove(optionIndex);
+ optionList.clear();
+ optionList.addAll(rList);
+// // add to delList
+// List delList = getDeletedQuestionList(sessionMap);
+// delList.add(question);
+ }
+
+ request.setAttribute(AssessmentConstants.ATTR_OPTION_LIST, optionList);
+ 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);
+ }
+
+ /**
+ * Move down current option.
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return
+ */
+ private ActionForward downOption(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
+ return switchOption(mapping, request, false);
+ }
+
+ private ActionForward switchOption(ActionMapping mapping, HttpServletRequest request, boolean up) {
+ Set optionList = getOptionsFromRequest(request, false);
+
+ 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
+ AssessmentAnswerOption option = rList.get(optionIndex);
+ AssessmentAnswerOption repOption;
+ if (up) {
+ repOption = rList.get(--optionIndex);
+ } else {
+ repOption = rList.get(++optionIndex);
+ }
+
+ int upSeqId = repOption.getSequenceId();
+ repOption.setSequenceId(option.getSequenceId());
+ option.setSequenceId(upSeqId);
+
+ // put back list, it will be sorted again
+ optionList.clear();
+ optionList.addAll(rList);
+ }
+
+ request.setAttribute(AssessmentConstants.ATTR_OPTION_LIST, optionList);
+ return mapping.findForward(AssessmentConstants.SUCCESS);
+ }
+
+ /**
+ * Ajax call, will add one more input line for new resource item instruction.
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return
+ */
+ private ActionForward initOverallFeedback(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
+ String sessionMapID = WebUtil.readStrParam(request, AssessmentConstants.ATTR_SESSION_MAP_ID);
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID);
+ AssessmentForm assessmentForm = (AssessmentForm) sessionMap.get(AssessmentConstants.ATTR_ASSESSMENT_FORM);
+ Assessment assessment = assessmentForm.getAssessment();
+
+ // initial Overall feedbacks list
+ SortedSet overallFeedbackList = new TreeSet(
+ new AssessmentOverallFeedbackComparator());
+ if (!assessment.getOverallFeedbacks().isEmpty()) {
+ overallFeedbackList.addAll(assessment.getOverallFeedbacks());
+ } else {
+ for (int i = 1; i <= AssessmentConstants.INITIAL_OVERALL_FEEDBACK_NUMBER; i++) {
+ AssessmentOverallFeedback overallFeedback = new AssessmentOverallFeedback();
+ if (i == 1) {
+ overallFeedback.setGradeBoundary(100);
+ }
+ overallFeedback.setSequenceId(i);
+ overallFeedbackList.add(overallFeedback);
+ }
+ }
+
+ request.setAttribute(AssessmentConstants.ATTR_OVERALL_FEEDBACK_LIST, overallFeedbackList);
+ return mapping.findForward(AssessmentConstants.SUCCESS);
+ }
+
+ /**
+ * Ajax call, will add one more input line for new OverallFeedback.
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return
+ */
+ private ActionForward newOverallFeedback(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
+ TreeSet overallFeedbackList = getOverallFeedbacksFromRequest(request, false);
+ AssessmentOverallFeedback overallFeedback = new AssessmentOverallFeedback();
+ int maxSeq = 1;
+ if (overallFeedbackList != null && overallFeedbackList.size() > 0) {
+ AssessmentOverallFeedback last = overallFeedbackList.last();
+ maxSeq = last.getSequenceId() + 1;
+ }
+ overallFeedback.setSequenceId(maxSeq);
+ overallFeedbackList.add(overallFeedback);
+
+ request.setAttribute(AssessmentConstants.ATTR_OVERALL_FEEDBACK_LIST, overallFeedbackList);
+ return mapping.findForward(AssessmentConstants.SUCCESS);
+ }
+
+ // *************************************************************************************
+ // Private method
+ // *************************************************************************************
+ /**
+ * Return AssessmentService bean.
+ */
+ private IAssessmentService getAssessmentService() {
+ WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet()
+ .getServletContext());
+ return (IAssessmentService) wac.getBean(AssessmentConstants.ASSESSMENT_SERVICE);
+ }
+
+ /**
+ * @param request
+ * @return
+ */
+ private List getAttachmentList(SessionMap sessionMap) {
+ return getListFromSession(sessionMap, AssessmentConstants.ATT_ATTACHMENT_LIST);
+ }
+
+ /**
+ * @param request
+ * @return
+ */
+ private List getDeletedAttachmentList(SessionMap sessionMap) {
+ return getListFromSession(sessionMap, AssessmentConstants.ATTR_DELETED_ATTACHMENT_LIST);
+ }
+
+ /**
+ * List save current assessment questions.
+ *
+ * @param request
+ * @return
+ */
+ private SortedSet getQuestionList(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 deleted assessment questions, which could be persisted or non-persisted questions.
+ *
+ * @param request
+ * @return
+ */
+ private List getDeletedQuestionList(SessionMap sessionMap) {
+ return getListFromSession(sessionMap, AssessmentConstants.ATTR_DELETED_QUESTION_LIST);
+ }
+
+ /**
+ * If a assessment question has attahment file, and the user edit this question and change the attachment to new file, then
+ * the old file need be deleted when submitting the whole authoring page. Save the file uuid and version id into
+ * Assessmentquestion object for temporarily use.
+ *
+ * @param request
+ * @return
+ */
+ private List getDeletedQuestionAttachmentList(SessionMap sessionMap) {
+ return getListFromSession(sessionMap, AssessmentConstants.ATTR_DELETED_QUESTION_ATTACHMENT_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;
+ }
+
+ /**
+ * Get back relative ActionForward from request.
+ *
+ * @param type
+ * @param mapping
+ * @return
+ */
+ private ActionForward findForward(short type, ActionMapping mapping) {
+ ActionForward forward;
+ switch (type) {
+ case AssessmentConstants.QUESTION_TYPE_CHOICE:
+ forward = mapping.findForward("choice");
+ break;
+ case AssessmentConstants.QUESTION_TYPE_MULTIPLE_CHOICE:
+ forward = mapping.findForward("multiplechoice");
+ break;
+ case AssessmentConstants.QUESTION_TYPE_MATCHING_PAIRS:
+ forward = mapping.findForward("matchingpairs");
+ break;
+ case AssessmentConstants.QUESTION_TYPE_FILL_THE_GAP:
+ forward = mapping.findForward("fillthegap");
+ break;
+ case AssessmentConstants.QUESTION_TYPE_SHORT_ANSWER:
+ forward = mapping.findForward("shortanswer");
+ break;
+ case AssessmentConstants.QUESTION_TYPE_NUMERICAL:
+ forward = mapping.findForward("numerical");
+ break;
+ case AssessmentConstants.QUESTION_TYPE_TRUE_FALSE:
+ forward = mapping.findForward("truefalse");
+ break;
+ case AssessmentConstants.QUESTION_TYPE_ESSAY:
+ forward = mapping.findForward("essay");
+ break;
+ default:
+ forward = null;
+ break;
+ }
+ return forward;
+ }
+
+ /**
+ * This method will populate assessment question information to its form for edit use.
+ *
+ * @param questionIdx
+ * @param question
+ * @param form
+ * @param request
+ */
+ private void populateQuestionToForm(int questionIdx, AssessmentQuestion question, AssessmentQuestionForm form,
+ HttpServletRequest request) {
+ form.setTitle(question.getTitle());
+ form.setQuestion(question.getQuestion());
+ form.setDefaultGrade(String.valueOf(question.getDefaultGrade()));
+ form.setPenaltyFactor(String.valueOf(question.getPenaltyFactor()));
+ form.setGeneralFeedback(question.getGeneralFeedback());
+ form.setFeedbackOnCorrect(question.getFeedbackOnCorrect());
+ form.setFeedbackOnPartiallyCorrect(question.getFeedbackOnPartiallyCorrect());
+ form.setFeedbackOnIncorrect(question.getFeedbackOnIncorrect());
+ form.setShuffle(question.isShuffle());
+ form.setCaseSensitive(question.isCaseSensitive());
+ if (questionIdx >= 0) {
+ form.setQuestionIndex(new Integer(questionIdx).toString());
+ }
+
+ short questionType = question.getType();
+ if (questionType == AssessmentConstants.QUESTION_TYPE_CHOICE) {
+ Set optionList = question.getAnswerOptions();
+ request.setAttribute(AssessmentConstants.ATTR_OPTION_LIST, optionList);
+ }
+ }
+
+ /**
+ * Extract web form content to assessment question.
+ *
+ * @param request
+ * @param optionList
+ * @param questionForm
+ * @throws AssessmentApplicationException
+ */
+ private void extractFormToAssessmentQuestion(HttpServletRequest request, AssessmentQuestionForm questionForm, Set optionList) throws Exception {
+ /*
+ * BE CAREFUL: This method will copy nessary info from request form to an old or new AssessmentQuestion instance. It
+ * gets all info EXCEPT AssessmentQuestion.createDate and AssessmentQuestion.createBy, which need be set when persisting
+ * this assessment Question.
+ */
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(questionForm.getSessionMapID());
+ // check whether it is "edit(old Question)" or "add(new Question)"
+ SortedSet questionList = getQuestionList(sessionMap);
+ int questionIdx = NumberUtils.stringToInt(questionForm.getQuestionIndex(), -1);
+ AssessmentQuestion question = null;
+
+ if (questionIdx == -1) { // add
+ question = new AssessmentQuestion();
+ question.setCreateDate(new Timestamp(new Date().getTime()));
+ int maxSeq = 1;
+ if (questionList != null && questionList.size() > 0) {
+ AssessmentQuestion last = questionList.last();
+ maxSeq = last.getSequenceId() + 1;
+ }
+ question.setSequenceId(maxSeq);
+ questionList.add(question);
+ } else { // edit
+ List rList = new ArrayList(questionList);
+ question = rList.get(questionIdx);
+ }
+ short type = questionForm.getQuestionType();
+ question.setType(questionForm.getQuestionType());
+
+ question.setTitle(questionForm.getTitle());
+ question.setQuestion(questionForm.getQuestion());
+ question.setCreateByAuthor(true);
+ question.setHide(false);
+
+ question.setDefaultGrade(Integer.parseInt(questionForm.getDefaultGrade()));
+ question.setPenaltyFactor(Float.parseFloat(questionForm.getPenaltyFactor()));
+ question.setGeneralFeedback(questionForm.getGeneralFeedback());
+
+ if ((type == AssessmentConstants.QUESTION_TYPE_CHOICE)
+ || (type == AssessmentConstants.QUESTION_TYPE_MULTIPLE_CHOICE)) {
+ question.setShuffle(questionForm.isShuffle());
+ question.setFeedbackOnCorrect(questionForm.getFeedbackOnCorrect());
+ question.setFeedbackOnPartiallyCorrect(questionForm.getFeedbackOnPartiallyCorrect());
+ question.setFeedbackOnIncorrect(questionForm.getFeedbackOnIncorrect());
+
+ // set instructions
+ Set options = new LinkedHashSet();
+ int seqId = 0;
+ for (AssessmentAnswerOption option : optionList) {
+ option.setSequenceId(seqId++);
+ options.add(option);
+ }
+ question.setAnswerOptions(options);
+ }
+
+ }
+
+ /**
+ * Vaidate assessment question regards to their type (url/file/learning object/website zip file)
+ *
+ * @param questionForm
+ * @return
+ */
+ private ActionErrors validateAssessmentQuestion(AssessmentQuestionForm questionForm, Set optionList) {
+ ActionErrors errors = new ActionErrors();
+ if (StringUtils.isBlank(questionForm.getTitle())) {
+ errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(AssessmentConstants.ERROR_MSG_QUESTION_NAME_BLANK));
+ }
+ if (StringUtils.isBlank(questionForm.getQuestion())) {
+ errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(AssessmentConstants.ERROR_MSG_QUESTION_TEXT_BLANK));
+ }
+
+ if (questionForm.getQuestionType() == AssessmentConstants.QUESTION_TYPE_CHOICE) {
+ /* Checks if entered value is integer. */
+ try {
+ Integer.parseInt(questionForm.getDefaultGrade());
+ } catch (NumberFormatException nfe) {
+ errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(
+ AssessmentConstants.ERROR_MSG_DEFAULT_GRADE_WRONG_FORMAT));
+ }
+ try {
+ Float.parseFloat(questionForm.getPenaltyFactor());
+ } catch (NumberFormatException nfe) {
+ errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(
+ AssessmentConstants.ERROR_MSG_PENALTY_FACTOR_WRONG_FORMAT));
+ }
+
+ if (optionList.size() < 2) {
+ errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(AssessmentConstants.ERROR_MSG_NOT_ENOUGH_OPTIONS));
+ }
+ }
+ return errors;
+ }
+
+ /**
+ * Get ToolAccessMode from HttpRequest parameters. Default value is AUTHOR mode.
+ *
+ * @param request
+ * @return
+ */
+ private ToolAccessMode getAccessMode(HttpServletRequest request) {
+ ToolAccessMode mode;
+ String modeStr = request.getParameter(AttributeNames.ATTR_MODE);
+ if (StringUtils.equalsIgnoreCase(modeStr, ToolAccessMode.TEACHER.toString()))
+ mode = ToolAccessMode.TEACHER;
+ else
+ mode = ToolAccessMode.AUTHOR;
+ return mode;
+ }
+
+ /**
+ * Get answer options from HttpRequest
+ *
+ * @param request
+ * @param skipBlankOptions whether the blank options will be preserved or not
+ *
+ */
+ private TreeSet getOptionsFromRequest(HttpServletRequest request, boolean skipBlankOptions) {
+ String list = request.getParameter(AssessmentConstants.ATTR_OPTION_LIST);
+ 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());
+ }request.getParameter("optionAnswer1");
+ }
+
+ int count = NumberUtils.stringToInt(paramMap.get(AssessmentConstants.ATTR_OPTION_COUNT));
+ TreeSet optionList = new TreeSet(new AssessmentAnswerOptionComparator());
+ for (int i = 0; i < count; i++) {
+ String answerString = paramMap.get(AssessmentConstants.ATTR_OPTION_ANSWER_PREFIX + i);
+ float grade = Float.valueOf(paramMap.get(AssessmentConstants.ATTR_OPTION_GRADE_PREFIX + i));
+ String feedback = paramMap.get(AssessmentConstants.ATTR_OPTION_FEEDBACK_PREFIX + i);
+ String sequenceId = paramMap.get(AssessmentConstants.ATTR_OPTION_SEQUENCE_ID_PREFIX + i);
+
+ if ((answerString == null) && skipBlankOptions){
+ continue;
+ }
+ AssessmentAnswerOption option = new AssessmentAnswerOption();
+ option.setSequenceId(NumberUtils.stringToInt(sequenceId));
+ option.setAnswerString(answerString);
+ option.setGrade(grade);
+ option.setFeedback(feedback);
+ optionList.add(option);
+ }
+ return optionList;
+ }
+
+ /**
+ * Get overall feedbacks from HttpRequest
+ *
+ * @param request
+ */
+ private TreeSet getOverallFeedbacksFromRequest(HttpServletRequest request, boolean skipBlankOverallFeedbacks) {
+ int count = NumberUtils.stringToInt(request.getParameter(AssessmentConstants.ATTR_OVERALL_FEEDBACK_COUNT));
+ TreeSet overallFeedbackList = new TreeSet(
+ new AssessmentOverallFeedbackComparator());
+ for (int i = 0; i < count; i++) {
+ String gradeBoundaryStr = request
+ .getParameter(AssessmentConstants.ATTR_OVERALL_FEEDBACK_GRADE_BOUNDARY_PREFIX + i);
+ String feedback = request.getParameter(AssessmentConstants.ATTR_OVERALL_FEEDBACK_FEEDBACK_PREFIX + i);
+ String sequenceId = request.getParameter(AssessmentConstants.ATTR_OVERALL_FEEDBACK_SEQUENCE_ID_PREFIX + i);
+
+ if ((StringUtils.isBlank(feedback) || StringUtils.isBlank(gradeBoundaryStr)) && skipBlankOverallFeedbacks) {
+ continue;
+ }
+ AssessmentOverallFeedback overallFeedback = new AssessmentOverallFeedback();
+ overallFeedback.setSequenceId(NumberUtils.stringToInt(sequenceId));
+ if (!StringUtils.isBlank(gradeBoundaryStr)) {
+ int gradeBoundary = NumberUtils.stringToInt(request
+ .getParameter(AssessmentConstants.ATTR_OVERALL_FEEDBACK_GRADE_BOUNDARY_PREFIX + i));
+ overallFeedback.setGradeBoundary(gradeBoundary);
+ }
+ overallFeedback.setFeedback(feedback);
+ overallFeedbackList.add(overallFeedback);
+ }
+ return overallFeedbackList;
+ }
+
+ /**
+ * Get overall feedbacks from HttpRequest
+ *
+ * @param request
+ */
+ private TreeSet getOverallFeedbacksFromForm(HttpServletRequest request, boolean skipBlankOverallFeedbacks) {
+ String list = request.getParameter(AssessmentConstants.ATTR_OVERALL_FEEDBACK_LIST);
+ 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());
+ }request.getParameter("optionAnswer1");
+ }
+
+
+
+ int count = NumberUtils.stringToInt(paramMap.get(AssessmentConstants.ATTR_OVERALL_FEEDBACK_COUNT));
+ TreeSet overallFeedbackList = new TreeSet(
+ new AssessmentOverallFeedbackComparator());
+ for (int i = 0; i < count; i++) {
+ String gradeBoundaryStr = paramMap
+ .get(AssessmentConstants.ATTR_OVERALL_FEEDBACK_GRADE_BOUNDARY_PREFIX + i);
+ String feedback = paramMap.get(AssessmentConstants.ATTR_OVERALL_FEEDBACK_FEEDBACK_PREFIX + i);
+ String sequenceId = paramMap.get(AssessmentConstants.ATTR_OVERALL_FEEDBACK_SEQUENCE_ID_PREFIX + i);
+
+ if ((StringUtils.isBlank(feedback) || StringUtils.isBlank(gradeBoundaryStr)) && skipBlankOverallFeedbacks) {
+ continue;
+ }
+ AssessmentOverallFeedback overallFeedback = new AssessmentOverallFeedback();
+ overallFeedback.setSequenceId(NumberUtils.stringToInt(sequenceId));
+ if (!StringUtils.isBlank(gradeBoundaryStr)) {
+ int gradeBoundary = NumberUtils.stringToInt(paramMap
+ .get(AssessmentConstants.ATTR_OVERALL_FEEDBACK_GRADE_BOUNDARY_PREFIX + i));
+ overallFeedback.setGradeBoundary(gradeBoundary);
+ }
+ overallFeedback.setFeedback(feedback);
+ overallFeedbackList.add(overallFeedback);
+ }
+ return overallFeedbackList;
+ }
+
+ private ActionMessages validate(AssessmentForm assessmentForm, ActionMapping mapping, HttpServletRequest request) {
+ ActionMessages errors = new ActionMessages();
+ // if (StringUtils.isBlank(assessmentForm.getAssessment().getTitle())) {
+ // ActionMessage error = new ActionMessage("error.resource.question.title.blank");
+ // errors.add(ActionMessages.GLOBAL_MESSAGE, error);
+ // }
+
+ // define it later mode(TEACHER) skip below validation.
+ String modeStr = request.getParameter(AttributeNames.ATTR_MODE);
+ if (StringUtils.equals(modeStr, ToolAccessMode.TEACHER.toString())) {
+ return errors;
+ }
+
+ // Some other validation outside basic Tab.
+
+ return errors;
+ }
+
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/ClearSessionAction.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/ClearSessionAction.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/ClearSessionAction.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -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.web.action;
+
+import javax.servlet.http.HttpSession;
+
+import org.lamsfoundation.lams.authoring.web.LamsAuthoringFinishAction;
+import org.lamsfoundation.lams.tool.ToolAccessMode;
+
+/**
+ * This class give a chance to clear HttpSession when user save/close authoring page.
+ *
+ * @author Steve.Ni
+ *
+ * @version $Revision$
+ */
+public class ClearSessionAction extends LamsAuthoringFinishAction {
+
+ @Override
+ public void clearSession(String customiseSessionID, HttpSession session, ToolAccessMode mode) {
+ if (mode.isAuthor()) {
+ session.removeAttribute(customiseSessionID);
+ }
+ }
+
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/LearningAction.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/LearningAction.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/LearningAction.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,710 @@
+/****************************************************************
+ * 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.web.action;
+
+import java.io.IOException;
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.log4j.Logger;
+import org.apache.struts.action.Action;
+import org.apache.struts.action.ActionErrors;
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+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.AssessmentQuestion;
+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.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;
+import org.lamsfoundation.lams.web.util.SessionMap;
+import org.springframework.web.context.WebApplicationContext;
+import org.springframework.web.context.support.WebApplicationContextUtils;
+
+/**
+ *
+ * @author Andrey Balan
+ *
+ * @version $Revision$
+ */
+public class LearningAction extends Action {
+
+ private static Logger log = Logger.getLogger(LearningAction.class);
+
+ @Override
+ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+
+ String param = mapping.getParameter();
+ // -----------------------Assessment Learner function ---------------------------
+ if (param.equals("start")) {
+ return start(mapping, form, request, response);
+ }
+ if (param.equals("complete")) {
+ return complete(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("addurl")) {
+ return addQuestion(mapping, form, request, response);
+ }
+ if (param.equals("saveOrUpdateQuestion")) {
+ return saveOrUpdateQuestion(mapping, form, request, response);
+ }
+
+ // ================ Reflection =======================
+ if (param.equals("newReflection")) {
+ return newReflection(mapping, form, request, response);
+ }
+ if (param.equals("submitReflection")) {
+ return submitReflection(mapping, form, request, response);
+ }
+
+ return mapping.findForward(AssessmentConstants.ERROR);
+ }
+
+ /**
+ * 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",
+ *
+ */
+ private ActionForward start(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
+
+ // initial 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));
+
+ request.setAttribute(AssessmentConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID());
+ request.setAttribute(AttributeNames.ATTR_MODE, mode);
+ request.setAttribute(AttributeNames.PARAM_TOOL_SESSION_ID, sessionId);
+
+ // 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,
+ AttributeNames.PARAM_USER_ID, false));
+ } else {
+ assessmentUser = getCurrentUser(service, sessionId);
+ }
+
+ List questions = null;
+ Assessment assessment;
+ questions = service.getAssessmentQuestionsBySessionId(sessionId);
+ assessment = service.getAssessmentBySessionId(sessionId);
+
+ // check whehter finish lock is on/off
+ //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,
+ AssessmentConstants.TOOL_SIGNATURE, assessmentUser.getUserId().intValue());
+ if (notebookEntry != null) {
+ entryText = notebookEntry.getEntry();
+ }
+ }
+
+ // basic information
+ 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_USER_FINISHED, assessmentUser != null
+ && assessmentUser.isSessionFinished());
+
+ sessionMap.put(AttributeNames.PARAM_TOOL_SESSION_ID, sessionId);
+ 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()) {
+ return mapping.findForward("defineLater");
+ }
+
+ // set contentInUse flag to true!
+ assessment.setContentInUse(true);
+ assessment.setDefineLater(false);
+ service.saveOrUpdateAssessment(assessment);
+
+ // add run offline support
+ if (assessment.getRunOffline()) {
+ sessionMap.put(AssessmentConstants.PARAM_RUN_OFFLINE, true);
+ return mapping.findForward("runOffline");
+ } else {
+ sessionMap.put(AssessmentConstants.PARAM_RUN_OFFLINE, false);
+ }
+
+ // init assessment question list
+ SortedSet assessmentQuestionList = getAssessmentQuestionList(sessionMap);
+ assessmentQuestionList.clear();
+ if (questions != null) {
+ // remove hidden questions.
+ for (AssessmentQuestion question : questions) {
+ // becuase in webpage will use this login name. Here is just
+ // initial it to avoid session close error in proxy object.
+ if (question.getCreateBy() != null) {
+ question.getCreateBy().getLoginName();
+ }
+ if (!question.isHide()) {
+ assessmentQuestionList.add(question);
+ }
+ }
+ }
+
+ // set complete flag for display purpose
+ if (assessmentUser != null) {
+ service.retrieveComplete(assessmentQuestionList, assessmentUser);
+ }
+ sessionMap.put(AssessmentConstants.ATTR_ASSESSMENT, assessment);
+
+ return mapping.findForward(AssessmentConstants.SUCCESS);
+ }
+
+ /**
+ * Mark assessment question as complete status.
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return
+ */
+ 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);
+ request.setAttribute(AssessmentConstants.ATTR_SESSION_MAP_ID, sessionMapID);
+ return mapping.findForward(AssessmentConstants.SUCCESS);
+ }
+
+ /**
+ * Finish learning session.
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return
+ */
+ private ActionForward finish(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);
+
+ // get mode and ToolSessionID from sessionMAP
+ 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);
+ }
+
+ if (!validateBeforeFinish(request, sessionMapID)) {
+ return mapping.getInputForward();
+ }
+
+ IAssessmentService service = getAssessmentService();
+ // get sessionId from HttpServletRequest
+ String nextActivityUrl = null;
+ try {
+ HttpSession ss = SessionManager.getSession();
+ UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER);
+ Long userID = new Long(user.getUserID().longValue());
+
+ nextActivityUrl = service.finishToolSession(sessionId, userID);
+ request.setAttribute(AssessmentConstants.ATTR_NEXT_ACTIVITY_URL, nextActivityUrl);
+ } catch (AssessmentApplicationException e) {
+ LearningAction.log.error("Failed get next activity url:" + e.getMessage());
+ }
+
+ 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.
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return
+ */
+ private ActionForward newReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
+
+ // get session value
+ String sessionMapID = WebUtil.readStrParam(request, AssessmentConstants.ATTR_SESSION_MAP_ID);
+ if (!validateBeforeFinish(request, sessionMapID)) {
+ return mapping.getInputForward();
+ }
+
+ ReflectionForm refForm = (ReflectionForm) form;
+ HttpSession ss = SessionManager.getSession();
+ UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER);
+
+ refForm.setUserID(user.getUserID());
+ refForm.setSessionMapID(sessionMapID);
+
+ // get the existing reflection entry
+ IAssessmentService submitFilesService = getAssessmentService();
+
+ SessionMap map = (SessionMap) request.getSession().getAttribute(sessionMapID);
+ Long toolSessionID = (Long) map.get(AttributeNames.PARAM_TOOL_SESSION_ID);
+ NotebookEntry entry = submitFilesService.getEntry(toolSessionID, CoreNotebookConstants.NOTEBOOK_TOOL,
+ AssessmentConstants.TOOL_SIGNATURE, user.getUserID());
+
+ if (entry != null) {
+ refForm.setEntryText(entry.getEntry());
+ }
+
+ return mapping.findForward(AssessmentConstants.SUCCESS);
+ }
+
+ /**
+ * Submit reflection form input database.
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return
+ */
+ private ActionForward submitReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
+ ReflectionForm refForm = (ReflectionForm) form;
+ Integer userId = refForm.getUserID();
+
+ String sessionMapID = WebUtil.readStrParam(request, AssessmentConstants.ATTR_SESSION_MAP_ID);
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID);
+ Long sessionId = (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID);
+
+ IAssessmentService service = getAssessmentService();
+
+ // check for existing notebook entry
+ NotebookEntry entry = service.getEntry(sessionId, CoreNotebookConstants.NOTEBOOK_TOOL,
+ AssessmentConstants.TOOL_SIGNATURE, userId);
+
+ if (entry == null) {
+ // create new entry
+ service.createNotebookEntry(sessionId, CoreNotebookConstants.NOTEBOOK_TOOL,
+ AssessmentConstants.TOOL_SIGNATURE, userId, refForm.getEntryText());
+ } else {
+ // update existing entry
+ entry.setEntry(refForm.getEntryText());
+ entry.setLastModified(new Date());
+ service.updateEntry(entry);
+ }
+
+ return finish(mapping, form, request, response);
+ }
+
+ // *************************************************************************************
+ // Private method
+ // *************************************************************************************
+ private boolean validateBeforeFinish(HttpServletRequest request, String sessionMapID) {
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID);
+ Long sessionId = (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID);
+
+ HttpSession ss = SessionManager.getSession();
+ UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER);
+ Long userID = new Long(user.getUserID().longValue());
+
+ IAssessmentService service = getAssessmentService();
+ //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);
+ if (miniViewFlag > 0 && !runOffline) {
+ ActionErrors errors = new ActionErrors();
+ errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("lable.learning.minimum.view.number.less",
+ miniViewFlag));
+ this.addErrors(request, errors);
+ return false;
+ }
+
+ return true;
+ }
+
+ private IAssessmentService getAssessmentService() {
+ WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet()
+ .getServletContext());
+ 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;
+ }
+
+ /**
+ * 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
+ * @param mapping
+ * @return
+ */
+ private ActionForward findForward(short type, ActionMapping mapping) {
+ ActionForward forward;
+ switch (type) {
+ case AssessmentConstants.QUESTION_TYPE_CHOICE:
+ forward = mapping.findForward("url");
+ break;
+ case AssessmentConstants.QUESTION_TYPE_MULTIPLE_CHOICE:
+ forward = mapping.findForward("file");
+ break;
+ case AssessmentConstants.QUESTION_TYPE_MATCHING_PAIRS:
+ forward = mapping.findForward("website");
+ break;
+ case AssessmentConstants.QUESTION_TYPE_FILL_THE_GAP:
+ forward = mapping.findForward("learningobject");
+ break;
+ default:
+ forward = null;
+ break;
+ }
+ return forward;
+ }
+
+ private AssessmentUser getCurrentUser(IAssessmentService service, Long sessionId) {
+ // try to get form system session
+ HttpSession ss = SessionManager.getSession();
+ // get back login user DTO
+ UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER);
+ AssessmentUser assessmentUser = service.getUserByIDAndSession(new Long(user.getUserID().intValue()), sessionId);
+
+ if (assessmentUser == null) {
+ AssessmentSession session = service.getAssessmentSessionBySessionId(sessionId);
+ assessmentUser = new AssessmentUser(user, session);
+ service.createUser(assessmentUser);
+ }
+ return assessmentUser;
+ }
+
+ private AssessmentUser getSpecifiedUser(IAssessmentService service, Long sessionId, Integer userId) {
+ AssessmentUser assessmentUser = service.getUserByIDAndSession(new Long(userId.intValue()), sessionId);
+ if (assessmentUser == null) {
+ LearningAction.log
+ .error("Unable to find specified user for assessment activity. Screens are likely to fail. SessionId="
+ + sessionId + " UserId=" + userId);
+ }
+ 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));
+ }
+
+ if (questionForm.getQuestionType() == AssessmentConstants.QUESTION_TYPE_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;
+ }
+
+ /**
+ * 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);
+
+ 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;
+ }
+ }
+ }
+
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/MonitoringAction.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/MonitoringAction.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/MonitoringAction.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,217 @@
+/****************************************************************
+ * 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.web.action;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.log4j.Logger;
+import org.apache.struts.action.Action;
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+import org.lamsfoundation.lams.notebook.model.NotebookEntry;
+import org.lamsfoundation.lams.notebook.service.CoreNotebookConstants;
+import org.lamsfoundation.lams.tool.assessment.AssessmentConstants;
+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.AssessmentSession;
+import org.lamsfoundation.lams.tool.assessment.model.AssessmentUser;
+import org.lamsfoundation.lams.tool.assessment.service.IAssessmentService;
+import org.lamsfoundation.lams.util.WebUtil;
+import org.lamsfoundation.lams.web.util.AttributeNames;
+import org.lamsfoundation.lams.web.util.SessionMap;
+import org.springframework.web.context.WebApplicationContext;
+import org.springframework.web.context.support.WebApplicationContextUtils;
+
+public class MonitoringAction extends Action {
+ public static Logger log = Logger.getLogger(MonitoringAction.class);
+
+ @Override
+ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ String param = mapping.getParameter();
+
+ request.setAttribute("initialTabId", WebUtil.readLongParam(request, AttributeNames.PARAM_CURRENT_TAB, true));
+
+ if (param.equals("summary")) {
+ return summary(mapping, form, request, response);
+ }
+
+ if (param.equals("listuser")) {
+ return listUser(mapping, form, request, response);
+ }
+ if (param.equals("showQuestion")) {
+ return showQuestion(mapping, form, request, response);
+ }
+ if (param.equals("hideQuestion")) {
+ return hideQuestion(mapping, form, request, response);
+ }
+ if (param.equals("viewReflection")) {
+ return viewReflection(mapping, form, request, response);
+ }
+
+ return mapping.findForward(AssessmentConstants.ERROR);
+ }
+
+ private ActionForward hideQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
+
+ Long itemUid = WebUtil.readLongParam(request, AssessmentConstants.PARAM_QUESTION_UID);
+ IAssessmentService service = getAssessmentService();
+ service.setQuestionVisible(itemUid, false);
+
+ // 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, sessionMap.getSessionID());
+
+ // update session value
+ List groupList = (List) sessionMap.get(AssessmentConstants.ATTR_SUMMARY_LIST);
+ if (groupList != null) {
+ for (List group : groupList) {
+ for (Summary sum : group) {
+ if (itemUid.equals(sum.getQuestionUid())) {
+ sum.setQuestionHide(true);
+ break;
+ }
+ }
+ }
+ }
+
+ return mapping.findForward(AssessmentConstants.SUCCESS);
+ }
+
+ private ActionForward showQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
+ Long itemUid = WebUtil.readLongParam(request, AssessmentConstants.PARAM_QUESTION_UID);
+ IAssessmentService service = getAssessmentService();
+ service.setQuestionVisible(itemUid, true);
+
+ // 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, sessionMap.getSessionID());
+
+ // update session value
+ List groupList = (List) sessionMap.get(AssessmentConstants.ATTR_SUMMARY_LIST);
+ if (groupList != null) {
+ for (List group : groupList) {
+ for (Summary sum : group) {
+ if (itemUid.equals(sum.getQuestionUid())) {
+ sum.setQuestionHide(false);
+ break;
+ }
+ }
+ }
+ }
+ return mapping.findForward(AssessmentConstants.SUCCESS);
+ }
+
+ private ActionForward summary(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
+ // initial Session Map
+ SessionMap sessionMap = new SessionMap();
+ request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap);
+ request.setAttribute(AssessmentConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID());
+ // save contentFolderID into session
+ sessionMap.put(AttributeNames.PARAM_CONTENT_FOLDER_ID, WebUtil.readStrParam(request,
+ AttributeNames.PARAM_CONTENT_FOLDER_ID));
+
+ Long contentId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID);
+ IAssessmentService service = getAssessmentService();
+ List> groupList = service.getSummary(contentId);
+
+ Assessment assessment = service.getAssessmentByContentId(contentId);
+ assessment.toDTO();
+
+ Map> relectList = service.getReflectList(contentId, false);
+
+ // cache into sessionMap
+ sessionMap.put(AssessmentConstants.ATTR_SUMMARY_LIST, groupList);
+ sessionMap.put(AssessmentConstants.PAGE_EDITABLE, assessment.isContentInUse());
+ sessionMap.put(AssessmentConstants.ATTR_ASSESSMENT, assessment);
+ sessionMap.put(AssessmentConstants.ATTR_TOOL_CONTENT_ID, contentId);
+ sessionMap.put(AssessmentConstants.ATTR_REFLECT_LIST, relectList);
+ return mapping.findForward(AssessmentConstants.SUCCESS);
+ }
+
+ private ActionForward listUser(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
+ Long sessionId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID);
+ Long itemUid = WebUtil.readLongParam(request, AssessmentConstants.PARAM_QUESTION_UID);
+
+ // get user list by given item uid
+ IAssessmentService service = getAssessmentService();
+ List list = service.getUserListBySessionQuestion(sessionId, itemUid);
+
+ // set to request
+ request.setAttribute(AssessmentConstants.ATTR_USER_LIST, list);
+ return mapping.findForward(AssessmentConstants.SUCCESS);
+ }
+
+ private ActionForward viewReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
+
+ Long uid = WebUtil.readLongParam(request, AssessmentConstants.ATTR_USER_UID);
+ Long sessionID = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID);
+
+ IAssessmentService service = getAssessmentService();
+ AssessmentUser user = service.getUser(uid);
+ NotebookEntry notebookEntry = service.getEntry(sessionID, CoreNotebookConstants.NOTEBOOK_TOOL,
+ AssessmentConstants.TOOL_SIGNATURE, user.getUserId().intValue());
+
+ AssessmentSession session = service.getAssessmentSessionBySessionId(sessionID);
+
+ ReflectDTO refDTO = new ReflectDTO(user);
+ if (notebookEntry == null) {
+ refDTO.setFinishReflection(false);
+ refDTO.setReflect(null);
+ } else {
+ refDTO.setFinishReflection(true);
+ refDTO.setReflect(notebookEntry.getEntry());
+ }
+ refDTO.setReflectInstrctions(session.getAssessment().getReflectInstructions());
+
+ request.setAttribute("userDTO", refDTO);
+ return mapping.findForward("success");
+ }
+
+ // *************************************************************************************
+ // Private method
+ // *************************************************************************************
+ private IAssessmentService getAssessmentService() {
+ WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet()
+ .getServletContext());
+ return (IAssessmentService) wac.getBean(AssessmentConstants.ASSESSMENT_SERVICE);
+ }
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/form/AssessmentForm.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/form/AssessmentForm.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/form/AssessmentForm.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,131 @@
+/****************************************************************
+ * 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.web.form;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.log4j.Logger;
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionMapping;
+import org.apache.struts.upload.FormFile;
+import org.lamsfoundation.lams.tool.assessment.model.Assessment;
+
+/**
+ *
+ * Assessment Form.
+ *
+ * @struts.form name="assessmentForm"
+ *
+ * @author Andrey Balan
+ */
+public class AssessmentForm extends ActionForm {
+ private static final long serialVersionUID = 3599879328307492312L;
+
+ private static Logger logger = Logger.getLogger(AssessmentForm.class.getName());
+
+ // Forum fields
+ private String sessionMapID;
+ private String contentFolderID;
+ private int currentTab;
+ private FormFile offlineFile;
+ private FormFile onlineFile;
+
+ private Assessment assessment;
+
+ public AssessmentForm() {
+ assessment = new Assessment();
+ assessment.setTitle("Shared Assessment");
+ currentTab = 1;
+ }
+
+ public void setAssessment(Assessment assessment) {
+ this.assessment = assessment;
+ // set Form special varaible from given forum
+ if (assessment == null) {
+ logger.error("Initial AssessmentForum failed by null value of Assessment.");
+ }
+ }
+
+ public void reset(ActionMapping mapping, HttpServletRequest request) {
+ String param = mapping.getParameter();
+ // if it is start page, all data read out from database or current session
+ // so need not reset checkbox to refresh value!
+ if (!StringUtils.equals(param, "start") && !StringUtils.equals(param, "initPage")) {
+ assessment.setAllowGradesAfterAttempt(false);
+ assessment.setAllowOverallFeedbackAfterQuestion(false);
+ assessment.setAllowQuestionFeedback(false);
+ assessment.setAllowRightWrongAnswersAfterQuestion(false);
+ assessment.setDefineLater(false);
+ assessment.setShuffled(false);
+ assessment.setRunOffline(false);
+ assessment.setReflectOnActivity(false);
+ }
+ }
+
+ public int getCurrentTab() {
+ return currentTab;
+ }
+
+ public void setCurrentTab(int currentTab) {
+ this.currentTab = currentTab;
+ }
+
+ public FormFile getOfflineFile() {
+ return offlineFile;
+ }
+
+ public void setOfflineFile(FormFile offlineFile) {
+ this.offlineFile = offlineFile;
+ }
+
+ public FormFile getOnlineFile() {
+ return onlineFile;
+ }
+
+ public void setOnlineFile(FormFile onlineFile) {
+ this.onlineFile = onlineFile;
+ }
+
+ public Assessment getAssessment() {
+ return assessment;
+ }
+
+ public String getSessionMapID() {
+ return sessionMapID;
+ }
+
+ public void setSessionMapID(String sessionMapID) {
+ this.sessionMapID = sessionMapID;
+ }
+
+ public String getContentFolderID() {
+ return contentFolderID;
+ }
+
+ public void setContentFolderID(String contentFolderID) {
+ this.contentFolderID = contentFolderID;
+ }
+
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/form/AssessmentQuestionForm.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/form/AssessmentQuestionForm.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/form/AssessmentQuestionForm.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,177 @@
+/****************************************************************
+ * 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.web.form;
+
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.upload.FormFile;
+
+/**
+ * Assessment Question Form.
+ *
+ * @struts.form name="assessmentQuestionForm"
+ * @author Andrey Balan
+ */
+public class AssessmentQuestionForm extends ActionForm {
+ private static final long serialVersionUID = 4900738305713649389L;
+
+ private String questionIndex;
+ private String sessionMapID;
+ private String contentFolderID;
+
+ // tool access mode;
+ private String mode;
+
+ private short questionType;
+ private String title;
+ private String question;
+ private String defaultGrade;
+ private String penaltyFactor;
+ private String generalFeedback;
+ private String feedbackOnCorrect;
+ private String feedbackOnPartiallyCorrect;
+ private String feedbackOnIncorrect;
+ private boolean shuffle;
+ private boolean caseSensitive;
+
+ public String getSessionMapID() {
+ return sessionMapID;
+ }
+
+ public void setSessionMapID(String sessionMapID) {
+ this.sessionMapID = sessionMapID;
+ }
+
+ public String getContentFolderID() {
+ return contentFolderID;
+ }
+
+ public void setContentFolderID(String contentFolderID) {
+ this.contentFolderID = contentFolderID;
+ }
+
+ public String getMode() {
+ return mode;
+ }
+
+ public void setMode(String mode) {
+ this.mode = mode;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getQuestion() {
+ return question;
+ }
+
+ public void setQuestion(String question) {
+ this.question = question;
+ }
+
+ public String getQuestionIndex() {
+ return questionIndex;
+ }
+
+ public void setQuestionIndex(String questionIndex) {
+ this.questionIndex = questionIndex;
+ }
+
+ public short getQuestionType() {
+ return questionType;
+ }
+
+ public void setQuestionType(short type) {
+ this.questionType = type;
+ }
+
+ public String getDefaultGrade() {
+ return defaultGrade;
+ }
+
+ public void setDefaultGrade(String defaultGrade) {
+ this.defaultGrade = defaultGrade;
+ }
+
+ public String getPenaltyFactor() {
+ return penaltyFactor;
+ }
+
+ public void setPenaltyFactor(String penaltyFactor) {
+ this.penaltyFactor = penaltyFactor;
+ }
+
+ public String getGeneralFeedback() {
+ return generalFeedback;
+ }
+
+ public void setGeneralFeedback(String generalFeedback) {
+ this.generalFeedback = generalFeedback;
+ }
+
+ public String getFeedbackOnCorrect() {
+ return feedbackOnCorrect;
+ }
+
+ public void setFeedbackOnCorrect(String feedbackOnCorrect) {
+ this.feedbackOnCorrect = feedbackOnCorrect;
+ }
+
+ public String getFeedbackOnPartiallyCorrect() {
+ return feedbackOnPartiallyCorrect;
+ }
+
+ public void setFeedbackOnPartiallyCorrect(String feedbackOnPartiallyCorrect) {
+ this.feedbackOnPartiallyCorrect = feedbackOnPartiallyCorrect;
+ }
+
+ public String getFeedbackOnIncorrect() {
+ return feedbackOnIncorrect;
+ }
+
+ public void setFeedbackOnIncorrect(String feedbackOnIncorrect) {
+ this.feedbackOnIncorrect = feedbackOnIncorrect;
+ }
+
+ public boolean isShuffle() {
+ return shuffle;
+ }
+
+ public void setShuffle(boolean shuffle) {
+ this.shuffle = shuffle;
+ }
+
+ public boolean isCaseSensitive() {
+ return caseSensitive;
+ }
+
+ public void setCaseSensitive(boolean caseSensitive) {
+ this.caseSensitive = caseSensitive;
+ }
+
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/form/ReflectionForm.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/form/ReflectionForm.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/form/ReflectionForm.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,71 @@
+/****************************************************************
+ * 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.web.form;
+
+import org.apache.log4j.Logger;
+import org.apache.struts.validator.ValidatorForm;
+
+/**
+ *
+ * Reflection Form.
+ *
+ * @struts.form name="reflectionForm"
+ *
+ * @author Andrey Balan
+ *
+ */
+public class ReflectionForm extends ValidatorForm {
+ private static final long serialVersionUID = -9054365604649146735L;
+ private static Logger logger = Logger.getLogger(ReflectionForm.class.getName());
+
+ private Integer userID;
+ private String sessionMapID;
+ private String entryText;
+
+ public String getEntryText() {
+ return entryText;
+ }
+
+ public void setEntryText(String entryText) {
+ this.entryText = entryText;
+ }
+
+ public Integer getUserID() {
+ return userID;
+ }
+
+ public void setUserID(Integer userUid) {
+ this.userID = userUid;
+ }
+
+ public String getSessionMapID() {
+ return sessionMapID;
+ }
+
+ public void setSessionMapID(String sessionMapID) {
+ this.sessionMapID = sessionMapID;
+ }
+
+}
Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/servlet/ExportServlet.java
===================================================================
diff -u
--- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/servlet/ExportServlet.java (revision 0)
+++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/servlet/ExportServlet.java (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,282 @@
+/****************************************************************
+ * 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.web.servlet;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.log4j.Logger;
+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.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.AssessmentSession;
+import org.lamsfoundation.lams.tool.assessment.model.AssessmentUser;
+import org.lamsfoundation.lams.tool.assessment.service.AssessmentApplicationException;
+import org.lamsfoundation.lams.tool.assessment.service.AssessmentServiceProxy;
+import org.lamsfoundation.lams.tool.assessment.service.IAssessmentService;
+import org.lamsfoundation.lams.tool.assessment.util.AssessmentToolContentHandler;
+import org.lamsfoundation.lams.tool.assessment.util.ReflectDTOComparator;
+import org.lamsfoundation.lams.util.FileUtil;
+import org.lamsfoundation.lams.web.servlet.AbstractExportPortfolioServlet;
+import org.lamsfoundation.lams.web.util.AttributeNames;
+import org.lamsfoundation.lams.web.util.SessionMap;
+import org.springframework.web.context.WebApplicationContext;
+import org.springframework.web.context.support.WebApplicationContextUtils;
+
+/**
+ * Export portfolio servlet to export all shared assessment into offline HTML package.
+ *
+ * @author Steve.Ni
+ *
+ * @version $Revision$
+ */
+public class ExportServlet extends AbstractExportPortfolioServlet {
+ private static final long serialVersionUID = -4529093489007108143L;
+
+ private static Logger logger = Logger.getLogger(ExportServlet.class);
+
+ private final String FILENAME = "shared_assessment_main.html";
+
+ private AssessmentToolContentHandler handler;
+
+ private IAssessmentService service;
+
+ @Override
+ public void init() throws ServletException {
+ service = AssessmentServiceProxy.getAssessmentService(getServletContext());
+ super.init();
+ }
+
+ public String doExport(HttpServletRequest request, HttpServletResponse response, String directoryName,
+ Cookie[] cookies) {
+
+ // initial sessionMap
+ SessionMap sessionMap = new SessionMap();
+ request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap);
+
+ try {
+ if (StringUtils.equals(mode, ToolAccessMode.LEARNER.toString())) {
+ sessionMap.put(AttributeNames.ATTR_MODE, ToolAccessMode.LEARNER);
+ learner(request, response, directoryName, cookies, sessionMap);
+ } else if (StringUtils.equals(mode, ToolAccessMode.TEACHER.toString())) {
+ sessionMap.put(AttributeNames.ATTR_MODE, ToolAccessMode.TEACHER);
+ teacher(request, response, directoryName, cookies, sessionMap);
+ }
+ } catch (AssessmentApplicationException e) {
+ logger.error("Cannot perform export for assessment tool.");
+ }
+
+ String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
+ + request.getContextPath();
+ writeResponseToFile(basePath + "/pages/export/exportportfolio.jsp?sessionMapID=" + sessionMap.getSessionID(),
+ directoryName, FILENAME, cookies);
+
+ return FILENAME;
+ }
+
+ protected String doOfflineExport(HttpServletRequest request, HttpServletResponse response, String directoryName,
+ Cookie[] cookies) {
+ if (toolContentID == null && toolSessionID == null) {
+ logger.error("Tool content Id or and session Id are null. Unable to activity title");
+ } else {
+
+ Assessment content = null;
+ if (toolContentID != null) {
+ content = service.getAssessmentByContentId(toolContentID);
+ } else {
+ AssessmentSession session = service.getAssessmentSessionBySessionId(toolSessionID);
+ if (session != null)
+ content = session.getAssessment();
+ }
+ if (content != null) {
+ activityTitle = content.getTitle();
+ }
+ }
+ return super.doOfflineExport(request, response, directoryName, cookies);
+ }
+
+ public void learner(HttpServletRequest request, HttpServletResponse response, String directoryName,
+ Cookie[] cookies, HashMap sessionMap) throws AssessmentApplicationException {
+
+ if (userID == null || toolSessionID == null) {
+ String error = "Tool session Id or user Id is null. Unable to continue";
+ logger.error(error);
+ throw new AssessmentApplicationException(error);
+ }
+
+ AssessmentUser learner = service.getUserByIDAndSession(userID, toolSessionID);
+
+ if (learner == null) {
+ String error = "The user with user id " + userID + " does not exist.";
+ logger.error(error);
+ throw new AssessmentApplicationException(error);
+ }
+
+ Assessment content = service.getAssessmentBySessionId(toolSessionID);
+
+ if (content == null) {
+ String error = "The content for this activity has not been defined yet.";
+ logger.error(error);
+ throw new AssessmentApplicationException(error);
+ }
+
+ List group = service.exportBySessionId(toolSessionID, true);
+ saveFileToLocal(group, directoryName);
+
+ List groupList = new ArrayList();
+ if (group.size() > 0)
+ groupList.add(group);
+
+ // Add flag to indicate whether to render user notebook entries
+ sessionMap.put(AssessmentConstants.ATTR_REFLECTION_ON, content.isReflectOnActivity());
+
+ // Create reflectList if reflection is enabled.
+ if (content.isReflectOnActivity()) {
+ // Create reflectList, need to follow same structure used in teacher
+ // see service.getReflectList();
+ Map> map = new HashMap>();
+ Set reflectDTOSet = new TreeSet(new ReflectDTOComparator());
+ reflectDTOSet.add(getReflectionEntry(learner));
+ map.put(toolSessionID, reflectDTOSet);
+
+ // Add reflectList to sessionMap
+ sessionMap.put(AssessmentConstants.ATTR_REFLECT_LIST, map);
+ }
+
+ sessionMap.put(AssessmentConstants.ATTR_TITLE, content.getTitle());
+ sessionMap.put(AssessmentConstants.ATTR_INSTRUCTIONS, content.getInstructions());
+ sessionMap.put(AssessmentConstants.ATTR_SUMMARY_LIST, groupList);
+ }
+
+ public void teacher(HttpServletRequest request, HttpServletResponse response, String directoryName,
+ Cookie[] cookies, HashMap sessionMap) throws AssessmentApplicationException {
+
+ // check if toolContentId exists in db or not
+ if (toolContentID == null) {
+ String error = "Tool Content Id is missing. Unable to continue";
+ logger.error(error);
+ throw new AssessmentApplicationException(error);
+ }
+
+ Assessment content = service.getAssessmentByContentId(toolContentID);
+
+ if (content == null) {
+ String error = "Data is missing from the database. Unable to Continue";
+ logger.error(error);
+ throw new AssessmentApplicationException(error);
+ }
+ List> groupList = service.exportByContentId(toolContentID);
+ if (groupList != null) {
+ for (List list : groupList) {
+ saveFileToLocal(list, directoryName);
+ }
+ }
+
+ // Add flag to indicate whether to render user notebook entries
+ sessionMap.put(AssessmentConstants.ATTR_REFLECTION_ON, content.isReflectOnActivity());
+
+ // Create reflectList if reflection is enabled.
+ if (content.isReflectOnActivity()) {
+ Map> reflectList = service.getReflectList(content.getContentId(), true);
+ // Add reflectList to sessionMap
+ sessionMap.put(AssessmentConstants.ATTR_REFLECT_LIST, reflectList);
+ }
+
+ // put it into HTTPSession
+ sessionMap.put(AssessmentConstants.ATTR_TITLE, content.getTitle());
+ sessionMap.put(AssessmentConstants.ATTR_INSTRUCTIONS, content.getInstructions());
+ sessionMap.put(AssessmentConstants.ATTR_SUMMARY_LIST, groupList);
+ }
+
+ private void saveFileToLocal(List list, String directoryName) {
+ handler = getToolContentHandler();
+ for (Summary summary : list) {
+ // for learning object, it just display "No offlice pakcage avaliable" information.
+ if (summary.getQuestionType() == AssessmentConstants.QUESTION_TYPE_FILL_THE_GAP
+ || summary.getQuestionType() == AssessmentConstants.QUESTION_TYPE_CHOICE)
+ continue;
+ try {
+ int idx = 1;
+ String userName = summary.getUsername();
+ String localDir;
+ while (true) {
+ localDir = FileUtil.getFullPath(directoryName, userName + "/" + idx);
+ File local = new File(localDir);
+ if (!local.exists()) {
+ local.mkdirs();
+ break;
+ }
+ idx++;
+ }
+// summary.setAttachmentLocalUrl(userName + "/" + idx + "/" + summary.getFileUuid() + '.'
+// + FileUtil.getFileExtension(summary.getFileName()));
+// handler.saveFile(summary.getFileUuid(), FileUtil.getFullPath(directoryName, summary
+// .getAttachmentLocalUrl()));
+ } catch (Exception e) {
+ logger.error("Export forum topic attachment failed: " + e.toString());
+ }
+ }
+
+ }
+
+ private AssessmentToolContentHandler getToolContentHandler() {
+ if (handler == null) {
+ WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(this
+ .getServletContext());
+ handler = (AssessmentToolContentHandler) wac.getBean(AssessmentConstants.TOOL_CONTENT_HANDLER_NAME);
+ }
+ return handler;
+ }
+
+ private ReflectDTO getReflectionEntry(AssessmentUser assessmentUser) {
+ ReflectDTO reflectDTO = new ReflectDTO(assessmentUser);
+ NotebookEntry notebookEntry = service.getEntry(assessmentUser.getSession().getSessionId(),
+ CoreNotebookConstants.NOTEBOOK_TOOL, AssessmentConstants.TOOL_SIGNATURE, assessmentUser.getUserId()
+ .intValue());
+
+ // check notebookEntry is not null
+ if (notebookEntry != null) {
+ reflectDTO.setReflect(notebookEntry.getEntry());
+ logger.debug("Could not find notebookEntry for AssessmentUser: " + assessmentUser.getUid());
+ }
+ return reflectDTO;
+ }
+}
Index: lams_tool_assessment/web/403.jsp
===================================================================
diff -u
--- lams_tool_assessment/web/403.jsp (revision 0)
+++ lams_tool_assessment/web/403.jsp (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,6 @@
+<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %>
+<%@ taglib uri="tags-lams" prefix="lams"%>
+<%@ taglib uri="tags-core" prefix="c" %>
+
+
+
Index: lams_tool_assessment/web/404.jsp
===================================================================
diff -u
--- lams_tool_assessment/web/404.jsp (revision 0)
+++ lams_tool_assessment/web/404.jsp (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,8 @@
+<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %>
+<%@ taglib uri="tags-lams" prefix="lams"%>
+<%@ taglib uri="tags-core" prefix="c" %>
+
+
+
+
+
Index: lams_tool_assessment/web/WEB-INF/.cvsignore
===================================================================
diff -u
--- lams_tool_assessment/web/WEB-INF/.cvsignore (revision 0)
+++ lams_tool_assessment/web/WEB-INF/.cvsignore (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,4 @@
+lib
+struts-config.xml
+validation.xml
+classes
Index: lams_tool_assessment/web/WEB-INF/tags/AuthoringButton.tag
===================================================================
diff -u
--- lams_tool_assessment/web/WEB-INF/tags/AuthoringButton.tag (revision 0)
+++ lams_tool_assessment/web/WEB-INF/tags/AuthoringButton.tag (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,94 @@
+<%
+/****************************************************************
+ * 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
+ * ****************************************************************
+ */
+
+ /**
+ * AuthoringButton.tag
+ * Author: Dapeng Ni
+ * Description: Creates the save/cancel button for authoring page
+ */
+
+ %>
+<%@ tag body-content="scriptless" %>
+<%@ taglib uri="tags-core" prefix="c" %>
+<%@ taglib uri="tags-fmt" prefix="fmt" %>
+<%@ taglib uri="tags-html" prefix="html" %>
+
+<%@ attribute name="formID" required="true" rtexprvalue="true" %>
+<%@ attribute name="toolSignature" required="true" rtexprvalue="true" %>
+<%@ attribute name="toolContentID" required="true" rtexprvalue="true" %>
+<%@ attribute name="contentFolderID" required="true" rtexprvalue="true" %>
+<%@ attribute name="clearSessionActionUrl" required="true" rtexprvalue="true" %>
+
+<%-- Optional attribute --%>
+<%@ attribute name="accessMode" required="false" rtexprvalue="true" %>
+<%@ attribute name="cancelButtonLabelKey" required="false" rtexprvalue="true" %>
+<%@ attribute name="saveButtonLabelKey" required="false" rtexprvalue="true" %>
+<%@ attribute name="cancelConfirmMsgKey" required="false" rtexprvalue="true" %>
+<%@ attribute name="defineLater" required="false" rtexprvalue="true" %>
+<%@ attribute name="customiseSessionID" required="false" rtexprvalue="true" %>
+
+<%-- Default value for message key --%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_assessment/web/WEB-INF/tags/Date.tag
===================================================================
diff -u
--- lams_tool_assessment/web/WEB-INF/tags/Date.tag (revision 0)
+++ lams_tool_assessment/web/WEB-INF/tags/Date.tag (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,52 @@
+<%
+/****************************************************************
+ * 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
+ * ****************************************************************
+ */
+
+ /**
+ * Author: Fiona Malikoff
+ * Description: Format a date, using the locale, based on standard parameters.
+ * Need to use long for the date otherwise the AU locale comes out as 1/2/06 and
+ * full is needed to include the timezone.
+ */
+
+ %>
+<%@ tag body-content="empty" %>
+<%@ attribute name="value" required="true" rtexprvalue="true" type="java.util.Date" %>
+<%@ attribute name="style" required="false" rtexprvalue="true"%>
+<%@ attribute name="type" required="false" rtexprvalue="true"%>
+
+<%@ taglib uri="tags-fmt" prefix="fmt" %>
+<%@ taglib uri="tags-core" prefix="c" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_assessment/web/WEB-INF/tags/DefineLater.tag
===================================================================
diff -u
--- lams_tool_assessment/web/WEB-INF/tags/DefineLater.tag (revision 0)
+++ lams_tool_assessment/web/WEB-INF/tags/DefineLater.tag (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,58 @@
+
+<%
+ /****************************************************************
+ * 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
+ * ****************************************************************
+ */
+
+ /**
+ * DefineLater.tag
+ * Author: Fiona Malikoff
+ * Description: Layout for "Define Later" screens - to be used in learning.
+ * A suggested layout - unless the tool has special requirements, this layout should be used.
+ * Expects to be used inside
+ */
+%>
+
+<%@ tag body-content="scriptless"%>
+<%@ taglib uri="tags-fmt" prefix="fmt"%>
+<%@ taglib uri="tags-core" prefix="c"%>
+
+<%@ attribute name="defineLaterMessageKey" required="false"
+ rtexprvalue="true"%>
+<%@ attribute name="buttonTryAgainKey" required="false"
+ rtexprvalue="true"%>
+
+<%-- Default value for I18N keys --%>
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_assessment/web/WEB-INF/tags/ExportPortOutput.tag
===================================================================
diff -u
--- lams_tool_assessment/web/WEB-INF/tags/ExportPortOutput.tag (revision 0)
+++ lams_tool_assessment/web/WEB-INF/tags/ExportPortOutput.tag (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,59 @@
+<%
+/****************************************************************
+ * 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
+ * ****************************************************************
+ */
+
+ /**
+ * Passon
+ * Author: Fiona Malikoff
+ * Description: Outputs the Activity details on the main page in export portfolio. Recursive tag.
+ *
+ */
+
+ %>
+<%@ tag body-content="empty" %>
+<%@ attribute name="actport" required="true" rtexprvalue="true" type="org.lamsfoundation.lams.learning.export.ActivityPortfolio" %>
+<%@ taglib uri="tags-core" prefix="c" %>
+<%@ taglib uri="tags-lams" prefix="lams" %>
+
+
+
+
+ " target="_blank"/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_assessment/web/WEB-INF/tags/FCKEditor.tag
===================================================================
diff -u
--- lams_tool_assessment/web/WEB-INF/tags/FCKEditor.tag (revision 0)
+++ lams_tool_assessment/web/WEB-INF/tags/FCKEditor.tag (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,57 @@
+<%@ taglib uri="tags-core" prefix="c"%>
+<%@ taglib uri="tags-lams" prefix="lams"%>
+<%@ taglib uri="fck-editor" prefix="fck"%>
+
+<%@ attribute name="id" required="true" rtexprvalue="true"%>
+<%@ attribute name="value" required="true" rtexprvalue="true"%>
+<%@ attribute name="toolbarSet" required="false" rtexprvalue="true"%>
+<%@ attribute name="contentFolderID" required="false" rtexprvalue="true"%>
+
+
+
+
+
+
+
+
+
+/fckeditor/
+
+
+
+
+ ${value}
+
+
+
+
+
Index: lams_tool_assessment/web/WEB-INF/tags/Head.tag
===================================================================
diff -u
--- lams_tool_assessment/web/WEB-INF/tags/Head.tag (revision 0)
+++ lams_tool_assessment/web/WEB-INF/tags/Head.tag (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,41 @@
+<%/****************************************************************
+ * 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
+ * ****************************************************************
+ */
+
+/**
+ * Head.tag
+ * Author: Fiona Malikoff
+ * Description: Sets up the non-cache pragma statements and the UTF-8
+ * encoding. Use in place of the normal head tag.
+ */
+%>
+
+<%@ tag body-content="scriptless"%>
+
+
+
+
+
+
+
+
+
Index: lams_tool_assessment/web/WEB-INF/tags/ImgButtonWrapper.tag
===================================================================
diff -u
--- lams_tool_assessment/web/WEB-INF/tags/ImgButtonWrapper.tag (revision 0)
+++ lams_tool_assessment/web/WEB-INF/tags/ImgButtonWrapper.tag (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,37 @@
+<%
+/****************************************************************
+ * 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
+ * ****************************************************************
+ */
+
+ /**
+ * ImgButtonWrapper.tag
+ * Author: Mitchell Seaton
+ * Description: Simple wrapper that will display buttons correctly when RTL page rendering is used.
+ */
+
+ %>
+<%@ tag body-content="scriptless" %>
+
+
+
+
+
Index: lams_tool_assessment/web/WEB-INF/tags/LearnerFlashEnabled.tag
===================================================================
diff -u
--- lams_tool_assessment/web/WEB-INF/tags/LearnerFlashEnabled.tag (revision 0)
+++ lams_tool_assessment/web/WEB-INF/tags/LearnerFlashEnabled.tag (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -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 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
+ * ****************************************************************
+ */
+
+ /**
+ * Learner Flash Enabled
+ * Author: Fiona Malikoff
+ * Description: Is Flash enabled for learner?
+ *
+ */
+
+ %>
+<%@ tag body-content="empty" %>
+<%@ taglib uri="tags-core" prefix="c" %>
+<%@ taglib uri="tags-lams" prefix="lams" %>
+
+
+
+
+
+ true
+ false
+
+
+
Index: lams_tool_assessment/web/WEB-INF/tags/Passon.tag
===================================================================
diff -u
--- lams_tool_assessment/web/WEB-INF/tags/Passon.tag (revision 0)
+++ lams_tool_assessment/web/WEB-INF/tags/Passon.tag (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,86 @@
+<%
+/****************************************************************
+ * 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
+ * ****************************************************************
+ */
+
+ /**
+ * Passon
+ * Author: Mitchell Seaton
+ * Description: Passes on progress data to the Flash Learner to update the progress bar.
+ *
+ */
+
+ %>
+<%@ tag body-content="empty" %>
+<%@ attribute name="progress" required="true" rtexprvalue="true" type="java.lang.String" %>
+<%@ attribute name="version" required="false" rtexprvalue="true" %>
+<%@ attribute name="id" required="true" rtexprvalue="true" %>
+<%@ attribute name="redirect" required="false" rtexprvalue="true" %>
+<%@ taglib uri="tags-core" prefix="c" %>
+<%@ taglib uri="tags-lams" prefix="lams" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_assessment/web/WEB-INF/tags/ProgressOutput.tag
===================================================================
diff -u
--- lams_tool_assessment/web/WEB-INF/tags/ProgressOutput.tag (revision 0)
+++ lams_tool_assessment/web/WEB-INF/tags/ProgressOutput.tag (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,79 @@
+<%
+/****************************************************************
+ * 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
+ * ****************************************************************
+ */
+
+ /**
+ * Progress Output
+ * Author: Fiona Malikoff
+ * Description: Outputs the Activity details on the jsp progress page. Recursive tag
+ *
+ */
+
+ /** Need to add current ! */
+
+ %>
+<%@ tag body-content="empty" %>
+<%@ attribute name="activity" required="true" rtexprvalue="true" type="org.lamsfoundation.lams.learning.web.bean.ActivityURL" %>
+<%@ taglib uri="tags-core" prefix="c" %>
+<%@ taglib uri="tags-lams" prefix="lams" %>
+
+
+
Index: lams_tool_assessment/web/WEB-INF/tags/Tab.tag
===================================================================
diff -u
--- lams_tool_assessment/web/WEB-INF/tags/Tab.tag (revision 0)
+++ lams_tool_assessment/web/WEB-INF/tags/Tab.tag (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -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 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
+ * ****************************************************************
+ */
+
+ /**
+ * Tab.tag
+ * Author: Mitchell Seaton
+ * Description: Creates a tab element.
+ * Wiki:
+ */
+%>
+<%@ tag body-content="empty"%>
+<%@ attribute name="id" required="true" rtexprvalue="true"%>
+<%@ attribute name="value" required="false" rtexprvalue="true"%>
+<%@ attribute name="key" required="false" rtexprvalue="true"%>
+<%@ attribute name="inactive" required="false" rtexprvalue="true"%>
+<%@ attribute name="methodCall" required="false" rtexprvalue="true"%>
+
+<%@ taglib uri="tags-core" prefix="c"%>
+<%@ taglib uri="tags-fmt" prefix="fmt"%>
+<%@ taglib uri="tags-lams" prefix="lams"%>
+
+<%-- Check if bundle is set --%>
+
+
+
+
+
+
+
+
+
+
+<%--
+ Usually methodCall is selectTab, but the calling code can override methodCall if desired.
+ this is handy if the page needs different logic on initialisation and user switching tabs
+--%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_assessment/web/WEB-INF/tags/TabBody.tag
===================================================================
diff -u
--- lams_tool_assessment/web/WEB-INF/tags/TabBody.tag (revision 0)
+++ lams_tool_assessment/web/WEB-INF/tags/TabBody.tag (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,52 @@
+<%/****************************************************************
+ * 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
+ * ****************************************************************
+ */
+
+/**
+ * TabBody.tag
+ * Author: Mitchell Seaton
+ * Description: Creates the body container for a tab element
+ * Wiki:
+ */
+
+ %>
+<%@ tag body-content="scriptless"%>
+<%@ attribute name="id" required="true" rtexprvalue="true"%>
+<%@ attribute name="tabTitle" required="false" rtexprvalue="true"%>
+<%@ attribute name="titleKey" required="false" rtexprvalue="true"%>
+<%@ attribute name="page" required="false" rtexprvalue="true"%>
+<%@ taglib uri="tags-core" prefix="c"%>
+<%@ taglib uri="tags-bean" prefix="bean"%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_assessment/web/WEB-INF/tags/TabName.tag
===================================================================
diff -u
--- lams_tool_assessment/web/WEB-INF/tags/TabName.tag (revision 0)
+++ lams_tool_assessment/web/WEB-INF/tags/TabName.tag (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,60 @@
+<%/****************************************************************
+ * 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
+ * ****************************************************************
+ */
+
+/**
+ * TabName Tag
+ * Author: Mitchell Seaton
+ * Description: Shortens name that are too long to fit inside a tab
+ */
+
+ %>
+<%@ tag body-content="scriptless" %>
+
+<%@ attribute name="url" required="true" rtexprvalue="true"%>
+<%@ attribute name="highlight" required="false" rtexprvalue="true" %>
+
+<%@ taglib uri="tags-core" prefix="c"%>
+<%@ taglib uri="tags-function" prefix="fn"%>
+
+12
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_assessment/web/WEB-INF/tags/Tabs.tag
===================================================================
diff -u
--- lams_tool_assessment/web/WEB-INF/tags/Tabs.tag (revision 0)
+++ lams_tool_assessment/web/WEB-INF/tags/Tabs.tag (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,69 @@
+<%/****************************************************************
+ * 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
+ * ****************************************************************
+ */
+
+/**
+ * Tabs.tag
+ * Author: Mitchell Seaton
+ * Description: Create a tab list from a input collection or nested Tab tags.
+ * Wiki:
+ */
+
+ %>
+<%@ tag body-content="scriptless"%>
+<%@ attribute name="collection" type="java.util.Collection" required="false" rtexprvalue="true"%>
+<%@ attribute name="control" required="false" rtexprvalue="true"%>
+<%@ attribute name="useKey" required="false" rtexprvalue="true"%>
+<%@ taglib uri="tags-core" prefix="c"%>
+<%@ taglib uri="tags-lams" prefix="lams"%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_assessment/web/WEB-INF/tags/headItems.tag
===================================================================
diff -u
--- lams_tool_assessment/web/WEB-INF/tags/headItems.tag (revision 0)
+++ lams_tool_assessment/web/WEB-INF/tags/headItems.tag (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,52 @@
+<%/****************************************************************
+ * 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
+ * ****************************************************************
+ */
+
+/**
+ * Standard Head Items
+ * Author: Fiona Malikoff
+ * Description: Includes all the standard head items e.g. the
+ * lams css files, sets the content type, standard javascript files.
+ */
+
+ %>
+<%@ tag body-content="empty"%>
+
+<%@ taglib uri="tags-core" prefix="c"%>
+<%@ taglib uri="tags-lams" prefix="lams"%>
+<%@ taglib uri="tags-fmt" prefix="fmt"%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_assessment/web/WEB-INF/tiles-defs.xml
===================================================================
diff -u
--- lams_tool_assessment/web/WEB-INF/tiles-defs.xml (revision 0)
+++ lams_tool_assessment/web/WEB-INF/tiles-defs.xml (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_assessment/web/WEB-INF/tlds/fckeditor/FCKeditor.tld
===================================================================
diff -u
--- lams_tool_assessment/web/WEB-INF/tlds/fckeditor/FCKeditor.tld (revision 0)
+++ lams_tool_assessment/web/WEB-INF/tlds/fckeditor/FCKeditor.tld (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,215 @@
+
+
+
+
+ 2.3
+ 1.1
+ FCKeditor
+ http://fckeditor.net/tags-fckeditor
+ FCKeditor taglib
+
+ editor
+ com.fredck.FCKeditor.tags.FCKeditorTag
+ JSP
+
+ id
+ true
+ true
+
+
+ basePath
+ false
+ true
+
+
+ toolbarSet
+ false
+ true
+
+
+ width
+ false
+ true
+
+
+ height
+ false
+ true
+
+
+ customConfigurationsPath
+ false
+ true
+
+
+ editorAreaCSS
+ false
+ true
+
+
+ baseHref
+ false
+ true
+
+
+ skinPath
+ false
+ true
+
+
+ pluginsPath
+ false
+ true
+
+
+ fullPage
+ false
+ true
+
+
+ debug
+ false
+ true
+
+
+ autoDetectLanguage
+ false
+ true
+
+
+ defaultLanguage
+ false
+ true
+
+
+ contentLangDirection
+ false
+ true
+
+
+ enableXHTML
+ false
+ true
+
+
+ enableSourceXHTML
+ false
+ true
+
+
+ fillEmptyBlocks
+ false
+ true
+
+
+ formatSource
+ false
+ true
+
+
+ formatOutput
+ false
+ true
+
+
+ formatIndentator
+ false
+ true
+
+
+ geckoUseSPAN
+ false
+ true
+
+
+ startupFocus
+ false
+ true
+
+
+ forcePasteAsPlainText
+ false
+ true
+
+
+ forceSimpleAmpersand
+ false
+ true
+
+
+ tabSpaces
+ false
+ true
+
+
+ useBROnCarriageReturn
+ false
+ true
+
+
+ toolbarStartExpanded
+ false
+ true
+
+
+ toolbarCanCollapse
+ false
+ true
+
+
+ fontColors
+ false
+ true
+
+
+ fontNames
+ false
+ true
+
+
+ fontSizes
+ false
+ true
+
+
+ fontFormats
+ false
+ true
+
+
+ stylesXmlPath
+ false
+ true
+
+
+ linkBrowserURL
+ false
+ true
+
+
+ imageBrowserURL
+ false
+ true
+
+
+ flashBrowserURL
+ false
+ true
+
+
+ linkUploadURL
+ false
+ true
+
+
+ imageUploadURL
+ false
+ true
+
+
+ flashUploadURL
+ false
+ true
+
+
+
Index: lams_tool_assessment/web/WEB-INF/tlds/jstl/c.tld
===================================================================
diff -u
--- lams_tool_assessment/web/WEB-INF/tlds/jstl/c.tld (revision 0)
+++ lams_tool_assessment/web/WEB-INF/tlds/jstl/c.tld (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,563 @@
+
+
+
+
+ JSTL 1.1 core library
+ JSTL core
+ 1.1
+ c
+ http://java.sun.com/jsp/jstl/core
+
+
+
+ Provides core validation features for JSTL tags.
+
+
+ org.apache.taglibs.standard.tlv.JstlCoreTLV
+
+
+
+
+
+ Catches any Throwable that occurs in its body and optionally
+ exposes it.
+
+ catch
+ org.apache.taglibs.standard.tag.common.core.CatchTag
+ JSP
+
+
+Name of the exported scoped variable for the
+exception thrown from a nested action. The type of the
+scoped variable is the type of the exception thrown.
+
+ var
+ false
+ false
+
+
+
+
+
+ Simple conditional tag that establishes a context for
+ mutually exclusive conditional operations, marked by
+ <when> and <otherwise>
+
+ choose
+ org.apache.taglibs.standard.tag.common.core.ChooseTag
+ JSP
+
+
+
+
+ Simple conditional tag, which evalutes its body if the
+ supplied condition is true and optionally exposes a Boolean
+ scripting variable representing the evaluation of this condition
+
+ if
+ org.apache.taglibs.standard.tag.rt.core.IfTag
+ JSP
+
+
+The test condition that determines whether or
+not the body content should be processed.
+
+ test
+ true
+ true
+ boolean
+
+
+
+Name of the exported scoped variable for the
+resulting value of the test condition. The type
+of the scoped variable is Boolean.
+
+ var
+ false
+ false
+
+
+
+Scope for var.
+
+ scope
+ false
+ false
+
+
+
+
+
+ Retrieves an absolute or relative URL and exposes its contents
+ to either the page, a String in 'var', or a Reader in 'varReader'.
+
+ import
+ org.apache.taglibs.standard.tag.rt.core.ImportTag
+ org.apache.taglibs.standard.tei.ImportTEI
+ JSP
+
+
+The URL of the assessment to import.
+
+ url
+ true
+ true
+
+
+
+Name of the exported scoped variable for the
+assessment's content. The type of the scoped
+variable is String.
+
+ var
+ false
+ false
+
+
+
+Scope for var.
+
+ scope
+ false
+ false
+
+
+
+Name of the exported scoped variable for the
+assessment's content. The type of the scoped
+variable is Reader.
+
+ varReader
+ false
+ false
+
+
+
+Name of the context when accessing a relative
+URL assessment that belongs to a foreign
+context.
+
+ context
+ false
+ true
+
+
+
+Character encoding of the content at the input
+assessment.
+
+ charEncoding
+ false
+ true
+
+
+
+
+
+ The basic iteration tag, accepting many different
+ collection types and supporting subsetting and other
+ functionality
+
+ forEach
+ org.apache.taglibs.standard.tag.rt.core.ForEachTag
+ org.apache.taglibs.standard.tei.ForEachTEI
+ JSP
+
+
+Collection of items to iterate over.
+
+ items
+ false
+ true
+ java.lang.Object
+
+
+
+If items specified:
+Iteration begins at the item located at the
+specified index. First item of the collection has
+index 0.
+If items not specified:
+Iteration begins with index set at the value
+specified.
+
+ begin
+ false
+ true
+ int
+
+
+
+If items specified:
+Iteration ends at the item located at the
+specified index (inclusive).
+If items not specified:
+Iteration ends when index reaches the value
+specified.
+
+ end
+ false
+ true
+ int
+
+
+
+Iteration will only process every step items of
+the collection, starting with the first one.
+
+ step
+ false
+ true
+ int
+
+
+
+Name of the exported scoped variable for the
+current item of the iteration. This scoped
+variable has nested visibility. Its type depends
+on the object of the underlying collection.
+
+ var
+ false
+ false
+
+
+
+Name of the exported scoped variable for the
+status of the iteration. Object exported is of type
+javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested
+visibility.
+
+ varStatus
+ false
+ false
+
+
+
+
+
+ Iterates over tokens, separated by the supplied delimeters
+
+ forTokens
+ org.apache.taglibs.standard.tag.rt.core.ForTokensTag
+ JSP
+
+
+String of tokens to iterate over.
+
+ items
+ true
+ true
+ java.lang.String
+
+
+
+The set of delimiters (the characters that
+separate the tokens in the string).
+
+ delims
+ true
+ true
+ java.lang.String
+
+
+
+Iteration begins at the token located at the
+specified index. First token has index 0.
+
+ begin
+ false
+ true
+ int
+
+
+
+Iteration ends at the token located at the
+specified index (inclusive).
+
+ end
+ false
+ true
+ int
+
+
+
+Iteration will only process every step tokens
+of the string, starting with the first one.
+
+ step
+ false
+ true
+ int
+
+
+
+Name of the exported scoped variable for the
+current item of the iteration. This scoped
+variable has nested visibility.
+
+ var
+ false
+ false
+
+
+
+Name of the exported scoped variable for the
+status of the iteration. Object exported is of
+type
+javax.servlet.jsp.jstl.core.LoopTag
+Status. This scoped variable has nested
+visibility.
+
+ varStatus
+ false
+ false
+
+
+
+
+
+ Like <%= ... >, but for expressions.
+
+ out
+ org.apache.taglibs.standard.tag.rt.core.OutTag
+ JSP
+
+
+Expression to be evaluated.
+
+ value
+ true
+ true
+
+
+
+Default value if the resulting value is null.
+
+ default
+ false
+ true
+
+
+
+Determines whether characters <,>,&,'," in the
+resulting string should be converted to their
+corresponding character entity codes. Default value is
+true.
+
+ escapeXml
+ false
+ true
+
+
+
+
+
+
+ Subtag of <choose> that follows <when> tags
+ and runs only if all of the prior conditions evaluated to
+ 'false'
+
+ otherwise
+ org.apache.taglibs.standard.tag.common.core.OtherwiseTag
+ JSP
+
+
+
+
+ Adds a parameter to a containing 'import' tag's URL.
+
+ param
+ org.apache.taglibs.standard.tag.rt.core.ParamTag
+ JSP
+
+
+Name of the query string parameter.
+
+ name
+ true
+ true
+
+
+
+Value of the parameter.
+
+ value
+ false
+ true
+
+
+
+
+
+ Redirects to a new URL.
+
+ redirect
+ org.apache.taglibs.standard.tag.rt.core.RedirectTag
+ JSP
+
+
+The URL of the assessment to redirect to.
+
+ url
+ false
+ true
+
+
+
+Name of the context when redirecting to a relative URL
+assessment that belongs to a foreign context.
+
+ context
+ false
+ true
+
+
+
+
+
+ Removes a scoped variable (from a particular scope, if specified).
+
+ remove
+ org.apache.taglibs.standard.tag.common.core.RemoveTag
+ empty
+
+
+Name of the scoped variable to be removed.
+
+ var
+ true
+ false
+
+
+
+Scope for var.
+
+ scope
+ false
+ false
+
+
+
+
+
+ Sets the result of an expression evaluation in a 'scope'
+
+ set
+ org.apache.taglibs.standard.tag.rt.core.SetTag
+ JSP
+
+
+Name of the exported scoped variable to hold the value
+specified in the action. The type of the scoped variable is
+whatever type the value expression evaluates to.
+
+ var
+ false
+ false
+
+
+
+Expression to be evaluated.
+
+ value
+ false
+ true
+
+
+
+Target object whose property will be set. Must evaluate to
+a JavaBeans object with setter property property, or to a
+java.util.Map object.
+
+ target
+ false
+ true
+
+
+
+Name of the property to be set in the target object.
+
+ property
+ false
+ true
+
+
+
+Scope for var.
+
+ scope
+ false
+ false
+
+
+
+
+
+ Creates a URL with optional query parameters.
+
+ url
+ org.apache.taglibs.standard.tag.rt.core.UrlTag
+ JSP
+
+
+Name of the exported scoped variable for the
+processed url. The type of the scoped variable is
+String.
+
+ var
+ false
+ false
+
+
+
+Scope for var.
+
+ scope
+ false
+ false
+
+
+
+URL to be processed.
+
+ value
+ false
+ true
+
+
+
+Name of the context when specifying a relative URL
+assessment that belongs to a foreign context.
+
+ context
+ false
+ true
+
+
+
+
+
+ Subtag of <choose> that includes its body if its
+ condition evalutes to 'true'
+
+ when
+ org.apache.taglibs.standard.tag.rt.core.WhenTag
+ JSP
+
+
+The test condition that determines whether or not the
+body content should be processed.
+
+ test
+ true
+ true
+ boolean
+
+
+
+
Index: lams_tool_assessment/web/WEB-INF/tlds/jstl/fmt.tld
===================================================================
diff -u
--- lams_tool_assessment/web/WEB-INF/tlds/jstl/fmt.tld (revision 0)
+++ lams_tool_assessment/web/WEB-INF/tlds/jstl/fmt.tld (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,671 @@
+
+
+
+
+ JSTL 1.1 i18n-capable formatting library
+ JSTL fmt
+ 1.1
+ fmt
+ http://java.sun.com/jsp/jstl/fmt
+
+
+
+ Provides core validation features for JSTL tags.
+
+
+ org.apache.taglibs.standard.tlv.JstlFmtTLV
+
+
+
+
+
+ Sets the request character encoding
+
+ requestEncoding
+ org.apache.taglibs.standard.tag.rt.fmt.RequestEncodingTag
+ empty
+
+
+Name of character encoding to be applied when
+decoding request parameters.
+
+ value
+ false
+ true
+
+
+
+
+
+ Stores the given locale in the locale configuration variable
+
+ setLocale
+ org.apache.taglibs.standard.tag.rt.fmt.SetLocaleTag
+ empty
+
+
+A String value is interpreted as the
+printable representation of a locale, which
+must contain a two-letter (lower-case)
+language code (as defined by ISO-639),
+and may contain a two-letter (upper-case)
+country code (as defined by ISO-3166).
+Language and country codes must be
+separated by hyphen (-) or underscore
+(_).
+
+ value
+ true
+ true
+
+
+
+Vendor- or browser-specific variant.
+See the java.util.Locale javadocs for
+more information on variants.
+
+ variant
+ false
+ true
+
+
+
+Scope of the locale configuration variable.
+
+ scope
+ false
+ false
+
+
+
+
+
+ Specifies the time zone for any time formatting or parsing actions
+ nested in its body
+
+ timeZone
+ org.apache.taglibs.standard.tag.rt.fmt.TimeZoneTag
+ JSP
+
+
+The time zone. A String value is interpreted as
+a time zone ID. This may be one of the time zone
+IDs supported by the Java platform (such as
+"America/Los_Angeles") or a custom time zone
+ID (such as "GMT-8"). See
+java.util.TimeZone for more information on
+supported time zone formats.
+
+ value
+ true
+ true
+
+
+
+
+
+ Stores the given time zone in the time zone configuration variable
+
+ setTimeZone
+ org.apache.taglibs.standard.tag.rt.fmt.SetTimeZoneTag
+ empty
+
+
+The time zone. A String value is interpreted as
+a time zone ID. This may be one of the time zone
+IDs supported by the Java platform (such as
+"America/Los_Angeles") or a custom time zone
+ID (such as "GMT-8"). See java.util.TimeZone for
+more information on supported time zone
+formats.
+
+ value
+ true
+ true
+
+
+
+Name of the exported scoped variable which
+stores the time zone of type
+java.util.TimeZone.
+
+ var
+ false
+ false
+
+
+
+Scope of var or the time zone configuration
+variable.
+
+ scope
+ false
+ false
+
+
+
+
+
+ Loads a assessment bundle to be used by its tag body
+
+ bundle
+ org.apache.taglibs.standard.tag.rt.fmt.BundleTag
+ JSP
+
+
+Assessment bundle base name. This is the bundle's
+fully-qualified assessment name, which has the same
+form as a fully-qualified class name, that is, it uses
+"." as the package component separator and does not
+have any file type (such as ".class" or ".properties")
+suffix.
+
+ basename
+ true
+ true
+
+
+
+Prefix to be prepended to the value of the message
+key of any nested <fmt:message> action.
+
+ prefix
+ false
+ true
+
+
+
+
+
+ Loads a assessment bundle and stores it in the named scoped variable or
+ the bundle configuration variable
+
+ setBundle
+ org.apache.taglibs.standard.tag.rt.fmt.SetBundleTag
+ empty
+
+
+Assessment bundle base name. This is the bundle's
+fully-qualified assessment name, which has the same
+form as a fully-qualified class name, that is, it uses
+"." as the package component separator and does not
+have any file type (such as ".class" or ".properties")
+suffix.
+
+ basename
+ true
+ true
+
+
+
+Name of the exported scoped variable which stores
+the i18n localization context of type
+javax.servlet.jsp.jstl.fmt.LocalizationC
+ontext.
+
+ var
+ false
+ false
+
+
+
+Scope of var or the localization context
+configuration variable.
+
+ scope
+ false
+ false
+
+
+
+
+
+ Maps key to localized message and performs parametric replacement
+
+ message
+ org.apache.taglibs.standard.tag.rt.fmt.MessageTag
+ JSP
+
+
+Message key to be looked up.
+
+ key
+ false
+ true
+
+
+
+Localization context in whose assessment
+bundle the message key is looked up.
+
+ bundle
+ false
+ true
+
+
+
+Name of the exported scoped variable
+which stores the localized message.
+
+ var
+ false
+ false
+
+
+
+Scope of var.
+
+ scope
+ false
+ false
+
+
+
+
+
+ Supplies an argument for parametric replacement to a containing
+ <message> tag
+
+ param
+ org.apache.taglibs.standard.tag.rt.fmt.ParamTag
+ JSP
+
+
+Argument used for parametric replacement.
+
+ value
+ false
+ true
+
+
+
+
+
+ Formats a numeric value as a number, currency, or percentage
+
+ formatNumber
+ org.apache.taglibs.standard.tag.rt.fmt.FormatNumberTag
+ JSP
+
+
+Numeric value to be formatted.
+
+ value
+ false
+ true
+
+
+
+Specifies whether the value is to be
+formatted as number, currency, or
+percentage.
+
+ type
+ false
+ true
+
+
+
+Custom formatting pattern.
+
+ pattern
+ false
+ true
+
+
+
+ISO 4217 currency code. Applied only
+when formatting currencies (i.e. if type is
+equal to "currency"); ignored otherwise.
+
+ currencyCode
+ false
+ true
+
+
+
+Currency symbol. Applied only when
+formatting currencies (i.e. if type is equal
+to "currency"); ignored otherwise.
+
+ currencySymbol
+ false
+ true
+
+
+
+Specifies whether the formatted output
+will contain any grouping separators.
+
+ groupingUsed
+ false
+ true
+
+
+
+Maximum number of digits in the integer
+portion of the formatted output.
+
+ maxIntegerDigits
+ false
+ true
+
+
+
+Minimum number of digits in the integer
+portion of the formatted output.
+
+ minIntegerDigits
+ false
+ true
+
+
+
+Maximum number of digits in the
+fractional portion of the formatted output.
+
+ maxFractionDigits
+ false
+ true
+
+
+
+Minimum number of digits in the
+fractional portion of the formatted output.
+
+ minFractionDigits
+ false
+ true
+
+
+
+Name of the exported scoped variable
+which stores the formatted result as a
+String.
+
+ var
+ false
+ false
+
+
+
+Scope of var.
+
+ scope
+ false
+ false
+
+
+
+
+
+ Parses the string representation of a number, currency, or percentage
+
+ parseNumber
+ org.apache.taglibs.standard.tag.rt.fmt.ParseNumberTag
+ JSP
+
+
+String to be parsed.
+
+ value
+ false
+ true
+
+
+
+Specifies whether the string in the value
+attribute should be parsed as a number,
+currency, or percentage.
+
+ type
+ false
+ true
+
+
+
+Custom formatting pattern that determines
+how the string in the value attribute is to be
+parsed.
+
+ pattern
+ false
+ true
+
+
+
+Locale whose default formatting pattern (for
+numbers, currencies, or percentages,
+respectively) is to be used during the parse
+operation, or to which the pattern specified
+via the pattern attribute (if present) is
+applied.
+
+ parseLocale
+ false
+ true
+
+
+
+Specifies whether just the integer portion of
+the given value should be parsed.
+
+ integerOnly
+ false
+ true
+
+
+
+Name of the exported scoped variable which
+stores the parsed result (of type
+java.lang.Number).
+
+ var
+ false
+ false
+
+
+
+Scope of var.
+
+ scope
+ false
+ false
+
+
+
+
+
+ Formats a date and/or time using the supplied styles and pattern
+
+ formatDate
+ org.apache.taglibs.standard.tag.rt.fmt.FormatDateTag
+ empty
+
+
+Date and/or time to be formatted.
+
+ value
+ true
+ true
+
+
+
+Specifies whether the time, the date, or both
+the time and date components of the given
+date are to be formatted.
+
+ type
+ false
+ true
+
+
+
+Predefined formatting style for dates. Follows
+the semantics defined in class
+java.text.DateFormat. Applied only
+when formatting a date or both a date and
+time (i.e. if type is missing or is equal to
+"date" or "both"); ignored otherwise.
+
+ dateStyle
+ false
+ true
+
+
+
+Predefined formatting style for times. Follows
+the semantics defined in class
+java.text.DateFormat. Applied only
+when formatting a time or both a date and
+time (i.e. if type is equal to "time" or "both");
+ignored otherwise.
+
+ timeStyle
+ false
+ true
+
+
+
+Custom formatting style for dates and times.
+
+ pattern
+ false
+ true
+
+
+
+Time zone in which to represent the formatted
+time.
+
+ timeZone
+ false
+ true
+
+
+
+Name of the exported scoped variable which
+stores the formatted result as a String.
+
+ var
+ false
+ false
+
+
+
+Scope of var.
+
+ scope
+ false
+ false
+
+
+
+
+
+ Parses the string representation of a date and/or time
+
+ parseDate
+ org.apache.taglibs.standard.tag.rt.fmt.ParseDateTag
+ JSP
+
+
+Date string to be parsed.
+
+ value
+ false
+ true
+
+
+
+Specifies whether the date string in the
+value attribute is supposed to contain a
+time, a date, or both.
+
+ type
+ false
+ true
+
+
+
+Predefined formatting style for days
+which determines how the date
+component of the date string is to be
+parsed. Applied only when formatting a
+date or both a date and time (i.e. if type
+is missing or is equal to "date" or "both");
+ignored otherwise.
+
+ dateStyle
+ false
+ true
+
+
+
+Predefined formatting styles for times
+which determines how the time
+component in the date string is to be
+parsed. Applied only when formatting a
+time or both a date and time (i.e. if type
+is equal to "time" or "both"); ignored
+otherwise.
+
+ timeStyle
+ false
+ true
+
+
+
+Custom formatting pattern which
+determines how the date string is to be
+parsed.
+
+ pattern
+ false
+ true
+
+
+
+Time zone in which to interpret any time
+information in the date string.
+
+ timeZone
+ false
+ true
+
+
+
+Locale whose predefined formatting styles
+for dates and times are to be used during
+the parse operation, or to which the
+pattern specified via the pattern
+attribute (if present) is applied.
+
+ parseLocale
+ false
+ true
+
+
+
+Name of the exported scoped variable in
+which the parsing result (of type
+java.util.Date) is stored.
+
+ var
+ false
+ false
+
+
+
+Scope of var.
+
+ scope
+ false
+ false
+
+
+
+
Index: lams_tool_assessment/web/WEB-INF/tlds/jstl/fn.tld
===================================================================
diff -u
--- lams_tool_assessment/web/WEB-INF/tlds/jstl/fn.tld (revision 0)
+++ lams_tool_assessment/web/WEB-INF/tlds/jstl/fn.tld (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,207 @@
+
+
+
+
+ JSTL 1.1 functions library
+ JSTL functions
+ 1.1
+ fn
+ http://java.sun.com/jsp/jstl/functions
+
+
+
+ Tests if an input string contains the specified substring.
+
+ contains
+ org.apache.taglibs.standard.functions.Functions
+ boolean contains(java.lang.String, java.lang.String)
+
+ <c:if test="${fn:contains(name, searchString)}">
+
+
+
+
+
+ Tests if an input string contains the specified substring in a case insensitive way.
+
+ containsIgnoreCase
+ org.apache.taglibs.standard.functions.Functions
+ boolean containsIgnoreCase(java.lang.String, java.lang.String)
+
+ <c:if test="${fn:containsIgnoreCase(name, searchString)}">
+
+
+
+
+
+ Tests if an input string ends with the specified suffix.
+
+ endsWith
+ org.apache.taglibs.standard.functions.Functions
+ boolean endsWith(java.lang.String, java.lang.String)
+
+ <c:if test="${fn:endsWith(filename, ".txt")}">
+
+
+
+
+
+ Escapes characters that could be interpreted as XML markup.
+
+ escapeXml
+ org.apache.taglibs.standard.functions.Functions
+ java.lang.String escapeXml(java.lang.String)
+
+ ${fn:escapeXml(param:info)}
+
+
+
+
+
+ Returns the index withing a string of the first occurrence of a specified substring.
+
+ indexOf
+ org.apache.taglibs.standard.functions.Functions
+ int indexOf(java.lang.String, java.lang.String)
+
+ ${fn:indexOf(name, "-")}
+
+
+
+
+
+ Joins all elements of an array into a string.
+
+ join
+ org.apache.taglibs.standard.functions.Functions
+ java.lang.String join(java.lang.String[], java.lang.String)
+
+ ${fn:join(array, ";")}
+
+
+
+
+
+ Returns the number of items in a collection, or the number of characters in a string.
+
+ length
+ org.apache.taglibs.standard.functions.Functions
+ int length(java.lang.Object)
+
+ You have ${fn:length(shoppingCart.products)} in your shopping cart.
+
+
+
+
+
+ Returns a string resulting from replacing in an input string all occurrences
+ of a "before" string into an "after" substring.
+
+ replace
+ org.apache.taglibs.standard.functions.Functions
+ java.lang.String replace(java.lang.String, java.lang.String, java.lang.String)
+
+ ${fn:replace(text, "-", "")}
+
+
+
+
+
+ Splits a string into an array of substrings.
+
+ split
+ org.apache.taglibs.standard.functions.Functions
+ java.lang.String[] split(java.lang.String, java.lang.String)
+
+ ${fn:split(customerNames, ";")}
+
+
+
+
+
+ Tests if an input string starts with the specified prefix.
+
+ startsWith
+ org.apache.taglibs.standard.functions.Functions
+ boolean startsWith(java.lang.String, java.lang.String)
+
+ <c:if test="${fn:startsWith(product.id, "100-")}">
+
+
+
+
+
+ Returns a subset of a string.
+
+ substring
+ org.apache.taglibs.standard.functions.Functions
+ java.lang.String substring(java.lang.String, int, int)
+
+ P.O. Box: ${fn:substring(zip, 6, -1)}
+
+
+
+
+
+ Returns a subset of a string following a specific substring.
+
+ substringAfter
+ org.apache.taglibs.standard.functions.Functions
+ java.lang.String substringAfter(java.lang.String, java.lang.String)
+
+ P.O. Box: ${fn:substringAfter(zip, "-")}
+
+
+
+
+
+ Returns a subset of a string before a specific substring.
+
+ substringBefore
+ org.apache.taglibs.standard.functions.Functions
+ java.lang.String substringBefore(java.lang.String, java.lang.String)
+
+ Zip (without P.O. Box): ${fn:substringBefore(zip, "-")}
+
+
+
+
+
+ Converts all of the characters of a string to lower case.
+
+ toLowerCase
+ org.apache.taglibs.standard.functions.Functions
+ java.lang.String toLowerCase(java.lang.String)
+
+ Product name: ${fn.toLowerCase(product.name)}
+
+
+
+
+
+ Converts all of the characters of a string to upper case.
+
+ toUpperCase
+ org.apache.taglibs.standard.functions.Functions
+ java.lang.String toUpperCase(java.lang.String)
+
+ Product name: ${fn.UpperCase(product.name)}
+
+
+
+
+
+ Removes white spaces from both ends of a string.
+
+ trim
+ org.apache.taglibs.standard.functions.Functions
+ java.lang.String trim(java.lang.String)
+
+ Name: ${fn.trim(name)}
+
+
+
+
Index: lams_tool_assessment/web/WEB-INF/tlds/jstl/x.tld
===================================================================
diff -u
--- lams_tool_assessment/web/WEB-INF/tlds/jstl/x.tld (revision 0)
+++ lams_tool_assessment/web/WEB-INF/tlds/jstl/x.tld (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,448 @@
+
+
+
+
+ JSTL 1.1 XML library
+ JSTL XML
+ 1.1
+ x
+ http://java.sun.com/jsp/jstl/xml
+
+
+
+ Provides validation features for JSTL XML tags.
+
+
+ org.apache.taglibs.standard.tlv.JstlXmlTLV
+
+
+
+
+
+ Simple conditional tag that establishes a context for
+ mutually exclusive conditional operations, marked by
+ <when> and <otherwise>
+
+ choose
+ org.apache.taglibs.standard.tag.common.core.ChooseTag
+ JSP
+
+
+
+
+ Like <%= ... >, but for XPath expressions.
+
+ out
+ org.apache.taglibs.standard.tag.rt.xml.ExprTag
+ empty
+
+
+XPath expression to be evaluated.
+
+ select
+ true
+ false
+
+
+
+Determines whether characters <,>,&,'," in the
+resulting string should be converted to their
+corresponding character entity codes. Default
+value is true.
+
+ escapeXml
+ false
+ true
+
+
+
+
+
+ XML conditional tag, which evalutes its body if the
+ supplied XPath expression evalutes to 'true' as a boolean
+
+ if
+ org.apache.taglibs.standard.tag.common.xml.IfTag
+ JSP
+
+
+The test condition that tells whether or not the
+body content should be processed.
+
+ select
+ true
+ false
+
+
+
+Name of the exported scoped variable for the
+resulting value of the test condition. The type
+of the scoped variable is Boolean.
+
+ var
+ false
+ false
+
+
+
+Scope for var.
+
+ scope
+ false
+ false
+
+
+
+
+
+ XML iteration tag.
+
+ forEach
+ org.apache.taglibs.standard.tag.common.xml.ForEachTag
+ JSP
+
+
+Name of the exported scoped variable for the
+current item of the iteration. This scoped variable
+has nested visibility. Its type depends on the
+result of the XPath expression in the select
+attribute.
+
+ var
+ false
+ false
+
+
+
+XPath expression to be evaluated.
+
+ select
+ true
+ false
+
+
+
+Iteration begins at the item located at the
+specified index. First item of the collection has
+index 0.
+
+ begin
+ false
+ true
+ int
+
+
+
+Iteration ends at the item located at the specified
+index (inclusive).
+
+ end
+ false
+ true
+ int
+
+
+
+Iteration will only process every step items of
+the collection, starting with the first one.
+
+ step
+ false
+ true
+ int
+
+
+
+Name of the exported scoped variable for the
+status of the iteration. Object exported is of type
+javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested visibility.
+
+ varStatus
+ false
+ false
+
+
+
+
+
+ Subtag of <choose> that follows <when> tags
+ and runs only if all of the prior conditions evaluated to
+ 'false'
+
+ otherwise
+ org.apache.taglibs.standard.tag.common.core.OtherwiseTag
+ JSP
+
+
+
+
+ Adds a parameter to a containing 'transform' tag's Transformer
+
+ param
+ org.apache.taglibs.standard.tag.rt.xml.ParamTag
+ JSP
+
+
+Name of the transformation parameter.
+
+ name
+ true
+ true
+
+
+
+Value of the parameter.
+
+ value
+ false
+ true
+
+
+
+
+
+ Parses XML content from 'source' attribute or 'body'
+
+ parse
+ org.apache.taglibs.standard.tag.rt.xml.ParseTag
+ org.apache.taglibs.standard.tei.XmlParseTEI
+ JSP
+
+
+Name of the exported scoped variable for
+the parsed XML document. The type of the
+scoped variable is implementation
+dependent.
+
+ var
+ false
+ false
+
+
+
+Name of the exported scoped variable for
+the parsed XML document. The type of the
+scoped variable is
+org.w3c.dom.Document.
+
+ varDom
+ false
+ false
+
+
+
+Scope for var.
+
+ scope
+ false
+ false
+
+
+
+Scope for varDom.
+
+ scopeDom
+ false
+ false
+
+
+
+Deprecated. Use attribute 'doc' instead.
+
+ xml
+ false
+ true
+
+
+
+Source XML document to be parsed.
+
+ doc
+ false
+ true
+
+
+
+The system identifier (URI) for parsing the
+XML document.
+
+ systemId
+ false
+ true
+
+
+
+Filter to be applied to the source
+document.
+
+ filter
+ false
+ true
+
+
+
+
+
+ Saves the result of an XPath expression evaluation in a 'scope'
+
+ set
+ org.apache.taglibs.standard.tag.common.xml.SetTag
+ empty
+
+
+Name of the exported scoped variable to hold
+the value specified in the action. The type of the
+scoped variable is whatever type the select
+expression evaluates to.
+
+ var
+ true
+ false
+
+
+
+XPath expression to be evaluated.
+
+ select
+ false
+ false
+
+
+
+Scope for var.
+
+ scope
+ false
+ false
+
+
+
+
+
+ Conducts a transformation given a source XML document
+ and an XSLT stylesheet
+
+ transform
+ org.apache.taglibs.standard.tag.rt.xml.TransformTag
+ org.apache.taglibs.standard.tei.XmlTransformTEI
+ JSP
+
+
+Name of the exported
+scoped variable for the
+transformed XML
+document. The type of the
+scoped variable is
+org.w3c.dom.Document.
+
+ var
+ false
+ false
+
+
+
+Scope for var.
+
+ scope
+ false
+ false
+
+
+
+Result
+Object that captures or
+processes the transformation
+result.
+
+ result
+ false
+ true
+
+
+
+Deprecated. Use attribute
+'doc' instead.
+
+ xml
+ false
+ true
+
+
+
+Source XML document to be
+transformed. (If exported by
+<x:set>, it must correspond
+to a well-formed XML
+document, not a partial
+document.)
+
+ doc
+ false
+ true
+
+
+
+Deprecated. Use attribute
+'docSystemId' instead.
+
+ xmlSystemId
+ false
+ true
+
+
+
+The system identifier (URI)
+for parsing the XML
+document.
+
+ docSystemId
+ false
+ true
+
+
+
+javax.xml.transform.Source
+Transformation stylesheet as
+a String, Reader, or
+Source object.
+
+ xslt
+ false
+ true
+
+
+
+The system identifier (URI)
+for parsing the XSLT
+stylesheet.
+
+ xsltSystemId
+ false
+ true
+
+
+
+
+
+ Subtag of <choose> that includes its body if its
+ expression evalutes to 'true'
+
+ when
+ org.apache.taglibs.standard.tag.common.xml.WhenTag
+ JSP
+
+
+The test condition that tells whether or
+not the body content should be
+processed
+
+ select
+ true
+ false
+
+
+
+
Index: lams_tool_assessment/web/WEB-INF/tlds/lams/lams.tld
===================================================================
diff -u
--- lams_tool_assessment/web/WEB-INF/tlds/lams/lams.tld (revision 0)
+++ lams_tool_assessment/web/WEB-INF/tlds/lams/lams.tld (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,513 @@
+
+
+
+
+ 1.0
+ lams
+
+ LAMSTags
+
+
+
+
+ Output the basic URL for the current webapp. e.g. http://server/lams/tool/nb11/
+ Base URL for the current web app
+
+
+ WebAppURL
+ org.lamsfoundation.lams.web.tag.WebAppURLTag
+ empty
+
+
+
+
+ Output a random number for the learner and passon flash movies to communicate directly.
+ generate unique ID
+
+
+ generateID
+ org.lamsfoundation.lams.web.tag.GenerateIDTag
+ empty
+
+
+ Output a random number for the learner and passon flash movies to communicate directly.
+ id
+ false
+
+ true
+
+
+
+
+
+
+ Get the configuration value for the specified key
+ Configuration value
+
+
+ Configuration
+ org.lamsfoundation.lams.web.tag.ConfigurationTag
+ empty
+
+
+ Get the configuration value for the specified key
+ key
+ false
+
+ true
+
+
+
+
+
+
+ Output the Server URL as defined in the lams.xml configuration file.
+ LAMS URL
+
+
+ LAMSURL
+ org.lamsfoundation.lams.web.tag.LAMSURLTag
+ empty
+
+
+
+
+ Render html tag with direction and language
+ Render html tag with direction and language
+
+
+ html
+ org.lamsfoundation.lams.web.tag.HtmlTag
+ JSP
+
+
+ Render html tag with direction and language
+ xhtml
+ false
+
+ true
+
+
+
+
+
+
+ Converts text from \n or \r\n to <BR> before rendering
+ Converts text from \n or \r\n to <BR> before rendering
+
+
+ out
+ org.lamsfoundation.lams.web.tag.MultiLinesOutputTag
+ empty
+
+
+ Converts text from \n or \r\n to <BR> before rendering
+ value
+ true
+
+ true
+
+
+
+ Converts text from \n or \r\n to <BR> before rendering
+ escapeHtml
+ false
+
+ true
+
+
+
+
+
+
+ Help tag
+ Help tag
+
+
+ help
+ org.lamsfoundation.lams.web.tag.HelpTag
+ empty
+
+
+ Help tag
+ module
+ false
+
+ true
+
+
+
+ Help tag
+ toolSignature
+ false
+
+ true
+
+
+
+ Help tag
+ page
+ false
+
+ true
+
+
+
+ Help tag
+ style
+ false
+
+ true
+
+
+
+
+
+
+ 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
+
+
+ css
+ org.lamsfoundation.lams.web.tag.CssTag
+ empty
+
+
+ Output stylesheet based on the user preferences.
+ localLinkPath
+ false
+
+ true
+
+
+
+ Output stylesheet based on the user preferences.
+ style
+ false
+
+ true
+
+
+
+
+
+
+ Output details from the shared session UserDTO object
+ user details
+
+
+ user
+ org.lamsfoundation.lams.web.tag.UserTag
+ empty
+
+
+ Output details from the shared session UserDTO object
+ property
+ true
+
+ true
+
+
+
+
+
+
+ STRUTS-textarea
+ org.lamsfoundation.lams.web.tag.MultiLinesTextareaTag
+ empty
+
+ accesskey
+ false
+ true
+
+
+ alt
+ false
+ true
+
+
+ altKey
+ false
+ true
+
+
+ bundle
+ false
+ true
+
+
+ cols
+ false
+ true
+
+
+ disabled
+ false
+ true
+
+
+ errorKey
+ false
+ true
+
+
+ errorStyle
+ false
+ true
+
+
+ errorStyleClass
+ false
+ true
+
+
+ errorStyleId
+ false
+ true
+
+
+ index
+ false
+ true
+
+
+ indexed
+ false
+ true
+
+
+ name
+ false
+ true
+
+
+ onblur
+ false
+ true
+
+
+ onchange
+ false
+ true
+
+
+ onclick
+ false
+ true
+
+
+ ondblclick
+ false
+ true
+
+
+ onfocus
+ false
+ true
+
+
+ onkeydown
+ false
+ true
+
+
+ onkeypress
+ false
+ true
+
+
+ onkeyup
+ false
+ true
+
+
+ onmousedown
+ false
+ true
+
+
+ onmousemove
+ false
+ true
+
+
+ onmouseout
+ false
+ true
+
+
+ onmouseover
+ false
+ true
+
+
+ onmouseup
+ false
+ true
+
+
+ property
+ true
+ true
+
+
+ readonly
+ false
+ true
+
+
+ rows
+ false
+ true
+
+
+ style
+ false
+ true
+
+
+ styleClass
+ false
+ true
+
+
+ styleId
+ false
+ true
+
+
+ tabindex
+ false
+ true
+
+
+ title
+ false
+ true
+
+
+ titleKey
+ false
+ true
+
+
+ value
+ false
+ true
+
+
+
+ Tab
+ /WEB-INF/tags/Tab.tag
+
+
+ Tabs
+ /WEB-INF/tags/Tabs.tag
+
+
+ TabBody
+ /WEB-INF/tags/TabBody.tag
+
+
+ TabName
+ /WEB-INF/tags/TabName.tag
+
+
+ FCKEditor
+ /WEB-INF/tags/FCKEditor.tag
+
+
+ AuthoringButton
+ /WEB-INF/tags/AuthoringButton.tag
+
+
+ headItems
+ /WEB-INF/tags/headItems.tag
+
+
+ Passon
+ /WEB-INF/tags/Passon.tag
+
+
+ ExportPortOutput
+ /WEB-INF/tags/ExportPortOutput.tag
+
+
+ Date
+ /WEB-INF/tags/Date.tag
+
+
+ DefineLater
+ /WEB-INF/tags/DefineLater.tag
+
+
+ ImgButtonWrapper
+ /WEB-INF/tags/ImgButtonWrapper.tag
+
+
+ textarea
+ org.lamsfoundation.lams.web.tag.LAMSMultiLinesTextareaTag
+ JSP
+ true
+
+ Render text exactly same as original input, which even won't escape the input HTML tag.
+
+
+
+
+ name
+ true
+ true
+
+
+
+
+ id
+ false
+ true
+
+
+
+
+ onchange
+ false
+ true
+
+
+
+ head
+ /WEB-INF/tags/Head.tag
+
+
+ ProgressOutput
+ /WEB-INF/tags/ProgressOutput.tag
+
+
+ LearnerFlashEnabled
+ /WEB-INF/tags/LearnerFlashEnabled.tag
+
+
+
Index: lams_tool_assessment/web/WEB-INF/tlds/struts/struts-bean.tld
===================================================================
diff -u
--- lams_tool_assessment/web/WEB-INF/tlds/struts/struts-bean.tld (revision 0)
+++ lams_tool_assessment/web/WEB-INF/tlds/struts/struts-bean.tld (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,382 @@
+
+
+
+
+
+
+
+
+
+
+1.2
+1.1
+bean
+http://struts.apache.org/tags-bean
+
+cookie
+org.apache.struts.taglib.bean.CookieTag
+org.apache.struts.taglib.bean.CookieTei
+empty
+
+id
+true
+false
+
+
+multiple
+false
+true
+
+
+name
+true
+true
+
+
+value
+false
+true
+
+
+
+define
+org.apache.struts.taglib.bean.DefineTag
+org.apache.struts.taglib.bean.DefineTei
+JSP
+
+id
+true
+false
+
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+toScope
+false
+true
+
+
+type
+false
+true
+
+
+value
+false
+true
+
+
+
+header
+org.apache.struts.taglib.bean.HeaderTag
+org.apache.struts.taglib.bean.HeaderTei
+empty
+
+id
+true
+false
+
+
+multiple
+false
+true
+
+
+name
+true
+true
+
+
+value
+false
+true
+
+
+
+include
+org.apache.struts.taglib.bean.IncludeTag
+org.apache.struts.taglib.bean.IncludeTei
+empty
+
+anchor
+false
+true
+
+
+forward
+false
+true
+
+
+href
+false
+true
+
+
+id
+true
+false
+
+
+name
+false
+true
+
+
+page
+false
+true
+
+
+transaction
+false
+true
+
+
+
+message
+org.apache.struts.taglib.bean.MessageTag
+empty
+
+arg0
+false
+true
+
+
+arg1
+false
+true
+
+
+arg2
+false
+true
+
+
+arg3
+false
+true
+
+
+arg4
+false
+true
+
+
+bundle
+false
+true
+
+
+key
+false
+true
+
+
+locale
+false
+true
+
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+
+page
+org.apache.struts.taglib.bean.PageTag
+org.apache.struts.taglib.bean.PageTei
+empty
+
+id
+true
+false
+
+
+property
+true
+true
+
+
+
+parameter
+org.apache.struts.taglib.bean.ParameterTag
+org.apache.struts.taglib.bean.ParameterTei
+empty
+
+id
+true
+false
+
+
+multiple
+false
+true
+
+
+name
+true
+true
+
+
+value
+false
+true
+
+
+
+resource
+org.apache.struts.taglib.bean.ResourceTag
+org.apache.struts.taglib.bean.ResourceTei
+empty
+
+id
+true
+false
+
+
+input
+false
+true
+
+
+name
+true
+true
+
+
+
+size
+org.apache.struts.taglib.bean.SizeTag
+org.apache.struts.taglib.bean.SizeTei
+empty
+
+collection
+false
+true
+
+
+id
+true
+false
+
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+
+struts
+org.apache.struts.taglib.bean.StrutsTag
+org.apache.struts.taglib.bean.StrutsTei
+empty
+
+id
+true
+false
+
+
+formBean
+false
+true
+
+
+forward
+false
+true
+
+
+mapping
+false
+true
+
+
+
+write
+org.apache.struts.taglib.bean.WriteTag
+empty
+
+bundle
+false
+true
+
+
+filter
+false
+true
+
+
+format
+false
+true
+
+
+formatKey
+false
+true
+
+
+ignore
+false
+true
+
+
+locale
+false
+true
+
+
+name
+true
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+
+
+
+
Index: lams_tool_assessment/web/WEB-INF/tlds/struts/struts-html.tld
===================================================================
diff -u
--- lams_tool_assessment/web/WEB-INF/tlds/struts/struts-html.tld (revision 0)
+++ lams_tool_assessment/web/WEB-INF/tlds/struts/struts-html.tld (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,3302 @@
+
+
+
+
+
+
+
+
+
+
+1.2
+1.1
+html
+http://struts.apache.org/tags-html
+
+base
+org.apache.struts.taglib.html.BaseTag
+empty
+
+target
+false
+true
+
+
+server
+false
+true
+
+
+
+button
+org.apache.struts.taglib.html.ButtonTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+indexed
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+true
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+cancel
+org.apache.struts.taglib.html.CancelTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+checkbox
+org.apache.struts.taglib.html.CheckboxTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+errorKey
+false
+true
+
+
+errorStyle
+false
+true
+
+
+errorStyleClass
+false
+true
+
+
+errorStyleId
+false
+true
+
+
+indexed
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+true
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+errors
+org.apache.struts.taglib.html.ErrorsTag
+empty
+
+bundle
+false
+true
+
+
+footer
+false
+true
+
+
+header
+false
+true
+
+
+locale
+false
+true
+
+
+name
+false
+true
+
+
+prefix
+false
+true
+
+
+property
+false
+true
+
+
+suffix
+false
+true
+
+
+
+file
+org.apache.struts.taglib.html.FileTag
+
+accesskey
+false
+true
+
+
+accept
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+errorKey
+false
+true
+
+
+errorStyle
+false
+true
+
+
+errorStyleClass
+false
+true
+
+
+errorStyleId
+false
+true
+
+
+indexed
+false
+true
+
+
+maxlength
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+true
+true
+
+
+size
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+form
+org.apache.struts.taglib.html.FormTag
+JSP
+
+action
+true
+true
+
+
+acceptCharset
+false
+true
+
+
+disabled
+false
+true
+
+
+enctype
+false
+true
+
+
+focus
+false
+true
+
+
+focusIndex
+false
+true
+
+
+method
+false
+true
+
+
+onreset
+false
+true
+
+
+onsubmit
+false
+true
+
+
+readonly
+false
+true
+
+
+scriptLanguage
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+target
+false
+true
+
+
+
+frame
+org.apache.struts.taglib.html.FrameTag
+
+bundle
+false
+true
+
+
+action
+false
+true
+
+
+module
+false
+true
+
+
+anchor
+false
+true
+
+
+forward
+false
+true
+
+
+frameborder
+false
+true
+
+
+frameName
+false
+true
+
+
+href
+false
+true
+
+
+longdesc
+false
+true
+
+
+marginheight
+false
+true
+
+
+marginwidth
+false
+true
+
+
+name
+false
+true
+
+
+noresize
+false
+true
+
+
+page
+false
+true
+
+
+paramId
+false
+true
+
+
+paramName
+false
+true
+
+
+paramProperty
+false
+true
+
+
+paramScope
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+scrolling
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+transaction
+false
+true
+
+
+
+hidden
+org.apache.struts.taglib.html.HiddenTag
+empty
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+indexed
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+true
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+write
+false
+true
+
+
+
+html
+org.apache.struts.taglib.html.HtmlTag
+JSP
+
+lang
+false
+true
+
+
+locale
+false
+true
+
+
+xhtml
+false
+true
+
+
+
+image
+org.apache.struts.taglib.html.ImageTag
+
+accesskey
+false
+true
+
+
+align
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+border
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+indexed
+false
+true
+
+
+locale
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+page
+false
+true
+
+
+pageKey
+false
+true
+
+
+property
+false
+true
+
+
+src
+false
+true
+
+
+srcKey
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+img
+org.apache.struts.taglib.html.ImgTag
+empty
+
+align
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+border
+false
+true
+
+
+bundle
+false
+true
+
+
+contextRelative
+false
+true
+
+
+height
+false
+true
+
+
+hspace
+false
+true
+
+
+imageName
+false
+true
+
+
+ismap
+false
+true
+
+
+locale
+false
+true
+
+
+lowsrc
+false
+true
+
+
+name
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+paramId
+false
+true
+
+
+page
+false
+true
+
+
+pageKey
+false
+true
+
+
+action
+false
+true
+
+
+module
+false
+true
+
+
+paramName
+false
+true
+
+
+paramProperty
+false
+true
+
+
+paramScope
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+src
+false
+true
+
+
+srcKey
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+useLocalEncoding
+false
+true
+
+
+usemap
+false
+true
+
+
+vspace
+false
+true
+
+
+width
+false
+true
+
+
+
+javascript
+org.apache.struts.taglib.html.JavascriptValidatorTag
+empty
+
+cdata
+false
+true
+
+
+dynamicJavascript
+false
+false
+
+
+formName
+false
+true
+
+
+method
+false
+true
+
+
+page
+false
+true
+
+
+scriptLanguage
+false
+true
+
+
+src
+false
+true
+
+
+staticJavascript
+false
+false
+
+
+htmlComment
+false
+true
+
+
+bundle
+false
+true
+
+
+
+link
+org.apache.struts.taglib.html.LinkTag
+
+accesskey
+false
+true
+
+
+action
+false
+true
+
+
+module
+false
+true
+
+
+anchor
+false
+true
+
+
+forward
+false
+true
+
+
+href
+false
+true
+
+
+indexed
+false
+true
+
+
+indexId
+false
+true
+
+
+bundle
+false
+true
+
+
+linkName
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+page
+false
+true
+
+
+paramId
+false
+true
+
+
+paramName
+false
+true
+
+
+paramProperty
+false
+true
+
+
+paramScope
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+target
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+transaction
+false
+true
+
+
+useLocalEncoding
+false
+true
+
+
+
+messages
+org.apache.struts.taglib.html.MessagesTag
+org.apache.struts.taglib.html.MessagesTei
+JSP
+
+id
+true
+false
+
+
+bundle
+false
+true
+
+
+locale
+false
+true
+
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+header
+false
+true
+
+
+footer
+false
+true
+
+
+message
+false
+true
+
+
+
+multibox
+org.apache.struts.taglib.html.MultiboxTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+errorKey
+false
+true
+
+
+errorStyle
+false
+true
+
+
+errorStyleClass
+false
+true
+
+
+errorStyleId
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+true
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+option
+org.apache.struts.taglib.html.OptionTag
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+key
+false
+true
+
+
+locale
+false
+true
+
+
+style
+false
+true
+
+
+styleId
+false
+true
+
+
+styleClass
+false
+true
+
+
+value
+true
+true
+
+
+
+options
+org.apache.struts.taglib.html.OptionsTag
+empty
+
+collection
+false
+true
+
+
+filter
+false
+true
+
+
+labelName
+false
+true
+
+
+labelProperty
+false
+true
+
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+
+optionsCollection
+org.apache.struts.taglib.html.OptionsCollectionTag
+empty
+
+filter
+false
+true
+
+
+label
+false
+true
+
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+value
+false
+true
+
+
+
+password
+org.apache.struts.taglib.html.PasswordTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+errorKey
+false
+true
+
+
+errorStyle
+false
+true
+
+
+errorStyleClass
+false
+true
+
+
+errorStyleId
+false
+true
+
+
+indexed
+false
+true
+
+
+maxlength
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+true
+true
+
+
+readonly
+false
+true
+
+
+redisplay
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+size
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+radio
+org.apache.struts.taglib.html.RadioTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+errorKey
+false
+true
+
+
+errorStyle
+false
+true
+
+
+errorStyleClass
+false
+true
+
+
+errorStyleId
+false
+true
+
+
+indexed
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+property
+true
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+true
+true
+
+
+idName
+false
+true
+
+
+
+reset
+org.apache.struts.taglib.html.ResetTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+rewrite
+org.apache.struts.taglib.html.RewriteTag
+empty
+
+action
+false
+true
+
+
+module
+false
+true
+
+
+anchor
+false
+true
+
+
+forward
+false
+true
+
+
+href
+false
+true
+
+
+name
+false
+true
+
+
+page
+false
+true
+
+
+paramId
+false
+true
+
+
+paramName
+false
+true
+
+
+paramProperty
+false
+true
+
+
+paramScope
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+transaction
+false
+true
+
+
+useLocalEncoding
+false
+true
+
+
+
+select
+org.apache.struts.taglib.html.SelectTag
+JSP
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+errorKey
+false
+true
+
+
+errorStyle
+false
+true
+
+
+errorStyleClass
+false
+true
+
+
+errorStyleId
+false
+true
+
+
+indexed
+false
+true
+
+
+multiple
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+true
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+size
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+submit
+org.apache.struts.taglib.html.SubmitTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+indexed
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+text
+org.apache.struts.taglib.html.TextTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+errorKey
+false
+true
+
+
+errorStyle
+false
+true
+
+
+errorStyleClass
+false
+true
+
+
+errorStyleId
+false
+true
+
+
+indexed
+false
+true
+
+
+maxlength
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+true
+true
+
+
+readonly
+false
+true
+
+
+size
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+textarea
+org.apache.struts.taglib.html.TextareaTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+cols
+false
+true
+
+
+disabled
+false
+true
+
+
+errorKey
+false
+true
+
+
+errorStyle
+false
+true
+
+
+errorStyleClass
+false
+true
+
+
+errorStyleId
+false
+true
+
+
+indexed
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+true
+true
+
+
+readonly
+false
+true
+
+
+rows
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+xhtml
+org.apache.struts.taglib.html.XhtmlTag
+empty
+
+
+
Index: lams_tool_assessment/web/WEB-INF/tlds/struts/struts-logic.tld
===================================================================
diff -u
--- lams_tool_assessment/web/WEB-INF/tlds/struts/struts-logic.tld (revision 0)
+++ lams_tool_assessment/web/WEB-INF/tlds/struts/struts-logic.tld (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,652 @@
+
+
+
+
+
+
+
+
+
+1.2
+1.1
+logic
+http://struts.apache.org/tags-logic
+
+empty
+org.apache.struts.taglib.logic.EmptyTag
+JSP
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+
+equal
+org.apache.struts.taglib.logic.EqualTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+forward
+org.apache.struts.taglib.logic.ForwardTag
+empty
+
+name
+true
+true
+
+
+
+greaterEqual
+org.apache.struts.taglib.logic.GreaterEqualTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+greaterThan
+org.apache.struts.taglib.logic.GreaterThanTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+iterate
+org.apache.struts.taglib.logic.IterateTag
+org.apache.struts.taglib.logic.IterateTei
+JSP
+
+collection
+false
+true
+
+
+id
+true
+false
+
+
+indexId
+false
+false
+
+
+length
+false
+true
+
+
+name
+false
+true
+
+
+offset
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+type
+false
+true
+
+
+
+lessEqual
+org.apache.struts.taglib.logic.LessEqualTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+lessThan
+org.apache.struts.taglib.logic.LessThanTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+match
+org.apache.struts.taglib.logic.MatchTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+location
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+messagesNotPresent
+org.apache.struts.taglib.logic.MessagesNotPresentTag
+JSP
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+message
+false
+true
+
+
+
+messagesPresent
+org.apache.struts.taglib.logic.MessagesPresentTag
+JSP
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+message
+false
+true
+
+
+
+notEmpty
+org.apache.struts.taglib.logic.NotEmptyTag
+JSP
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+
+notEqual
+org.apache.struts.taglib.logic.NotEqualTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+notMatch
+org.apache.struts.taglib.logic.NotMatchTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+location
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+notPresent
+org.apache.struts.taglib.logic.NotPresentTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+role
+false
+true
+
+
+scope
+false
+true
+
+
+user
+false
+true
+
+
+
+present
+org.apache.struts.taglib.logic.PresentTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+role
+false
+true
+
+
+scope
+false
+true
+
+
+user
+false
+true
+
+
+
+redirect
+org.apache.struts.taglib.logic.RedirectTag
+
+action
+false
+true
+
+
+anchor
+false
+true
+
+
+forward
+false
+true
+
+
+href
+false
+true
+
+
+name
+false
+true
+
+
+page
+false
+true
+
+
+paramId
+false
+true
+
+
+paramName
+false
+true
+
+
+paramProperty
+false
+true
+
+
+paramScope
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+transaction
+false
+true
+
+
+useLocalEncoding
+false
+true
+
+
+
+
+
+
Index: lams_tool_assessment/web/WEB-INF/tlds/struts/struts-nested.tld
===================================================================
diff -u
--- lams_tool_assessment/web/WEB-INF/tlds/struts/struts-nested.tld (revision 0)
+++ lams_tool_assessment/web/WEB-INF/tlds/struts/struts-nested.tld (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,3171 @@
+
+
+
+
+
+
+
+
+
+1.2
+1.1
+nested
+http://struts.apache.org/tags-nested
+
+nest
+org.apache.struts.taglib.nested.NestedPropertyTag
+JSP
+
+property
+false
+true
+
+
+
+writeNesting
+org.apache.struts.taglib.nested.NestedWriteNestingTag
+org.apache.struts.taglib.nested.NestedWriteNestingTei
+JSP
+
+property
+false
+true
+
+
+id
+false
+true
+
+
+filter
+false
+true
+
+
+
+root
+org.apache.struts.taglib.nested.NestedRootTag
+JSP
+
+name
+false
+true
+
+
+
+define
+org.apache.struts.taglib.nested.bean.NestedDefineTag
+org.apache.struts.taglib.nested.bean.NestedDefineTei
+empty
+
+id
+true
+true
+
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+toScope
+false
+true
+
+
+type
+false
+true
+
+
+value
+false
+true
+
+
+
+message
+org.apache.struts.taglib.nested.bean.NestedMessageTag
+empty
+
+arg0
+false
+true
+
+
+arg1
+false
+true
+
+
+arg2
+false
+true
+
+
+arg3
+false
+true
+
+
+arg4
+false
+true
+
+
+bundle
+false
+true
+
+
+key
+false
+true
+
+
+locale
+false
+true
+
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+
+size
+org.apache.struts.taglib.nested.bean.NestedSizeTag
+org.apache.struts.taglib.bean.SizeTei
+empty
+
+collection
+false
+true
+
+
+id
+true
+true
+
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+
+write
+org.apache.struts.taglib.nested.bean.NestedWriteTag
+empty
+
+bundle
+false
+true
+
+
+filter
+false
+true
+
+
+format
+false
+true
+
+
+formatKey
+false
+true
+
+
+ignore
+false
+true
+
+
+locale
+false
+true
+
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+
+checkbox
+org.apache.struts.taglib.nested.html.NestedCheckboxTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+errorKey
+false
+true
+
+
+errorStyle
+false
+true
+
+
+errorStyleClass
+false
+true
+
+
+errorStyleId
+false
+true
+
+
+indexed
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+true
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+errors
+org.apache.struts.taglib.nested.html.NestedErrorsTag
+empty
+
+bundle
+false
+true
+
+
+footer
+false
+true
+
+
+header
+false
+true
+
+
+locale
+false
+true
+
+
+name
+false
+true
+
+
+prefix
+false
+true
+
+
+property
+false
+true
+
+
+suffix
+false
+true
+
+
+
+file
+org.apache.struts.taglib.nested.html.NestedFileTag
+
+accesskey
+false
+true
+
+
+accept
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+errorKey
+false
+true
+
+
+errorStyle
+false
+true
+
+
+errorStyleClass
+false
+true
+
+
+errorStyleId
+false
+true
+
+
+indexed
+false
+true
+
+
+maxlength
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+true
+true
+
+
+size
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+form
+org.apache.struts.taglib.nested.html.NestedFormTag
+JSP
+
+action
+true
+true
+
+
+acceptCharset
+false
+true
+
+
+disabled
+false
+true
+
+
+enctype
+false
+true
+
+
+focus
+false
+true
+
+
+focusIndex
+false
+true
+
+
+method
+false
+true
+
+
+onreset
+false
+true
+
+
+onsubmit
+false
+true
+
+
+readonly
+false
+true
+
+
+scriptLanguage
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+target
+false
+true
+
+
+
+hidden
+org.apache.struts.taglib.nested.html.NestedHiddenTag
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+indexed
+false
+true
+
+
+name
+false
+true
+
+
+property
+true
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+value
+false
+true
+
+
+write
+false
+true
+
+
+
+image
+org.apache.struts.taglib.nested.html.NestedImageTag
+
+accesskey
+false
+true
+
+
+align
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+border
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+indexed
+false
+true
+
+
+locale
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+page
+false
+true
+
+
+pageKey
+false
+true
+
+
+property
+false
+true
+
+
+src
+false
+true
+
+
+srcKey
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+img
+org.apache.struts.taglib.nested.html.NestedImgTag
+empty
+
+accesskey
+false
+true
+
+
+align
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+border
+false
+true
+
+
+bundle
+false
+true
+
+
+height
+false
+true
+
+
+hspace
+false
+true
+
+
+imageName
+false
+true
+
+
+ismap
+false
+true
+
+
+locale
+false
+true
+
+
+lowsrc
+false
+true
+
+
+name
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+paramId
+false
+true
+
+
+page
+false
+true
+
+
+pageKey
+false
+true
+
+
+action
+false
+true
+
+
+module
+false
+true
+
+
+paramName
+false
+true
+
+
+paramProperty
+false
+true
+
+
+paramScope
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+src
+false
+true
+
+
+srcKey
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+useLocalEncoding
+false
+true
+
+
+usemap
+false
+true
+
+
+vspace
+false
+true
+
+
+width
+false
+true
+
+
+
+link
+org.apache.struts.taglib.nested.html.NestedLinkTag
+
+accesskey
+false
+true
+
+
+action
+false
+true
+
+
+module
+false
+true
+
+
+anchor
+false
+true
+
+
+forward
+false
+true
+
+
+href
+false
+true
+
+
+indexed
+false
+true
+
+
+indexId
+false
+true
+
+
+bundle
+false
+true
+
+
+linkName
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+page
+false
+true
+
+
+paramId
+false
+true
+
+
+paramName
+false
+true
+
+
+paramProperty
+false
+true
+
+
+paramScope
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+target
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+transaction
+false
+true
+
+
+useLocalEncoding
+false
+true
+
+
+
+messages
+org.apache.struts.taglib.nested.html.NestedMessagesTag
+org.apache.struts.taglib.html.MessagesTei
+JSP
+
+id
+true
+true
+
+
+bundle
+false
+true
+
+
+locale
+false
+true
+
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+header
+false
+true
+
+
+footer
+false
+true
+
+
+message
+false
+true
+
+
+
+multibox
+org.apache.struts.taglib.nested.html.NestedMultiboxTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+errorKey
+false
+true
+
+
+errorStyle
+false
+true
+
+
+errorStyleClass
+false
+true
+
+
+errorStyleId
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+true
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+options
+org.apache.struts.taglib.nested.html.NestedOptionsTag
+empty
+
+collection
+false
+true
+
+
+filter
+false
+true
+
+
+labelName
+false
+true
+
+
+labelProperty
+false
+true
+
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+
+optionsCollection
+org.apache.struts.taglib.nested.html.NestedOptionsCollectionTag
+empty
+
+filter
+false
+true
+
+
+label
+false
+true
+
+
+name
+false
+true
+
+
+property
+true
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+value
+false
+true
+
+
+
+password
+org.apache.struts.taglib.nested.html.NestedPasswordTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+errorKey
+false
+true
+
+
+errorStyle
+false
+true
+
+
+errorStyleClass
+false
+true
+
+
+errorStyleId
+false
+true
+
+
+indexed
+false
+true
+
+
+maxlength
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+true
+true
+
+
+readonly
+false
+true
+
+
+redisplay
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+size
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+radio
+org.apache.struts.taglib.nested.html.NestedRadioTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+errorKey
+false
+true
+
+
+errorStyle
+false
+true
+
+
+errorStyleClass
+false
+true
+
+
+errorStyleId
+false
+true
+
+
+indexed
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+property
+true
+true
+
+
+onmousedown
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+true
+true
+
+
+idName
+false
+true
+
+
+
+select
+org.apache.struts.taglib.nested.html.NestedSelectTag
+JSP
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+errorKey
+false
+true
+
+
+errorStyle
+false
+true
+
+
+errorStyleClass
+false
+true
+
+
+errorStyleId
+false
+true
+
+
+indexed
+false
+true
+
+
+multiple
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+true
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+size
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+submit
+org.apache.struts.taglib.nested.html.NestedSubmitTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+indexed
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+text
+org.apache.struts.taglib.nested.html.NestedTextTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+errorKey
+false
+true
+
+
+errorStyle
+false
+true
+
+
+errorStyleClass
+false
+true
+
+
+errorStyleId
+false
+true
+
+
+indexed
+false
+true
+
+
+maxlength
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+true
+true
+
+
+readonly
+false
+true
+
+
+size
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+textarea
+org.apache.struts.taglib.nested.html.NestedTextareaTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+cols
+false
+true
+
+
+disabled
+false
+true
+
+
+errorKey
+false
+true
+
+
+errorStyle
+false
+true
+
+
+errorStyleClass
+false
+true
+
+
+errorStyleId
+false
+true
+
+
+indexed
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+true
+true
+
+
+readonly
+false
+true
+
+
+rows
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+empty
+org.apache.struts.taglib.nested.logic.NestedEmptyTag
+JSP
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+
+equal
+org.apache.struts.taglib.nested.logic.NestedEqualTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+greaterEqual
+org.apache.struts.taglib.nested.logic.NestedGreaterEqualTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+greaterThan
+org.apache.struts.taglib.nested.logic.NestedGreaterThanTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+iterate
+org.apache.struts.taglib.nested.logic.NestedIterateTag
+org.apache.struts.taglib.nested.logic.NestedIterateTei
+JSP
+
+collection
+false
+true
+
+
+id
+false
+true
+
+
+indexId
+false
+true
+
+
+length
+false
+true
+
+
+name
+false
+true
+
+
+offset
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+type
+false
+true
+
+
+
+lessEqual
+org.apache.struts.taglib.nested.logic.NestedLessEqualTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+lessThan
+org.apache.struts.taglib.nested.logic.NestedLessThanTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+match
+org.apache.struts.taglib.nested.logic.NestedMatchTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+location
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+messagesNotPresent
+org.apache.struts.taglib.nested.logic.NestedMessagesNotPresentTag
+JSP
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+message
+false
+true
+
+
+
+messagesPresent
+org.apache.struts.taglib.nested.logic.NestedMessagesPresentTag
+JSP
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+message
+false
+true
+
+
+
+notEmpty
+org.apache.struts.taglib.nested.logic.NestedNotEmptyTag
+JSP
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+
+notEqual
+org.apache.struts.taglib.nested.logic.NestedNotEqualTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+notMatch
+org.apache.struts.taglib.nested.logic.NestedNotMatchTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+location
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+notPresent
+org.apache.struts.taglib.nested.logic.NestedNotPresentTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+role
+false
+true
+
+
+scope
+false
+true
+
+
+user
+false
+true
+
+
+
+present
+org.apache.struts.taglib.nested.logic.NestedPresentTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+role
+false
+true
+
+
+scope
+false
+true
+
+
+user
+false
+true
+
+
+
+
+
+
Index: lams_tool_assessment/web/WEB-INF/tlds/struts/struts-tiles.tld
===================================================================
diff -u
--- lams_tool_assessment/web/WEB-INF/tlds/struts/struts-tiles.tld (revision 0)
+++ lams_tool_assessment/web/WEB-INF/tlds/struts/struts-tiles.tld (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,344 @@
+
+
+
+
+
+
+
+
+
+
+1.2
+1.1
+tiles
+http://struts.apache.org/tags-tiles
+
+insert
+org.apache.struts.taglib.tiles.InsertTag
+JSP
+
+template
+false
+true
+
+
+component
+false
+true
+
+
+page
+false
+true
+
+
+definition
+false
+true
+
+
+attribute
+false
+false
+
+
+name
+false
+true
+
+
+beanName
+false
+true
+
+
+beanProperty
+false
+true
+
+
+beanScope
+false
+false
+
+
+flush
+false
+false
+
+
+ignore
+false
+true
+
+
+role
+false
+true
+
+
+controllerUrl
+false
+true
+
+
+controllerClass
+false
+true
+
+
+
+definition
+org.apache.struts.taglib.tiles.DefinitionTag
+JSP
+
+id
+true
+false
+
+
+scope
+false
+false
+
+
+template
+false
+true
+
+
+page
+false
+true
+
+
+role
+false
+true
+
+
+extends
+false
+true
+
+
+
+put
+org.apache.struts.taglib.tiles.PutTag
+JSP
+
+name
+false
+false
+
+
+value
+false
+true
+
+
+content
+false
+true
+
+
+direct
+false
+false
+
+
+type
+false
+false
+
+
+beanName
+false
+true
+
+
+beanProperty
+false
+true
+
+
+beanScope
+false
+false
+
+
+role
+false
+true
+
+
+
+putList
+org.apache.struts.taglib.tiles.PutListTag
+JSP
+
+name
+true
+false
+
+
+
+add
+org.apache.struts.taglib.tiles.AddTag
+JSP
+
+value
+false
+false
+
+
+content
+false
+true
+
+
+direct
+false
+false
+
+
+type
+false
+false
+
+
+beanName
+false
+true
+
+
+beanProperty
+false
+true
+
+
+beanScope
+false
+false
+
+
+role
+false
+true
+
+
+
+get
+org.apache.struts.taglib.tiles.GetTag
+empty
+
+name
+true
+true
+
+
+ignore
+false
+true
+
+
+flush
+false
+false
+
+
+role
+false
+true
+
+
+
+getAsString
+org.apache.struts.taglib.tiles.GetAttributeTag
+empty
+
+name
+true
+true
+
+
+ignore
+false
+true
+
+
+role
+false
+true
+
+
+
+useAttribute
+org.apache.struts.taglib.tiles.UseAttributeTag
+org.apache.struts.taglib.tiles.UseAttributeTei
+empty
+
+id
+false
+false
+
+
+classname
+false
+false
+
+
+scope
+false
+false
+
+
+name
+true
+true
+
+
+ignore
+false
+true
+
+
+
+importAttribute
+org.apache.struts.taglib.tiles.ImportAttributeTag
+empty
+
+name
+false
+true
+
+
+scope
+false
+false
+
+
+ignore
+false
+true
+
+
+
+initComponentDefinitions
+org.apache.struts.taglib.tiles.InitDefinitionsTag
+empty
+
+file
+true
+false
+
+
+classname
+false
+false
+
+
+
+
+
+
Index: lams_tool_assessment/web/WEB-INF/web.xml
===================================================================
diff -u
--- lams_tool_assessment/web/WEB-INF/web.xml (revision 0)
+++ lams_tool_assessment/web/WEB-INF/web.xml (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,357 @@
+
+
+
+ Shared Assessment
+
+ Shared Assessment tool
+
+
+ javax.servlet.jsp.jstl.fmt.localizationContext
+ org.lamsfoundation.lams.tool.assessment.ApplicationResources
+
+
+ contextConfigLocation
+
+ classpath:/org/lamsfoundation/lams/applicationContext.xml
+ classpath:/org/lamsfoundation/lams/contentrepository/applicationContext.xml
+ classpath:/org/lamsfoundation/lams/toolApplicationContext.xml
+ classpath:/org/lamsfoundation/lams/lesson/lessonApplicationContext.xml
+ classpath:/org/lamsfoundation/lams/learning/learningApplicationContext.xml
+ classpath:/org/lamsfoundation/lams/tool/assessment/assessmentApplicationContext.xml
+
+
+
+
+
+ org.springframework.web.context.ContextLoaderListener
+
+
+
+
+
+ org.lamsfoundation.lams.web.session.SetMaxTimeoutListener
+
+
+
+
+ hibernateFilter
+
+ org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
+
+
+ sessionFactoryBeanName
+ assessmentSessionFactory
+
+
+
+
+ SystemSessionFilter
+
+ org.lamsfoundation.lams.web.session.SystemSessionFilter
+
+
+
+ LocaleFilter
+
+ org.lamsfoundation.lams.web.filter.LocaleFilter
+
+
+ encoding
+ UTF-8
+
+
+
+
+ hibernateFilter
+ /*
+
+
+ SystemSessionFilter
+ /*
+
+
+ LocaleFilter
+ /*
+
+
+
+
+
+ exportPortfolio
+ org.lamsfoundation.lams.tool.assessment.web.servlet.ExportServlet
+
+
+
+ action
+ org.apache.struts.action.ActionServlet
+
+ config
+ /WEB-INF/struts-config.xml
+
+
+ debug
+ 999
+
+
+ detail
+ 1
+
+
+ validate
+ true
+
+ 2
+
+
+
+ Connector
+ com.fredck.FCKeditor.connector.ConnectorServlet
+
+ baseDir
+ /UserFiles/
+
+
+ debug
+ false
+
+ 1
+
+
+
+
+ Instructions Download
+ Instructions Download
+ download
+ org.lamsfoundation.lams.contentrepository.client.ToolDownload
+
+ toolContentHandlerBeanName
+ assessmentToolContentHandler
+
+ 3
+
+
+
+ action
+ *.do
+
+
+
+ Connector
+ /editor/filemanager/browser/default/connectors/jsp/connector
+
+
+
+ download
+ /download/*
+
+
+
+ exportPortfolio
+ /exportPortfolio
+
+
+
+
+
+
+
+ tags-bean
+ /WEB-INF/tlds/struts/struts-bean.tld
+
+
+ tags-html
+ /WEB-INF/tlds/struts/struts-html.tld
+
+
+ tags-logic
+ /WEB-INF/tlds/struts/struts-logic.tld
+
+
+ tags-tiles
+ /WEB-INF/tlds/struts/struts-tiles.tld
+
+
+
+
+
+ tags-fmt
+ /WEB-INF/tlds/jstl/fmt.tld
+
+
+ tags-core
+ /WEB-INF/tlds/jstl/c.tld
+
+
+ tags-function
+ /WEB-INF/tlds/jstl/fn.tld
+
+
+ tags-xml
+ /WEB-INF/tlds/jstl/x.tld
+
+
+
+
+
+ fck-editor
+ /WEB-INF/tlds/fckeditor/FCKeditor.tld
+
+
+
+
+
+ tags-lams
+ /WEB-INF/tlds/lams/lams.tld
+
+
+
+
+
+
+
+ Secure Content
+ /*
+
+
+ LEARNER
+ TEACHER
+ MONITOR
+ AUTHOR
+ ADMIN
+ SYSADMIN
+ AUTHOR ADMIN
+
+
+
+
+
+ Authoring Update
+ /authoring/*
+
+
+ AUTHOR
+ AUTHOR ADMIN
+ SYSADMIN
+
+
+
+
+ Staff Content
+ /monitoring.do
+
+
+ MONITOR
+ TEACHER
+
+
+
+
+ Staff Content
+ /definelater.do
+
+
+ MONITOR
+ TEACHER
+
+
+
+
+
+ Adminstrator Content
+ /admin.do
+
+
+ ADMIN
+
+
+
+
+ LAMS System Adminstrator Content
+ /sysadmin.do
+
+
+ SYSADMIN
+
+
+
+
+
+ Download Files
+ /download/
+
+
+ LEARNER
+ AUTHOR
+ MONITOR
+ TEACHER
+ ADMIN
+ SYSADMIN
+ AUTHOR ADMIN
+
+
+
+
+
+
+
+ Student
+ LEARNER
+
+
+ Student
+ TEACHER
+
+
+
+ Can create/modify a learning design
+ AUTHOR
+
+
+
+ Can running and monitoring a learning session
+ MONITOR
+
+
+
+ Can add/remove users to the system, set up classes of users for sessions
+ ADMIN
+
+
+
+ Can add/remove users to the system, set up classes of users for sessions
+ SYSADMIN
+
+
+
+ Can create/modify a learning design and edit default tool content
+ AUTHOR ADMIN
+
+
+
+
+ FORM
+ LAMS
+
+ /login.jsp
+ /login.jsp?failed=y
+
+
+
+
+ 500
+ /error.jsp
+
+
+ 403
+ /403.jsp
+
+
+ 404
+ /404.jsp
+
+
+
Index: lams_tool_assessment/web/common/fckeditorheader.jsp
===================================================================
diff -u
--- lams_tool_assessment/web/common/fckeditorheader.jsp (revision 0)
+++ lams_tool_assessment/web/common/fckeditorheader.jsp (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,5 @@
+<%@ include file="/common/taglibs.jsp"%>
+
+
+
+
Index: lams_tool_assessment/web/common/footer.jsp
===================================================================
diff -u
--- lams_tool_assessment/web/common/footer.jsp (revision 0)
+++ lams_tool_assessment/web/common/footer.jsp (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1 @@
+
Index: lams_tool_assessment/web/common/header.jsp
===================================================================
diff -u
--- lams_tool_assessment/web/common/header.jsp (revision 0)
+++ lams_tool_assessment/web/common/header.jsp (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,17 @@
+<%@ include file="/common/taglibs.jsp"%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_assessment/web/common/messages.jsp
===================================================================
diff -u
--- lams_tool_assessment/web/common/messages.jsp (revision 0)
+++ lams_tool_assessment/web/common/messages.jsp (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,8 @@
+<%-- Error Messages --%>
+
+
' + (this.a_children.length ? '' : '');
+ **/
+}
+
+function item_get_icon (b_junction) {
+ return this.o_root.a_tpl['icon_' + ((this.n_depth ? 0 : 32) + (this.a_children.length ? 16 : 0) + (this.a_children.length && this.b_opened ? 8 : 0) + (!b_junction && this.o_root.o_selected == this ? 4 : 0) + (b_junction ? 2 : 0) + (b_junction && this.is_last() ? 1 : 0))];
+}
+
+var trees = [];
+get_element = document.all ?
+ function (s_id) { return document.all[s_id] } :
+ function (s_id) { return document.getElementById(s_id) };
Index: lams_tool_assessment/web/includes/javascript/tree_tpl.js
===================================================================
diff -u
--- lams_tool_assessment/web/includes/javascript/tree_tpl.js (revision 0)
+++ lams_tool_assessment/web/includes/javascript/tree_tpl.js (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,36 @@
+/*
+ Feel free to use your custom icons for the tree. Make sure they are all of the same size.
+ User icons collections are welcome, we'll publish them giving all regards.
+*/
+
+var TREE_TPL = {
+ 'target' : 'contentFrame', // name of the frame links will be opened in
+ // other possible values are: _blank, _parent, _search, _self and _top
+
+ 'icon_e' : 'icons/empty.gif', // empty image
+ 'icon_l' : 'icons/line.gif', // vertical line
+
+ 'icon_32' : 'icons/base.gif', // root leaf icon normal
+ 'icon_36' : 'icons/base.gif', // root leaf icon selected
+
+ 'icon_48' : 'icons/base.gif', // root icon normal
+ 'icon_52' : 'icons/base.gif', // root icon selected
+ 'icon_56' : 'icons/base.gif', // root icon opened
+ 'icon_60' : 'icons/base.gif', // root icon selected
+
+ 'icon_16' : 'icons/folder.gif', // node icon normal
+ 'icon_20' : 'icons/folderopen.gif', // node icon selected
+ 'icon_24' : 'icons/folderopen.gif', // node icon opened
+ 'icon_28' : 'icons/folderopen.gif', // node icon selected opened
+
+ 'icon_0' : 'icons/page.gif', // leaf icon normal
+ 'icon_4' : 'icons/page.gif', // leaf icon selected
+
+ 'icon_2' : 'icons/joinbottom.gif', // junction for leaf
+ 'icon_3' : 'icons/join.gif', // junction for last leaf
+ 'icon_18' : 'icons/plusbottom.gif', // junction for closed node
+ 'icon_19' : 'icons/plus.gif', // junctioin for last closed node
+ 'icon_26' : 'icons/minusbottom.gif',// junction for opened node
+ 'icon_27' : 'icons/minus.gif' // junctioin for last opended node
+};
+
Index: lams_tool_assessment/web/layout/ frame.jsp
===================================================================
diff -u
--- lams_tool_assessment/web/layout/ frame.jsp (revision 0)
+++ lams_tool_assessment/web/layout/ frame.jsp (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,56 @@
+<%--
+Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+License Information: http://lamsfoundation.org/licensing/lams/2.0/
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License version 2 as
+ published by the Free Software Foundation.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+ USA
+
+ http://www.gnu.org/licenses/gpl.txt
+--%>
+<%@ include file="/common/taglibs.jsp" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This tool requires the support of frames. Your browser does not support frames.
+
+
+
+
Index: lams_tool_assessment/web/layout/default.jsp
===================================================================
diff -u
--- lams_tool_assessment/web/layout/default.jsp (revision 0)
+++ lams_tool_assessment/web/layout/default.jsp (revision c56857991e269aa7f5bd250a05b52c767a9957ad)
@@ -0,0 +1,20 @@
+<%@ include file="/common/taglibs.jsp"%>
+<%@ taglib uri="tags-tiles" prefix="tiles"%>
+
+
+
+
+
+
+
+
+