apply egg17 to master branch
flag=discussions_redesign fixes EGG-17 test plan: - create a graded group discussion for a group set that has groups without any students - as a student, visit the discussion (you will end up in the root topic page, this is ok) - reply to the discussion - as a teacher, view discussion in speedgrader - verify discussion loads without error - create an anonymous discussion, as a student, reply - delete your reply - verify you can reload the page without the page breaking - create a graded group discussion this time with groups that have students - as a student belonging to a group, reply to your group's discussion - as a teacher view speedgrader - verify the the full discussion loads with the student's reply Change-Id: Iadc6205a84c05c27cfbf03c7fbdc36087d72e81a Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/355056 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Omar Soto-Fortuño <omar.soto@instructure.com> Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com> QA-Review: Chawn Neal <chawn.neal@instructure.com>
This commit is contained in:
parent
9c0f3f0ea3
commit
399c6ad342
|
@ -766,7 +766,7 @@ class DiscussionTopicsController < ApplicationController
|
|||
current_page: 0
|
||||
}
|
||||
env_hash[:context_rubric_associations_url] = context_url(@context, :context_rubric_associations_url) rescue nil
|
||||
if params[:entry_id]
|
||||
if params[:entry_id] && (entry = @topic.discussion_entries.find_by(id: params[:entry_id]))
|
||||
entry = @topic.discussion_entries.find(params[:entry_id])
|
||||
env_hash[:discussions_deep_link] = {
|
||||
root_entry_id: entry.root_entry_id,
|
||||
|
|
|
@ -49,11 +49,20 @@
|
|||
|
||||
<% provide :page_title do %><%= join_title @assignment.title, t("Submission Preview") %><% end %>
|
||||
<% if @assignment.submission_types == 'discussion_topic' && @assignment.discussion_topic %>
|
||||
<%
|
||||
@entries = @assignment.discussion_topic.for_group_discussion? ? @assignment.discussion_topic.all_child_entries_from_user(@user) : @assignment.discussion_topic.discussion_entries.active.for_user(@user)
|
||||
hidden_user_id = params[:hide_student_name] ? @user.id : nil
|
||||
discussion_iframe_src = context_url(@entries.first.discussion_topic.context, :context_discussion_topic_url, @entries.first.discussion_topic.id, :embed => true, :entry_id => @entries.first.id, :hidden_user_id => hidden_user_id, :speed_grader => 1)
|
||||
%>
|
||||
<%
|
||||
@entries = @assignment.discussion_topic.for_group_discussion? ? @assignment.discussion_topic.all_child_entries_from_user(@user) : @assignment.discussion_topic.discussion_entries.active.for_user(@user)
|
||||
hidden_user_id = params[:hide_student_name] ? @user.id : nil
|
||||
url_opts = {
|
||||
embed: true,
|
||||
hidden_user_id:,
|
||||
speed_grader: 1,
|
||||
}
|
||||
url_opts[:entry_id] = @entries.first.id if @entries&.first
|
||||
|
||||
topic_to_show = @assignment.discussion_topic.for_group_discussion? ? @assignment.discussion_topic.child_topic_for(@user) : @assignment.discussion_topic
|
||||
topic_to_show ||= @assignment.discussion_topic
|
||||
discussion_iframe_src = context_url(topic_to_show.context, :context_discussion_topic_url, topic_to_show.id, url_opts)
|
||||
%>
|
||||
<% unless show_full_discussion_immediately %>
|
||||
<div style="width: 600px; margin: 10px auto;">
|
||||
<p>
|
||||
|
|
|
@ -96,7 +96,7 @@ describe "SpeedGrader - discussion submissions" do
|
|||
end
|
||||
end
|
||||
|
||||
context "discussion_checkpoints", skip: "checkpoints broken fix coming up" do
|
||||
context "discussion_checkpoints" do
|
||||
before do
|
||||
Account.site_admin.enable_feature!(:react_discussions_post)
|
||||
@course.root_account.enable_feature!(:discussion_checkpoints)
|
||||
|
@ -199,7 +199,21 @@ describe "SpeedGrader - discussion submissions" do
|
|||
end
|
||||
end
|
||||
|
||||
context "discussion_checkpoints", skip: "checkpoints broken fix coming up" do
|
||||
it "displays all entries for group discussion submission" do
|
||||
entry_text = "first student message in group1"
|
||||
root_topic = group_discussion_assignment
|
||||
@group1.add_user(@student, "accepted")
|
||||
|
||||
root_topic.child_topic_for(@student).discussion_entries.create!(user: @student, message: entry_text)
|
||||
Speedgrader.visit(@course.id, root_topic.assignment.id)
|
||||
|
||||
in_frame "speedgrader_iframe", "#discussion_view_link" do
|
||||
expect(f("#main")).to include_text("The submissions for this assignment are posts in the assignment's discussion for this group. Below are the discussion posts for")
|
||||
expect(f("#main")).to include_text(entry_text)
|
||||
end
|
||||
end
|
||||
|
||||
context "discussion_checkpoints" do
|
||||
before do
|
||||
Account.site_admin.enable_feature!(:react_discussions_post)
|
||||
@course.root_account.enable_feature!(:discussion_checkpoints)
|
||||
|
@ -398,6 +412,27 @@ describe "SpeedGrader - discussion submissions" do
|
|||
|
||||
expect(f("#this_student_does_not_have_a_submission")).to be_displayed
|
||||
end
|
||||
|
||||
it "displays the root topic for group discussion if groups have no users" do
|
||||
entry_text = "first student message"
|
||||
root_topic = group_discussion_assignment
|
||||
root_topic.discussion_entries.create!(user: @student, message: entry_text)
|
||||
Speedgrader.visit(@course.id, root_topic.assignment.id)
|
||||
|
||||
Speedgrader.click_settings_link
|
||||
Speedgrader.click_options_link
|
||||
Speedgrader.select_hide_student_names
|
||||
expect_new_page_load { fj(".ui-dialog-buttonset .ui-button:visible:last").click }
|
||||
|
||||
in_frame("speedgrader_iframe") do
|
||||
in_frame("discussion_preview_iframe") do
|
||||
wait_for_ajaximations
|
||||
expect(f("div[data-testid='discussion-root-entry-container']").text).to include("This Student")
|
||||
expect(f("div[data-testid='discussion-root-entry-container']").text).to include(entry_text)
|
||||
expect(f("body")).not_to contain_jqcss(".discussions-search-filter")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -413,8 +413,7 @@ const hiddenUserId = urlParams.get('hidden_user_id')
|
|||
export const hideStudentNames = !!hiddenUserId
|
||||
|
||||
export const userNameToShow = (originalName, authorId, course_roles) => {
|
||||
// if discussion is anonymous, no need to use hide student names at all
|
||||
if (hideStudentNames && !isAnonymous() && course_roles?.includes('StudentEnrollment')) {
|
||||
if (hideStudentNames && course_roles?.includes('StudentEnrollment')) {
|
||||
return hiddenUserId === authorId ? I18n.t('This Student') : I18n.t('Discussion Participant')
|
||||
}
|
||||
return originalName
|
||||
|
|
Loading…
Reference in New Issue