--- loncom/interface/lonparmset.pm 2012/12/17 15:00:41 1.529
+++ loncom/interface/lonparmset.pm 2013/06/27 18:12:22 1.534
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set parameters for assessments
#
-# $Id: lonparmset.pm,v 1.529 2012/12/17 15:00:41 raeburn Exp $
+# $Id: lonparmset.pm,v 1.534 2013/06/27 18:12:22 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".'- '.
@@ -920,7 +924,7 @@ COURSECONTENTSCRIPT
}
sub startpage {
- my ($r,$psymb) = @_;
+ my ($r,$psymb,$crstype) = @_;
my %loaditems = (
'onload' => "group_or_section('cgroup')",
@@ -954,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(<
@@ -1106,6 +1110,10 @@ sub print_td {
if ($which > 3) {
$nolink = 1;
}
+ } elsif ($mprefix =~ /examcode\&$/) {
+ unless ($which == 2) {
+ $nolink = 1;
+ }
}
if ($nolink) {
$r->print(&valout($$outpar[$which],$$typeoutpar[$which]));
@@ -1259,7 +1267,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});
}
@@ -1429,7 +1437,7 @@ sub lookUpTableParameter {
'lenient' => 'grading',
'retrypartial' => 'tries',
'discussvote' => 'misc',
-
+ 'examcode' => 'high_level_randomization',
);
}
@@ -1792,7 +1800,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()
@@ -2186,16 +2194,22 @@ sub assessparms {
}
}
}
- } elsif ($markers[$i] =~ /_(type|lenient|retrypartial|discussvote)\&\d+$/) {
+ } elsif ($markers[$i] =~ /_(type|lenient|retrypartial|discussvote|examcode)\&\d+$/) {
$name = $1;
+ my $val = $values[$i];
+ if ($name eq 'examcode') {
+ if (&Apache::lonnet::validCODE($values[$i])) {
+ $val = 'valid';
+ }
+ }
$needsrelease =
- $Apache::lonnet::needsrelease{"parameter:$name:$values[$i]"};
+ $Apache::lonnet::needsrelease{"parameter:$name:$val"};
if ($needsrelease) {
unless ($got_chostname) {
($chostname,$cmajor,$cminor) = ¶meter_release_vars();
$got_chostname = 1;
}
- $needsnewer = ¶meter_releasecheck($name,$values[$i],
+ $needsnewer = ¶meter_releasecheck($name,$val,
$needsrelease,
$chostname,
$cmajor,$cminor);
@@ -2226,7 +2240,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') {
@@ -2306,7 +2321,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);
@@ -2430,9 +2444,8 @@ ENDTABLEHEADFOUR
my $defbgtwo='';
my $defbgthree = '';
- foreach (@ids) {
+ foreach my $rid (@ids) {
- my $rid=$_;
my ($inmapid)=($rid=~/\.(\d+)$/);
if ((!$pssymb &&
@@ -2838,6 +2851,8 @@ sub storedata {
$name = 'lenient';
} elsif ($typeof eq 'string_discussvote') {
$name = 'discussvote';
+ } elsif ($typeof eq 'string_examcode') {
+ $name = 'examcode';
} elsif ($typeof eq 'string_yesno') {
if ($thiskey =~ /\.retrypartial$/) {
$name = 'retrypartial';
@@ -3162,7 +3177,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'],
@@ -3307,6 +3322,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"});
@@ -3326,7 +3342,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
@@ -3495,13 +3511,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('