Moodle 1.7 converts (n) to a thumbs down image

Moodle 1.7 converts (n) to a thumbs down image

by Daniel Adihardjo -
Number of replies: 19

Has anyone encountered the same problem as I have? I'm using Moodle 1.7 and through out the Moodle interface, if I want to use either "open parenthesis - n - close parenthesis" or "open parenthesis - y - close parenthesis"; it conerts it to thumbs down (for n) and thumbs up (for y). No Yes

an

Iv'e also tried using document.write, it works the first time around, but once you modify and save, it strips the Javascript.

Is there a setting some where that I can change? Does anyone have a solution?

Average of ratings: -
In reply to Daniel Adihardjo

Re: Moodle 1.7 converts (n) to a thumbs down image

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Look in lib/weblib.php at the function replace_smilies (~ line 1700). You can delete the ones you don't like.

Hmm. Perhaps we should disable smilies altogether for quiz question text? Does anyone out there use smilies in questions?

In reply to Tim Hunt

Re: Moodle 1.7 converts (n) to a thumbs down image

by Ray Lawrence -
Always wary of too many options... but could this be an option in the quiz settings?
In reply to Tim Hunt

Re: Moodle 1.7 converts (n) to a thumbs down image

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
While I don't use them I could imagine some teachers may use them as feedback (if not in the question or answers).
In reply to Tim Hunt

Re: Moodle 1.7 converts (n) to a thumbs down image

by Daniel Adihardjo -
Thanks Tim. I read in another posting that you can do this via the administration panel/settings. The person didn't say where Is this true?
In reply to Daniel Adihardjo

Re: Moodle 1.7 converts (n) to a thumbs down image

by Matt Campbell -
I've noticed that I can use the HTML codes (see table at http://www.ascii.cl/htmlcodes.htm) and it will display the parens properly UNTIL you edit the question. Then, any questions or answers you put the codes in will convert to the symbol, and then display as the smiley. So, any time I edit, I have to enter the codes again.

Thanks,
Matt
In reply to Matt Campbell

Re: Moodle 1.7 converts (n) to a thumbs down image

by Anthony Williams -
I'd find it useful to switch this off in quiz questions. We often use paths such as c:\ and have found that converted to a smiley
In reply to Matt Campbell

Re: Moodle 1.7 converts (n) to a thumbs down image

by Daniel Adihardjo -
Yeah, I noticed this problem also. I can use the HTML symbol but when I edit the question, it changes back to the thumbs down. Thanks.
In reply to Daniel Adihardjo

Re: Moodle 1.7 converts (n) to a thumbs down image

by Eamon Costello -
I've logged this as a bug:

http://tracker.moodle.org/browse/MDL-10915

as I couldn't find it in the tracker. If someone here has logged it already please say so.

- Eamon
In reply to Eamon Costello

Re: Moodle 1.7 converts (n) to a thumbs down image

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
It's not a bug - it is the smilies feature of moodle at work. The same one that means what when I type : - ) smile I get a smily face. Occasionally, they define ones that match genuine text, and it is a pain in the next, but it is no a bug.
In reply to Tim Hunt

Re: Moodle 1.7 converts (n) to a thumbs down image

by John Isner -
I was taught that one of the criteria for usability was "no unpleasant surprises." So this may not be a bug, but it is definitely a usability issue.

I always wondered: Why aren't text-based smilies processed by an optional text filter? Then people who don't like their text arbitrarily transformed could do something about it.

If you agree, vote for MDL-11045 "Text-based smilies should be handled by an optional text filter."

Eamon -- I cross-referenced your bug report MDL-10915.
In reply to John Isner

Re: Moodle 1.7 converts (n) to a thumbs down image

by A. T. Wyatt -
I too, would like to turn the smileys off in the quiz module. I would like to be able to insert smileys from the toolbar in the html editor, but not the automatic part. Plays havoc with quizzes that require code snippets. . .

atw
Average of ratings: Useful (1)
In reply to A. T. Wyatt

Re: Moodle 1.7 converts (n) to a thumbs down image

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Unfortunately, smilies inserted with the HTML editor, and smilies you type yourself, are exactly the same, once the data is saved in the database. This is an annoying problem, without an abviouls good solution.
Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Moodle 1.7 converts (n) to a thumbs down image

by Matt Campbell -
How about an administrator option to define what smileys can be used, and what the keystrokes will be? Maybe in Appearance-HTML Editor?

Thanks,
Matt
In reply to Matt Campbell

Re: Moodle 1.7 converts (n) to a thumbs down image

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Yes, that would be nice.

Actually, it would make a nice project for someone wanting to get into Moodle programming, because it is the kind of minor, would-be-nice feature that most developers won't get around to, but is quite and easy project for a novice to Moodle code.

At the moment, there is a hard-coded list in function replace_smilies in lib/weblib.php, which is easy to edit if you want to customise this.

In reply to Tim Hunt

Re: Moodle 1.7 converts (n) to a thumbs down image

by Matt Campbell -
I MIGHT be up to something like this. From what I can figure, it would need to have a class in /lib/adminlib.php - something like how admin_setting_special_editorfontlist works, then change /lib/weblib.php to use those functions to pull it up, a line in appearance.php under the htmleditor settings to display the choices, and the appropriate language file changes. I can't seem to figure out from the code where this data is stored - is it in the sessions file in moodledata?

Could you let me know if I'm even close to being on the right track?

Thanks,
Matt
In reply to Matt Campbell

Re: Moodle 1.7 converts (n) to a thumbs down image

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Most stuff from admin is stored in the mdl_config table, using set_config.

I don't know very much about admin pages. You may be better asking in the General Developer Forum.
In reply to Daniel Adihardjo

Re: Moodle 1.7 converts (n) to a thumbs down image

by Peter Hesen -
Diff in mod/resource/type/html/resource.class.php

The following diff disables smilies i.e. No conversion in a webpage source



--- resource.class.php (revision 111)
+++ resource.class.php (working copy)
@@ -96,6 +96,7 @@

parent::display_course_blocks_start();
$formatoptions->noclean = true;
+ $formatoptions->smiley = false;
echo format_text($this->resource->alltext, FORMAT_HTML, $formatoptions, $this->course->id);

$cm = $this->cm; @@ -118,6 +119,7 @@

$pagetitle = strip_tags($course->shortname.': '.format_string($resource->name));
$formatoptions->noclean = true;
+ $formatoptions->smiley = false;
$inpopup_param = optional_param( 'inpopup','' );
$inpopup = !empty($inpopup_param);

In reply to Peter Hesen

Re: Moodle 1.7 converts (n) to a thumbs down image

by Fred Weiss -
I was asked this question today and pointed to this discussion. Although I realise this discussion ceased in 2008 probably as the issue was fixed.
I thought I would still pop in the answer.

In Moodle 1.9 if you go to

Site Admininstration ; Appearance ; HTML editor

Scroll down to Emoticons and remove the entries for Yes ( y ), No ( n ) (or change to something else)

This will stop the thumbs up, thumbs down showing for the entire moodle site.

There are a list of other emoticons in this table which can be deleted or changed.
Average of ratings: Useful (1)
In reply to Fred Weiss

Re: Moodle 1.7 converts (n) to a thumbs down image

by Jaime McLeod -

This worked perfectly, thanks!

It's hard for me to believe this isn't a big issue to people. I'm glad I ran across this thread.