Archive for the ‘Moodle Stuff’ Category

Moodle – IE8 Issues empty anchors

Moodle – IE8 Issues empty anchors

See: http://tracker.moodle.org/browse/MDL-18232
Issue: The section links block in Moodle is broken when using IE8.  The issue is that IE8 can’t have named anchors to blank sections.

Won’t work.
<a id=”gohere”></a>
<a href=”#gohere”>Go There</a>

Will work
<a id=”gohere”>HERE</a>
<a href=”#gohere”>Go There</a>

The fix is to add something to the anchor.  The problem is that doing so this (in Moodle) then beaks the sharing cart block, which I love.  To save both:

The suggested change of these lines in format.php:

Before:
echo ‘<tr id=”section-‘.$section.'”>’;
echo ‘<td> ‘.$currenttext.'</td>’;

After:
echo ‘<tr>’;
echo ‘<td id=”section-‘.$section.'”> ‘.$currenttext.'</td>’;

Does fix the empty tag for IE8 issue.

But, it breaks the sharing cart block locations for all sections>0. To fix this, I added a NEW ID for the section links (see below).
To fix this, without breaking sharing cart:

Before in format.php:
echo ‘<tr id=”section-‘.$section.'”>’;
echo ‘<td> ‘.$currenttext.'</td>’;

After in format.php:
echo ‘<tr id=”section-‘.$section.'”>’;
echo ‘<td id=”sectionblock-‘.$section.'”> ‘.$currenttext.'</td>’;

then in blocks/section_links/block_section_links.php
change line 76 from:

$link = ‘#section-‘;
to
$link = ‘#sectionblock-‘;

In summary – DON’T touch:
echo ‘<tr id=”section-‘.$section.'”>’;
as the sharing cart block needs it

Just a change:
echo ‘<td> ‘.$currenttext.'</td>’;
to
echo ‘<td id=”sectionblock-‘.$section.'”> ‘.$currenttext.'</td>’;
adding a new ID to it (i called it sectionblock) and then edit your sectionlinks block to look for this ID.

Moodle – Quiz timeouts

Moodle – Quiz timeouts

See: http://tracker.moodle.org/browse/MDL-11972
Issue: Student opens a long quiz in Moodle, opens the page and starts working on the quiz.  If nothing gets sent to the server within 2 hours (limited by admin config and mysql session.gc_maxlifetime) then the student gets a timeout message and all data is lost. 

Fix: Fix appears to have the student “send something” to the server to keep session alive.  So I added the text below to warn students to do something.  This appears at the top of all quizzes.

Location: /mod/quiz/attempt.php

around line 490 add:

/// Warning
echo ‘ <div style=”margin-left:50px; margin-right:50px;”>PLEASE READ:   There is a <b>2 HOUR session inactivity timeout</b> build into this course.  This means that you must select the <b>Save without submitting</b> or <b>Submit all and finish</b> buttons at the bottom of this quiz page within a 2 hour window, otherwise, your work will be lost.  Alternatively, the 2 HOUR session limit is also reset  EACH time you  load the next quiz page, or load any other page or item from any of the courses.  NOTE: Simply selecting quiz answers <b>DOES NOT</b> reset the 2 hour time limit.</div> ‘;

Looks like this now: