Adding of backslach character when I save feedback

Adding of backslach character when I save feedback

by Caryl Gordon -
Number of replies: 5

Hi everyone,

We are using Moodle 1.9.5. When I save feedback for a Journal entry, wherever there is an apostrophe character, for example in the words don't, student's, etc., a slash character is inserted before the apostrophe when I click the "Save all my feedback" button.

For example, I wrote the following feedback:

It's hard to know how and in what ways ... That's important for the final write up.

After clicking the "Save all my feedback" button, it now appears as:

It/'s hard to know how and in what ways ... That/'s important for the final write up.

Since I have 35 students in this class, every time I save after this, a few more slashs are added, so now it looks like this:

It\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'s hard to know how and in what ways ...That\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'s important for the final write up.

Any ideas on what is happening? Thanks is advance for any help.

Caryl Gordon

Average of ratings: -
In reply to Caryl Gordon

Re: Adding of backslach character when I save feedback

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
That is a typical bug when there is an extra addslashes or a missing stripslashes somewhere.
In reply to Tim Hunt

Re: Adding of backslach character when I save feedback

by ViliMaka Foliaki -
Lol Caryl,

I've noticed that too. So I'm resorting to grading many journals in one go before I click the save button. It doesn't solve the problem; only reduces the number slashes.

Hi Tim,
No solution yet to this bug?

Many thanks
In reply to ViliMaka Foliaki

Re: Adding of backslach character when I save feedback

by Jeremy Schambaugh -
I'm having the same issue and was wondering if there was ever any solutions to this problem?
In reply to ViliMaka Foliaki

Re: Adding of backslach character when I save feedback

by François Lizotte -
Picture of Particularly helpful Moodlers

Here I am, over a year and a half later looking for help with a similar issue.

I just tried this fix suggested by Joseph Rézeau centuries ago and it seems to work.

In Moodle 1.6+

In file \mod\journal\report.php, line 86 replace

                $entrybyuser[$entry->userid]->comment    = $vals['c'];

with

                $entrybyuser[$entry->userid]->comment    = stripslashes($vals['c']);

See Joseph's post:

http://moodle.org/mod/forum/discuss.php?d=53582#p244694

Now let's see if I can fix the Questionnaire module where the same problem was just reported.

FL

In reply to Tim Hunt

Re: Adding of backslach character when I save feedback

by Steve Neufeld -

Seems to related to a PHP setting in PHP.ini file: see http://tracker.moodle.org/browse/MDL-14845 (there is a 'patch' for the journal module here):

The Journal feedback window inserts backslashes before quotes and apostrophe marks. When the feedback page is refreshed, another backslash is inserted.

Set for PHP as per instructions:

magic_quotes_gpc = On
magic_quotes_runtime = Off

I have not tried to change the setting yet...I just learn to avoid using contractions in the journal feedback...or I use the` instead of ' - smile