| 1 | ################################################################################ |
1 | ################################################################################ |
| 2 | # WeBWorK Online Homework Delivery System |
2 | # WeBWorK Online Homework Delivery System |
| 3 | # Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/ |
3 | # Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/ |
| 4 | # $CVSHeader: webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm,v 1.33 2004/10/25 22:37:32 jj Exp $ |
4 | # $CVSHeader: webwork2/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm,v 1.34 2004/10/25 22:40:19 jj Exp $ |
| 5 | # |
5 | # |
| 6 | # This program is free software; you can redistribute it and/or modify it under |
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 |
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 |
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. |
9 | # version, or (b) the "Artistic License" which comes with this package. |
| … | |
… | |
| 252 | ##### Version 2 is local problem sets |
252 | ##### Version 2 is local problem sets |
| 253 | sub browse_mysets_panel { |
253 | sub browse_mysets_panel { |
| 254 | my $self = shift; |
254 | my $self = shift; |
| 255 | my $library_selected = shift; |
255 | my $library_selected = shift; |
| 256 | my $list_of_local_sets = shift; |
256 | my $list_of_local_sets = shift; |
| 257 | my $default_value = "Select a Problem Set"; |
257 | my $default_value = "Select a Homework Set"; |
| 258 | |
258 | |
| 259 | if(scalar(@$list_of_local_sets) == 0) { |
259 | if(scalar(@$list_of_local_sets) == 0) { |
| 260 | $list_of_local_sets = [NO_LOCAL_SET_STRING]; |
260 | $list_of_local_sets = [NO_LOCAL_SET_STRING]; |
| 261 | } elsif (not $library_selected or $library_selected eq $default_value) { |
261 | } elsif (not $library_selected or $library_selected eq $default_value) { |
| 262 | unshift @{$list_of_local_sets}, $default_value; |
262 | unshift @{$list_of_local_sets}, $default_value; |
| … | |
… | |
| 412 | print CGI::Tr(CGI::td({-bgcolor=>"black"})); |
412 | print CGI::Tr(CGI::td({-bgcolor=>"black"})); |
| 413 | |
413 | |
| 414 | if($have_local_sets ==0) { |
414 | if($have_local_sets ==0) { |
| 415 | $list_of_local_sets = [NO_LOCAL_SET_STRING]; |
415 | $list_of_local_sets = [NO_LOCAL_SET_STRING]; |
| 416 | } elsif (not $set_selected or $set_selected eq SELECT_SET_STRING) { |
416 | } elsif (not $set_selected or $set_selected eq SELECT_SET_STRING) { |
| 417 | if ($list_of_local_sets->[0] eq "Select a Problem Set") { |
417 | if ($list_of_local_sets->[0] eq "Select a Homework Set") { |
| 418 | shift @{$list_of_local_sets}; |
418 | shift @{$list_of_local_sets}; |
| 419 | } |
419 | } |
| 420 | unshift @{$list_of_local_sets}, SELECT_SET_STRING; |
420 | unshift @{$list_of_local_sets}, SELECT_SET_STRING; |
| 421 | $set_selected = SELECT_SET_STRING; |
421 | $set_selected = SELECT_SET_STRING; |
| 422 | } |
422 | } |
| … | |
… | |
| 656 | |
656 | |
| 657 | } elsif ($r->param('view_mysets_set')) { |
657 | } elsif ($r->param('view_mysets_set')) { |
| 658 | |
658 | |
| 659 | my $set_to_display = $r->param('library_sets'); |
659 | my $set_to_display = $r->param('library_sets'); |
| 660 | if (not defined($set_to_display) |
660 | if (not defined($set_to_display) |
| 661 | or $set_to_display eq "Select a Problem Set" |
661 | or $set_to_display eq "Select a Homework Set" |
| 662 | or $set_to_display eq NO_LOCAL_SET_STRING) { |
662 | or $set_to_display eq NO_LOCAL_SET_STRING) { |
| 663 | $self->addbadmessage("You need to select a set from this course to view."); |
663 | $self->addbadmessage("You need to select a set from this course to view."); |
| 664 | } else { |
664 | } else { |
| 665 | my @problemList = $db->listGlobalProblems($set_to_display); |
665 | my @problemList = $db->listGlobalProblems($set_to_display); |
| 666 | my $problem; |
666 | my $problem; |
| … | |
… | |
| 829 | |
829 | |
| 830 | } |
830 | } |
| 831 | |
831 | |
| 832 | |
832 | |
| 833 | sub title { |
833 | sub title { |
| 834 | return "Problem Set Maker"; |
834 | return "Homework Set Maker"; |
| 835 | } |
835 | } |
| 836 | |
836 | |
| 837 | sub body { |
837 | sub body { |
| 838 | my ($self) = @_; |
838 | my ($self) = @_; |
| 839 | |
839 | |