Skip to content

Commit

Permalink
initialize grade columns in the LMS according to the grade passback m…
Browse files Browse the repository at this point in the history
…ode and the nature of the LTI link
  • Loading branch information
Alex-Jordan committed Sep 3, 2024
1 parent 3dc16db commit b5d80a3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
21 changes: 13 additions & 8 deletions lib/WeBWorK/ContentGenerator/LTIAdvanced.pm
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,11 @@ sub content_selection ($c) {
? {
'@type' => 'LtiLinkItem',
mediaType => 'application/vnd.ims.lti.v1.ltilink',
title => $c->maketext('Assignments'),
url => $c->url_for('set_list', courseID => $c->stash->{courseID})->to_abs->to_string
title => $c->maketext('WeBWorK Assignments'),
url => $c->url_for('set_list', courseID => $c->stash->{courseID})->to_abs->to_string,
$c->ce->{LTIGradeMode} eq 'course'
? (lineItem => {scoreMaximum => 100})
: ()
}
: (),
map { {
Expand All @@ -141,12 +144,14 @@ sub content_selection ($c) {
url =>
$c->url_for('problem_list', courseID => $c->stash->{courseID}, setID => $_->set_id)
->to_abs->to_string,
lineItem => {
'@type' => 'LineItem',
scoreConstraints => {
'@type' => 'NumericLimits',
normalMaximum => $setMaxScores{ $_->set_id }
}
$c->ce->{LTIGradeMode} eq 'homework'
? (lineItem => {
'@type' => 'LineItem',
scoreConstraints => {
'@type' => 'NumericLimits',
normalMaximum => $setMaxScores{ $_->set_id })
}
: ()
}
} } @selectedSets
]
Expand Down
9 changes: 6 additions & 3 deletions lib/WeBWorK/ContentGenerator/LTIAdvantage.pm
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,9 @@ sub content_selection ($c) {
$c->param('course_home_link')
? {
type => 'ltiResourceLink',
title => $c->maketext('Assignments'),
url => $c->url_for('set_list', courseID => $c->stash->{courseID})->to_abs->to_string
title => $c->maketext('WeBWorK Assignments'),
url => $c->url_for('set_list', courseID => $c->stash->{courseID})->to_abs->to_string,
$c->ce->{LTIGradeMode} eq 'course' ? (lineItem => { scoreMaximum => 100 }) : ()
}
: (),
map { {
Expand All @@ -277,7 +278,9 @@ sub content_selection ($c) {
url =>
$c->url_for('problem_list', courseID => $c->stash->{courseID}, setID => $_->set_id)
->to_abs->to_string,
lineItem => { scoreMaximum => $setMaxScores{ $_->set_id } }
$c->ce->{LTIGradeMode} eq 'homework'
? (lineItem => { scoreMaximum => $setMaxScores{ $_->set_id } })
: ()
} } @selectedSets
]
)
Expand Down

0 comments on commit b5d80a3

Please sign in to comment.