Posts made by Joseph Rézeau

Picture of Core developers Picture of Plugin developers Picture of Testers Picture of Translators

Hello!

When one clicks on an autolinked word or phrase in a resource text, a "Glossary entry" popup window is displayed. This popup window is created with the following parameters:

menubar=0,location=0,scrollbars,resizable,width=600,height=450

For all types of text resources created online & residing within the Moodle database, i.e. text page, web page & label, the popup window is indeed displayed with those parameters.

However, the appearance of that popup window is not correct when the resource text is an uploaded HTML file.

The reason is as follows: both types of resources are parsed for the detection of terms present in the glossaries and autolink links are then dynamically created, including the parameters mentioned above. So far, so good. But only the resources of "online type" are output as HTML with the appropriate javascript function openpopup(). That function is not added to the <head></head> section of an uploaded HTML file. Consequently, the popup window opens as a "normal" window, complete with menubar, not located in the top-left corner and not sized 600x450.

I posted this as a bug report some time ago but it has not been answered. For anyone irritated by this glossary entry popup window wrong behavior, I can propose 2 workarounds.

Workaround 1: modifying Moodle file \lib\filterlib.php

using latest version 1.5.2, around line 220, just before returning the modified text with autolinks in it, add this:

if (!empty($ignoretags)) {

$text = str_replace(array_keys($ignoretags),$ignoretags,$text);

}

//MODIFIED JOSEPH REZEAU 22 JULY 2005

$nopopupfunction = '</head>';

$popupfunction = '<script language="javascript" type="text/javascript">function openpopup(url,name,options,fullscreen) {var _url = top.location.href;var _start =_url.indexOf("/mod/");var startUrl = _url.substring(0,_start);fullUrl = startUrl + url;windowobj = window.open(fullUrl,name, options);windowobj.moveTo(0,0);windowobj.focus();return false;}</script></head>';

$text = str_replace($nopopupfunction, $popupfunction, $text);

//END MODIF JR

return $text;

caveat: this relies on the presence of a <head></head> section in the uploaded HTML file, i.e. we suppose it is "correct" HTML

Workaround 2: modifying your HTML files

simply add the script for the missing openpopup() function in the head of your HTML FILES before uploading them to your Moodle course; if you have a large number of such files, that function could of course reside in an external *.js file and you would refer to it in the head of all your HTML files. Here is the script:
<script language="javascript" type="text/javascript">
function openpopup(url,name,options,fullscreen) {
var _url = top.location.href;
var _start =_url.indexOf("/mod/");
var startUrl = _url.substring(0,_start);
fullUrl = startUrl + url;
windowobj = window.open(fullUrl,name,options);windowobj.moveTo(0,0);
windowobj.focus();
return false;
}
</script>

I hope this will be useful and am looking forward to your testing it...

Joseph

NOTE: in the scripts above, you will notice that the HTML editor has replaced language with Xlanguage; please remove the superfluous X to make the scripts work...

Average of ratings: -
Picture of Core developers Picture of Plugin developers Picture of Testers Picture of Translators
Thanks for your help, Mike. I followed the link you provide, which at least explains that the culprit is PHP 5.0.4, but I couldn't implement the workarounds suggested for Moodle. Never mind, since this is a local installation I can always find a solution.

However it's hard to believe that such a glaring bug should have made its way into a recent version of PHP...angry
Picture of Core developers Picture of Plugin developers Picture of Testers Picture of Translators
Hello!

The question of maximum upload file size has often been asked & answers provided on this forum.

However, I have been surprised to find out that there seems to be a maximum download file size limit of 2Mo as well.

I am using Moodle 1.5 on a local installation on my own computer, with Apache/2.0.54 (Win32) PHP/5.0.4... I have set the upper limit for uploading files to my Moodle courses to 100Mo. Recently I did a backup of a course which yielded a file of about 6Mo. I want to download that file from the Apache/Moodle server to another place on my computer. Either in MSIE or Firefox, clicking or right-clicking on the filename in "My Files" and selecting a directory for downloading on my computer seems to work... but then I discover that the file has been truncated to its first 2Mo and is of course unreadable.

This is not a zip problem, I have tried with other types of large files and the result is always the same: files over 2Mo are truncated to 2Mo...

Is this an Apache problem? Do I have to change a parameter somewhere in php.ini ???

Many thanks in advance for your help,

Joseph

Average of ratings: -
Picture of Développeurs Picture of Développeurs de plugins Picture of Testeurs Picture of Traducteurs

Bonjour.

L'incompréhension provient d'un problème de terminologie dans Moodle. Les "cours" créés sur un site Moodle sont des "espaces" attribués à un enseignant et à un groupe d'étudiants.

A l'intérieur d'un espace-cours, un enseignant dépose dans le dossier Mes Fichiers les divers documents qu'il a l'intention d'utiliser pour son cours. Ces ressources peuvent être des fichiers HTML, DOC, powerpoint, flash, etc. Pour intégrer ces "ressources" au cours, l'enseignant, en mode édition, fait le choix Ajouter une ressource/Lien vers un fichier ou un site web...

Lorsque D. Bodin (et Nicolas) parlent de "leçon", il s'agit de quelque chose de tout à fait différent. Dans la terminologie de Moodle, une "leçon" est une "activité" créée à l'intérieur de la base de données de Moodle, en ligne, grâce à l'outil Ajouter une activité/Leçon. Une "leçon" de Moodle consiste en une suite de pages d'écran, pouvant comporter du texte, des questions de type QCM, etc.. Le passage d'une page à la suivante peut être conditionné par la réponse correcte aux questions posées. Le mode de fonctionnement de la "leçon" dans Moodle est de type Crowdérien bien connu dans les milieux de l'enseignement programmé, depuis ... près de 60 ans.wink

Pour répondre à la question de D BODIN,je pense comme Nicolas qu'il faudrait que l'enseignant:
  • dépose l'applet java dans un dossier de "mes fichiers";
  • à l'endroit précis où on a besoin de cette applet dans une page d'une "leçon" Moodle, mettre un lien vers l'URL de cette applet.
Comme je n'y connais rien en applet java, je laisse Nicolas et les autres tester la solution...

Joseph

Moodle in English -> General help -> Shared folder -> Re: Shared folder

by Joseph Rézeau -
Picture of Core developers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Teemu!

What exactly do you mean by "Everybody can see the images and documents when they have been added to the front page." ? Actually, the problem with accessing those site files is that there is no way an admin can make site folders or sub-folders visible to either teachers or students. As far as I know the only way teachers or students can link to, e.g. pictures made available by admin in a site/images folder is if admin has made their URL available, but how?

What we are missing in Moodle is a "site files" block which admin would make available on the front page (and, possibly, on the welcome page of all courses)... This would be similar to the existing resource tool "Display a directory" available to course teachers...
But what exactly would be the usefulness of such site files, I wonder.

Well, I can think of one use: admin could make available to everyone a set of logos and icons related to the site institution or of general use, which teachers & students might thus be able to include in their forum posts, etc. Something like the set of smileys that is available in the HTML editor now.

Joseph

PS Anyway I do not think that site files would solve the problem that this thread is about, viz. the problem of shared ressources between courses...