Character count vs word count for minimum answers...

Character count vs word count for minimum answers...

Ben Girard -
回帖数:20

Hello community...

The government specification forces us to have a minimum and a maximum amount of "characters". Currently, in 3.11, I only see an option for "Word count".  Is there an option somewhere or config file we can change for Moodle to count the characters instead of Words?  Thanks.

平均分:Useful (1)
回复Ben Girard

Re: Character count vs word count for minimum answers...

Tim Hunt -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像
Short answer: no.

Of course, the extra options you want could be added, but someone who wants it will have to do it.
回复Tim Hunt

Re: Character count vs word count for minimum answers...

Ben Girard -

Too bad...  Thanks for the quick reply.  We'll have to come up with an average of characters per "word" to use the word limit in Moodle properly.

回复Ben Girard

Re: Character count vs word count for minimum answers...

AL Rachels -
Core developers的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像
Which activity are you using where you need the character and word counts?
回复AL Rachels

Re: Character count vs word count for minimum answers...

Ben Girard -

It's quiz with an "essay" question where the response must contain a minimum and a maximum of characters.  At the moment, Moodle only provides the option to use a word count for min/max instead of character count.

回复Ben Girard

Re: Character count vs word count for minimum answers...

AL Rachels -
Core developers的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像
Not sure what country you are referring to, but I think you will need to get a developer to do a "lot" of work for you. The reason I say that, is that the essay question word count in its present form is easily fooled which means the obvious way of adding a character count can be fooled, too. For instance, if I create a very simple essay question requiring ten words minimum and fifteen maximum, I can type any ten characters or symbols, each separated by a space, and will get credit for the minimum word length. If I continue the sequence past fifteen, I will be notified that I am over the maximum. This is just how the Moodle count_words API seems to work. If you search the tracker, you will find that count_words returns too few words when dealing with html tags. It also seems to give bogus results when you have embedded media.
To me the obvious method of getting a character count is to just get the strlen(yourtextstring), but his can be easily fooled with embbed stuff too.
I maintain the Diary plugin, which uses the Moodle count_words for each entry, and I have just added a character count for each entry. I am still in the testing mode to see if it is worth including it in an actual release. Since a Diary activity could be used to replace a Quiz Essay question, let me know if you would like to try it out and I will provide details.
回复AL Rachels

Re: Character count vs word count for minimum answers...

Tim Hunt -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像
At the same as adding the word-count feature to essay questions, I fixed Moodle's word-counting to give exactly the same count as MS Word and Libre Office in every situation I could think of to test. If you have a specific case which Moodle counts wrongly in the latest version, please tell us.

Typing 15 random characters separated by spaces will not get you any credit. The essay will ultimately be manually marked by the teacher, who will be able to see that it is garbage and worth 0 points.
回复Tim Hunt

Re: Character count vs word count for minimum answers...

Dominique Bauer -
Documentation writers的头像 Particularly helpful Moodlers的头像 Plugin developers的头像
Ben,

Maybe you could put a little script in the questions that will give you the number of characters. It would look something like this:



You can try the question here ↗. I'll make the script available when I've cleaned it up a bit.
回复Dominique Bauer

Re: Character count vs word count for minimum answers...

Ben Girard -
Thanks for developing this script Dominique. I'm interested in it if you can share it it. Where does the script go (upload in Atto? Moodle plugin? Else?) I also agree with the opinions in this thread where the Moodle Word Count functionality should behave like MS Word. Thank sin advance.
回复Ben Girard

Re: Character count vs word count for minimum answers...

Dominique Bauer -
Documentation writers的头像 Particularly helpful Moodlers的头像 Plugin developers的头像
Hello Ben,

You prefer word count like Word's, rather than Google Docs' which is better in my opinion. Can you tell me the reason?

Regarding the number of characters, have you looked at the "Essay Auto-grade" plugin as suggested above by Don Hinkelman? If a plugin is right for you and it can be installed on your site, this is still the easiest solution.

On the other hand, if you want to use the "Essay" question with the little script I wrote, please head over to this other thread Caracter count in the Essay question ↗.

回复Tim Hunt

Re: Character count vs word count for minimum answers...

AL Rachels -
Core developers的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像
Hi Tim,
Sorry, currently my work time is usually very limited and full of interruptions and consequently, I did not carefully re-read and complete my last entry. Yesterday, while trying and failing to write a coherent reply, our dog came running into the room, clearly agitated, and I suddenly realized the house was rapidly filling with smoke. My wife has a family reputation of burning up pans on the stove, and I caught that one just barely in time. By the time I got back to my computer, I just clicked the post button without remembering that I was not done with the entry.
I totally understand that typing any number of random character will not get credit due to manual marking, but if an essay is long enough, there is the possibility that the teacher may not notice and count them as wrong.
I used to teach computer applications to 11 and 12 year olds. I had them write at least one essay per month using the various essay capable plugins, in Moodle. No matter how often I went over proper punctuation of a sentence, many of them still were doing it wrong at the end of each academic school year. Their tendency was to place a space on both sides of any punctuation character because that was what they did when handwriting essays in their English course. While this would make no difference in the overall character count to a computer entry, it does artificially inflate the word count, which was the point I so poorly was trying to make.
I can already see from the post by Dominique, that I need to go do some more work on my version of character count for the Diary plugin.
回复AL Rachels

Re: Character count vs word count for minimum answers...

Dominique Bauer -
Documentation writers的头像 Particularly helpful Moodlers的头像 Plugin developers的头像

Hello Al and Tim,

As Al says, counting punctuation with a space on both sides as a word, as the Essay question and MS word do, is probably not adequate. Punctuation probably shouldn't be counted in a character count either.

Something like this, in despicable jQuery 微笑, would probably do the trick:

  numberSpacePeriodSpace = (string.split(" . ").length - 1);
  numberSpaceCommaSpace = (string.split(" , ").length - 1);
  numberSpaceColonSpace = (string.split(" : ").length - 1);
  numberSpaceSemicolonSpace = (string.split(" ; ").length - 1);

I am writing this post in a hurry. We're going to an afternoon performance at the theater. My wife will kill me if I still hang out on the forum.

回复Dominique Bauer

Re: Character count vs word count for minimum answers...

Dominique Bauer -
Documentation writers的头像 Particularly helpful Moodlers的头像 Plugin developers的头像

Orginal work by artist KC Green "This is fine", 2013, http://gunshowcomic.com/648", adaptation by Lisa Maltseva.

Now that Al's gone to put out the fire,
I'll finally be able to play a game for the doggies.

回复Dominique Bauer

Re: Character count vs word count for minimum answers...

Don Hinkelman -
Particularly helpful Moodlers的头像 Plugin developers的头像
Just to say this thread is very interesting to all teachers in Japan, because we often switch between or combine word count and character count (Japanese/Chinese characters have no words, only characters). Also, minimum counts (with warning to student at submission) are more important than maximum counts. In his excellent custom question type "Essay Auto-grade", Gordon Bateson has integrated minimum word counts and minimum character counts, and key word bonuses within an auto grading tool. https://github.com/gbateson/moodle-qtype_essayautograde
回复Don Hinkelman

Re: Character count vs word count for minimum answers...

Dominique Bauer -
Documentation writers的头像 Particularly helpful Moodlers的头像 Plugin developers的头像
Their tendency was to place a space on both sides of any punctuation character because that was what they did when handwriting essays in their English course.

Typing 15 random characters separated by spaces will not get you any credit.
Actually, with Moodle it will. Also, it is not about random characters, it is about punctuation.

The essay will ultimately be manually marked by the teacher, who will be able to see that it is garbage and worth 0 points.
What students may write is not garbage, it is mistakes. What is garbage is a program that cannot detect that punctuation with a space on each side is not a word.

Google Docs doesn't count punctuation with a space on either side as words. It is free and not antiquated.
回复Don Hinkelman

Re: Character count vs word count for minimum answers...

Tim Hunt -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像
MS Word seems to know enough to be able to count Words in Japanese in some meaningful way - at least as far as I can tell. However, I don't think there is a non-trivial algorithm for that, so I did not try. I guess I shoudl qualify my previous remark by saying "same word-count as word for English, and possibly other languages".
回复Tim Hunt

Re: Character count vs word count for minimum answers...

AL Rachels -
Core developers的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像
Hi Tim,
Sorry to be so slow to get back to this but I do think I sometimes see cases of Moodle being wrong with the results given by the count_words API. Both the Atto and TinyMCE editors can and do sometimes include default hidden tags that, count_words($text), will include in the count total. Usually as a minimum, Atto will automatically include a start paragraph and end paragraph tag which will just throw off the character count, while the TinyMCE editor will include a line break tag that does the same thing. Here in this forum, Atto will include a div with a class and due to an included space, will always throw off the correct count_words result, as well as a character count. And, of course, we all know that copy and paste from M$ Word includes a whole lot of hidden baggage that will make both a total word count and character count wind up being way off.
In Diary, I think I will also try to include a "typing" standardized word count based on one word = 5 characters, like they use for calculating typing speed in words per minute. And, also include a raw character count, along with a cleaned character count, so it is easy to identify that a copy and paste was done without cleaning.
回复AL Rachels

Re: Character count vs word count for minimum answers...

AL Rachels -
Core developers的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像

I have finally gotten a Diary setup to show three versions of word and character counts. Details are in the new character count discussion at https://moodle.org/mod/forum/discuss.php?d=423166#p1705281.

回复AL Rachels

Re: Character count vs word count for minimum answers...

AL Rachels -
Core developers的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像
For anyone still interested in this subject, I have just released a much better version of the Diary plugin, v3.5.0, that includes a much larger number of statistics. It can include capability for an autorating for one of the following: None, Characters, Words, Sentences, or Paragraphs.

Eventually, I hope to make it possible to select up to all four items for inclusion in the autorating results.
回复Dominique Bauer

Re: Character count vs word count for minimum answers...

Tim Hunt -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像
I think the only sensible policy for Moodle is to give the same word-count as Microsoft office & Libre office - which is what we now do. (Those two agree on every input I could think of.)