version 1.25, 2021/11/22 03:19:05
|
version 1.27, 2021/11/24 04:25:03
|
Line 613 sub handler {
|
Line 613 sub handler {
|
|
|
my $reqcrs; |
my $reqcrs; |
if ($cnum eq '') { |
if ($cnum eq '') { |
if ((@ltiroles) && ($lti{$itemid}{'mapcrs'}) && |
if ($lti{$itemid}{'crsinc'}) { |
($ltiroles[0] eq 'Instructor') && ($lcroles[0] eq 'cc') && ($lti{$itemid}{'makecrs'})) { |
if ((@ltiroles) && ($lti{$itemid}{'mapcrs'}) && |
my (%can_request,%request_domains); |
($ltiroles[0] eq 'Instructor') && ($lcroles[0] eq 'cc') && ($lti{$itemid}{'makecrs'})) { |
&Apache::lonnet::check_can_request($cdom,\%can_request,\%request_domains,$uname,$udom); |
my (%can_request,%request_domains); |
if ($can_request{'lti'}) { |
&Apache::lonnet::check_can_request($cdom,\%can_request,\%request_domains,$uname,$udom); |
$reqcrs = 1; |
if ($can_request{'lti'}) { |
<i_session($r,$itemid,$uname,$udom,$uhome,$lonhost,undef,$mapurl,$tail, |
$reqcrs = 1; |
$symb,$cdom,$cnum,$params,\@ltiroles,$lti{$itemid},\@lcroles, |
<i_session($r,$itemid,$uname,$udom,$uhome,$lonhost,undef,$mapurl,$tail, |
$reqcrs,$sourcecrs); |
$symb,$cdom,$cnum,$params,\@ltiroles,$lti{$itemid},\@lcroles, |
|
$reqcrs,$sourcecrs); |
|
} else { |
|
&invalid_request($r,27); |
|
} |
} else { |
} else { |
&invalid_request($r,27); |
&invalid_request($r,28); |
} |
} |
} else { |
} else { |
&invalid_request($r,28); |
<i_session($r,$itemid,$uname,$udom,$uhome,$lonhost,undef,$mapurl,$tail, |
|
$symb,$cdom,$cnum,$params,\@ltiroles,$lti{$itemid},\@lcroles, |
|
$reqcrs,$sourcecrs); |
} |
} |
return OK; |
return OK; |
} |
} |
Line 634 sub handler {
|
Line 640 sub handler {
|
# |
# |
# If LON-CAPA course is a Community, and LON-CAPA role |
# If LON-CAPA course is a Community, and LON-CAPA role |
# indicated is cc, change role indicated to co. |
# indicated is cc, change role indicated to co. |
# |
# |
|
|
my %crsenv; |
my %crsenv; |
if ($lcroles[0] eq 'cc') { |
if ($lcroles[0] eq 'cc') { |
Line 739 sub handler {
|
Line 745 sub handler {
|
} |
} |
|
|
# |
# |
# Store consumer-to-LON-CAPA course mapping |
# Retrieve course type of LON-CAPA course to check if mapping from a Consumer |
|
# course identifier permitted for this type of course (one of: official, |
|
# unofficial, community, textbook, placement or lti. |
|
# |
|
|
|
unless (%crsenv) { |
|
%crsenv = &Apache::lonnet::coursedescription($cdom.'_'.$cnum); |
|
} |
|
my $crstype = lc($crsenv{'type'}); |
|
if ($crstype eq '') { |
|
$crstype = 'course'; |
|
} |
|
if ($crstype eq 'course') { |
|
if ($crsenv{'internal.coursecode'}) { |
|
$crstype = 'official'; |
|
} elsif ($crsenv{'internal.textbook'}) { |
|
$crstype = 'textbook'; |
|
} elsif ($crsenv{'internal.lti'}) { |
|
$crstype = 'lti'; |
|
} else { |
|
$crstype = 'unofficial'; |
|
} |
|
} |
|
|
|
# |
|
# Store consumer-to-LON-CAPA course mapping if permitted |
# |
# |
|
|
if (($sourcecrs ne '') && ($consumers{$sourcecrs} eq '') && ($cnum ne '')) { |
if (($lti{$itemid}{'storecrs'}) && ($sourcecrs ne '') && |
&Apache::lonnet::put_dom('lticonsumers',{ $sourcecrs => $cnum },$cdom); |
($consumers{$sourcecrs} eq '') && ($cnum ne '')) { |
|
if (ref($lti{$itemid}{'mapcrstype'}) eq 'ARRAY') { |
|
if (grep(/^$crstype$/,@{$lti{$itemid}{'mapcrstype'}})) { |
|
&Apache::lonnet::put_dom('lticonsumers',{ $sourcecrs => $cnum },$cdom); |
|
} |
|
} |
} |
} |
|
|
# |
# |
Line 894 sub lti_session {
|
Line 930 sub lti_session {
|
$env{'request.lti.uri'} = $tail; |
$env{'request.lti.uri'} = $tail; |
} else { |
} else { |
unless ($tail eq '/adm/roles') { |
unless ($tail eq '/adm/roles') { |
$env{'form.origurl'} = '/adm/navmaps'; |
if ($cnum) { |
|
$env{'form.origurl'} = '/adm/navmaps'; |
|
} |
} |
} |
} |
} |
} |
} |
Line 1002 sub lti_session {
|
Line 1040 sub lti_session {
|
$info{'origurl'} = $tail; |
$info{'origurl'} = $tail; |
} else { |
} else { |
unless ($tail eq '/adm/roles') { |
unless ($tail eq '/adm/roles') { |
$info{'origurl'} = '/adm/navmaps'; |
if ($cnum) { |
|
$info{'origurl'} = '/adm/navmaps'; |
|
} |
} |
} |
} |
} |
} |
} |