Moodle

Teacher can not view student replies in QandA forum on the user's profile Forum posts tab

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Duplicate
  • Affects Version/s: 1.9.2
  • Fix Version/s: None
  • Component/s: Forum
  • Labels:
    None
  • Environment:
    N/A
  • Database:
    Any
  • Affected Branches:
    MOODLE_19_STABLE

Description

This issue appears to only affect the Q and A type of forum. I did not check or test the other types.

In Moodle 1.8.6 a teacher could view any of the student forums postings. In Moodle 1.9.2 the teacher only sees the a new question that a student submits, they no longer see the replies to those new questions.

Reproduction steps using one teacher account and two student accounts. As the teacher in a course, create a new forum as type Q and A. As student1 choose that forum and click to "Add a new question" button then create a new question. As student2, choose that forum and click on "Add a new question" then create a new question. Next, select the question that student1 created and reply to that question. Finally, as the teacher go to Participants and select student2. You will see the question that student created but you will not see the reply of student2 to the student1 new question.

Running through the same steps in 1.8.6, the teacher does see the student2 reply to the student1 question.

While I am not real good yet at reading Moodle code, the issue appears to be in the /mod/forum/lib.php file's forum_search_posts function call.

The block of code ...

if ($forum->type == 'qanda') {
if (!empty($forum->onlydiscussions)) { $discussionsids = implode(',', $forum->onlydiscussions); $select[] = "(d.id IN ($discussionsids) OR p.parent = 0)"; } else { $select[] = "p.parent = 0"; }
}

is adding the parent = 0 filter for the teacher because the call in forum_get_readable_forums to build the list of forums never sets any values in $forum->onlydiscussions because the teacher has the mod/forum:viewqandawithoutposting capability. In version 1.8.6 it appears that the check for any value in the $forum->onlydiscussions is done in the outer if statement so the parent = 0 is not applied.

Thank you for reviewing this matter.

Issue Links

Activity

Hide
Molly McManus added a comment -

I also have this problem in 1.9.2

Show
Molly McManus added a comment - I also have this problem in 1.9.2
Hide
James Riggs added a comment -

removing the line

$select[] = "p.parent = 0";

seems to give the desired results on our test site.
i'm not sure if this is going to cause other problems though.

anyone else have any feedback about this possible fix?

Show
James Riggs added a comment - removing the line $select[] = "p.parent = 0"; seems to give the desired results on our test site. i'm not sure if this is going to cause other problems though. anyone else have any feedback about this possible fix?
Hide
Molly McManus added a comment -

Removing that line as you described fixed the problem for me also.

Show
Molly McManus added a comment - Removing that line as you described fixed the problem for me also.
Hide
theresarumjahn added a comment -

Thank you very much, James. Commenting out that line on our version 1.9.3 also solved the problem, but I hope it does not cause problems elsewhere.

Show
theresarumjahn added a comment - Thank you very much, James. Commenting out that line on our version 1.9.3 also solved the problem, but I hope it does not cause problems elsewhere.
Hide
Charles Fulton added a comment -

This issue duplicates MDL-15968 which fixed the bug.

Show
Charles Fulton added a comment - This issue duplicates MDL-15968 which fixed the bug.
Hide
Eric Merrill added a comment -

This issue was resolved by MDL-15968

Show
Eric Merrill added a comment - This issue was resolved by MDL-15968

Dates

  • Created:
    Updated:
    Resolved: