Index: lams_central/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -rc6890f863ca4146aeba71942af83d4a594b2c517 -r55ed20d39180d1733d5ac186c0f7ea29b77dd66e --- lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision c6890f863ca4146aeba71942af83d4a594b2c517) +++ lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 55ed20d39180d1733d5ac186c0f7ea29b77dd66e) @@ -919,6 +919,8 @@ label.import.xml = Import questions in XML format label.export.xml = Export questions in XML format msg.import.file.format = The import file must be .xml file exported from assessment tool and not exceed size of {0} +label.import.openai = Generative AI +label.import.openai.hint = Generate questions at OpenAI label.qb.stats.title = Question statistics error.qb.permanent.remove = The question is in one collection only, so it would be permanently removed.\\nIt is not possible as the question is used in other designs. label.qb.permanent.remove.confirm = The question is in one collection only. Are you sure that you want to remove it permanently? Index: lams_central/src/java/org/lamsfoundation/lams/web/qb/QbCollectionController.java =================================================================== diff -u -r5bc88174180046cd153cfc46a0c8ef13675bd4bf -r55ed20d39180d1733d5ac186c0f7ea29b77dd66e --- lams_central/src/java/org/lamsfoundation/lams/web/qb/QbCollectionController.java (.../QbCollectionController.java) (revision 5bc88174180046cd153cfc46a0c8ef13675bd4bf) +++ lams_central/src/java/org/lamsfoundation/lams/web/qb/QbCollectionController.java (.../QbCollectionController.java) (revision 55ed20d39180d1733d5ac186c0f7ea29b77dd66e) @@ -103,6 +103,7 @@ model.addAttribute("availableOrganisations", qbService.getShareableWithOrganisations(collectionUid, userId)); model.addAttribute("questionCount", qbService.getCountCollectionQuestions(collectionUid, null)); model.addAttribute("isQtiExportEnabled", Configuration.getAsBoolean(ConfigurationKeys.QB_QTI_ENABLE)); + model.addAttribute("isAiEnabled", Configuration.isLamsModuleAvailable(Configuration.AI_MODULE_CLASS)); return "qb/collection"; } @@ -334,7 +335,7 @@ if (userId == null) { return false; } - if (securityService.isAppadmin(userId, "acess QB collection", true)){ + if (securityService.isAppadmin(userId, "acess QB collection", true)) { return true; } Collection collections = qbService.getUserCollections(userId); Index: lams_central/web/qb/collection.jsp =================================================================== diff -u -r03d284a4bdb2a2f2d6f57d0810e465f437c25155 -r55ed20d39180d1733d5ac186c0f7ea29b77dd66e --- lams_central/web/qb/collection.jsp (.../collection.jsp) (revision 03d284a4bdb2a2f2d6f57d0810e465f437c25155) +++ lams_central/web/qb/collection.jsp (.../collection.jsp) (revision 55ed20d39180d1733d5ac186c0f7ea29b77dd66e) @@ -3,598 +3,620 @@ - - <fmt:message key="label.qb.collection" /> - - - - - - - - - - - - - - - - + + + + + + + - - - - -
- -
- -
- -
+ let questionIdsToRemove = []; + questionsToRemove.forEach(function(questionUid) { + let questionId = $('tr#' + questionUid + ' > td[aria-describedby="collection-grid_id"]', collectionGrid).text(); + if (questionId) { + questionIdsToRemove.push(questionId); + } + }); + + $.ajax({ + 'url' : 'qb/collection/removeCollectionQuestions.do', + 'type' : 'POST', + 'dataType' : 'text', + 'data' : { + 'collectionUid' : ${collection.uid}, + 'qbQuestionIds' : questionIdsToRemove, + "" : "" + }, + '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() { + var questionType = document.getElementById("question-type").selectedIndex + 1; + $("#create-question-href").attr("href", + "?questionType=" + questionType + + "&oldCollectionUid=${collection.uid}" + + "&KeepThis=true&TB_iframe=true&modal=true"); + }; + + //this method gets invoked after question has been edited and saved + function refreshThickbox(){ + location.reload(); + }; + + + + + +
+ +
+ +
+ +
- -   - - - + +   + + + - -
- -
- "> -   - - - <%-- Do not display button for public and private collections --%> - -
- - - -
-
- - - - -
- - - - <%-- jqGrid placeholder with some useful attributes --%> -
-
-
-
- -
- -
-
-
- <%-- Do not display links for collection manipulation for public and private collections --%> - + <%-- jqGrid placeholder with some useful attributes --%> +
+
+
+ + +
+ +
+
+ + + <%-- Do not display links for collection manipulation for public and private collections --%> + -
-
- -
-
- - - - <%-- Already shared organisations--%> +
+
+ +
+
+
+ + + <%-- Already shared organisations--%> - - <%-- Not yet shared ones --%> + + <%-- Not yet shared ones --%> - + - -
@@ -608,8 +630,8 @@
@@ -620,17 +642,17 @@
- + + + +
-
- - - - -
- + + + + + + \ No newline at end of file