Index: lams_tool_mindmap/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -r232372ca3bbe7a14d8ddb66e07516839ed0a97d6 -r889137c66c1156153a5e8eaa1e250ae60024fc0a --- lams_tool_mindmap/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 232372ca3bbe7a14d8ddb66e07516839ed0a97d6) +++ lams_tool_mindmap/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 889137c66c1156153a5e8eaa1e250ae60024fc0a) @@ -124,3 +124,6 @@ label.gallery.walk.preview = You are in preview mode. You only see your own group. Regular learners would see other groups' work and would be able to comment on it and rate it. label.gallery.walk = Gallery Walk label.gallery.walk.wait.finish = The Gallery Walk activity has not been set as completed by the teacher. If you have completed, please contact the teacher for assistance. +label.comment.textarea.tip = Type your comment here then click on the green tick +warning.comment.blank = Comment text is missing. +monitoring.label.group = Group \ No newline at end of file Index: lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/dto/MindmapSessionDTO.java =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r889137c66c1156153a5e8eaa1e250ae60024fc0a --- lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/dto/MindmapSessionDTO.java (.../MindmapSessionDTO.java) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/dto/MindmapSessionDTO.java (.../MindmapSessionDTO.java) (revision 889137c66c1156153a5e8eaa1e250ae60024fc0a) @@ -21,23 +21,23 @@ * **************************************************************** */ - - package org.lamsfoundation.lams.tool.mindmap.dto; import java.util.Iterator; import java.util.Set; import java.util.TreeSet; +import org.lamsfoundation.lams.rating.dto.ItemRatingDTO; import org.lamsfoundation.lams.tool.mindmap.model.MindmapSession; import org.lamsfoundation.lams.tool.mindmap.model.MindmapUser; public class MindmapSessionDTO implements Comparable { - Long sessionID; - String sessionName; - int numberOfLearners; - int numberOfFinishedLearners; - Set userDTOs = new TreeSet(); + private Long sessionID; + private String sessionName; + private int numberOfLearners; + private int numberOfFinishedLearners; + private ItemRatingDTO itemRatingDto; + private Set userDTOs = new TreeSet<>(); public MindmapSessionDTO(MindmapSession session) { this.sessionID = session.getSessionId(); @@ -110,4 +110,12 @@ public void setNumberOfFinishedLearners(int numberOfFinishedLearners) { this.numberOfFinishedLearners = numberOfFinishedLearners; } -} + + public ItemRatingDTO getItemRatingDto() { + return itemRatingDto; + } + + public void setItemRatingDto(ItemRatingDTO itemRatingDto) { + this.itemRatingDto = itemRatingDto; + } +} \ No newline at end of file Index: lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/service/IMindmapService.java =================================================================== diff -u -r232372ca3bbe7a14d8ddb66e07516839ed0a97d6 -r889137c66c1156153a5e8eaa1e250ae60024fc0a --- lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/service/IMindmapService.java (.../IMindmapService.java) (revision 232372ca3bbe7a14d8ddb66e07516839ed0a97d6) +++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/service/IMindmapService.java (.../IMindmapService.java) (revision 889137c66c1156153a5e8eaa1e250ae60024fc0a) @@ -136,6 +136,8 @@ XStream getXStream(); + void createGalleryWalkRatingCriterion(long toolContentId); + void startGalleryWalk(long toolContentId) throws IOException; void finishGalleryWalk(long toolContentId) throws IOException; Index: lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/service/MindmapService.java =================================================================== diff -u -r232372ca3bbe7a14d8ddb66e07516839ed0a97d6 -r889137c66c1156153a5e8eaa1e250ae60024fc0a --- lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/service/MindmapService.java (.../MindmapService.java) (revision 232372ca3bbe7a14d8ddb66e07516839ed0a97d6) +++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/service/MindmapService.java (.../MindmapService.java) (revision 889137c66c1156153a5e8eaa1e250ae60024fc0a) @@ -238,6 +238,10 @@ Mindmap toContent = Mindmap.newInstance(fromContent, toContentId); mindmapDAO.saveOrUpdate(toContent); + if (toContent.isGalleryWalkEnabled() && !toContent.isGalleryWalkReadOnly()) { + createGalleryWalkRatingCriterion(toContentId); + } + /* Copying Mindmap Nodes */ // creating default nodes for current mindmap @@ -1056,7 +1060,7 @@ return xstream; } - private List createGalleryWalkRatingCriterion(long toolContentId) { + public void createGalleryWalkRatingCriterion(long toolContentId) { List criteria = ratingService.getCriteriasByToolContentId(toolContentId); if (criteria.size() >= 2) { @@ -1076,7 +1080,7 @@ logger.warn("Ignoring error while deleting a duplicate criterion for Mindmap tool content ID " + toolContentId + ": " + e.getMessage()); } - return criteria; + return; } if (criteria.isEmpty()) { @@ -1091,7 +1095,6 @@ mindmapDAO.insert(criterion); criteria.add(criterion); } - return criteria; } @Override Index: lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/controller/LearningController.java =================================================================== diff -u -r3ee06bc1b00b1673399c1871a73cfa1d8ec2c0db -r889137c66c1156153a5e8eaa1e250ae60024fc0a --- lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/controller/LearningController.java (.../LearningController.java) (revision 3ee06bc1b00b1673399c1871a73cfa1d8ec2c0db) +++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/controller/LearningController.java (.../LearningController.java) (revision 889137c66c1156153a5e8eaa1e250ae60024fc0a) @@ -24,10 +24,15 @@ package org.lamsfoundation.lams.tool.mindmap.web.controller; import java.io.IOException; +import java.util.Collection; import java.util.Date; import java.util.Iterator; import java.util.List; +import java.util.Map; +import java.util.Set; import java.util.TimeZone; +import java.util.function.Function; +import java.util.stream.Collectors; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -37,13 +42,16 @@ import org.apache.log4j.Logger; import org.lamsfoundation.lams.notebook.model.NotebookEntry; import org.lamsfoundation.lams.notebook.service.CoreNotebookConstants; +import org.lamsfoundation.lams.rating.dto.ItemRatingDTO; +import org.lamsfoundation.lams.rating.service.IRatingService; import org.lamsfoundation.lams.tool.ToolAccessMode; import org.lamsfoundation.lams.tool.ToolSessionManager; import org.lamsfoundation.lams.tool.exception.DataMissingException; import org.lamsfoundation.lams.tool.exception.ToolException; import org.lamsfoundation.lams.tool.mindmap.MindmapConstants; import org.lamsfoundation.lams.tool.mindmap.dto.IdeaJSON; import org.lamsfoundation.lams.tool.mindmap.dto.MindmapDTO; +import org.lamsfoundation.lams.tool.mindmap.dto.MindmapSessionDTO; import org.lamsfoundation.lams.tool.mindmap.dto.NotifyResponseJSON; import org.lamsfoundation.lams.tool.mindmap.dto.RootJSON; import org.lamsfoundation.lams.tool.mindmap.model.Mindmap; @@ -57,8 +65,6 @@ import org.lamsfoundation.lams.tool.mindmap.util.xmlmodel.NodeModel; import org.lamsfoundation.lams.tool.mindmap.web.forms.LearningForm; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; -import org.lamsfoundation.lams.util.Configuration; -import org.lamsfoundation.lams.util.ConfigurationKeys; import org.lamsfoundation.lams.util.DateUtil; import org.lamsfoundation.lams.util.JsonUtil; import org.lamsfoundation.lams.util.MessageService; @@ -70,6 +76,7 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import com.fasterxml.jackson.core.JsonProcessingException; @@ -83,7 +90,7 @@ @RequestMapping("/learning") public class LearningController { private static Logger log = Logger.getLogger(LearningController.class); - + private static final boolean MODE_OPTIONAL = false; private static final String REQUEST_JSON_TYPE = "type"; // Expected to be int: 0 - delete; 1 - create node; 2 - change color; 3 - change text @@ -94,6 +101,9 @@ private IMindmapService mindmapService; @Autowired + private IRatingService ratingService; + + @Autowired @Qualifier("mindmapMessageService") private MessageService messageService; @@ -118,37 +128,88 @@ throw new MindmapException("Cannot retrieve session with toolSessionID: " + toolSessionID); } + request.setAttribute(AttributeNames.ATTR_IS_LAST_ACTIVITY, mindmapService.isLastActivity(toolSessionID)); + + HttpSession ss = SessionManager.getSession(); + UserDTO userDto = (UserDTO) ss.getAttribute(AttributeNames.USER); + + MindmapUser mindmapUser; + if (mode.equals(ToolAccessMode.TEACHER)) { + mindmapUser = mindmapService.getUserByUserIdAndSessionId(userDto.getUserID().longValue(), toolSessionID); + } else { + mindmapUser = getCurrentUser(toolSessionID, true); + } + Mindmap mindmap = mindmapSession.getMindmap(); + if (mindmap.isGalleryWalkEnabled() && mode != null && mode.isAuthor()) { + String[] galleryWalkParameterValuesArray = request.getParameterValues("galleryWalk"); + if (galleryWalkParameterValuesArray != null) { + Collection galleryWalkParameterValues = Set.of(galleryWalkParameterValuesArray); + if (!mindmap.isGalleryWalkStarted() && galleryWalkParameterValues.contains("forceStart")) { + mindmap.setGalleryWalkStarted(true); + mindmapService.saveOrUpdateMindmap(mindmap); + } + + if (!mindmap.isGalleryWalkFinished() && galleryWalkParameterValues.contains("forceFinish")) { + mindmap.setGalleryWalkFinished(true); + mindmapService.saveOrUpdateMindmap(mindmap); + } + } + } + + MindmapDTO mindmapDTO = new MindmapDTO(mindmap); + request.setAttribute("mindmapDTO", mindmapDTO); + request.setAttribute("reflectOnActivity", mindmap.isReflectOnActivity()); + + LearningController.storeMindmapCanvasParameters(mindmap, toolSessionID, mindmapUser, mode.toString(), + !(mode.equals(ToolAccessMode.TEACHER) + || (mindmap.isLockOnFinished() && mindmapUser.isFinishedActivity())), + request); + + if (mindmap.isGalleryWalkStarted()) { + Map itemRatingDtoMap = null; + if (!mindmap.isGalleryWalkReadOnly()) { + // it should have been created on lesson create, + // but in case Live Edit added Gallery Walk, we need to add it now, but just once + try { + mindmapService.createGalleryWalkRatingCriterion(mindmap.getToolContentId()); + } catch (Exception e) { + log.warn("Ignoring error while processing Mindmap Gallery Walk criteria for tool content ID " + + mindmap.getToolContentId()); + } + } + + // Item IDs are WhiteboardSession session IDs, i.e. a single Whiteboard + Set itemIds = mindmapDTO.getSessionDTOs().stream() + .collect(Collectors.mapping(MindmapSessionDTO::getSessionID, Collectors.toSet())); + + List itemRatingDtos = ratingService.getRatingCriteriaDtos(mindmap.getToolContentId(), null, + itemIds, true, mindmapUser.getUserId()); + // Mapping of Item ID -> DTO + itemRatingDtoMap = itemRatingDtos.stream() + .collect(Collectors.toMap(ItemRatingDTO::getItemId, Function.identity())); + + for (MindmapSessionDTO sessionDTO : mindmapDTO.getSessionDTOs()) { + sessionDTO.setItemRatingDto(itemRatingDtoMap.get(sessionDTO.getSessionID())); + } + + return "pages/learning/galleryWalk"; + } + // check defineLater if (mindmap.isDefineLater()) { return "pages/learning/defineLater"; } // set mode, toolSessionID and MindmapDTO - request.setAttribute("mode", mode.toString()); learningForm.setToolSessionID(toolSessionID); - MindmapDTO mindmapDTO = new MindmapDTO(); - mindmapDTO.title = mindmap.getTitle(); - mindmapDTO.instructions = mindmap.getInstructions(); - mindmapDTO.lockOnFinish = mindmap.isLockOnFinished(); - mindmapDTO.multiUserMode = mindmap.isMultiUserMode(); - mindmapDTO.reflectInstructions = mindmap.getReflectInstructions(); - - request.setAttribute("mindmapDTO", mindmapDTO); - // Set the content in use flag. if (!mindmap.isContentInUse()) { mindmap.setContentInUse(true); mindmapService.saveOrUpdateMindmap(mindmap); } - - request.setAttribute(AttributeNames.ATTR_IS_LAST_ACTIVITY, mindmapService.isLastActivity(toolSessionID)); - - HttpSession ss = SessionManager.getSession(); - UserDTO userDto = (UserDTO) ss.getAttribute(AttributeNames.USER); - // check if there is submission deadline Date submissionDeadline = mindmap.getSubmissionDeadline(); if (submissionDeadline != null) { @@ -164,44 +225,9 @@ } } - MindmapUser mindmapUser; - if (mode.equals(ToolAccessMode.TEACHER)) { - mindmapUser = mindmapService.getUserByUserIdAndSessionId(userDto.getUserID().longValue(), toolSessionID); - } else { - mindmapUser = getCurrentUser(toolSessionID); - } - - // set readOnly flag. - if (mode.equals(ToolAccessMode.TEACHER) || (mindmap.isLockOnFinished() && mindmapUser.isFinishedActivity())) { - request.setAttribute("contentEditable", false); - } else { - request.setAttribute("contentEditable", true); - } - request.setAttribute("finishedActivity", mindmapUser.isFinishedActivity()); - - // mindmapContentPath Parameter - String mindmapContentPath = Configuration.get(ConfigurationKeys.SERVER_URL) - + "tool/lamind10/learning.do?dispatch=setMindmapContent%26mindmapId=" + mindmap.getUid() + "%26userId=" - + mindmapUser.getUid() + "%26sessionId=" + mindmapSession.getSessionId(); - request.setAttribute("mindmapContentPath", mindmapContentPath); - - // currentMindmapUser Parameter - String currentMindmapUser = mindmapUser.getFirstName() + " " + mindmapUser.getLastName(); - request.setAttribute("currentMindmapUser", currentMindmapUser); - // setting userId for reflection request.setAttribute("userIdParam", mindmapUser.getUid()); - request.setAttribute("toolContentIdParam", mindmap.getUid()); - request.setAttribute("reflectOnActivity", mindmap.isReflectOnActivity()); - // AJAX calls for saving Mindmap every one minute - request.setAttribute("get", Configuration.get(ConfigurationKeys.SERVER_URL) + "tool/lamind10/learning.do"); - request.setAttribute("dispatch", "saveLastMindmapChanges"); - request.setAttribute("mindmapId", mindmap.getUid()); - request.setAttribute("userId", mindmapUser.getUid()); - request.setAttribute("sessionId", toolSessionID); - request.setAttribute("multiMode", mindmap.isMultiUserMode()); - // if not multi-user mode if (!mindmap.isMultiUserMode()) { // clonning Mindmap Nodes for every new user @@ -533,14 +559,14 @@ /** * Returns current learner */ - private MindmapUser getCurrentUser(Long toolSessionId) { + private MindmapUser getCurrentUser(Long toolSessionId, boolean create) { UserDTO user = (UserDTO) SessionManager.getSession().getAttribute(AttributeNames.USER); // attempt to retrieve user using userId and toolSessionId MindmapUser mindmapUser = mindmapService.getUserByUserIdAndSessionId(new Long(user.getUserID().intValue()), toolSessionId); - if (mindmapUser == null) { + if (mindmapUser == null && create) { MindmapSession mindmapSession = mindmapService.getSessionBySessionId(toolSessionId); mindmapUser = mindmapService.createMindmapUser(user, mindmapSession); } @@ -555,11 +581,11 @@ public String reflect(@ModelAttribute LearningForm learningForm, HttpServletRequest request, HttpServletResponse response) throws IOException { - Long userId = WebUtil.readLongParam(request, "userId", false); + Long userId = WebUtil.readLongParam(request, "userUid", false); Long toolContentId = WebUtil.readLongParam(request, "toolContentId", false); MindmapUser mindmapUser = mindmapService.getUserByUID(userId); - Mindmap mindmap = mindmapService.getMindmapByUid(toolContentId); + Mindmap mindmap = mindmapService.getMindmapByContentId(toolContentId); MindmapSession mindmapSession = mindmapUser.getMindmapSession(); request.setAttribute("reflectTitle", mindmap.getTitle()); @@ -595,7 +621,7 @@ HttpServletResponse response) throws IOException { Long toolSessionID = WebUtil.readLongParam(request, "toolSessionID"); - MindmapUser mindmapUser = getCurrentUser(toolSessionID); + MindmapUser mindmapUser = getCurrentUser(toolSessionID, true); // Retrieve the session and content MindmapSession mindmapSession = mindmapService.getSessionBySessionId(toolSessionID); @@ -658,4 +684,30 @@ return null; } -} + @RequestMapping("/getGalleryWalkMindmap") + public String getGalleryWalkMindmap(@RequestParam Long toolSessionID, HttpServletRequest request) { + MindmapSession session = mindmapService.getSessionBySessionId(toolSessionID); + Mindmap mindmap = session.getMindmap(); + MindmapUser user = getCurrentUser(toolSessionID, false); + boolean contentEditable = mindmap.isGalleryWalkEditEnabled() && user != null + && user.getMindmapSession().getSessionId().equals(toolSessionID); + LearningController.storeMindmapCanvasParameters(mindmap, toolSessionID, user, + user == null ? ToolAccessMode.TEACHER.toString() : ToolAccessMode.LEARNER.toString(), contentEditable, + request); + return "pages/learning/galleryWalkMindmap"; + } + + private static void storeMindmapCanvasParameters(Mindmap mindmap, Long toolSessionID, MindmapUser user, String mode, + boolean contentEditable, HttpServletRequest request) { + request.setAttribute("mindmapId", mindmap.getUid()); + request.setAttribute("multiMode", mindmap.isMultiUserMode()); + request.setAttribute("toolContentID", mindmap.getToolContentId()); + request.setAttribute("sessionId", toolSessionID); + request.setAttribute("toolSessionID", toolSessionID); + request.setAttribute("userUid", user == null ? null : user.getUid()); + request.setAttribute("contentEditable", contentEditable); + request.setAttribute("mode", mode); + request.setAttribute("currentMindmapUser", user == null ? "" : user.getFirstName() + " " + user.getLastName()); + request.setAttribute("finishedActivity", user == null ? false : user.isFinishedActivity()); + } +} \ No newline at end of file Index: lams_tool_mindmap/web/common/mapjs.jsp =================================================================== diff -u -rc834a3c9964666b01df4eef7b31b6d12564c80dd -r889137c66c1156153a5e8eaa1e250ae60024fc0a --- lams_tool_mindmap/web/common/mapjs.jsp (.../mapjs.jsp) (revision c834a3c9964666b01df4eef7b31b6d12564c80dd) +++ lams_tool_mindmap/web/common/mapjs.jsp (.../mapjs.jsp) (revision 889137c66c1156153a5e8eaa1e250ae60024fc0a) @@ -38,7 +38,7 @@ $.ajax({ method: "POST", url: "${url=='author'? 'setMindmapContentJSON.do':'../learning/setMindmapContentJSON.do'}", - data: { mindmapId: "${mindmapId}", userId: "${userId}", + data: { mindmapId: "${mindmapId}", userId: "${userUid}", sessionId: "${sessionId}", mode: "${mode}" } , dataType: "json", success: function (response) { @@ -167,7 +167,7 @@ $.ajax({ method: "POST", url: "notifyServerActionJSON.do", - data: { mindmapId: "${mindmapId}", userId: "${userId}", + data: { mindmapId: "${mindmapId}", userId: "${userUid}", sessionId: "${sessionId}", lastActionId: lastActionId, actionJSON: JSON.stringify(updateRequest) } , dataType: "json", success: function (response) { @@ -380,7 +380,7 @@ url: "saveLastMindmapChanges.do", data: { mindmapId: "${mindmapId}", - userId: "${userId}", + userId: "${userUid}", toolSessionID: "${sessionId}", content: JSON.stringify(window.mapModel.getIdea()) }, Index: lams_tool_mindmap/web/includes/css/mindmap.scss =================================================================== diff -u -rc834a3c9964666b01df4eef7b31b6d12564c80dd -r889137c66c1156153a5e8eaa1e250ae60024fc0a --- lams_tool_mindmap/web/includes/css/mindmap.scss (.../mindmap.scss) (revision c834a3c9964666b01df4eef7b31b6d12564c80dd) +++ lams_tool_mindmap/web/includes/css/mindmap.scss (.../mindmap.scss) (revision 889137c66c1156153a5e8eaa1e250ae60024fc0a) @@ -7,7 +7,7 @@ #mindmap-container { background-color: $body-bg; - height: calc(100vh - 240px); + height: calc(100vh - 239px); width: 100%; border: $border-thin-solid; } Index: lams_tool_mindmap/web/pages/learning/galleryWalk.jsp =================================================================== diff -u --- lams_tool_mindmap/web/pages/learning/galleryWalk.jsp (revision 0) +++ lams_tool_mindmap/web/pages/learning/galleryWalk.jsp (revision 889137c66c1156153a5e8eaa1e250ae60024fc0a) @@ -0,0 +1,231 @@ + +<%@ include file="/common/taglibs.jsp"%> + + + + + + <fmt:message key="activity.title" /> + + + + + + + + + + + + + + + <%@ include file="websocket.jsp"%> + + + + + + + +

+ + +
+

+
+ + +

+ + + + + + + + + + + + + + + + +
+ +

+ + + + + + + +
+ +
+ <%-- Do not show rating to own group before Gallery Walk is finished --%> + + + + + + +
+
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
Index: lams_tool_mindmap/web/pages/learning/galleryWalkMindmap.jsp =================================================================== diff -u --- lams_tool_mindmap/web/pages/learning/galleryWalkMindmap.jsp (revision 0) +++ lams_tool_mindmap/web/pages/learning/galleryWalkMindmap.jsp (revision 889137c66c1156153a5e8eaa1e250ae60024fc0a) @@ -0,0 +1,35 @@ + +<%@ include file="/common/taglibs.jsp"%> + + + + + + + + + + + + + + + + + + + + + + + + <%-- MindMap ---------------------------------------%> + <%@ include file="/common/mapjs.jsp"%> + <%-- End MindMap -----------------------------------%> + + \ No newline at end of file Index: lams_tool_mindmap/web/pages/learning/mindmap.jsp =================================================================== diff -u -rd5fa41792bdb2657d0d53c35126a64604510d18a -r889137c66c1156153a5e8eaa1e250ae60024fc0a --- lams_tool_mindmap/web/pages/learning/mindmap.jsp (.../mindmap.jsp) (revision d5fa41792bdb2657d0d53c35126a64604510d18a) +++ lams_tool_mindmap/web/pages/learning/mindmap.jsp (.../mindmap.jsp) (revision 889137c66c1156153a5e8eaa1e250ae60024fc0a) @@ -2,9 +2,8 @@ <%@ include file="/common/taglibs.jsp"%> - - - + + @@ -49,15 +48,20 @@ var f = document.getElementById('learningForm'); f.submit(); } - - </script> + + $(document).ready(function(){ + $('[data-toggle="tooltip"]').bootstrapTooltip(); + }); + </script> + + <%@ include file="websocket.jsp"%> </lams:head> <body class="stripes"> <form:form action="${reflectOnActivity ? 'reflect.do' : 'finishActivity.do'}" method="post" onsubmit="return false;" modelAttribute="learningForm" id="learningForm"> <input type="hidden" name="userId" value="${userIdParam}" /> - <input type="hidden" name="toolContentId" value="${toolContentIdParam}" /> + <input type="hidden" name="toolContentId" value="${toolContentID}" /> <form:hidden path="toolSessionID" /> <form:hidden path="mindmapContent" id="mindmapContent" /> @@ -106,6 +110,22 @@ <c:otherwise> <c:choose> + <c:when test="${mindmapDTO.galleryWalkEnabled}"> + <button data-toggle="tooltip" + class="btn btn-default voffset5 pull-right ${mode == 'author' ? '' : 'disabled'}" + <c:choose> + <c:when test="${mode == 'author'}"> + title="<fmt:message key='label.gallery.walk.wait.start.preview' />" + onClick="javascript:location.href = location.href + '&galleryWalk=forceStart'" + </c:when> + <c:otherwise> + title="<fmt:message key='label.gallery.walk.wait.start' />" + </c:otherwise> + </c:choose> + > + <fmt:message key="button.continue" /> + </button> + </c:when> <c:when test="${reflectOnActivity}"> <a href="javascript:submitForm();" class="btn btn-primary" id="continueButton"> <span class="nextActivity"><fmt:message key="button.continue"/></span> Index: lams_tool_mindmap/web/pages/learning/websocket.jsp =================================================================== diff -u --- lams_tool_mindmap/web/pages/learning/websocket.jsp (revision 0) +++ lams_tool_mindmap/web/pages/learning/websocket.jsp (revision 889137c66c1156153a5e8eaa1e250ae60024fc0a) @@ -0,0 +1,11 @@ +<script type="text/javascript"> + $(document).ready(function(){ + // command websocket stuff for refreshing + // trigger is an unique ID of page and action that command websocket code in Page.tag recognises + commandWebsocketHookTrigger = 'mindmap-refresh-${toolContentID}'; + // if the trigger is recognised, the following action occurs + commandWebsocketHook = function() { + location.reload(); + }; + }); +</script> \ No newline at end of file