| … | |
… | |
| 979 | debug("browse_mysets", $r->param("browse_mysets")); |
979 | debug("browse_mysets", $r->param("browse_mysets")); |
| 980 | debug("browse_setdefs", $r->param("browse_setdefs")); |
980 | debug("browse_setdefs", $r->param("browse_setdefs")); |
| 981 | ##### Asked to browse certain problems |
981 | ##### Asked to browse certain problems |
| 982 | if ($browse_lib ne '') { |
982 | if ($browse_lib ne '') { |
| 983 | $browse_which = $browse_lib; |
983 | $browse_which = $browse_lib; |
| 984 | $self->{current_library_sets} = ""; |
984 | $self->{current_library_set} = ""; |
| 985 | $use_previous_problems = 0; @pg_files = (); ## clear old problems |
985 | $use_previous_problems = 0; @pg_files = (); ## clear old problems |
| 986 | } elsif ($r->param('browse_library')) { |
986 | } elsif ($r->param('browse_library')) { |
| 987 | $browse_which = 'browse_library'; |
987 | $browse_which = 'browse_library'; |
| 988 | $self->{current_library_sets} = ""; |
988 | $self->{current_library_set} = ""; |
| 989 | $use_previous_problems = 0; @pg_files = (); ## clear old problems |
989 | $use_previous_problems = 0; @pg_files = (); ## clear old problems |
| 990 | } elsif ($r->param('browse_local')) { |
990 | } elsif ($r->param('browse_local')) { |
| 991 | $browse_which = 'browse_local'; |
991 | $browse_which = 'browse_local'; |
| 992 | $self->{current_library_sets} = ""; |
992 | #$self->{current_library_set} = ""; |
| 993 | $use_previous_problems = 0; @pg_files = (); ## clear old problems |
993 | $use_previous_problems = 0; @pg_files = (); ## clear old problems |
| 994 | } elsif ($r->param('browse_mysets')) { |
994 | } elsif ($r->param('browse_mysets')) { |
| 995 | $browse_which = 'browse_mysets'; |
995 | $browse_which = 'browse_mysets'; |
| 996 | $self->{current_library_sets} = ""; |
996 | $self->{current_library_set} = ""; |
| 997 | $use_previous_problems = 0; @pg_files = (); ## clear old problems |
997 | $use_previous_problems = 0; @pg_files = (); ## clear old problems |
| 998 | } elsif ($r->param('browse_setdefs')) { |
998 | } elsif ($r->param('browse_setdefs')) { |
| 999 | $browse_which = 'browse_setdefs'; |
999 | $browse_which = 'browse_setdefs'; |
| 1000 | $self->{current_library_sets} = ""; |
1000 | $self->{current_library_set} = ""; |
| 1001 | $use_previous_problems = 0; @pg_files = (); ## clear old problems |
1001 | $use_previous_problems = 0; @pg_files = (); ## clear old problems |
| 1002 | |
1002 | |
| 1003 | ##### Change the seed value |
1003 | ##### Change the seed value |
| 1004 | |
1004 | |
| 1005 | } elsif ($r->param('rerandomize')) { |
1005 | } elsif ($r->param('rerandomize')) { |
| … | |
… | |
| 1016 | |
1016 | |
| 1017 | ##### View problems selected from the local list |
1017 | ##### View problems selected from the local list |
| 1018 | |
1018 | |
| 1019 | } elsif ($r->param('view_local_set')) { |
1019 | } elsif ($r->param('view_local_set')) { |
| 1020 | |
1020 | |
| 1021 | my $set_to_display = $r->param('local_sets'); |
1021 | my $set_to_display = $self->{current_library_set}; |
|
|
1022 | debug("display local sets", $r->param('local_sets'), "or library sets", $set_to_display); |
| 1022 | if (not defined($set_to_display) or $set_to_display eq SELECT_LOCAL_STRING or $set_to_display eq "Found no directories containing problems") { |
1023 | if (not defined($set_to_display) or $set_to_display eq SELECT_LOCAL_STRING or $set_to_display eq "Found no directories containing problems") { |
| 1023 | $self->addbadmessage('You need to select a set to view.'); |
1024 | $self->addbadmessage('You need to select a set to view.'); |
| 1024 | } else { |
1025 | } else { |
| 1025 | $set_to_display = '.' if $set_to_display eq MY_PROBLEMS; |
1026 | $set_to_display = '.' if $set_to_display eq MY_PROBLEMS; |
| 1026 | $set_to_display = substr($browse_which,7) if $set_to_display eq MAIN_PROBLEMS; |
1027 | $set_to_display = substr($browse_which,7) if $set_to_display eq MAIN_PROBLEMS; |