--- loncom/interface/lonparmset.pm 2009/11/01 12:20:16 1.475
+++ loncom/interface/lonparmset.pm 2009/11/14 17:47:18 1.483
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set parameters for assessments
#
-# $Id: lonparmset.pm,v 1.475 2009/11/01 12:20:16 amueller Exp $
+# $Id: lonparmset.pm,v 1.483 2009/11/14 17:47:18 amueller Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1161,81 +1161,80 @@ sub extractResourceInformation {
my $navmap = Apache::lonnavmaps::navmap->new();
my @allres=$navmap->retrieveResources(undef,undef,1,undef,1);
foreach my $resource (@allres) {
- my $id=$resource->id();
+ my $id=$resource->id();
my ($mapid,$resid)=split(/\./,$id);
- if ($mapid eq '0') { next; }
- $$ids[$#$ids+1]=$id;
- my $srcf=$resource->src();
- $srcf=~/\.(\w+)$/;
- $$typep{$id}=$1;
- $$keyp{$id}='';
+ if ($mapid eq '0') { next; }
+ $$ids[$#$ids+1]=$id;
+ my $srcf=$resource->src();
+ $srcf=~/\.(\w+)$/;
+ $$typep{$id}=$1;
+ $$keyp{$id}='';
$$uris{$id}=$srcf;
- foreach my $key (split(/\,/,&Apache::lonnet::metadata($srcf,'allpossiblekeys'))) {
- next if ($key!~/^parameter_/);
+ foreach my $key (split(/\,/,&Apache::lonnet::metadata($srcf,'allpossiblekeys'))) {
+ next if ($key!~/^parameter_/);
# Hidden parameters
- next if (&Apache::lonnet::metadata($srcf,$key.'.hidden') eq 'parm');
+ next if (&Apache::lonnet::metadata($srcf,$key.'.hidden') eq 'parm');
#
# allparms is a hash of parameter names
#
- my $name=&Apache::lonnet::metadata($srcf,$key.'.name');
- if (!exists($$allparms{$name}) || $$allparms{$name} =~ m/^\s*$/ ) {
- my ($display,$parmdis);
- $display = &standard_parameter_names($name);
- if ($display eq '') {
- $display= &Apache::lonnet::metadata($srcf,$key.'.display');
- $parmdis = $display;
- $parmdis =~ s/\s*\[Part.*$//g;
- } else {
- $parmdis = &mt($display);
- }
- $$allparms{$name}=$parmdis;
- if (ref($defkeytype)) {
- $$defkeytype{$name}=
- &Apache::lonnet::metadata($srcf,$key.'.type');
- }
- }
+ my $name=&Apache::lonnet::metadata($srcf,$key.'.name');
+ if (!exists($$allparms{$name}) || $$allparms{$name} =~ m/^\s*$/ ) {
+ my ($display,$parmdis);
+ $display = &standard_parameter_names($name);
+ if ($display eq '') {
+ $display= &Apache::lonnet::metadata($srcf,$key.'.display');
+ $parmdis = $display;
+ $parmdis =~ s/\s*\[Part.*$//g;
+ } else {
+ $parmdis = &mt($display);
+ }
+ $$allparms{$name}=$parmdis;
+ if (ref($defkeytype)) {
+ $$defkeytype{$name}=
+ &Apache::lonnet::metadata($srcf,$key.'.type');
+ }
+ }
#
# allparts is a hash of all parts
#
- my $part= &Apache::lonnet::metadata($srcf,$key.'.part');
- $$allparts{$part} = &mt('Part: [_1]',$part);
+ my $part= &Apache::lonnet::metadata($srcf,$key.'.part');
+ $$allparts{$part} = &mt('Part: [_1]',$part);
#
# Remember all keys going with this resource
#
- if ($$keyp{$id}) {
- $$keyp{$id}.=','.$key;
- } else {
- $$keyp{$id}=$key;
- }
+ if ($$keyp{$id}) {
+ $$keyp{$id}.=','.$key;
+ } else {
+ $$keyp{$id}=$key;
+ }
#
# Put in order
#
- unless ($$keyorder{$key}) {
- $$keyorder{$key}=$keyordercnt;
- $keyordercnt++;
+ unless ($$keyorder{$key}) {
+ $$keyorder{$key}=$keyordercnt;
+ $keyordercnt++;
+ }
}
- }
- if (!exists($$mapp{$mapid})) {
- $$mapp{$id}=
- &Apache::lonnet::declutter($resource->enclosing_map_src());
- $$mapp{$mapid}=$$mapp{$id};
- $$allmaps{$mapid}=$$mapp{$id};
- if ($mapid eq '1') {
- $$maptitles{$mapid}=&mt('Main Course Documents');
+ if (!exists($$mapp{$mapid})) {
+ $$mapp{$id}=
+ &Apache::lonnet::declutter($resource->enclosing_map_src());
+ $$mapp{$mapid}=$$mapp{$id};
+ $$allmaps{$mapid}=$$mapp{$id};
+ if ($mapid eq '1') {
+ $$maptitles{$mapid}=&mt('Main Course Documents');
+ } else {
+ $$maptitles{$mapid}=&Apache::lonnet::gettitle($$mapp{$id});
+ }
+ $$maptitles{$$mapp{$id}}=$$maptitles{$mapid};
+ $$symbp{$mapid}=$$mapp{$id}.'___(all)';
} else {
- $$maptitles{$mapid}=
- &Apache::lonnet::gettitle($$mapp{$id});
+ $$mapp{$id} = $$mapp{$mapid};
}
- $$maptitles{$$mapp{$id}}=$$maptitles{$mapid};
- $$symbp{$mapid}=$$mapp{$id}.'___(all)';
- } else {
- $$mapp{$id} = $$mapp{$mapid};
- }
- $$symbp{$id}=&Apache::lonnet::encode_symb($$mapp{$id},$resid,$srcf);
+ $$symbp{$id}=&Apache::lonnet::encode_symb($$mapp{$id},$resid,$srcf);
}
}
@@ -1836,6 +1835,8 @@ sub mapmenu {
}
}
+# Build up the select Box to choose if your parameter specification should work for the resource, map/folder or the course level
+# The value of default selection in the select box is set by the value that is given by the argument in $parmlev.
sub levelmenu {
my ($r,$alllevs,$parmlev)=@_;
@@ -2197,7 +2198,7 @@ ENDPARMSELSCRIPT
# Display Unit 1 "General Parameters"
if (!$pssymb) {
- $r->print(&Apache::lonhtmlcommon::topic_bar (1,&mt('General Parameters')));
+ $r->print(&Apache::lonhtmlcommon::topic_bar(1,&mt('Resource Specification')));
$r->print(<
');
+ $r->print(&Apache::lonhtmlcommon::topic_bar('',&mt('User Specification (optional)')));
}
- $r->print(&Apache::lonhtmlcommon::topic_bar (3,&mt('User Selection')));
$r->print(&Apache::lonhtmlcommon::start_pick_box());
&usermenu($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,\@usersgroups);
$r->print(&Apache::lonhtmlcommon::row_closure(1));
@@ -2266,6 +2269,7 @@ COURSECONTENTSCRIPT
.''
.'
'.&mt('Parts').' | '.&mt('Section(s)'). ' | '.&mt('Group(s)').' |
---|---|---|
'); &partmenu($r,\%allparts,\@psprt); @@ -3240,15 +3244,15 @@ ENDOVER if (($env{'form.store'}) || ($env{'form.dis'})) { - if ($env{'form.store'}) { &storedata($r,$crs,$dom); } + if ($env{'form.store'}) { &storedata($r,$crs,$dom); } # Read modified data - my $resourcedata=&readdata($crs,$dom); + my $resourcedata=&readdata($crs,$dom); # List data - &listdata($r,$resourcedata,$listdata,$sortorder); + &listdata($r,$resourcedata,$listdata,$sortorder); } $r->print(&tableend(). ((($env{'form.store'}) || ($env{'form.dis'}))?'':''). @@ -3639,33 +3643,35 @@ ENDMAINFORMHEAD my $vgr = &Apache::lonnet::allowed('vgr',$env{'request.course.id'}); my $mgr = &Apache::lonnet::allowed('mgr',$env{'request.course.id'}); + my $crstype = &Apache::loncommon::course_type(); + my $lc_crstype = lc($crstype); my @menu = - ( { categorytitle=>'Settings for this Course', + ( { categorytitle=>"Settings for this $crstype", items => [ - { linktext => 'Course Configuration', + { linktext => "$crstype Configuration", url => '/adm/courseprefs?origin=params', permission => $parm_permission, - linktitle =>'Edit course configuration.' , + linktitle => "Edit $lc_crstype configuration." , icon => 'preferences-desktop-remote-desktop.png' , #help => 'Course_Environment', }, { linktext => 'Portfolio Metadata', url => '/adm/parmset?action=setrestrictmeta', permission => $parm_permission, - linktitle => 'Restrict metadata for this course.' , + linktitle => "Restrict metadata for this $lc_crstype." , icon =>'contact-new.png' , }, - { linktext => 'Manage Course Slots', + { linktext => "Manage $crstype Slots", url => '/adm/slotrequest?command=showslots', permission => $vgr, - linktitle =>'Manage slots for this course.' , + linktitle => "Manage slots for this $lc_crstype." , icon => 'format-justify-fill.png' , }, { linktext => 'Reset Student Access Times', url => '/adm/helper/resettimes.helper', permission => $mgr, - linktitle =>'Reset access times for folders/maps, resources or the course.' , + linktitle => "Reset access times for folders/maps, resources or the $lc_crstype." , icon => 'start-here.png' , }, @@ -3710,7 +3716,7 @@ ENDMAINFORMHEAD { linktext => 'Change Log', url => '/adm/parmset?action=parameterchangelog', permission => $parm_permission, - linktitle =>'View parameter and course blog posting/user notification change log.' , + linktitle =>"View parameter and $lc_crstype blog posting/user notification change log." , icon => 'emblem-system.png' , }]} ); |