[system] / trunk / webwork2 / lib / WeBWorK / ContentGenerator / ProblemSets.pm Repository:
ViewVC logotype

Diff of /trunk/webwork2/lib/WeBWorK/ContentGenerator/ProblemSets.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 403 Revision 441
1package WeBWorK::ContentGenerator::ProblemSets; 1package WeBWorK::ContentGenerator::ProblemSets;
2our @ISA = qw(WeBWorK::ContentGenerator); 2our @ISA = qw(WeBWorK::ContentGenerator);
3 3
4use strict;
5use warnings;
4use WeBWorK::ContentGenerator; 6use WeBWorK::ContentGenerator;
7use WeBWorK::DB::WW;
5use Apache::Constants qw(:common); 8use Apache::Constants qw(:common);
6use CGI qw(-compile :html :form); 9use CGI qw(-compile :html :form);
10
11sub 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}
7 21
8sub title { 22sub title {
9 my $self = shift; 23 my $self = shift;
10 my $r = $self->{r}; 24 my $r = $self->{r};
11 my $courseEnvironment = $self->{courseEnvironment}; 25 my $courseEnvironment = $self->{courseEnvironment};
17sub body { 31sub body {
18 my $self = shift; 32 my $self = shift;
19 my $r = $self->{r}; 33 my $r = $self->{r};
20 my $courseEnvironment = $self->{courseEnvironment}; 34 my $courseEnvironment = $self->{courseEnvironment};
21 my $user = $r->param('user'); 35 my $user = $r->param('user');
36 my $wwdb = $self->{wwdb};
37
38 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;
22 47
23 print startform({-method=>"POST", -action=>$r->uri."set0/"}); 48 print startform({-method=>"POST", -action=>$r->uri."set0/"});
24 print $self->hidden_authen_fields; 49 print $self->hidden_authen_fields;
25 print input({-type=>"submit", -value=>"Do Set 0"}); 50 print input({-type=>"submit", -value=>"Do Set 0"});
26 print endform; 51 print endform;

Legend:
Removed from v.403  
changed lines
  Added in v.441

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9