Getting maxscore while creating content or onload the activity

Forums: 

Hi,

Is it possible to calculate max score when creating the content with the editor or during viewing the content before submiting the answer.

What i need to achieve from my end is i need to send total score of the activity so student can see total score.

otacke's picture

Hi!

The maximum score is not available when creating the content, but when the content is viewed (see getMaxScore function, should be implemented by most to all contents that deal with scores).

Best,
Oliver

Yeah but for some contants getMaxScore is not available. For that what we need to do?

otacke's picture

If `getMaxScore` is not available, then either that content type does not generate scores at all and and thus does not need that function or the author did not implement that function. In the latter case, you'd have to implement that function and create a pull-request.