diff --git a/lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm b/lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm index 6c55ec065f..1e9e761257 100644 --- a/lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm +++ b/lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm @@ -232,7 +232,7 @@ sub initialize ($c) { $c->stash->{hardcopyLabels} = []; # Tell the templates if we are working on a PG file - $c->{is_pg} = ($c->{file_type} eq 'course_info') ? 0 : 1; + $c->{is_pg} = $c->{file_type} && $c->{file_type} eq 'course_info' ? 0 : 1; # Check permissions return @@ -336,11 +336,12 @@ sub path ($c, $args) { # page. The bread crumb path leads back to the problem being edited, not to the Instructor tool. return $c->pathMacro( $args, - 'WeBWorK' => $c->url_for('root'), - $c->stash('courseID') => $c->url_for('set_list'), - ($c->stash('setID') // '') => $c->url_for('problem_list'), - $c->{prettyProblemNumber} => $c->url_for('problem_detail', problemID => $c->stash('problemID') || ''), - $c->maketext('Editor') => '' + 'WeBWorK' => $c->url_for('root'), + $c->stash('courseID') => $c->url_for('set_list'), + ($c->stash('setID') // '') => $c->url_for('problem_list'), + ($c->{prettyProblemNumber} // '') => + $c->url_for('problem_detail', problemID => $c->stash('problemID') || ''), + $c->maketext('Editor') => '' ); } @@ -348,6 +349,8 @@ sub page_title ($c) { my $setID = $c->stash('setID'); my $problemID = $c->stash('problemID'); + return 'Editor' unless $c->{file_type}; + return $c->maketext('Set Header for set [_1]', $setID) if $c->{file_type} eq 'set_header'; return $c->maketext('Hardcopy Header for set [_1]', $setID) if $c->{file_type} eq 'hardcopy_header'; return $c->maketext('Course Information for course [_1]', $c->stash('courseID')) diff --git a/templates/ContentGenerator/Instructor/PGProblemEditor.html.ep b/templates/ContentGenerator/Instructor/PGProblemEditor.html.ep index 6392b7cc30..912d43fcac 100644 --- a/templates/ContentGenerator/Instructor/PGProblemEditor.html.ep +++ b/templates/ContentGenerator/Instructor/PGProblemEditor.html.ep @@ -2,7 +2,7 @@ % use WeBWorK::HTML::CodeMirrorEditor % qw(generate_codemirror_html generate_codemirror_controls_html output_codemirror_static_files); % -% my $codemirrorMode = $c->{file_type} eq 'course_info' ? 'htmlmixed' : 'PG'; +% my $codemirrorMode = $c->{file_type} && $c->{file_type} eq 'course_info' ? 'htmlmixed' : 'PG'; % content_for js => begin <%= output_codemirror_static_files($c, $codemirrorMode) =%> <%= javascript getAssetURL($ce, 'js/ActionTabs/actiontabs.js'), defer => undef =%>