--- loncom/interface/lonparmset.pm 2006/05/18 01:08:51 1.307 +++ loncom/interface/lonparmset.pm 2006/06/23 03:14:00 1.314 @@ -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.314 2006/06/23 03:14:00 albertel 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 ''; } @@ -701,7 +702,7 @@ sub print_row { } my $automatic=&rulescache(($which=~/\_([^\_]+)$/)[0].'_triggers'); if ($automatic) { - $parm.='
'.&mt('Automatically sets').' '.join(', ',split(/\:/,$automatic)).'
'; + $parm.='
'.&mt('Automatically sets').' '.join(', ',split(/\:/,$automatic)).'
'; } $r->print(''.$parm.''); @@ -1476,8 +1477,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 +1489,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'}; @@ -1571,8 +1572,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). + ''. '

'); } @@ -1732,7 +1734,7 @@ ENDTABLEHEADFOUR '

'. "$title"); @@ -2092,9 +2094,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'). '
'. @@ -2165,8 +2167,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.'), @@ -2192,6 +2194,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').')', @@ -2228,7 +2232,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\./)) { @@ -2389,8 +2394,8 @@ sub storedata { $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 { @@ -2404,8 +2409,8 @@ sub storedata { &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 { @@ -2422,8 +2427,8 @@ sub storedata { &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 { @@ -2444,8 +2449,8 @@ sub storedata { &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); } @@ -2454,8 +2459,8 @@ sub storedata { &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); } @@ -3333,9 +3338,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 { @@ -3343,20 +3357,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(). ''.&mt('Time').''.&mt('User').''.&mt('Extent').''.&mt('Users').''. &mt('Parameter').''.&mt('Part').''.&mt('New Value').''.&mt('Announce').''. &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; @@ -3409,7 +3449,7 @@ sub parm_change_log { $r->print($value); } if ($value ne $all[$level]) { - $r->print('
'.&mt('Not active anymore').''); + $r->print('
'.&mt('Not active anymore').''); } else { $stillactive=1; } @@ -3434,8 +3474,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()); }