@@ -9,52 +9,54 @@ Analyze a pg file for use of old and current methods.
99
1010=over
1111
12- =item C<deprecated_macros > : a list of the macros that the problem uses that is in the C<macros/deprecated >
12+ =item * C<deprecated_macros > : a list of the macros that the problem uses that is in the C<macros/deprecated >
1313folder.
1414
15- =item Positive features:
15+ =item * Positive features:
1616
17- =over 10
17+ =over
18+
19+ =item * Uses PGML
1820
19- =item Uses PGML
21+ =item * Provides a solution
2022
21- =item Provides a solution
23+ =item * Provides a hint
2224
23- =item Provides a hint
25+ =item * Uses Scaffolds
2426
25- =item Uses Scaffolds
27+ =item * Uses a custom checker
2628
27- =item Uses a custom checker
29+ =item * Uses a multianswer
2830
29- =item Uses a multianswer
31+ =item * Uses answer hints
3032
31- =item Uses answer hints
33+ =item * Uses nicetables
3234
33- =item Uses nicetables
35+ =item * Uses randomness
3436
3537=back
3638
3739=item Old and deprecated features
3840
39- =over 10
41+ =over
4042
41- =item Use of BEGIN_TEXT/END_TEXT
43+ =item * Use of BEGIN_TEXT/END_TEXT
4244
43- =item Include the C<TEXT(beginproblem) >
45+ =item * Include the C<TEXT(beginproblem) >
4446
45- =item Include old tables (for example from C<unionTables.pl > )
47+ =item * Include old tables (for example from C<unionTables.pl > )
4648
47- =item The use of C<num_cmp > , C<str_cmp > and C<fun_cmp > in lieu of using MathObjects
49+ =item * The use of C<num_cmp > , C<str_cmp > and C<fun_cmp > in lieu of using MathObjects
4850
49- =item Including C<< Context()->TeXStrings >>
51+ =item * Including C<< Context()->TeXStrings >>
5052
51- =item Calling C<loadMacros > more than once.
53+ =item * Calling C<loadMacros > more than once.
5254
53- =item Using the line C< $showPartialCorrectAnswers = 1 > which is the default behavior and thus unnecessary.
55+ =item * Using the line C< $showPartialCorrectAnswers = 1 > which is the default behavior and thus unnecessary.
5456
55- =item Using methods from C<PGchoicemacros.pl >
57+ =item * Using methods from C<PGchoicemacros.pl >
5658
57- =item Inlcuding code or other text below the C<ENDDOCUMENT(); > line indicating the end of the problem.
59+ =item * Inlcuding code or other text below the C<ENDDOCUMENT(); > line indicating the end of the problem.
5860
5961=back
6062
@@ -87,6 +89,7 @@ sub analyzePGcode ($code) {
8789 custom_checker => 0,
8890 multianswer => 0,
8991 nicetables => 0,
92+ randomness => 0,
9093 contexts => { BaseN => 0, Units => 0, Boolean => 0, Reaction => 0 },
9194 parsers =>
9295 { dropdown => 0, RadioButtons => 0, CheckboxList => 0, RadioMultianswer => 0, GraphTool => 0 },
@@ -236,6 +239,7 @@ sub analyzePGcode ($code) {
236239 $features -> {positive }{multianswer } = 1 if $line =~ / MultiAnswer/ ;
237240 $features -> {positive }{custom_checker } = 1 if $line =~ / checker\s *=>/ ;
238241 $features -> {positive }{nicetables } = 1 if $line =~ / DataTable|LayoutTable/ ;
242+ $features -> {positive }{randomness } = 1 if $line =~ / random\( |random_(\w +)\( |list_random\( / ;
239243
240244 }
241245 return $features ;
0 commit comments