Add a criterion to a rubric
client.Rubrics.Criteria.New(ctx, rubricID, body) (*RubricCriteriaResponse, error)
POST/v5/rubrics/{rubric_id}/criteria
Add a single criterion to an existing rubric.
Creates a new criterion at version 1 under the given rubric. Criteria are versioned independently of the rubric they belong to. The request is rejected if the target rubric is archived.
Add a criterion to a rubric
package main
import (
"context"
"fmt"
"github.com/scaleapi/sgp-dev-go"
"github.com/scaleapi/sgp-dev-go/option"
)
func main() {
client := sgpdev.NewClient(
option.WithAPIKey("My API Key"),
option.WithAccountID("My Account ID"),
)
rubricCriteriaResponse, err := client.Rubrics.Criteria.New(
context.TODO(),
"rubric_id",
sgpdev.RubricCriterionNewParams{
RubricCriteriaInput: sgpdev.RubricCriteriaInputParam{
Title: "x",
},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", rubricCriteriaResponse.ID)
}
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"rubric_id": "rubric_id",
"title": "title",
"version": 0,
"annotations": {
"foo": "bar"
},
"object": "rubric_criteria",
"weight": 0
}Returns Examples
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"rubric_id": "rubric_id",
"title": "title",
"version": 0,
"annotations": {
"foo": "bar"
},
"object": "rubric_criteria",
"weight": 0
}