Tim, do you think it would be feasible to have a css file in a course level (located in the Files section of the course) to allow those who wish and have some familiarity with css (and really, anyone who works with a course site should be able to acquire some basic css skills) to apply their stylistic preferences to their course over and above the sometimes inaccessible (admin restricted) theme? I know a lot of work is done on a theme editor but if that editor is in the admin level it might not be of much help to lowly course instructors whose admins (particularly in large institutions) are too busy or cautious or what not to apply desired course apecific styles.
Itamar Tzadok
Publicaciones hechas por por Itamar Tzadok
Might be possible with 'window.setTimeout'. To each quiz you can insert some javascript which sets the window's timeout to 5 minutes after which the page is redirected to the next quiz. The javascript can be inserted to an otherwise empty description question. The quizzes themselves close after 5 minutes so they can't be revisited. Just a thought.
Can be done with cloze questions. See http://moodle.org/mod/forum/discuss.php?d=96799 for discussion.
Here is some cross-browser code I found but haven't tried. Note that for IE you need to call window.attachEvent. Further explanation should be available in the following link: http://www.digital-web.com/articles/seven_javascript_techniques/
Hope that helps.
Hope that helps.
- var addListener = function() {
-
if ( window.addEventListener ) {
-
return function(el, type, fn) {
-
el.addEventListener(type, fn, false);
-
};
-
} else if ( window.attachEvent ) {
-
return function(el, type, fn) {
-
var f = function() {
-
fn.call(el, window.event);
-
};
-
el.attachEvent('on'+type, f);
-
};
-
} else {
-
return function(el, type, fn) {
-
element['on'+type] = fn;
-
}
-
}
-
}();
Here is how I do that. For the list view template I have three js functions (listHeaderTmpl, listBodyTmpl, listFooterTmpl) stored in a js file located in the Files section of the course site. In each function I create and return a string consisting of a part of an HTML code for displaying the list of items in a table. So the header function returns a string containing the open tag of a table and the header row; the body function returns a string containing an item's row; the footer function closes the table. These functions are called in the corresponding template sections and their returned values are collected in a string which is then dumped into the innerHTML of a div element.
In the header section of the template:

In the header section of the template:
- Create an identified (by id) div element.
- In a script tag include the js file containing the functions.
- In a script block define a literal and assign to it the string returned by the header function (e.g. var strHtml=listHeaderTmpl()).
- In a script block add to the same literal from above the string returned from the body function; pass the song value to the function (e.g. strHtml+=listBodyTmpl('SONG').
- you can check the value of song in the function and decide whether or not to add the item to the list. If you don't want to add the item you simply return an empty string; otherwise you return the html of a table row, e.g.
- function listBodyTmpl(song){
- var str="";
- if (song!=""){
- str='<tr><td>'+song+'</td></tr>';
- }
- return str;
- }
- How you pass the field's value to the function depends on the characteristics of the expected value. Simple string values shouldn't pose any problem. See my previous post.
- In a script block add to the same literal from above the string returned from the footer function (e.g. strHtml+=listFooterTmpl()).
- Assign the literal to the innerHTML of the div element you created in the header section (e.g. document.getElementById('itemsList').innerHTML=strHtml;)