From: Sam H. v. a. <we...@ma...> - 2005-12-18 22:42:35
|
Log Message: ----------- get rid of submiterror escape Modified Files: -------------- webwork2/conf/templates: test.template ur.template webwork2/lib/WeBWorK: ContentGenerator.pm Revision Data ------------- Index: ur.template =================================================================== RCS file: /webwork/cvs/system/webwork2/conf/templates/ur.template,v retrieving revision 1.46 retrieving revision 1.47 diff -Lconf/templates/ur.template -Lconf/templates/ur.template -u -r1.46 -r1.47 --- conf/templates/ur.template +++ conf/templates/ur.template @@ -108,11 +108,6 @@ </div> <!--#endif--> - <!--#if can="submiterror"--> - <div class="SubmitError"> - <!--#submiterror--> - </div> - <!--#endif--> <!--#if can="body"--> <div class="Body"> <!--#body--> Index: test.template =================================================================== RCS file: /webwork/cvs/system/webwork2/conf/templates/test.template,v retrieving revision 1.5 retrieving revision 1.6 diff -Lconf/templates/test.template -Lconf/templates/test.template -u -r1.5 -r1.6 --- conf/templates/test.template +++ conf/templates/test.template @@ -75,12 +75,6 @@ <!--#message--> </div> -<h1>submiterror</h1> -<p>this should go away... it is only used in three places (Grades, SendMail, ShowAnswers), and could be replaced with calls to addbadmessage.</p> -<div class="test_box"> -<!--#submiterror--> -</div> - <h1>body</h1> <div class="test_box"> <!--#body--> Index: ContentGenerator.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator.pm,v retrieving revision 1.157 retrieving revision 1.158 diff -Llib/WeBWorK/ContentGenerator.pm -Llib/WeBWorK/ContentGenerator.pm -u -r1.157 -r1.158 --- lib/WeBWorK/ContentGenerator.pm +++ lib/WeBWorK/ContentGenerator.pm @@ -867,29 +867,6 @@ return(Date::Format::time2str($formatstring, time())); } -=item submiterror() - -Defined in this package. - -Print any error messages resulting from the last form submission. - -This method is deprecated -- use message() instead - -The implementation in this package prints the value of the field -$self->{submitError}, if it is present. - -=cut - -sub submiterror { - my ($self) = @_; - - print "\n<!-- BEGIN " . __PACKAGE__ . "::submiterror -->\n"; - print $self->{submitError} if exists $self->{submitError}; - print "<!-- END " . __PACKAGE__ . "::submiterror -->\n"; - - return ""; -} - =item message() Defined in this package. @@ -1078,40 +1055,6 @@ return $self->r->authen->was_verified() ? $arg : !$arg; } -=item if_submiterror($arg) - -If the last form submission generated an error, $arg is returned. Otherwise, the -inverse of $arg is returned. - -The implementation in this package checks for the field $self->{submitError} to -determine if an error condition is present. - -If a subclass uses some other method to classify submission results, this method could be -redefined to handle that variance: - - sub if_submiterror { - my ($self, $arg) = @_; - - my $status = $self->{processReturnValue}; - if ($status != 0) { - return $arg; - } else { - return !$arg; - } - } - -=cut - -sub if_submiterror { - my ($self, $arg) = @_; - - if (exists $self->{submitError}) { - return $arg; - } else { - return !$arg; - } -} - =item if_message($arg) If the last form submission generated a message, $arg is returned. Otherwise, the |