How To Make Glossary Autolink With Feedback Module - WILL PAY FOR SOLUTION

How To Make Glossary Autolink With Feedback Module - WILL PAY FOR SOLUTION

by John Keilaus -
Number of replies: 1
Hi
Am struggling to find an answer so maybe you nice folks could help

I'm using the Feedback Module for custom surveys, but have noticed that glossary does not autolink with it. Autolinking works fine everywhere else, just not in this module when a student is taking a survey.

Does anyone know how I can enable this or modify code to force glossary to include this module during the filtration/autolinking process?
Thanks
QuaySupport
Average of ratings: -
In reply to John Keilaus

How To Make Glossary Autolink With Feedback Module - SOLVED

by John Keilaus -
Eureka!!
I have just completed my first EVER Moodle Hack!

After pouring over the code in Feedback, I found a way to enable Glossary Autolinking within Feedback.
What I did was;
The feedback module seems to use a seperate lib.php for each different type of element used in a survey. This can be seen by exploring the Feedback->Mod->Feedback->Item Folder of the unzipped package.
You will see that each type of form element has its own subfolder, and within that each element type has its own lib.php

EG
For a Textfield
1. Open feedback->mod->feedback->textfield->lib.php
2. Goto function named [function feedback_print_textfield] around line 104
3. Look for line "<td valign="top" align="left"><?php echo text_to_html(stripslashes_safe($item->name) . $requiredmark, true, false, false);?></td>
4. Change it to <td valign="top" align="left"><?php echo format_text(text_to_html(stripslashes_safe($item->name) . $requiredmark, true, false, false));?></td> - This is basically wrapping the text_to_html() function within the Moodle Format_text() function with is where the glossary functionality kicks in.
5. Save the lib.php file and upload to your server in the CORRECT folder

coolNow you surveys will support Glossary Autolinking for text fields.

You will need to repeat the exercise for each different form element type by navigating to the correct folder feedback->mod->feedback->formelementtype->lib.php

Then look for the feedback_print_elementtype function for that element type and nest the text_to_html() function call within a format_text() function call - DON'T FORGET TO CLOSE THE PARENTHESIS


Hope this helps anyone else out their
QuaySupport Virtual Learning Solutions