--- loncom/interface/lonparmset.pm 2006/04/14 16:38:43 1.287 +++ loncom/interface/lonparmset.pm 2007/01/12 20:04:16 1.357 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.287 2006/04/14 16:38:43 albertel Exp $ +# $Id: lonparmset.pm,v 1.357 2007/01/12 20:04:16 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -63,6 +63,9 @@ use Apache::lonhomework; use Apache::lonxml; use Apache::lonlocal; use Apache::lonnavmaps; +use Apache::longroup; +use Apache::lonrss; +use LONCAPA qw(:DEFAULT :match); # --- Caches local to lonparmset @@ -90,11 +93,11 @@ Inputs: $what - a parameter spec (inclu Returns: A list, the first item is the index into the remaining list of items of parm valuse that is the active one, the list consists of parm values at the 14 possible levels -14 - General Course -13 - Map or Folder level in course +14- General Course +13- Map or Folder level in course 12- resource default 11- map default -10 - resource level in course +10- resource level in course 9 - General for section 8 - Map or Folder level for section 7 - resource level in section @@ -117,15 +120,18 @@ sub parmval { sub parmval_by_symb { my ($what,$symb,$def,$uname,$udom,$csec,$cgroup,$courseopt)=@_; # load caches - &cacheparmhash(); - my $useropt=&Apache::lonnet::get_userresdata($uname,$udom); + my $useropt; + if ($uname ne '' && $udom ne '') { + $useropt = &Apache::lonnet::get_userresdata($uname,$udom); + } my $result=''; my @outpar=(); # ----------------------------------------------------- Cascading lookup scheme my $map=(&Apache::lonnet::decode_symb($symb))[0]; + $map = &Apache::lonnet::deversion($map); my $symbparm=$symb.'.'.$what; my $mapparm=$map.'___(all).'.$what; @@ -170,7 +176,7 @@ sub parmval_by_symb { } # ------------------------------------------------------ fourth, back to course - if (defined($csec)) { + if ($csec ne '') { if (defined($$courseopt{$seclevel})) { $outpar[9]=$$courseopt{$seclevel}; $result=9; @@ -186,7 +192,7 @@ sub parmval_by_symb { } } # ------------------------------------------------------ fifth, check course group - if (defined($cgroup)) { + if ($cgroup ne '') { if (defined($$courseopt{$grplevel})) { $outpar[6]=$$courseopt{$grplevel}; $result=6; @@ -203,7 +209,7 @@ sub parmval_by_symb { # ---------------------------------------------------------- fifth, check user - if (defined($uname)) { + if ($uname ne '') { if (defined($$useropt{$courselevel})) { $outpar[3]=$$useropt{$courselevel}; $result=3; @@ -266,10 +272,8 @@ sub resetrulescache { sub rulescache { my $id=shift; - if ($rulesid ne $env{'request.course.id'}) { - %rules=(); - } - unless (defined($rules{$id})) { + if ($rulesid ne $env{'request.course.id'} + && !defined($rules{$id})) { my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; %rules=&Apache::lonnet::dump('parmdefactions',$dom,$crs); @@ -394,41 +398,18 @@ sub storeparm_by_symb { return ''; } -{ - my $logid; - sub log_parmset { - my ($symb,$spnam,$snum,$nval,$ntype,$uname,$udom,$csec,$cgroup)=@_; - $logid++; - my $id=time().'00000'.$$.'00000'.$logid; - &Apache::lonnet::put('nohist_parameterlog', - { - $id.'_exe_uname' => $env{'user.name'}, - $id.'_exe_udom' => $env{'user.domain'}, - $id.'_exe_time' => time(), - $id.'_exe_ip' => $ENV{'REMOTE_ADDR'}, - $id.'_symb' => $symb, - $id.'_spnam' => $spnam, - $id.'_snum' => $snum, - $id.'_nval' => $nval, - $id.'_ntype' => $ntype, - $id.'_uname' => $uname, - $id.'_udom' => $udom, - $id.'_csec' => $csec, - $id.'_cgroup' => $cgroup - }, - $env{'course.'.$env{'request.course.id'}.'.domain'}, - $env{'course.'.$env{'request.course.id'}.'.num'} - ); - } +sub log_parmset { + return &Apache::lonnet::instructor_log('parameterlog',@_); } sub storeparm_by_symb_inner { # ---------------------------------------------------------- Get symb, map, etc my ($symb,$spnam,$snum,$nval,$ntype,$uname,$udom,$csec,$cgroup)=@_; - &log_parmset(@_); # ---------------------------------------------------------- Construct prefixes $spnam=~s/\_([^\_]+)$/\.$1/; my $map=(&Apache::lonnet::decode_symb($symb))[0]; + $map = &Apache::lonnet::deversion($map); + my $symbparm=$symb.'.'.$spnam; my $mapparm=$map.'___(all).'.$spnam; @@ -479,9 +460,11 @@ sub storeparm_by_symb_inner { if ($delete) { $reply=&Apache::lonnet::del ('resourcedata',[keys(%storecontent)],$cdom,$cnum); + &log_parmset(\%storecontent,1); } else { $reply=&Apache::lonnet::cput ('resourcedata',\%storecontent,$cdom,$cnum); + &log_parmset(\%storecontent); } &Apache::lonnet::devalidatecourseresdata($cnum,$cdom); } else { @@ -502,15 +485,17 @@ sub storeparm_by_symb_inner { if ($delete) { $reply=&Apache::lonnet::del ('resourcedata',[keys(%storecontent)],$udom,$uname); + &log_parmset(\%storecontent,1,$uname,$udom); } else { $reply=&Apache::lonnet::cput ('resourcedata',\%storecontent,$udom,$uname); + &log_parmset(\%storecontent,0,$uname,$udom); } &Apache::lonnet::devalidateuserresdata($uname,$udom); } if ($reply=~/^error\:(.*)/) { - return "Write Error: $1"; + return "Write Error: $1"; } return ''; } @@ -524,21 +509,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); @@ -606,7 +596,7 @@ sub plink { return '
'. ''. - &valout($value,$type).'
'; + &valout($value,$type,1).''; } sub page_js { @@ -671,8 +661,7 @@ sub startpage { &page_js(), {'add_entries' => \%loaditems,}); my $breadcrumbs = - &Apache::lonhtmlcommon::breadcrumbs(undef, - 'Table Mode Parameter Setting'); + &Apache::lonhtmlcommon::breadcrumbs('Table Mode Parameter Setting','Table_Mode'); $r->print(<'; + $parm.='
'.&mt('Automatically sets').' '.join(', ',split(/\:/,$automatic)).'
'; } $r->print(''.$parm.''); @@ -1074,15 +1063,15 @@ sub parmmenu { ENDSCRIPT $r->print(); - $r->print("\n"); + $r->print("\n
"); my $cnt=0; foreach $tempkey (&keysindisplayorder($allparms,$keyorder)) { - $r->print("\n'); + $r->print('>'.$$allparms{$tempkey}.''); $cnt++; if ($cnt==3) { $r->print("\n"); @@ -1090,7 +1079,7 @@ ENDSCRIPT } } $r->print(' - + @@ -1769,9 +1740,9 @@ ENDTABLEHEADFOUR '

'. "$title"); + &escape($symbp{$rid}). + "', 'metadatafile', '450', '500', 'no', 'yes');\"". + " target=\"_self\">$title"); if ($thistitle) { $r->print(' ('.$thistitle.')'); @@ -1968,7 +1939,7 @@ ENDMAPONE } if ($csec) {$r->print(&mt("Section")." $csec\n")}; - if ($cgroup) {$r->print(&mt("Group")." $csec\n")}; + if ($cgroup) {$r->print(&mt("Group")." $cgroup\n")}; $r->print("\n"); #---------------------------------------------------------------- print table $r->print('

+
Select All
Select Common Only
@@ -1140,21 +1129,15 @@ sub usermenu { 'oi' => "or ID", 'ad' => "at Domain" ); - my %sectionhash=(); my $sections=''; - my $numsec = &Apache::loncommon::get_sections( - $env{'course.'.$env{'request.course.id'}.'.domain'}, - $env{'course.'.$env{'request.course.id'}.'.num'}, - \%sectionhash); + my %sectionhash = &Apache::loncommon::get_sections(); + my $groups; - my %grouphash; - my $numgrp = &Apache::loncommon::coursegroups( - \%grouphash, - $env{'course.'.$env{'request.course.id'}.'.domain'}, - $env{'course.'.$env{'request.course.id'}.'.num'}); - if ($numsec > 0) { + my %grouphash = &Apache::longroup::coursegroups(); + + if (%sectionhash) { $sections=$lt{'se'}.': print(''); + foreach my $s ('all',sort keys %sectionhash) { + $r->print(' \n"); } - $r->print("\n"); - } + $r->print('>'.$s."\n"); + } + $r->print("\n"); } sub groupmenu { my ($r,$selectedgroups)=@_; - my %grouphash; - my $numgrp = &Apache::loncommon::coursegroups( - \%grouphash, - $env{'course.'.$env{'request.course.id'}.'.domain'}, - $env{'course.'.$env{'request.course.id'}.'.num'}); - if ($numgrp) { - $r->print('\n"); + my %grouphash = &Apache::longroup::coursegroups(); + return if (!%grouphash); + + $r->print('\n"); } @@ -1437,7 +1412,6 @@ sub assessparms { my $uhome; my $csec; my $cgroup; - my $grouplist; my @usersgroups = (); my $coursename=$env{'course.'.$env{'request.course.id'}.'.description'}; @@ -1509,8 +1483,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'}; @@ -1521,17 +1495,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'}; @@ -1541,18 +1515,14 @@ sub assessparms { $message="\n

\n".&mt("Full Name").": ". $name{'firstname'}.' '.$name{'middlename'}.' ' .$name{'lastname'}.' '.$name{'generation'}. - "
\n".&mt('ID').": ".$name{'id'}.'

'; + "
\n".&mt('ID').": ".$name{'id'}.'

'; } - $grouplist = &Apache::lonnet::get_users_groups( + @usersgroups = &Apache::lonnet::get_users_groups( $udom,$uname,$env{'request.course.id'}); - if ($grouplist) { - @usersgroups = &Apache::lonnet::sort_course_groups($grouplist, - $env{'request.course.id'}); - unless (grep/^\Q$cgroup\E$/,@usersgroups) { + if (@usersgroups > 0) { + unless (grep(/^\Q$cgroup\E$/,@usersgroups)) { $cgroup = $usersgroups[0]; - } - } else { - $cgroup = ''; + } } } } @@ -1593,7 +1563,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) { @@ -1608,8 +1578,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). + ''. '

'); } @@ -1669,7 +1640,7 @@ sub assessparms { ); $r->print(<$lt{'pie'} -

$lt{'csv'}
($csuname $lt{'at'} $csudom)
$lt{'csv'}
($csuname $lt{'at'} $csudom)
$lt{'ic'}$lt{'rl'} $lt{'ic'}
'); @@ -2011,8 +1982,8 @@ sub crsenv { my $r=shift; my $setoutput=''; - my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs(undef, - 'Edit Course Environment'); + my $breadcrumbs = + &Apache::lonhtmlcommon::breadcrumbs('Edit Course Environment'); my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; @@ -2035,7 +2006,7 @@ sub crsenv { ('environment', {'top level map backup '.$bkuptime => $tmp[1] }, $dom,$crs). - '
'; + '
'; } # # Deal with modified default spreadsheets @@ -2113,9 +2084,14 @@ sub crsenv { } } } + + my $start_table =&Apache::loncommon::start_data_table(); + my $start_header_row=&Apache::loncommon::start_data_table_header_row(); + my $end_header_row =&Apache::loncommon::end_data_table_header_row(); # ------------------------- Re-init course environment entries for this session - &Apache::lonnet::coursedescription($env{'request.course.id'}); + &Apache::lonnet::coursedescription($env{'request.course.id'}, + {'freshen_cache' => 1}); # -------------------------------------------------------- Get parameters again @@ -2128,9 +2104,9 @@ sub crsenv { ('url' => ''.&mt('Top Level Map').' '. '
". - &mt('Select Map').'
'. + &mt('Select Map').'
'. &mt('Modification may make assessment data inaccessible'). - '
', + '', 'description' => ''.&mt('Course Description').'', 'courseid' => ''.&mt('Course ID or number'). '
'. @@ -2141,7 +2117,7 @@ sub crsenv { 'default_xml_style' => ''.&mt('Default XML Style File').' '. '$SelectStyleFile
", + ",'sty')\">$SelectStyleFile
", 'question.email' => ''.&mt('Feedback Addresses for Resource Content Question'). '
(user:domain,'. 'user:domain(section;section;...;*;...),...)', @@ -2201,8 +2177,8 @@ sub crsenv { '('.&mt('or set value to "[_1]" to allow all roles',"yes").')', 'rndseed' => ''.&mt('Randomization algorithm used').'
'. - ''.&mt('Modifying this will make problems').' '. - &mt('have different numbers and answers').'', + ''.&mt('Modifying this will make problems').' '. + &mt('have different numbers and answers').'', 'receiptalg' => ''.&mt('Receipt algorithm used').'
'. &mt('This controls how receipt numbers are generated.'), @@ -2217,6 +2193,8 @@ sub crsenv { ' ('.&mt('supported types').': Letter [8 1/2x11 in], Legal [8 1/2x14 in],'. ' Tabloid [11x17 in], Executive [7 1/2x10 in], A2 [420x594 mm],'. ' A3 [297x420 mm], A4 [210x297 mm], A5 [148x210 mm], A6 [105x148 mm])', + 'print_header_format' + => 'Print header format; substitutions: %n student name %c course id %a assignment note, numbers after the % limit the field size', 'anonymous_quiz' => ''.&mt('Anonymous quiz/exam').'
'. ' ('.&mt('yes').' '.&mt('to avoid print students names').' )', @@ -2228,6 +2206,8 @@ sub crsenv { 'disable_receipt_display' => ''.&mt('Disable display of problem receipts').'
'. ' ('.&mt('"[_1]" to disable, anything else if not','yes').')', + 'task_messages' + => ''.&mt('Send message to student when clicking Done on Tasks. [_1] to send a message only to student, [_2] to send message to student and add record to user information page for instructors. Leave blank to disable.','only_student','student_and_user_notes_screen').'', 'disablesigfigs' => ''.&mt('Disable checking of Significant Figures').'
'. ' ('.&mt('"[_1]" to disable, anything else if not','yes').')', @@ -2255,6 +2235,7 @@ sub crsenv { 'problem_stream_switch', 'suppress_tries', 'default_paper_size', + 'print_header_format', 'disable_receipt_display', 'spreadsheet_default_classcalc', 'spreadsheet_default_studentcalc', @@ -2264,7 +2245,8 @@ sub crsenv { 'default_enrollment_end_date', 'tthoptions', 'disablesigfigs', - 'disableexampointprint' + 'disableexampointprint', + 'task_messages' ); foreach my $parameter (sort(keys(%values))) { unless (($parameter =~ m/^internal\./)||($parameter =~ m/^metadata\./)) { @@ -2274,13 +2256,15 @@ sub crsenv { } } } + foreach my $parameter (@Display_Order) { my $description = $descriptions{$parameter}; # onchange is javascript to automatically check the 'Set' button. my $onchange = 'onFocus="javascript:window.document.forms'. "['envform'].elements['".$parameter."_setparmval']". '.checked=true;"'; - $output .= '
'; + $output .= &Apache::loncommon::start_data_table_row(). + ''; if ($parameter =~ /^default_enrollment_(start|end)_date$/) { $output .= ''; - $output .= "\n"; + $output .= &Apache::loncommon::end_data_table_row()."\n"; } my $onchange = 'onFocus="javascript:window.document.forms'. '[\'envform\'].elements[\'newp_setparmval\']'. '.checked=true;"'; - $output.=''; + ''. + &Apache::loncommon::end_data_table_row()."\n"; } my %lt=&Apache::lonlocal::texthash( 'par' => 'Parameter', @@ -2325,20 +2311,22 @@ sub crsenv { ''; my $start_page = - &Apache::loncommon::start_page('Set Course Environment Parameters', + &Apache::loncommon::start_page('Set Course Environment', $browse_js); my $end_page = &Apache::loncommon::end_page(); + my $end_table=&Apache::loncommon::end_data_table(); $r->print(< $setoutput -

-

'.$description.''.$description.''. &Apache::lonhtmlcommon::date_setter('envform', @@ -2297,17 +2281,19 @@ sub crsenv { $output .= ''. &Apache::lonhtmlcommon::checkbox($parameter.'_setparmval'). '
'.&mt('Create New Environment Variable').'
'. + $output.=&Apache::loncommon::start_data_table_row(). + '
'.&mt('Create New Environment Variable').'
'. '
'. ''. - '
- +$start_table +$start_header_row + +$end_header_row $output -
$lt{'par'}$lt{'val'}$lt{'set'}?
$lt{'par'}$lt{'val'}$lt{'set'}?
+$end_table $end_page @@ -2354,7 +2342,7 @@ sub tablestart { return ''; } else { $tableopen=1; - return ''; } } @@ -2362,7 +2350,7 @@ sub tablestart { sub tableend { if ($tableopen) { $tableopen=0; - return '
'.&mt('Parameter').''. + return &Apache::loncommon::start_data_table().'
'.&mt('Parameter').''. &mt('Delete').''.&mt('Set to ...').'
'; + return &Apache::loncommon::end_data_table(); } else { return''; } @@ -2376,8 +2364,7 @@ sub readdata { my $classlist=&Apache::loncoursedata::get_classlist(); foreach (keys %$classlist) { - # the following undefs are for 'domain', and 'username' respectively. - if ($_=~/^(\w+)\:(\w+)$/) { + if ($_=~/^($match_username)\:($match_domain)$/) { my ($tuname,$tudom)=($1,$2); my $useropt=&Apache::lonnet::get_userresdata($tuname,$tudom); foreach my $userkey (keys %{$useropt}) { @@ -2421,11 +2408,12 @@ sub storedata { if (&Apache::lonnet::put('resourcedata',{$tkey=>$data, $tkey.'.type' => $typeof}, $tudom,$tuname) eq 'ok') { + &log_parmset({$tkey=>$data,$tkey.'.type' => $typeof},0,$tuname,$tudom); $r->print('
'.&mt('Stored modified parameter for').' '. &Apache::loncommon::plainname($tuname,$tudom)); } else { - $r->print('

'. - &mt('Error storing parameters').'

'); + $r->print('
'. + &mt('Error storing parameters').'
'); } &Apache::lonnet::devalidateuserresdata($tuname,$tudom); } else { @@ -2436,14 +2424,15 @@ sub storedata { } elsif ($cmd eq 'del') { if ($tuname) { if (&Apache::lonnet::del('resourcedata',[$tkey],$tudom,$tuname) eq 'ok') { + &log_parmset({$tkey=>''},1,$tuname,$tudom); $r->print('
'.&mt('Deleted parameter for').' '.&Apache::loncommon::plainname($tuname,$tudom)); } else { - $r->print('

'. - &mt('Error deleting parameters').'

'); + $r->print('
'. + &mt('Error deleting parameters').'
'); } &Apache::lonnet::devalidateuserresdata($tuname,$tudom); } else { - push (@deldata,$thiskey); + push (@deldata,$thiskey,$thiskey.'.type'); } } elsif ($cmd eq 'datepointer') { my $data=&Apache::lonhtmlcommon::get_date_from_form($env{$_}); @@ -2453,10 +2442,11 @@ sub storedata { if (&Apache::lonnet::put('resourcedata',{$tkey=>$data, $tkey.'.type' => $typeof}, $tudom,$tuname) eq 'ok') { + &log_parmset({$tkey=>$data,$tkey.'.type' => $typeof},0,$tuname,$tudom); $r->print('
'.&mt('Stored modified date for').' '.&Apache::loncommon::plainname($tuname,$tudom)); } else { - $r->print('

'. - &mt('Error storing parameters').'

'); + $r->print('
'. + &mt('Error storing parameters').'
'); } &Apache::lonnet::devalidateuserresdata($tuname,$tudom); } else { @@ -2473,19 +2463,22 @@ sub storedata { my $putentries=$#newdatakeys+1; if ($delentries) { 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)); } else { - $r->print('

'. - &mt('Error deleting parameters').'

'); + $r->print('
'. + &mt('Error deleting parameters').'
'); } &Apache::lonnet::devalidatecourseresdata($crs,$dom); } if ($putentries) { if (&Apache::lonnet::put('resourcedata',\%newdata,$dom,$crs) eq 'ok') { + &log_parmset(\%newdata,0); $r->print('

'.&mt('Stored [_1] parameter(s)',$putentries/2).'

'); } else { - $r->print('

'. - &mt('Error storing parameters').'

'); + $r->print('
'. + &mt('Error storing parameters').'
'); } &Apache::lonnet::devalidatecourseresdata($crs,$dom); } @@ -2493,7 +2486,7 @@ sub storedata { sub extractuser { my $key=shift; - return ($key=~/^$env{'request.course.id'}.\[useropt\:(\w+)\:(\w+)\]\./); + return ($key=~/^$env{'request.course.id'}.\[useropt\:($match_username)\:($match_domain)\]\./); } sub listdata { @@ -2551,7 +2544,7 @@ sub listdata { my $section=&mt('All Students'); if ($middle=~/^\[(.*)\]/) { my $issection=$1; - if ($issection=~/^useropt\:(\w+)\:(\w+)/) { + if ($issection=~/^useropt\:($match_username)\:($match_domain)/) { $section=&mt('User').": ".&Apache::loncommon::plainname($1,$2); } else { $section=&mt('Group/Section').': '.$issection; @@ -2560,12 +2553,12 @@ sub listdata { } $middle=~s/\.+$//; $middle=~s/^\.+//; - my $realm=''.&mt('All Resources').''; + my $realm=''.&mt('All Resources').''; if ($middle=~/^(.+)\_\_\_\(all\)$/) { - $realm=''.&mt('Folder/Map').': '.&Apache::lonnet::gettitle($1).'
('.$1.')
'; + $realm=''.&mt('Folder/Map').': '.&Apache::lonnet::gettitle($1).'
('.$1.')
'; } elsif ($middle) { my ($map,$id,$url)=&Apache::lonnet::decode_symb($middle); - $realm=''.&mt('Resource').': '.&Apache::lonnet::gettitle($middle).'
('.$url.' in '.$map.' id: '.$id.')
'; + $realm=''.&mt('Resource').': '.&Apache::lonnet::gettitle($middle).'
('.$url.' in '.$map.' id: '.$id.')
'; } if ($sortorder eq 'realmstudent') { if ($realm ne $oldrealm) { @@ -2592,23 +2585,16 @@ sub listdata { } if ($part ne $oldpart) { $r->print(&tableend(). - "\n".&mt('Part').": $part"); + "\n".&mt('Part').": $part"); $oldpart=$part; } # -# Preset defaults? -# - my ($hour,$min,$sec,$val)=('','','',''); - unless ($$resourcedata{$thiskey}) { - my ($parmname)=($thiskey=~/\.(\w+)$/); - ($hour,$min,$sec,$val)=&preset_defaults($parmname); - } - -# # Ready to print # - $r->print(&tablestart().''.$name. - ':'); $foundkeys++; if (&isdateparm($thistype)) { @@ -2618,7 +2604,7 @@ sub listdata { &Apache::lonhtmlcommon::date_setter('parmform', $jskey, $$resourcedata{$thiskey}, - '',1,'','',$hour,$min,$sec). + '',1,'',''). ''. &date_sanity_info($$resourcedata{$thiskey}) ); @@ -2626,8 +2612,6 @@ sub listdata { my $showval; if (defined($$resourcedata{$thiskey})) { $showval=$$resourcedata{$thiskey}; - } else { - $showval=$val; } $r->print('