[samigo-team] EMI issues for Sakai 10

Jaques Smith jaques at opencollab.co.za
Wed Apr 16 01:45:37 PDT 2014


Hi Guys,

I made a mistake in the SAM-2018-part2.diff yesterday. I updated the
Javascript after testing and just checked it in one browser, schoolboy
error. This patch is in trunk.
So currently in FF the delete key and back key does not work on item
options. Oliver will log that.
There is too much patches so I'm asking you first what is the best option.

Attached is;
SAM-2018-part2v2.diff: This is what the SAM-2018-part2.diff should have
looked like.
SAM-2018-part2-fix.diff: This is just to update trunk as it is now to fix
that bug.

Which patch do I upload to Jira?

Cheers,
*Jaques Smith*
Development Manager
 *opencollab*
 *Tel*: +27 21 970 4000 | *Fax*: +27 21 914 3098
 *Mobile*: +27 82 779 9601 | *Skype*: jaques.smith
 *Web*: www.opencollab.co.za


On 15 April 2014 14:56, Neal Caidin <neal.caidin at apereo.org> wrote:

> Thanks everyone for the great work and testing (and to Oliver Williams
> too)!
>
>
>
>
> On Tue, Apr 15, 2014 at 8:13 AM, Stephen Marquard <
> stephen.marquard at uct.ac.za> wrote:
>
>>  We've successfully tested the changes on our 2.9.x msub T&Q branch and
>> they look good.
>>
>>
>>
>> Cheers
>>
>> Stephen
>>
>>
>>
>> ---
>> Stephen Marquard, Learning Technologies Co-ordinator
>> Centre for Innovation in Learning and Teaching (CILT, formerly CET and
>> HAESDU)
>> University of Cape Town
>> http://www.cet.uct.ac.za
>> stephen.marquard at uct.ac.za
>> Phone: +27-21-650-5037 Cell: +27-83-500-5290
>>
>>
>>
>> *From:* Jaques Smith [mailto:jaques at opencollab.co.za]
>> *Sent:* 15 April 2014 08:50 AM
>> *To:* Neal Caidin
>> *Cc:* Karen Tsao; Samigo Team; Stephen Marquard; Lydia Li
>>
>> *Subject:* Re: EMI issues for Sakai 10
>>
>>
>>
>> Hi Neal,
>>
>> Oliver will try and get to it today.
>>
>> Jaques Smith
>>
>> On 14 Apr 2014 6:59 PM, "Neal Caidin" <neal.caidin at apereo.org> wrote:
>>
>> Is there an ETA for getting remaining issues tested? I know we've had a
>> number of issues with the trunk build lately which has held things up.
>>
>> Thanks,
>> Neal
>>
>>
>>
>>     *Jaques Smith* <jaques at opencollab.co.za>
>>
>> April 14, 2014 at 10:17 AM
>>
>> You are correct. You also have the new patch (SAM-2018-part2.diff) in
>> your branch.
>>
>>
>>  *Jaques Smith*
>>
>> Development Manager
>>
>> *open**collab*
>>
>> *Tel*: +27 21 970 4000 | *Fax*: +27 21 914 3098
>>
>> *Mobile*: +27 82 779 9601 | *Skype*: jaques.smith
>>
>> *Web*: www.opencollab.co.za
>>
>>
>>
>>
>>  ------------------------------
>>
>> See OpenCollab email disclaimer at
>> http://www.opencollab.co.za/email-disclaimer
>>
>>   *Stephen Marquard* <stephen.marquard at uct.ac.za>
>>
>> April 14, 2014 at 10:11 AM
>>
>> Thanks Jacques.
>>
>>
>> We are QA'ing our 2-9-x UCT msub branch locally as well, which I
>> understand now has all the latest EMI fixes (Jaques, pls correct me if I'm
>> wrong on that).
>>
>>
>>
>> Cheers
>>
>> Stephen
>>
>>
>>
>> ---
>> Stephen Marquard, Learning Technologies Co-ordinator
>> Centre for Innovation in Learning and Teaching (CILT, formerly CET and
>> HAESDU)
>> University of Cape Town
>> http://www.cet.uct.ac.za
>> stephen.marquard at uct.ac.za
>> Phone: +27-21-650-5037 Cell: +27-83-500-5290
>>
>>
>>
>> *From:* Jaques Smith [mailto:jaques at opencollab.co.za<jaques at opencollab.co.za>]
>>
>> *Sent:* 14 April 2014 04:09 PM
>> *To:* Karen Tsao
>> *Cc:* Neal Caidin; Samigo Team; Stephen Marquard; Lydia Li
>> *Subject:* Re: EMI issues for Sakai 10
>>
>>
>>
>>   *Jaques Smith* <jaques at opencollab.co.za>
>>
>> April 14, 2014 at 10:08 AM
>>
>> Hey all,
>>
>>
>>
>> Update from my side about EMI's for sakai 10.
>>
>>
>>
>> SAM-2018 <https://jira.sakaiproject.org/browse/SAM-2018> *Not in*sam/branches/sakai-10.x
>>
>> Found a bug and added another patch. Reopened and assigned the Jira to
>> the Samigo team.
>>
>> So the first patch (SAM-2018v2.diff) is in trunk but not in
>> sam/branches/sakai-10.x
>>
>> The second SAM-2018-part2.diff is not in either.
>>
>> *Not tested...*
>>
>> Note: The SAM-2018-part2.diff will depend in SAM-2018v2.diff and
>> SAM-2295.diff
>>
>>
>>
>> SAM-2292 <https://jira.sakaiproject.org/browse/SAM-2292> *Not in*sam/branches/sakai-10.x
>>
>> Patch (SAM-2292.diff) in trunk but not in sam/branches/sakai-10.x
>>
>> *Not tested...*
>>
>>
>>
>> SAM-2293 <https://jira.sakaiproject.org/browse/SAM-2293> Done, thanks
>>
>> Patch (SAM-2293.diff) in trunk and in sam/branches/sakai-10.x
>>
>> This has been tested and is done
>>
>>
>>
>> SAM-2295 <https://jira.sakaiproject.org/browse/SAM-2295> *Not in*sam/branches/sakai-10.x
>> Patch (SAM-2295.diff) in trunk but not in sam/branches/sakai-10.x
>>
>> This has been tested and verified
>>
>>
>>
>> SAM-2319 <https://jira.sakaiproject.org/browse/SAM-2319> *Not in*sam/branches/sakai-10.x
>>
>> Patch (SAM-2319.diff) in trunk but not in sam/branches/sakai-10.x
>>
>> *Not tested...*
>>
>>
>>
>> I asked Oliver to test tomorrow, but anybody else that can test will help.
>>
>>
>>
>> Cheers,
>>
>> *Jaques Smith*
>>
>> Development Manager
>>
>> *open**collab*
>>
>> *Tel*: +27 21 970 4000 | *Fax*: +27 21 914 3098
>>
>> *Mobile*: +27 82 779 9601 | *Skype*: jaques.smith
>>
>> *Web*: www.opencollab.co.za
>>
>>
>>
>>
>>  ------------------------------
>>
>> See OpenCollab email disclaimer at
>> http://www.opencollab.co.za/email-disclaimer
>>
>>   *Jaques Smith* <jaques at opencollab.co.za>
>>
>> April 3, 2014 at 7:32 AM
>>
>> I meant to say he will test on trunk nightly, but that is still broken...
>>
>>
>>
>> Dyslexic people has more nuf :)
>>
>>
>>
>>
>>  *Jaques Smith*
>>
>> Development Manager
>>
>> *open**collab*
>>
>> *Tel*: +27 21 970 4000 | *Fax*: +27 21 914 3098
>>
>> *Mobile*: +27 82 779 9601 | *Skype*: jaques.smith
>>
>> *Web*: www.opencollab.co.za
>>
>>
>>
>>
>>  ------------------------------
>>
>> See OpenCollab email disclaimer at
>> http://www.opencollab.co.za/email-disclaimer
>>
>>   *Jaques Smith* <jaques at opencollab.co.za>
>>
>> April 3, 2014 at 5:32 AM
>>
>> Hi Karen,
>>
>>
>>
>> Oliver want to test on night but it is still broken, will let you know.
>>
>>
>>
>> Thanks,
>>
>> Jaques
>>
>>
>>
>>
>>
>>
>>  ------------------------------
>>
>> See OpenCollab email disclaimer at
>> http://www.opencollab.co.za/email-disclaimer
>>
>>
>>
>> --
>> Neal Caidin
>> Sakai Community Coordinator
>> Apereo Foundation
>> neal.caidin at apereo.org
>> Skype me! (but let me know in advance for the first interaction) -
>> nealkdin
>>
>>
>>  ------------------------------
>>
>> See OpenCollab email disclaimer at
>> http://www.opencollab.co.za/email-disclaimer
>>  ------------------------------
>> UNIVERSITY OF CAPE TOWN
>>
>> This e-mail is subject to the UCT ICT policies and e-mail disclaimer
>> published on our website at
>> http://www.uct.ac.za/about/policies/emaildisclaimer/ or obtainable from +27
>> 21 650 9111. This e-mail is intended only for the person(s) to whom it
>> is addressed. If the e-mail has reached you in error, please notify the
>> author. If you are not the intended recipient of the e-mail you may not
>> use, disclose, copy, redirect or print the content. If this e-mail is not
>> related to the business of UCT it is sent by the sender in the sender's
>> individual capacity.
>>
>
>

-- 

------------------------------
See OpenCollab email disclaimer at 
http://www.opencollab.co.za/email-disclaimer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/samigo-team/attachments/20140416/7b9a7716/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 770 bytes
Desc: not available
Url : http://collab.sakaiproject.org/pipermail/samigo-team/attachments/20140416/7b9a7716/attachment-0002.jpg 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 1291 bytes
Desc: not available
Url : http://collab.sakaiproject.org/pipermail/samigo-team/attachments/20140416/7b9a7716/attachment-0003.jpg 
-------------- next part --------------
Index: samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/author/ItemAddListener.java
===================================================================
--- samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/author/ItemAddListener.java	(revision 308155)
+++ samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/author/ItemAddListener.java	(working copy)
@@ -2083,7 +2083,7 @@
         answerOptions.clear();
         outer: for(AnswerBean answerBean: bean.getEmiAnswerOptionsClean()){
             for(AnswerIfc currentAnswerOption: deleteAnswerOptions){
-                if(currentAnswerOption.getSequence() == answerBean.getSequence()){
+                if(currentAnswerOption.getSequence().equals(answerBean.getSequence())){
                     //update the existing answer
                     currentAnswerOption.setText(stripPtags(answerBean.getText()));
                     currentAnswerOption.setLabel(answerBean.getLabel());
@@ -2123,7 +2123,7 @@
         for(AnswerBean answerBean: emiQuestionAnswerCombinations){
             ItemTextIfc itemText = null;
 			for(ItemTextIfc currentItemText: deleteItemText){
-                if(currentItemText.getSequence() == answerBean.getSequence()){
+                if(currentItemText.getSequence().equals(answerBean.getSequence())){
                     itemText = currentItemText;
                     break;
                 }
@@ -2155,7 +2155,7 @@
                     for(AnswerIfc currentItemAnswer: deleteItemAnswerSet){
                         //if the answer option was removed before then the item
                         //answer will also be removed (not added back here)
-                        if(currentItemAnswer.getSequence() == currentAnswerOption.getSequence()){
+                        if(currentItemAnswer.getSequence().equals(currentAnswerOption.getSequence())){
                             currentItemAnswer.setText(currentAnswerOption.getText());
                             currentItemAnswer.setLabel(currentAnswerOption.getLabel());
                             currentItemAnswer.setIsCorrect(isCorrect);
Index: samigo-app/src/webapp/js/utils-emi.js
===================================================================
--- samigo-app/src/webapp/js/utils-emi.js	(revision 308155)
+++ samigo-app/src/webapp/js/utils-emi.js	(working copy)
@@ -11,12 +11,27 @@
  */
 function checkEMIOptions(element, validEMIOptions, event) {
 	var charCode = event.charCode;
-	//A-Z or a-z
+    //whitespace
+    if (isCharGoodWhitespace(charCode)){
+        return true;
+    }
+    //A-Z or a-z
 	if (isCharAlphaUpper(charCode) || isCharAlphaLower(charCode)){
 		return isValidOption(element, validEMIOptions, charCode);
 	}
 	return false;
 }
+/*
+ * good whitespace (tab, shift, backspace...)
+ */
+function isCharGoodWhitespace(charCode){
+    return (charCode === 0 ||
+            charCode === 8 ||
+            charCode === 9 ||
+            charCode === 14 ||
+            charCode === 15 ||
+            charCode === 127);
+}
 
 function isCharNumber(charCode){
 	return (charCode >= 48 && charCode <= 57);
@@ -44,7 +59,7 @@
 function isValidOption(element, validEMIOptions, charCode){
 	// don't use if it is not in the options
 	var keychar = String.fromCharCode(charCode).toUpperCase();
-	if (validEMIOptions.indexOf(keychar) == -1) {
+	if (validEMIOptions.indexOf(keychar) === -1) {
 		return false;
 	}
 	// now check that it is not a duplicate
@@ -52,7 +67,7 @@
 		element.value = element.val();
 	}
 	var index = element.value.toUpperCase().indexOf(keychar);
-	if (index == -1) {
+	if (index === -1) {
 		return true;
 	} else {
 		// check that the duplicate is not selected, then we can replace
-------------- next part --------------
Index: samigo-app/src/webapp/js/utils-emi.js
===================================================================
--- samigo-app/src/webapp/js/utils-emi.js	(revision 308240)
+++ samigo-app/src/webapp/js/utils-emi.js	(working copy)
@@ -11,8 +11,12 @@
  */
 function checkEMIOptions(element, validEMIOptions, event) {
 	var charCode = event.charCode;
+    //whitespace
+    if (isCharGoodWhitespace(charCode)){
+        return true;
+    }
     //A-Z or a-z
-	if (isCharGoodWhitespace(charCode) || isCharAlphaUpper(charCode) || isCharAlphaLower(charCode)){
+	if (isCharAlphaUpper(charCode) || isCharAlphaLower(charCode)){
 		return isValidOption(element, validEMIOptions, charCode);
 	}
 	return false;


More information about the samigo-team mailing list