version 1.1410, 2023/07/06 17:16:35
|
version 1.1416, 2023/11/11 18:50:51
|
Line 437 sub studentbrowser_javascript {
|
Line 437 sub studentbrowser_javascript {
|
<script type="text/javascript" language="Javascript"> |
<script type="text/javascript" language="Javascript"> |
// <![CDATA[ |
// <![CDATA[ |
var stdeditbrowser; |
var stdeditbrowser; |
function openstdbrowser(formname,uname,udom,clicker,roleflag,ignorefilter,courseadv) { |
function openstdbrowser(formname,uname,udom,clicker,roleflag,ignorefilter,courseadv,uident) { |
var url = '/adm/pickstudent?'; |
var url = '/adm/pickstudent?'; |
var filter; |
var filter; |
if (!ignorefilter) { |
if (!ignorefilter) { |
Line 458 sub studentbrowser_javascript {
|
Line 458 sub studentbrowser_javascript {
|
} |
} |
} |
} |
if ((courseadv == 'only') || (courseadv == 'none')) { url+="&courseadv="+courseadv; } |
if ((courseadv == 'only') || (courseadv == 'none')) { url+="&courseadv="+courseadv; } |
|
if (uident !== '') { url+="&identelement="+uident; } |
var title = 'Student_Browser'; |
var title = 'Student_Browser'; |
var options = 'scrollbars=1,resizable=1,menubar=0'; |
var options = 'scrollbars=1,resizable=1,menubar=0'; |
options += ',width=700,height=600'; |
options += ',width=700,height=600'; |
Line 489 ENDRESBRW
|
Line 490 ENDRESBRW
|
} |
} |
|
|
sub selectstudent_link { |
sub selectstudent_link { |
my ($form,$unameele,$udomele,$courseadv,$clickerid)=@_; |
my ($form,$unameele,$udomele,$courseadv,$clickerid,$identelem)=@_; |
my $callargs = "'".&Apache::lonhtmlcommon::entity_encode($form)."','". |
my $callargs = "'".&Apache::lonhtmlcommon::entity_encode($form)."','". |
&Apache::lonhtmlcommon::entity_encode($unameele)."','". |
&Apache::lonhtmlcommon::entity_encode($unameele)."','". |
&Apache::lonhtmlcommon::entity_encode($udomele)."'"; |
&Apache::lonhtmlcommon::entity_encode($udomele)."'"; |
Line 506 sub selectstudent_link {
|
Line 507 sub selectstudent_link {
|
$callargs .= ",'','','$courseadv'"; |
$callargs .= ",'','','$courseadv'"; |
} elsif ($courseadv eq 'condition') { |
} elsif ($courseadv eq 'condition') { |
$callargs .= ",'','','$courseadv'"; |
$callargs .= ",'','','$courseadv'"; |
|
} elsif ($identelem ne '') { |
|
$callargs .= ",'','',''"; |
|
} |
|
if ($identelem ne '') { |
|
$callargs .= ",'".&Apache::lonhtmlcommon::entity_encode($identelem)."'"; |
} |
} |
return '<span class="LC_nobreak">'. |
return '<span class="LC_nobreak">'. |
'<a href="javascript:openstdbrowser('.$callargs.');">'. |
'<a href="javascript:openstdbrowser('.$callargs.');">'. |
Line 6455 sub CSTR_pageheader {
|
Line 6461 sub CSTR_pageheader {
|
return $output; |
return $output; |
} |
} |
|
|
|
sub nocodemirror { |
|
my $nocodem = $env{'environment.nocodemirror'}; |
|
unless ($nocodem) { |
|
my %domdefs = &Apache::lonnet::get_domain_defaults($env{'user.domain'}); |
|
if ($domdefs{'nocodemirror'}) { |
|
$nocodem = 'yes'; |
|
} |
|
} |
|
return $nocodem; |
|
} |
|
|
############################################### |
############################################### |
############################################### |
############################################### |
|
|
Line 6849 ENDJS
|
Line 6866 ENDJS
|
$endbodytag; |
$endbodytag; |
} |
} |
} |
} |
|
if ((ref($args) eq 'HASH') && ($args->{'dashjs'})) { |
|
$endbodytag = &Apache::lonhtmlcommon::dash_to_minus_js().$endbodytag; |
|
} |
return $endbodytag; |
return $endbodytag; |
} |
} |
|
|
Line 17051 sub construct_course {
|
Line 17071 sub construct_course {
|
$cenv{'internal.defaultcredits'} = $args->{'defaultcredits'}; |
$cenv{'internal.defaultcredits'} = $args->{'defaultcredits'}; |
} |
} |
my @badclasses = (); # Used to accumulate sections/crosslistings that did not pass classlist access check for course owner. |
my @badclasses = (); # Used to accumulate sections/crosslistings that did not pass classlist access check for course owner. |
|
my @oklcsecs = (); # Used to accumulate LON-CAPA sections for validated institutional sections. |
if ($args->{'crssections'}) { |
if ($args->{'crssections'}) { |
$cenv{'internal.sectionnums'} = ''; |
$cenv{'internal.sectionnums'} = ''; |
if ($args->{'crssections'} =~ m/,/) { |
if ($args->{'crssections'} =~ m/,/) { |
Line 17064 sub construct_course {
|
Line 17085 sub construct_course {
|
my $class = $args->{'crscode'}.$sec; |
my $class = $args->{'crscode'}.$sec; |
my $addcheck = &Apache::lonnet::auto_new_course($$crsunum,$$crsudom,$class,$cenv{'internal.courseowner'}); |
my $addcheck = &Apache::lonnet::auto_new_course($$crsunum,$$crsudom,$class,$cenv{'internal.courseowner'}); |
$cenv{'internal.sectionnums'} .= $item.','; |
$cenv{'internal.sectionnums'} .= $item.','; |
unless ($addcheck eq 'ok') { |
if ($addcheck eq 'ok') { |
|
unless (grep(/^\Q$gp\E$/,@oklcsecs)) { |
|
push(@oklcsecs,$gp); |
|
} |
|
} else { |
push(@badclasses,$class); |
push(@badclasses,$class); |
} |
} |
} |
} |
Line 17092 sub construct_course {
|
Line 17117 sub construct_course {
|
my ($xl,$gp) = split/:/,$item; |
my ($xl,$gp) = split/:/,$item; |
my $addcheck = &Apache::lonnet::auto_new_course($$crsunum,$$crsudom,$xl,$cenv{'internal.courseowner'}); |
my $addcheck = &Apache::lonnet::auto_new_course($$crsunum,$$crsudom,$xl,$cenv{'internal.courseowner'}); |
$cenv{'internal.crosslistings'} .= $item.','; |
$cenv{'internal.crosslistings'} .= $item.','; |
unless ($addcheck eq 'ok') { |
if ($addcheck eq 'ok') { |
|
unless (grep(/^\Q$gp\E$/,@oklcsecs)) { |
|
push(@oklcsecs,$gp); |
|
} |
|
} else { |
push(@badclasses,$xl); |
push(@badclasses,$xl); |
} |
} |
} |
} |
Line 17155 sub construct_course {
|
Line 17184 sub construct_course {
|
if ($args->{'no_end_date'}) { |
if ($args->{'no_end_date'}) { |
$args->{'endaccess'} = 0; |
$args->{'endaccess'} = 0; |
} |
} |
|
# If an official course with institutional sections is created by cloning |
|
# an existing course, section-specific hiding of course totals in student's |
|
# view of grades as copied from cloned course, will be checked for valid |
|
# sections. |
|
if (($can_clone && $cloneid) && |
|
($cenv{'internal.coursecode'} ne '') && |
|
($cenv{'grading'} eq 'standard') && |
|
($cenv{'hidetotals'} ne '') && |
|
($cenv{'hidetotals'} ne 'all')) { |
|
my @hidesecs; |
|
my $deletehidetotals; |
|
if (@oklcsecs) { |
|
foreach my $sec (split(/,/,$cenv{'hidetotals'})) { |
|
if (grep(/^\Q$sec$/,@oklcsecs)) { |
|
push(@hidesecs,$sec); |
|
} |
|
} |
|
if (@hidesecs) { |
|
$cenv{'hidetotals'} = join(',',@hidesecs); |
|
} else { |
|
$deletehidetotals = 1; |
|
} |
|
} else { |
|
$deletehidetotals = 1; |
|
} |
|
if ($deletehidetotals) { |
|
delete($cenv{'hidetotals'}); |
|
&Apache::lonnet::del('environment',['hidetotals'],$$crsudom,$$crsunum); |
|
} |
|
} |
$cenv{'internal.autostart'}=$args->{'enrollstart'}; |
$cenv{'internal.autostart'}=$args->{'enrollstart'}; |
$cenv{'internal.autoend'}=$args->{'enrollend'}; |
$cenv{'internal.autoend'}=$args->{'enrollend'}; |
$cenv{'default_enrollment_start_date'}=$args->{'startaccess'}; |
$cenv{'default_enrollment_start_date'}=$args->{'startaccess'}; |
Line 17515 sub init_user_environment {
|
Line 17574 sub init_user_environment {
|
|
|
my $public=($username eq 'public' && $domain eq 'public'); |
my $public=($username eq 'public' && $domain eq 'public'); |
|
|
my ($filename,$cookie,$userroles,$firstaccenv,$timerintenv); |
my ($filename,$cookie,$userroles,$firstaccenv,$timerintenv, |
|
$coauthorenv); |
my $now=time; |
my $now=time; |
|
|
if ($public) { |
if ($public) { |
Line 17581 sub init_user_environment {
|
Line 17641 sub init_user_environment {
|
|
|
# Initialize roles |
# Initialize roles |
|
|
($userroles,$firstaccenv,$timerintenv) = |
($userroles,$firstaccenv,$timerintenv,$coauthorenv) = |
&Apache::lonnet::rolesinit($domain,$username,$authhost); |
&Apache::lonnet::rolesinit($domain,$username,$authhost); |
} |
} |
# ------------------------------------ Check browser type and MathML capability |
# ------------------------------------ Check browser type and MathML capability |
Line 17659 sub init_user_environment {
|
Line 17719 sub init_user_environment {
|
my %is_adv = ( is_adv => $env{'user.adv'} ); |
my %is_adv = ( is_adv => $env{'user.adv'} ); |
my %domdef = &Apache::lonnet::get_domain_defaults($domain); |
my %domdef = &Apache::lonnet::get_domain_defaults($domain); |
|
|
foreach my $tool ('aboutme','blog','webdav','portfolio','timezone') { |
foreach my $tool ('aboutme','blog','webdav','portfolio','portaccess','timezone') { |
$userenv{'availabletools.'.$tool} = |
$userenv{'availabletools.'.$tool} = |
&Apache::lonnet::usertools_access($username,$domain,$tool,'reload', |
&Apache::lonnet::usertools_access($username,$domain,$tool,'reload', |
undef,\%userenv,\%domdef,\%is_adv); |
undef,\%userenv,\%domdef,\%is_adv); |
} |
} |
Line 17728 sub init_user_environment {
|
Line 17788 sub init_user_environment {
|
if (ref($timerintenv) eq 'HASH') { |
if (ref($timerintenv) eq 'HASH') { |
&_add_to_env(\%disk_env,$timerintenv); |
&_add_to_env(\%disk_env,$timerintenv); |
} |
} |
|
if (ref($coauthorenv) eq 'HASH') { |
|
if (keys(%{$coauthorenv})) { |
|
&_add_to_env(\%disk_env,$coauthorenv); |
|
} |
|
} |
if (ref($args->{'extra_env'})) { |
if (ref($args->{'extra_env'})) { |
&_add_to_env(\%disk_env,$args->{'extra_env'}); |
&_add_to_env(\%disk_env,$args->{'extra_env'}); |
} |
} |