--- loncom/interface/lonparmset.pm 2012/05/09 19:46:30 1.523
+++ loncom/interface/lonparmset.pm 2013/05/21 18:54:15 1.532
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set parameters for assessments
#
-# $Id: lonparmset.pm,v 1.523 2012/05/09 19:46:30 raeburn Exp $
+# $Id: lonparmset.pm,v 1.532 2013/05/21 18:54:15 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -315,11 +315,15 @@ use LONCAPA qw(:DEFAULT :match);
sub startSettingsScreen {
- my ($r,$mode)=@_;
+ my ($r,$mode,$crstype)=@_;
+ my $tabtext = &mt('Course Settings');
+ if ($crstype eq 'Community') {
+ $tabtext = &mt('Community Settings');
+ }
$r->print("\n".'
');
$r->print("\n".'- '.
- &mt('Course Settings').
+ $tabtext.
'
');
$r->print("\n".'- '.
@@ -661,7 +665,7 @@ sub storeparm_by_symb {
}
sub log_parmset {
- return &Apache::lonnet::instructor_log('parameterlog',@_);
+ return &Apache::lonnet::write_log('course','parameterlog',@_);
}
sub storeparm_by_symb_inner {
@@ -768,11 +772,14 @@ sub valout {
my $result = '';
# Values of zero are valid.
if (! $value && $value ne '0') {
- if ($editable) {
- $result = '*';
- } else {
- $result=' ';
- }
+ if ($editable) {
+ $result =
+ '';
+ } else {
+ $result=' ';
+ }
} else {
if ($type eq 'date_interval') {
my ($sec,$min,$hour,$mday,$mon,$year)=gmtime($value);
@@ -917,7 +924,7 @@ COURSECONTENTSCRIPT
}
sub startpage {
- my ($r,$psymb) = @_;
+ my ($r,$psymb,$crstype) = @_;
my %loaditems = (
'onload' => "group_or_section('cgroup')",
@@ -951,7 +958,7 @@ sub startpage {
my $escfilter=&Apache::lonhtmlcommon::entity_encode($env{'form.filter'});
my $escpart=&Apache::lonhtmlcommon::entity_encode($env{'form.part'});
$r->print($start_page.$breadcrumbs);
- &startSettingsScreen($r,'parmset');
+ &startSettingsScreen($r,'parmset',$crstype);
$r->print(<
@@ -1256,7 +1263,7 @@ sub extractResourceInformation {
$$mapp{$mapid}=$$mapp{$id};
$$allmaps{$mapid}=$$mapp{$id};
if ($mapid eq '1') {
- $$maptitles{$mapid}=&mt('Main Course Documents');
+ $$maptitles{$mapid}=&mt('Main Content');
} else {
$$maptitles{$mapid}=&Apache::lonnet::gettitle($$mapp{$id});
}
@@ -1789,7 +1796,7 @@ sub mapmenu {
.&Apache::loncommon::end_data_table_row()
);
- # Display row: "Main Course Documents"
+ # Display row: "Main Content"
if (exists($$allmaps{1})) {
$r->print(
&Apache::loncommon::start_data_table_row()
@@ -2223,7 +2230,8 @@ sub assessparms {
if ($psprt[0] eq "all" || !@psprt) {@psprt = (keys %allparts);}
# ------------------------------------------------------------------ Start page
- &startpage($r,$pssymb);
+ my $crstype = &Apache::loncommon::course_type();
+ &startpage($r,$pssymb,$crstype);
foreach ('tolerance','date_default','date_start','date_end',
'date_interval','int','float','string') {
@@ -2303,7 +2311,6 @@ ENDPARMSELSCRIPT
.''
.'');
} else {
- $r->print();
# parameter screen for a single resource.
my ($map,$iid,$resource)=&Apache::lonnet::decode_symb($pssymb);
my $title = &Apache::lonnet::gettitle($pssymb);
@@ -2427,9 +2434,8 @@ ENDTABLEHEADFOUR
my $defbgtwo='';
my $defbgthree = '';
- foreach (@ids) {
+ foreach my $rid (@ids) {
- my $rid=$_;
my ($inmapid)=($rid=~/\.(\d+)$/);
if ((!$pssymb &&
@@ -2911,7 +2917,7 @@ sub storedata {
if (&Apache::lonnet::del('resourcedata',\@deldata,$dom,$crs) eq 'ok') {
my %loghash=map { $_ => '' } @deldata;
&log_parmset(\%loghash,1);
- $r->print('
'.&mt('Deleted [_1] parameter(s)
',$delentries));
+ $r->print(''.&mt('Deleted [_1] parameter(s)',$delentries).'
');
} else {
$r->print(''.
&mt('Error deleting parameters').'
');
@@ -3159,7 +3165,7 @@ my %strings =
=> [[ 'problem', 'Standard Problem'],
[ 'survey', 'Survey'],
[ 'anonsurveycred', 'Anonymous Survey (credit for submission)'],
- [ 'exam', 'Exam'],
+ [ 'exam', 'Bubblesheet Exam'],
[ 'anonsurvey', 'Anonymous Survey'],
[ 'randomizetry', 'New Randomization Each N Tries (default N=1)'],
[ 'practice', 'Practice'],
@@ -3304,6 +3310,7 @@ sub newoverview {
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
+ my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'};
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setoverview',
text=>"Overview Mode"});
@@ -3323,7 +3330,7 @@ sub newoverview {
{'add_entries' => \%loaditems,});
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview');
$r->print($start_page.$breadcrumbs);
- &startSettingsScreen($r,'parmset');
+ &startSettingsScreen($r,'parmset',$crstype);
$r->print(<
ENDOVER
@@ -3492,13 +3499,14 @@ sub overview {
my ($r) = @_;
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
+ my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'};
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setoverview',
text=>"Overview Mode"});
my $start_page=&Apache::loncommon::start_page('Modify Parameters');
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview');
$r->print($start_page.$breadcrumbs);
- &startSettingsScreen($r,'parmset');
+ &startSettingsScreen($r,'parmset',$crstype);
$r->print(''.
+ ($foundkeys?'':''.&mt('There are no parameters.').'').''.
&Apache::loncommon::end_page());
}
@@ -3595,8 +3603,9 @@ ENDOVER
} elsif ($data{'realm_type'} eq 'symb') {
my ($map,$resid,$url) =
&Apache::lonnet::decode_symb($data{'realm'});
- $r->print(&mt('Resource: [_1]
with ID: [_2]
in folder [_3]',
- $url,$resid,$map));
+ $r->print(&mt('Resource: [_1]with ID: [_2]in folder [_3]',
+ $url.'
',
+ $resid.'
',$map));
}
$r->print('
'.&mt('Part: [_1]',$data{'parameter_part'}));
$r->print('');
@@ -3614,13 +3623,14 @@ sub date_shift_one {
my ($r) = @_;
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
+ my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'};
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=dateshift1&timebase='.$env{'form.timebase'},
text=>"Shifting Dates"});
my $start_page=&Apache::loncommon::start_page('Shift Dates');
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Shift');
$r->print($start_page.$breadcrumbs);
- &startSettingsScreen($r,'parmset');
+ &startSettingsScreen($r,'parmset',$crstype);
$r->print('