--- loncom/interface/lonparmset.pm 2000/11/28 15:39:52 1.18
+++ loncom/interface/lonparmset.pm 2009/05/05 16:53:25 1.443
@@ -1,375 +1,872 @@
# The LearningOnline Network with CAPA
# Handler to set parameters for assessments
#
-# (Handler to resolve ambiguous file locations
+# $Id: lonparmset.pm,v 1.443 2009/05/05 16:53:25 neumanie Exp $
#
-# (TeX Content Handler
+# Copyright Michigan State University Board of Trustees
#
-# 05/29/00,05/30,10/11 Gerd Kortemeyer)
+# This file is part of the LearningOnline Network with CAPA (LON-CAPA).
#
-# 10/11,10/12,10/16 Gerd Kortemeyer)
+# LON-CAPA is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
#
-# 11/20,11/21,11/22,11/23,11/24,11/25,11/27,11/28 Gerd Kortemeyer
+# LON-CAPA is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with LON-CAPA; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# /home/httpd/html/adm/gpl.txt
+#
+# http://www.lon-capa.org/
+#
+###################################################################
+###################################################################
-package Apache::lonparmset;
+=pod
-use strict;
-use Apache::lonnet;
-use Apache::Constants qw(:common :http REDIRECT);
-use GDBM_File;
+=head1 NAME
+lonparmset - Handler to set parameters for assessments and course
-my %courseopt;
-my %useropt;
-my %bighash;
-my %parmhash;
+=head1 SYNOPSIS
-my @outpar;
+lonparmset provides an interface to setting course parameters.
-my @ids;
-my %symbp;
-my %mapp;
-my %typep;
-my %keyp;
-my %defp;
+=head1 DESCRIPTION
-my %allkeys;
+This module sets coursewide and assessment parameters.
-my $uname;
-my $udom;
-my $uhome;
+=head1 INTERNAL SUBROUTINES
-my $csec;
+=over
-my $fcat;
+=pod
-# -------------------------------------------- Figure out a cascading parameter
+=item parmval()
-sub parmval {
- my ($what,$id,$def)=@_;
- my $result='';
- @outpar=();
-# ----------------------------------------------------- Cascading lookup scheme
+Figure out a cascading parameter.
- my $symbparm=$symbp{$id}.'.'.$what;
- my $mapparm=$mapp{$id}.'___(all).'.$what;
+Inputs: $what - a parameter spec (incluse part info and name I.E. 0.weight)
+ $id - a bighash Id number
+ $def - the resource's default value 'stupid emacs
- my $seclevel=
- $ENV{'request.course.id'}.'.['.
- $csec.'].'.$what;
- my $seclevelr=
- $ENV{'request.course.id'}.'.['.
- $csec.'].'.$symbparm;
- my $seclevelm=
- $ENV{'request.course.id'}.'.['.
- $csec.'].'.$mapparm;
+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
- my $courselevel=
- $ENV{'request.course.id'}.'.'.$what;
- my $courselevelr=
- $ENV{'request.course.id'}.'.'.$symbparm;
- my $courselevelm=
- $ENV{'request.course.id'}.'.'.$mapparm;
+14- General Course
+13- Map or Folder level in course
+12- resource default
+11- map default
+10- resource level in course
+9 - General for section
+8 - Map or Folder level for section
+7 - resource level in section
+6 - General for group
+5 - Map or Folder level for group
+4 - resource level in group
+3 - General for specific student
+2 - Map or Folder level for specific student
+1 - resource level for specific student
-# -------------------------------------------------------- first, check default
+=item parmval_by_symb()
- if ($def) { $outpar[11]=$def;
- $result=11; }
+=item reset_caches()
-# ----------------------------------------------------- second, check map parms
+=item cacheparmhash()
- my $thisparm=$parmhash{$symbparm};
- if ($thisparm) { $outpar[10]=$thisparm;
- $result=10; }
+=item parmhash()
-# --------------------------------------------------------- third, check course
+=item symbcache()
- if ($courseopt{$courselevel}) { $outpar[9]=$courseopt{$courselevel};
- $result=9; }
+=item preset_defaults()
- if ($courseopt{$courselevelm}) { $outpar[8]=$courseopt{$courselevelm};
- $result=8; }
+=item date_sanity_info()
- if ($courseopt{$courselevelr}) { $outpar[7]=$courseopt{$courselevelr};
- $result=7; }
+=item storeparm()
- if ($csec) {
+Store a parameter by symb
- if ($courseopt{$seclevel}) { $outpar[6]=$courseopt{$seclevel};
- $result=6; }
+ Takes
+ - symb
+ - name of parameter
+ - level
+ - new value
+ - new type
+ - username
+ - userdomain
- if ($courseopt{$seclevelm}) { $outpar[5]=$courseopt{$seclevelm};
- $result=5; }
-
- if ($courseopt{$seclevelr}) { $outpar[4]=$courseopt{$seclevelr};
- $result=4; }
-
- }
+=item log_parmset()
-# ---------------------------------------------------------- fourth, check user
-
- if ($uname) {
+=item storeparm_by_symb_inner()
- if ($useropt{$courselevel}) { $outpar[3]=$useropt{$courselevel};
- $result=3; }
+=item valout()
- if ($useropt{$courselevelm}) { $outpar[2]=$useropt{$courselevelm};
- $result=2; }
+Format a value for output.
- if ($useropt{$courselevelr}) { $outpar[1]=$useropt{$courselevelr};
- $result=1; }
+Inputs: $value, $type, $editable
- }
-
- return $result;
-}
+Returns: $value, formatted for output. If $type indicates it is a date,
+localtime($value) is returned.
+$editable will return an icon to click on
-# ------------------------------------------------------------ Output for value
+=item plink()
-sub valout {
- my ($value,$type)=@_;
- return
- ($value?(($type=~/^date/)?localtime($value):$value):' ');
-}
+Produces a link anchor.
-# -------------------------------------------------------- Produces link anchor
+Inputs: $type,$dis,$value,$marker,$return,$call
-sub plink {
- my ($type,$dis,$value,$marker,$return,$call)=@_;
- return ''.
- &valout($value,$type).'';
+Returns: scalar with html code for a link which will envoke the
+javascript function 'pjump'.
+
+=item page_js()
+
+=item startpage()
+
+=item print_row()
+
+=item print_td()
+
+=item print_usergroups()
+
+=item parm_control_group()
+
+=item extractResourceInformation() :
+
+Given the course data hash, extractResourceInformation extracts lots of information about the course's resources into a variety of hashes.
+
+Input: See list below:
+
+=item * B : An array that will contain all of the ids in the course.
+
+=item * B : hash, id->type, where "type" contains the extension of the file, thus, I.
+
+=item * B : hash, id->key list, will contain a comma separated list of the meta-data keys available for the given id
+
+=item * B : hash, name of parameter->display value (what is the display value?)
+
+=item * B : hash, part identification->text representation of part, where the text representation is "[Part $part]"
+
+=item * B : hash, full key to part->display value (what's display value?)
+
+=item * B : hash, ???
+
+=item * B : ???
+
+=item * B : hash, ???
+
+=item * B : ??
+
+=item * B : hash, id->full sym?
+
+
+
+=item isdateparm()
+
+=item parmmenu()
+
+=item partmenu()
+
+=item usermenu()
+
+=item displaymenu()
+
+=item mapmenu()
+
+=item levelmenu()
+
+=item sectionmenu()
+
+=item keysplit()
+
+=item keysinorder()
+
+=item keysinorder_bytype()
+
+=item keysindisplayorder()
+
+=item standardkeyorder()
+
+=item assessparms() :
+
+Show assessment data and parameters. This is a large routine that should
+be simplified and shortened... someday.
+
+Inputs: $r
+
+Returns: nothing
+
+Variables used (guessed by Jeremy):
+
+=item * B: ParameterS CATegories? ends up a list of the types of parameters that exist, e.g., tol, weight, acc, opendate, duedate, answerdate, sig, maxtries, type.
+
+=item * B: ParameterS PaRTs? a list of the parts of a problem that we are displaying? Used to display only selected parts?
+
+=item * B<@catmarker> contains list of all possible parameters including part #s
+
+=item * B<$fullkeyp> contains the full part/id # for the extraction of proper parameters
+
+=item * B<$tempkeyp> contains part 0 only (no ids - ie, subparts)
+ When storing information, store as part 0
+ When requesting information, request from full part
+
+=item crsenv()
+
+Show and set course data and parameters. This is a large routine that should
+be simplified and shortened... someday.
+
+Inputs: $r
+
+Returns: nothing
+
+=item can_modify_catsettings()
+
+=item assign_course_categories()
+
+=item tablestart()
+
+=item tableend()
+
+=item extractuser()
+
+=item parse_listdata_key()
+
+=item listdata()
+
+=item date_interval_selector()
+
+=item get_date_interval_from_form()
+
+=item default_selector()
+
+=item string_selector()
+
+=item dateshift()
+
+=item newoverview()
+
+=item secgroup_lister()
+
+=item overview()
+
+=item clean_parameters()
+
+=item date_shift_one()
+
+=item date_shift_two()
+
+=item parse_key()
+
+=item check_cloners() :
+
+Checks if new users included in list of allowed cloners
+are valid users. Replaces supplied list with
+cleaned list containing only users with valid usernames
+and domains.
+
+Inputs: $clonelist, $oldcloner
+where $clonelist is ref to array of requested cloners,
+and $oldcloner is ref to array of currently allowed
+cloners.
+
+Returns: string - comma separated list of requested
+cloners (username:domain) who do not exist in system.
+
+=item change_clone() :
+
+Modifies the list of courses a user can clone (stored
+in the user's environment.db file), called when a
+change is made to the list of users allowed to clone
+a course.
+
+Inputs: $action,$cloner
+where $action is add or drop, and $cloner is identity of
+user for whom cloning ability is to be changed in course.
+
+
+=item check_cloners()
+
+=item change_clone()
+
+=item header()
+
+Output html header for page
+
+=item print_main_menu()
+
+=item output_row()
+
+Set portfolio metadata
+
+=item order_meta_fields()
+
+=item addmetafield()
+
+=item setrestrictmeta()
+
+=item get_added_meta_fieldnames()
+
+=item get_deleted_meta_fieldnames()
+
+=item defaultsetter()
+
+=item components()
+
+=item load_parameter_names()
+
+=item parm_change_log()
+
+=item handler() :
+
+Main handler. Calls &assessparms and &crsenv subroutines.
+
+
+=back
+
+=cut
+
+###################################################################
+###################################################################
+
+package Apache::lonparmset;
+
+use strict;
+use Apache::lonnet;
+use Apache::Constants qw(:common :http REDIRECT);
+use Apache::lonhtmlcommon();
+use Apache::loncommon;
+use GDBM_File;
+use Apache::lonhomework;
+use Apache::lonxml;
+use Apache::lonlocal;
+use Apache::lonnavmaps;
+use Apache::longroup;
+use Apache::lonrss;
+use LONCAPA qw(:DEFAULT :match);
+
+
+sub parmval {
+ my ($what,$id,$def,$uname,$udom,$csec,$cgroup,$courseopt)=@_;
+ return &parmval_by_symb($what,&symbcache($id),$def,$uname,$udom,$csec,
+ $cgroup,$courseopt);
}
-# ================================================================ Main Handler
+sub parmval_by_symb {
+ my ($what,$symb,$def,$uname,$udom,$csec,$cgroup,$courseopt)=@_;
-sub handler {
- my $r=shift;
+ my $useropt;
+ if ($uname ne '' && $udom ne '') {
+ $useropt = &Apache::lonnet::get_userresdata($uname,$udom);
+ }
- if ($r->header_only) {
- $r->content_type('text/html');
- $r->send_http_header;
- return OK;
- }
+ my $result='';
+ my @outpar=();
+# ----------------------------------------------------- Cascading lookup scheme
+ my $map=(&Apache::lonnet::decode_symb($symb))[0];
+ $map = &Apache::lonnet::deversion($map);
-# ----------------------------------------------------- Needs to be in a course
+ my $symbparm=$symb.'.'.$what;
+ my $mapparm=$map.'___(all).'.$what;
- if (($ENV{'request.course.fn'}) &&
- (&Apache::lonnet::allowed('opa',$ENV{'request.course.id'}))) {
-# -------------------------------------------------------- Variable declaration
+ my $grplevel=$env{'request.course.id'}.'.['.$cgroup.'].'.$what;
+ my $grplevelr=$env{'request.course.id'}.'.['.$cgroup.'].'.$symbparm;
+ my $grplevelm=$env{'request.course.id'}.'.['.$cgroup.'].'.$mapparm;
- %courseopt=();
- %useropt=();
- %bighash=();
-
- @ids=();
- %symbp=();
- %typep=();
-
- my $message='';
-
- $csec=$ENV{'form.csec'};
- $udom=$ENV{'form.udom'};
- unless ($udom) { $udom=$r->dir_config('lonDefDomain'); }
-
- my $id=$ENV{'form.id'};
- if (($id) && ($udom)) {
- $uname=(&Apache::lonnet::idget($udom,$id))[1];
- if ($uname) {
- $id='';
- } else {
- $message=
- "Unknown ID '$id' at domain '$udom'";
- }
- } else {
- $uname=$ENV{'form.uname'};
- }
- unless ($udom) { $uname=''; }
- $uhome='';
- if ($uname) {
- $uhome=&Apache::lonnet::homeserver($uname,$udom);
-
- if ($uhome eq 'no_host') {
- $message=
- "Unknown user '$uname' at domain '$udom'";
- $uname='';
- } else {
- $csec=&Apache::lonnet::usection(
- $udom,$uname,$ENV{'request.course.id'});
- if ($csec eq '-1') {
- $message="".
- "User '$uname' at domain '$udom' not in this course";
- $uname='';
- $csec=$ENV{'form.csec'};
- } else {
- my %name=&Apache::lonnet::userenvironment($udom,$uname,
- ('firstname','middlename','lastname','generation','id'));
- $message="\n
';
- }
+ my $seclevel=$env{'request.course.id'}.'.['.$csec.'].'.$what;
+ my $seclevelr=$env{'request.course.id'}.'.['.$csec.'].'.$symbparm;
+ my $seclevelm=$env{'request.course.id'}.'.['.$csec.'].'.$mapparm;
+
+ my $courselevel=$env{'request.course.id'}.'.'.$what;
+ my $courselevelr=$env{'request.course.id'}.'.'.$symbparm;
+ my $courselevelm=$env{'request.course.id'}.'.'.$mapparm;
+
+
+# --------------------------------------------------------- first, check course
+
+ if (defined($$courseopt{$courselevel})) {
+ $outpar[14]=$$courseopt{$courselevel};
+ $result=14;
+ }
+
+ if (defined($$courseopt{$courselevelm})) {
+ $outpar[13]=$$courseopt{$courselevelm};
+ $result=13;
+ }
+
+# ------------------------------------------------------- second, check default
+
+ if (defined($def)) { $outpar[12]=$def; $result=12; }
+
+# ------------------------------------------------------ third, check map parms
+
+ my $thisparm=&parmhash($symbparm);
+ if (defined($thisparm)) { $outpar[11]=$thisparm; $result=11; }
+
+ if (defined($$courseopt{$courselevelr})) {
+ $outpar[10]=$$courseopt{$courselevelr};
+ $result=10;
+ }
+
+# ------------------------------------------------------ fourth, back to course
+ if ($csec ne '') {
+ if (defined($$courseopt{$seclevel})) {
+ $outpar[9]=$$courseopt{$seclevel};
+ $result=9;
+ }
+ if (defined($$courseopt{$seclevelm})) {
+ $outpar[8]=$$courseopt{$seclevelm};
+ $result=8;
+ }
+
+ if (defined($$courseopt{$seclevelr})) {
+ $outpar[7]=$$courseopt{$seclevelr};
+ $result=7;
+ }
+ }
+# ------------------------------------------------------ fifth, check course group
+ if ($cgroup ne '') {
+ if (defined($$courseopt{$grplevel})) {
+ $outpar[6]=$$courseopt{$grplevel};
+ $result=6;
}
- }
+ if (defined($$courseopt{$grplevelm})) {
+ $outpar[5]=$$courseopt{$grplevelm};
+ $result=5;
+ }
+ if (defined($$courseopt{$grplevelr})) {
+ $outpar[4]=$$courseopt{$grplevelr};
+ $result=4;
+ }
+ }
- unless ($csec) { $csec=''; }
+# ---------------------------------------------------------- fifth, check user
- $fcat=$ENV{'form.fcat'};
- unless ($fcat) { $fcat=''; }
+ if ($uname ne '') {
+ if (defined($$useropt{$courselevel})) {
+ $outpar[3]=$$useropt{$courselevel};
+ $result=3;
+ }
+
+ if (defined($$useropt{$courselevelm})) {
+ $outpar[2]=$$useropt{$courselevelm};
+ $result=2;
+ }
+
+ if (defined($$useropt{$courselevelr})) {
+ $outpar[1]=$$useropt{$courselevelr};
+ $result=1;
+ }
+ }
+ return ($result,@outpar);
+}
-# ------------------------------------------------------------------- Tie hashs
- if ((tie(%bighash,'GDBM_File',$ENV{'request.course.fn'}.'.db',
- &GDBM_READER,0640)) &&
- (tie(%parmhash,'GDBM_File',
- $ENV{'request.course.fn'}.'_parms.db',&GDBM_READER,0640))) {
-# --------------------------------------------------------- Get all assessments
- %allkeys=();
- %defp=();
- map {
- if ($_=~/^src\_(\d+)\.(\d+)$/) {
- my $mapid=$1;
- my $resid=$2;
- my $id=$mapid.'.'.$resid;
- my $srcf=$bighash{$_};
- if ($srcf=~/\.(problem|exam|quiz|assess|survey|form)$/) {
- $ids[$#ids+1]=$id;
- $typep{$id}=$1;
- $keyp{$id}='';
- map {
- if ($_=~/^parameter\_(.*)/) {
- my $key=$_;
- my $allkey=$1;
- $allkey=~s/\_/\./;
- my $display=
- &Apache::lonnet::metadata($srcf,$key.'.display');
- unless ($display) {
- $display=
- &Apache::lonnet::metadata($srcf,$key.'.name');
- }
- $allkeys{$allkey}=$display;
- if ($allkey eq $fcat) {
- $defp{$id}=
- &Apache::lonnet::metadata($srcf,$key.'.default');
- }
- if ($keyp{$id}) {
- $keyp{$id}.=','.$key;
- } else {
- $keyp{$id}=$key;
- }
- }
- } split(/\,/,
- &Apache::lonnet::metadata($srcf,'keys'));
- $mapp{$id}=
- &Apache::lonnet::declutter($bighash{'map_id_'.$mapid});
- $symbp{$id}=$mapp{$id}.
- '___'.$resid.'___'.
- &Apache::lonnet::declutter($srcf);
- }
- }
- } keys %bighash;
-# ---------------------------------------------------------- Anything to store?
- if ($ENV{'form.pres_marker'}) {
- my ($sresid,$spnam,$snum)=split(/\&/,$ENV{'form.pres_marker'});
- $spnam=~s/\_/\./;
-# ---------------------------------------------------------- Construct prefixes
- my $symbparm=$symbp{$sresid}.'.'.$spnam;
- my $mapparm=$mapp{$sresid}.'___(all).'.$spnam;
+# --- Caches local to lonparmset
+
+
+sub reset_caches {
+ &resetparmhash();
+ &resetsymbcache();
+ &resetrulescache();
+}
- my $seclevel=
- $ENV{'request.course.id'}.'.['.
- $csec.'].'.$spnam;
- my $seclevelr=
- $ENV{'request.course.id'}.'.['.
- $csec.'].'.$symbparm;
- my $seclevelm=
- $ENV{'request.course.id'}.'.['.
- $csec.'].'.$mapparm;
-
- my $courselevel=
- $ENV{'request.course.id'}.'.'.$spnam;
- my $courselevelr=
- $ENV{'request.course.id'}.'.'.$symbparm;
- my $courselevelm=
- $ENV{'request.course.id'}.'.'.$mapparm;
-
- my $storeunder='';
- if (($snum==9) || ($snum==3)) { $storeunder=$courselevel; }
- if (($snum==8) || ($snum==2)) { $storeunder=$courselevelm; }
- if (($snum==7) || ($snum==1)) { $storeunder=$courselevelr; }
- if ($snum==6) { $storeunder=$seclevel; }
- if ($snum==5) { $storeunder=$seclevelm; }
- if ($snum==4) { $storeunder=$seclevelr; }
- $storeunder=&Apache::lonnet::escape($storeunder);
+{
+ my $parmhashid;
+ my %parmhash;
+ sub resetparmhash {
+ undef($parmhashid);
+ undef(%parmhash);
+ }
+
+ sub cacheparmhash {
+ if ($parmhashid eq $env{'request.course.fn'}) { return; }
+ my %parmhashfile;
+ if (tie(%parmhashfile,'GDBM_File',
+ $env{'request.course.fn'}.'_parms.db',&GDBM_READER(),0640)) {
+ %parmhash=%parmhashfile;
+ untie(%parmhashfile);
+ $parmhashid=$env{'request.course.fn'};
+ }
+ }
- my $storecontent=
- $storeunder.'='.&Apache::lonnet::escape($ENV{'form.pres_value'}).'&'.
- $storeunder.'.type='.&Apache::lonnet::escape($ENV{'form.pres_type'});
+ sub parmhash {
+ my ($id) = @_;
+ &cacheparmhash();
+ return $parmhash{$id};
+ }
+ }
+
+{
+ my $symbsid;
+ my %symbs;
+ sub resetsymbcache {
+ undef($symbsid);
+ undef(%symbs);
+ }
+
+ sub symbcache {
+ my $id=shift;
+ if ($symbsid ne $env{'request.course.id'}) {
+ undef(%symbs);
+ }
+ if (!$symbs{$id}) {
+ my $navmap = Apache::lonnavmaps::navmap->new();
+ if ($id=~/\./) {
+ my $resource=$navmap->getById($id);
+ $symbs{$id}=$resource->symb();
+ } else {
+ my $resource=$navmap->getByMapPc($id);
+ $symbs{$id}=&Apache::lonnet::declutter($resource->src());
+ }
+ $symbsid=$env{'request.course.id'};
+ }
+ return $symbs{$id};
+ }
+ }
+
+{
+ my $rulesid;
+ my %rules;
+ sub resetrulescache {
+ undef($rulesid);
+ undef(%rules);
+ }
+
+ sub rulescache {
+ my $id=shift;
+ if ($rulesid ne $env{'request.course.id'}
+ && !defined($rules{$id})) {
+ my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+ my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
+ %rules=&Apache::lonnet::dump('parmdefactions',$dom,$crs);
+ $rulesid=$env{'request.course.id'};
+ }
+ return $rules{$id};
+ }
+}
+
+
+
+sub preset_defaults {
+ my $type=shift;
+ if (&rulescache($type.'_action') eq 'default') {
+# yes, there is something
+ return (&rulescache($type.'_hours'),
+ &rulescache($type.'_min'),
+ &rulescache($type.'_sec'),
+ &rulescache($type.'_value'));
+ } else {
+# nothing there or something else
+ return ('','','','','');
+ }
+}
+
+
+
+
+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!')
+ .'
';
+ }
+ }
+# Preparation for additional warnings about dates in the past/future.
+# An improved, more context sensitive version is recommended,
+# e.g. warn for due and answer dates which are defined before the corresponding open date, etc.
+# if ($checkdate