File tree Expand file tree Collapse file tree 3 files changed +17
-4
lines changed
templates/ContentGenerator Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -486,17 +486,21 @@ sub checkSet {
486486 # for this set before students access it.
487487 my $LTIGradeMode = $ce -> {LTIGradeMode } // ' ' ;
488488
489- if ($LTIGradeMode eq ' homework' && !$self -> hasPermissions($userName , " view_unopened_sets" )) {
489+ if ($LTIGradeMode eq ' homework'
490+ && !$self -> hasPermissions($userName , " view_unopened_sets" )
491+ && !($set -> lis_source_did || ($ce -> {LTIVersion } eq ' v1p3' && $ce -> {LTI }{v1p3 }{ignoreMissingSourcedID })))
492+ {
490493 my $LMS =
491494 $ce -> {LTI }{ $ce -> {LTIVersion } }{LMS_url }
492495 ? $c -> link_to($ce -> {LTI }{ $ce -> {LTIVersion } }{LMS_name } => $ce -> {LTI }{ $ce -> {LTIVersion } }{LMS_url })
493496 : $ce -> {LTI }{ $ce -> {LTIVersion } }{LMS_name };
497+ $c -> {viewSetCheck } = ' lti_restricted'
498+ if $node_name eq ' problem_list' && $self -> hasPermissions($userName , ' view_unopened_set_info' );
494499 return $c -> b($c -> maketext(
495500 ' You must use your Learning Management System ([_1]) to access this set. '
496501 . ' Try logging in to the Learning Management System and visiting the set from there.' ,
497502 $LMS
498- ))
499- unless $set -> lis_source_did || ($ce -> {LTIVersion } eq ' v1p3' && $ce -> {LTI }{v1p3 }{ignoreMissingSourcedID });
503+ ));
500504 }
501505
502506 return 0;
Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ sub siblings ($c) {
167167}
168168
169169sub info ($c ) {
170- return $c -> include(' ContentGenerator/ProblemSet/info' );
170+ return $c -> { pg } ? $c -> include(' ContentGenerator/ProblemSet/info' ) : ' ' ;
171171}
172172
173173# This is called by the ContentGenerator/ProblemSet/body template for a regular homework set.
Original file line number Diff line number Diff line change 3333% if ($c->{viewSetCheck} && $c->{viewSetCheck} eq 'restricted') {
3434 <div class="alert alert-warning"><%= $c->{invalidSet} %></div>
3535% }
36+ % # Show a warning that the user must access the set via their LMS before they can start.
37+ % if ($c->{viewSetCheck} && $c->{viewSetCheck} eq 'lti_restricted') {
38+ <div class="alert alert-warning">
39+ <%= maketext('You must access this set via your Learning Management System ([_1]) before starting.',
40+ $ce->{LTI}{ $ce->{LTIVersion} }{LMS_url}
41+ ? $c->link_to($ce->{LTI}{ $ce->{LTIVersion} }{LMS_name} => $ce->{LTI}{ $ce->{LTIVersion} }{LMS_url})
42+ : $ce->{LTI}{ $ce->{LTIVersion} }{LMS_name}) %>
43+ </div>
44+ % }
3645%
3746<%= include 'ContentGenerator/ProblemSet/auxiliary_tools' =%>
3847%
You can’t perform that action at this time.
0 commit comments