Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-5875

Please show word count to teachers and students on forum posts

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.7, 1.8, 1.9, 2.0, 2.1.3, 2.4
    • Fix Version/s: 2.5
    • Component/s: Forum
    • Environment:
      All
    • Testing Instructions:
      Hide

      Test 1

      1. Upgrade Moodle and make sure that the table forum now counts a field name displaywordcount

      Test 2

      1. Install a new Moodle and make sure that the table forum counts a field name displaywordcount

      Test 3

      1. Create a new blog-type forum and set 'Display word count' to yes
      2. Create a new topic and make sure it is very very long (more than 600 chars or whatever value is your setting forum_longpost)
      3. Go to the main page of the forum and make sure the word count is displayed next to the link to read the whole post
      4. Go to the post and make sure the word count is displayed at the end of the post
      5. Check the styles in a few themes

      Test 4

      1. Back the course
      2. Restore it as a new course
      3. Make sure the restored course has 'Display word count' set to yes
      Show
      Test 1 Upgrade Moodle and make sure that the table forum now counts a field name displaywordcount Test 2 Install a new Moodle and make sure that the table forum counts a field name displaywordcount Test 3 Create a new blog-type forum and set 'Display word count' to yes Create a new topic and make sure it is very very long (more than 600 chars or whatever value is your setting forum_longpost) Go to the main page of the forum and make sure the word count is displayed next to the link to read the whole post Go to the post and make sure the word count is displayed at the end of the post Check the styles in a few themes Test 4 Back the course Restore it as a new course Make sure the restored course has 'Display word count' set to yes
    • Affected Branches:
      MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE, MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-5875-master

      Description

      I searched for word count

      http://moodle.org/bugs/query.php?title=&title_type=like&description=word+count&description_type=like&emailsearch1=email&email1=&emailtype1=like&emailfield1%5B%5D=owner&projects=&versions=&components=&op=doquery&order=severity.sort_order&sort=asc&savedqueryname=

      Please show word count on forum posts. It's very useful in gettng reluctant writers to meet minimum writing/thinking goals.

      It's an easy javascript and would be of huge benefit to high school Moodlers, imho.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              dougiamas Martin Dougiamas added a comment -

              Assigning to me temporarily because Vy-Shane no longer works for Moodle HQ.

              Show
              dougiamas Martin Dougiamas added a comment - Assigning to me temporarily because Vy-Shane no longer works for Moodle HQ.
              Hide
              hinkelman Don Hinkelman added a comment -

              This would be very helpful for second language learners. I often give word-count goals in writing short essays or self-introductions on forums. I believe word counts are already reported on activity reports. which is very important for end of term grading. However, putting the count (with a turn on/off option) in the forum would make it clear and immediate to the students.

              Show
              hinkelman Don Hinkelman added a comment - This would be very helpful for second language learners. I often give word-count goals in writing short essays or self-introductions on forums. I believe word counts are already reported on activity reports. which is very important for end of term grading. However, putting the count (with a turn on/off option) in the forum would make it clear and immediate to the students.
              Hide
              hinkelman Don Hinkelman added a comment -

              Thank you for working on the "Word Count for Forum Posts". However, I cannot find this implemented in any Moodle version. Is this a planned feature addition? For the reasons explained earlier, it would be good as a standard feature in all versions of Moodle 1.7, 1.8 and 1.9, with an enable/disable switch.

              Show
              hinkelman Don Hinkelman added a comment - Thank you for working on the "Word Count for Forum Posts". However, I cannot find this implemented in any Moodle version. Is this a planned feature addition? For the reasons explained earlier, it would be good as a standard feature in all versions of Moodle 1.7, 1.8 and 1.9, with an enable/disable switch.
              Hide
              aborrow Anthony Borrow added a comment - - edited

              Here is a simple patch file for Moodle 1.9 to implement displaying forum post word counts universally. Feedback is of course welcome. Peace - Anthony

              Show
              aborrow Anthony Borrow added a comment - - edited Here is a simple patch file for Moodle 1.9 to implement displaying forum post word counts universally. Feedback is of course welcome. Peace - Anthony
              Hide
              aborrow Anthony Borrow added a comment -

              adding later Moodle versions as affected

              Show
              aborrow Anthony Borrow added a comment - adding later Moodle versions as affected
              Hide
              sporter@nts.edu Stephen Porter added a comment -

              Will the patch/.diff still work if you install directly in 2.0? Looking at the code, it appears the line numbers to be edited are different from the version the .diff was created for.

              Show
              sporter@nts.edu Stephen Porter added a comment - Will the patch/.diff still work if you install directly in 2.0? Looking at the code, it appears the line numbers to be edited are different from the version the .diff was created for.
              Hide
              aborrow Anthony Borrow added a comment -

              Stephen - You may want to try the following patch for Moodle 2.0 - https://github.com/arborrow/moodle/compare/MOODLE_20_STABLE...MDL-5875. There were some API changes and this patch will probably be of more help. I've only done preliminary testing so let me know how it works for you. It was a quick, copy and paste job so any feedback you have would be helpful. Peace - Anthony

              Show
              aborrow Anthony Borrow added a comment - Stephen - You may want to try the following patch for Moodle 2.0 - https://github.com/arborrow/moodle/compare/MOODLE_20_STABLE...MDL-5875 . There were some API changes and this patch will probably be of more help. I've only done preliminary testing so let me know how it works for you. It was a quick, copy and paste job so any feedback you have would be helpful. Peace - Anthony
              Hide
              sporter@nts.edu Stephen Porter added a comment -

              Thanks Anthony. We just installed it in our 2.0 test environment and it seems to work perfectly. I will let you know if we encounter any bugs. Thanks!!

              Show
              sporter@nts.edu Stephen Porter added a comment - Thanks Anthony. We just installed it in our 2.0 test environment and it seems to work perfectly. I will let you know if we encounter any bugs. Thanks!!
              Hide
              koen Koen Roggemans added a comment -

              There seems to be quite some demand for word count all over Moodle if you search the tracker.
              I was wondering wether implementing it in the TinyMCE editor could be a good generic sollution to give the functionality everywhere in one go.
              See http://jess-mann.com/blog/2009/04/04/tinymce-wordcount-with-jquery/ for inspiration

              Show
              koen Koen Roggemans added a comment - There seems to be quite some demand for word count all over Moodle if you search the tracker. I was wondering wether implementing it in the TinyMCE editor could be a good generic sollution to give the functionality everywhere in one go. See http://jess-mann.com/blog/2009/04/04/tinymce-wordcount-with-jquery/ for inspiration
              Hide
              salvetore Michael de Raadt added a comment -

              It looks like this issue has been around for a while.

              I'm not sure how recent the existing patch is in relation to current versions.

              Show
              salvetore Michael de Raadt added a comment - It looks like this issue has been around for a while. I'm not sure how recent the existing patch is in relation to current versions.
              Hide
              fred Frédéric Massart added a comment -

              Pushing for peer review. Here after a few notes:

              • I changed the <span> to a <div> because semantically the span would be appended to the string before, which could create a non-readable word for screen readers;
              • I decided to have the word count in each if because I felt like keeping the parentheses was a good idea, but not when the post is not shortened;
              • There is no change to add a word count to the HTML editor as it is already possible by asking the admin to set editor_tinymce | customconfig to
                _ { "plugins": "wordcount" }

                _;

              • I have tried several display of the word count, but it looks like this one is the most compatible without having to hack the HTML too much (explored the different options with Barbara).

              Cheers,
              Fred

              Show
              fred Frédéric Massart added a comment - Pushing for peer review. Here after a few notes: I changed the <span> to a <div> because semantically the span would be appended to the string before, which could create a non-readable word for screen readers; I decided to have the word count in each if because I felt like keeping the parentheses was a good idea, but not when the post is not shortened; There is no change to add a word count to the HTML editor as it is already possible by asking the admin to set editor_tinymce | customconfig to _ { "plugins": "wordcount" } _; I have tried several display of the word count, but it looks like this one is the most compatible without having to hack the HTML too much (explored the different options with Barbara). Cheers, Fred
              Hide
              abgreeve Adrian Greeve added a comment -

              [Y] Syntax
              [Y] Output
              [Y] Whitespace
              [Y] Language
              [*] Databases
              [Y] Testing
              [-] Security
              [*] Documentation
              [Y] Git
              [Y] Sanity check

              Hi Fréd,

              I like the solution that you have provided. I think that it provides a neat solution to this improvement.

              Just a couple of things:

              • Did you use the XMLDB editor to generate the XML and upgrade script for your code? I remember Eloy posting somewhere in chat or something about using that to make alterations like this, and it looks like you are missing a line that should include the function upgrade_mod_savepoint().
              • Why did you decide that normal length posts shouldn't be surrounded by parentheses? I'm not saying this is a problem, I'm just curious about the decision.
              • No doubt the moodle docs should be updated to make mention of this improvement.

              Thanks.

              Show
              abgreeve Adrian Greeve added a comment - [Y] Syntax [Y] Output [Y] Whitespace [Y] Language [*] Databases [Y] Testing [-] Security [*] Documentation [Y] Git [Y] Sanity check Hi Fréd, I like the solution that you have provided. I think that it provides a neat solution to this improvement. Just a couple of things: Did you use the XMLDB editor to generate the XML and upgrade script for your code? I remember Eloy posting somewhere in chat or something about using that to make alterations like this, and it looks like you are missing a line that should include the function upgrade_mod_savepoint(). Why did you decide that normal length posts shouldn't be surrounded by parentheses? I'm not saying this is a problem, I'm just curious about the decision. No doubt the moodle docs should be updated to make mention of this improvement. Thanks.
              Hide
              fred Frédéric Massart added a comment -

              Thanks Adrian,

              • I use the XMLDB editor to generate the PHP code and XML file, thanks for pointing it out.
              • I kept the current behaviour which added the parenthesis to the shorten text, but it looked nicer without when the full text is displayed, and would allow themers to adapt it in styles without suffering from the parenthesis.
              • Added the label docs_required, thanks!

              Cheers,
              Fred

              Show
              fred Frédéric Massart added a comment - Thanks Adrian, I use the XMLDB editor to generate the PHP code and XML file, thanks for pointing it out. I kept the current behaviour which added the parenthesis to the shorten text, but it looked nicer without when the full text is displayed, and would allow themers to adapt it in styles without suffering from the parenthesis. Added the label docs_required, thanks! Cheers, Fred
              Hide
              damyon Damyon Wiese added a comment -

              The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

              Cheers!

              Show
              damyon Damyon Wiese added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. Cheers!
              Hide
              damyon Damyon Wiese added a comment -

              Hi Fred,

              This patch is missing backup/restore code - can you add that and I'll take another look?

              Also adding Mark as a watcher to this issue as component lead.

              Mark - can you thumbs up this change?

              Cheers, Damyon

              Show
              damyon Damyon Wiese added a comment - Hi Fred, This patch is missing backup/restore code - can you add that and I'll take another look? Also adding Mark as a watcher to this issue as component lead. Mark - can you thumbs up this change? Cheers, Damyon
              Hide
              fred Frédéric Massart added a comment -

              Good thinking Damyon! I've amended my patch. Cheers!

              Show
              fred Frédéric Massart added a comment - Good thinking Damyon! I've amended my patch. Cheers!
              Hide
              damyon Damyon Wiese added a comment -

              Thanks Fred,

              Looks good - just waiting on a thumbs up from Mark.

              Show
              damyon Damyon Wiese added a comment - Thanks Fred, Looks good - just waiting on a thumbs up from Mark.
              Hide
              markn Mark Nelson added a comment -

              Thanks guys. Looks good to me, go ahead and integrate.

              Show
              markn Mark Nelson added a comment - Thanks guys. Looks good to me, go ahead and integrate.
              Hide
              damyon Damyon Wiese added a comment -

              Thanks Fred - this has been pushed to master.

              Show
              damyon Damyon Wiese added a comment - Thanks Fred - this has been pushed to master.
              Hide
              markn Mark Nelson added a comment -

              Thanks Fred. Works as expected, passing.

              Show
              markn Mark Nelson added a comment - Thanks Fred. Works as expected, passing.
              Hide
              damyon Damyon Wiese added a comment -

              Congratulations this fix has been added to Moodle!

              You may want to dedicate this issue to someone special on this Valentines day.

              Thanks!

              Show
              damyon Damyon Wiese added a comment - Congratulations this fix has been added to Moodle! You may want to dedicate this issue to someone special on this Valentines day. Thanks!
              Hide
              marycooch Mary Cooch added a comment -

              Removing qa_test_required as there is a test for this here MDLQA-5265 ready for the next cycle.

              Show
              marycooch Mary Cooch added a comment - Removing qa_test_required as there is a test for this here MDLQA-5265 ready for the next cycle.
              Hide
              marycooch Mary Cooch added a comment -

              Removing docs_required label as this is documented here http://docs.moodle.org/25/en/Forum_settings

              Show
              marycooch Mary Cooch added a comment - Removing docs_required label as this is documented here http://docs.moodle.org/25/en/Forum_settings

                People

                • Votes:
                  14 Vote for this issue
                  Watchers:
                  16 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    14/May/13