Index: lams_central/web/qb/collection.jsp =================================================================== diff -u -rcf4300b8c69fbf72488c91ab3250246c07800701 -r666a01da9d0d2b4482ca00041527739b5e56b9f2 --- lams_central/web/qb/collection.jsp (.../collection.jsp) (revision cf4300b8c69fbf72488c91ab3250246c07800701) +++ lams_central/web/qb/collection.jsp (.../collection.jsp) (revision 666a01da9d0d2b4482ca00041527739b5e56b9f2) @@ -99,6 +99,9 @@ height: "100%", autowidth:true, shrinkToFit: true, + <%-- Do not allow batch removing questions from the public collection --%> + multiselect: !isPublicCollection, + multiPageSelection: !isPublicCollection, viewrecords: true, cellEdit: false, cmTemplate: { title: false, search: false }, @@ -133,7 +136,7 @@ ], beforeSelectRow: function(rowid, e) { // do not select rows at all - return false; + return !isPublicCollection; }, loadComplete: function(data) { //init thickbox @@ -370,9 +373,14 @@ }); } + function importWordQuestions(){ + window.open('questions/questionFile.jsp?importType=word', + 'QuestionFile','width=500,height=370,scrollbars=yes'); + } + function importQTI(){ window.open('questions/questionFile.jsp', - 'QuestionFile','width=500,height=240,scrollbars=yes'); + 'QuestionFile','width=500,height=370,scrollbars=yes'); } function saveQTI(formHTML, formName) { @@ -402,6 +410,31 @@ $(document.body).append(form); form.submit(); } + + + function removeQuestions(){ + let questionsToRemove = $('#collection-grid').jqGrid('getGridParam','selarrrow'); + if (questionsToRemove.length == 0){ + return; + } + $.ajax({ + 'url' : 'qb/collection/removeCollectionQuestions.do', + 'type' : 'POST', + 'dataType' : 'text', + 'data' : { + 'collectionUid' : ${collection.uid}, + 'qbQuestionIds' : questionsToRemove, + "" : "" + }, + 'cache' : false + }).done(function(response){ + if (response == 'fail') { + // not all questions were removed + alert(''); + } + document.location.reload(); + }); + } //create proper href for "Create question" button function initLinkHref() { @@ -430,7 +463,7 @@
-
+
@@ -447,8 +480,13 @@
-
- +
+ "> +   + + <%-- Do not display button for public and private collections --%>
@@ -489,8 +527,18 @@
- -
+ +
+ + + + + + + +
+ +