Joseph Rézeau による投稿

画像 Core developers 画像 Plugin developers 画像 Testers 画像 Translators
Yes, Gustav, "a lot has already been said in this thread", which goes to show that navigation is an important usability topic.
I don't care much whether one calls the Moodle bar "navigation" or "breadcrumbs", but there is one point I do care about, and that is the name of a resource being displayed as a hyperlink at the end of the navigation line where it should be displayed as plain text.

What I mean is that the navigation line I have at the top of the screen right now looks like this: "Moodle » Using Moodle » Forums » Course formats » Back button at the bottom please???? » Editing" where Editing is where I am (and what I am doing) and thus correctly displayed as plain text.
Similarly, in one of my Moodle courses, in the Activities block, if I click on Resources, I can see the navigation line: "CURSUS >> English for Art >> Resources" which is correct, as I am now viewing a list of the Resources available in my course.

On the other hand, if I click on the name of one of those resources in the list, e.g. Text_1, then the page Text_1 is displayed. I always choose
Put resource in a frame to keep site navigation visible
But then the navigation bar is displayed thus:
"
CURSUS >> English for Art >> Resources >> Text 1" which means that Text 1, is a hyperlink, so that the very page I am reading is considered as somewhere I can navigate to... I fail to see the logic behind this behaviour, which I call a plain bug but which Martin calls a "feature" (see http://moodle.org/mod/forum/discuss.php?d=9690#53095). What is worse is that should a student inadvertently click on that Text 1 link, the Text 1 page is opened in a new window, thus loosing the Moodle site navigation and defeating the very reason why I selected that option in the first place angry !
画像 Core developers 画像 Plugin developers 画像 Testers 画像 Translators
Dear Gordon,
Thanks for your reply and your offer to help. The mystery has now been solved, and it has nothing to do with the Hot Potatoes file itself.
You can read all the details in my post http://moodle.org/mod/forum/discuss.php?d=19269

By the way I have just started testing your new HotPotatoes module and I like it a lot. Well-done!

Joseph_R
画像 Core developers 画像 Plugin developers 画像 Testers 画像 Translators
Oops!
I have just realised that the bug I mentioned in my previous post means that Thomas's HotPot module will not work with HP exercises saved as 2 separate files (HTML & JS)...
Which means that a proper solution still has to be found for the situation described, i.e. single HTML HP file not working in some conditions on a moodle platform...

Joseph_R
画像 Core developers 画像 Plugin developers 画像 Testers 画像 Translators
Hello!
After a whole day spent trying to pinpoint an incomprehensible bug in an uploaded Hot Potatoes exercise, I have finally found the culprit.
  • It so happens that in the glossary of one of my English courses I have an entry for "while" (alongwith whereas, however and a number of so-called link-words...).
  • My HP exercise - uploaded as a resource - is an HTML file which contains a Javascript script containing a number of while loops.
  • Upon loading that HP exercise, \moodle\mod\glossary\filter.php dutifully tags all occurences of while in the script with links to the Glossary.
  • The result is that the script is ruined and will not work...angry
Suggested solution
In \moodle\mod\glossary\filter.php: after
//Now avoid searching inside the <nolink>tag
$excludes = array();
preg_match_all('/<nolink>(.+?)<\/nolink>/is',$text,$list_of_excludes);
foreach (array_unique($list_of_excludes[0]) as $key=>$value) {
$excludes['<+'.$key.'+>'] = $value;
}
if (!empty($excludes)) {
$text = str_replace($excludes,array_keys($excludes),$text);
}
add a section:
//Now avoid searching inside the <script> tag
$excludes = array();
preg_match_all('/<script>(.+?)<\/script>/is',$text,$list_of_excludes);
foreach (array_unique($list_of_excludes[0]) as $key=>$value) {
$excludes['<+'.$key.'+>'] = $value;
}
if (!empty($excludes)) {
$text = str_replace($excludes,array_keys($excludes),$text);
}
Problem
Avoiding searching inside the <script></script> tag solves the problem of resources containing Javascript scriptssmile, but... it ruins the display of the Glossary itself, replacing all entries with <+0+> evil

Of course, one might always rely on the fact that conscientious programers (including the HP crowd cool) will have all their scripts enclosed not just in <script></script> tags but more likely in <script type="text/javascript"></script> tags. In which case the preg_match_all line above should read:
preg_match_all('/<script type=\"text\/javascript\">(.+?)<\/script>/is',$text,$list_of_excludes);
and all would be well... but what about the overconsciencious programers who would have used a <script type="text/javascript" language="javascript"></script> tag ?

Whilst we are at it, may I suggest that \moodle\mod\glossary\filter.php should also avoid searching inside the <head></head> tags of uploaded HTML files? That would solve the problem for any Javascript scripts located within the <head></head>, but would not consider the case of scripts located within the <body></body> itself (yes, it does happen...)

Provisionally, of course, I have been able to solve the problem by including the offending <script></script> inside Moodle's own <nolink></nolink> tag. But this cannot be a long-term solution, as one a) cannot hope that no reserved Javascript term will ever be absent from someone's Glossary b) and cannot  expect all HP users to add a <nolink></nolink> tag to their HP files...

I'm certain that the Moodle gurus will come up with a workable solution soon.wink

All the best,

Joseph_R

Moodle in English -> Glossary -> Glossary lookup not saved in activity database?

- Joseph Rézeau の投稿
画像 Core developers 画像 Plugin developers 画像 Testers 画像 Translators
Hello!
As part of my research into learning strategies I'm interested in tracking as much of my students' activity in my Moodle courses as possible.
I would very much like the Glossary module to track the students look-up of Glossary entries, not especially those look-ups resulting of a browsing activity but more those resulting from clicking the hyperlinked words in Resource texts.
Would this be feasible in a further version of the Glossary module? Or could it be done with some hacking (in Javascript rather than PHP?)

Thanks in advance

Joseph_R