version 1.1363, 2017/12/22 17:19:43
|
version 1.1367, 2018/02/01 04:51:13
|
Line 5229 sub set_first_access {
|
Line 5229 sub set_first_access {
|
'course.'.$courseid.'.timerinterval.'.$res => $interval, |
'course.'.$courseid.'.timerinterval.'.$res => $interval, |
} |
} |
); |
); |
|
if (($cachedtime) && (abs($start-$cachedtime) < 5)) { |
|
$cachedtimes{"$courseid\0$res"} = $start; |
|
} |
} |
} |
return $putres; |
return $putres; |
} |
} |
Line 8889 sub auto_validate_class_sec {
|
Line 8892 sub auto_validate_class_sec {
|
return $response; |
return $response; |
} |
} |
|
|
|
sub auto_validate_instclasses { |
|
my ($cdom,$cnum,$owners,$classesref) = @_; |
|
my ($homeserver,%validations); |
|
$homeserver = &homeserver($cnum,$cdom); |
|
unless ($homeserver eq 'no_host') { |
|
my $ownerlist; |
|
if (ref($owners) eq 'ARRAY') { |
|
$ownerlist = join(',',@{$owners}); |
|
} else { |
|
$ownerlist = $owners; |
|
} |
|
if (ref($classesref) eq 'HASH') { |
|
my $classes = &freeze_escape($classesref); |
|
my $response=&reply('autovalidateinstclasses:'.&escape($ownerlist). |
|
':'.$cdom.':'.$classes,$homeserver); |
|
unless ($response =~ /(con_lost|error|no_such_host|refused)/) { |
|
my @items = split(/&/,$response); |
|
foreach my $item (@items) { |
|
my ($key,$value) = split('=',$item); |
|
$validations{&unescape($key)} = &thaw_unescape($value); |
|
} |
|
} |
|
} |
|
} |
|
return %validations; |
|
} |
|
|
sub auto_crsreq_update { |
sub auto_crsreq_update { |
my ($cdom,$cnum,$crstype,$action,$ownername,$ownerdomain,$fullname,$title, |
my ($cdom,$cnum,$crstype,$action,$ownername,$ownerdomain,$fullname,$title, |
$code,$accessstart,$accessend,$inbound) = @_; |
$code,$accessstart,$accessend,$inbound) = @_; |
Line 11201 sub get_numsuppfiles {
|
Line 11231 sub get_numsuppfiles {
|
unless (defined($cached)) { |
unless (defined($cached)) { |
my $chome=&homeserver($cnum,$cdom); |
my $chome=&homeserver($cnum,$cdom); |
unless ($chome eq 'no_host') { |
unless ($chome eq 'no_host') { |
($suppcount,my $errors) = (0,0); |
($suppcount,my $supptools,my $errors) = (0,0,0); |
my $suppmap = 'supplemental.sequence'; |
my $suppmap = 'supplemental.sequence'; |
($suppcount,$errors) = |
($suppcount,$supptools,$errors) = |
&Apache::loncommon::recurse_supplemental($cnum,$cdom,$suppmap,$suppcount,$errors); |
&Apache::loncommon::recurse_supplemental($cnum,$cdom,$suppmap,$suppcount, |
|
$supptools,$errors); |
} |
} |
&do_cache_new('suppcount',$hashid,$suppcount,600); |
&do_cache_new('suppcount',$hashid,$suppcount,600); |
} |
} |
Line 11729 sub metadata {
|
Line 11760 sub metadata {
|
# uploaded map containing the tool. The value is retrieved via |
# uploaded map containing the tool. The value is retrieved via |
# &EXT(), if a valid symb is available. Otherwise the value of |
# &EXT(), if a valid symb is available. Otherwise the value of |
# gradable in the exttool_$marker.db file for the tool instance |
# gradable in the exttool_$marker.db file for the tool instance |
# is retrived via &get(). |
# is retrieved via &get(). |
|
# |
|
# When lonuserstate::traceroute() calls lonnet::EXT() for |
|
# hiddenresource and encrypturl (during course initialization) |
|
# the map-level parameter for resource.0.gradable included in the |
|
# uploaded map containing the tool will not yet have been stored |
|
# in the user_course_parms.db file for the user's session, so in |
|
# this case fall back to retrieving gradable status from the |
|
# exttool_$marker.db file. |
# |
# |
# In order to avoid an infinite loop, &metadata() will return |
# In order to avoid an infinite loop, &metadata() will return |
# before a call to &EXT(), if the uri is for an external tool |
# before a call to &EXT(), if the uri is for an external tool |
Line 11744 sub metadata {
|
Line 11783 sub metadata {
|
my ($checked,$use_passback); |
my ($checked,$use_passback); |
if ($toolsymb ne '') { |
if ($toolsymb ne '') { |
(undef,undef,my $tooluri) = &decode_symb($toolsymb); |
(undef,undef,my $tooluri) = &decode_symb($toolsymb); |
if ($tooluri eq $uri) { |
if (($tooluri eq $uri) && (&EXT('resource.0.gradable',$toolsymb))) { |
$checked = 1; |
$checked = 1; |
if (&EXT('resource.0.gradable',$toolsymb) =~ /^yes$/i) { |
if (&EXT('resource.0.gradable',$toolsymb) =~ /^yes$/i) { |
$use_passback = 1; |
$use_passback = 1; |