[system] / trunk / webwork-modperl / lib / WeBWorK / Test.pm Repository:
ViewVC logotype

View of /trunk/webwork-modperl/lib/WeBWorK/Test.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 323 - (download) (as text) (annotate)
Thu May 30 20:34:46 2002 UTC (17 years, 7 months ago) by malsyned
File size: 1386 byte(s)
-Fixed a few interfaces so that they make more sense (I hope)
-Added preliminary templating code to ContentGenerator
-Added a lot of logic to the dispatcher (WeBWorK.pm).  More to come, too.
-Moved lots of things over to CGI.pm, for my convenience while prototyping
-Added preliminary examples of ProblemSets, ProblemSet, and Problem.
 Problem.pm will some day go on to do what ProcessProblem8 does right now,
 so keep your eyes on that one.
--Dennis

    1 package WeBWorK::Test;
    2 
    3 # This file will cease to be as soon as the real content generation modules
    4 # have been written.  However, there's always reason to keep it around, as
    5 # it showcases many things that new content generators will want to do,
    6 # since it's generally where I dump new functionality before I put it in any
    7 # end-user modules.
    8 
    9 use Apache::Request;
   10 use Apache::Constants qw(:common);
   11 use WeBWorK::ContentGenerator;
   12 
   13 our @ISA = qw(WeBWorK::ContentGenerator);
   14 
   15 sub go() {
   16   my $self = shift;
   17   my $r = $self->{r};
   18   $r->content_type("text/html");
   19   $r->send_http_header;
   20 
   21   # get some stuff together
   22   my $user = $r->param("user");
   23   my $key = $r->param("key");
   24   my $uri = $r->uri;
   25 
   26 print<<EOT;
   27 <html>
   28 <head><title>Welcome to Hell.</title></head>
   29 <body>
   30 <h1>There you go.</h1>
   31 <p>You're now accessing $uri.</p>
   32 EOT
   33   $self->print_form_data(""," = ","<br>");
   34 
   35   print '<br><form method="POST" action="',$r->uri,'">';
   36   $self->print_form_data('<input type="hidden" name="','" value = "',"\">\n");
   37   print '<input type="submit" value="repost"></form>';
   38 
   39   print '<form method="POST" action="',$r->uri,'">';
   40   $self->print_form_data('<input type="hidden" name="','" value = "',"\">\n",qr/^key$/);
   41   print "<input type=\"hidden\" name=\"key\" value=\"invalidkeyhahaha\">";
   42   print '<input type="submit" value="invalidate key"></form>';
   43 
   44 
   45 print<<EOT;
   46 </body>
   47 </html>
   48 EOT
   49 
   50   return OK;
   51 }
   52 
   53 1;

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9