Poster lagt til av Itamar Tzadok

I use the following javascript for moving the list of courses from the main (middle) column to an HTML block in the right column. If there are courses I don't want to see I add their names to the hideCourses regular expression and they are not added to myCoursesBlock when in normal (not edit) mode (which means that if I want to see the whole list I simply change to edit mode). In the code below I just copy whatever is there but it can be easily modified to add to the list of courses only the course name with the link to the site and omit all the rest (I had to do that in our previous Moodle when the list of courses got bigger and bigger and there were all these assignments) And just in case you wonder why I move the list to the side, it is because I put in the middle an iframe with my own website and so I have an integrated working environment. Hope that helps. smiler

  • // detect edit mode
  • var arTmp=document.getElementsByTagName("body");
  • var theBody=arTmp[0];
  • var editMode=theBody.className.search(/editing/gi);

  • var middleColumn=document.getElementById("middle-column");
  • var hideCourses=/nothing/g;
  • var myCoursesBlock=document.getElementById("CoursesBlock"); // that's a div element in an HTML block in the right column
  • var courseObjs=middleColumn.getElementsByTagName("div");
  • for (i=0;i<courseobjs.length;i++)>
    • if (courseObjs[i].className.search("coursebox")!=-1){
      • if (courseObjs[i].innerHTML.search(hideCourses)!=-1 && editMode==-1) {
        • //do nothing
      • } else {
        • myCoursesBlock.innerHTML+='<div class="coursebox courseboxcontent" valign="top">'+courseObjs[i].innerHTML+'</div>';
      • }
    • }
  • }
My way of using the quiz may not be the most common but at any rate here is how it works. I have weekly quizzes in which some problems may take several days to solve, that is, several days until one "sees the light" (even when working in groups). Consequently, I make each quiz available to students for a whole week so that they could work out the problems in stages. Since I allow only one attempt, just to avoid accumulated attempts, I need the save without submitting option which allows students to ... well ... save their work without submitting until they are ready to submit. smiler
Gjennomsnittlig vurdering:Useful (1)
You can try setting the time limit of the quiz so that once a student attempts the quiz she has, say, 20 minutes to complete it, after which the quiz is submitted automatically. Another way involves hacking the php code to hide the 'save without submitting' button and yet another way is to hide the button with javascript. Hope that helps. smiler