Skip to content

Commit

Permalink
Merge pull request #2566 from Alex-Jordan/hotfix/lms-grade-items
Browse files Browse the repository at this point in the history
hotfix variant of #2561
  • Loading branch information
drgrice1 authored Oct 1, 2024
2 parents fa3468a + d3935df commit 095521d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 11 deletions.
31 changes: 23 additions & 8 deletions lib/WeBWorK/ContentGenerator/LTIAdvanced.pm
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,19 @@ 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 => {
'@type' => 'LineItem',
scoreConstraints => {
'@type' => 'NumericLimits',
normalMaximum => 100
}
}
)
: ()
}
: (),
map { {
Expand All @@ -141,13 +152,17 @@ 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 095521d

Please sign in to comment.