Hope this helps for QUIZ - TIMER - FLOAT
I have a new client that had Moodle V.1.9.x and they loved the FLOATING CLOCK feature when taking a quiz.
I upgrade them to V2.3 and they pointed out the LOSS of functionality.
I am new to Moodle and had no idea that feature existed at one time.Clearly the Quiz Navigation Block did not float in V2.3
So I implemented this brute force bit of code to make the Nav Block always stay in view and only takes a few minutes to install!
If this saves someone research time and/or allows someone to publish a better widget! Great!
I have only tested with IE 9 (64bit), Firefox 14, Chrome. However, seems to work fine, but I am looking for breaks.
This very generic code surgically moves the ".block-region" (name of quiz panel) so the TIME is always in VIEW!
Step#1 Get a copy of Jquery and install in your JS folder (I downloaded and used jquery-1.8.0.min.js)
Step#2 Modify the QUIZ renderer.php program
Note: (CSS [position;fixed;] and other methods did not seem to meet my need of auto scroll)
......root/mod/quiz/renderer.php
In renderer.php Line 289 area! BLUE insert code below (attached also)
/**
* Outputs the navigation block panel
*
* @param quiz_nav_panel_base $panel instance of quiz_nav_panel_base
*/
public function navigation_panel(quiz_nav_panel_base $panel) {
$output = '';
// this output makes the QUIZ nav bar BLOCK Scroll with the questons! .block-region
$output = '<script type="text/javascript" src="/_js/jquery-1.8.0.min.js"></script>
<script language="javascript">
var name = ".block-region";
var menuYloc = null;
$(document).ready(function(){
menuYloc = 0;
$(window).scroll(function () {
offset = menuYloc+$(document).scrollTop()+"px";
$(name).animate({top:offset},{duration:300,queue:false});
});
});
</script>';
$userpicture = $panel->user_picture();
if ($userpicture) {
$output .= html_writer::tag('div', $this->render($userpicture),
array('id' => 'user-picture', 'class' => 'clearfix'));
}
$output .= $panel->render_before_button_bits($this);
$output .= html_writer::start_tag('div', array('class' => 'qn_buttons'));
foreach ($panel->get_question_buttons() as $button) {
$output .= $this->render($button);
}
$output .= html_writer::end_tag('div');
$output .= html_writer::tag('div', $panel->render_end_bits($this),
array('class' => 'othernav'));
$this->page->requires->js_init_call('M.mod_quiz.nav.init', null, false,
quiz_get_js_module());
return $output;
}