Skip to content

fix(Discussion): Grading view shows no replies, and nothing for a team that only replied - #2408

Open
Isaries wants to merge 1 commit into
WISE-Community:developfrom
Isaries:fix/discussion-grading-replies
Open

Isaries wants to merge 1 commit into
WISE-Community:developfrom
Isaries:fix/discussion-grading-replies

Conversation

@Isaries

@Isaries Isaries commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

In the teacher's grading view (Class Responses), expanding a team's Discussion work shows its threads without any of their replies. A team whose only contributions are replies to other teams' posts is worse off: its panel is empty, as if it had not taken part in the discussion at all.

The cause is in DiscussionShowWorkComponent. getClassResponses resets every post's replies to an empty array, and getLevel1Responses keeps a thread only when the team wrote either the top-level post or one of its replies in this component. Replies are attached to their threads by getResponsesMap. The component called it until #2232, which removed the call together with the responsesMap field it was assigned to. The field was unused, but the call was needed for its side effect. Since then every thread has had an empty replies array, so no comments are shown and threads in which the team only replied are filtered out.

This restores the behavior from before #2232 and adds nothing beyond it. One related gap predates both: the grading view renders ClassResponse, which has no hide or show controls, so a reply a teacher hid elsewhere appears here without any mark. It is left for a separate change.

Changes

  • DiscussionShowWorkComponent calls getResponsesMap again before selecting the top-level threads.
  • New discussion-show-work.component.spec.ts covering a team that only replied, the replies under a team's own post, and a thread the team took no part in.

Test

Two of the three new tests fail on current develop:

DiscussionShowWorkComponent shows the thread a team only replied in, with the reply FAILED
    Expected $.length = 0 to equal 1.
    Expected $[0] = undefined to equal 1.
DiscussionShowWorkComponent shows the replies under the post of the team that started the thread FAILED
    Expected 0 to equal 1.
TOTAL: 2 FAILED, 1 SUCCESS

With the change, all three pass, as do the other Discussion specs (62 in total). Also checked by hand on a class discussion: in Class Responses, every team now shows the threads it posted or replied in, with their comments.

…m that only replied

DiscussionShowWorkComponent builds a team's threads with getClassResponses,
which resets every post's replies to an empty array, and then
getLevel1Responses, which keeps a thread only if the team wrote the
top-level post or one of its replies. The replies are attached to their
threads by getResponsesMap, which the component called before WISE-Community#2232.
That refactor removed the call together with the unused responsesMap
field it was assigned to, so replies stayed empty.

As a result, in Class Responses every thread shows no comments, and a team
whose only posts are replies to other teams shows an empty panel.

Call getResponsesMap again before selecting the top-level threads.
@Isaries
Isaries force-pushed the fix/discussion-grading-replies branch from 4ac8110 to c3d4017 Compare November 27, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant