forked from openwebwork/webwork2
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change the "Tidy Code" tab of the PGproblemeditor to "Clean Code"
This introduces a second option to cleaning code which is convertToPGML, which changes the code in text blocks in the code to use PGML features.
- Loading branch information
Showing
7 changed files
with
67 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
templates/ContentGenerator/Instructor/PGProblemEditor/clean_code_form.html.ep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<div> | ||
<div class="form-check"> | ||
<%= radio_button 'action.clean_code' => 'tidyPGCode', | ||
id => 'action_clean_code_perltidy', class => 'form-check-input', checked => undef =%> | ||
<%= label_for 'action_clean_code_perltidy', class => 'form-check-label', begin =%> | ||
<%== maketext('Reformat the code using perltidy.') =%> | ||
<% end =%> | ||
<a class="help-popup" data-bs-content="<%== maketext('Perltidy is a reformatting ' | ||
. 'function that attempts to format code in a standard way. It does not change ' | ||
. 'the functionality of the code and in general is desired to have a common problem layout.') =%>" | ||
data-bs-placement="top" data-bs-toggle="popover" role="button"> | ||
<i aria-hidden="true" class="icon fas fa-question-circle" data-alt="Help Icon"></i> | ||
<span class="sr-only-glyphicon">Help Icon</span> | ||
</a> | ||
</div> | ||
<div class="form-check"> | ||
<%= radio_button 'action.clean_code' => 'convertCodeToPGML', | ||
id => 'action_clean_code_convert_PGML', class => 'form-check-input'=%> | ||
<%= label_for 'action_clean_code_convert_PGML', class => 'form-check-label', begin =%> | ||
<%== maketext('Convert the code to PGML') =%> | ||
<% end =%> | ||
<a class="help-popup" data-bs-content="<%== maketext('This option converts the text blocks ' | ||
. 'in the problem code to PGML and updates the loadMacros to include PGML and drop others. ' | ||
. 'This can be used as a first pass of the conversion, however the author will still need ' | ||
. 'to ensure the problem functions. One area of attention should be the answer blanks, ' | ||
. 'which are not converted with the proper variable.') =%>" | ||
data-bs-placement="top" data-bs-toggle="popover" role="button"> | ||
<i aria-hidden="true" class="icon fas fa-question-circle" data-alt="Help Icon"></i> | ||
<span class="sr-only-glyphicon">Help Icon</span> | ||
</a> | ||
</div> | ||
</div> |
5 changes: 0 additions & 5 deletions
5
templates/ContentGenerator/Instructor/PGProblemEditor/pgtidy_form.html.ep
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters