Skip to content

Commit

Permalink
SAK-40409 forums > allow students to access their own stats (sakaipro…
Browse files Browse the repository at this point in the history
  • Loading branch information
bjones86 authored Oct 22, 2020
1 parent f5b0f18 commit 5c28cd5
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ cdfm_moderate = Moderate
cdfm_mark_as_read=Mark as Read
cdfm_readby= - Read by:
stat_list = Statistics & Grading
stat_list_student = Statistics
stat_name = Name
stat_anon_user = User
stat_authored = Authored
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@
import net.sf.json.JsonConfig;
import org.sakaiproject.api.app.messageforums.events.ForumsMessageEventParams;
import org.sakaiproject.api.app.messageforums.events.ForumsTopicEventParams;
import static org.sakaiproject.component.app.messageforums.dao.hibernate.MessageImpl.DATE_COMPARATOR;

/**
* @author <a href="mailto:[email protected]">Rashmi Shastri</a>
Expand Down Expand Up @@ -7274,6 +7275,9 @@ public String processActionDisplayInThread() {
setSelectedForumForCurrentTopic(topic);
selectedTopic = getDecoratedTopic(topic);
selectedForum = getDecoratedForum(forum);
if (!isInstructor()) {
Collections.sort(selectedTopic.getMessages(), DATE_COMPARATOR);
}

if (uiPermissionsManager.isRead((DiscussionTopic)topic, forum)) {
List messageList = messageManager.findMessagesByTopicId(topic.getId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@
</span>
</li>
</h:panelGroup>
<h:panelGroup rendered="#{!ForumTool.instructor}">
<li role="menuitem">
<span id="forumsStatisticsMenuLink">
<h:commandLink value="#{msgs.stat_list_student}" id="statListStudent" action="#{mfStatisticsBean.processActionStatisticsUser}" immediate="true">
<f:param value="#{ForumTool.userId}" name="siteUserId"/>
</h:commandLink>
</span>
</li>
</h:panelGroup>
<h:panelGroup rendered="#{ForumTool.displayPendingMsgQueue}">
<li role="menuitem">
<span id="forumsQueueMenuLink">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

<f:view>
<sakai:view toolCssHref="/messageforums-tool/css/msgcntr.css">
<h:form id="dfStatisticsForm" rendered="#{ForumTool.instructor}">
<h:form id="dfStatisticsForm">
<!-- discussionForum/statistics/dfStatisticsAllAuthoredMsgForOneUser.jsp-->
<script>
var iframeId = '<%= org.sakaiproject.util.Web.escapeJavascript(thisId)%>';
Expand Down Expand Up @@ -152,7 +152,7 @@
</h:panelGroup>
</h:panelGroup>
<% }else {%>
<h:panelGroup layout="block" styleClass="breadCrumb"><h3>
<h:panelGroup layout="block" styleClass="breadCrumb" rendered="#{ForumTool.instructor}"><h3>
<h:commandLink action="#{ForumTool.processActionHome}" value="#{msgs.cdfm_message_forums}" title=" #{msgs.cdfm_message_forums}"
rendered="#{ForumTool.messagesandForums}" />
<h:commandLink action="#{ForumTool.processActionHome}" value="#{msgs.cdfm_discussion_forums}" title=" #{msgs.cdfm_discussion_forums}"
Expand Down Expand Up @@ -242,7 +242,7 @@
<% if(!isDialogBox){ %>
<h:panelGroup style="display:block;float:right;width:25%;text-align:right">
<h:outputLink value="/tool/#{ForumTool.currentToolId}/discussionForum/message/dfMsgGrade" target="dialogFrame"
onclick="dialogLinkClick(this);">
onclick="dialogLinkClick(this);" rendered="#{ForumTool.instructor}">
<f:param value="#{stat.forumId}" name="forumId"/>
<f:param value="#{stat.topicId}" name="topicId"/>
<f:param value="#{stat.msgId}" name="messageId"/>
Expand All @@ -253,7 +253,7 @@
<h:graphicImage value="/../../library/image/silk/award_star_gold_1.png" alt="#{msgs.cdfm_button_bar_grade}" />
<h:outputText value=" #{msgs.cdfm_button_bar_grade}" />
</h:outputLink>
<h:outputText value=" #{msgs.cdfm_toolbar_separator} " />
<h:outputText value=" #{msgs.cdfm_toolbar_separator} " rendered="#{ForumTool.instructor}" />
<h:commandLink action="#{ForumTool.processActionDisplayInThread}" title=" #{msgs.stat_display_in_thread}" >
<f:param value="#{stat.forumId}" name="forumId"/>
<f:param value="#{stat.topicId}" name="topicId"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</jsp:useBean>
<f:view>
<sakai:view toolCssHref="/messageforums-tool/css/msgcntr.css">
<h:form id="dfStatisticsForm" rendered="#{ForumTool.instructor}">
<h:form id="dfStatisticsForm">
<!-- discussionForum/statistics/dfStatisticsDisplayInThread.jsp -->
<script>includeLatestJQuery("msgcntr");</script>
<script src="/messageforums-tool/js/sak-10625.js"></script>
Expand All @@ -29,7 +29,7 @@
<link rel="stylesheet" type="text/css" href="/messageforums-tool/css/msgcntr_statistics.css" />
<%@ include file="/jsp/discussionForum/menu/forumsMenu.jsp" %>

<f:verbatim><div class="breadCrumb"><h3></f:verbatim>
<h:panelGroup layout="block" styleClass="breadCrumb" rendered="#{ForumTool.instructor}"><h3>
<h:commandLink action="#{ForumTool.processActionHome}" value="#{msgs.cdfm_message_forums}" title=" #{msgs.cdfm_message_forums}"
rendered="#{ForumTool.messagesandForums}" />
<h:commandLink action="#{ForumTool.processActionHome}" value="#{msgs.cdfm_discussion_forums}" title=" #{msgs.cdfm_discussion_forums}"
Expand Down Expand Up @@ -63,7 +63,7 @@
<h:outputText value="#{ForumTool.selectedForum.forum.title}" />
<h:outputText value=" / "/>
<h:outputText value="#{ForumTool.selectedTopic.topic.title}" />
<f:verbatim></h3></div></f:verbatim>
</h3></h:panelGroup>

<h:panelGroup id="forumsAction">
<h:outputLink styleClass="button" id="print" value="javascript:printFriendly('#{ForumTool.printFriendlyDisplayInThread}');" title="#{msgs.cdfm_print}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<f:view>
<sakai:view>
<h:form id="dfStatisticsForm" rendered="#{ForumTool.instructor}">
<h:form id="dfStatisticsForm">
<!--discussionForum/statistics/dfStatisticsUser.jsp-->
<script>
Expand Down Expand Up @@ -128,7 +128,7 @@
<iframe id="dialogFrame" name="dialogFrame" width="100%" height="100%" frameborder="0"></iframe>
</div>

<h:panelGrid columns="2" width="100%" styleClass="navPanel specialLink">
<h:panelGrid columns="2" width="100%" styleClass="navPanel specialLink" rendered="#{ForumTool.instructor}">
<h:panelGroup>
<f:verbatim><h3></f:verbatim>
<h:commandLink action="#{ForumTool.processActionHome}" value="#{msgs.cdfm_message_forums}" title=" #{msgs.cdfm_message_forums}"
Expand Down Expand Up @@ -262,7 +262,7 @@

<h:column>
<h:outputLink value="/tool/#{ForumTool.currentToolId}/discussionForum/message/dfMsgGrade" target="dialogFrame"
onclick="dialogLinkClick(this);">
onclick="dialogLinkClick(this);" rendered="#{ForumTool.instructor}">
<f:param value="#{stat.forumId}" name="forumId"/>
<f:param value="#{stat.topicId}" name="topicId"/>
<f:param value="#{stat.msgId}" name="messageId"/>
Expand All @@ -273,7 +273,7 @@
<h:graphicImage value="/../../library/image/silk/award_star_gold_1.png" alt="#{msgs.cdfm_button_bar_grade}" />
<h:outputText value=" #{msgs.cdfm_button_bar_grade}" />
</h:outputLink>
<h:outputText value=" #{msgs.cdfm_toolbar_separator} " />
<h:outputText value=" #{msgs.cdfm_toolbar_separator} " rendered="#{ForumTool.instructor}" />
<h:commandLink action="#{ForumTool.processActionDisplayInThread}" value="#{msgs.stat_display_in_thread}" title=" #{msgs.stat_display_in_thread}">
<f:param value="#{stat.topicId}" name="topicId"/>
<f:param value="#{stat.forumId}" name="forumId"/>
Expand Down

0 comments on commit 5c28cd5

Please sign in to comment.