General developer forum

Retrieve a manual grade

Picture of Bob Puffer
Re: Retrieve a manual grade
Plugin developersTesters

That documentation doesn't look up-to-date.  Grade schemas don't change all that much and what you're looking for has hardly changed at all since 1.95. You don't mention your version so I'll assume you're wise enough not to be using a version unsupported for security fixes.  In that case your query would be:

$params = array('userid' => $USER->id, 'itemid' => <the itemid from grade_items you want to display>);

$gradeval = $DB->get_record('grade_grades', $params);

Average of ratings: -
Picture of Graham Bowman
Re: Retrieve a manual grade

Thanks so much for posting that code. It really helped me. 

I have published my block on github

Average of ratings: -