--- loncom/interface/lonparmset.pm 2007/03/17 04:35:03 1.363 +++ loncom/interface/lonparmset.pm 2007/08/02 00:42:43 1.373 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.363 2007/03/17 04:35:03 albertel Exp $ +# $Id: lonparmset.pm,v 1.373 2007/08/02 00:42:43 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2044,6 +2044,29 @@ sub crsenv { if ($name =~ /^default_enrollment_(start|end)_date$/) { $value=&Apache::lonhtmlcommon::get_date_from_form($name.'_value'); } + # + # Deal with the emails + if ($name =~ /\.email$/) { + foreach my $specifier (split(',',$value)) { + my ($user,$sections_or_groups)= + ($specifier=~/^([^\(]+)\(([^\)]+)\)/); + if (!$sections_or_groups) { + $user = $specifier; + } + my ($name,$domain) = split(':',$user); + if (!defined($user) || !defined($domain)) { + $setoutput.= '
'. + &mt("Invalid email address specified, address must be of the form username:domain what was specified was ([_1])",$user). + ''; + undef($value); + } elsif (&Apache::lonnet::homeserver($user,$domain) eq 'no_host') { + $setoutput.= '
'. + &mt("Invalid email address specified, user [_1] is unknown.",$name). + ''; + undef($value); + } + } + } # Get existing cloners my @oldcloner = (); if ($name eq 'cloners') { @@ -2124,6 +2147,8 @@ sub crsenv { 'cloners' => ''.&mt('Users allowed to clone course').'
(user:domain,user:domain)
'.&mt('Users with active Course Coordinator role in the course automatically have the right to clone it, and can be omitted from list.'), 'grading' => ''.&mt('Grading').'
'. '"standard", "external", or "spreadsheet" '.&Apache::loncommon::help_open_topic('GradingOptions'), + 'task_grading' => ''.&mt('Bridge Task Grading').'
'. + &mt('Instructors and TAs in sections, when grading bridge tasks, should be allowed to grade other sections, "[_1]" they are allowed (this is the default), "[_2]" no, they can only grade their own section','any','section'), 'default_xml_style' => ''.&mt('Default XML Style File').' '. 'yes').', '. &mt('changes will not show until next login').')', 'student_classlist_view' => ''.&mt('Allow students to view classlist.').''.&mt('("all":students can view all sections,"section":students can only view their own section.blank or "disabled" prevents student view.'), - + 'student_classlist_portfiles' => ''.&mt('Include link to accessible portfolio files').'
'.&mt('"[_1]" for link to each a listing of each student\'s files.','yes'), + 'student_classlist_opt_in' => ''.&mt("Student's agreement needed for listing in student-viewable roster").'
'.&mt('"[_1]" to require students to opt-in to listing in the roster (on the roster page).','yes'), 'plc.roles.denied'=> ''.&mt('Disallow live chatroom use for Roles'). '
"st": '. &mt('student').', "ta": '. @@ -2210,10 +2236,7 @@ sub crsenv { ' 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').' )', + => &mtn(' Print header format; substitutions : %n student name %c course id %a assignment note, numbers after the % limit the field size.').'', 'default_enrollment_start_date' => ''.&mt('Default beginning date for student access.').'', 'default_enrollment_end_date' => ''.&mt('Default ending date for student access.').'', 'nothideprivileged' => ''.&mt('Privileged users that should not be hidden on staff listings').''. @@ -2233,13 +2256,18 @@ sub crsenv { 'externalsyllabus' => ''.&mt('URL of Syllabus (not using internal handler)').'', 'tthoptions' - => ''.&mt('Default set of options to pass to tth/m when converting tex').'' + => ''.&mt('Default set of options to pass to tth/m when converting tex').'', + + 'texengine' + => ''.&mt('Force all students in the course to use a specific math rendering engine.').'
'.&mt('(Valid options are [_1].)','"tth", "jsMath", "mimetex"').'', ); my @Display_Order = ('url','description','courseid','cloners','grading', 'externalsyllabus', 'default_xml_style','pageseparators', 'question.email','question.email.text','comment.email','comment.email.text','policy.email','policy.email.text', 'student_classlist_view', + 'student_classlist_opt_in', + 'student_classlist_portfiles', 'plc.roles.denied','plc.users.denied', 'pch.roles.denied','pch.users.denied', 'allow_limited_html_in_feedback', @@ -2260,9 +2288,10 @@ sub crsenv { 'default_enrollment_start_date', 'default_enrollment_end_date', 'tthoptions', + 'texengine', 'disablesigfigs', 'disableexampointprint', - 'task_messages' + 'task_messages','task_grading', ); foreach my $parameter (sort(keys(%values))) { unless (($parameter =~ m/^internal\./)||($parameter =~ m/^metadata\./)) { @@ -2343,7 +2372,7 @@ $start_header_row $end_header_row $output $end_table - + $end_page ENDENV @@ -2425,11 +2454,11 @@ sub storedata { $tkey.'.type' => $typeof}, $tudom,$tuname) eq 'ok') { &log_parmset({$tkey=>$data,$tkey.'.type' => $typeof},0,$tuname,$tudom); - $r->print('
'.&mt('Stored modified parameter for').' '. + $r->print('
'.&mt('Saved modified parameter for').' '. &Apache::loncommon::plainname($tuname,$tudom)); } else { $r->print('
'. - &mt('Error storing parameters').'
'); + &mt('Error saving parameters').''); } &Apache::lonnet::devalidateuserresdata($tuname,$tudom); } else { @@ -2459,10 +2488,10 @@ sub storedata { $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)); + $r->print('
'.&mt('Saved modified date for').' '.&Apache::loncommon::plainname($tuname,$tudom)); } else { $r->print('
'. - &mt('Error storing parameters').'
'); + &mt('Error saving parameters').''); } &Apache::lonnet::devalidateuserresdata($tuname,$tudom); } else { @@ -2491,10 +2520,10 @@ sub storedata { 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).'

'); + $r->print('

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

'); } else { $r->print('
'. - &mt('Error storing parameters').'
'); + &mt('Error saving parameters').''); } &Apache::lonnet::devalidatecourseresdata($crs,$dom); } @@ -2775,7 +2804,7 @@ ENDOVER &listdata($r,$resourcedata,$listdata,$sortorder); } $r->print(&tableend(). - ((($env{'form.store'}) || ($env{'form.dis'}))?'

':''). + ((($env{'form.store'}) || ($env{'form.dis'}))?'

':''). ''.&Apache::loncommon::end_page()); } @@ -3132,6 +3161,7 @@ ENDMAINFORMHEAD my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; 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 @menu = ( { divider=>'Settings for Your Course', @@ -3149,6 +3179,11 @@ ENDMAINFORMHEAD url => '/adm/slotrequest?command=showslots', permission => $vgr, }, + { text => 'Reset Student Access Times', + url => '/adm/helper/resettimes.helper', + permission => $mgr, + }, + { text => 'Set Parameter Setting Default Actions', action => 'setdefaults', permission => $parm_permission, @@ -3662,7 +3697,7 @@ ENDYESNO } $r->print(&Apache::loncommon::end_data_table(). "\n\n". + &mt('Save Rules')."' />\n". &Apache::loncommon::end_page()); return; }