Index: lams_tool_assessment/web/pages/authoring/basic.jsp
===================================================================
diff -u -rc2b79a48e116ee67d7de18bfb4b793fda02b58e7 -rf993635c56cbdd4ee0d6e448e37302004adf3535
--- lams_tool_assessment/web/pages/authoring/basic.jsp (.../basic.jsp) (revision c2b79a48e116ee67d7de18bfb4b793fda02b58e7)
+++ lams_tool_assessment/web/pages/authoring/basic.jsp (.../basic.jsp) (revision f993635c56cbdd4ee0d6e448e37302004adf3535)
@@ -285,7 +285,7 @@
Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/controller/AuthoringController.java
===================================================================
diff -u -r7521e0cd5b5f4b01d188ca0ddad1e5f59d3bde27 -rf993635c56cbdd4ee0d6e448e37302004adf3535
--- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/controller/AuthoringController.java (.../AuthoringController.java) (revision 7521e0cd5b5f4b01d188ca0ddad1e5f59d3bde27)
+++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/controller/AuthoringController.java (.../AuthoringController.java) (revision f993635c56cbdd4ee0d6e448e37302004adf3535)
@@ -59,12 +59,14 @@
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
@@ -75,6 +77,7 @@
import java.net.URLEncoder;
import java.sql.Timestamp;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
@@ -792,6 +795,24 @@
return "pages/authoring/parts/optionlist";
}
+ @GetMapping("/printQuestions")
+ public String printQuestions(HttpServletRequest request, RedirectAttributes redirectAttributes) {
+ // need to set up FlashAttributes so they are read in Central after redirect
+ SessionMap sessionMap = getSessionMap(request);
+ Collection scratchieItems = getItemList(sessionMap);
+
+ List questions = new ArrayList<>();
+ for (ScratchieItem scratchieItem : scratchieItems) {
+ questions.add(scratchieItem.getQbQuestion());
+ }
+ if (!questions.isEmpty()) {
+ redirectAttributes.addFlashAttribute("printQuestions", questions);
+ }
+ ScratchieForm scratchieForm = (ScratchieForm) sessionMap.get(ScratchieConstants.ATTR_RESOURCE_FORM);
+ redirectAttributes.addFlashAttribute("printTitleSuffix", scratchieForm.getScratchie().getTitle());
+ return "redirect:" + Configuration.get(ConfigurationKeys.SERVER_URL) + "qb/printQuestions.do";
+ }
+
// *************************************************************************************
// Private method
// *************************************************************************************
Index: lams_tool_scratchie/web/pages/authoring/authoring.jsp
===================================================================
diff -u -r7521e0cd5b5f4b01d188ca0ddad1e5f59d3bde27 -rf993635c56cbdd4ee0d6e448e37302004adf3535
--- lams_tool_scratchie/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision 7521e0cd5b5f4b01d188ca0ddad1e5f59d3bde27)
+++ lams_tool_scratchie/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision f993635c56cbdd4ee0d6e448e37302004adf3535)
@@ -5,90 +5,87 @@
-
-
+
+
- <%@ include file="/common/tabbedheader.jsp"%>
-
-
-
-
-
-
-
+ function init(){
+ var tag = document.getElementById("currentTab");
+ if (tag.value != "") {
+ selectTab(tag.value);
+ } else {
+ selectTab(1); //select the default tab;
+ }
+ }
+
+ function doSelectTab(tabId) {
+ // start optional tab controller stuff
+ var tag = document.getElementById("currentTab");
+ tag.value = tabId;
+ // end optional tab controller stuff
+ selectTab(tabId);
+ }
+
+ // avoid name clash between bootstrap and jQuery UI
+ $.fn.bootstrapTooltip = $.fn.tooltip.noConflict();
+
+ function validateForm(){
+ var timeLimit = $('#relativeTimeLimit').val();
+ if (!timeLimit || timeLimit < 1) {
+ $('#relativeTimeLimit').val(0);
+ }
+
+ $('#syncRatQuestions').val(hasMatchingRatActivity && questionsEdited &&
+ confirm(""));
+
+ return true;
+ }
+
+
+
+
@@ -102,42 +99,42 @@
-
+
-
+
-
-
-
+
+
+
-
+
-
-
+
+
<%-- Default value
cancelButtonLabelKey="label.authoring.cancel.button"
saveButtonLabelKey="label.authoring.save.button"
cancelConfirmMsgKey="authoring.msg.cancel.save"
accessMode="author"
--%>
-
+
-
+
-
+
\ No newline at end of file
Index: lams_tool_scratchie/web/pages/authoring/basic.jsp
===================================================================
diff -u -r7521e0cd5b5f4b01d188ca0ddad1e5f59d3bde27 -rf993635c56cbdd4ee0d6e448e37302004adf3535
--- lams_tool_scratchie/web/pages/authoring/basic.jsp (.../basic.jsp) (revision 7521e0cd5b5f4b01d188ca0ddad1e5f59d3bde27)
+++ lams_tool_scratchie/web/pages/authoring/basic.jsp (.../basic.jsp) (revision f993635c56cbdd4ee0d6e448e37302004adf3535)
@@ -127,6 +127,11 @@
}
});
}
+
+ function showQuestionsPrintPage() {
+ let url = '';
+ window.open(url, "_blank");
+ }
@@ -144,6 +149,12 @@
<%@ include file="parts/itemlist.jsp"%>
+
+