Moodle 1.7 converts (n) to a thumbs down image

Moodle 1.7 converts (n) to a thumbs down image

Daniel Adihardjo -
回帖数: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). 否 是的

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?

回复Daniel Adihardjo

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

Tim Hunt -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 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?

回复Tim Hunt

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

Ray Lawrence -
Always wary of too many options... but could this be an option in the quiz settings?
回复Tim Hunt

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

Anthony Borrow -
Core developers的头像 Plugin developers的头像 Testers的头像
While I don't use them I could imagine some teachers may use them as feedback (if not in the question or answers).
回复Tim Hunt

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

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?
回复Daniel Adihardjo

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

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
回复Matt Campbell

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

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
回复Matt Campbell

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

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.
回复Daniel Adihardjo

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

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
回复Eamon Costello

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

Tim Hunt -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 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 : - ) 微笑 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.
回复Tim Hunt

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

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.
回复John Isner

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

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
回复A. T. Wyatt

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

Tim Hunt -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 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.
回复Tim Hunt

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

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
回复Matt Campbell

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

Tim Hunt -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 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.

回复Tim Hunt

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

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
回复Matt Campbell

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

Tim Hunt -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 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.
回复Daniel Adihardjo

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

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

The following diff disables smilies i.e. 否 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);

回复Peter Hesen

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

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.
回复Fred Weiss

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

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.