[system] / branches / rel-2-2-dev / webwork2 / lib / WeBWorK / ContentGenerator / Instructor / PGProblemEditor.pm Repository:
ViewVC logotype

Diff of /branches/rel-2-2-dev/webwork2/lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 2080 Revision 2081
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/PGProblemEditor.pm,v 1.29 2004/05/06 21:53:41 jj Exp $ 4# $CVSHeader: webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm,v 1.32 2004/05/08 19:35:21 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.
25=cut 25=cut
26 26
27use strict; 27use strict;
28use warnings; 28use warnings;
29use CGI qw(); 29use CGI qw();
30use WeBWorK::Utils qw(readFile); 30use WeBWorK::Utils qw(readFile surePathToFile);
31use Apache::Constants qw(:common REDIRECT); 31use Apache::Constants qw(:common REDIRECT);
32use HTML::Entities; 32use HTML::Entities;
33use WeBWorK::Utils::Tasks qw(fake_set fake_problem); 33use WeBWorK::Utils::Tasks qw(fake_set fake_problem);
34 34
35########################################################### 35###########################################################
432 432
433 # FIXME set a local state rather continue to call on the submit button. 433 # FIXME set a local state rather continue to call on the submit button.
434 if (defined $submit_button and $submit_button eq 'Save as' and defined $currentSourceFilePath and -e $currentSourceFilePath) { 434 if (defined $submit_button and $submit_button eq 'Save as' and defined $currentSourceFilePath and -e $currentSourceFilePath) {
435 warn "File $currentSourceFilePath exists. File not saved."; 435 warn "File $currentSourceFilePath exists. File not saved.";
436 } else { 436 } else {
437 # make sure any missing directories are created
438 $currentSourceFilePath = WeBWorK::Utils::surePathToFile($ce->{courseDirs}->{templates},$currentSourceFilePath);
437 eval { 439 eval {
438 local *OUTPUTFILE; 440 local *OUTPUTFILE;
439 open OUTPUTFILE, ">", $currentSourceFilePath 441 open OUTPUTFILE, ">", $currentSourceFilePath
440 or die "Failed to open $currentSourceFilePath"; 442 or die "Failed to open $currentSourceFilePath";
441 print OUTPUTFILE $problemContents; 443 print OUTPUTFILE $problemContents;

Legend:
Removed from v.2080  
changed lines
  Added in v.2081

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9