Apache::loncommon - pile of common routines
Referenced by other mod_perl Apache modules.
Invocation: &Apache::loncommon::SUBROUTINENAME(ARGUMENTS);
Common collection of used subroutines. 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.
BEGIN()
openbrowser(formname,elementname,only,omit)
[javascript]formname and elementname indicate the name of the html form and name of the element that the results of the browsing selection are to be placed in.
Specifying 'only' will restrict the browser to displaying only files with the given extension. Can be a comma seperated list.
Specifying 'omit' will restrict the browser to NOT displaying files with the given extension. Can be a comma seperated list.
formname and elementname specify the name of the html form and the name of the element the selection from the search results will be placed in.
linked_select_forms(...)
linked_select_forms takes the following ordered inputs:
Below is an example of such a hash. Only the 'text', 'default', and
'select2' keys must appear as stated. keys(%menu)
are the possible
values for the first select menu. The text that coincides with the
first menu value is given in $menu{$choice1}->{'text'}. The values
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'' } } );
csv_translate($text)
get_domains()
select_dom_form($defdom,$name)
get_home_servers($domain)
home_server_option_list($domain)
See loncreateuser.pm for invocation and use examples.
upfile_store($r)
load_tmp_file($r)
upfile_record_sep()
record_sep($record)
upfile_select_html()
csv_print_samples($r,$records)
csv_print_select_table($r,$records,$d)
csv_samples_select_table($r,$records,$d)
$r is an Apache Request ref, $records is an arrayref from &Apache::loncommon::upfile_record_sep, $d is an array of 2 element arrays (internal name, displayed name)
languageids()
languagedescription()
copyrightids()
copyrightdescription()
filecategories()
filecategorytypes()
fileembstyle()
filedescription()
filedescriptionex()
get_previous_attempt()
get_student_view()
get_student_answers()
get_unprocessed_cgi($query,$possible_names)
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.
cacheheader()
nocache()
add_to_env($name,$value)