--- loncom/interface/lonparmset.pm 2006/05/18 01:08:51 1.307 +++ loncom/interface/lonparmset.pm 2006/11/20 21:04:44 1.347 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.307 2006/05/18 01:08:51 raeburn Exp $ +# $Id: lonparmset.pm,v 1.347 2006/11/20 21:04:44 banghart Exp $ # # Copyright Michigan State University Board of Trustees # @@ -65,6 +65,7 @@ use Apache::lonlocal; use Apache::lonnavmaps; use Apache::longroup; use Apache::lonrss; +use LONCAPA; # --- Caches local to lonparmset @@ -493,7 +494,7 @@ sub storeparm_by_symb_inner { } if ($reply=~/^error\:(.*)/) { - return "Write Error: $1"; + return "Write Error: $1"; } return ''; } @@ -507,21 +508,26 @@ sub storeparm_by_symb_inner { Format a value for output. -Inputs: $value, $type +Inputs: $value, $type, $editable Returns: $value, formatted for output. If $type indicates it is a date, localtime($value) is returned. +$editable will return an icon to click on =cut ################################################## ################################################## sub valout { - my ($value,$type)=@_; + my ($value,$type,$editable)=@_; my $result = ''; # Values of zero are valid. if (! $value && $value ne '0') { - $result = ' '; + if ($editable) { + $result = '*'; + } else { + $result=' '; + } } else { if ($type eq 'date_interval') { my ($sec,$min,$hour,$mday,$mon,$year)=gmtime($value); @@ -589,7 +595,7 @@ sub plink { return '
'. ''. - &valout($value,$type).' |
'); $cnt++; if ($cnt==3) { $r->print(" | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Select All Select Common Only |
@@ -1476,8 +1482,8 @@ sub assessparms {
$id='';
} else {
$message=
- "".&mt("Unknown ID")." '$id' ".
- &mt('at domain')." '$udom'";
+ ''.&mt("Unknown ID")." '$id' ".
+ &mt('at domain')." '$udom'";
}
} else {
$uname=$env{'form.uname'};
@@ -1488,17 +1494,17 @@ sub assessparms {
$uhome=&Apache::lonnet::homeserver($uname,$udom);
if ($uhome eq 'no_host') {
$message=
- "".&mt("Unknown user")." '$uname' ".
- &mt("at domain")." '$udom'";
+ ''.&mt("Unknown user")." '$uname' ".
+ &mt("at domain")." '$udom'";
$uname='';
} else {
$csec=&Apache::lonnet::getsection($udom,$uname,
$env{'request.course.id'});
if ($csec eq '-1') {
- $message="".
+ $message=''.
&mt("User")." '$uname' ".&mt("at domain")." '$udom' ".
- &mt("not in this course")."";
+ &mt("not in this course")."";
$uname='';
$csec=$env{'form.csec'};
$cgroup=$env{'form.cgroup'};
@@ -1508,7 +1514,7 @@ sub assessparms {
$message="\n \n".&mt("Full Name").": ".
$name{'firstname'}.' '.$name{'middlename'}.' '
.$name{'lastname'}.' '.$name{'generation'}.
- " ';
+ " ';
}
@usersgroups = &Apache::lonnet::get_users_groups(
$udom,$uname,$env{'request.course.id'});
@@ -1556,7 +1562,7 @@ sub assessparms {
foreach ('tolerance','date_default','date_start','date_end',
'date_interval','int','float','string') {
$r->print('');
+ $env{'form.recent_'.$_}.'" name="recent_'.$_.'" />');
}
if (!$pssymb) {
@@ -1571,8 +1577,9 @@ sub assessparms {
&displaymenu($r,\%allparms,\%allparts,\@pscat,\@psprt,\%keyorder);
} else {
my ($map,$id,$resource)=&Apache::lonnet::decode_symb($pssymb);
- $r->print(&mt('Specific Resource').": ".$resource.
- ''.
+ my $title = &Apache::lonnet::gettitle($pssymb);
+ $r->print(&mt('Specific Resource: [_1] ([_2])',$title,$resource).
+ ''.
' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$lt{'ic'} | $lt{'rl'} | $lt{'ic'} | @@ -1732,9 +1739,9 @@ ENDTABLEHEADFOUR '|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
'.$description.' | '; + $output .= &Apache::loncommon::start_data_table_row(). + ''.$description.' | '; if ($parameter =~ /^default_enrollment_(start|end)_date$/) { $output .= ''. &Apache::lonhtmlcommon::date_setter('envform', @@ -2261,17 +2280,19 @@ sub crsenv { $output .= ' | '. &Apache::lonhtmlcommon::checkbox($parameter.'_setparmval'). ' | '; - $output .= "||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'.&mt('Create New Environment Variable').' '. + $output.=&Apache::loncommon::start_data_table_row(). + ' | '.&mt('Create New Environment Variable').' '. ' | '. ' | '. - ' |
$lt{'par'} | $lt{'val'} | $lt{'set'}? | $lt{'par'} | $lt{'val'} | $lt{'set'}? | +$end_header_row $output -
---|
');
+ $r->print('
|