Skip to content

Commit

Permalink
reverted HardCopyRenderedProblem back to original code.
Browse files Browse the repository at this point in the history
  • Loading branch information
pstaabp committed Jan 25, 2024
1 parent d37d776 commit 96d4aca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions lib/HardcopyRenderedProblem.pm
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ sub hardcopyRenderedProblem {
my $userID = $ws->{inputs_ref}{user};

# Create the parent directory for the temporary working directory.
my $temp_dir_parent_path = Mojo::File->new("$ce->{webworkDirs}{tmp}/$courseID/hardcopy/$userID");
my $temp_dir_parent_path = path("$ce->{webworkDirs}{tmp}/$courseID/hardcopy/$userID");
eval { $temp_dir_parent_path->make_path };
if ($@) {
push(@errors, "Couldn't create hardcopy directory $temp_dir_parent_path: $@");
Expand Down Expand Up @@ -127,19 +127,19 @@ sub generate_hardcopy_tex {

# Copy the common tex files into the working directory
my $ce = $ws->c->ce;
my $assetsTex_dir = Mojo::File->new($ce->{webworkDirs}{assetsTex});
my $assetsTex_dir = path($ce->{webworkDirs}{assetsTex});
for (qw{webwork2.sty webwork_logo.png}) {
eval { $assetsTex_dir->child($_)->copy_to($working_dir) };
push(@$errors, qq{Failed to copy "$ce->{webworkDirs}{assetsTex}/$_" into directory "$working_dir": $@})
if $@;
}
my $pgAssetsTex_dir = Mojo::File->new($ce->{pg}{directories}{assetsTex});
my $pgAssetsTex_dir = path($ce->{pg}{directories}{assetsTex});
for (qw{pg.sty PGML.tex CAPA.tex}) {
eval { $pgAssetsTex_dir->child($_)->copy_to($working_dir) };
push(@$errors, qq{Failed to copy "$ce->{pg}{directories}{assetsTex}/$_" into directory "$working_dir": $@})
if $@;
}
my $pgsty = Mojo::File->new("$ce->{pg}{directories}{assetsTex}/pg.sty");
my $pgsty = path("$ce->{pg}{directories}{assetsTex}/pg.sty");
eval { $pgsty->copy_to($working_dir) };
push(@$errors, qq{Failed to copy "$ce->{pg}{directories}{assetsTex}/pg.sty" into directory "$working_dir": $@})
if $@;
Expand All @@ -150,7 +150,7 @@ sub generate_hardcopy_tex {
my $data = eval { $src_file->slurp };
unless ($@) {
for my $resource (keys %$resource_list) {
my $file_path = Mojo::File->new($resource_list->{$resource});
my $file_path = path($resource_list->{$resource});
$data =~ s{$file_path}{$file_path->basename}ge;

eval { $file_path->copy_to($working_dir) };
Expand Down
2 changes: 1 addition & 1 deletion lib/WeBWorK/Utils/CourseManagement.pm
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ sub addCourse {
"Can't create the course '$courseID' because the courses directory '$rootParent' is not writeable.";
# try to create it
eval { Mojo::File->new($root)->make_path };
croak "Can't create the course '$courseID' becasue the root directory '$root' could not be created: $@." if $@;
croak "Can't create the course '$courseID' because the root directory '$root' could not be created: $@." if $@;
}

# deal with the rest of the directories
Expand Down

0 comments on commit 96d4aca

Please sign in to comment.