--- loncom/interface/lonparmset.pm 2006/01/10 05:27:57 1.275 +++ loncom/interface/lonparmset.pm 2006/03/06 22:17:48 1.278 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.275 2006/01/10 05:27:57 raeburn Exp $ +# $Id: lonparmset.pm,v 1.278 2006/03/06 22:17:48 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -293,6 +293,25 @@ sub preset_defaults { } ################################################## + +sub date_sanity_info { + my $checkdate=shift; + unless ($checkdate) { return ''; } + my $result=''; + my $crsprefix='course.'.$env{'request.course.id'}.'.'; + if ($env{$crsprefix.'default_enrollment_end_date'}) { + if ($checkdate>$env{$crsprefix.'default_enrollment_end_date'}) { + $result.='
'.&mt('After course enrollment end!'); + } + } + if ($env{$crsprefix.'default_enrollment_start_date'}) { + if ($checkdate<$env{$crsprefix.'default_enrollment_start_date'}) { + $result.='
'.&mt('Before course enrollment start!'); + } + } + return $result; +} +################################################## ################################################## # # Store a parameter by ID @@ -516,7 +535,7 @@ sub valout { } $result=~s/\s+$//; } elsif (&isdateparm($type)) { - $result = localtime($value); + $result = localtime($value).&date_sanity_info($value); } else { $result = $value; } @@ -2138,8 +2157,11 @@ sub crsenv { => ''.&mt('Allow limited HTML in discussion posts').'
'. '('.&mt('Set value to "[_1]" to allow',"yes").')', 'allow_discussion_post_editing' - => ''.&mt('Allow users to edit/delete their own discussion posts').'
'. - '('.&mt('Set value to "[_1]" to allow',"yes").')', + => ''.&mt('Allow users with specified roles to edit/delete their own discussion posts').'
"st": '. + &mt('student').', "ta": '. + 'TA, "in": '. + &mt('instructor').'; ('.&mt('role:section,role:section,..., e.g., st:001,st:002,in,cc would permit students in sections 001 and 002 and instructors in any section, and course coordinators to edit their own posts.').')
'. + '('.&mt('or set value to "[_1]" to allow all roles',"yes").')', 'rndseed' => ''.&mt('Randomization algorithm used').'
'. ''.&mt('Modifying this will make problems').' '. @@ -2175,10 +2197,13 @@ sub crsenv { 'disableexampointprint' => ''.&mt('Disable automatically printing point values onto exams.').'
'. ' ('.&mt('"[_1]" to disable, anything else if not','yes').')', + 'externalsyllabus' + => ''.&mt('URL of Syllabus (not using internal handler))').'', 'tthoptions' => ''.&mt('Default set of options to pass to tth/m when converting tex').'' ); my @Display_Order = ('url','description','courseid','cloners','grading', + 'externalsyllabus', 'default_xml_style','pageseparators', 'question.email','comment.email','policy.email', 'student_classlist_view', @@ -2557,7 +2582,8 @@ sub listdata { $jskey, $$resourcedata{$thiskey}, '',1,'','',$hour,$min,$sec). -'' +''. +&date_sanity_info($$resourcedata{$thiskey}) ); } elsif ($thistype eq 'string_yesno') { my $showval;