Publicaciones hechas por por Itamar Tzadok

These are really bad news. sad I do that all the time and if it is a new "feature" (I suspect the reason would be security) then it's going to be tough come next academic year and Moodle 1.9.

Here is a workaround but it's a little bit dangerous because it can mess up the page so if you use it do it with caution. You add a label before and after the resource item (or group of items) you want to highlight. In the lower label you insert script which does document.write('</font>') and in the upper label you insert script which does document.write('<font size=...>') (that is, if they haven't taken scripts away too mixed). You should start from the closing tag. If you start from the opening tag you will have an unclosed tag in the page which might prevent everything under it from functioning properly.

As a safety measure you can add an empty label at the top so that if things go wrong you can use that label for running a script to find and replace the messed up part (I learned that by experience, unpleasant experience; but then again I'm here to tell you about it smile)

I hope it is just a bad dream... thoughtful

Itamar
Hi Cory,

What I used to do in such cases is set the number of topics to display only the relevant topics. So if my resources were in the fifth I set the number of topics to 4. Yes, when I needed to add a resource I had to go to the course settings, set the number of topics to 5, add the resource and then change the settings again. Not very elegant but in courses which had a stable predefined structure this solution worked reasonably well.

An alternative way which I started to use recently for a slightly different purpose but should work in this case too is to show the topic block only in editing mode. I add to course sites an html block in the bottom right corner. In this block I insert javascript which detects whether the page is in editing mode, and if it is not, I set the style.display of certain sections on the page to 'none' so that they are not displayed when not in editing mode which means that even I don't see them and bothered by their ugliness when I don't need to make changes in them.

Now, you can get the editing mode from the body tag by
// detect edit mode
var arTmp=document.getElementsByTagName("body");
var theBody=arTmp[0];
var editMode=theBody.className.search(/editing/gi);

A topic section is a tr tag with id 'section-n' so you can access it from the script and set its style.display as desired.

Finally, I currently work on 1.6.3 so I don't know if this solution works on 1.9 although I don't see any reason why not.

I hope that helps sonrisa

Itamar
One more thing sonrisa An alternative way to access the official answer box without tracking its name is by placing it in a known position relative to an identified html element in the question and navigating the DOM hierarchy.
The official answer box can be hidden by placing it in a a div tag with style="visibility:hidden".

The image below shows that in a hidden kind of way. For each row there is an official answer box in the right most column which you cannot see because it is hidden so you'll have to take my word for it. parpadeo

Notice the buttons which allow a student to validate an answer, display the correct answer and reset the fields. The buttons call javascript functions and pass relevant parameters to them. The functions do not reside in the question but rather in the "back-end" of a description question (which otherwise is empty) so that they can be called by multiple questions in the same quiz page without code duplication and conflicts.

This question was used for practice so the quiz assessment was not necessary in that case. Disabling the validation and display buttons can turn the question into formal assessment. Or disabling only the display button may allow a student to keep trying until the answer is figured out or time's up.

The image shows the question view after clicking 'Validate' which indicates a wrong answer in line 6.

dr-cmp-prc.jpg