Teammates: Instructor: Feedback: View Results: fix the disappearing 'No specific recipient' panel bug

Created on 29 Jun 2017  路  10Comments  路  Source: TEAMMATES/teammates

Noticed while investigating #4282

Steps to replicate:

  1. Login as instructor
  2. View results for an FS in which there are no questions that do not have a specific recipient.
  3. Load any view EXCEPT for Group by - Question

The problem:
You will see a panel header with No specific recipients (even though there are no such responses). This panel then disappears on clicking.

GIF of isssue:
ezgif com-video-to-gif

a-UIX p.Medium

Most helpful comment

Ok so I investigated more and found out the following:

  • The panel was initially named No specific recipients [ Although the name suggests that it shows all responses which do not have recipient, it actually showed the results for students not in any section]
    The problem was discovered in #7044

  • In #7935 the panel was renamed to what it acatully showed No specefic section. However this current issue was created before that PR and hence this issue is pointing out the problem in No specefic section panel but just that it had a different name before.

  • Based on my current understanding(I could be wrong) we currently do not have a No specefic recipients panel at all

If there is a question that has no specific recipient, the panel should show up for any view except the By Question view. The gif in the issue description (above) has an example.

This doesnt happen, because as I said, the panel was renamed and the issue indirectly is pointing out the bug in the curent No specefic section panel

All 10 comments

I've noticed it a couple of times too.

I will look into this.

@damithc can I check whether No Specific Section has a use case?

After investigating the codebase, I see that the code adds this section automatically before adding other sections with this line sectionPanels.put(Const.DEFAULT_SECTION, sectionPanel);

    private void buildSectionPanelsForForAjaxLoading(List<String> sections) {
        sectionPanels = new LinkedHashMap<>();

        InstructorFeedbackResultsSectionPanel sectionPanel = new InstructorFeedbackResultsSectionPanel(
                Const.DEFAULT_SECTION, Const.NO_SPECIFIC_SECTION, true);
        sectionPanels.put(Const.DEFAULT_SECTION, sectionPanel);

        for (String section : sections) {
            sectionPanel = new InstructorFeedbackResultsSectionPanel(section, section, true);
            sectionPanels.put(section, sectionPanel);
        }
    }

And since this section is always empty, there is a javascript code that removes empty section whenever it is clicked.
```
if (isEmptySection($appendedSection)) {
if (parseInt(sectionId, 10) === 0) {
removeSection(sectionId);
return;
}
````

So there are a few solutions:

  1. If No Specific Section is not used, then we can simply remove adding it by default in the Java code.
  2. If No Specific Section is used in some cases, we can check if it is empty and not add it as a section if empty.
  3. Handle it more cleanly in Javascript, where we do not handle this onClick, but remove this section if it is empty when data is loaded.

@damithc can I check whether No Specific Section has a use case?

Dividing a course into sections is optional. students who are not put in a section will be shown in 'No specific section'.

@damithc Can I confirm that if the No specific recipient panel was made into No specefic Section panel in some PR? (I could not find any place where I would get No specefic recipient panel)

Cause then its better to update the details of this issue.

@damithc Can I confirm that if the No specific recipient panel was made into No specefic Section panel in some PR? (I could not find any place where I would get No specefic recipient panel)

It could have, but by mistake. The two things are not the same.

I think #7935 did the change(comment thread #7044), but it was intentional cause recipient part didnt make sense in some places.
(That PR was merged after this Bug report so it makes sense why this would be incorrectly framed)

I think @Crphang 's PR #8539 is not solving this bug then. We will have to create a new issue for the No specific section part

The two things are not the same.

Wanted to check under what conditions can instructor view the "No specific recipient" panel?
I am unable to view that panel even when a FS has a single question with FP from Student-> General

Wanted to check under what conditions can instructor view the "No specific recipient" panel?

If there is a question that has no specific recipient, the panel should show up for any view except the By Question view. The gif in the issue description (above) has an example.

This is the only place where No Specific Recipient is used in the codebase.

/**
     * Get the displayable section name from an email.
     *
     * <p>If the email is not an email of someone in the class roster, an empty string is returned.
     *
     * <p>If the email of an instructor or "%GENERAL%" is passed in, "No specific recipient" is returned.
     */
public String getSectionFromRoster(String participantIdentifier) {
        boolean isStudent = isParticipantIdentifierStudent(participantIdentifier);
        boolean isInstructor = isParticipantIdentifierInstructor(participantIdentifier);
        boolean participantIsGeneral = participantIdentifier.equals(Const.GENERAL_QUESTION);

        if (isStudent) {
            return roster.getStudentForEmail(participantIdentifier)
                    .section;
        } else if (isInstructor || participantIsGeneral) {
            return Const.NO_SPECIFIC_RECIPIENT;
        } else {
            return "";
        }
    }

It is used to get a section name. On the other hand, I believe #7935 changed the naming No Specific Recipient to No Specific Section, and I don't think that this bug will be caused by a No Specific Recipient panel because the javascript code only removes the panel when it is empty while the logic above suggests that there should be some participants in the section for No Specific Recipient. Looking at the date of the issues, #7935 is created on Aug 2017 and this issue is created on Jun 2017, which means they should be talking about the same thing, but probably this issue needs to be renamed?

Ok so I investigated more and found out the following:

  • The panel was initially named No specific recipients [ Although the name suggests that it shows all responses which do not have recipient, it actually showed the results for students not in any section]
    The problem was discovered in #7044

  • In #7935 the panel was renamed to what it acatully showed No specefic section. However this current issue was created before that PR and hence this issue is pointing out the problem in No specefic section panel but just that it had a different name before.

  • Based on my current understanding(I could be wrong) we currently do not have a No specefic recipients panel at all

If there is a question that has no specific recipient, the panel should show up for any view except the By Question view. The gif in the issue description (above) has an example.

This doesnt happen, because as I said, the panel was renamed and the issue indirectly is pointing out the bug in the curent No specefic section panel

Was this page helpful?
0 / 5 - 0 ratings