Index: lams_tool_scratchie/conf/language/lams/ApplicationResources_en_AU.properties
===================================================================
diff -u -r0ef117e7eca05b962210cb3b18eab1e39a6c57d1 -r6ade8791af29bde5c1e1b1aad674a9d23b69fb36
--- lams_tool_scratchie/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision 0ef117e7eca05b962210cb3b18eab1e39a6c57d1)
+++ lams_tool_scratchie/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision 6ade8791af29bde5c1e1b1aad674a9d23b69fb36)
@@ -95,11 +95,15 @@
warning.msg.are.you.sure.you.want.to.finish =Are you sure you want to finish?
label.authoring.add.blank.answer =Add Blank Answer
label.authoring.title.required =Title is required.
-label.authoring.numerical.error.answer =You should provide at least one possible answer.
+label.authoring.error.possible.answer =You should provide at least one possible answer.
+label.authoring.error.correct.answer =You should mark one of the filled answers as correct.
error.form.validation.error =You have 1 error in a form. It has been highlighted
error.form.validation.errors =You have {0} errors in a form. They have been highlighted
label.edit.question =Add/Edit Question
label.authoring.basic.question.name =Question title
label.authoring.basic.question.text =Question description
+label.authoring.advanced.give.extra.point =Give an extra point to all questions if student gets it right in the first attempt
+label.authoring.scratchie.answers =Scratchie answers
+label.one.or.more.questions.not.completed =One or more questions have not being completed. If you are to continue, you won't be able to answer these questions at a later stage and you'll get zero point for this questions. Are you sure you want to continue?
#======= End labels: Exported 176 labels for en AU =====
Index: lams_tool_scratchie/conf/language/rams/ApplicationResources.properties
===================================================================
diff -u -r6aaee4b2fe2caa08b0c63a0de11f05042d5a3e18 -r6ade8791af29bde5c1e1b1aad674a9d23b69fb36
--- lams_tool_scratchie/conf/language/rams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 6aaee4b2fe2caa08b0c63a0de11f05042d5a3e18)
+++ lams_tool_scratchie/conf/language/rams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 6ade8791af29bde5c1e1b1aad674a9d23b69fb36)
@@ -6,166 +6,5 @@
#=================== labels for ShareResources =================#
-appName =Share Resources
-activity.title =Scratchie
-activity.description =Sharing resource with others.
-activity.helptext =Uploading your resources to share with others.
-tool.display.name =Share Resources Tool
-tool.description =Tool for sharing resources.
-errorPage.title =Error page
-errorPage.heading =Some error occurs when handling your request
-label.authoring.heading =Share Resources
-label.author.title =Share Resources Authoring
-label.authoring.heading.basic =Basic
-label.authoring.heading.advance =Advanced
-label.authoring.heading.instructions =Instructions
-label.authoring.heading.basic.desc =Basic input information for shared resources
-label.authoring.heading.instructions.desc =Please input online and offline instructions
-label.authoring.heading.advance.desc =Please input advance options for shared resources
-label.authoring.basic.title =Title
-label.authoring.basic.instruction =Instruction
-label.authoring.basic.add.url =Add URL
-label.authoring.basic.add.file =Add Single File
-label.authoring.basic.add.website =Add Zipped Website
-label.authoring.basic.add.learning.object =Add IMS Content Package
-label.authoring.basic.resource.list.title =Resource List
-label.authoring.basic.resource.url =URL
-label.authoring.basic.resource.file =File
-label.authoring.basic.resource.website =Website
-label.authoring.basic.resource.learning.object =IMS CP
-label.authoring.basic.resource.verify.url =Verify URL
-label.authoring.basic.resource.preview =Preview
-label.authoring.basic.resource.edit =Edit
-label.authoring.basic.resource.delete =Delete
-label.authoring.basic.resource.add.instruction =Add Instruction
-label.authoring.basic.resource.instructions =Instructions
-label.authoring.basic.resource.title.input =Title
-label.authoring.basic.resource.url.input =URL
-label.authoring.basic.resource.file.input =File
-label.authoring.basic.resource.description.input =Description
-label.authoring.basic.resource.zip.file.input =Zip file:
-label.authoring.online.instruction =Online Instructions
-label.authoring.offline.instruction =Offline Instructions
-label.authoring.online.file =Upload online file
-label.authoring.offline.file =Upload offline file
-label.authoring.choosefile.button =Choose file
-label.authoring.upload.online.button =Upload Online
-label.authoring.upload.offline.button =Upload Offline
-label.authoring.online.filelist =Online file list
-label.authoring.offline.filelist =Offline file list
-label.authoring.online.delete =Delete
-label.authoring.offline.delete =Delete
-label.authoring.advance.lock.on.finished =Lock when finished
-label.authoring.advance.run.content.auto =Run content automatically (only available if there is exactly one resource)
-label.authoring.advance.mini.number.resources.view =Minimum number of resources to view
-label.authoring.advance.allow.learner.add.urls =Allow participants to add URLs
-label.authoring.advance.allow.learner.add.files =Allow participants to add Files
-label.next.instruction =Next Instruction
-label.authoring.save.button =Save
-label.authoring.cancel.button =Cancel
-label.description =Description:
-authoring.exception =There is a problem in shared resources authoring page, the reason is {0}
-error.resource.item.title.blank =Title can not be blank.
-error.resource.item.url.blank =URL can not be blank.
-error.resource.item.file.blank =File can not be blank.
-error.resource.item.desc.blank =Comment/Instruction can not be blank
-error.resource.item.invalid.url =Invalid URL format.
-error.upload.failed =Upload file failed: {0}
-error.msg.upload.file.not.found =Could not find upload file {0}.
-error.msg.zip.file.exception =Could not handle zip file when uploading file.
-error.msg.file.not.found =File not found exception occurs when uploading file.
-error.msg.ims.package =Invalid IMS CP format.
-error.msg.ims.application =ImscpApplicationException occurs when uploading resource item file.
-error.msg.website.no.initial.file =Website zip can not find out initial file (index.htm/html or default.htm/html).
-error.msg.io.exception =IOException occurs when uploading file.
-error.msg.invaid.param.upload =InvalidParameterException occured while trying to upload File.
-error.msg.repository =Repository occurs exception while trying to upload file.
-error.msg.default.content.not.find =Could not retrieve default content record for this tool.
-msg.no.instruction =No instruction available.
-authoring.msg.cancel.save =Do you want to close this window without saving?
-label.learning.title =Share Resource
-label.learning.heading =Share Resources
-label.resoruce.to.review =Resources to view
-label.learning.minimum.review =You must view at least {0} of the resources.
-lable.learning.minimum.view.number.less =You at least view another {0} of the resources.
-label.check.for.new =Check for new
-label.suggest.new =Suggest a new
-label.learning.new.file =New file details:
-label.learning.new.url =New URL details:
-label.learning.comment.or.instruction =Comment/Instruction
-monitoring.tab.summary =Summary
-monitoring.tab.statistics =Statistic
-monitoring.tab.instructions =Instruction
-monitoring.tab.edit.activity =Edit Activity
-monitoring.label.group =Group
-monitoring.summary.note =Note: number of participants is the number of participants who have viewed the resource.
-monitoring.label.type =Type
-monitoring.label.title =Title
-monitoring.label.suggest =Suggested By
-monitoring.label.number.learners =Number of Participants
-monitoring.label.hide =Hide
-monitoring.label.show =Show
-monitoring.label.user.loginname =Login name
-monitoring.label.user.name =Name
-monitoring.label.hidden =Hidden
-label.monitoring.edit.activity.cancel =Cancel
-label.monitoring.edit.activity.update =Update
-label.monitoring.edit.activity.edit =Edit
-message.monitoring.edit.activity.not.editable =This Activity is no longer editable
-export.label.resource =Resource
-export.label.no.learning.object =No offline package available
-export.title =Export portfolio of Share Resource
-export.init.resource =Initial Resources
-errors.header =
-errors.footer =
-error.valueReqd =Value Required
-error.inputFileTooLarge =Input File size is too large!
-error.uploading =error uploading
-error.title.empty =Title can not be blank
-message.msg.maxFileSize =Max 250K
-label.open =Open
-label.delete =Delete
-label.download =Download
-label.view =View
-label.edit =Edit
-label.finished =Finished
-label.completed =Completed
-label.finish =Finish
-button.upload =Upload
-button.add =Add
-button.cancel =Cancel
-message.monitoring.summary.no.session =No Session Available
-label.show =Show
-label.hide =Hide
-label.save =Save
-label.cancel =Cancel
-monitoring.label.access.time =Access time
-define.later.message =Please wait for the researcher to complete the contents of this activity.
-run.offline.message =This activity is not being done on the computer. Please see your instructor for details.
-message.monitoring.summary.no.resource.for.group =No resource available for this group.
-button.try.again =Try again
-open.in.new.window =Open URL in pop-up
-label.up =Move Up
-label.down =Move down
-label.authoring.advanced.reflectOnActivity =Add Notebook at end of Shared Resources with the following instructions:
-error.reflection.emtpy =Please input reflection
-title.reflection =Reflection
-label.continue =Continue
-monitoring.user.fullname =Name
-monitoring.user.reflection =Reflection
-page.title.monitoring.view.reflection =View Reflection
-button.close =Close
-message.step.of =Step {0} of {1}
-message.no.reflection.available =No notebook available
-button.edit =Edit
-errors.maxfilesize =The uploaded file has exceeded the maximum file size limit of {0} bytes
-error.attachment.executable =The uploaded file is executable, please zip it before uploading.
-label.monitoring.heading.access =Participants list
-message.alertContentEdit =Warning: One of more participants have accessed this activity. Changing this content will result in students getting different information.
-label.export.reflection =Notebook Entries
-monitoring.label.attachments =Attachments
-message.activityLocked =Note: After you click on "Next Activity" and you come back to this Share Resources, you won't be able to continue.
-message.warnLockOnFinish =This activitiy has been setup not to allow sharing and viewing of resources after it has been finished.
-
#======= End labels: Exported 160 labels for en AU =====
Index: lams_tool_scratchie/conf/language/rams/ApplicationResources_en_AU.properties
===================================================================
diff -u -r6aaee4b2fe2caa08b0c63a0de11f05042d5a3e18 -r6ade8791af29bde5c1e1b1aad674a9d23b69fb36
--- lams_tool_scratchie/conf/language/rams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision 6aaee4b2fe2caa08b0c63a0de11f05042d5a3e18)
+++ lams_tool_scratchie/conf/language/rams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision 6ade8791af29bde5c1e1b1aad674a9d23b69fb36)
@@ -6,166 +6,5 @@
#=================== labels for ShareResources =================#
-appName =Share Resources
-activity.title =Scratchie
-activity.description =Sharing resource with others.
-activity.helptext =Uploading your resources to share with others.
-tool.display.name =Share Resources Tool
-tool.description =Tool for sharing resources.
-errorPage.title =Error page
-errorPage.heading =Some error occurs when handling your request
-label.authoring.heading =Share Resources
-label.author.title =Share Resources Authoring
-label.authoring.heading.basic =Basic
-label.authoring.heading.advance =Advanced
-label.authoring.heading.instructions =Instructions
-label.authoring.heading.basic.desc =Basic input information for shared resources
-label.authoring.heading.instructions.desc =Please input online and offline instructions
-label.authoring.heading.advance.desc =Please input advance options for shared resources
-label.authoring.basic.title =Title
-label.authoring.basic.instruction =Instruction
-label.authoring.basic.add.url =Add URL
-label.authoring.basic.add.file =Add Single File
-label.authoring.basic.add.website =Add Zipped Website
-label.authoring.basic.add.learning.object =Add IMS Content Package
-label.authoring.basic.resource.list.title =Resource List
-label.authoring.basic.resource.url =URL
-label.authoring.basic.resource.file =File
-label.authoring.basic.resource.website =Website
-label.authoring.basic.resource.learning.object =IMS CP
-label.authoring.basic.resource.verify.url =Verify URL
-label.authoring.basic.resource.preview =Preview
-label.authoring.basic.resource.edit =Edit
-label.authoring.basic.resource.delete =Delete
-label.authoring.basic.resource.add.instruction =Add Instruction
-label.authoring.basic.resource.instructions =Instructions
-label.authoring.basic.resource.title.input =Title
-label.authoring.basic.resource.url.input =URL
-label.authoring.basic.resource.file.input =File
-label.authoring.basic.resource.description.input =Description
-label.authoring.basic.resource.zip.file.input =Zip file:
-label.authoring.online.instruction =Online Instructions
-label.authoring.offline.instruction =Offline Instructions
-label.authoring.online.file =Upload online file
-label.authoring.offline.file =Upload offline file
-label.authoring.choosefile.button =Choose file
-label.authoring.upload.online.button =Upload Online
-label.authoring.upload.offline.button =Upload Offline
-label.authoring.online.filelist =Online file list
-label.authoring.offline.filelist =Offline file list
-label.authoring.online.delete =Delete
-label.authoring.offline.delete =Delete
-label.authoring.advance.lock.on.finished =Lock when finished
-label.authoring.advance.run.content.auto =Run content automatically (only available if there is exactly one resource)
-label.authoring.advance.mini.number.resources.view =Minimum number of resources to view
-label.authoring.advance.allow.learner.add.urls =Allow participants to add URLs
-label.authoring.advance.allow.learner.add.files =Allow participants to add Files
-label.next.instruction =Next Instruction
-label.authoring.save.button =Save
-label.authoring.cancel.button =Cancel
-label.description =Description:
-authoring.exception =There is a problem in shared resources authoring page, the reason is {0}
-error.resource.item.title.blank =Title can not be blank.
-error.resource.item.url.blank =URL can not be blank.
-error.resource.item.file.blank =File can not be blank.
-error.resource.item.desc.blank =Comment/Instruction can not be blank
-error.resource.item.invalid.url =Invalid URL format.
-error.upload.failed =Upload file failed: {0}
-error.msg.upload.file.not.found =Could not find upload file {0}.
-error.msg.zip.file.exception =Could not handle zip file when uploading file.
-error.msg.file.not.found =File not found exception occurs when uploading file.
-error.msg.ims.package =Invalid IMS CP format.
-error.msg.ims.application =ImscpApplicationException occurs when uploading resource item file.
-error.msg.website.no.initial.file =Website zip can not find out initial file (index.htm/html or default.htm/html).
-error.msg.io.exception =IOException occurs when uploading file.
-error.msg.invaid.param.upload =InvalidParameterException occured while trying to upload File.
-error.msg.repository =Repository occurs exception while trying to upload file.
-error.msg.default.content.not.find =Could not retrieve default content record for this tool.
-msg.no.instruction =No instruction available.
-authoring.msg.cancel.save =Do you want to close this window without saving?
-label.learning.title =Share Resource
-label.learning.heading =Share Resources
-label.resoruce.to.review =Resources to view
-label.learning.minimum.review =You must view at least {0} of the resources.
-lable.learning.minimum.view.number.less =You at least view another {0} of the resources.
-label.check.for.new =Check for new
-label.suggest.new =Suggest a new
-label.learning.new.file =New file details:
-label.learning.new.url =New URL details:
-label.learning.comment.or.instruction =Comment/Instruction
-monitoring.tab.summary =Summary
-monitoring.tab.statistics =Statistic
-monitoring.tab.instructions =Instruction
-monitoring.tab.edit.activity =Edit Activity
-monitoring.label.group =Group
-monitoring.summary.note =Note: number of participants is the number of participants who have viewed the resource.
-monitoring.label.type =Type
-monitoring.label.title =Title
-monitoring.label.suggest =Suggested By
-monitoring.label.number.learners =Number of Participants
-monitoring.label.hide =Hide
-monitoring.label.show =Show
-monitoring.label.user.loginname =Login name
-monitoring.label.user.name =Name
-monitoring.label.hidden =Hidden
-label.monitoring.edit.activity.cancel =Cancel
-label.monitoring.edit.activity.update =Update
-label.monitoring.edit.activity.edit =Edit
-message.monitoring.edit.activity.not.editable =This Activity is no longer editable
-export.label.resource =Resource
-export.label.no.learning.object =No offline package available
-export.title =Export portfolio of Share Resource
-export.init.resource =Initial Resources
-errors.header =
-errors.footer =
-error.valueReqd =Value Required
-error.inputFileTooLarge =Input File size is too large!
-error.uploading =error uploading
-error.title.empty =Title can not be blank
-message.msg.maxFileSize =Max 250K
-label.open =Open
-label.delete =Delete
-label.download =Download
-label.view =View
-label.edit =Edit
-label.finished =Finished
-label.completed =Completed
-label.finish =Finish
-button.upload =Upload
-button.add =Add
-button.cancel =Cancel
-message.monitoring.summary.no.session =No Session Available
-label.show =Show
-label.hide =Hide
-label.save =Save
-label.cancel =Cancel
-monitoring.label.access.time =Access time
-define.later.message =Please wait for the researcher to complete the contents of this activity.
-run.offline.message =This activity is not being done on the computer. Please see your instructor for details.
-message.monitoring.summary.no.resource.for.group =No resource available for this group.
-button.try.again =Try again
-open.in.new.window =Open URL in pop-up
-label.up =Move Up
-label.down =Move down
-label.authoring.advanced.reflectOnActivity =Add Notebook at end of Shared Resources with the following instructions:
-error.reflection.emtpy =Please input reflection
-title.reflection =Reflection
-label.continue =Continue
-monitoring.user.fullname =Name
-monitoring.user.reflection =Reflection
-page.title.monitoring.view.reflection =View Reflection
-button.close =Close
-message.step.of =Step {0} of {1}
-message.no.reflection.available =No notebook available
-button.edit =Edit
-errors.maxfilesize =The uploaded file has exceeded the maximum file size limit of {0} bytes
-error.attachment.executable =The uploaded file is executable, please zip it before uploading.
-label.monitoring.heading.access =Participants list
-message.alertContentEdit =Warning: One of more participants have accessed this activity. Changing this content will result in students getting different information.
-label.export.reflection =Notebook Entries
-monitoring.label.attachments =Attachments
-message.activityLocked =Note: After you click on "Next Activity" and you come back to this Share Resources, you won't be able to continue.
-message.warnLockOnFinish =This activitiy has been setup not to allow sharing and viewing of resources after it has been finished.
-
#======= End labels: Exported 160 labels for en AU =====
Index: lams_tool_scratchie/db/sql/create_lams_tool_scratchie.sql
===================================================================
diff -u -r0ef117e7eca05b962210cb3b18eab1e39a6c57d1 -r6ade8791af29bde5c1e1b1aad674a9d23b69fb36
--- lams_tool_scratchie/db/sql/create_lams_tool_scratchie.sql (.../create_lams_tool_scratchie.sql) (revision 0ef117e7eca05b962210cb3b18eab1e39a6c57d1)
+++ lams_tool_scratchie/db/sql/create_lams_tool_scratchie.sql (.../create_lams_tool_scratchie.sql) (revision 6ade8791af29bde5c1e1b1aad674a9d23b69fb36)
@@ -31,6 +31,7 @@
content_id bigint unique,
reflect_instructions varchar(255),
reflect_on_activity smallint,
+ extra_point smallint,
primary key (uid)
)ENGINE=InnoDB;
create table tl_lascrt11_scratchie_item (
@@ -96,13 +97,21 @@
INSERT INTO `tl_lascrt11_scratchie` (`uid`, `create_date`, `update_date`, `create_by`, `title`, `run_offline`,
- `instructions`, `online_instructions`, `offline_instructions`, `content_in_use`, `define_later`, `content_id`, `reflect_on_activity`) VALUES
- (1,NULL,NULL,NULL,'Scratchie','0','Scenario explanation ', null,null,0,0,${default_content_id},0);
+ `instructions`, `online_instructions`, `offline_instructions`, `content_in_use`, `define_later`, `content_id`, `reflect_on_activity`, `extra_point`) VALUES
+ (1,NULL,NULL,NULL,'Scratchie','0','Scenario explanation ', null,null,0,0,${default_content_id},0, 0);
INSERT INTO `tl_lascrt11_scratchie_item` (`uid`, `title`, `description`, `create_by`, `create_date`, `create_by_author`, `scratchie_uid`, `session_uid`, `order_id`) VALUES
(1, 'Question Title','Question Description',null,NOW(),1,1,NULL, 1);
INSERT INTO `tl_lascrt11_scratchie_answer` (`uid`, `description`, `correct`, `scratchie_item_uid`, `order_id`) VALUES
(1, 'Question Answer A',1,1,0);
-
+INSERT INTO `tl_lascrt11_scratchie_answer` (`uid`, `description`, `correct`, `scratchie_item_uid`, `order_id`) VALUES
+ (2, 'Question Answer B',0,1,1);
+INSERT INTO `tl_lascrt11_scratchie_answer` (`uid`, `description`, `correct`, `scratchie_item_uid`, `order_id`) VALUES
+ (3, 'Question Answer C',0,1,2);
+INSERT INTO `tl_lascrt11_scratchie_answer` (`uid`, `description`, `correct`, `scratchie_item_uid`, `order_id`) VALUES
+ (4, 'Question Answer D',0,1,3);
+INSERT INTO `tl_lascrt11_scratchie_answer` (`uid`, `description`, `correct`, `scratchie_item_uid`, `order_id`) VALUES
+ (5, 'Question Answer E',0,1,4);
+
SET FOREIGN_KEY_CHECKS=1;
Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/ScratchieConstants.java
===================================================================
diff -u -r0ef117e7eca05b962210cb3b18eab1e39a6c57d1 -r6ade8791af29bde5c1e1b1aad674a9d23b69fb36
--- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/ScratchieConstants.java (.../ScratchieConstants.java) (revision 0ef117e7eca05b962210cb3b18eab1e39a6c57d1)
+++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/ScratchieConstants.java (.../ScratchieConstants.java) (revision 6ade8791af29bde5c1e1b1aad674a9d23b69fb36)
@@ -32,7 +32,7 @@
public static final int COMPLETED = 1;
- public static final int INITIAL_ANSWERS_NUMBER = 3;
+ public static final int INITIAL_ANSWERS_NUMBER = 5;
// for action forward name
public static final String SUCCESS = "success";
@@ -108,8 +108,6 @@
public static final String ATTR_ITEM_SUMMARY = "itemSummary";
public static final String ATTR_RESOURCE_INSTRUCTION = "instructions";
-
- public static final String ATTR_SCRATCHING_LOCK = "scratchingLock";
public static final String ATTR_SESSION_MAP_ID = "sessionMapID";
Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/model/Scratchie.java
===================================================================
diff -u -r6aaee4b2fe2caa08b0c63a0de11f05042d5a3e18 -r6ade8791af29bde5c1e1b1aad674a9d23b69fb36
--- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/model/Scratchie.java (.../Scratchie.java) (revision 6aaee4b2fe2caa08b0c63a0de11f05042d5a3e18)
+++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/model/Scratchie.java (.../Scratchie.java) (revision 6ade8791af29bde5c1e1b1aad674a9d23b69fb36)
@@ -82,6 +82,8 @@
// scratchie Items
private Set scratchieItems;
+
+ private boolean extraPoint;
private boolean reflectOnActivity;
@@ -479,4 +481,16 @@
public void setReflectOnActivity(boolean reflectOnActivity) {
this.reflectOnActivity = reflectOnActivity;
}
+
+ /**
+ * @hibernate.property column="extra_point"
+ * @return
+ */
+ public boolean isExtraPoint() {
+ return extraPoint;
+ }
+
+ public void setExtraPoint(boolean extraPoint) {
+ this.extraPoint = extraPoint;
+ }
}
Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/model/ScratchieItem.java
===================================================================
diff -u -r0ef117e7eca05b962210cb3b18eab1e39a6c57d1 -r6ade8791af29bde5c1e1b1aad674a9d23b69fb36
--- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/model/ScratchieItem.java (.../ScratchieItem.java) (revision 0ef117e7eca05b962210cb3b18eab1e39a6c57d1)
+++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/model/ScratchieItem.java (.../ScratchieItem.java) (revision 6ade8791af29bde5c1e1b1aad674a9d23b69fb36)
@@ -57,6 +57,10 @@
// scratchie Items
private Set answers;
+ // ***********************************************
+ // DTO fields:
+ private boolean isUnraveled;
+
/**
* Default contruction method.
*
@@ -188,7 +192,7 @@
}
/**
- * @hibernate.set inverse="false" cascade="all" order-by="order_id desc"
+ * @hibernate.set inverse="false" cascade="all" order-by="order_id asc"
* @hibernate.collection-key column="scratchie_item_uid"
* @hibernate.collection-one-to-many class="org.lamsfoundation.lams.tool.scratchie.model.ScratchieAnswer"
*
@@ -201,4 +205,12 @@
public void setAnswers(Set answers) {
this.answers = answers;
}
+
+ public boolean isUnraveled() {
+ return isUnraveled;
+ }
+
+ public void setUnraveled(boolean isUnraveled) {
+ this.isUnraveled = isUnraveled;
+ }
}
Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/ScratchieServiceImpl.java
===================================================================
diff -u -r0ef117e7eca05b962210cb3b18eab1e39a6c57d1 -r6ade8791af29bde5c1e1b1aad674a9d23b69fb36
--- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/ScratchieServiceImpl.java (.../ScratchieServiceImpl.java) (revision 0ef117e7eca05b962210cb3b18eab1e39a6c57d1)
+++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/ScratchieServiceImpl.java (.../ScratchieServiceImpl.java) (revision 6ade8791af29bde5c1e1b1aad674a9d23b69fb36)
@@ -389,7 +389,11 @@
}
public void retrieveScratched(Collection items, ScratchieUser user) {
+
+
for (ScratchieItem item : items) {
+ boolean isItemUnraveled = false;
+
for (ScratchieAnswer answer : (Set)item.getAnswers()) {
ScratchieAnswerVisitLog log = scratchieAnswerVisitDao.getScratchieAnswerLog(answer.getUid(),
user.getUserId());
@@ -398,9 +402,13 @@
} else {
answer.setScratched(true);
answer.setScratchedDate(log.getAccessDate());
+ isItemUnraveled |= answer.isCorrect();
}
}
+ item.setUnraveled(isItemUnraveled);
}
+
+
}
public void setAnswerAccess(Long answerUid, Long userId, Long sessionId) {
@@ -945,6 +953,7 @@
toolContentObj.setRunOffline(Boolean.FALSE);
toolContentObj.setUpdated(now);
toolContentObj.setReflectOnActivity(Boolean.FALSE);
+ toolContentObj.setExtraPoint(Boolean.FALSE);
toolContentObj.setReflectInstructions(null);
// leave as empty, no need to set them to anything.
Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/action/AuthoringAction.java
===================================================================
diff -u -r0ef117e7eca05b962210cb3b18eab1e39a6c57d1 -r6ade8791af29bde5c1e1b1aad674a9d23b69fb36
--- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/action/AuthoringAction.java (.../AuthoringAction.java) (revision 0ef117e7eca05b962210cb3b18eab1e39a6c57d1)
+++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/action/AuthoringAction.java (.../AuthoringAction.java) (revision 6ade8791af29bde5c1e1b1aad674a9d23b69fb36)
@@ -854,22 +854,22 @@
private ActionForward switchAnswer(ActionMapping mapping, HttpServletRequest request, boolean up) {
SortedSet answerList = getAnswersFromRequest(request, false);
- int itemIndex = NumberUtils.stringToInt(request.getParameter(ScratchieConstants.PARAM_ITEM_INDEX), -1);
- if (itemIndex != -1) {
+ int answerIndex = NumberUtils.stringToInt(request.getParameter(ScratchieConstants.PARAM_ANSWER_INDEX), -1);
+ if (answerIndex != -1) {
List rList = new ArrayList(answerList);
// get current and the target item, and switch their sequnece
- ScratchieAnswer item = rList.get(itemIndex);
- ScratchieAnswer repOption;
+ ScratchieAnswer answer = rList.get(answerIndex);
+ ScratchieAnswer repAnswer;
if (up) {
- repOption = rList.get(--itemIndex);
+ repAnswer = rList.get(--answerIndex);
} else {
- repOption = rList.get(++itemIndex);
+ repAnswer = rList.get(++answerIndex);
}
- int upSeqId = repOption.getOrderId();
- repOption.setOrderId(item.getOrderId());
- item.setOrderId(upSeqId);
+ int upSeqId = repAnswer.getOrderId();
+ repAnswer.setOrderId(answer.getOrderId());
+ answer.setOrderId(upSeqId);
// put back list, it will be sorted again
answerList.clear();
Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/action/LearningAction.java
===================================================================
diff -u -r0ef117e7eca05b962210cb3b18eab1e39a6c57d1 -r6ade8791af29bde5c1e1b1aad674a9d23b69fb36
--- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/action/LearningAction.java (.../LearningAction.java) (revision 0ef117e7eca05b962210cb3b18eab1e39a6c57d1)
+++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/action/LearningAction.java (.../LearningAction.java) (revision 6ade8791af29bde5c1e1b1aad674a9d23b69fb36)
@@ -196,17 +196,6 @@
Collection items = new TreeSet(new ScratchieItemComparator());
items.addAll(initialItems);
sessionMap.put(ScratchieConstants.ATTR_ITEM_LIST, items);
-
- boolean scratchingLock = isUserFinished;
- //TODO!!!!
-// for (ScratchieItem item : items) {
-// if (item.isScratched() && item.isCorrect()) {
-// scratchingLock = true;
-// }
-// }
- sessionMap.put(ScratchieConstants.ATTR_SCRATCHING_LOCK, scratchingLock);
-
-
sessionMap.put(ScratchieConstants.ATTR_SCRATCHIE, scratchie);
return mapping.findForward(ScratchieConstants.SUCCESS);
Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/form/ScratchieForm.java
===================================================================
diff -u -r6aaee4b2fe2caa08b0c63a0de11f05042d5a3e18 -r6ade8791af29bde5c1e1b1aad674a9d23b69fb36
--- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/form/ScratchieForm.java (.../ScratchieForm.java) (revision 6aaee4b2fe2caa08b0c63a0de11f05042d5a3e18)
+++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/form/ScratchieForm.java (.../ScratchieForm.java) (revision 6ade8791af29bde5c1e1b1aad674a9d23b69fb36)
@@ -75,6 +75,7 @@
scratchie.setDefineLater(false);
scratchie.setRunOffline(false);
scratchie.setReflectOnActivity(false);
+ scratchie.setExtraPoint(false);
}
}
Index: lams_tool_scratchie/web/pages/authoring/advance.jsp
===================================================================
diff -u -r6aaee4b2fe2caa08b0c63a0de11f05042d5a3e18 -r6ade8791af29bde5c1e1b1aad674a9d23b69fb36
--- lams_tool_scratchie/web/pages/authoring/advance.jsp (.../advance.jsp) (revision 6aaee4b2fe2caa08b0c63a0de11f05042d5a3e18)
+++ lams_tool_scratchie/web/pages/authoring/advance.jsp (.../advance.jsp) (revision 6ade8791af29bde5c1e1b1aad674a9d23b69fb36)
@@ -4,8 +4,14 @@
-
-
+
+
+
+
+
+
Index: lams_tool_scratchie/web/pages/authoring/parts/additem.jsp
===================================================================
diff -u -r0ef117e7eca05b962210cb3b18eab1e39a6c57d1 -r6ade8791af29bde5c1e1b1aad674a9d23b69fb36
--- lams_tool_scratchie/web/pages/authoring/parts/additem.jsp (.../additem.jsp) (revision 0ef117e7eca05b962210cb3b18eab1e39a6c57d1)
+++ lams_tool_scratchie/web/pages/authoring/parts/additem.jsp (.../additem.jsp) (revision 6ade8791af29bde5c1e1b1aad674a9d23b69fb36)
@@ -153,16 +153,29 @@
title: "required",
hasAnswerFilled: {
required: function(element) {
+ //check there should be at least one answer filled
prepareAnswerEditorsForAjaxSubmit();
return $("textarea[name^=answerDescription]:filled").length < 1;
}
+ },
+ hasFilledCorrectAnswer: {
+ required: function(element) {
+ //check one answer should be selected as correct (and be filled at the same time)
+ prepareAnswerEditorsForAjaxSubmit();
+
+ var hasFilledCorrectAnswer = false;
+ $("input[name^=answerCorrect]:checked").each(function() {
+ var statusIndex = this.alt;
+ var answerDescription = $("textarea[name=answerDescription" + statusIndex + "]");
+ hasFilledCorrectAnswer = answerDescription.val() != "";
+ });
+
+ return !hasFilledCorrectAnswer;
+ }
}
},
messages: {
- title: "",
- hasAnswerFilled: {
- required: ""
- }
+ title: ""
},
invalidHandler: function(form, validator) {
var errors = validator.numberOfInvalids();
@@ -230,6 +243,17 @@
+
+