Function: setGrade()
function setGrade(
context,
siteUrl,
courseId,
itemId,
userId,
__namedParameters
): Promise<{
changed: string;
grade: GradebookGrade;
}>;
Defined in: areas/grades/singleview.ts:123
Sets a person's grade in a grade item through the gradebook's single view report, as a teacher
does there: a manual item takes the grade; an activity's or a category's is overridden (Moodle
keeps the override until it's taken off with override: false). Feedback and excluding from
the totals go the same way. Returns a sentence of what changed and the grade afterwards.
Throws GradebookError when the item or the person isn't in the course's gradebook, the grade
is locked, or Moodle refuses the value (out of range, a scale item it doesn't have).
Parameters
| Parameter | Type |
|---|---|
context | BrowserContext |
siteUrl | string |
courseId | number |
itemId | number |
userId | number |
__namedParameters | SetGradeOptions |
Returns
Promise<{
changed: string;
grade: GradebookGrade;
}>