[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm
bowersj2
lon-capa-cvs@mail.lon-capa.org
Wed, 20 Aug 2003 18:18:45 -0000
This is a MIME encoded message
--bowersj21061403525
Content-Type: text/plain
bowersj2 Wed Aug 20 14:18:45 2003 EDT
Modified files:
/loncom/interface loncommon.pm
Log:
Documentation reformatting. A smidge of updating.
I was going to add a couple of routines and there was no good way to
document it, so I fixed this up.
--bowersj21061403525
Content-Type: text/plain
Content-Disposition: attachment; filename="bowersj2-20030820141845.txt"
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.111 loncom/interface/loncommon.pm:1.112
--- loncom/interface/loncommon.pm:1.111 Wed Aug 13 16:40:31 2003
+++ loncom/interface/loncommon.pm Wed Aug 20 14:18:45 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.111 2003/08/13 20:40:31 www Exp $
+# $Id: loncommon.pm,v 1.112 2003/08/20 18:18:45 bowersj2 Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -47,29 +47,15 @@
=head1 SYNOPSIS
-Referenced by other mod_perl Apache modules.
+Common routines for manipulating connections, student answers,
+ domains, common Javascript fragments, etc.
-Invocation:
- &Apache::loncommon::SUBROUTINENAME(ARGUMENTS);
+=head1 OVERVIEW
-=head1 INTRODUCTION
-
-Common collection of used subroutines. This collection helps remove
+A collection of commonly used subroutines that don't have a natural
+home anywhere else. This collection helps remove
redundancy from other modules and increase efficiency of memory usage.
-Current things done:
-
- Makes a table out of the previous homework attempts
- Inputs result_from_symbread, user, domain, course_id
- Reads in non-network-related .tab files
-
-This is part of the LearningOnline Network with CAPA project
-described at http://www.lon-capa.org.
-
-=head2 General Subroutines
-
-=over 4
-
=cut
# End of POD header
@@ -86,11 +72,10 @@
=pod
-=item Global Variables
-
-=over 4
+=head1 Global Variables
=cut
+
# ----------------------------------------------- Filetypes/Languages/Copyright
my %language;
my %cprtag;
@@ -103,37 +88,45 @@
# ---------------------------------------------- Thesaurus variables
+# FIXME: I don't think it's necessary to document these things;
+# they're privately used - Jeremy
+
=pod
-=item %Keywords
+=over 4
+
+=item * %Keywords
A hash used by &keyword to determine if a word is considered a keyword.
-=item $thesaurus_db_file
+=item * $thesaurus_db_file
Scalar containing the full path to the thesaurus database.
+=back
+
=cut
my %Keywords;
my $thesaurus_db_file;
+# ----------------------------------------------------------------------- BEGIN
+# FIXME: I don't think this needs to be documented, it prepares
+# private data structures - Jeremy
=pod
-=back
-
-=cut
-
-# ----------------------------------------------------------------------- BEGIN
+=head1 General Subroutines
-=pod
+=over 4
-=item BEGIN()
+=item * BEGIN()
Initialize values from language.tab, copyright.tab, filetypes.tab,
thesaurus.tab, and filecategories.tab.
+=back
+
=cut
# ----------------------------------------------------------------------- BEGIN
@@ -228,21 +221,27 @@
} # end of unless($readit)
}
-# ============================================================= END BEGIN BLOCK
+
###############################################################
## HTML and Javascript Helper Functions ##
###############################################################
=pod
-=item browser_and_searcher_javascript
+=head1 HTML and Javascript Functions
-Returns scalar containing javascript to open a browser window
-or a searcher window. Also creates
+=over 4
+
+=item * browser_and_searcher_javascript ()
+
+X<browsing, javascript>X<searching, javascript>Returns a string
+containing javascript with two functions, C<openbrowser> and
+C<opensearcher>. Returned string does not contain E<lt>scriptE<gt>
+tags.
=over 4
-=item openbrowser(formname,elementname,only,omit) [javascript]
+=item * openbrowser(formname,elementname,only,omit) [javascript]
inputs: formname, elementname, only, omit
@@ -255,7 +254,7 @@
Specifying 'omit' will restrict the browser to NOT displaying files
with the given extension. Can be a comma seperated list.
-=item opensearcher(formname, elementname) [javascript]
+=item * opensearcher(formname, elementname) [javascript]
Inputs: formname, elementname
@@ -266,7 +265,6 @@
=cut
-###############################################################
sub browser_and_searcher_javascript {
return <<END;
var editbrowser = null;
@@ -387,11 +385,9 @@
'","'.$udomele.'");'."'>Select Course</a>";
}
-###############################################################
-
=pod
-=item linked_select_forms(...)
+=item * linked_select_forms(...)
linked_select_forms returns a string containing a <script></script> block
and html for two <select> menus. The select menus will be linked in that
@@ -403,17 +399,17 @@
=over 4
-=item $formname, the name of the <form> tag
+=item * $formname, the name of the <form> tag
-=item $middletext, the text which appears between the <select> tags
+=item * $middletext, the text which appears between the <select> tags
-=item $firstdefault, the default value for the first menu
+=item * $firstdefault, the default value for the first menu
-=item $firstselectname, the name of the first <select> tag
+=item * $firstselectname, the name of the first <select> tag
-=item $secondselectname, the name of the second <select> tag
+=item * $secondselectname, the name of the second <select> tag
-=item $hashref, a reference to a hash containing the data for the menus.
+=item * $hashref, a reference to a hash containing the data for the menus.
=back
@@ -424,41 +420,39 @@
and text for the second menu are given in the hash pointed to by
$menu{$choice1}->{'select2'}.
-my %menu = ( A1 => { text =>"Choice A1" ,
- default => "B3",
- select2 => {
- B1 => "Choice B1",
- B2 => "Choice B2",
- B3 => "Choice B3",
- B4 => "Choice B4"
- }
- },
- A2 => { text =>"Choice A2" ,
- default => "C2",
- select2 => {
- C1 => "Choice C1",
- C2 => "Choice C2",
- C3 => "Choice C3"
- }
- },
- A3 => { text =>"Choice A3" ,
- default => "D6",
- select2 => {
- D1 => "Choice D1",
- D2 => "Choice D2",
- D3 => "Choice D3",
- D4 => "Choice D4",
- D5 => "Choice D5",
- D6 => "Choice D6",
- D7 => "Choice D7"
- }
- }
- );
+ my %menu = ( A1 => { text =>"Choice A1" ,
+ default => "B3",
+ select2 => {
+ B1 => "Choice B1",
+ B2 => "Choice B2",
+ B3 => "Choice B3",
+ B4 => "Choice B4"
+ }
+ },
+ A2 => { text =>"Choice A2" ,
+ default => "C2",
+ select2 => {
+ C1 => "Choice C1",
+ C2 => "Choice C2",
+ C3 => "Choice C3"
+ }
+ },
+ A3 => { text =>"Choice A3" ,
+ default => "D6",
+ select2 => {
+ D1 => "Choice D1",
+ D2 => "Choice D2",
+ D3 => "Choice D3",
+ D4 => "Choice D4",
+ D5 => "Choice D5",
+ D6 => "Choice D6",
+ D7 => "Choice D7"
+ }
+ }
+ );
=cut
-# ------------------------------------------------
-
sub linked_select_forms {
my ($formname,
$middletext,
@@ -537,19 +531,27 @@
return $result;
} # end of sub linked_select_forms {
-###############################################################
-
=pod
-=item help_open_topic($topic, $text, $stayOnPage, $width, $height)
-
-Returns a string corresponding to an HTML link to the given help $topic, where $topic corresponds to the name of a .tex file in /home/httpd/html/adm/help/tex, with underscores replaced by spaces.
+=item * help_open_topic($topic, $text, $stayOnPage, $width, $height)
-$text will optionally be linked to the same topic, allowing you to link text in addition to the graphic. If you do not want to link text, but wish to specify one of the later parameters, pass an empty string.
-
-$stayOnPage is a value that will be interpreted as a boolean. If true, the link will not open a new window. If false, the link will open a new window using Javascript. (Default is false.)
-
-$width and $height are optional numerical parameters that will override the width and height of the popped up window, which may be useful for certain help topics with big pictures included.
+Returns a string corresponding to an HTML link to the given help
+$topic, where $topic corresponds to the name of a .tex file in
+/home/httpd/html/adm/help/tex, with underscores replaced by
+spaces.
+
+$text will optionally be linked to the same topic, allowing you to
+link text in addition to the graphic. If you do not want to link
+text, but wish to specify one of the later parameters, pass an
+empty string.
+
+$stayOnPage is a value that will be interpreted as a boolean. If true,
+the link will not open a new window. If false, the link will open
+a new window using Javascript. (Default is false.)
+
+$width and $height are optional numerical parameters that will
+override the width and height of the popped up window, which may
+be useful for certain help topics with big pictures included.
=cut
@@ -617,11 +619,13 @@
=pod
-=item csv_translate($text)
+=item * csv_translate($text)
Translate $text to allow it to be output as a 'comma seperated values'
format.
+=back
+
=cut
sub csv_translate {
@@ -634,11 +638,14 @@
###############################################################
## Home server <option> list generating code ##
###############################################################
-#-------------------------------------------
=pod
-=item get_domains()
+=head1 Home Server option list generating code
+
+=over 4
+
+=item * get_domains()
Returns an array containing each of the domains listed in the hosts.tab
file.
@@ -660,7 +667,7 @@
=pod
-=item select_form($defdom,$name,%hash)
+=item * select_form($defdom,$name,%hash)
Returns a string containing a <select name='$name' size='1'> form to
allow a user to select options from a hash option_name => displayed text.
@@ -686,7 +693,7 @@
=pod
-=item select_dom_form($defdom,$name,$includeempty)
+=item * select_dom_form($defdom,$name,$includeempty)
Returns a string containing a <select name='$name' size='1'> form to
allow a user to select the domain to preform an operation in.
@@ -716,7 +723,7 @@
=pod
-=item get_library_servers($domain)
+=item * get_library_servers($domain)
Returns a hash which contains keys like '103l3' and values like
'kirk.lite.msu.edu'. All of the keys will be for machines in the
@@ -740,7 +747,7 @@
=pod
-=item home_server_option_list($domain)
+=item * home_server_option_list($domain)
returns a string which contains an <option> list to be used in a
<select> form input. See loncreateuser.pm for an example.
@@ -758,16 +765,24 @@
}
return $result;
}
-###############################################################
-## End of home server <option> list generating code ##
-###############################################################
+
+=pod
+
+=back
+
+=cut
###############################################################
+## Decoding User Agent ##
###############################################################
=pod
-=item &decode_user_agent()
+=head1 Decoding the User Agent
+
+=over 4
+
+=item * &decode_user_agent()
Inputs: $r
@@ -775,17 +790,17 @@
=over 4
-=item $httpbrowser
+=item * $httpbrowser
-=item $clientbrowser
+=item * $clientbrowser
-=item $clientversion
+=item * $clientversion
-=item $clientmathml
+=item * $clientmathml
-=item $clientunicode
+=item * $clientunicode
-=item $clientos
+=item * $clientos
=back
@@ -827,9 +842,11 @@
$clientunicode,$clientos,);
}
-###############################################################
-###############################################################
+=pod
+
+=back
+=cut
###############################################################
## Authentication changing form generation subroutines ##
@@ -843,7 +860,11 @@
=pod
-=item authform_xxxxxx
+=head1 Authentication Routines
+
+=over 4
+
+=item * authform_xxxxxx
The authform_xxxxxx subroutines provide javascript and html forms which
handle some of the conveniences required for authentication forms.
@@ -853,17 +874,17 @@
=over 4
-=item authform_header
+=item * authform_header
-=item authform_authorwarning
+=item * authform_authorwarning
-=item authform_nochange
+=item * authform_nochange
-=item authform_kerberos
+=item * authform_kerberos
-=item authform_internal
+=item * authform_internal
-=item authform_filesystem
+=item * authform_filesystem
=back
@@ -1061,22 +1082,26 @@
return $result;
}
-###############################################################
-## End Authentication changing form generation functions ##
-###############################################################
+=pod
+
+=back
+
+=cut
###############################################################
## Get Authentication Defaults for Domain ##
###############################################################
-##
-## Returns default authentication type and an associated argument
-## as listed in file domain.tab
-##
-#-------------------------------------------
=pod
-=item get_auth_defaults
+=head1 Domains and Authentication
+
+Returns default authentication type and an associated argument as
+listed in file 'domain.tab'.
+
+=over 4
+
+=item * get_auth_defaults
get_auth_defaults($target_domain) returns the default authentication
type and an associated argument (initial password or a kerberos domain).
@@ -1086,12 +1111,6 @@
If target_domain is not found in domain.tab, returns nothing ('').
-=over 4
-
-=item get_auth_defaults
-
-=back
-
=cut
#-------------------------------------------
@@ -1115,7 +1134,7 @@
=pod
-=item get_kerberos_defaults
+=item * get_kerberos_defaults
get_kerberos_defaults($target_domain) returns the default kerberos
version and domain. If not found in domain.tabs, it defaults to
@@ -1123,12 +1142,6 @@
($def_version, $def_krb_domain) = &get_kerberos_defaults($target_domain);
-=over 4
-
-=item get_kerberos_defaults
-
-=back
-
=cut
#-------------------------------------------
@@ -1144,9 +1157,12 @@
}
return ($krbdef,$krbdefdom);
}
-###############################################################
-## End Get Kerberos Defaults for Domain ##
-###############################################################
+
+=pod
+
+=back
+
+=cut
###############################################################
## Thesaurus Functions ##
@@ -1154,7 +1170,11 @@
=pod
-=item initialize_keywords
+=head1 Thesaurus Functions
+
+=over 4
+
+=item * initialize_keywords
Initializes the package variable %Keywords if it is empty. Uses the
package variable $thesaurus_db_file.
@@ -1199,7 +1219,7 @@
=pod
-=item keyword($word)
+=item * keyword($word)
Returns true if $word is a keyword. A keyword is a word that appears more
than the average number of times in the thesaurus database. Calls
@@ -1220,7 +1240,7 @@
=pod
-=item get_related_words
+=item * get_related_words
Look up a word in the thesaurus. Takes a scalar arguement and returns
an array of words. If the keyword is not in the thesaurus, an empty array
@@ -1257,18 +1277,23 @@
return @Words;
}
-###############################################################
-## End Thesaurus Functions ##
-###############################################################
+=pod
+
+=back
+
+=cut
# -------------------------------------------------------------- Plaintext name
=pod
-=item plainname($uname,$udom)
+=head1 User Name Functions
-Gets a users name and returns it as a string in
-"first middle last generation"
-form
+=over 4
+
+=item * plainname($uname,$udom)
+
+Takes a users logon name and returns it as a string in
+"first middle last generation" form
=cut
@@ -1288,7 +1313,7 @@
# -------------------------------------------------------------------- Nickname
=pod
-=item nickname($uname,$udom)
+=item * nickname($uname,$udom)
Gets a users name and returns it as a string as
@@ -1323,7 +1348,7 @@
=pod
-=item screenname($uname,$udom)
+=item * screenname($uname,$udom)
Gets a users screenname and returns it as a string
@@ -1368,16 +1393,135 @@
return "<a href='/public/$domain/$coursedir/syllabus'>$linktext</a>";
}
-# ---------------------------------------------------------------- Language IDs
+=pod
+
+=back
+
+=head1 Access .tab File Data
+
+=over 4
+
+=item * languageids()
+
+returns list of all language ids
+
+=cut
+
sub languageids {
return sort(keys(%language));
}
-# -------------------------------------------------------- Language Description
+=pod
+
+=item * languagedescription()
+
+returns description of a specified language id
+
+=cut
+
sub languagedescription {
return $language{shift(@_)};
}
+=pod
+
+=item * copyrightids()
+
+returns list of all copyrights
+
+=cut
+
+sub copyrightids {
+ return sort(keys(%cprtag));
+}
+
+=pod
+
+=item * copyrightdescription()
+
+returns description of a specified copyright id
+
+=cut
+
+sub copyrightdescription {
+ return $cprtag{shift(@_)};
+}
+
+=pod
+
+=item * filecategories()
+
+returns list of all file categories
+
+=cut
+
+sub filecategories {
+ return sort(keys(%category_extensions));
+}
+
+=pod
+
+=item * filecategorytypes()
+
+returns list of file types belonging to a given file
+category
+
+=cut
+
+sub filecategorytypes {
+ return @{$category_extensions{lc($_[0])}};
+}
+
+=pod
+
+=item * fileembstyle()
+
+returns embedding style for a specified file type
+
+=cut
+
+sub fileembstyle {
+ return $fe{lc(shift(@_))};
+}
+
+=pod
+
+=item * filedescription()
+
+returns description for a specified file type
+
+=cut
+
+sub filedescription {
+ return $fd{lc(shift(@_))};
+}
+
+=pod
+
+=item * filedescriptionex()
+
+returns description for a specified file type with
+extra formatting
+
+=cut
+
+sub filedescriptionex {
+ my $ex=shift;
+ return '.'.$ex.' '.$fd{lc($ex)};
+}
+
+# End of .tab access
+=pod
+
+=back
+
+=cut
+
+# ------------------------------------------------------------------ File Types
+sub fileextensions {
+ return sort(keys(%fe));
+}
+
# ----------------------------------------------------------- Display Languages
# returns a hash with all desired display languages
#
@@ -1404,59 +1548,45 @@
return %languages;
}
-# --------------------------------------------------------------- Copyright IDs
-sub copyrightids {
- return sort(keys(%cprtag));
-}
+###############################################################
+## Student Answer Attempts ##
+###############################################################
-# ------------------------------------------------------- Copyright Description
-sub copyrightdescription {
- return $cprtag{shift(@_)};
-}
+=pod
-# ------------------------------------------------------------- File Categories
-sub filecategories {
- return sort(keys(%category_extensions));
-}
+=head1 Alternate Problem Views
-# -------------------------------------- File Types within a specified category
-sub filecategorytypes {
- return @{$category_extensions{lc($_[0])}};
-}
+=over 4
-# ------------------------------------------------------------------ File Types
-sub fileextensions {
- return sort(keys(%fe));
-}
+=item * get_previous_attempt($symb, $username, $domain, $course,
+ $getattempt, $regexp, $gradesub)
-# ------------------------------------------------------------- Embedding Style
-sub fileembstyle {
- return $fe{lc(shift(@_))};
-}
+Return string with previous attempt on problem. Arguments:
-# ------------------------------------------------------------ Description Text
-sub filedescription {
- return $fd{lc(shift(@_))};
-}
+=over 4
-# ------------------------------------------------------------ Description Text
-sub filedescriptionex {
- my $ex=shift;
- return '.'.$ex.' '.$fd{lc($ex)};
-}
+=item * $symb: Problem, including path
+
+=item * $username: username of the desired student
+
+=item * $domain: domain of the desired student
+
+=item * $course: Course ID
+
+=item * $getattempt: Leave blank for all attempts, otherwise put
+ something
+
+=item * $regexp: if string matches this regexp, the string will be
+ sent to $gradesub
+
+=item * $gradesub: routine that processes the string if it matches $regexp
+
+=back
+
+The output string is a table containing all desired attempts, if any.
+
+=cut
-# ---- Retrieve attempts by students
-# input
-# $symb - problem including path
-# $username,$domain - that of the student
-# $course - course name
-# $getattempt - leave blank if want all attempts, else put something.
-# $regexp - regular expression. If string matches regexp send to
-# $gradesub - routine that process the string if it matches regexp
-#
-# output
-# formatted as a table all the attempts, if any.
-#
sub get_previous_attempt {
my ($symb,$username,$domain,$course,$getattempt,$regexp,$gradesub)=@_;
my $prevattempts='';
@@ -1557,6 +1687,14 @@
return $output;
}
+=pod
+
+=item * get_student_view
+
+show a snapshot of what student was looking at
+
+=cut
+
sub get_student_view {
my ($symb,$username,$domain,$courseid,$target) = @_;
my ($map,$id,$feedurl) = split(/___/,$symb);
@@ -1585,6 +1723,14 @@
return $userview;
}
+=pod
+
+=item * get_student_answers()
+
+show a snapshot of how student was answering problem
+
+=cut
+
sub get_student_answers {
my ($symb,$username,$domain,$courseid,%form) = @_;
my ($map,$id,$feedurl) = split(/___/,$symb);
@@ -1604,6 +1750,12 @@
return $userview;
}
+=pod
+
+=back
+
+=cut
+
###############################################
@@ -1668,7 +1820,11 @@
=pod
-=item &determinedomain()
+=head1 Domain Template Functions
+
+=over 4
+
+=item * &determinedomain()
Inputs: $domain (usually will be undef)
@@ -1692,7 +1848,7 @@
###############################################
=pod
-=item &domainlogo()
+=item * &domainlogo()
Inputs: $domain (usually will be undef)
@@ -1700,6 +1856,7 @@
If the domain logo does not exist, a description of the domain.
=cut
+
###############################################
sub domainlogo {
my $domain = &determinedomain(shift);
@@ -1719,13 +1876,14 @@
=pod
-=item &designparm()
+=item * &designparm()
Inputs: $which parameter; $domain (usually will be undef)
Returns: value of designparamter $which
=cut
+
##############################################
sub designparm {
my ($which,$domain)=@_;
@@ -1756,20 +1914,35 @@
=pod
-=item &bodytag()
+=back
+
+=head1 HTTP Helpers
+
+=over 4
+
+=item * &bodytag()
Returns a uniform header for LON-CAPA web pages.
Inputs:
- $title, A title to be displayed on the page.
- $function, the current role (can be undef).
- $addentries, extra parameters for the <body> tag.
- $bodyonly, if defined, only return the <body> tag.
- $domain, if defined, force a given domain.
- $forcereg, if page should register as content page (relevant for
+=over 4
+
+=item * $title, A title to be displayed on the page.
+
+=item * $function, the current role (can be undef).
+
+=item * $addentries, extra parameters for the <body> tag.
+
+=item * $bodyonly, if defined, only return the <body> tag.
+
+=item * $domain, if defined, force a given domain.
+
+=item * $forcereg, if page should register as content page (relevant for
text interface only)
+=back
+
Returns: A uniform header for LON-CAPA web pages.
If $bodyonly is nonzero, a string containing a <body> tag will be returned.
If $bodyonly is undef or zero, an html string containing a <body> tag and
@@ -1777,10 +1950,6 @@
=cut
-###############################################
-
-
-###############################################
sub bodytag {
my ($title,$function,$addentries,$bodyonly,$domain,$forcereg)=@_;
unless ($function) {
@@ -1947,7 +2116,20 @@
$r->headers_in->unset('Content-length');
}
-###############################################
+=pod
+
+=item * get_unprocessed_cgi($query,$possible_names)
+
+Modify the %ENV hash to contain unprocessed CGI form parameters held in
+$query. The parameters listed in $possible_names (an array reference),
+will be set in $ENV{'form.name'} if they do not already exist.
+
+Typically called with $ENV{'QUERY_STRING'} as the first parameter.
+$possible_names is an ref to an array of form element names. As an example:
+get_unprocessed_cgi($ENV{'QUERY_STRING'},['uname','udom']);
+will result in $ENV{'form.uname'} and $ENV{'form.udom'} being set.
+
+=cut
sub get_unprocessed_cgi {
my ($query,$possible_names)= @_;
@@ -1964,6 +2146,14 @@
}
}
+=pod
+
+=item * cacheheader()
+
+returns cache-controlling header code
+
+=cut
+
sub cacheheader {
unless ($ENV{'request.method'} eq 'GET') { return ''; }
my $date=strftime("%a, %d %b %Y %H:%M:%S GMT",gmtime);
@@ -1973,6 +2163,14 @@
return $output;
}
+=pod
+
+=item * no_cache($r)
+
+specifies header code to not have cache
+
+=cut
+
sub no_cache {
my ($r) = @_;
unless ($ENV{'request.method'} eq 'GET') { return ''; }
@@ -1982,6 +2180,16 @@
#$r->header_out("Expires" => $date);
}
+=pod
+
+=item * add_to_env($name,$value)
+
+adds $name to the %ENV hash with value
+$value, if $name already exists, the entry is converted to an array
+reference and $value is added to the array.
+
+=cut
+
sub add_to_env {
my ($name,$value)=@_;
if (defined($ENV{$name})) {
@@ -2003,11 +2211,11 @@
=back
-=head2 CSV Upload/Handling functions
+=head1 CSV Upload/Handling functions
=over 4
-=item upfile_store($r)
+=item * upfile_store($r)
Store uploaded file, $r should be the HTTP Request object,
needs $ENV{'form.upfile'}
@@ -2034,7 +2242,7 @@
=pod
-=item load_tmp_file($r)
+=item * load_tmp_file($r)
Load uploaded file from tmp, $r should be the HTTP Request object,
needs $ENV{'form.datatoken'},
@@ -2057,7 +2265,7 @@
=pod
-=item upfile_record_sep()
+=item * upfile_record_sep()
Separate uploaded file into records
returns array of records,
@@ -2074,7 +2282,7 @@
=pod
-=item record_sep($record)
+=item * record_sep($record)
Separate a record into fields $record should be an item from the upfile_record_sep(), needs $ENV{'form.upfiletype'}
@@ -2126,7 +2334,7 @@
=pod
-=item upfile_select_html()
+=item * upfile_select_html()
return HTML code to select file and specify its type
@@ -2146,7 +2354,7 @@
=pod
-=item csv_print_samples($r,$records)
+=item * csv_print_samples($r,$records)
Prints a table of sample values from each column uploaded $r is an
Apache Request ref, $records is an arrayref from
@@ -2178,7 +2386,7 @@
=pod
-=item csv_print_select_table($r,$records,$d)
+=item * csv_print_select_table($r,$records,$d)
Prints a table to create associations between values and table columns.
$r is an Apache Request ref,
@@ -2212,7 +2420,7 @@
=pod
-=item csv_samples_select_table($r,$records,$d)
+=item * csv_samples_select_table($r,$records,$d)
Prints a table of sample values from the upload and can make associate samples to internal names.
@@ -2252,7 +2460,7 @@
=pod
-=item check_if_partid_hidden($id,$symb,$udom,$uname)
+=item * check_if_partid_hidden($id,$symb,$udom,$uname)
Returns either 1 or undef
@@ -2278,106 +2486,12 @@
return undef;
}
-
-
-1;
-__END__;
-
=pod
=back
-=head2 Access .tab File Data
-
-=over 4
-
-=item languageids()
-
-returns list of all language ids
-
-=item languagedescription()
-
-returns description of a specified language id
-
-=item copyrightids()
-
-returns list of all copyrights
-
-=item copyrightdescription()
-
-returns description of a specified copyright id
-
-=item filecategories()
-
-returns list of all file categories
-
-=item filecategorytypes()
-
-returns list of file types belonging to a given file
-category
-
-=item fileembstyle()
-
-returns embedding style for a specified file type
-
-=item filedescription()
-
-returns description for a specified file type
-
-=item filedescriptionex()
-
-returns description for a specified file type with
-extra formatting
-
-=back
-
-=head2 Alternate Problem Views
-
-=over 4
-
-=item get_previous_attempt()
-
-return string with previous attempt on problem
-
-=item get_student_view()
-
-show a snapshot of what student was looking at
-
-=item get_student_answers()
-
-show a snapshot of how student was answering problem
-
-=back
-
-=head2 HTTP Helper
-
-=over 4
-
-=item get_unprocessed_cgi($query,$possible_names)
-
-Modify the %ENV hash to contain unprocessed CGI form parameters held in
-$query. The parameters listed in $possible_names (an array reference),
-will be set in $ENV{'form.name'} if they do not already exist.
-
-Typically called with $ENV{'QUERY_STRING'} as the first parameter.
-$possible_names is an ref to an array of form element names. As an example:
-get_unprocessed_cgi($ENV{'QUERY_STRING'},['uname','udom']);
-will result in $ENV{'form.uname'} and $ENV{'form.udom'} being set.
-
-=item cacheheader()
-
-returns cache-controlling header code
-
-=item no_cache($r)
-
-specifies header code to not have cache
-
-=item add_to_env($name,$value)
-
-adds $name to the %ENV hash with value
-$value, if $name already exists, the entry is converted to an array
-reference and $value is added to the array.
+=cut
-=back
+1;
+__END__;
-=cut
--bowersj21061403525--