--- loncom/interface/lonparmset.pm 2006/05/15 23:40:54 1.305 +++ loncom/interface/lonparmset.pm 2006/06/12 23:17:48 1.313 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.305 2006/05/15 23:40:54 albertel Exp $ +# $Id: lonparmset.pm,v 1.313 2006/06/12 23:17:48 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -63,7 +63,10 @@ use Apache::lonhomework; use Apache::lonxml; use Apache::lonlocal; use Apache::lonnavmaps; +use Apache::longroup; use Apache::lonrss; +use lib '/home/httpd/lib/perl/'; +use LONCAPA; # --- Caches local to lonparmset @@ -91,11 +94,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 @@ -1125,7 +1128,7 @@ sub usermenu { my %sectionhash = &Apache::loncommon::get_sections(); my $groups; - my %grouphash = &Apache::loncommon::coursegroups(); + my %grouphash = &Apache::longroup::coursegroups(); if (%sectionhash) { $sections=$lt{'se'}.': '); @@ -1512,7 +1515,7 @@ sub assessparms { @usersgroups = &Apache::lonnet::get_users_groups( $udom,$uname,$env{'request.course.id'}); if (@usersgroups > 0) { - unless (grep/^\Q$cgroup\E$/,@usersgroups) { + unless (grep(/^\Q$cgroup\E$/,@usersgroups)) { $cgroup = $usersgroups[0]; } } @@ -1570,8 +1573,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). + ''. '

'); } @@ -1731,7 +1735,7 @@ ENDTABLEHEADFOUR '

'. "$title"); @@ -1930,7 +1934,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('

'); @@ -2191,6 +2195,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').')', @@ -2227,7 +2233,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\./)) { @@ -3332,9 +3339,18 @@ sub standard_parameter_names { 'weight' => 'Weight', 'date_start' => 'Starting Date', 'date_end' => 'Ending Date', + 'interval' => 'Time Interval Length', + 'tol' => 'Numerical Tolerance', + 'sig' => 'Significant Digits', + 'contentopen' => 'Content Opening Date', + 'contentclose' => 'Content Closing Date', + 'discussend' => 'End of Discussion Time', + 'discusshide' => 'Discussion Hidden', + 'problemstatus' => 'Problem Status Visible', 'int_pos' => 'Positive Integer', 'int_zero_pos' => 'Positive Integer or Zero', - 'hinttries' => 'Number of Tries till Hints appear'); + 'hinttries' => 'Number of Tries till Hints appear', + 'numbubbles' => 'Number of Bubbles in Exam Mode'); if ($standard_parms{$name}) { return $standard_parms{$name}; } else { @@ -3342,20 +3358,46 @@ sub standard_parameter_names { } } +# +# Parameter Change Log +# + + sub parm_change_log { my ($r)=@_; &startpage($r); 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('
+ '); + + my %saveable_parameters = ('show' => 'scalar',); + &Apache::loncommon::store_course_settings('parameter_log', + \%saveable_parameters); + &Apache::loncommon::restore_course_settings('parameter_log', + \%saveable_parameters); + if (!$env{'form.show'}) { $env{'form.show'}=10; } + + my $countselect = + &Apache::lonmeta::selectbox('show',$env{'form.show'},undef, + (&mt('all'),10,20,50,100,1000,10000)); + + $r->print(''.&mt('[_1] Records',$countselect).''. + ''); + my $courseopt=&Apache::lonnet::get_courseresdata($env{'course.'.$env{'request.course.id'}.'.num'}, $env{'course.'.$env{'request.course.id'}.'.domain'}); $r->print(&Apache::loncommon::start_data_table().&Apache::loncommon::start_data_table_header_row(). '
'. &Apache::loncommon::end_data_table_header_row()); + my $shown=0; foreach my $id (sort { $parmlog{$b}{'exe_time'}<=>$parmlog{$a}{'exe_time'} } (keys(%parmlog))) { my @changes=keys(%{$parmlog{$id}{'logentry'}}); my $count=$#changes+1; @@ -3433,8 +3475,12 @@ sub parm_change_log { } $r->print(&Apache::loncommon::end_data_table_row()); } + $shown++; + if (!($env{'form.show'} eq &mt('all') + || $shown<=$env{'form.show'})) { last; } } $r->print(&Apache::loncommon::end_data_table()); + $r->print(''); $r->print(&Apache::loncommon::end_page()); }
'.&mt('Time').''.&mt('User').''.&mt('Extent').''.&mt('Users').''. &mt('Parameter').''.&mt('Part').''.&mt('New Value').''.&mt('Announce').'