version 1.1075.2.161.2.15, 2023/01/23 22:50:32
|
version 1.1075.2.161.2.18, 2023/09/06 16:09:14
|
Line 1280 sub help_open_topic {
|
Line 1280 sub help_open_topic {
|
my $target = ' target="_top"'; |
my $target = ' target="_top"'; |
if ($links_target) { |
if ($links_target) { |
$target = ' target="'.$links_target.'"'; |
$target = ' target="'.$links_target.'"'; |
} elsif (($env{'request.deeplink.login'}) && ($env{'request.deeplink.target'} eq '_self')) { |
} elsif ((($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) || |
|
(($env{'request.deeplink.login'}) && ($env{'request.deeplink.target'} eq '_self'))) { |
$target = ''; |
$target = ''; |
} |
} |
if ($text ne "") { |
if ($text ne "") { |
Line 2729 This is not an optimal method, but it wo
|
Line 2730 This is not an optimal method, but it wo
|
|
|
=item * authform_filesystem |
=item * authform_filesystem |
|
|
|
=item * authform_lti |
|
|
=back |
=back |
|
|
See loncreateuser.pm for invocation and use examples. |
See loncreateuser.pm for invocation and use examples. |
Line 3153 sub authform_filesystem {
|
Line 3156 sub authform_filesystem {
|
return $result; |
return $result; |
} |
} |
|
|
|
sub authform_lti { |
|
my %in = ( |
|
formname => 'document.cu', |
|
kerb_def_dom => 'MSU.EDU', |
|
@_, |
|
); |
|
my ($lticheck,$result,$authtype,$autharg,$jscall,$disabled); |
|
my ($authnum,%can_assign) = &get_assignable_auth($in{'domain'}); |
|
if ($in{'readonly'}) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
|
if (defined($in{'curr_authtype'})) { |
|
if ($in{'curr_authtype'} eq 'lti') { |
|
if ($can_assign{'lti'}) { |
|
$lticheck = 'checked="checked" '; |
|
if (defined($in{'mode'})) { |
|
if ($in{'mode'} eq 'modifyuser') { |
|
$lticheck = ''; |
|
} |
|
} |
|
} else { |
|
$result = &mt('Currently LTI Authenticated.'); |
|
return $result; |
|
} |
|
} |
|
} else { |
|
if ($authnum == 1) { |
|
$authtype = '<input type="hidden" name="login" value="lti" />'; |
|
} |
|
} |
|
if (!$can_assign{'lti'}) { |
|
return; |
|
} elsif ($authtype eq '') { |
|
if (defined($in{'mode'})) { |
|
if ($in{'mode'} eq 'modifycourse') { |
|
if ($authnum == 1) { |
|
$authtype = '<input type="radio" name="login" value="lti"'.$disabled.' />'; |
|
} |
|
} |
|
} |
|
} |
|
$jscall = "javascript:changed_radio('lti',$in{'formname'});"; |
|
if (($authtype eq '') && (($in{'mode'} eq 'modifycourse') || ($in{'curr_authtype'} ne 'lti'))) { |
|
$authtype = '<input type="radio" name="login" value="lti" '. |
|
$lticheck.' onchange="'.$jscall.'" onclick="'. |
|
$jscall.'"'.$disabled.' />'; |
|
} |
|
$autharg = '<input type="hidden" name="ltiarg" value="" />'; |
|
if ($authtype) { |
|
$result = &mt('[_1] LTI Authenticated', |
|
'<label>'.$authtype.'</label>'.$autharg); |
|
} else { |
|
$result = '<b>'.&mt('LTI Authenticated').'</b>'. |
|
$autharg; |
|
} |
|
return $result; |
|
} |
|
|
sub get_assignable_auth { |
sub get_assignable_auth { |
my ($dom) = @_; |
my ($dom) = @_; |
if ($dom eq '') { |
if ($dom eq '') { |
Line 4462 sub get_previous_attempt {
|
Line 4523 sub get_previous_attempt {
|
} |
} |
$prevattempts.= &end_data_table_row().&end_data_table(); |
$prevattempts.= &end_data_table_row().&end_data_table(); |
} else { |
} else { |
|
my $msg; |
|
if ($symb =~ /ext\.tool$/) { |
|
$msg = &mt('No grade passed back.'); |
|
} else { |
|
$msg = &mt('Nothing submitted - no attempts.'); |
|
} |
$prevattempts= |
$prevattempts= |
&start_data_table().&start_data_table_row(). |
&start_data_table().&start_data_table_row(). |
'<td>'.&mt('Nothing submitted - no attempts.').'</td>'. |
'<td>'.$msg.'</td>'. |
&end_data_table_row().&end_data_table(); |
&end_data_table_row().&end_data_table(); |
} |
} |
} else { |
} else { |
Line 5830 sub CSTR_pageheader {
|
Line 5897 sub CSTR_pageheader {
|
if ($frameset) { |
if ($frameset) { |
$target = ' target="_parent"'; |
$target = ' target="_parent"'; |
$crumbtarget = '_parent'; |
$crumbtarget = '_parent'; |
|
} elsif (($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) { |
|
$target = ''; |
|
$crumbtarget = ''; |
} elsif (($env{'request.deeplink.login'}) && ($env{'request.deeplink.target'})) { |
} elsif (($env{'request.deeplink.login'}) && ($env{'request.deeplink.target'})) { |
$target = ' target="'.$env{'request.deeplink.target'}.'"'; |
$target = ' target="'.$env{'request.deeplink.target'}.'"'; |
$crumbtarget = $env{'request.deeplink.target'}; |
$crumbtarget = $env{'request.deeplink.target'}; |
Line 7626 fieldset {
|
Line 7696 fieldset {
|
/* overflow: hidden; */ |
/* overflow: hidden; */ |
} |
} |
|
|
|
fieldset#LC_selectuser { |
|
margin: 0; |
|
padding: 0; |
|
} |
|
|
article.geogebraweb div { |
article.geogebraweb div { |
margin: 0; |
margin: 0; |
} |
} |
Line 9138 sub symb_from_tinyurl {
|
Line 9213 sub symb_from_tinyurl {
|
} |
} |
} |
} |
|
|
|
sub usable_exttools { |
|
my %tooltypes; |
|
if ($env{'request.course.id'}) { |
|
if ($env{'course.'.$env{'request.course.id'}.'.internal.exttool'}) { |
|
if ($env{'course.'.$env{'request.course.id'}.'.internal.exttool'} eq 'both') { |
|
%tooltypes = ( |
|
crs => 1, |
|
dom => 1, |
|
); |
|
} elsif ($env{'course.'.$env{'request.course.id'}.'.internal.exttool'} eq 'crs') { |
|
$tooltypes{'crs'} = 1; |
|
} elsif ($env{'course.'.$env{'request.course.id'}.'.internal.exttool'} eq 'dom') { |
|
$tooltypes{'dom'} = 1; |
|
} |
|
} else { |
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $crstype = lc($env{'course.'.$env{'request.course.id'}.'.type'}); |
|
if ($crstype eq '') { |
|
$crstype = 'course'; |
|
} |
|
if ($crstype eq 'course') { |
|
if ($env{'course.'.$env{'request.course.id'}.'internal.coursecode'}) { |
|
$crstype = 'official'; |
|
} elsif ($env{'course.'.$env{'request.course.id'}.'.internal.textbook'}) { |
|
$crstype = 'textbook'; |
|
} elsif ($env{'course.'.$env{'request.course.id'}.'.internal.lti'}) { |
|
$crstype = 'lti'; |
|
} else { |
|
$crstype = 'unofficial'; |
|
} |
|
} |
|
my %domdefaults = &Apache::lonnet::get_domain_defaults($cdom); |
|
if ($domdefaults{$crstype.'domexttool'}) { |
|
$tooltypes{'dom'} = 1; |
|
} |
|
if ($domdefaults{$crstype.'exttool'}) { |
|
$tooltypes{'crs'} = 1; |
|
} |
|
} |
|
} |
|
return %tooltypes; |
|
} |
|
|
sub wishlist_window { |
sub wishlist_window { |
return(<<'ENDWISHLIST'); |
return(<<'ENDWISHLIST'); |
<script type="text/javascript"> |
<script type="text/javascript"> |
Line 16143 sub construct_course {
|
Line 16262 sub construct_course {
|
if ($args->{'crstype'}) { |
if ($args->{'crstype'}) { |
$cenv{'type'}=$args->{'crstype'}; |
$cenv{'type'}=$args->{'crstype'}; |
} |
} |
|
if ($args->{'lti'}) { |
|
$cenv{'internal.lti'}=$args->{'lti'}; |
|
} |
if ($args->{'crsid'}) { |
if ($args->{'crsid'}) { |
$cenv{'courseid'}=$args->{'crsid'}; |
$cenv{'courseid'}=$args->{'crsid'}; |
} |
} |
Line 16492 sub group_term {
|
Line 16614 sub group_term {
|
} |
} |
|
|
sub course_types { |
sub course_types { |
my @types = ('official','unofficial','community','textbook'); |
my @types = ('official','unofficial','community','textbook','lti'); |
my %typename = ( |
my %typename = ( |
official => 'Official course', |
official => 'Official course', |
unofficial => 'Unofficial course', |
unofficial => 'Unofficial course', |
community => 'Community', |
community => 'Community', |
textbook => 'Textbook course', |
textbook => 'Textbook course', |
|
lti => 'LTI provider', |
); |
); |
return (\@types,\%typename); |
return (\@types,\%typename); |
} |
} |
Line 16754 sub init_user_environment {
|
Line 16877 sub init_user_environment {
|
undef,\%userenv,\%domdef,\%is_adv); |
undef,\%userenv,\%domdef,\%is_adv); |
} |
} |
|
|
foreach my $crstype ('official','unofficial','community','textbook') { |
foreach my $crstype ('official','unofficial','community','textbook','lti') { |
$userenv{'canrequest.'.$crstype} = |
$userenv{'canrequest.'.$crstype} = |
&Apache::lonnet::usertools_access($username,$domain,$crstype, |
&Apache::lonnet::usertools_access($username,$domain,$crstype, |
'reload','requestcourses', |
'reload','requestcourses', |
Line 17704 sub parse_supplemental_title {
|
Line 17827 sub parse_supplemental_title {
|
my $name = &plainname($uname,$udom); |
my $name = &plainname($uname,$udom); |
$name = &HTML::Entities::encode($name,'"<>&\''); |
$name = &HTML::Entities::encode($name,'"<>&\''); |
$renametitle = &HTML::Entities::encode($renametitle,'"<>&\''); |
$renametitle = &HTML::Entities::encode($renametitle,'"<>&\''); |
$title='<i>'.&Apache::lonlocal::locallocaltime($time).'</i> '. |
$title='<i>'.&Apache::lonlocal::locallocaltime($time).'</i> '.$name; |
$name.': <br />'.$foldertitle; |
if ($foldertitle ne '') { |
|
$title .= ': <br />'.$foldertitle; |
|
} |
} |
} |
if (wantarray) { |
if (wantarray) { |
return ($title,$foldertitle,$renametitle); |
return ($title,$foldertitle,$renametitle); |