From 58a2000363bbfd5d63830e3ba511af57a644db63 Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Tue, 27 Jan 2026 19:55:50 -0600 Subject: [PATCH 1/2] Update some of the help. The instructor links help is updated to order the links in the help in the same order that they are in the site navigation. Also add help for the "Job Manager" which was missing. Also fix the links the PG problem editor help. The links above the CodeMirror editor window in the PG problem editor have changed in two ways that the links in the help were not updated to match. First, the "Problem Techniques" button was replaced with the "Sample Problems" button. So that Wiki link is now also removed from the help, and it is now the local server sample problems link. The PGML lab was updated so that it does not need the PGML-lab.pg file in the templates directory of the course. It now directly uses that problem from the assets/pg directory. The link in the help file now does the same thing. I removed the `reference-link` class from the links above the CodeMirror window because that class does not do anything. I also removed the old webwork.maa.org links in the comments because those don't need to be there even if they are updated to the new locations. --- htdocs/js/PGProblemEditor/pgproblemeditor.js | 72 ++++++++++--------- .../Instructor/PGProblemEditor.html.ep | 19 +++-- .../PGProblemEditor/file_chooser.html.ep | 1 + .../InstructorPGProblemEditor.html.ep | 30 +++----- templates/HelpFiles/instructor_links.html.ep | 16 +++-- 5 files changed, 64 insertions(+), 74 deletions(-) diff --git a/htdocs/js/PGProblemEditor/pgproblemeditor.js b/htdocs/js/PGProblemEditor/pgproblemeditor.js index 1d600746d0..55645e1513 100644 --- a/htdocs/js/PGProblemEditor/pgproblemeditor.js +++ b/htdocs/js/PGProblemEditor/pgproblemeditor.js @@ -1,5 +1,43 @@ (() => { + const renderURL = `${webworkConfig?.webwork_url ?? '/webwork2'}/render_rpc`; + + for (const pgmlLabButton of document.querySelectorAll('.pgml-lab')) { + pgmlLabButton.addEventListener('click', (e) => { + e.preventDefault(); + const form = document.createElement('form'); + form.style.display = 'none'; + form.target = 'PGML'; + form.action = renderURL; + form.method = 'post'; + + const inputs = [ + ['courseID', document.getElementsByName('courseID')[0]?.value], + ['displayMode', document.getElementById('action_view_displayMode_id')?.value ?? 'MathJax'], + ['fileName', 'PGMLLab/PGML-lab.pg'], + ['uriEncodedProblemSource', pgmlLabButton.dataset.source] + ]; + + const user = document.getElementsByName('user')[0]; + if (user) inputs.push(['user', user.value]); + const sessionKey = document.getElementsByName('key')[0]; + if (sessionKey) inputs.push(['key', sessionKey.value]); + + for (const [name, value] of inputs) { + const input = document.createElement('input'); + input.name = name; + input.value = value; + input.type = 'hidden'; + form.append(input); + } + + document.body.append(form); + form.submit(); + form.remove(); + }); + } + const fileChooserForm = document.forms['pg-editor-file-chooser']; + if (fileChooserForm) { const newProblemRadio = document.getElementById('new_problem'); @@ -342,7 +380,6 @@ } }); - const renderURL = `${webworkConfig?.webwork_url ?? '/webwork2'}/render_rpc`; const fileType = document.getElementsByName('file_type')[0]?.value; // This is either the div containing the CodeMirror editor or the problemContents textarea in the case that @@ -650,37 +687,4 @@ rendering = false; } }; - - const pgmlLabButton = document.getElementById('pgml-lab'); - pgmlLabButton?.addEventListener('click', () => { - const form = document.createElement('form'); - form.style.display = 'none'; - form.target = 'PGML'; - form.action = renderURL; - form.method = 'post'; - - const inputs = [ - ['courseID', document.getElementsByName('courseID')[0]?.value], - ['displayMode', document.getElementById('action_view_displayMode_id')?.value ?? 'MathJax'], - ['fileName', 'PGMLLab/PGML-lab.pg'], - ['uriEncodedProblemSource', pgmlLabButton.dataset.source] - ]; - - const user = document.getElementsByName('user')[0]; - if (user) inputs.push(['user', user.value]); - const sessionKey = document.getElementsByName('key')[0]; - if (sessionKey) inputs.push(['key', sessionKey.value]); - - for (const [name, value] of inputs) { - const input = document.createElement('input'); - input.name = name; - input.value = value; - input.type = 'hidden'; - form.append(input); - } - - document.body.append(form); - form.submit(); - form.remove(); - }); })(); diff --git a/templates/ContentGenerator/Instructor/PGProblemEditor.html.ep b/templates/ContentGenerator/Instructor/PGProblemEditor.html.ep index e666e53937..b813220b8a 100644 --- a/templates/ContentGenerator/Instructor/PGProblemEditor.html.ep +++ b/templates/ContentGenerator/Instructor/PGProblemEditor.html.ep @@ -103,20 +103,19 @@
<%= link_to maketext('Sample Problems') => url_for('sample_problem_index'), target => 'techniques_window', - title => maketext('POD for macros and sample problem code and snippets'), - class => 'reference-link btn btn-sm btn-info', + title => maketext('Sample problem code with documentation.'), + class => 'btn btn-sm btn-info', data => { bs_toggle => 'tooltip', bs_placement => 'top' } =%> - % # http://webwork.maa.org/wiki/Category:MathObjects <%= link_to maketext('Math Objects') => $ce->{webworkURLs}{MathObjectsHelpURL}, target => 'math_objects', title => maketext('Wiki summary page for MathObjects'), - class => 'reference-link btn btn-sm btn-info', + class => 'btn btn-sm btn-info', data => { bs_toggle => 'tooltip', bs_placement => 'top' } =%> % # PG POD served locally <%= link_to maketext('POD') => url_for('pod_index'), target => 'pod_docs', title => maketext('Documentation from source code for PG modules and macro files.'), - class => 'reference-link btn btn-sm btn-info', + class => 'btn btn-sm btn-info', data => { bs_toggle => 'tooltip', bs_placement => 'top' } =%> % # PGML lab problem rendered as an unattached problem in a new window. % my $pgml_lab_source = readFile("$ce->{webworkDirs}{assets}/pg/PGMLLab/PGML-lab.pg"); @@ -125,15 +124,13 @@ 'PG markdown syntax used to format WeBWorK questions. ' . 'This interactive lab can help you to learn the techniques.' ), - id => 'pgml-lab', - class => 'reference-link btn btn-sm btn-info', - data => { source => url_escape($pgml_lab_source), bs_toggle => 'tooltip', bs_placement => 'top' }, + class => 'pgml-lab btn btn-sm btn-info', + data => { source => url_escape($pgml_lab_source), bs_toggle => 'tooltip', bs_placement => 'top' }, 'PGML' =%> - % # http://webwork.maa.org/wiki/Category:Authors <%= link_to maketext('Author Info') => $ce->{webworkURLs}{AuthorHelpURL}, target => 'author_info', title => maketext('Top level of author information on the wiki.'), - class => 'reference-link btn btn-sm btn-info', + class => 'btn btn-sm btn-info', data => { bs_toggle => 'tooltip', bs_placement => 'top' } =%> % # Only show the report bugs in problem button if editing an OPL or Contrib problem. % if ($ce->{webworkURLs}{OPLBugReporter} @@ -152,7 +149,7 @@ . 'The very first time you do this you will need to register with an email address so that ' . 'information on the bug fix can be reported back to you.' ), - class => 'reference-link btn btn-sm btn-info', + class => 'btn btn-sm btn-info', data => { bs_toggle => 'tooltip', bs_placement => 'top' } =%> % }
diff --git a/templates/ContentGenerator/Instructor/PGProblemEditor/file_chooser.html.ep b/templates/ContentGenerator/Instructor/PGProblemEditor/file_chooser.html.ep index 10e361a65f..1ba942eb24 100644 --- a/templates/ContentGenerator/Instructor/PGProblemEditor/file_chooser.html.ep +++ b/templates/ContentGenerator/Instructor/PGProblemEditor/file_chooser.html.ep @@ -2,6 +2,7 @@ % <%= form_for current_route, method => 'POST', name => 'pg-editor-file-chooser', class => 'needs-validation', novalidate => undef, begin =%> + <%= hidden_field courseID => $c->{courseID} =%>
diff --git a/templates/HelpFiles/InstructorPGProblemEditor.html.ep b/templates/HelpFiles/InstructorPGProblemEditor.html.ep index 66a4c7aa0d..f66033b789 100644 --- a/templates/HelpFiles/InstructorPGProblemEditor.html.ep +++ b/templates/HelpFiles/InstructorPGProblemEditor.html.ep @@ -11,11 +11,10 @@
- - <%= maketext('Problem Techniques') =%> - + <%= link_to maketext('Sample Problems') => url_for('sample_problem_index'), + target => 'techniques_window' =%>
-
<%= maketext('This links to a list of problem authoring techniques.') %>
+
<%= maketext('Sample problem code with documentation.') %>
<%= maketext('Math Objects') %> @@ -28,26 +27,13 @@ . 'macro files themselves.') =%>
- % if (-e "$ce->{courseDirs}{templates}/PGMLLab/PGML-lab.pg") { - <%= link_to maketext('PGML') => $c->systemLink( - url_for('problem_detail', setID => 'Undefined_Set', problemID => 1), - params => { - displayMode => $ce->{pg}{options}{displayMode}, - problemSeed => 1234, - editMode => 'temporaryFile', - sourceFilePath => 'PGMLLab/PGML-lab.pg' - } - ), - target => 'PGML' =%> - % } else { - <%= maketext('PGML') %> - % } + <%= link_to PGML => '#', class => 'pgml-lab', target => 'PGML', + data => { source => url_escape(readFile("$ce->{webworkDirs}{assets}/pg/PGMLLab/PGML-lab.pg")) } =%>
- <%= maketext('This links to a WeBWorK "problem" which allows you to try out fragments of PGML code. ' - . 'This link will not be available if the file [_1] is not located in the templates directory of ' - . 'the course.', - 'PGMLLab/PGML-lab.pg') =%> + <%= maketext( + 'This links to a WeBWorK "problem" which allows you to try out fragments of PGML code.' + ) =%>
diff --git a/templates/HelpFiles/instructor_links.html.ep b/templates/HelpFiles/instructor_links.html.ep index 1a4595cc49..e182075cab 100644 --- a/templates/HelpFiles/instructor_links.html.ep +++ b/templates/HelpFiles/instructor_links.html.ep @@ -24,14 +24,14 @@ <%= maketext('Edit class roster data. Add students, edit student data, drop students from class, import ' . 'students from a classlist, and give user professor privileges. Access to individual assignments.') =%> -
<%= maketext('Assigner Tool') %>
-
<%= maketext('Assign and unassign selected exercise sets to selected users.') %>
<%= maketext('Sets Manager') %>
<%= maketext('Edit sets for the entire class. Change set due dates, create new sets from a set ' . 'definition file, create new sets, make sets visible/invisible, score assignments. Assign ' . 'sets to the class.') =%>
+
<%= maketext('Assigner Tool') %>
+
<%= maketext('Assign and unassign selected exercise sets to selected users.') %>
<%= maketext('Problem Editor') %>
<%= maketext('Write a new PG problem file or edit an existing one.') %>
<%= maketext('Library Browser') %>
@@ -45,6 +45,11 @@ <%= maketext('Score one or more sets. This can also be done from the "Sets Manager" or from the ' . '"Instructor Tools", but the "Scoring Tools" page allows control over parameters.') =%> +
<%= maketext('LTI Grade Update') %>
+
+ <%= maketext('Manually initiate an LTI grade passback for selected sets or users. This link is only visible ' + . 'if LTI grade passback is enabled for the course.') =%> +
<%= maketext('Achievements Manager') %>
<%= maketext('Edit achivements for the course. This link is only present if achievements ' @@ -52,16 +57,13 @@
<%= maketext('Email') %>
<%= maketext('Send email to students.') %>
+
<%= maketext('Job Manager') %>
+
<%= maketext('View and manage jobs in the job queue.') %>
<%= maketext('File Manager') %>
<%= maketext('Upload, download and delete text files, including scoring spread sheets, set definition files, ' . 'class list spread sheets, and "PG" problems.') =%>
-
<%= maketext('LTI Grade Update') %>
-
- <%= maketext('Manually initiate an LTI grade passback for selected sets or users. This link is only visible ' - . 'if LTI grade passback is enabled for the course.') =%> -
<%= maketext('Course Configuration') %>
<%= maketext('Allows configuration of certain parameters, such as permission levels, default display mode for ' From 18857e0b116fcca1cb924244f72f97159a6b6cad Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Tue, 3 Feb 2026 14:43:44 -0600 Subject: [PATCH 2/2] Update all `webwork.maa.org` links in the help to their new locations. --- lib/WeBWorK/ConfigValues.pm | 4 ++-- templates/HelpFiles/InstructorFileManager.html.ep | 4 ++-- templates/HelpFiles/InstructorPGProblemEditor.html.ep | 4 ++-- templates/HelpFiles/InstructorUserList.html.ep | 2 +- templates/HelpFiles/instructor_links.html.ep | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/WeBWorK/ConfigValues.pm b/lib/WeBWorK/ConfigValues.pm index 209cde6df8..175cf8c14c 100644 --- a/lib/WeBWorK/ConfigValues.pm +++ b/lib/WeBWorK/ConfigValues.pm @@ -545,8 +545,8 @@ sub getConfigValues ($ce) { var => 'permissionLevels{report_bugs}', doc => x('Can report bugs'), doc2 => x( - 'Users with at least this permission level get a link in the left panel for reporting bugs to the ' - . 'bug tracking system at bugs.webwork.maa.org.' + 'Users with at least this permission level get a link in the left panel for reporting issues at ' + . 'github.com/openwebwork/webwork2.' ), type => 'permission' }, diff --git a/templates/HelpFiles/InstructorFileManager.html.ep b/templates/HelpFiles/InstructorFileManager.html.ep index d6f0ddfe0b..95daeebb66 100644 --- a/templates/HelpFiles/InstructorFileManager.html.ep +++ b/templates/HelpFiles/InstructorFileManager.html.ep @@ -34,7 +34,7 @@ . 'and are created when exporting a problem set from the "Sets Manager". Each set definition file ' . 'contains a list of problems used and the dates and times. These definitions can be imported into the ' . 'current course.', - 'href="https://webwork.maa.org/wiki/Set_Definition_Files" target="Webworkdocs"') =%> + 'href="https://wiki.openwebwork.org/wiki/Set_Definition_Files" target="Webworkdocs"') =%>
<%= maketext('Class list (".lst") files') %>
@@ -44,7 +44,7 @@ . 'ClassList files can be prepared using a spreadsheet and then saved as [_3] (comma separated values) ' . 'text files. However, to access as a classlist file, the file suffix needs to be changed to [_4], ' . 'which can be done with the "Rename" button.', - 'href="http://webwork.maa.org/wiki/Classlist_Files#Format_of_classlist_files" target="Webworkdocs"', + 'href="https://wiki.openwebwork.org/wiki/Classlist_Files#Format_of_classlist_files" target="Webworkdocs"', 'demoCourse.lst', '.csv', '.lst') =%>
<%= maketext('Scoring (".csv") files') %>
diff --git a/templates/HelpFiles/InstructorPGProblemEditor.html.ep b/templates/HelpFiles/InstructorPGProblemEditor.html.ep index f66033b789..87f966708e 100644 --- a/templates/HelpFiles/InstructorPGProblemEditor.html.ep +++ b/templates/HelpFiles/InstructorPGProblemEditor.html.ep @@ -16,7 +16,7 @@
<%= maketext('Sample problem code with documentation.') %>
- + <%= maketext('Math Objects') %>
@@ -36,7 +36,7 @@ ) =%>
- + <%= maketext('Author Info') %>
diff --git a/templates/HelpFiles/InstructorUserList.html.ep b/templates/HelpFiles/InstructorUserList.html.ep index 57ed8676a7..2a057d0437 100644 --- a/templates/HelpFiles/InstructorUserList.html.ep +++ b/templates/HelpFiles/InstructorUserList.html.ep @@ -62,7 +62,7 @@
<%== maketext('This is most easily done by importing a class list. The class list can be uploaded from your ' . 'workstation to the server using the File Manager page. The class list must be a file ending in .lst and ' - . 'must have a specific ' + . 'must have a specific ' . 'format. Once the file has been uploaded to the server the file will appear in the import action ' . 'pop-up list (5th action). demoCourse.lst is available for most courses and adds the "practice users" ' . 'which activate guest logins to the class list.') =%> diff --git a/templates/HelpFiles/instructor_links.html.ep b/templates/HelpFiles/instructor_links.html.ep index e182075cab..f1fe87bd94 100644 --- a/templates/HelpFiles/instructor_links.html.ep +++ b/templates/HelpFiles/instructor_links.html.ep @@ -6,8 +6,8 @@
<%== maketext('The main page for WeBWorK documentation is the webwork wiki while specific help for ' . q{instructors setting up a course are in the instructors' section.}, - 'href="http://webwork.maa.org/wiki" target="ww_wiki"', - 'href="http://webwork.maa.org/wiki/Instructors" target="ww_wiki"') =%> + 'href="https://wiki.openwebwork.org/wiki" target="ww_wiki"', + 'href="https://wiki.openwebwork.org/wiki/Instructors" target="ww_wiki"') =%>