Index: lams_central/web/ckeditor/plugins/confighelper/plugin.js =================================================================== diff -u -ra6c94a5454507a7c6502caf4c054000f36cc6778 -rc2dd5ccedb6cfa8bb4df16752c99c2c2d13478a0 --- lams_central/web/ckeditor/plugins/confighelper/plugin.js (.../plugin.js) (revision a6c94a5454507a7c6502caf4c054000f36cc6778) +++ lams_central/web/ckeditor/plugins/confighelper/plugin.js (.../plugin.js) (revision c2dd5ccedb6cfa8bb4df16752c99c2c2d13478a0) @@ -103,7 +103,7 @@ CKEDITOR.plugins.add( 'confighelper', { getPlaceholderCss : function() { - return '.placeholder{ color: #999; }'; + return '.placeholder{ color: #999 !important; }'; }, onLoad : function() { Index: lams_central/web/includes/javascript/Sortable.js =================================================================== diff -u --- lams_central/web/includes/javascript/Sortable.js (revision 0) +++ lams_central/web/includes/javascript/Sortable.js (revision c2dd5ccedb6cfa8bb4df16752c99c2c2d13478a0) @@ -0,0 +1,3 @@ +/*! Sortable 1.8.1 - MIT | git://github.com/SortableJS/Sortable.git */ + +!function(t){"use strict";"function"==typeof define&&define.amd?define(t):"undefined"!=typeof module&&void 0!==module.exports?module.exports=t():window.Sortable=t()}(function(){"use strict";if("undefined"==typeof window||!window.document)return function(){throw new Error("Sortable.js requires a window with a document")};var V,q,G,u,K,Z,h,Y,M,k,Q,o,J,$,l,s,c,f,P,tt,et,nt,ot,it,rt,I=[],at=!1,p=!1,lt=!1,d=[],st=!1,ct=!1,i=/\s+/g,dt="Sortable"+(new Date).getTime(),ht=window,ut=ht.document,g=ht.parseInt,ft=ht.setTimeout,e=ht.jQuery||ht.Zepto,n=ht.Polymer,r={capture:!1,passive:!1},pt=!!navigator.userAgent.match(/(?:Trident.*rv[ :]?11\.|msie|iemobile)/i),v=!!navigator.userAgent.match(/Edge/i),m=v||pt?"cssFloat":"float",a="draggable"in ut.createElement("div"),b=function(){if(pt)return!1;var t=ut.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}(),gt=!1,w=!1,vt=Math.abs,_=Math.min,y=[],D=function(t,e){var n=B(t),o=g(n.width),i=W(t,0,e),r=W(t,1,e),a=i&&B(i),l=r&&B(r),s=a&&g(a.marginLeft)+g(a.marginRight)+Mt(i).width,c=l&&g(l.marginLeft)+g(l.marginRight)+Mt(r).width;return"flex"===n.display?"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal":i&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||o<=s&&"none"===n[m]||r&&"none"===n[m]&&o=o.left-i&&t<=o.right+i,a=e>=o.top-i&&e<=o.bottom+i;if(r&&a)return d[n]}}(t.clientX,t.clientY);e&&e[dt]._onDragOver({clientX:t.clientX,clientY:t.clientY,target:e,rootEl:e})}};function _t(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be HTMLElement, not "+{}.toString.call(t);this.el=t,this.options=e=U({},e),t[dt]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,scroll:!0,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0,draggable:/[uo]l/i.test(t.nodeName)?"li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return D(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,touchStartThreshold:g(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==_t.supportPointer&&("PointerEvent"in window||window.navigator&&"msPointerEnabled"in window.navigator),emptyInsertThreshold:5};for(var o in n)!(o in e)&&(e[o]=n[o]);for(var i in S(e),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!e.forceFallback&&a,e.supportPointer?X(t,"pointerdown",this._onTapStart):(X(t,"mousedown",this._onTapStart),X(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(X(t,"dragover",this),X(t,"dragenter",this)),d.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[])}function yt(t,e,n,o){if(t){n=n||ut;do{if(">*"===e&&t.parentNode===n||z(t,e)||o&&t===n)return t;if(t===n)break}while(t=(i=t).host&&i!==ut&&i.host.nodeType?i.host:i.parentNode)}var i;return null}function X(t,e,n){t.addEventListener(e,n,r)}function O(t,e,n){t.removeEventListener(e,n,r)}function Dt(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(i," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(i," ")}}function B(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return ut.defaultView&&ut.defaultView.getComputedStyle?n=ut.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function H(t){var e="";do{var n=B(t,"transform");n&&"none"!==n&&(e=n+" "+e)}while(t=t.parentNode);return window.DOMMatrix?new DOMMatrix(e):window.WebKitCSSMatrix?new WebKitCSSMatrix(e):window.CSSMatrix?new CSSMatrix(e):void 0}function R(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i=this.options.touchStartThreshold&&this._disableDelayedDrag()},_disableDelayedDrag:function(){var t=this.el.ownerDocument;clearTimeout(this._dragStartTimer),O(t,"mouseup",this._disableDelayedDrag),O(t,"touchend",this._disableDelayedDrag),O(t,"touchcancel",this._disableDelayedDrag),O(t,"mousemove",this._delayedDragTouchMoveHandler),O(t,"touchmove",this._delayedDragTouchMoveHandler),O(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||("touch"==t.pointerType?t:null),!this.nativeDraggable||e?this.options.supportPointer?X(ut,"pointermove",this._onTouchMove):X(ut,e?"touchmove":"mousemove",this._onTouchMove):(X(V,"dragend",this),X(K,"dragstart",this._onDragStart));try{ut.selection?Xt(function(){ut.selection.empty()}):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t){if(p=!1,K&&V){this.nativeDraggable&&(X(ut,"dragover",this._handleAutoScroll),X(ut,"dragover",T));var e=this.options;!t&&Dt(V,e.dragClass,!1),Dt(V,e.ghostClass,!0),B(V,"transform",""),_t.active=this,t&&this._appendGhost(),Ct(this,K,"start",V,K,K,Q)}else this._nulling()},_emulateDragOver:function(t){if(P){if(this._lastX===P.clientX&&this._lastY===P.clientY&&!t)return;this._lastX=P.clientX,this._lastY=P.clientY,E();for(var e=ut.elementFromPoint(P.clientX,P.clientY),n=e;e&&e.shadowRoot;)n=e=e.shadowRoot.elementFromPoint(P.clientX,P.clientY);if(n)do{if(n[dt])if(n[dt]._onDragOver({clientX:P.clientX,clientY:P.clientY,target:e,rootEl:n})&&!this.options.dragoverBubble)break;e=n}while(n=n.parentNode);V.parentNode[dt]._computeIsAligned(P),x()}},_onTouchMove:function(t){if(f){if(!t.cancelable)return;var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,i=t.touches?t.touches[0]:t,r=G&&H(G),a=G&&r&&r.a,l=G&&r&&r.d,s=(i.clientX-f.clientX+o.x)/(a||1),c=(i.clientY-f.clientY+o.y)/(l||1),d=t.touches?"translate3d("+s+"px,"+c+"px,0)":"translate("+s+"px,"+c+"px)";if(!_t.active&&!p){if(n&&_(vt(i.clientX-this._lastX),vt(i.clientY-this._lastY)) optionList = getOptionsFromRequest(request, false); - int optionIndex = NumberUtils.toInt(request.getParameter(AssessmentConstants.PARAM_OPTION_INDEX), -1); - if (optionIndex != -1) { - List rList = new ArrayList<>(optionList); - rList.remove(optionIndex); - optionList.clear(); - optionList.addAll(rList); - } - - request.setAttribute(AttributeNames.PARAM_CONTENT_FOLDER_ID, - WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID)); - request.setAttribute(AssessmentConstants.ATTR_QUESTION_TYPE, - WebUtil.readIntParam(request, AssessmentConstants.ATTR_QUESTION_TYPE)); - request.setAttribute(AssessmentConstants.ATTR_OPTION_LIST, optionList); - return "pages/authoring/parts/optionlist"; - } - - /** - * Move up current option. - */ - @RequestMapping("/upOption") - public String upOption(HttpServletRequest request) { - return switchOption(request, true); - } - - /** - * Move down current option. - */ - @RequestMapping("/downOption") - public String downOption(HttpServletRequest request) { - return switchOption(request, false); - } - - private String switchOption(HttpServletRequest request, boolean up) { - Set optionList = getOptionsFromRequest(request, false); - - int optionIndex = NumberUtils.toInt(request.getParameter(AssessmentConstants.PARAM_OPTION_INDEX), -1); - if (optionIndex != -1) { - List rList = new ArrayList<>(optionList); - - // get current and the target item, and switch their sequnece - AssessmentQuestionOption option = rList.get(optionIndex); - AssessmentQuestionOption repOption; - if (up) { - repOption = rList.get(--optionIndex); - } else { - repOption = rList.get(++optionIndex); - } - - int upSeqId = repOption.getSequenceId(); - repOption.setSequenceId(option.getSequenceId()); - option.setSequenceId(upSeqId); - - // put back list, it will be sorted again - optionList.clear(); - optionList.addAll(rList); - } - - request.setAttribute(AttributeNames.PARAM_CONTENT_FOLDER_ID, - WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID)); - request.setAttribute(AssessmentConstants.ATTR_QUESTION_TYPE, - WebUtil.readIntParam(request, AssessmentConstants.ATTR_QUESTION_TYPE)); - request.setAttribute(AssessmentConstants.ATTR_OPTION_LIST, optionList); - return "pages/authoring/parts/optionlist"; - } - - /** * Ajax call, will add one more input line for new Unit. */ @RequestMapping("/newUnit") @@ -1271,12 +1200,19 @@ TreeSet optionList = new TreeSet<>(new SequencableComparator()); for (int i = 0; i < count; i++) { AssessmentQuestionOption option = new AssessmentQuestionOption(); + + String sequenceId = paramMap.get(AssessmentConstants.ATTR_OPTION_SEQUENCE_ID_PREFIX + i); + //sequenceId is null, in case this item was removed using Remove button + if (sequenceId == null) { + continue; + } else { + option.setSequenceId(NumberUtils.toInt(sequenceId)); + } + String uid = paramMap.get(AssessmentConstants.ATTR_OPTION_UID_PREFIX + i); if (uid != null) { option.setUid(NumberUtils.toLong(uid)); } - String sequenceId = paramMap.get(AssessmentConstants.ATTR_OPTION_SEQUENCE_ID_PREFIX + i); - option.setSequenceId(NumberUtils.toInt(sequenceId)); if ((questionType == AssessmentConstants.QUESTION_TYPE_MULTIPLE_CHOICE) || (questionType == AssessmentConstants.QUESTION_TYPE_SHORT_ANSWER)) { Index: lams_tool_assessment/web/WEB-INF/tags/CKEditor.tag =================================================================== diff -u -ra6c94a5454507a7c6502caf4c054000f36cc6778 -rc2dd5ccedb6cfa8bb4df16752c99c2c2d13478a0 --- lams_tool_assessment/web/WEB-INF/tags/CKEditor.tag (.../CKEditor.tag) (revision a6c94a5454507a7c6502caf4c054000f36cc6778) +++ lams_tool_assessment/web/WEB-INF/tags/CKEditor.tag (.../CKEditor.tag) (revision c2dd5ccedb6cfa8bb4df16752c99c2c2d13478a0) @@ -68,7 +68,7 @@ if (editor) { editor.destroy(true); } var instance = CKEDITOR.${method}( "${id}", { - classes : "${classes}", + //classes : "${classes}", width : "${width}", height : "${height}", toolbar : "${toolbarSet}", Index: lams_tool_assessment/web/includes/javascript/assessmentoption.js =================================================================== diff -u -ra6c94a5454507a7c6502caf4c054000f36cc6778 -rc2dd5ccedb6cfa8bb4df16752c99c2c2d13478a0 --- lams_tool_assessment/web/includes/javascript/assessmentoption.js (.../assessmentoption.js) (revision a6c94a5454507a7c6502caf4c054000f36cc6778) +++ lams_tool_assessment/web/includes/javascript/assessmentoption.js (.../assessmentoption.js) (revision c2dd5ccedb6cfa8bb4df16752c99c2c2d13478a0) @@ -31,62 +31,8 @@ } function removeOption(idx){ - var url= removeOptionUrl; - var contentFolderID= $("#contentFolderID").val(); - prepareOptionEditorsForAjaxSubmit(); - var optionList = $("#optionForm").serialize(true); - $.ajaxSetup({ cache: true }); - $(optionTargetDiv).load( - url, - { - contentFolderID: contentFolderID, - questionType: questionType, - optionIndex: idx, - optionList: optionList - }, - function() { - initializeOptionItems(); - } - ); + $("#option-table-" + idx).remove(); } - function upOption(idx){ - var url= upOptionUrl; - var contentFolderID= $("#contentFolderID").val(); - prepareOptionEditorsForAjaxSubmit(); - var optionList = $("#optionForm").serialize(true); - $.ajaxSetup({ cache: true }); - $(optionTargetDiv).load( - url, - { - contentFolderID: contentFolderID, - questionType: questionType, - optionIndex: idx, - optionList: optionList - }, - function() { - initializeOptionItems(); - } - ); - } - function downOption(idx){ - var url= downOptionUrl; - var contentFolderID= $("#contentFolderID").val(); - prepareOptionEditorsForAjaxSubmit(); - var optionList = $("#optionForm").serialize(true); - $.ajaxSetup({ cache: true }); - $(optionTargetDiv).load( - url, - { - contentFolderID: contentFolderID, - questionType: questionType, - optionIndex: idx, - optionList: optionList - }, - function() { - initializeOptionItems(); - } - ); - } //in order to be able to use option's value, copy it from CKEditor to textarea function prepareOptionEditorsForAjaxSubmit(){ Index: lams_tool_assessment/web/pages/authoring/parts/addmultiplechoice.jsp =================================================================== diff -u -ra6c94a5454507a7c6502caf4c054000f36cc6778 -rc2dd5ccedb6cfa8bb4df16752c99c2c2d13478a0 --- lams_tool_assessment/web/pages/authoring/parts/addmultiplechoice.jsp (.../addmultiplechoice.jsp) (revision a6c94a5454507a7c6502caf4c054000f36cc6778) +++ lams_tool_assessment/web/pages/authoring/parts/addmultiplechoice.jsp (.../addmultiplechoice.jsp) (revision c2dd5ccedb6cfa8bb4df16752c99c2c2d13478a0) @@ -15,15 +15,42 @@ label { font-weight: initial; } - .justify-content-end { - -webkit-box-pack: end!important; - -ms-flex-pack: end!important; - justify-content: flex-end!important; -} -.nav-pills>li { - float: right; -} + #question-settings-link{ + margin-top: -10px; + margin-bottom: 5px; + position: absolute; + top: 60px; + right: 20px; + z-index: 2; + } + .delete-button, .arrows-div, .option-settings, #question-settings-link{ + visibility:hidden; + } + .sortable-placeholder .option-text { + pointer-events: none + } + + + #option-table.hover-active tr:hover .delete-button, #option-table.hover-active tr:hover .arrows-div, #option-table.hover-active tr:hover .option-settings, #assessmentQuestionForm:hover #question-settings-link { + visibility:visible; + } + .basic-tab[style*="display: none"] + #question-settings-link { + visibility:visible; + } + #title { + padding-right: 80px; + } + .advanced-tab { + display:none; + } + .delete-button { + opacity: 0.6; + cursor: pointer; + } + + + /*----------TEXT INPUT----------------*/ .form-control-new { display: block; width: 100%; @@ -54,10 +81,10 @@ } .form-control-new:-o-input-placeholder { font-weight: normal; - } - - - .ckeditor-without-borders { + } + + /*----------CKEDITOR----------------*/ + div[contenteditable] { display: block; width: 100%; padding: 0; @@ -73,39 +100,11 @@ -webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s; -o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s; transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s; - border: 0; overflow: hidden; min-height: 60px; -webkit-appearance: textfield; } - #question-settings-link{ - margin-top: -10px; - margin-bottom: 5px; - position: absolute; - top: 60px; - right: 20px; - z-index: 2; - } - .delete-button, .arrows-div, .option-settings, #question-settings-link{ - visibility:hidden; - } - #option-table.hover-active tr:hover .delete-button, #option-table.hover-active tr:hover .arrows-div, #option-table.hover-active tr:hover .option-settings, #assessmentQuestionForm:hover #question-settings-link { - visibility:visible; - } - .basic-tab[style*="display: none"] + #question-settings-link { - visibility:visible; - } - #title { - padding-right: 80px; - } - .advanced-tab { - display:none; - } - .delete-button { - opacity: 0.6; - } - /*----------UL numbers----------------*/ #option-table table { width: 100%; @@ -195,44 +194,39 @@ height: 30px; padding-top: 15px; } +/* .sortable-placeholder { height: 130px; background-color: #f1f1f1; margin: 0px 0 20px -0; -} +}*/ .ui-sortable-helper { opacity: 0.8; } + .sortable-chosen { + background-color: #fff; + } + + + + + .sortable-placeholder { + background-color: rgba(241, 241, 241, 0.7); + } - - - + @@ -449,7 +483,7 @@
-
Index: lams_tool_assessment/web/pages/authoring/parts/option.jsp =================================================================== diff -u -ra6c94a5454507a7c6502caf4c054000f36cc6778 -rc2dd5ccedb6cfa8bb4df16752c99c2c2d13478a0 --- lams_tool_assessment/web/pages/authoring/parts/option.jsp (.../option.jsp) (revision a6c94a5454507a7c6502caf4c054000f36cc6778) +++ lams_tool_assessment/web/pages/authoring/parts/option.jsp (.../option.jsp) (revision c2dd5ccedb6cfa8bb4df16752c99c2c2d13478a0) @@ -1,7 +1,7 @@ -
+
@@ -23,6 +23,6 @@
+ placeholder="${FEEDBACK_LABEL}" contentFolderID="${contentFolderID}" height="50px"/>
\ No newline at end of file Index: lams_tool_assessment/web/pages/authoring/parts/optionlist.jsp =================================================================== diff -u -ra6c94a5454507a7c6502caf4c054000f36cc6778 -rc2dd5ccedb6cfa8bb4df16752c99c2c2d13478a0 --- lams_tool_assessment/web/pages/authoring/parts/optionlist.jsp (.../optionlist.jsp) (revision a6c94a5454507a7c6502caf4c054000f36cc6778) +++ lams_tool_assessment/web/pages/authoring/parts/optionlist.jsp (.../optionlist.jsp) (revision c2dd5ccedb6cfa8bb4df16752c99c2c2d13478a0) @@ -11,61 +11,45 @@
- - - - - +
- ${status.index+1} -
+ - - - - - - - - - + + + + + + + +
- - - <%@ include file="option.jsp"%> - - - <%@ include file="matchingpairoption.jsp"%> - - - <%@ include file="shortansweroption.jsp"%> - - - <%@ include file="numericaloption.jsp"%> - - - <%@ include file="orderingoption.jsp"%> - - - <%@ include file="optionhedgingmark.jsp"%> - - - - " - onclick="javascript:removeOption(${status.index})"> + + ${status.index+1}
+ + + <%@ include file="option.jsp"%> + + + <%@ include file="matchingpairoption.jsp"%> + + + <%@ include file="shortansweroption.jsp"%> + + + <%@ include file="numericaloption.jsp"%> + + + <%@ include file="orderingoption.jsp"%> + + + <%@ include file="optionhedgingmark.jsp"%> + + + + " + onclick="javascript:removeOption(${status.index})"> +