--- loncom/interface/domainprefs.pm 2021/11/22 23:40:59 1.391 +++ loncom/interface/domainprefs.pm 2021/11/24 04:25:01 1.392 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: domainprefs.pm,v 1.391 2021/11/22 23:40:59 raeburn Exp $ +# $Id: domainprefs.pm,v 1.392 2021/11/24 04:25:01 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -6129,7 +6129,8 @@ sub lti_options { my (%checked,%rolemaps,$crssecsrc,$userfield,$cidfield,$callback); $checked{'mapuser'}{'sourcedid'} = ' checked="checked"'; $checked{'mapcrs'}{'course_offering_sourcedid'} = ' checked="checked"'; - $checked{'makecrs'}{'N'} = ' checked="checked"'; + $checked{'storecrs'}{'Y'} = ' checked="checked"'; + $checked{'makecrs'}{'N'} = ' checked="checked"'; $checked{'mapcrstype'} = {}; $checked{'makeuser'} = {}; $checked{'selfenroll'} = {}; @@ -6187,6 +6188,10 @@ sub lti_options { $checked{'mapcrstype'}{$type} = ' checked="checked"'; } } + if (!$current->{'storecrs'}) { + $checked{'storecrs'}{'N'} = $checked{'storecrs'}{'Y'}; + $checked{'storecrs'}{'Y'} = ''; + } if ($current->{'makecrs'}) { $checked{'makecrs'}{'Y'} = ' checked="checked"'; } @@ -6294,7 +6299,7 @@ sub lti_options { my $onclicklcauth = ' onclick="toggleLTI(this.form,'."'lcauth','$num'".')"'; my $onclickmenu = ' onclick="toggleLTI(this.form,'."'lcmenu','$num'".');"'; my $output = '
'.&mt('Logout options').''. - '
'.&mt('Callback on logout').': '. + '
'.&mt('Callback to logout LON-CAPA on log out from Consumer').': '. ''.(' 'x2). ''. (' 'x2); } - $output .= '
'. + $output .= '

'. + ''.&mt('Store mapping of course identifier to LON-CAPA CourseID').': '. + ''.(' 'x2). + ''. + ''. '
'.&mt('Mapping course roles').''; foreach my $ltirole (@lticourseroles) { my ($selected,$selectnone); @@ -14775,13 +14786,14 @@ sub modify_lti { my @courseroles = ('cc','in','ta','ep','st'); my @ltiroles = qw(Learner Instructor ContentDeveloper TeachingAssistant Mentor Member Manager Administrator); my @lticourseroles = qw(Instructor TeachingAssistant Mentor Learner); - my @coursetypes = ('official','unofficial','community','textbook','placement'); + my @coursetypes = ('official','unofficial','community','textbook','placement','lti'); my %coursetypetitles = &Apache::lonlocal::texthash ( official => 'Official', unofficial => 'Unofficial', community => 'Community', textbook => 'Textbook', placement => 'Placement Test', + lti => 'LTI Provider', ); my %fieldtitles = &Apache::loncommon::personal_data_fieldtitles(); my %lt = <i_names(); @@ -14939,6 +14951,9 @@ sub modify_lti { } } $confhash{$itemid}{'mapcrstype'} = \@crstypes; + if ($env{'form.lti_storecrs_'.$idx}) { + $confhash{$itemid}{'storecrs'} = 1; + } if ($env{'form.lti_makecrs_'.$idx}) { $confhash{$itemid}{'makecrs'} = 1; } @@ -14983,7 +14998,7 @@ sub modify_lti { } unless (($idx eq 'add') || ($changes{$itemid})) { if ($confhash{$itemid}{'crsinc'}) { - foreach my $field ('mapcrs','makecrs','section','passback','roster') { + foreach my $field ('mapcrs','storecrs','makecrs','section','passback','roster') { if ($domconfig{$action}{$itemid}{$field} ne $confhash{$itemid}{$field}) { $changes{$itemid} = 1; } @@ -15145,7 +15160,7 @@ sub modify_lti { if ($confhash{$itemid}{'callback'}) { $resulttext .= '
  • '.&mt('Callback setting').': '.$confhash{$itemid}{'callback'}.'
  • '; } else { - $resulttext .= '
  • '.&mt('No callback to logout LON-CAPA session when user logs out of Comsumer').'
  • '; + $resulttext .= '
  • '.&mt('Callback to logout LON-CAPA on log out from Consumer').'
  • '; } if ($confhash{$itemid}{'mapuser'}) { my $shownmapuser; @@ -15234,6 +15249,9 @@ sub modify_lti { $resulttext .= '
  • '.&mt('No mapping to LON-CAPA courses').'
  • '; } } + if ($confhash{$itemid}{'storecrs'}) { + $resulttext .= '
  • '.&mt('Store mapping of course identifier to LON-CAPA CourseID').': '.$confhash{$itemid}{'storecrs'}.'
  • '; + } if ($confhash{$itemid}{'makecrs'}) { $resulttext .= '
  • '.&mt('Instructor may create course (if absent).').'
  • '; } else {