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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 455 - (download) (as text) (annotate)
Mon Aug 5 21:34:18 2002 UTC (10 years, 9 months ago) by sh002i
File size: 1251 byte(s)
"normalized" files:
- (c) header on all files
- standard order of preamble lines:
	1. (c) header
	2. package PACKAGENAME;
	3. short summary of the package (pod's NAME section)
	4. use - pragmatic modules
	5. use - standard perl modules
	6. use - CPAN modules
	7. use - webwork modules
- ALWAYS use strict and use warnings
- use "use base" rather than "our @ISA"
so now we can be happy.
-sam

    1 ################################################################################
    2 # WeBWorK mod_perl (c) 1995-2002 WeBWorK Team, Univeristy of Rochester
    3 # $Id$
    4 ################################################################################
    5 
    6 package WeBWorK::ContentGenerator::Test;
    7 
    8 =head1 NAME
    9 
   10 WeBWorK::ContentGenerator::Test - display debugging information.
   11 
   12 =cut
   13 
   14 use strict;
   15 use warnings;
   16 use base qw(WeBWorK::ContentGenerator);
   17 use CGI qw();
   18 use WeBWorK::Form;
   19 use WeBWorK::Utils qw(ref2string);
   20 
   21 # This file will cease to be as soon as the real content generation modules
   22 # have been written.  However, there's always reason to keep it around, as
   23 # it showcases many things that new content generators will want to do,
   24 # since it's generally where I dump new functionality before I put it in any
   25 # end-user modules.
   26 
   27 sub initialize {
   28   my $self = shift;
   29   $self->{funny} = "foobar!";
   30 }
   31 
   32 sub title {
   33   return "Welcome to Hell";
   34 }
   35 
   36 sub body {
   37   my $self = shift;
   38   my $formFields = WeBWorK::Form->new_from_paramable($self->{r});
   39   my $courseEnvironment = $self->{courseEnvironment};
   40   return
   41     CGI->h2("Form Fields"), ref2string($formFields),
   42     CGI->h2("Course Environment"), ref2string($courseEnvironment),
   43     CGI->h2("Funny"), p($self->{funny});
   44 }
   45 
   46 1;

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9