--- loncom/interface/lonparmset.pm 2011/01/13 17:44:30 1.506 +++ loncom/interface/lonparmset.pm 2013/08/08 05:52:14 1.522.2.8 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.506 2011/01/13 17:44:30 www Exp $ +# $Id: lonparmset.pm,v 1.522.2.8 2013/08/08 05:52:14 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -137,33 +137,41 @@ javascript function 'pjump'. =item extractResourceInformation() : -Given the course data hash, extractResourceInformation extracts lots of information about the course's resources into a variety of hashes. + extractResourceInformation extracts lots of information about all of the the course's resources into a variety of hashes. Input: See list below: -=item * B : An array that will contain all of the ids in the course. +=item * B : Current username -=item * B : hash, id->type, where "type" contains the extension of the file, thus, I. +=item * B : Domain of current user. -=item * B : hash, id->key list, will contain a comma separated list of the meta-data keys available for the given id +=item * b : hash, name of parameter->display value (what is the display value?) +Outputs: See list below: -=item * B : hash, part identification->text representation of part, where the text representation is "[Part $part]" +=item * B (out) : An array that will contain all of the ids in the course. -=item * B : hash, full key to part->display value (what's display value?) +=item * B(out) : hash, id->type, where "type" contains the extension of the file, thus, I. -=item * B : hash, ??? +=item * B (out) : hash, id->key list, will contain a comma separated list of the meta-data keys available for the given id -=item * B : ??? +=item * B (out) : hash, name of parameter->display value (what is the display value?) -=item * B : hash, ??? +=item * B (out) : hash, part identification->text representation of part, where the text representation is "[Part $part]" + +=item * B (out) : hash, ??? =item * B : ?? =item * B : hash, id->full sym? +=item * B + +=item * B + +=item * B +=item * B =item isdateparm() @@ -196,8 +204,8 @@ Input: See list below: Show assessment data and parameters. This is a large routine that should be simplified and shortened... someday. -Inputs: $r - +Inputs: $r - the Apache request object. + Returns: nothing Variables used (guessed by Jeremy): @@ -632,7 +640,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 { @@ -739,11 +747,14 @@ sub valout { my $result = ''; # Values of zero are valid. if (! $value && $value ne '0') { - if ($editable) { - $result = '*'; - } else { - $result=' '; - } + if ($editable) { + $result = + ''.&mt('Change').''; + } else { + $result=' '; + } } else { if ($type eq 'date_interval') { my ($sec,$min,$hour,$mday,$mon,$year)=gmtime($value); @@ -784,6 +795,7 @@ sub valout { &date_sanity_info($value); } else { $result = $value; + $result=~s/\,/\, /gs; $result = &HTML::Entities::encode($result,'"<>&'); } } @@ -825,16 +837,10 @@ sub page_js { return(< // "pclose()", - 'onload' => "showHide_courseContent(); group_or_section('cgroup')", - ); + my %loaditems = ( + 'onload' => "group_or_section('cgroup')", + ); + if (!$psymb) { + $loaditems{'onload'} = "showHide_courseContent(); group_or_section('cgroup'); resize_scrollbox('mapmenuscroll','1','1');"; + } if ((($env{'form.command'} eq 'set') && ($env{'form.url'}) && (!$env{'form.dis'})) || ($env{'form.symb'})) { @@ -885,17 +915,23 @@ sub startpage { text=>"Table Mode", help => 'Course_Setting_Parameters'}); } + my $js = &page_js().' + +'; my $start_page = - &Apache::loncommon::start_page('Set/Modify Course Parameters', - &page_js(), + &Apache::loncommon::start_page('Set/Modify Course Parameters',$js, {'add_entries' => \%loaditems,}); my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Table Mode Parameter Setting','Table_Mode'); my $escfilter=&Apache::lonhtmlcommon::entity_encode($env{'form.filter'}); my $escpart=&Apache::lonhtmlcommon::entity_encode($env{'form.part'}); + $r->print($start_page.$breadcrumbs); $r->print(< @@ -1046,6 +1082,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])); @@ -1143,6 +1183,7 @@ sub extractResourceInformation { $$typep{$id}=$1; $$keyp{$id}=''; $$uris{$id}=$srcf; + foreach my $key (split(/\,/,&Apache::lonnet::metadata($srcf,'allpossiblekeys'))) { next if ($key!~/^parameter_/); @@ -1198,7 +1239,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}); } @@ -1242,14 +1283,12 @@ sub parmmenu { ele = document.forms.parmform.elements[i]; if (ele.name == checkName) { document.forms.parmform.elements[i].checked=value; - document.getElementById(document.forms.parmform.elements[i].value.concat(li)).style.display = displayOverview; } } } function checkthis(thisvalue, checkName) { - document.getElementById(thisvalue.concat("_li")).style.display = ""; for (i=0; i ENDSCRIPT - $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parameters to View'))); - - #part to print selected parms overview - $r->print(&mt('Selected Parameters:').'
'); - - #print out all possible parms and hide them by default - $r->print('
    '); - foreach $tempkey (&keysindisplayorder($allparms,$keyorder)) { - $r->print('
  • print(' style="display:none"'); - } - $r->print('>' - .($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey} : $tempkey) - .'
  • ' - ); - } - $r->print('
'); $r->print('
'); &shortCuts($r,$allparms,$pscat,$keyorder); $r->print('
'); - - $r->print( - '

' - .&mt('Show detailed Parameter Selection') - .'

' - ); - - $r->print(&Apache::lonhtmlcommon::row_closure(1)); } # return a hash sub categories { @@ -1377,6 +1373,8 @@ sub lookUpTableParameter { 'contentopen' => 'time_settings', 'contentclose' => 'time_settings', 'discussend' => 'time_settings', + 'printopendate' => 'time_settings', + 'printclosedate' => 'time_settings', 'weight' => 'grading', 'handgrade' => 'grading', 'maxtries' => 'tries', @@ -1408,7 +1406,10 @@ sub lookUpTableParameter { 'acc' => 'misc', 'maxcollaborators' => 'misc', 'scoreformat' => 'misc', - + 'lenient' => 'grading', + 'retrypartial' => 'tries', + 'discussvote' => 'misc', + 'examcode' => 'high_level_randomization', ); } @@ -1476,56 +1477,36 @@ sub parmboxes { 'file_submission' => [], 'misc' => [], ); - my $hidelink = - '

' - .'' - .&mt('Hide detailed Parameter Selection') - .'' - .'

' - ."\n"; -; + foreach $tempparameter (keys %$allparms) { &whatIsMyCategory($tempparameter, \%categoryList); } #part to print the parm-list - $r->print( - ''); @@ -2293,6 +2290,7 @@ COURSECONTENTSCRIPT .'' .'

'); } else { + $r->print(); # parameter screen for a single resource. my ($map,$iid,$resource)=&Apache::lonnet::decode_symb($pssymb); my $title = &Apache::lonnet::gettitle($pssymb); @@ -2313,7 +2311,7 @@ COURSECONTENTSCRIPT $r->print(&Apache::lonhtmlcommon::end_pick_box()); $r->print('

' .'' + .' value="'.&mt('Update Display').'" />' .'' .'

'); } @@ -2348,7 +2346,7 @@ COURSECONTENTSCRIPT $coursespan += 3; } - $r->print('

'); + $r->print(&Apache::loncommon::start_data_table()); # # This produces the headers # @@ -2458,7 +2456,6 @@ ENDTABLEHEADFOUR my $uri=&Apache::lonnet::declutter($uris{$rid}); my $filter=$env{'form.filter'}; - foreach (&keysplit($keyp{$rid})) { my $tempkeyp = $_; if (grep $_ eq $tempkeyp, @catmarker) { @@ -2513,8 +2510,8 @@ ENDTABLEHEADFOUR $r->print(''); - foreach (&keysinorder_bytype(\%name,\%keyorder)) { + unless ($firstrow) { $r->print(''); } else { @@ -2529,7 +2526,7 @@ ENDTABLEHEADFOUR } } # end foreach ids # -------------------------------------------------- End entry for one resource - $r->print('
'.$maptitles{$mapp{$rid}}.'
'); + $r->print(&Apache::loncommon::end_data_table); } # end of full #--------------------------------------------------- Entry for parm level map if ($parmlev eq 'map') { @@ -2745,7 +2742,8 @@ ENDMAPONE ); } # end of $parmlev eq general } - $r->print(''.&Apache::loncommon::end_page()); + $r->print(''); + $r->print(&Apache::loncommon::end_page()); } # end sub assessparms ################################################## @@ -2818,25 +2816,40 @@ sub storedata { $tkey=~s/\.\[useropt\:$tuname\:$tudom\]\./\./; } if ($cmd eq 'set' || $cmd eq 'datepointer' || $cmd eq 'dateinterval') { - my ($data, $typeof, $text); + my ($data, $typeof, $text, $name); if ($cmd eq 'set') { $data=$env{$key}; $typeof=$env{'form.typeof_'.$thiskey}; $text = &mt('Saved modified parameter for'); if ($typeof eq 'string_questiontype') { + $name = 'type'; + } elsif ($typeof eq 'string_lenient') { + $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'; + } + } + if ($name ne '') { my ($needsrelease,$needsnewer); - $needsrelease = $Apache::lonnet::needsrelease{'parameter:type:'.$data}; + $needsrelease = $Apache::lonnet::needsrelease{"parameter:$name:$data"}; if ($needsrelease) { unless ($got_chostname) { - ($chostname,$cmajor,$cminor)=&questiontype_release_vars(); + ($chostname,$cmajor,$cminor)=¶meter_release_vars(); $got_chostname = 1; } - $needsnewer = &questiontype_releasecheck($data,$needsrelease, - $chostname,$cmajor, - $cminor); + $needsnewer = ¶meter_releasecheck($name,$data, + $needsrelease, + $chostname,$cmajor, + $cminor); } if ($needsnewer) { - $r->print('
'.&oldversion_warning($data,$chostname,$cmajor, + $r->print('
'.&oldversion_warning($name,$data, + $chostname,$cmajor, $cminor,$needsrelease)); next; } @@ -2892,7 +2905,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').'
'); @@ -3071,7 +3084,7 @@ sub listdata { $$resourcedata{$thiskey})); } elsif ($thistype =~ m/^string/) { $r->print(&string_selector($thistype,$thiskey, - $$resourcedata{$thiskey})); + $$resourcedata{$thiskey},$name)); } else { $r->print(&default_selector($thiskey,$$resourcedata{$thiskey})); } @@ -3145,6 +3158,14 @@ my %strings = [ 'randomizetry', 'New Randomization Each N Tries (default N=1)'], [ 'practice', 'Practice'], [ 'surveycred', 'Survey (credit for submission)']], + 'string_lenient' + => [['yes', 'Yes' ], + [ 'no', 'No' ], + [ 'default', 'Default - only bubblesheet grading is lenient' ]], + 'string_discussvote' + => [['yes','Yes'], + ['notended','Yes, unless discussion ended'], + ['no','No']], ); sub standard_string_options { @@ -3156,33 +3177,37 @@ sub standard_string_options { } sub string_selector { - my ($thistype, $thiskey, $showval) = @_; + my ($thistype, $thiskey, $showval, $name) = @_; if (!exists($strings{$thistype})) { return &default_selector($thiskey,$showval); } my %skiptype; - if ($thistype eq 'string_questiontype') { + if (($thistype eq 'string_questiontype') || + ($thistype eq 'string_lenient') || + ($thistype eq 'string_discussvote') || + ($name eq 'retrypartial')) { my ($got_chostname,$chostname,$cmajor,$cminor); foreach my $possibilities (@{ $strings{$thistype} }) { next unless (ref($possibilities) eq 'ARRAY'); - my ($name, $description) = @{ $possibilities }; - my $needsrelease=$Apache::lonnet::needsrelease{'parameter:type:'.$name}; + my ($parmval, $description) = @{ $possibilities }; + my $needsrelease=$Apache::lonnet::needsrelease{"parameter:$name:$parmval"}; if ($needsrelease) { unless ($got_chostname) { - ($chostname,$cmajor,$cminor)=&questiontype_release_vars(); + ($chostname,$cmajor,$cminor)=¶meter_release_vars(); $got_chostname = 1; } - my $needsnewer=&questiontype_releasecheck($name,$needsrelease, - $chostname,$cmajor, - $cminor); + my $needsnewer=¶meter_releasecheck($name,$parmval,$needsrelease, + $chostname,$cmajor, + $cminor); if ($needsnewer) { - $skiptype{$name} = 1; + $skiptype{$parmval} = 1; } } } } + my $result; my $numinrow = 3; @@ -3275,11 +3300,24 @@ sub newoverview { my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setoverview', text=>"Overview Mode"}); - my $start_page = &Apache::loncommon::start_page('Set Parameters'); + + my %loaditems = ( + 'onload' => "showHide_courseContent(); resize_scrollbox('mapmenuscroll','1','1');", + ); + my $js = ' + +'; + my $start_page = &Apache::loncommon::start_page('Set Parameters',$js, + {'add_entries' => \%loaditems,}); my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview'); + $r->print($start_page.$breadcrumbs); $r->print(< ENDOVER my @ids=(); @@ -3341,7 +3379,7 @@ ENDOVER $r->print('
'); #$r->print('

Step 1

'); $r->print('
'); - $r->print(&Apache::lonhtmlcommon::start_pick_box()); + $r->print(&Apache::lonhtmlcommon::start_pick_box(undef,'parmlevel')); &levelmenu($r,\%alllevs,$parmlev); if ($parmlev ne 'general') { $r->print(&Apache::lonhtmlcommon::row_closure()); @@ -3353,10 +3391,7 @@ ENDOVER $r->print('
'); $r->print('
'); - $r->print(&Apache::lonhtmlcommon::start_pick_box()); - &parmmenu($r,\%allparms,\@pscat,\%keyorder); - $r->print(&Apache::lonhtmlcommon::end_pick_box()); - &parmboxes($r,\%allparms,\@pscat,\%keyorder); + &displaymenu($r,\%allparms,\@pscat,\%keyorder); $r->print(&Apache::lonhtmlcommon::start_pick_box()); $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View'))); $r->print(''. @@ -3406,7 +3441,8 @@ ENDOVER } $r->print(&tableend(). ((($env{'form.store'}) || ($env{'form.dis'}))?'

':''). - ''.&Apache::loncommon::end_page()); + ''); + $r->print(&Apache::loncommon::end_page()); } sub secgroup_lister { @@ -3453,11 +3489,9 @@ sub overview { text=>"Overview Mode"}); my $start_page=&Apache::loncommon::start_page('Modify Parameters'); my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview'); - $r->print(< -ENDOVER + $r->print($start_page.$breadcrumbs); + $r->print('
'); + # Store modified &storedata($r,$crs,$dom); @@ -3476,7 +3510,7 @@ ENDOVER my $foundkeys=&listdata($r,$resourcedata,$resourcedata,$sortorder); $r->print(&tableend().'

'. - ($foundkeys?'':&mt('There are no parameters.')).'

'. + ($foundkeys?'':''.&mt('There are no parameters.').'').'

'. &Apache::loncommon::end_page()); } @@ -3552,8 +3586,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(''); @@ -3562,8 +3597,8 @@ ENDOVER } $r->print(&Apache::loncommon::end_data_table().'

'. ''. - '

'. - &Apache::loncommon::end_page()); + '

'); + $r->print(&Apache::loncommon::end_page()); } sub date_shift_one { @@ -3575,15 +3610,13 @@ sub date_shift_one { text=>"Shifting Dates"}); my $start_page=&Apache::loncommon::start_page('Shift Dates'); my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Shift'); - $r->print(<print('
'. + $r->print($start_page.$breadcrumbs); + $r->print(''. '
'. '
'.&mt('Currently set date:').''. &Apache::lonlocal::locallocaltime($env{'form.timebase'}).'
'.&mt('Shifted date:').''. - &Apache::lonhtmlcommon::date_setter('shiftform', + &Apache::lonhtmlcommon::dshowerfuck.net +ate_setter('shiftform', 'timeshifted', $env{'form.timebase'},, ''). @@ -3602,10 +3635,7 @@ sub date_shift_two { text=>"Shifting Dates"}); my $start_page=&Apache::loncommon::start_page('Shift Dates'); my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Shift'); - $r->print(<print($start_page.$breadcrumbs); my $timeshifted=&Apache::lonhtmlcommon::get_date_from_form('timeshifted'); $r->print(&mt('Shifting all dates such that [_1] becomes [_2]', &Apache::lonlocal::locallocaltime($env{'form.timebase'}), @@ -3656,7 +3686,7 @@ sub parse_key { sub header { - return &Apache::loncommon::start_page('Parameter Manager'); + return &Apache::loncommon::start_page('Content and Problem Settings'); } @@ -3665,7 +3695,7 @@ sub print_main_menu { my ($r,$parm_permission)=@_; # $r->print(&header()); - $r->print(&Apache::lonhtmlcommon::breadcrumbs('Parameter Manager')); + $r->print(&Apache::lonhtmlcommon::breadcrumbs('Content and Problem Settings')); $r->print(< @@ -3675,12 +3705,17 @@ ENDMAINFORMHEAD my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; my $vgr = &Apache::lonnet::allowed('vgr',$env{'request.course.id'}); my $mgr = &Apache::lonnet::allowed('mgr',$env{'request.course.id'}); + my $dcm = &Apache::lonnet::allowed('dcm',$env{'request.course.id'}); + if ((!$dcm) && ($env{'request.course.sec'} ne '')) { + $dcm = &Apache::lonnet::allowed('dcm',$env{'request.course.id'}. + '/'.$env{'request.course.sec'}); + } my $crstype = &Apache::loncommon::course_type(); my $lc_crstype = lc($crstype); my @menu = - ( { categorytitle=>"Settings for this $crstype", + ( { categorytitle=>"Content Settings for this $crstype", items => [ { linktext => 'Portfolio Metadata', url => '/adm/parmset?action=setrestrictmeta', @@ -3694,7 +3729,12 @@ ENDMAINFORMHEAD linktitle => "Reset access times for folders/maps, resources or the $lc_crstype." , icon => 'start-here.png' , }, - + { linktext => 'Blocking Communication/Resource Access', + url => '/adm/setblock', + permission => $dcm, + linktitle => 'Configure blocking of communication/collaboration and access to resources during an exam', + icon => 'comblock.png', + }, { linktext => 'Set Parameter Setting Default Actions', url => '/adm/parmset?action=setdefaults', permission => $parm_permission, @@ -3741,6 +3781,7 @@ ENDMAINFORMHEAD }]} ); $r->print(&Apache::lonhtmlcommon::generate_menu(@menu)); + $r->print(''.&Apache::loncommon::end_page()); return; } @@ -3869,7 +3910,7 @@ sub order_meta_fields { foreach my $key (@fields_in_order) { $r->print('
'); $r->print('
'); - $r->print(''); for (my $i = 1;$i le $num_fields;$i ++) { if ($i eq $idx) { $r->print(''); @@ -4074,11 +4115,8 @@ sub defaultsetter { my $start_page = &Apache::loncommon::start_page('Parameter Setting Default Actions'); my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Defaults'); - $r->print(< -ENDDEFHEAD + $r->print($start_page.$breadcrumbs); + $r->print(''); my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; @@ -4223,8 +4261,8 @@ ENDYESNO } $r->print(&Apache::loncommon::end_data_table(). "\n".''."\n". - &Apache::loncommon::end_page()); + &mt('Save').'" />'."\n"); + $r->print(&Apache::loncommon::end_page()); return; } @@ -4314,16 +4352,22 @@ sub parm_change_log { my ($r)=@_; &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=settable', text=>"Parameter Change Log"}); - $r->print(&Apache::loncommon::start_page('Parameter Change Log')); + my $js = ''."\n"; + $r->print(&Apache::loncommon::start_page('Parameter Change Log',$js)); $r->print(&Apache::lonhtmlcommon::breadcrumbs('Parameter Change Log')); - my %parmlog=&Apache::lonnet::dump('nohist_parameterlog', $env{'course.'.$env{'request.course.id'}.'.domain'}, $env{'course.'.$env{'request.course.id'}.'.num'}); if ((keys(%parmlog))[0]=~/^error\:/) { undef(%parmlog); } - $r->print('
print('
'. + '
'.&mt('Display of Changes').''. + ''); my %saveable_parameters = ('show' => 'scalar',); @@ -4331,10 +4375,9 @@ sub parm_change_log { \%saveable_parameters); &Apache::loncommon::restore_course_settings('parameter_log', \%saveable_parameters); - $r->print(&Apache::loncommon::display_filter(). - ''. - ''); + $r->print(&Apache::loncommon::display_filter('parmslog').' '."\n". + ''. + '

'); my $courseopt=&Apache::lonnet::get_courseresdata($env{'course.'.$env{'request.course.id'}.'.num'}, $env{'course.'.$env{'request.course.id'}.'.domain'}); @@ -4531,10 +4574,10 @@ sub update_slots { action => 'reserve', context => 'parameter', ); - &Apache::lonnet::instructor_log('slotreservationslog',\%storehash, + &Apache::lonnet::write_log('course','slotreservationslog',\%storehash, '',$uname,$udom,$cnum,$cdom); - &Apache::lonnet::instructor_log($cdom.'_'.$cnum.'_slotlog',\%storehash, + &Apache::lonnet::write_log('course',$cdom.'_'.$cnum.'_slotlog',\%storehash, '',$uname,$udom,$uname,$udom); } return $success; @@ -4565,9 +4608,9 @@ sub delete_slots { action => 'release', context => 'parameter', ); - &Apache::lonnet::instructor_log('slotreservationslog',\%storehash, + &Apache::lonnet::write_log('course','slotreservationslog',\%storehash, 1,$uname,$udom,$cnum,$cdom); - &Apache::lonnet::instructor_log($cdom.'_'.$cnum.'_slotlog',\%storehash, + &Apache::lonnet::write_log('course',$cdom.'_'.$cnum.'_slotlog',\%storehash, 1,$uname,$udom,$uname,$udom); } } @@ -4581,7 +4624,7 @@ sub check_for_course_info { return 0; } -sub questiontype_release_vars { +sub parameter_release_vars { my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; my $chome = $env{'course.'.$env{'request.course.id'}.'.home'}; my $chostname = &Apache::lonnet::hostname($chome); @@ -4590,35 +4633,47 @@ sub questiontype_release_vars { return ($chostname,$cmajor,$cminor); } -sub questiontype_releasecheck { - my ($questiontype,$needsrelease,$chostname,$cmajor,$cminor) = @_; +sub parameter_releasecheck { + my ($name,$value,$needsrelease,$chostname,$cmajor,$cminor) = @_; my $needsnewer; my ($needsmajor,$needsminor) = split(/\./,$needsrelease); if (($cmajor < $needsmajor) || ($cmajor == $needsmajor && $cminor < $needsminor)) { $needsnewer = 1; } else { - &Apache::lonnet::update_released_required($Apache::lonnet::needsrelease{'parameter:type:'.$questiontype}); + &Apache::lonnet::update_released_required($Apache::lonnet::needsrelease{'parameter:'.$name.':'.$value}); } return $needsnewer; } sub oldversion_warning { - my ($questiontype,$chostname,$cmajor,$cminor,$needsrelease) = @_; + my ($name,$value,$chostname,$cmajor,$cminor,$needsrelease) = @_; my $desc; - if (ref($strings{'string_questiontype'}) eq 'ARRAY') { - foreach my $possibilities (@{ $strings{'string_questiontype'} }) { - next unless (ref($possibilities) eq 'ARRAY'); - my ($name, $description) = @{ $possibilities }; - if ($name eq $questiontype) { - $desc = $description; - last; + my %stringtypes = ( + type => 'string_questiontype', + lenient => 'string_lenient', + retrypartial => 'string_yesno', + discussvote => 'string_discussvote', + examcode => 'string_examcode', + ); + if (exists($stringtypes{$name})) { + if ($name eq 'examcode') { + $desc = $value; + } elsif (ref($strings{$stringtypes{$name}}) eq 'ARRAY') { + foreach my $possibilities (@{ $strings{$stringtypes{$name}} }) { + next unless (ref($possibilities) eq 'ARRAY'); + my ($parmval, $description) = @{ $possibilities }; + if ($parmval eq $value) { + $desc = $description; + last; + } } } } + my $standard_name = &standard_parameter_names($name); return '

'. - &mt('Question Type was [_1]not[_2] set to [_3].', - '','','"'.$desc.'"').'
'. + &mt('[_1] was [_2]not[_3] set to [_4].', + $standard_name,'','','"'.$desc.'"').'
'. &mt('LON-CAPA version ([_1]) installed on home server ([_2]) does not meet version requirements ([_3] or newer).', $cmajor.'.'.$cminor,$chostname, $needsrelease). @@ -4645,7 +4700,7 @@ sub handler { &Apache::lonhtmlcommon::clear_breadcrumbs(); &Apache::lonhtmlcommon::add_breadcrumb({href=>"/adm/parmset", - text=>"Parameter Manager", + text=>"Content and Problem Settings", faq=>10, bug=>'Instructor Interface', help =>