Create/Update grade

Method

Method Description
exam.gradeCreate Create grade
exam.gradeUpdate Update grade

Request parameters

{
    "grade": {
        "id": {GradeId}, /* Only for update operation */
        "exam_id": {ExamId},
        "name": "{Name}",
        "description": "{Description}",
        "external_id": "{ExternalId}",
        "badge_color": "{BadgeColor}",
        "score_from": {ScoreFrom},
        "score_to": {ScoreTo}
    },
    "resources": {
        "{ResourcePath}": "{ResourceCnt}",
        ...
    }
}

Response parameters

{
    "grade": {
        "id": {GradeStudyId},
        "exam_id": {ExamId},
        "name": "{Name}",
        "description": "{Description}",
        "external_id": "{ExternalId}",
        "badge_color": "{BadgeColor}",
        "score_from": {ScoreFrom},
        "score_to": {ScoreTo}
    },
    "resources": {
        "{ResourcePath}": "{NewResourcePath}",
        ...
    },
    "completed": {Comleted}
}

Every field below must be resent with its current (or new) value on every update call - any field left out is reset to empty/null, not preserved.

Variable Type Appearance Description
{GradeId} Integer Mandatory Grade id. Mandatory for update operation.
{ExamId} Integer Mandatory Exam id.
{Name} String Mandatory Grade name. Maximum 15 characters.
{Description} String Mandatory Grade content. HTML formatted, may contain media resources like images and audio. Please be aware that only relative URLs are allowed. See Rich HTML formatting for the full list of supported tags and attributes.
{ExternalId} String Optional External Id. Optional field to store external system grade id, which later can be used for matching/synchronization.
{BadgeColor} String Mandatory Badge background color in HEX format (e.g., #000000).
{ScoreFrom} Integer / null Optional Indicates the lowest score (inclusive) this grade applies to.
  • The grade that covers the lowest scores of the whole test must have {ScoreFrom} set to NULL (no minimum) - a non-NULL value there is rejected.
  • Every other grade's {ScoreFrom} must continue immediately after the {ScoreTo} of the grade covering the next-lower score range, with no gap: {ScoreFrom} <= that grade's {ScoreTo} + 1.
  • At least one grade must be defined whenever the test's evaluation method is grades-based, or the test cannot be marked ready.
  • Note: error messages number grades in this same low-to-high order (the grade with no minimum is always "Grade 1").
  • When the test's evaluation method is 3 (grades by percent), a non-NULL {ScoreFrom} must be 0 or greater. Evaluation method 4 (grades by points) has no such lower bound.
{ScoreTo} Integer / null Optional Indicates the highest score (inclusive) this grade applies to.
  • The grade that covers the highest scores of the whole test must have {ScoreTo} set to NULL (no maximum) - a non-NULL value there is rejected.
  • When the test's evaluation method is 3 (grades by percent), a non-NULL {ScoreTo} must be 100 or less. Evaluation method 4 (grades by points) has no such upper bound.
resources Object Optional If you are using media resources like images you need to send the content of each media resource under "resources" node.
{ResourcePath} String Mandatory Path of media resource. Same value as it was used in Description.
Example: "fld/image.jpg" for <img src="fld/image.jpg">.
{ResourceCnt} String Mandatory Base64 encoded content of media resource.
{NewResourcePath} String Mandatory New media resource path.
{Completed} Boolean Mandatory Indicates whether action was successfully completed or not.