[LON-CAPA-cvs] cvs: loncom /interface lonparmset.pm

jms lon-capa-cvs-allow@mail.lon-capa.org
Wed, 19 Nov 2008 21:14:42 -0000


This is a MIME encoded message

--jms1227129282
Content-Type: text/plain

jms		Wed Nov 19 21:14:42 2008 EDT

  Modified files:              
    /loncom/interface	lonparmset.pm 
  Log:
  Cleaned up POD documentation, added some new POD documentation. Added some line breaks between subroutines where there were none for better reading.
  
--jms1227129282
Content-Type: text/plain
Content-Disposition: attachment; filename="jms-20081119211442.txt"

Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.415 loncom/interface/lonparmset.pm:1.416
--- loncom/interface/lonparmset.pm:1.415	Mon Nov 17 16:57:06 2008
+++ loncom/interface/lonparmset.pm	Wed Nov 19 21:14:42 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.415 2008/11/17 16:57:06 schafran Exp $
+# $Id: lonparmset.pm,v 1.416 2008/11/19 21:14:42 jms Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -44,36 +44,11 @@
 
 =head1 INTERNAL SUBROUTINES
 
-=over 4
-
-=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);
-
-
-##################################################
-##################################################
+=over
 
 =pod
 
-=item parmval
+=item parmval()
 
 Figure out a cascading parameter.
 
@@ -98,9 +73,282 @@
 2 - Map or Folder level for specific student
 1 - resource level for specific student
 
+=item parmval_by_symb()
+
+=item reset_caches()
+
+=item cacheparmhash() 
+
+=item parmhash()
+
+=item symbcache()
+
+=item preset_defaults()
+
+=item date_sanity_info()
+
+=item storeparm()
+
+Store a parameter by symb
+
+    Takes
+    - symb
+    - name of parameter
+    - level
+    - new value
+    - new type
+    - username
+    - userdomain
+
+=item log_parmset()
+
+=item storeparm_by_symb_inner()
+
+=item valout()
+
+Format a value for output.
+
+Inputs:  $value, $type, $editable
+
+Returns: $value, formatted for output.  If $type indicates it is a date,
+localtime($value) is returned.
+$editable will return an icon to click on
+
+=item plink()
+
+Produces a link anchor.
+
+Inputs: $type,$dis,$value,$marker,$return,$call
+
+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<ids> : An array that will contain all of the ids in the course.
+
+=item * B<typep> : hash, id->type, where "type" contains the extension of the file, thus, I<problem exam quiz assess survey form>.
+
+=item * B<keyp> : hash, id->key list, will contain a comma separated list of the meta-data keys available for the given id
+
+=item * B<allparms> : hash, name of parameter->display value (what is the display value?)
+
+=item * B<allparts> : hash, part identification->text representation of part, where the text representation is "[Part $part]"
+
+=item * B<allkeys> : hash, full key to part->display value (what's display value?)
+
+=item * B<allmaps> : hash, ???
+
+=item * B<fcat> : ???
+
+=item * B<defp> : hash, ???
+
+=item * B<mapp> : ??
+
+=item * B<symbp> : 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<pscat>: 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<psprt>: 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,
@@ -302,6 +550,8 @@
     }
 }
 
+
+
 sub preset_defaults {
     my $type=shift;
     if (&rulescache($type.'_action') eq 'default') {
@@ -316,7 +566,8 @@
     }
 }
 
-##################################################
+
+
 
 sub date_sanity_info {
    my $checkdate=shift;
@@ -371,17 +622,6 @@
     &storeparm_by_symb(&symbcache($sresid),$spnam,$snum,$nval,$ntype,$uname,$udom,$csec,'',$cgroup);
 }
 
-#
-# Store a parameter by symb
-#
-# Takes
-# - symb
-# - name of parameter
-# - level
-# - new value
-# - new type
-# - username
-# - userdomain
 my %recstack;
 sub storeparm_by_symb {
     my ($symb,$spnam,$snum,$nval,$ntype,$uname,$udom,$csec,$recflag,$cgroup)=@_;
@@ -536,25 +776,7 @@
     return '';
 }
 
-##################################################
-##################################################
-
-=pod
-
-=item valout
-
-Format a value for output.
-
-Inputs:  $value, $type, $editable
-
-Returns: $value, formatted for output.  If $type indicates it is a date,
-localtime($value) is returned.
-$editable will return an icon to click on
 
-=cut
-
-##################################################
-##################################################
 sub valout {
     my ($value,$type,$editable)=@_;
     my $result = '';
@@ -611,24 +833,7 @@
     return $result;
 }
 
-##################################################
-##################################################
-
-=pod
-
-=item plink
 
-Produces a link anchor.
-
-Inputs: $type,$dis,$value,$marker,$return,$call
-
-Returns: scalar with html code for a link which will envoke the 
-javascript function 'pjump'.
-
-=cut
-
-##################################################
-##################################################
 sub plink {
     my ($type,$dis,$value,$marker,$return,$call)=@_;
     my $winvalue=$value;
@@ -936,39 +1141,7 @@
     return($coursereply,$resultitem,$resultgroup,$resultlevel,$resulttype);
 }
 
-=pod
-
-=item B<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:
-
-=over 4
-
-=item B<ids>: An array that will contain all of the ids in the course.
-
-=item B<typep>: hash, id->type, where "type" contains the extension of the file, thus, I<problem exam quiz assess survey form>.
-
-=item B<keyp>: hash, id->key list, will contain a comma separated list of the meta-data keys available for the given id
-
-=item B<allparms>: hash, name of parameter->display value (what is the display value?)
-
-=item B<allparts>: hash, part identification->text representation of part, where the text representation is "[Part $part]"
-
-=item B<allkeys>: hash, full key to part->display value (what's display value?)
-
-=item B<allmaps>: hash, ???
-
-=item B<fcat>: ???
-
-=item B<defp>: hash, ???
-
-=item B<mapp>: ??
-
-=item B<symbp>: hash, id->full sym?
-
-=back
-
-=cut
 
 sub extractResourceInformation {
     my $ids = shift;
@@ -1062,8 +1235,6 @@
 }
 
 
-##################################################
-##################################################
 
 sub isdateparm {
     my $type=shift;
@@ -1464,36 +1635,7 @@
             'parameter_0_discusshide' => 20);
 }
 
-##################################################
-##################################################
-
-=pod
-
-=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):
-
-=over 4
-
-=item B<pscat>: 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<psprt>: ParameterS PaRTs? a list of the parts of a problem that we are displaying? Used to display only selected parts?
-
-=item B<allmaps>:
-
-=back
-
-=cut
-
-##################################################
-##################################################
 sub assessparms {
 
     my $r=shift;
@@ -2066,24 +2208,7 @@
 } # end sub assessparms
 
 
-##################################################
-##################################################
-
-=pod
-
-=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
-
-=cut
-
-##################################################
-##################################################
 sub crsenv {
     my $r=shift;
     my $setoutput='';
@@ -3492,41 +3617,7 @@
     return %data;
 }
 
-##################################################
-##################################################
-
-=pod
-
-=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. 
-
-=cut
-
-##################################################
-##################################################
 
 sub extract_cloners {
     my ($clonelist,$allowclone) = @_;
@@ -3643,24 +3734,13 @@
 }
 
 
-##################################################
-##################################################
-
-=pod
-
-=item * header
-
-Output html header for page
-
-=cut
 
-##################################################
-##################################################
 sub header {
     return &Apache::loncommon::start_page('Parameter Manager');
 }
-##################################################
-##################################################
+
+
+
 sub print_main_menu {
     my ($r,$parm_permission)=@_;
     #
@@ -3759,7 +3839,8 @@
     return;
 }
 
-### Set portfolio metadata
+
+
 sub output_row {
     my ($r, $field_name, $field_text, $added_flag) = @_;
     my $output;
@@ -3814,6 +3895,9 @@
     }
     return ($output);
 }
+
+
+
 sub order_meta_fields {
     my ($r)=@_;
     my $idx = 1;
@@ -3898,6 +3982,8 @@
     $r->print('</table>');
     return 'ok';
 }
+
+
 sub continue {
     my $output;
     $output .= '<form action="" method="post">';
@@ -3905,6 +3991,8 @@
     $output .= '<input type="submit" value="Continue" />';
     return ($output);
 }
+
+
 sub addmetafield {
     my ($r)=@_;
     &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=addmetadata',
@@ -3953,6 +4041,9 @@
     }
     $r->print('</form>');
 }
+
+
+
 sub setrestrictmeta {
     my ($r)=@_;
     my $next_meta;
@@ -4038,7 +4129,9 @@
     $r->print(&Apache::loncommon::end_page());
     return 'ok';
 }
-##################################################
+
+
+
 sub get_added_meta_fieldnames {
     my ($cid) = @_;
     my %fields;
@@ -4051,6 +4144,9 @@
     }
     return \%fields;
 }
+
+
+
 sub get_deleted_meta_fieldnames {
     my ($cid) = @_;
     my %fields;
@@ -4266,6 +4362,8 @@
 }
 
 my %standard_parms;
+
+
 sub load_parameter_names {
     open(my $config,"<$Apache::lonnet::perlvar{'lonTabDir'}/packages.tab");
     while (my $configline=<$config>) {
@@ -4295,9 +4393,6 @@
     }
 }
 
-#
-# Parameter Change Log
-#
 
 
 sub parm_change_log {
@@ -4465,19 +4560,6 @@
     return 0;
 }
 
-##################################################
-##################################################
-
-=pod
-
-=item * handler
-
-Main handler.  Calls &assessparms and &crsenv subroutines.
-
-=cut
-
-##################################################
-##################################################
 
 sub handler {
     my $r=shift;
@@ -4567,11 +4649,4 @@
 1;
 __END__
 
-=pod
-
-=back
-
-=cut
-
-
 

--jms1227129282--