Activities checked off as students complete them?

Re: Activities checked off as students complete them?

by Gordon Bateson -
Number of replies: 5
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

To display QuizPort grades on a Moodle 1.9 (or earlier) course page, you need one extra file, "courselinks.js.php", which I will send to all the people who have bought a single or institutional license for QuizPort.

  1. put the "courselink.js.php" file into the "mod/quizport" folder on your server
  2. login to Moodle as course teacher or admin
  3. go to your Moodle profile page then ...
    • click "Show advanced"
    • set "When editing text" to "Use standard Web forms"
    • click "Save changes" at t he bottom of the page
  4. go to the course where you want to show QuizPort grades on the course page
    • switch course page into edit mode
    • click the edit icon for the very top section (=topic or week) of the course
    • insert the following javascript code:
      <script type="text/javascript">
      //<![CDATA[
      var src = location.href.replace(new RegExp('^(.*?)/course/view.php.*$'), '$1');
      src += '/mod/quizport/courselinks.js.php?id=';
      src += location.href.replace(new RegExp('^.*?id=([0-9]+).*$'), '$1');
      src += '&rnd='+Math.ceil(10000*Math.random())+'&showgrades=1';
      document.writeln('<scr'+'ipt type="text/javascr'+'ipt" src="'+src+'"></scr'+'ipt>');
      //]]>
      </script>
    • click "Save changes" at the bottom of the page

That's it! Next time you view the course page, the QuizPorts will display their color coded grades.

Be careful not to edit the summary for the top section of your course with the Moodle editor or it will mess up the javascript.

Be aware that showing grades on the course page requires some extra database queries each and every time the course page is displayed, and there is some delay (usually less than a second) in the student's browser between the page loading and the grades appearing.

I will send you the courselinks.js.php file in the near future.

best regards
Gordon

In reply to Gordon Bateson

Re: Activities checked off as students complete them?

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
I have modified the Javascript in my original post, so it does not use so many variables, as it was this was found to cause Moodle's Glossary autolinking filter to attempt to modify the Javascript which caused the QuizPort grades not to show.

Gordon
In reply to Gordon Bateson

Re: Activities checked off as students complete them?

by Nicholas Walker -

My students keep asking if I can get Moodle to display the other grades on the course page in the same manner as the much appreciated code above does for Quizport in 1.9.15. 

Is there someone out there with the coding skills and time to write the additional script to display Assignment and Quiz grades also? I will gladly pay for the custom code. 

In reply to Nicholas Walker

Re: Activities checked off as students complete them?

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Nick,
actually, as long as you already have the mod/quizport/courselinks.js.php script, then you already have all that you need.

Try inserting the following javascript into the very top section of your course:

<script type="text/javascript">
//<![CDATA[
var src = location.href.replace(new RegExp('^(.*?)/course/view.php.*$'), '$1');
src += '/mod/quizport/courselinks.js.php?id=';
src += location.href.replace(new RegExp('^.*?id=([0-9]+).*$'), '$1');
src += '&rnd='+Math.ceil(10000*Math.random());
src += '&showgrades=1';
src += '&showaverages=1';
src += '&displayasblock=1';
src += '&mods=assignment,quiz,quizport';
document.writeln('<scr'+'ipt type="text/javascr'+'ipt" src="'+src+'"></scr'+'ipt>');
//]]>
</script>

If you have other types of activity whose grades you would like to display on the course page, then just add them to the list after "mods="

The "showaverages" switch will show the average grade for each activity on the course page when viewed by the teacher. Students will only ever see their own grades - of course smile. I have found this provides a useful way for the teacher to see how the class as a whole is progressing through the course. I sometimes show my course page to the whole class, so that each student can get an idea of how they are doing compared to the class average.

enjoy!
Gordon

In reply to Gordon Bateson

Re: Activities checked off as students complete them?

by Jim Ranalli -

Great feature, Gordon! 

If I wanted to change the color-coding, could I do so? 

On my strategy instruction course, users are required to retake each QuizPort until they get a score of 80% or higher. So I'd like just two color designations: red for 79% or below, and green for 80% or above. 

Thanks as always,

Jim

In reply to Jim Ranalli

Re: Activities checked off as students complete them?

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Jim,
glad you like the color-coded grades.

Although there is no GUI for changing the grade boundaries and colors, you can change them if you alter a couple of files in the "/mod/quizport" folder on your server.

  • To change the colors, open "/mod/quizport/styles.php" and search for the following identifiers:
    • quizportlowgrade
    • quizportmediumgrade
    • quizporthighgrade
  • To change the grade boundaries, open "/mod/quizport/courselinks.js.php" and  search for the following numbers:
    • 90
    • 60

regards
Gordon