Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/api/views/scores.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ def get(self, request):
timezone.now() - play.created_at
).total_seconds()
<= 86400,
"max_score": play_state.score_submitted,
}

return Response(response)
18 changes: 18 additions & 0 deletions app/core/migrations/0027_ltiplaystate_score_submitted.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 5.0.1 on 2026-03-24 14:54

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("core", "0026_ltiplaystate"),
]

operations = [
migrations.AddField(
model_name="ltiplaystate",
name="score_submitted",
field=models.FloatField(null=True),
),
]
1 change: 1 addition & 0 deletions app/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ class SubmissionStatus(models.TextChoices):
)
submission_attempts = models.PositiveIntegerField(default=0)
last_submitted = models.DateTimeField(default=None, null=True)
score_submitted = models.FloatField(null=True)


# this sucks
Expand Down
1 change: 1 addition & 0 deletions app/lti/ags/services/ags.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def submit_score_for_play(play: LogPlay) -> str:
# If no exception is caught, indicates a 200
play_state.submission_status = LtiPlayState.SubmissionStatus.SUCCESS
play_state.last_submitted = timezone.now()
play_state.score_submitted = max_score

logger.info(
"LTI-AGS: successfully transmitted %s score for play %s",
Expand Down
24 changes: 17 additions & 7 deletions src/components/score-overview-lti-status.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, {useState, useEffect} from 'react'
import ScoreLtiResubmit from './score-lti-resubmit'


const ScoreOverviewLtiStatus = ({ lti, single, playId }) => {
const ScoreOverviewLtiStatus = ({ lti, single, playId, score }) => {

const [status, setStatus] = useState(lti.status)

Expand All @@ -29,12 +29,22 @@ const ScoreOverviewLtiStatus = ({ lti, single, playId }) => {
const article = single ? 'The' : 'Your'
switch (status) {
case 'SUCCESS':
ltiContentBody = (
<>
<h3>Grade Submitted</h3>
<p>{article} score was successfully synced with the gradebook.</p>
</>
)

if (lti.max_score != null && lti.max_score != score) {
ltiContentBody = (
<>
<h3>Grade Submitted</h3>
<p>{article} highest score of {lti.max_score}% was submitted instead of the current {score}% score.</p>
</>
)
} else {
ltiContentBody = (
<>
<h3>Grade Submitted</h3>
<p>{article} score was successfully synced with the gradebook.</p>
</>
)
}
break
case 'AGS_NOT_INCLUDED':
case 'NOT_GRADED':
Expand Down
2 changes: 1 addition & 1 deletion src/components/score-overview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const ScoreOverview = ({instId, playId, isSingle, overview, attemptNum, isPrevie

let overviewLtiStatus = null
if (overview.lti) {
overviewLtiStatus = <ScoreOverviewLtiStatus lti={overview.lti} single={isSingle} playId={playId} />
overviewLtiStatus = <ScoreOverviewLtiStatus lti={overview.lti} single={isSingle} playId={playId} score={overview.score} />
}

let classRankBtn = null
Expand Down
Loading