Parent Directory
|
Revision Log
Revision 441 - (view) (download) (as text)
| 1 : | malsyned | 353 | package WeBWorK::ContentGenerator::ProblemSets; |
| 2 : | our @ISA = qw(WeBWorK::ContentGenerator); | ||
| 3 : | |||
| 4 : | malsyned | 441 | use strict; |
| 5 : | use warnings; | ||
| 6 : | malsyned | 353 | use WeBWorK::ContentGenerator; |
| 7 : | malsyned | 441 | use WeBWorK::DB::WW; |
| 8 : | malsyned | 353 | use Apache::Constants qw(:common); |
| 9 : | use CGI qw(-compile :html :form); | ||
| 10 : | |||
| 11 : | malsyned | 441 | sub initialize { |
| 12 : | my $self = shift; | ||
| 13 : | my $courseEnvironment = $self->{courseEnvironment}; | ||
| 14 : | |||
| 15 : | # Open a database connection that we can use for the rest of | ||
| 16 : | # the content generation. | ||
| 17 : | |||
| 18 : | my $wwdb = new WeBWorK::DB::WW $courseEnvironment; | ||
| 19 : | $self->{wwdb} = $wwdb; | ||
| 20 : | } | ||
| 21 : | |||
| 22 : | malsyned | 353 | sub title { |
| 23 : | my $self = shift; | ||
| 24 : | my $r = $self->{r}; | ||
| 25 : | my $courseEnvironment = $self->{courseEnvironment}; | ||
| 26 : | my $user = $r->param('user'); | ||
| 27 : | |||
| 28 : | return "Problem Sets for $user"; | ||
| 29 : | } | ||
| 30 : | |||
| 31 : | sub body { | ||
| 32 : | my $self = shift; | ||
| 33 : | my $r = $self->{r}; | ||
| 34 : | my $courseEnvironment = $self->{courseEnvironment}; | ||
| 35 : | my $user = $r->param('user'); | ||
| 36 : | malsyned | 441 | my $wwdb = $self->{wwdb}; |
| 37 : | malsyned | 353 | |
| 38 : | malsyned | 441 | if (!defined $wwdb->getSets($user)) { |
| 39 : | print "undefined".br; | ||
| 40 : | } | ||
| 41 : | |||
| 42 : | my @setNames = $wwdb->getSets($user); | ||
| 43 : | |||
| 44 : | print "Set Names<br>\n"; | ||
| 45 : | print join(br."\n", @setNames); | ||
| 46 : | print p; | ||
| 47 : | |||
| 48 : | malsyned | 403 | print startform({-method=>"POST", -action=>$r->uri."set0/"}); |
| 49 : | malsyned | 353 | print $self->hidden_authen_fields; |
| 50 : | malsyned | 403 | print input({-type=>"submit", -value=>"Do Set 0"}); |
| 51 : | malsyned | 353 | print endform; |
| 52 : | ""; | ||
| 53 : | } | ||
| 54 : | |||
| 55 : | 1; |
| aubreyja at gmail dot com | ViewVC Help |
| Powered by ViewVC 1.0.9 |