How do I disable Glossary autolinking to Quiz items?

How do I disable Glossary autolinking to Quiz items?

by Michael Nelson -
Number of replies: 14

Greetings All:

I am using Moodle 1.4.2 and wonder how to disable the use of Glossary autolink functions to certain words that would be tested as vocabulary during a Quiz. 

I tried the "<nolink> Keyword </nolink>" suggestion in the original help files, but it is not working for me, and the items I want <nolink>'ed are still showing up with Glossary references and hyperlinks to key words on the vocabulary quiz.

If anyone else has this problem, or has a possible solution, I would be very grateful to hear from you!  Small potatoes for right now, but will need a fix in about a month or so.

Thanks in advance for your time and assistance smile

Michael in Dongguan

Average of ratings: -
In reply to Michael Nelson

Re: How do I disable Glossary autolinking to Quiz items?

by Timothy Takemoto -

Dear Michael Nelson

Yes, there is a solution to the autolinking of Quiz Items, thanks to Paul Evans. Please see this thread
http://moodle.org/mod/forum/discuss.php?d=13652
You will need to hack your Moodle a little. The important part in Paul's word is the following

So, try this out if you like: edit the file filter.php in /mod/glossary. Locate function glossary_dynamic_link, which is right near the top and right after the line with 'global $CFG' put

        // Nolink for quizzes (or any other word in the path you like)

        // $_SERVER['REQUEST_URI'] looks like e.g. : /mysite/mod/quiz/view.php?id=21
        if (strpos($_SERVER['REQUEST_URI'], "/quiz/")) {
            return $text;
        }

Or again as Paul writes further down (in Plain English):

if NOT condition(s) met:
return the text
else
filter it

I think that this MAY be the following in php if you only want to filter the resources. Note the exclamation mark at the beginning.

        if (!strpos($_SERVER['REQUEST_URI'], "/resource/")) {
            return $text;
        }

But perhaps this at the top
        if (strpos($_SERVER['REQUEST_URI'], "/resource/")) {

And then find the place to put a "}" immediately before the final "}" in the subroutine as it stands.  

Then peraps the following would work.

        if (strpos($_SERVER['REQUEST_URI'], "/resource/") OR strpos($_SERVER['REQUEST_URI'], "/glossary/")  ) {

......

}

I never got around to implementing except very breifly, because I found that just adding (large) glossaries to my (many) courses seemed to slow things even without quiz linking. Perhaps when there is a php accelerator on my server?

Tim

In reply to Timothy Takemoto

Re: How do I disable Glossary autolinking to Quiz items?

by Paul Evans -
Dear Tim,

Sorry to bother you again, but how many is 'many' courses in this instance?

I only have a couple of dozen at the moment, but that's due to more than double soon, so I'd appreciate a heads up on coming problems before they happen to me.

Also, by a 'large' glossary do you still mean around 500 entries? Or do I have that wrong? (if I am wrong, I hope it's by an order of magnitude smile )

No hurry on any reply. cheers.
In reply to Paul Evans

Re: How do I disable Glossary autolinking to Quiz items?

by Timothy Takemoto -
Dear Paul

Sorry to be a year late responding to this.

I still only have 22 + 1 classes, which is quite a lot to me, so you already have more than me. My glossary contained only about 800 entries I think, (I am still not using it) not 5000.  Did your 500 word glossary autolink okay?

Please let me know how it went with nearly 50 courses and a big glossary.
I will send this to you by email since you are no longer enrolled. The address was in the google cache.

I should do the hack the glossaries and link them only to resources.

Timothy
In reply to Timothy Takemoto

Re: How do I disable Glossary autolinking to Quiz items?

by Larry Zoumas -
First the good news! Thanks for the help on this criticalk issue for my Moddle installation. I thought I was going to have to go <<nolink>> crazy. Every time I seem to have a question there is a cool and concise answer. Everyone in the Moodle Community is awesome tongueout.

Now the bad news... it doesn't make any sense to have glossary terms hyperlinked in the quizzes. This is not a feature it is a bug. For those who are afraid to hack their PHP code I feel a deep sympathy and someone should really look into making automatic glossary linking in the quiz a deprecated 'feature'. I mean... I can't even think of a single reason why someone would want to do that unless their quizzes.

My $.02


In reply to Larry Zoumas

Re: How do I disable Glossary autolinking to Quiz items?

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Larry,

>Now the bad news... it doesn't make any sense to have glossary terms hyperlinked in the quizzes. This is not a feature it is a bug.

I beg to disagree with you here.thoughtful In fact it all depends what you are using quizzes for. Personally I have not much use for the quiz as a testing tool, I use it mostly as a learning tool (see this discussion). Although I admit to <nolinking> some items in my quizzes, most of the time I want to have the links on, if only to encourage my students to click and get some "glossary" help before answering the question at hand.

What would be nice, howevever, would be an option attached to question create/edit mode, whereby <nolinking> could be ticked on/off. More work for poor Gustav.sad

Joseph

In reply to Joseph Rézeau

Re: How do I disable Glossary autolinking to Quiz items?

by Deb Burdick-Hinton -
Hello Joseph-
Just curious: Is there a Moodle Tool that you use for "testing" if you do not use the quiz tool in this way?
In reply to Deb Burdick-Hinton

Re: How do I disable Glossary autolinking to Quiz items?

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Debra,
Easy answer: all of my Moodle courses (even the few which are totally online, with no face-to-face classes) are tested in a "regular" exam set-up (paper & pen) at the end of term at the university. But I also take into account (for the final mark) all the work done online: Hot Potatoes quizzes, Quizzes and Lessons, participation in Forums, a few Assignments, etc. What I mean is that I am not too worried about "cheating" when the students take the quizzes, because Quiz results are only a small fraction of the final result.
Hope I made that clear,
Joseph
In reply to Larry Zoumas

Re: How do I disable Glossary autolinking to Quiz items?

by Timothy Takemoto -
Dear Larry,

For my own usage I agree with you, but I think that Joseph represents the authordox Moodle view here below. Things are not made to be hidded from students in standard Moodle installations (other than where there are privacy concernts). Quizzes (nota bene the name, not "exams", not "tests") are were designed primarily for learning, self testing, and fun.

That said, I still do plan to hack my moodle in this way. Did you make the above work? To be honest I have not yet done so myself.

Timothy 
In reply to Timothy Takemoto

Re: How do I disable Glossary autolinking to Quiz items?

by Robert Dickey -

A thought that might satisfy all but the poor developers...

'twould be lovely if the quiz creation page asked

(alongside things like "Shuffle questions: [Yes/No]")

"Glossary linking disabled in this quiz: [Yes/No]"

I use quiz function both for testing (midterm, final) as well as for learning (instead of trying to track time on task [we gave up last year's effort] I now have a reading comprehension question or two for each text (with all choices valued at fullpoints, and feedback on all answers)

Rob

=================
"So much time, so little to do... Wait.  Strike that.  Reverse it."  (Willy Wonka)
In reply to Robert Dickey

Re: How do I disable Glossary autolinking to Quiz items?

by Chris Collman -
Picture of Documentation writers
I agree Rob.   People who use Moodle for certification in training (ie to teachers collecting Continuing Education Units, brain surgeons who have to take a safety course etc) have a different set of needs than most educators.  

More work for our hard working developer.  Perhaps for 1.7 as a quiz setting ?  This would allow those who want glossary to be enabled in a test as part of the educational process to be happy along with the training or certification ilk.   Later today I will check with Moodle Bug and see if this has been put in as a suggestion.

I am also thinking of adding this question as a FAQ in MoodleDocs. I keep thinking someone has actually posted a solution/hack for this beside the link no link option.  

Chris 

"So much time, so little to do.  So little to do, so much time" smile




In reply to Chris Collman

Re: How do I disable Glossary autolinking to Quiz items?

by Stephan Becker -
I have the same problem for a certification course - our glossary gives eveything away in the final exam (quiz). We did the hack in our first course - but I cant find this posting anywhere.

If someone stumbles across it, please post - I need this solution urgently or I have to postpone exams for our second certification course.

Thank you so much,
Stephan
In reply to Stephan Becker

Re: Added Glossary unlinking to quiz in MoodleDocs Thanks Paul

by Chris Collman -
Picture of Documentation writers
Thanks Paul and Timothy for the old threads.  I thought that was going to be hard and even for a bald guy (looks can be deceiving), that was easy!  I just did it in Ver 1.6 on my localhost.  All my lessons showed the autolinks both in branch pages and in questions but none in the quiz!   

I could not find this solution in MoodleDocs.  So I added the following in Quiz FAQ
http://docs.moodle.org/en/Quiz_FAQ#How_can_I_turn_off_glossary_in_a_quiz.3F And added a link on one of the glossary pages, as another way to find this solution. Still can not believe how much reading I did in forums. Now I see Timothy and others have consistantly suggested this in forums but there was so much information, I got lost or thought it would not work in later versions.  

So glad Stephan "forgot", all the best to everyone.