--- loncom/homework/lonhomework.pm 2013/08/21 16:07:49 1.340
+++ loncom/homework/lonhomework.pm 2014/01/10 17:03:30 1.341
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Homework handler
#
-# $Id: lonhomework.pm,v 1.340 2013/08/21 16:07:49 bisitz Exp $
+# $Id: lonhomework.pm,v 1.341 2014/01/10 17:03:30 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1133,6 +1133,7 @@ sub get_template_list {
&mt(&Apache::lonnet::metadata($_, 'help'))]} (@files);
@files = sort {$a->[2].$a->[1] cmp $b->[2].$b->[1]} (@files);
my ($midpoint,$seconddiv,$numfiles);
+ my @noexamplelink = ('blank.problem','blank.library','script.library');
$numfiles = 0;
foreach my $file (@files) {
next if ($file->[1] !~ /\S/);
@@ -1171,11 +1172,16 @@ sub get_template_list {
if ($file->[3]) {
$result.=&Apache::loncommon::help_open_topic($file->[3]);
}
+ # Provide example link
my $filename=$file->[0];
$filename=~s{^\Q$londocroot\E}{};
- $result.=' '
- .&Apache::loncommon::modal_link($filename.'?inhibitmenu=yes',&mt('Example'),600,420,'sample')
- .'
'."\n";
+ if (!(grep $filename =~ $_, @noexamplelink)) {
+ $result .= ' '
+ .&Apache::loncommon::modal_link(
+ $filename.'?inhibitmenu=yes',&mt('Example'),600,420,'sample')
+ .'';
+ };
+ $result .= '
'."\n";
$count ++;
}
if ($numfiles > 0) {