From: Mike G. v. a. <we...@ma...> - 2005-11-01 01:52:53
|
Log Message: ----------- Added rudimentary link to report problems directly. It does this by constructing a link to the bugzilla CGI that includes information on the file name of the problem and the library in which the problem is stored. This is probably still pretty fragile. A separate module could be constructed to more intelligently report bugs. -- Mike Modified Files: -------------- webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor: PGProblemEditor.pm Revision Data ------------- Index: PGProblemEditor.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm,v retrieving revision 1.61 retrieving revision 1.62 diff -Llib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm -Llib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm -u -r1.61 -r1.62 --- lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm +++ lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm @@ -406,6 +406,8 @@ unless $authz->hasPermissions($user, "modify_student_data"); + + # Gathering info my $editFilePath = $self->{editFilePath}; # path to the permanent file to be edited my $tempFilePath = $self->{tempFilePath}; # path to the file currently being worked with (might be a .tmp file) @@ -417,6 +419,17 @@ # empty string. $problemNumber = defined($problemNumber) ? $problemNumber : ''; + ######################################################################### + # Construct url for reporting bugs: + ######################################################################### + + $editFilePath =~ m|([^/]*)Library|; #find the path to the file + my $libraryName = $1; # find the library, if any exists in the path name (first library is picked) + $libraryName ='rochester' unless defined($libraryName) and $libraryName =~/\S/; # default library + + my $BUGZILLA = "http://bugs.webwork.rochester.edu/enter_bug.cgi?product=Problem%20libraries&component=$libraryName&bug_file_loc=$editFilePath"; + #FIXME # The construction of this URL is somewhat fragile. A separate module could be devoted to intelligent reporting of bugs. + ######################################################################### # Find the text for the problem, either in the tmp file, if it exists # or in the original file in the template directory @@ -479,22 +492,25 @@ $self->hidden_authen_fields, $force_field, CGI::hidden(-name=>'file_type',-default=>$self->{file_type}), - CGI::div( + CGI::div(" | ", CGI::a({-href=>'http://webwork.math.rochester.edu/docs/docs/pglanguage/manpages/',-target=>"manpage_window"}, ' Manpages ', - ), + )," | ", CGI::a({-href=>'http://devel.webwork.rochester.edu/twiki/bin/view/Webwork/PGmacrosByFile',-target=>"manpage_window"}, ' macro list ', - ), + )," | ", CGI::a({-href=>'http://devel.webwork.rochester.edu/doc/cvs/pg_HEAD/',-target=>"manpage_window"}, ' pod docs ', - ), + )," | ", + CGI::a({-href=>$BUGZILLA,-target=>"bugs_window"}, + ' report problem bugs ', + )," | ", ), CGI::p( CGI::textarea( -name => 'problemContents', -default => $problemContents, -rows => $rows, -columns => $columns, -override => 1, - ), + )," | ", ); |