Moodle Community Sites
  1. Moodle Community Sites
  2. MDLSITE-1620

Add 'Report as spam' links to forum posts etc.

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Component/s: moodle.org
    • Labels:
      None
    • Rank:
      33596

      Description

      It would be great if forum posts, comments and personal messages on moodle.org included a small 'Report to moderator' link which if clicked would prompt users to give a reason for their report and then send an email to me with the URL of the offending message, the reporter's name, profile page URL and reason for their report.

      Please see attached 'Report post to moderator' example from ProBoards.

      1. French forum screenshot.jpg
        35 kB
      2. report as spam link.png
        2 kB
      3. report to moderator.png
        12 kB
      4. spam reports.png
        52 kB

        Issue Links

          Activity

          Hide
          Helen Foster added a comment -

          Adding Martin as watcher in case he has any ideas on the best way to implement this.

          Show
          Helen Foster added a comment - Adding Martin as watcher in case he has any ideas on the best way to implement this.
          Hide
          Helen Foster added a comment -

          Linking to MDLSITE-1619 as both features together will form an excellent spam-busting tool.

          Show
          Helen Foster added a comment - Linking to MDLSITE-1619 as both features together will form an excellent spam-busting tool.
          Hide
          Rajesh Taneja added a comment -

          Can we can have something similar to comments block, say Report spam block. User can report spams easily, for that page and you can either opt for email or check moodle.org for reported spams.

          Show
          Rajesh Taneja added a comment - Can we can have something similar to comments block, say Report spam block. User can report spams easily, for that page and you can either opt for email or check moodle.org for reported spams.
          Hide
          Helen Foster added a comment -

          The disadvantage of a report spam block is that it would not be possible to identify a particular forum post or comment, also I don't know how it would work for personal messages.

          Also, I'd like the wording to be 'Report to moderator' rather than 'Report spam' so that people feel they can report other stuff too, such as forum posts posted in the wrong forum.

          Show
          Helen Foster added a comment - The disadvantage of a report spam block is that it would not be possible to identify a particular forum post or comment, also I don't know how it would work for personal messages. Also, I'd like the wording to be 'Report to moderator' rather than 'Report spam' so that people feel they can report other stuff too, such as forum posts posted in the wrong forum.
          Hide
          Helen Foster added a comment -

          It seems Mahara has a 'Report post to moderator' feature which we could perhaps look at to see how it's done.

          Show
          Helen Foster added a comment - It seems Mahara has a 'Report post to moderator' feature which we could perhaps look at to see how it's done.
          Hide
          Dan Poltawski added a comment -

          I implemented the basics of this at the weekend to the spam deltion block, you can see it in action on the clone.

          It required a small hack to core to get the link in:
          https://github.com/moodlehq/block-spam_deletion/blob/master/hackforumlib.patch

          But that is hardly the end of the world to maintain.

          Show
          Dan Poltawski added a comment - I implemented the basics of this at the weekend to the spam deltion block, you can see it in action on the clone. It required a small hack to core to get the link in: https://github.com/moodlehq/block-spam_deletion/blob/master/hackforumlib.patch But that is hardly the end of the world to maintain.
          Hide
          Martin Dougiamas added a comment -

          Great start!

          Show
          Martin Dougiamas added a comment - Great start!
          Hide
          Helen Foster added a comment -

          Just copying Dan's commment from MDLSITE-2032:

          I've implemented the basics of my plan, now on the moodle.org clone.

          What i've implemented is a voting system, where each vote has a weighting:

          1. Everyone (anyone with the capability to reply to a post) can report/vote a post as spam
          2. But each vote has a weighting (default weighting is 0)
          3. You need to posted 5 times to have your vote weighting of 1
            • Posts in the last 24 hours are excluded
          4. You are given 1 additional weighting point for each 50 posts you've posted on moodle.org
          5. If the author who you are voting as spam has posted 50 times themselves, then your weighting is changed to 0 (to stop someone trying to disrupt an established moodler)

          The plan would then to take automatic action based on votes. e.g. If a post gets 10 weighted SPAM votes the content would be replaced with some 'this post is awaiting moderation' message and the user would be assigned a spammer role where they couldn't create any more content.

          But we could just see how the voting system works without doing any automatic action first, to see if people can find a way to abuse it.

          Show
          Helen Foster added a comment - Just copying Dan's commment from MDLSITE-2032 : I've implemented the basics of my plan, now on the moodle.org clone. What i've implemented is a voting system, where each vote has a weighting: Everyone (anyone with the capability to reply to a post) can report/vote a post as spam But each vote has a weighting (default weighting is 0) You need to posted 5 times to have your vote weighting of 1 Posts in the last 24 hours are excluded You are given 1 additional weighting point for each 50 posts you've posted on moodle.org If the author who you are voting as spam has posted 50 times themselves, then your weighting is changed to 0 (to stop someone trying to disrupt an established moodler) The plan would then to take automatic action based on votes. e.g. If a post gets 10 weighted SPAM votes the content would be replaced with some 'this post is awaiting moderation' message and the user would be assigned a spammer role where they couldn't create any more content. But we could just see how the voting system works without doing any automatic action first, to see if people can find a way to abuse it.
          Hide
          Helen Foster added a comment -

          Hi Dan,

          Thanks a lot for adding 'report spam' links to forum posts. I've had a play on the clone site and found that authenticated users not enrolled in a course obtain an error message 'Sorry, but you do not currently have permissions to do that (Reply to posts)' when they click on the report spam link.

          Also, regarding http://clone.moodle.org/blocks/spam_deletion/viewvotes.php can you provide a way of removing items in the list if it is decided that they are not spam.

          Show
          Helen Foster added a comment - Hi Dan, Thanks a lot for adding 'report spam' links to forum posts. I've had a play on the clone site and found that authenticated users not enrolled in a course obtain an error message 'Sorry, but you do not currently have permissions to do that (Reply to posts)' when they click on the report spam link. Also, regarding http://clone.moodle.org/blocks/spam_deletion/viewvotes.php can you provide a way of removing items in the list if it is decided that they are not spam.
          Hide
          Joseph Rézeau added a comment -

          @Dan,
          Is there a maximum weighting for votes? (something like 99 or 999 or whatever)?
          If so, I suggest that forum members with the "Particularly Helpful Moodlers"/"Developers"/"members of the Facilitators corner" forum, etc.
          a) be automatically given the maximum weighting
          c) be automatically prevented from being reported as spammers...
          Joseph

          Show
          Joseph Rézeau added a comment - @Dan, Is there a maximum weighting for votes? (something like 99 or 999 or whatever)? If so, I suggest that forum members with the "Particularly Helpful Moodlers"/"Developers"/"members of the Facilitators corner" forum, etc. a) be automatically given the maximum weighting c) be automatically prevented from being reported as spammers... Joseph
          Hide
          Dan Poltawski added a comment -

          Helen:

          Thanks a lot for adding 'report spam' links to forum posts. I've had a play on the clone site and found that authenticated users not enrolled in a course obtain an error message 'Sorry, but you do not currently have permissions to do that (Reply to posts)' when they click on the report spam link.

          I've improved this message (it tells you are not enrolled). I abused the 'reply to post' capability since this is the simplest way to determine whether to show the report link.

          Also, regarding http://clone.moodle.org/blocks/spam_deletion/viewvotes.php can you provide a way of removing items in the list if it is decided that they are not spam.

          Done.

          I've also:

          1. Added a specific capability to view the spam reports (was previously using site:config).
          2. Improved the link to the forum post
            # Added another table displaying spam reports which still have the 'vote' but the forum post has been deleted (could happen if a moderator deletes the forum post). Which would be a way of ensuring the users profile is looked at. (This shouldn't be typical)
          Show
          Dan Poltawski added a comment - Helen: Thanks a lot for adding 'report spam' links to forum posts. I've had a play on the clone site and found that authenticated users not enrolled in a course obtain an error message 'Sorry, but you do not currently have permissions to do that (Reply to posts)' when they click on the report spam link. I've improved this message (it tells you are not enrolled). I abused the 'reply to post' capability since this is the simplest way to determine whether to show the report link. Also, regarding http://clone.moodle.org/blocks/spam_deletion/viewvotes.php can you provide a way of removing items in the list if it is decided that they are not spam. Done. I've also: Added a specific capability to view the spam reports (was previously using site:config). Improved the link to the forum post # Added another table displaying spam reports which still have the 'vote' but the forum post has been deleted (could happen if a moderator deletes the forum post). Which would be a way of ensuring the users profile is looked at. (This shouldn't be typical)
          Hide
          Dan Poltawski added a comment -

          Joseph:

          Is there a maximum weighting for votes? (something like 99 or 999 or whatever)?

          Not at the moment. Though perhaps it would be deseriable to do so (say, only allow something to be auto moderated once at least 2 people vote it as spam, even if the voter has huge reputation).

          If so, I suggest that forum members with the "Particularly Helpful Moodlers"/"Developers"/"members of the Facilitators corner" forum, etc.
          a) be automatically given the maximum weighting
          c) be automatically prevented from being reported as spammers...

          I was kind of hoping to pickup all these people from the post count checks. Mostly because maintaining the mapping of groups will be (slightly) complicated to implement from all the different courses. Also I think anyone who's posted a lot (even if they aren't a PHM) should be auto-protected. Maybe we only make auto-moderation work on users who've posted < 10 posts, would that catch them all?

          To give 'super-powers', I think i'd rather do that as a capability (e.g. for 'Using Moodle' facilitators).

          But I think that we can see how the voting works in reality first before over-tweaking the algorithm and only once we are confident in it, implement any sort of auto-moderation.

          Show
          Dan Poltawski added a comment - Joseph: Is there a maximum weighting for votes? (something like 99 or 999 or whatever)? Not at the moment. Though perhaps it would be deseriable to do so (say, only allow something to be auto moderated once at least 2 people vote it as spam, even if the voter has huge reputation). If so, I suggest that forum members with the "Particularly Helpful Moodlers"/"Developers"/"members of the Facilitators corner" forum, etc. a) be automatically given the maximum weighting c) be automatically prevented from being reported as spammers... I was kind of hoping to pickup all these people from the post count checks. Mostly because maintaining the mapping of groups will be (slightly) complicated to implement from all the different courses. Also I think anyone who's posted a lot (even if they aren't a PHM) should be auto-protected. Maybe we only make auto-moderation work on users who've posted < 10 posts, would that catch them all? To give 'super-powers', I think i'd rather do that as a capability (e.g. for 'Using Moodle' facilitators). But I think that we can see how the voting works in reality first before over-tweaking the algorithm and only once we are confident in it, implement any sort of auto-moderation.
          Hide
          Helen Foster added a comment -

          Dan, thanks for your further improvements.

          I tested and found all of the following working fine:

          • block/spam_deletion:viewspamreport capability
          • The table displaying spam reports when the forum post has been deleted - a really good idea. I think there could well be items listed there quite often.
          • Button for removing items if they're not spam
          • 'Report as spam' links in non-English forums. Maybe 'Report as spam' can be added as a language string to be translated?

          Regarding guest access / authenticated users not enrolled in a course, the not enrolled message is much better than an error message, though I'm wondering whether better still would be to hide the 'Report as spam' link in these cases (if it's easy to do)?

          Major request:

          • Can we have 'Report as spam' links for comments in the plugins directory?

          A few very small things (no need to fix unless it's really easy):

          Show
          Helen Foster added a comment - Dan, thanks for your further improvements. I tested and found all of the following working fine: block/spam_deletion:viewspamreport capability The table displaying spam reports when the forum post has been deleted - a really good idea. I think there could well be items listed there quite often. Button for removing items if they're not spam 'Report as spam' links in non-English forums. Maybe 'Report as spam' can be added as a language string to be translated? Regarding guest access / authenticated users not enrolled in a course, the not enrolled message is much better than an error message, though I'm wondering whether better still would be to hide the 'Report as spam' link in these cases (if it's easy to do)? Major request: Can we have 'Report as spam' links for comments in the plugins directory? A few very small things (no need to fix unless it's really easy): I notice it's possible to report your own post as spam. The spam deletion block always states that there is one more report than listed in http://clone.moodle.org/blocks/spam_deletion/viewvotes.php http://clone.moodle.org/blocks/spam_deletion/viewvotes.php has title 'View Votes' yet the subtitle is 'Forum post spam reports'. Seems a bit weird to be voting (gives idea of something positive) for spam!
          Hide
          Dan Poltawski added a comment -

          'Report as spam' links in non-English forums. Maybe 'Report as spam' can be added as a language string to be translated?

          It is a language string (from the block).

          Regarding guest access / authenticated users not enrolled in a course, the not enrolled message is much better than an error message, though I'm wondering whether better still would be to hide the 'Report as spam' link in these cases (if it's easy to do)?

          Its not easy to do (we can only use the existing rules for displaying 'reply' and those show to unenrolled users even though they need to enrol to report as spam).

          Can we have 'Report as spam' links for comments in the plugins directory?

          This may well require another 'hack' to core to do it unfortunately. Yes it can be done, but maybe it could come in another version? (Also, there is the tricky issue of messaging spam too).

          The spam deletion block always states that there is one more report than listed in http://clone.moodle.org/blocks/spam_deletion/viewvotes.php

          Thats because there are two 'votes/reports' one from you and one from me on the same piece of spam and its was the quckest number to calcualte

          http://clone.moodle.org/blocks/spam_deletion/viewvotes.php has title 'View Votes' yet the subtitle is 'Forum post spam reports'. Seems a bit weird to be voting (gives idea of something positive) for spam

          Show
          Dan Poltawski added a comment - 'Report as spam' links in non-English forums. Maybe 'Report as spam' can be added as a language string to be translated? It is a language string (from the block). Regarding guest access / authenticated users not enrolled in a course, the not enrolled message is much better than an error message, though I'm wondering whether better still would be to hide the 'Report as spam' link in these cases (if it's easy to do)? Its not easy to do (we can only use the existing rules for displaying 'reply' and those show to unenrolled users even though they need to enrol to report as spam). Can we have 'Report as spam' links for comments in the plugins directory? This may well require another 'hack' to core to do it unfortunately. Yes it can be done, but maybe it could come in another version? (Also, there is the tricky issue of messaging spam too). The spam deletion block always states that there is one more report than listed in http://clone.moodle.org/blocks/spam_deletion/viewvotes.php Thats because there are two 'votes/reports' one from you and one from me on the same piece of spam and its was the quckest number to calcualte http://clone.moodle.org/blocks/spam_deletion/viewvotes.php has title 'View Votes' yet the subtitle is 'Forum post spam reports'. Seems a bit weird to be voting (gives idea of something positive) for spam
          Hide
          Helen Foster added a comment -

          Thanks for explaining things Dan (sorry I can't count spam reports!) - it sounds as though this cool feature is production-ready!

          Show
          Helen Foster added a comment - Thanks for explaining things Dan (sorry I can't count spam reports!) - it sounds as though this cool feature is production-ready!
          Hide
          Helen Foster added a comment -

          Attaching screen shots of report as spam link and spam reports page for interest.

          Show
          Helen Foster added a comment - Attaching screen shots of report as spam link and spam reports page for interest.
          Hide
          Dan Poltawski added a comment -

          Spoke to Eloy and in order to elimate the hack to insert the link, i'm going to look at doing this with JS.

          Show
          Dan Poltawski added a comment - Spoke to Eloy and in order to elimate the hack to insert the link, i'm going to look at doing this with JS.
          Hide
          Dan Poltawski added a comment -

          I've now done this so the hack is done. The block just needs to be enabled on all pages (we were doing that anyway):
          https://github.com/moodlehq/block-spam_deletion/blob/master/module.js

          Hopefully can use the same approach for other areas.

          Show
          Dan Poltawski added a comment - I've now done this so the hack is done. The block just needs to be enabled on all pages (we were doing that anyway): https://github.com/moodlehq/block-spam_deletion/blob/master/module.js Hopefully can use the same approach for other areas.
          Hide
          Joseph Rézeau added a comment -

          Just noticed the "report as spam" link has been activated on moodle.org today.
          However, on the French forum, it is not (yet) translated. See attached screenshot.

          Show
          Joseph Rézeau added a comment - Just noticed the "report as spam" link has been activated on moodle.org today. However, on the French forum, it is not (yet) translated. See attached screenshot.
          Hide
          Joseph Rézeau added a comment -

          "Report as spam" not yet translated to French.

          Show
          Joseph Rézeau added a comment - "Report as spam" not yet translated to French.
          Hide
          Helen Foster added a comment -

          Hi Joseph,

          Dan has just added block_spam_deletion to the plugins directory so the strings are available in AMOS if you'd like to translate the 'Report as spam' links. Thanks in advance for your help.

          Show
          Helen Foster added a comment - Hi Joseph, Dan has just added block_spam_deletion to the plugins directory so the strings are available in AMOS if you'd like to translate the 'Report as spam' links. Thanks in advance for your help.
          Hide
          Dan Poltawski added a comment -

          Joseph, the most visible strings are (in block_spam_deletion):
          reportasspam
          alreadyreported
          thanksspamrecorded
          confirmspamreportmsg

          Show
          Dan Poltawski added a comment - Joseph, the most visible strings are (in block_spam_deletion): reportasspam alreadyreported thanksspamrecorded confirmspamreportmsg
          Hide
          Dan Poltawski added a comment -

          Hi Helen,

          I've implemented reporting a comment as SPAM and its now available for testing on the clone.

          Unfortunately the links to the comment content doesn't work amazingly (it returns you to the context where the comment is), because its nearly impossible for me to discover this information.

          Show
          Dan Poltawski added a comment - Hi Helen, I've implemented reporting a comment as SPAM and its now available for testing on the clone. Unfortunately the links to the comment content doesn't work amazingly (it returns you to the context where the comment is), because its nearly impossible for me to discover this information.
          Hide
          Matteo Scaramuccia added a comment -

          Hi Dan,
          what about removing Report as spam in those posts coming from the current loggedin user ($USER->id)? Now, I can report my own posts as spam, which could be useful in case I recognize myself to be kind of Dr. Jekill & Mr Hide .
          Joking apart, it's probably an improvement not really useful, maybe aesthetic, that requires module.js to have kind of initialization and taking the user id from div@author: something that could lowering the perfomance client side so take this comment just for recording my own brain storming.

          Show
          Matteo Scaramuccia added a comment - Hi Dan, what about removing Report as spam in those posts coming from the current loggedin user ( $USER->id )? Now, I can report my own posts as spam, which could be useful in case I recognize myself to be kind of Dr. Jekill & Mr Hide . Joking apart, it's probably an improvement not really useful, maybe aesthetic, that requires module.js to have kind of initialization and taking the user id from div@author : something that could lowering the perfomance client side so take this comment just for recording my own brain storming.
          Hide
          Dan Poltawski added a comment -

          Hi Matteo,
          As you say, to remove the link we'd need to do the JS to do some client side checking and i'm also cautious about keeping it as simply as possible as obviously a JS 'hack' like this is fragile.

          However I could/should implement the check on the server side. Though on the other hand I prompt you to for confirmation, so if someone sees there own post and clicks 'yes I really want to submit this as spam' then they deserve everything that comes to them

          Show
          Dan Poltawski added a comment - Hi Matteo, As you say, to remove the link we'd need to do the JS to do some client side checking and i'm also cautious about keeping it as simply as possible as obviously a JS 'hack' like this is fragile. However I could/should implement the check on the server side. Though on the other hand I prompt you to for confirmation, so if someone sees there own post and clicks 'yes I really want to submit this as spam' then they deserve everything that comes to them
          Hide
          Helen Foster added a comment -

          Hi Dan,

          I've just had a play with the report as spam links on comments in the plugins directory. Everything seemed to work fine. As the content of the spam comment is shown on blocks/spam_deletion/viewvotes.php I think the comment location is not so important.

          Would it be possible to add report as spam links to comments elsewhere, such as database activity entry comments e.g. http://clone.moodle.org/mod/data/view.php?d=19 ?

          Show
          Helen Foster added a comment - Hi Dan, I've just had a play with the report as spam links on comments in the plugins directory. Everything seemed to work fine. As the content of the spam comment is shown on blocks/spam_deletion/viewvotes.php I think the comment location is not so important. Would it be possible to add report as spam links to comments elsewhere, such as database activity entry comments e.g. http://clone.moodle.org/mod/data/view.php?d=19 ?
          Hide
          Dan Poltawski added a comment -

          Would it be possible to add report as spam links to comments elsewhere, such as database activity entry comments e.g. http://clone.moodle.org/mod/data/view.php?d=19 ?

          Its really hard to do that due to a variety of reasons, but i've come up with a way of doing it which is not very elegant (and might be a bit fragile.. sometimes those links might not appear) but it seems to work..

          Show
          Dan Poltawski added a comment - Would it be possible to add report as spam links to comments elsewhere, such as database activity entry comments e.g. http://clone.moodle.org/mod/data/view.php?d=19 ? Its really hard to do that due to a variety of reasons, but i've come up with a way of doing it which is not very elegant (and might be a bit fragile.. sometimes those links might not appear) but it seems to work..
          Hide
          Helen Foster added a comment -

          Hi Dan,

          I can't see any report as spam links to database activity entry comments on the clone site.

          Pretty please could you add report as spam links on comments in the plugins directory to moodle.org?

          Show
          Helen Foster added a comment - Hi Dan, I can't see any report as spam links to database activity entry comments on the clone site. Pretty please could you add report as spam links on comments in the plugins directory to moodle.org?
          Hide
          Dan Poltawski added a comment -

          Hi Helen,

          I've deployed it now.

          I think it best if we ignore the database comments for now (its complicated and I can't think of a quick and easy solution)

          Show
          Dan Poltawski added a comment - Hi Helen, I've deployed it now. I think it best if we ignore the database comments for now (its complicated and I can't think of a quick and easy solution)
          Hide
          Dan Poltawski added a comment -

          Hi Helen,

          As requested, i've added a messaging output for spam reports and given you and I the role to receive these reports.

          Show
          Dan Poltawski added a comment - Hi Helen, As requested, i've added a messaging output for spam reports and given you and I the role to receive these reports.
          Hide
          Helen Foster added a comment -

          Dan, I can't thank you enough for the 'Report as spam' links on moodle.org. They're helping such a lot in our fight against spammers.

          Just noting our chat regarding my idea of another place for a 'report as spam' link...

          Helen: in a messaging notification - 'report this message as spam'
          Dan: Do you mean the popup or just the message?
          Helen: I was thinking of the email notification
          Dan: oh, sorry
          Dan: that is impossible to do with the current approach i'm afraid
          Dan: (the current approach of not hacking core code)
          Helen: impossible for email and popup notification?
          Dan: impossible to change the email
          Dan: things on the webpage are possible

          Show
          Helen Foster added a comment - Dan, I can't thank you enough for the 'Report as spam' links on moodle.org. They're helping such a lot in our fight against spammers. Just noting our chat regarding my idea of another place for a 'report as spam' link... Helen: in a messaging notification - 'report this message as spam' Dan: Do you mean the popup or just the message? Helen: I was thinking of the email notification Dan: oh, sorry Dan: that is impossible to do with the current approach i'm afraid Dan: (the current approach of not hacking core code) Helen: impossible for email and popup notification? Dan: impossible to change the email Dan: things on the webpage are possible
          Hide
          Helen Foster added a comment -

          Resolving as fixed since the 'Report as spam' links are working brilliantly!

          We can create a new issue for further spam-fighting developments...

          Show
          Helen Foster added a comment - Resolving as fixed since the 'Report as spam' links are working brilliantly! We can create a new issue for further spam-fighting developments...
          Hide
          Helen Foster added a comment -

          Linking to a possible further spam-fighting development - MDLSITE-2156.

          Show
          Helen Foster added a comment - Linking to a possible further spam-fighting development - MDLSITE-2156 .

            People

            • Votes:
              3 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development