File:
[LON-CAPA] /
rat /
Attic /
lonftest.pm
Revision
1.4:
download - view:
text,
annotated -
select for diffs
Tue Nov 14 18:39:34 2000 UTC (23 years, 10 months ago) by
www
Branches:
MAIN
CVS tags:
version_1_2_X,
version_1_2_1,
version_1_2_0,
version_1_1_X,
version_1_1_99_5,
version_1_1_99_4,
version_1_1_99_3,
version_1_1_99_2,
version_1_1_99_1,
version_1_1_99_0,
version_1_1_3,
version_1_1_2,
version_1_1_1,
version_1_1_0,
version_1_0_99_3,
version_1_0_99_2,
version_1_0_99_1,
version_1_0_99,
version_1_0_3,
version_1_0_2,
version_1_0_1,
version_1_0_0,
version_0_99_5,
version_0_99_4,
version_0_99_3,
version_0_99_2,
version_0_99_1,
version_0_99_0,
version_0_6_2,
version_0_6,
version_0_5_1,
version_0_5,
version_0_4,
stable_2002_spring,
stable_2002_july,
stable_2002_april,
stable_2001_fall,
conference_2003,
STABLE,
HEAD
Tests parameters
1: # TRASH FORM TESTER TRASH
2: #
3: #
4: # The LearningOnline Network with CAPA
5: # TeX Content Handler
6: #
7: # 05/29/00,05/30 Gerd Kortemeyer
8:
9: package Apache::lonftest;
10:
11: use strict;
12:
13: use Apache::Constants qw(:common);
14:
15:
16: # ================================================================ Main Handler
17:
18: sub handler {
19: my $r=shift;
20:
21: # ----------------------------------------------------------- Set document type
22:
23: $r->content_type('text/html');
24:
25: $r->send_http_header;
26:
27: return OK if $r->header_only;
28:
29: # -------------------------------------------------------------------- This URL
30:
31: my $thisurl=$r->uri;
32:
33: # --------------------------------------------------------------- Render Output
34:
35: $r->print(<<ENDSTART);
36: <html>
37: <body bgcolor="#EEFFCC" test="#112233" link="#332211" vlink="#442222"
38: alink="#FF0000">
39: <h1>Form Test</h1>
40: ENDSTART
41:
42: # ---------------------------------------------------------------- Hash Restore
43: $r->print("<h2>Random Seed</h2>".&Apache::lonnet::rndseed());
44: $r->print("<h2>Restored Hash</h2>");
45:
46: my %hash=&Apache::lonnet::restore();
47: map {
48: $r->print($_.' : '.$hash{$_}.'<br>');
49: } sort keys %hash;
50:
51: # ------------------------------------------------------------------------ form
52:
53: $r->print(<<ENDFORM);
54: <h2>Form</h2>
55: <form action="$thisurl" method="post">
56: <input name="store" type=hidden value='yes'>
57: <input name="top" type=text size=20>
58: <input name="bottom" type=text size=20>
59: <input name="submit" type=submit value="Yeah!">
60: </form>
61: ENDFORM
62:
63: if ($ENV{'form.store'}) {
64: $r->print('<h2>New Data</h2>');
65: $r->print("top: $ENV{'form.top'}<br>bottom: $ENV{'form.bottom'}<br>");
66: $r->print('<p>Storing: '.
67: &Apache::lonnet::store('top' => $ENV{'form.top'},
68: 'bottom' => $ENV{'form.bottom'}));
69: }
70: $r->print("\n<br>".&Apache::lonnet::EXT('resource.fred'));
71: $r->print("\n<br>".&Apache::lonnet::EXT('resource.deadline.type'));
72: $r->print('</body></html>');
73: return OK;
74: }
75:
76: 1;
77: __END__
78:
79:
80:
81:
82:
83:
84:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>