Skip to content

Blank comment in AGS score publish call returns 400 #637

@ayub02

Description

@ayub02

Background

If the comment field is blank is call to AGS score publish endpoint /api/lti_consumer/v1/lti/<lti_config_id>/lti-ags/<lineitem_id>/scores, the platform does not update the score and returns 400. Below is an example of a request and response from a tool named CourseArc. I am able to reproduce the same from the test tool SALTIRE.

Request:

POST /api/lti_consumer/v1/lti/37/lti-ags/30/scores HTTP/1.1
Host: [master.openedx.io](http://master.openedx.io/)
Authorization: Bearer ey ...
Content-Type: application/vnd.ims.lis.v1.score+json; charset=UTF-8
Content-Length: 204
User-Agent: CourseArc/1.0
Accept: */*

{"scoreGiven":1,"scoreMaximum":1,"comment":"","activityProgress":"Completed","gradingProgress":"FullyGraded","userId":"70f7ac39-f127-4d86-8686-e84e8ff7661f","timestamp":"2026-04-02T11:35:26.000000-04:00"}

Response:

HTTP/1.1 400 Bad Request
Allow: POST, OPTIONS
Alt-Svc: h3=":443"; ma=2592000
Content-Language: en
Content-Length: 44
Content-Type: application/vnd.ims.lis.v1.score+json
Server: Caddy
Set-Cookie: sessionid=1|hanv...;
Domain=[master.openedx.io](http://master.openedx.io/); expires=Thu, 16 Apr 2026 15:35:27 GMT; HttpOnly; Max-Age=1209600; Path=/; SameSite=None; Secure
Vary: Accept-Language, origin, Cookie
X-Frame-Options: SAMEORIGIN
Date: Thu, 02 Apr 2026 15:35:27 GMT

{"comment":["This field may not be blank."]}

Problem

However, the spec allows blank comment: see link.

The current value for the comment. The value must be a string. If no value exists, this attribute may be omitted, blank or have an explicit null value.

Proposed way forward

Since the spec allows blank comments, we need to allow tools to be able to publish scores:

  1. Without a comment field
  2. comment field with a blank value ""
  3. comment field with null value

This seems like a place where this change needs to be made:

comment = serializers.CharField(required=False, allow_null=True)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions