--- loncom/interface/lonblockingmenu.pm 2016/10/23 14:35:32 1.22 +++ loncom/interface/lonblockingmenu.pm 2021/01/02 21:07:36 1.29 @@ -2,7 +2,7 @@ # Routines for configuring blocking of access to collaborative functions, # and specific resources during an exam # -# $Id: lonblockingmenu.pm,v 1.22 2016/10/23 14:35:32 raeburn Exp $ +# $Id: lonblockingmenu.pm,v 1.29 2021/01/02 21:07:36 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -116,7 +116,7 @@ Outputs: 2 $readonly - true if modification of blocking events is prohibited. $allowed - true if blocking events information can be shown. - + =item &get_timed_items() @@ -252,7 +252,7 @@ Inputs: 8 - $blockcount - number of existing blocking events in course - $readonly - if true, modification not allowed. - + Output: None @@ -345,7 +345,7 @@ Outputs: 1 - $intervalform - web form el =item &interval_details() Creates name/scope of current interval and expandable/collapsible -showing which interval parameters apply to the current folder/resource +showing which interval parameters apply to the current folder/resource Inputs: 6 @@ -362,7 +362,7 @@ Inputs: 6 - $parmcount - unique ID for current element. -Outputs: 2 +Outputs: 2 - $itemname - name/scope of interval (timer) parameter @@ -435,10 +435,10 @@ containing details about item with timed Inputs: none Output: 1 Javascript (with tags) for functions used to: - toggle visibility of unordered list for display of detailed + toggle visibility of unordered list for display of detailed information about intervals. - -=back + +=back =cut @@ -527,7 +527,7 @@ sub handler { $r->print(&Apache::loncourserespicker::create_picker($navmap, 'examblock','resourceblocks',$crstype, \%blockedmaps,\%blockedresources, - $env{'form.block'},'','',undef,$readonly)); + $env{'form.block'},'','',undef,undef,$readonly)); } else { $r->print($errormsg); } @@ -578,6 +578,7 @@ sub handler { my %lt=&Apache::lonlocal::texthash ( 'cbds' => 'Blocking communication and/or content access during exams', 'prev' => "For the duration of an exam, or a timed quiz, students in this course can be prevented from:", + 'flow' => "For the duration of an exam, or a timed quiz, event-driven interruptions to a student's workflow can be suppressed:", 'blca' => "Blocks can potentially interrupt legitimate communication between $usertype who are also both enrolled in a different LON-CAPA $lctype.", 'pobl' => "Portfolio blocking can impact a student's ability to complete assignments in courses besides your own. Please use this feature wisely.", 'actt' => "Action to take:", @@ -617,19 +618,26 @@ sub handler { ''. + $lt{'flow'}. + ''. '

'.$lt{'blca'}.'
'.$lt{'pobl'}.'

' ); } # ------------------------ Choose between modifying existing block or adding new $r->print('
'); - - unless ($readonly) { + + unless ($readonly) { if ($blockcount > 0) { $r->print(<<"END");
@@ -658,20 +666,19 @@ END &Apache::loncourserespicker::get_navmap_object($crstype,'examblock'); # --------------------------------------------- Interface for adding a new block - if ($readonly) { - if (!$blockcount) { - $r->print($lt{'ncbc'}.'
'); - } - } else { + unless ($readonly) { &display_addblocker_table($r,$blockcount,\%ltext,\%intervals, $navmap,$errormsg); if ($blockcount > 0) { $r->print('
'); } } - # ------------------------------------------------ Interface for existing blocks - if ($blockcount > 0) { + if (!$blockcount) { + if ($readonly) { + $r->print($lt{'ncbc'}.'
'); + } + } else { &display_blocker_status($r,\%records,\%ltext,\%intervals, $navmap,$errormsg,$blockcount,$readonly); } @@ -878,6 +885,24 @@ sub blockstore { &escape($env{'form.title_'.$key})).'
'; } } + if ($blocktypes->{'alert'} eq 'on') { + ($status,$needsrelease) = &check_release_required('alert',$chomemajor,$chomeminor); + if ($status eq 'fail') { + $blocktypes->{'alert'} = 'off'; + $output .= '

'. + &mt('Message Alert blocking not allowed for [_1]', + &escape($env{'form.title_'.$key})).'
'; + } + } + if ($blocktypes->{'reinit'} eq 'on') { + ($status,$needsrelease) = &check_release_required('reinit',$chomemajor,$chomeminor); + if ($status eq 'fail') { + $blocktypes->{'reinit'} = 'off'; + $output .= '

'. + &mt('Course Re-initialization blocking not allowed for [_1]', + &escape($env{'form.title_'.$key})).'
'; + } + } } if ($blockdocs) { ($status,$needsrelease) = &check_release_required('docs',$chomemajor,$chomeminor); @@ -1437,7 +1462,7 @@ sub create_interval_form { if (ref($resobj)) { $title = $resobj->compTitle(); } - if ($title eq '') { + if ($title eq '') { $title = &Apache::lonnet::gettitle($resource); } $hierarchy = &show_timer_path($type,$resource,$navmap); @@ -1630,11 +1655,16 @@ sub blocktype_text { 'port' => 'Portfolio', 'groups' => 'Groups', 'blogs' => 'Blogs', + 'about' => 'User Information', 'docs' => 'Content', 'printout' => 'Printouts', 'passwd' => 'Change Password', + 'grades' => 'Gradebook', + 'search' => 'Content Search', + 'alert' => 'Critical Alert', + 'reinit' => 'Course Re-init', ); - my $typeorder = ['com','chat','boards','port','groups','blogs','printout','docs','passwd']; + my $typeorder = ['com','chat','boards','port','groups','blogs','about','printout','docs','grades','search','alert','reinit','passwd']; return ($typeorder,\%types); }