Develop a gradable module

Develop a gradable module

by Alberto Lietor Santos -
Number of replies: 1

Hi

I'm trying to develop a new module, i downloaded the newmodule template and i'm adding some stuff but i have a big question, i want my module gradable, in the mod_form i added

$this->standard_grading_coursemodule_elements();

 

but nothing happends, i went to moddleform_mod.php to see what this function do and saw

if($this->_features->hasgrades ...

so i suposed that the problem is this, my module "not hasgrades".

How can i do this?

Thanks a lot

Average of ratings: -
In reply to Alberto Lietor Santos

Re: Develop a gradable module

by Alberto Lietor Santos -

i answer to myself

i found that the variable hasgrade is setted previously by a function called plugin_supports(..), trying to find the clue of this function i'm arrived to that this function read the lib.php to find a function called "modname_supports($feature)", so, i created a the function and assigned values that i want.

i dont know if this is the "correct way" to solve the problem.