Parent Directory
|
Revision Log
nothing
1 ################################################################################ 2 # WeBWorK Online Homework Delivery System 3 # Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/ 4 # $CVSHeader: webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor/Assigner.pm,v 1.17 2004/03/06 21:49:48 sh002i Exp $ 5 # 6 # This program is free software; you can redistribute it and/or modify it under 7 # the terms of either: (a) the GNU General Public License as published by the 8 # Free Software Foundation; either version 2, or (at your option) any later 9 # version, or (b) the "Artistic License" which comes with this package. 10 # 11 # This program is distributed in the hope that it will be useful, but WITHOUT 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 # FOR A PARTICULAR PURPOSE. See either the GNU General Public License or the 14 # Artistic License for more details. 15 ################################################################################ 16 17 # SKEL: Welcome to the ContentGenerator skeleton! 18 # 19 # This module is designed to help you in creating subclasses of 20 # WeBWorK::ContentGenerator. Follow the instructions marked "SKEL" below to 21 # create your very own module. 22 # 23 # When you've finished, I recommend you do some cleanup. These modules are much 24 # easier to maintain if they doesn't contain "vestigal" garbage code. Remove the 25 # "SKEL" comments and anything else that that you're not using in your module. 26 27 # SKEL: Declare the name and superclass of your module here: 28 package WeBWorK::ContentGenerator::Skeleton; 29 use base qw(WeBWorK::ContentGenerator); 30 31 # SKEL: change the name of the module below and provide a short description. Add 32 # additional POD documentation as you see fit. 33 34 =head1 NAME 35 36 WeBWorK::ContentGenerator::Skeleton - Template for creating subclasses of 37 WeBWorK::ContentGenerator. 38 39 =cut 40 41 use strict; 42 use warnings; 43 44 # SKEL: Add "use" lines for libraries you will be using here. Note that you only 45 # need to add a "use" line here if you will be instantiating now objects or 46 # calling free functions. If you have an existing instance (like $self->r) you 47 # can use it without a corresponding "use" line. Sample lines are given below: 48 # 49 # You'll probably want to generate HTML code: 50 #use CGI::Pretty qw(); 51 # 52 # You might need some utility functions: 53 #use WeBWorK::Utils qw(function1 function2); 54 55 # SKEL: If you need to do any processing before the HTTP header is sent, do it 56 # in this method: 57 # 58 #sub pre_header_initialize { 59 # my ($self) = @_; 60 # 61 # # Do your processing here! Don't print or return anything -- store data in 62 # # the self hash for later retrieveal. 63 #} 64 65 # SKEL: To emit your own HTTP header, uncomment this: 66 # 67 #sub header { 68 # my ($self) = @_; 69 # 70 # # Generate your HTTP header here. 71 # 72 # # If you return something, it will be used as the HTTP status code for this 73 # # request. The Apache::Constants module might be useful for gerating status 74 # # codes. If you don't return anything, the status code "OK" will be used. 75 # return ""; 76 #} 77 78 # SKEL: If you need to do any processing after the HTTP header is sent, but before 79 # any template processing occurs, or you need to calculate values that will be 80 # used in multiple methods, do it in this method: 81 # 82 #sub initialize { 83 # my ($self) = @_; 84 # 85 # # Do your processing here! Don't print or return anything -- store data in 86 # # the self hash for later retrieveal. 87 #} 88 89 # SKEL: If you need to add tags to the document <HEAD>, uncomment this method: 90 # 91 #sub head { 92 # my ($self) = @_; 93 # 94 # # You can print head tags here, like <META>, <SCRIPT>, etc. 95 # 96 # return ""; 97 #} 98 99 # SKEL: To fill in the "info" box (to the right of the main body), use this 100 # method: 101 # 102 #sub info { 103 # my ($self) = @_; 104 # 105 # # Print HTML here. 106 # 107 # return ""; 108 #} 109 110 # SKEL: To provide navigation links, use this method: 111 # 112 #sub nav { 113 # my ($self, $args) = @_; 114 # 115 # # See the documentation of path() and pathMacro() in 116 # # WeBWorK::ContentGenerator for more information. 117 # 118 # return ""; 119 #} 120 121 # SKEL: For a little box for display options, etc., use this method: 122 # 123 #sub options { 124 # my ($self) = @_; 125 # 126 # # Print HTML here. 127 # 128 # return ""; 129 #} 130 131 # SKEL: For a list of sibling objects, use this method: 132 # 133 #sub siblings { 134 # my ($self, $args) = @_; 135 # 136 # # See the documentation of siblings() and siblingsMacro() in 137 # # WeBWorK::ContentGenerator for more information. 138 # # 139 # # Refer to implementations in ProblemSet and Problem. 140 # 141 # return ""; 142 #} 143 144 # SKEL: Okay, here's the body. Most of your stuff will go here: 145 # 146 sub body { 147 my ($self) = @_; 148 149 # SKEL: Useful things from the superclass: 150 # 151 # The WeBWorK::Request object. Good for accessing request params and so on. 152 #my $r = $self->r; 153 # 154 # Do you need data from the course environment? 155 #my $ce = $r->ce; 156 # 157 # Will you be accessing the database? 158 #my $db = $r->db; 159 # 160 # Query authorization: 161 #my $authz = $r->authz; 162 # 163 # The WeBWorK::URLPath object. Necessary for getting/generating URL data: 164 #my $urlpath = $r->urlpath; 165 166 # FIXME: Add more examples of common idioms, mention WeBWorK::HTML::* 167 # classes, refer to superclass methods. 168 169 # SKEL: Print your content here! 170 171 return ""; 172 } 173 174 1;
| aubreyja at gmail dot com | ViewVC Help |
| Powered by ViewVC 1.0.9 |