Skip to content

Commit 84ef097

Browse files
committed
Improved work on the PG critic interface to the PGEditor.
1 parent ecef9de commit 84ef097

File tree

1 file changed

+49
-26
lines changed

1 file changed

+49
-26
lines changed

templates/ContentGenerator/Instructor/PGProblemEditor/pg_critic.html.ep

Lines changed: 49 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,40 @@
2525
<tr><th>Keywords</th><td> <%== showIcon($results->{metadata}{KEYWORDS}) %> </td></tr>
2626
</table>
2727

28-
<h3>You done good with the following</h3>
29-
28+
% my $pos = $results->{positive};
29+
% if ($pos->{PGML} || $pos->{solution} || $pos->{hint}) {
30+
<h3>Good aspects of this problems are the following</h3>
31+
% }
3032
<table class="table table-bordered">
3133
<tbody>
32-
% if ($results->{good}{PGML}) {
34+
% if ($pos->{PGML}) {
3335
<tr><th>PGML</th><td>This problem uses PGML, the current preferred way to write problem (text), solution and hint
3436
blocks.</td></tr>
35-
%}
36-
% if ($results->{good}{solution}) {
37+
% }
38+
% if ($pos->{solution}) {
3739
<tr><th>Solutions</th><td>This problem has a solution block. Every problem should have solutions that the
3840
student can view after the answer data. </td></tr>
39-
%}
40-
% if ($results->{good}{hint}) {
41+
% }
42+
% if ($pos->{hint}) {
4143
<tr><th>Hints</th><td>This problem has a hint. This can be helpful for students after attempting the problem
4244
a few times (this can be set by the instructor).
43-
%}
45+
% }
46+
% # list of the positive contexts:
47+
% my @good_contexts = grep { $pos->{contexts}{$_} } keys %{$pos->{parsers}};
48+
% if (@good_contexts) {
49+
<tr><th>Modern Contexts</th><td>This problem uses the following modern contexts:
50+
<%= join(', ', @good_contexts) %> </td>
51+
% }
52+
% my @good_parsers = grep { $pos->{parsers}->{$_} } keys %{$pos->{parsers}};
53+
% if (@good_parsers) {
54+
<tr><th>Modern Parsers</th><td>This problem uses features of the following modern parsers:
55+
<%= join(', ', @good_parsers) %> </td>
56+
% }
57+
% my @good_macros = grep { $pos->{macros}->{$_} } keys %{$pos->{macros}};
58+
% if (@good_macros) {
59+
<tr><th>Modern Macros</th><td>This problem uses functionality from the following modern macros:
60+
<%= join(', ', @good_macros) %> </td>
61+
% }
4462
</tbody>
4563
</table>
4664

@@ -55,59 +73,64 @@
5573
% }
5674

5775
% my $has_bad_features = 0;
58-
% $has_bad_features += $results->{bad}{$_} for (keys %{$results->{bad}});
76+
% $has_bad_features += $results->{negative}{$_} for (keys %{$results->{negative}});
5977

60-
% if ($has_bad_features || !$results->{good}{solution}) {
78+
% if ($has_bad_features || !$pos->{solution}) {
6179
<h3>You can improve on the following:</h3>
6280
<p> There are features in this problem that contain old or deprecated features. The following
6381
list gives feedback of how the problem can be improved. </p>
6482
%}
6583

6684
<ul>
67-
% if ($results->{bad}{BEGIN_TEXT}) {
85+
% if ($results->{negative}{BEGIN_TEXT}) {
6886
<li>This problem contains older formatting blocks like BEGIN_TEXT. Consider use PGML.
6987
In the <em>Format Code</em> section of the PG Editor, the "Convert to PGML" should be used
7088
as a start to get the problem switched.
7189
</li>
7290
%}
73-
% if ($results->{bad}{beginproblem}) {
91+
% if ($results->{negative}{beginproblem}) {
7492
<li>This problem contains the line <tt>TEXT(beginproblem())</tt>. This is no longer necessary and should be removed. </li>
7593
%}
76-
% if ($results->{bad}{context_texstrings}) {
94+
% if ($results->{negative}{context_texstrings}) {
7795
<li>This problem contains the line <tt>Context()->texStrings;</tt>. This is no longer necessary and should be removed. </li>
7896
%}
79-
% if ($results->{bad}{oldtable}) {
97+
% if ($results->{negative}{oldtable}) {
8098
<li>This problem contains the deprecated <tt>begintable</tt> command. This is not assessible and often cannot be
8199
converted to hardcopy. This table should be written using <tt>nicetables</tt> or a PGML table. </li>
82100
%}
83-
% if ($results->{bad}{showPartialCorrect}) {
101+
% if ($results->{negative}{showPartialCorrect}) {
84102
<li>This problem contains the line <tt>$showPartialCorrectAnswers = 1</tt>. This is enabled by default and needed only
85103
if set to 0.</li>
86104
% }
87-
% if (!$results->{good}{solution}) {
105+
% if (!$pos->{solution}) {
88106
<li>This problem does not have a solution. Consider adding one.</li>
89107
% }
90-
% if ($results->{bad}{fun_cmp} || $results->{bad}{str_cmp} || $results->{bad}{num_cmp}) {
108+
% if ($results->{negative}{fun_cmp} || $results->{negative}{str_cmp} || $results->{negative}{num_cmp}) {
91109
<li>This problem contains the functioins <tt>num_cmp</tt>, <tt>str_cmp</tt> or <tt>fun_cmp</tt>.
92110
These are old ways of checking answers. These should be converted to MathObjects.
93111
% }
94-
% if ($results->{bad}{multiple_loadmacros}) {
112+
% if ($results->{negative}{multiple_loadmacros}) {
95113
<li>This problem contains two <tt>loadMacros</tt> function call. Combine the function
96114
calls and make sure that all macros are needed for your problem. </li>
97115
% }
98-
% if ($results->{bad}{old_multiple_choice}) {
116+
% if ($results->{negative}{macros}{PGchoicemacros}) {
99117
<li>This problem contains old versions of multiple choice. The sample problems
100-
<a href="https://openwebwork.github.io/pg-docs/sample-problems/Misc/MultipleChoiceCheckbox.html">
101-
Multiple Choice with Checkbox</a>, <a href="https://openwebwork.github.io/pg-docs/sample-problems/Misc/MultipleChoicePopup.html">
102-
Multiple Choice with Popup</a> and <a href="https://openwebwork.github.io/pg-docs/sample-problems/Misc/MultipleChoiceRadio.html">
118+
<a target="_blank" href="https://openwebwork.github.io/pg-docs/sample-problems/Misc/MultipleChoiceCheckbox.html">
119+
Multiple Choice with Checkbox</a>, <a target="_blank" href="https://openwebwork.github.io/pg-docs/sample-problems/Misc/MultipleChoicePopup.html">
120+
Multiple Choice with Popup</a> and <a target="_blank" href="https://openwebwork.github.io/pg-docs/sample-problems/Misc/MultipleChoiceRadio.html">
103121
Multiple Choice with Radio Buttons</a> should be examined as well the macros:
104-
<a href="https://openwebwork.github.io/pg-docs/pod/pg/macros/parsers/parserPopUp.html">parserPopUp.pl</a>,
105-
<a href="https://openwebwork.github.io/pg-docs/pod/pg/macros/parsers/parserCheckboxList.html">parserCheckboxList.pl</a> and
106-
<a href="https://openwebwork.github.io/pg-docs/pod/pg/macros/parsers/parserRadioButtons.html">parserRadioButtons.pl</a>.
122+
<a target="_blank" href="https://openwebwork.github.io/pg-docs/pod/pg/macros/parsers/parserPopUp.html">parserPopUp.pl</a>,
123+
<a target="_blank" href="https://openwebwork.github.io/pg-docs/pod/pg/macros/parsers/parserCheckboxList.html">parserCheckboxList.pl</a> and
124+
<a target="_blank" href="https://openwebwork.github.io/pg-docs/pod/pg/macros/parsers/parserRadioButtons.html">parserRadioButtons.pl</a>.
107125

108126
</li>
109127
% }
110-
% if ($results->{bad}{lines_below_enddocument}) {
128+
% if ($results->{negative}{macros}{PGgraphmacros}) {
129+
<li>This problem uses <tt>PGgraphmacros</tt> a old plotting library. Consider using
130+
<a target="_blank" href="https://openwebwork.github.io/pg-docs/pod/pg/macros/graph/plots.html"><tt>Plots.pl</tt></a>
131+
or <a target="_blank" href="https://openwebwork.github.io/pg-docs/pod/pg/macros/graph/PGtikz.html"><tt>PGtikz.pl</tt></a>
132+
%}
133+
% if ($results->{negative}{lines_below_enddocument}) {
111134
<li>There is content (code or other text), below the <tt>ENDDOCUMENT()</tt> line. Although this
112135
is ignored, there shouldn't be content in this area.</li>
113136
% }

0 commit comments

Comments
 (0)