Namespace: microsoft.graph
Important
APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Create a new educationGradingScheme on an educationClass. Only teachers can perform this operation.
This API is available in the following national cloud deployments.
| Global service |
US Government L4 |
US Government L5 (DOD) |
China operated by 21Vianet |
| ✅ |
❌ |
❌ |
❌ |
Permissions
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
| Permission type |
Least privileged permissions |
Higher privileged permissions |
| Delegated (work or school account) |
EduAssignments.ReadWriteBasic |
EduAssignments.ReadWrite |
| Delegated (personal Microsoft account) |
Not supported. |
Not supported. |
| Application |
Not supported. |
Not supported. |
HTTP request
POST /education/classes/{id}/assignmentSettings/gradingSchemes
Request body
In the request body, supply a JSON representation of an educationGradingScheme object.
Response
If successful, this method returns a 201 Created response code and an educationGradingScheme object in the response body.
Examples
Request
The following example shows the request.
POST https://graph.microsoft.com/beta/education/classes/de45722a-c202-43a9-9dd5-d82c45bcef91/assignmentSettings/gradingSchemes
Content-Type: application/json
{
"displayName": "PassFailScheme",
"grades": [
{
"displayName": "Pass",
"minPercentage": 70,
"defaultPercentage": 90
},
{
"displayName": "Fail",
"minPercentage": 0,
"defaultPercentage": 50
}
]
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new EducationGradingScheme
{
DisplayName = "PassFailScheme",
Grades = new List<EducationGradingSchemeGrade>
{
new EducationGradingSchemeGrade
{
DisplayName = "Pass",
MinPercentage = 70f,
DefaultPercentage = 90f,
},
new EducationGradingSchemeGrade
{
DisplayName = "Fail",
MinPercentage = 0f,
DefaultPercentage = 50f,
},
},
};
// To initialize your graphClient, see https://free.blessedness.top/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Education.Classes["{educationClass-id}"].AssignmentSettings.GradingSchemes.PostAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewEducationGradingScheme()
displayName := "PassFailScheme"
requestBody.SetDisplayName(&displayName)
educationGradingSchemeGrade := graphmodels.NewEducationGradingSchemeGrade()
displayName := "Pass"
educationGradingSchemeGrade.SetDisplayName(&displayName)
minPercentage := float32(70)
educationGradingSchemeGrade.SetMinPercentage(&minPercentage)
defaultPercentage := float32(90)
educationGradingSchemeGrade.SetDefaultPercentage(&defaultPercentage)
educationGradingSchemeGrade1 := graphmodels.NewEducationGradingSchemeGrade()
displayName := "Fail"
educationGradingSchemeGrade1.SetDisplayName(&displayName)
minPercentage := float32(0)
educationGradingSchemeGrade1.SetMinPercentage(&minPercentage)
defaultPercentage := float32(50)
educationGradingSchemeGrade1.SetDefaultPercentage(&defaultPercentage)
grades := []graphmodels.EducationGradingSchemeGradeable {
educationGradingSchemeGrade,
educationGradingSchemeGrade1,
}
requestBody.SetGrades(grades)
// To initialize your graphClient, see https://free.blessedness.top/en-us/graph/sdks/create-client?from=snippets&tabs=go
gradingSchemes, err := graphClient.Education().Classes().ByEducationClassId("educationClass-id").AssignmentSettings().GradingSchemes().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
EducationGradingScheme educationGradingScheme = new EducationGradingScheme();
educationGradingScheme.setDisplayName("PassFailScheme");
LinkedList<EducationGradingSchemeGrade> grades = new LinkedList<EducationGradingSchemeGrade>();
EducationGradingSchemeGrade educationGradingSchemeGrade = new EducationGradingSchemeGrade();
educationGradingSchemeGrade.setDisplayName("Pass");
educationGradingSchemeGrade.setMinPercentage(70f);
educationGradingSchemeGrade.setDefaultPercentage(90f);
grades.add(educationGradingSchemeGrade);
EducationGradingSchemeGrade educationGradingSchemeGrade1 = new EducationGradingSchemeGrade();
educationGradingSchemeGrade1.setDisplayName("Fail");
educationGradingSchemeGrade1.setMinPercentage(0f);
educationGradingSchemeGrade1.setDefaultPercentage(50f);
grades.add(educationGradingSchemeGrade1);
educationGradingScheme.setGrades(grades);
EducationGradingScheme result = graphClient.education().classes().byEducationClassId("{educationClass-id}").assignmentSettings().gradingSchemes().post(educationGradingScheme);
const options = {
authProvider,
};
const client = Client.init(options);
const educationGradingScheme = {
displayName: 'PassFailScheme',
grades: [
{
displayName: 'Pass',
minPercentage: 70,
defaultPercentage: 90
},
{
displayName: 'Fail',
minPercentage: 0,
defaultPercentage: 50
}
]
};
await client.api('/education/classes/de45722a-c202-43a9-9dd5-d82c45bcef91/assignmentSettings/gradingSchemes')
.version('beta')
.post(educationGradingScheme);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\EducationGradingScheme;
use Microsoft\Graph\Beta\Generated\Models\EducationGradingSchemeGrade;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new EducationGradingScheme();
$requestBody->setDisplayName('PassFailScheme');
$gradesEducationGradingSchemeGrade1 = new EducationGradingSchemeGrade();
$gradesEducationGradingSchemeGrade1->setDisplayName('Pass');
$gradesEducationGradingSchemeGrade1->setMinPercentage(70);
$gradesEducationGradingSchemeGrade1->setDefaultPercentage(90);
$gradesArray []= $gradesEducationGradingSchemeGrade1;
$gradesEducationGradingSchemeGrade2 = new EducationGradingSchemeGrade();
$gradesEducationGradingSchemeGrade2->setDisplayName('Fail');
$gradesEducationGradingSchemeGrade2->setMinPercentage(0);
$gradesEducationGradingSchemeGrade2->setDefaultPercentage(50);
$gradesArray []= $gradesEducationGradingSchemeGrade2;
$requestBody->setGrades($gradesArray);
$result = $graphServiceClient->education()->classes()->byEducationClassId('educationClass-id')->assignmentSettings()->gradingSchemes()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.education_grading_scheme import EducationGradingScheme
from msgraph_beta.generated.models.education_grading_scheme_grade import EducationGradingSchemeGrade
# To initialize your graph_client, see https://free.blessedness.top/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = EducationGradingScheme(
display_name = "PassFailScheme",
grades = [
EducationGradingSchemeGrade(
display_name = "Pass",
min_percentage = 70,
default_percentage = 90,
),
EducationGradingSchemeGrade(
display_name = "Fail",
min_percentage = 0,
default_percentage = 50,
),
],
)
result = await graph_client.education.classes.by_education_class_id('educationClass-id').assignment_settings.grading_schemes.post(request_body)
Response
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 201 Created
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#education/classes('de45722a-c202-43a9-9dd5-d82c45bcef91')/assignmentSettings/gradingSchemes/$entity",
"id": "acdbd23c-004e-4965-8e57-fa08c7d2020d",
"displayName": "PassFailScheme",
"hidePointsDuringGrading": false,
"grades": [
{
"displayName": "Pass",
"minPercentage": 70,
"defaultPercentage": 90
},
{
"displayName": "Fail",
"minPercentage": 0,
"defaultPercentage": 50
}
]
}