version 1.343, 2014/01/15 14:46:27
|
version 1.344.2.1, 2015/03/12 01:26:55
|
Line 469 sub check_access {
|
Line 469 sub check_access {
|
if ( $tries eq '' ) { $tries = '0'; } |
if ( $tries eq '' ) { $tries = '0'; } |
if ( $maxtries eq '' && |
if ( $maxtries eq '' && |
$env{'request.state'} ne 'construct') { $maxtries = '2'; } |
$env{'request.state'} ne 'construct') { $maxtries = '2'; } |
$Apache::lonhomework::results{'resource.'.$id.'.maxtries'}=$maxtries; |
|
if ($maxtries && $tries >= $maxtries) { $status = 'CANNOT_ANSWER'; } |
if ($maxtries && $tries >= $maxtries) { $status = 'CANNOT_ANSWER'; } |
# if (correct and show prob status) or excused then CANNOT_ANSWER |
# if (correct and show prob status) or excused then CANNOT_ANSWER |
if ( ($Apache::lonhomework::history{"resource.$id.solved"}=~/^correct/) |
if ( ($Apache::lonhomework::history{"resource.$id.solved"}=~/^correct/) |
Line 541 sub due_date {
|
Line 540 sub due_date {
|
} else { |
} else { |
$date = $due_date; |
$date = $due_date; |
} |
} |
return $date |
return $date; |
} |
} |
|
|
sub seconds_to_human_length { |
sub seconds_to_human_length { |
Line 590 sub showarray {
|
Line 589 sub showarray {
|
sub showhashsubset { |
sub showhashsubset { |
my ($hash,$keyre) = @_; |
my ($hash,$keyre) = @_; |
my $resultkey; |
my $resultkey; |
foreach $resultkey (sort keys %$hash) { |
foreach $resultkey (sort(keys(%$hash))) { |
if ($resultkey !~ /$keyre/) { next; } |
if ($resultkey !~ /$keyre/) { next; } |
if (ref($$hash{$resultkey}) eq 'ARRAY' ) { |
if (ref($$hash{$resultkey}) eq 'ARRAY' ) { |
&Apache::lonxml::debug("$resultkey ---- ". |
&Apache::lonxml::debug("$resultkey ---- ". |
Line 1176 sub get_template_list {
|
Line 1175 sub get_template_list {
|
# Provide example link |
# Provide example link |
my $filename=$file->[0]; |
my $filename=$file->[0]; |
$filename=~s{^\Q$londocroot\E}{}; |
$filename=~s{^\Q$londocroot\E}{}; |
if (!(grep $filename =~ $_, @noexamplelink)) { |
if (!(grep($filename =~ /\Q$_\E$/,@noexamplelink))) { |
$result .= ' <span class="LC_fontsize_small">' |
$result .= ' <span class="LC_fontsize_small">' |
.&Apache::loncommon::modal_link( |
.&Apache::loncommon::modal_link( |
$filename.'?inhibitmenu=yes',&mt('Example'),600,420,'sample') |
$filename.'?inhibitmenu=yes',&mt('Example'),600,420,'sample') |
.'</span>'; |
.'</span>'; |
}; |
} |
$result .= '<br />'."\n"; |
$result .= '<br />'."\n"; |
$count ++; |
$count ++; |
} |
} |