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

count_words() returns an inaccurate word count

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5.4, 2.6.1
    • Fix Version/s: 2.7
    • Component/s: Assignment
    • Labels:
    • Testing Instructions:
      Hide
      • Create an assignment activity with online text submission enabled.
      • Edit your submission and paste in some text (at least 25 words required for word count to be reported).
      • Save your submission and check the reported word count in the submission status table.
      • Edit your submission again and insert apostrophes into a few words.
      • Save and check the reported word count again. It should not have changed.
      Show
      Create an assignment activity with online text submission enabled. Edit your submission and paste in some text (at least 25 words required for word count to be reported). Save your submission and check the reported word count in the submission status table. Edit your submission again and insert apostrophes into a few words. Save and check the reported word count again. It should not have changed.
    • Affected Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-44349-master

      Description

      The count_words() function in lib/moodlelib.php counts the number of word boundaries following a word character. Since punctuation characters are classed as word boundaries, the reported word count for long strings can be fairly inaccurate (e.g. "can't" is counted as two words).

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              tonybutler Tony Butler
              Reporter:
              tonybutler Tony Butler
              Peer reviewer:
              Damyon Wiese
              Integrator:
              Dan Poltawski
              Tester:
              Frédéric Massart
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                12/May/14