Details
Description
To demonstrate the bug, create a resource called Article: "Testing" and then create an offline assignment that instructs the student to Read Article: "Testing". I would expect autolinking to work (especially if I copy and paste the resource name into the assignment's description. I've not looked at the code to see what the problem is but I do notice that the description field stores the double quote as " A workaround is to use two single quotes which gives the appearance of a double quote but this is not intuitive to users. This issue is important as teachers who wish to demonstrate good formatting of resource names require the use of quotations (this is how I came across this issue). So getting this patched up would be very helpful. A similar issue occurs when italics are used in the assignment description. Since italics are not allowed in the resource name (they get stripped out if the html is added manually), then I think the text string should also be stripped using the same function prior to doing the compare. Peace - Anthony
Attachments
Issue Links
| This issue has been marked as being related by: | ||||
| MDL-17545 | Activitynames Filter: Problem autolinking if activity name contains use of double quote (i.e. " ) |
|
|
|
Eloy - I was taking a quick look at how the resource name is handled and figured I would make a couple notes for myself that also might be useful if you get to this before I do.
Looking at /mod/resource/mod_form.php the name field for a resource is a form type of either PARAM_TEXT or PARAM_CLEAN depending on whether $CFG->formatstringstriptags is set or not. To test italics, I allowed the activity name to contain the italics tags. Even so, the autolinking did not work. Do you think it would be wise to strip the resource name to PARAM_TEXT before comparing?
The disadvantage would be that a resource named: My Resource and My <i>Resource</i> would be the same but I would see that more as a benefit. I think this might improve the autolinking and make it a tad more predictable and less fussy.
I have a day full of classes so will not get to do too much with this today but will continue to plug away at coming up with a patch.
Peace - Anthony