From: Gavin L. v. a. <we...@ma...> - 2008-07-01 13:30:29
|
Log Message: ----------- GatewayQuiz: improve handling of unlikely circumstances. Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator: GatewayQuiz.pm Revision Data ------------- Index: GatewayQuiz.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/GatewayQuiz.pm,v retrieving revision 1.53 retrieving revision 1.54 diff -Llib/WeBWorK/ContentGenerator/GatewayQuiz.pm -Llib/WeBWorK/ContentGenerator/GatewayQuiz.pm -u -r1.53 -r1.54 --- lib/WeBWorK/ContentGenerator/GatewayQuiz.pm +++ lib/WeBWorK/ContentGenerator/GatewayQuiz.pm @@ -1018,8 +1018,11 @@ #################################### # bail without doing anything if the set isn't yet open for this user - return unless $self->{isOpen} || - $authz->hasPermissions($userName,"view_unopened_sets"); + if ( ! ( $self->{isOpen} || + $authz->hasPermissions($userName,"view_unopened_sets") ) ) { + $self->{invalidSet} = "This set is not yet open."; + return; + } # what does the user want to do? my %want = @@ -1283,7 +1286,7 @@ # if $self->{invalidSet} is set, then we have an error and should # just bail with the appropriate error message - if ($self->{invalidSet}) { + if ($self->{invalidSet} || $self->{invalidProblem}) { # delete any proctor keys that are floating around if ( $self->{'assignment_type'} eq 'proctored_gateway' ) { my $proctorID = $r->param('proctor_user'); |