Moodle 3.2: Gradebook not visible in course administration block?

Re: Moodle 3.2: Gradebook not visible in course administration block?

by Neil Stapleton -
Number of replies: 0

So there's been a lot of activity on this over the last few days, and I think the work that's been done to correct and updating guidance and documentation is very helpful to overall understanding and the future (big thanks Mary & Helen).  It doesn't really help those of use who initially missed the change in the first place, and have taken the plunge to 3.2 and still have the issue.

I though I'd share with you what we've ended up doing as a work around to keep our users happy for the time being and avoid adding the Nav blcok back in.

We've added a persistant block containing a client side script (javascript) that looks at the URL and when the page it a course main page it captured the course ID and outputs a 'Grades' link.

Now I'm not saying this is the right way to go and it is far from an ideal solution, it's just what's worked for us in our particular use case. I am also fully aware it's fraught with potential issues from a UX design perspective, that said, so far the phone calls and emails have stopped and it appears to be working for our users. So I thought is was work sharing.

This does obviously mean you need to allow Javascript within an HTML block and anyone looking to do this should make sure you understand how to do this and the associated risks.

Here's the code we used:

<a id="link" href=""><b><span id="txt" style="font-size: 1.2em;"><br></span></b></a>
<script>
function getUrlVars() {
var vars = {};
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
vars[key] = value;
});
return vars;
}

var id = getUrlVars()["id"];
var u = "/grade/report/index.php?id=";

if (window.location.href.indexOf("course/view.php?id=") != -1){
  document.getElementById("txt").innerHTML = "Grades";
  document.getElementById("link").href = u.concat(id);
}else{
  document.getElementById("txt").innerHTML = "";
  document.getElementById("link").href = "";
}

</script>


This is how it looks on a course page


...and this is how it looks anywhere else (pretty unobstrusive)