Log of /trunk/pg/macros/PGanswermacros.pl
Parent Directory
Revision
3758 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Nov 12 00:58:57 2005 UTC (7 years, 6 months ago) by
gage
File length: 176431 byte(s)
Diff to
previous 3757
,
to
selected 1785
Check to see if $inputs_ref->{previewAnswers} is defined. If it is then
the preview button has been pressed. In this case emit a warning if
the answer has been given previously regardless of whether the answer is
correct or incorrect. The warning message indicates that the previous
matching answer might have been either a preview or a submitted answer.
Let's see how this works.
Revision
3757 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Nov 12 00:50:07 2005 UTC (7 years, 6 months ago) by
dpvc
File length: 176306 byte(s)
Diff to
previous 3756
,
to
selected 1785
Take care of the issue where Preview could be used to gather
information about whether an answer is correct by using the "this
answer is the same as the previous one" message. Now if Preview is
used, the warning is given whether the answer is right or not.
(Maybe it is not necessary to check for correct at all, since that was
there to prevent the message from being issued when there are multiple
answer blanks and the student is working on other ones. But the exact
match check will take care of those. Should the message be issued if
the student changes a correct answer to an equivalent one?)
Revision
3753 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Nov 12 00:13:03 2005 UTC (7 years, 6 months ago) by
gage
File length: 176081 byte(s)
Diff to
previous 3735
,
to
selected 1785
Changes to code checking whether the previous answer is equivalent to the current answer.
In this module additional code was answer to check for errors in the overloaded ==
in case the two Values can't be compared.
In PGanswermacros.pl the filter which handles "parse_previous_answer"
was modified to make sure the context is the same in the previous answer and the current answer.
Revision
3715 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Oct 16 03:27:35 2005 UTC (7 years, 7 months ago) by
dpvc
File length: 175735 byte(s)
Diff to
previous 3689
,
to
selected 1785
Added a new experimental diagonstic function for the function answer
checker. When enabled, it will produce graphs of the correct answer,
the student answer, and the absolute and relative errors, and will
list the data points used in the comparison, plus the numerical values
of the results and errors.
To enable the diagnostic, use
ANS(fun_cmp($f,diagnostics=>1));
Note that only single-variable functions can be graphed at the moment,
so if you are using a multi-variable check, you need to disable the
graphing. To do this use
ANS(fun_cmp($f,vars=>['x','y'],diagnostics=>[showGraphs=>0]));
The diagnostic mode is only available for the Parser-based versions of
the function checker, and (of course) with the native Parser objects
as well:
ANS(Formula($f)->cmp(diagnostics=>1));
There are now Context settings to control the diagnostics, which can
be set through Context()->diagnostics->set(). For example
Context()->diagnostics->set(formulas=>{showGraphs=>0});
would turn off graphs for all functions comparisons. Some of the
other values you can set are:
formulas => {
showTestPoints => 1, # show the test points and function values
showRelativeErrors => 1, # show the relative errors for the student answer
showAbsoluteErrors => 1, # show the absolute errors for the student answer
showGraphs => 1, # show the various graphs
graphRelativeErrors => 1, # show the relative error graph
graphAbsoluteErrors => 1, # show the absolute error graph
clipRelativeError => 5, # don't show relative errors above 5
clipAbsoluteError => 5, # don't show absolute errors above 5
plotTestPoints => 1, # include dots at the test points
combineGraphs => 1, # show correct and student graphs in one image
},
graphs => {
divisions => 75, # the number of data points to plot
limits => [-2,2], # the lower and upper limit of the plot
# (taken from the function limits if not provided)
size => 250, # pixel size of the image (could be [width,height])
grid => [10,10], # number of grid lines in each direction
axes => [0,0], # where to put axes relative to origin
}
Any of these can be set in the Context(), or in the answer checker
itself. If you set diagnostics to an array reference, the entries in
the array refer to element of the formulas hash. If you set
diagonstics to a hash reference, then you can set values in either the
formulas or graphs hashes, as in:
ANS(Formula($f)->cmp(diagnostics=>{
formulas => {showAbsoluteErrors=>0},
graphs => {size=>300, divisions=>100},
}));
If you want all function checkers to show diagnostics, use
Context()->diagonstics->set(formulas=>{show=>1});
The image file names are modified to include the current time so that
the names will be unique. This avoids problems with the browser cache
showing a old image when a new one has been generated. But this also
means that the temporary image directory will fill up fast, so you may
need to empty it if you use the diagnostic images frequently.
This is just a first attempt at a diagnostic feature. I think it will
help when you are not sure if the tolerances are set properly, or if
you think a student answer should be markes correct but isn't, as it
will point out which point(s) are not being accepted.
Revision
3615 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Sep 13 14:07:32 2005 UTC (7 years, 8 months ago) by
dpvc
File length: 175429 byte(s)
Diff to
previous 3572
,
to
selected 1785
The ORIGINAL_NUM_CMP was calling str_cmp as a code reference rather
than as the more modern AnswerEvaluator object. This causes error
messages when string answers were used. It now uses the evaluate()
method of the AnswerEvaluator.
Revision
3572 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Aug 25 18:21:21 2005 UTC (7 years, 9 months ago) by
jj
File length: 175420 byte(s)
Diff to
previous 3393
,
to
selected 1785
This makes the pg/lib/Parser/Legacy copy of PGanswermacros.pl the
official copy here. This still leaves the original answer evaluators as
the default, but simplifies the update process, and we don't have to
maintain two copies of the original functions.
Revision
3393 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Jul 20 18:30:59 2005 UTC (7 years, 10 months ago) by
gage
File length: 165229 byte(s)
Diff to
previous 3346
,
to
selected 1785
Added a modification of the grades that shows where the
state_summary_msg can be added. This message is
printed at the bottom of each problem page. The current default
is a blank message, which means that the default message
defined in Problem.pm is printed.
There is currently no way to turn the message off entirely. Perhaps
on the next revision.
Revision
3338 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jul 4 15:21:52 2005 UTC (7 years, 10 months ago) by
gage
File length: 162134 byte(s)
Diff to
previous 3325
,
to
selected 1785
Restored str_filters -- removing it broke some of the other answer evaluators.
str_filters takes a string, filters it and then returns the filtered string.
The actual filters have been changed to work with answer hashes rather than with
strings, so str_filters warps the string in an answer hash before sending it through
the filters.
sorry for the breakage.
-- Mike
Revision
3324 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Jun 29 16:19:42 2005 UTC (7 years, 10 months ago) by
gage
File length: 162042 byte(s)
Diff to
previous 3323
,
to
selected 1785
Fixed bug in radio_cmp closing bug #258. We now check to make
sure that only a single string is being passed and not an array.
(The latter occurs if checkboxes are used instead of radio buttons.)
The presence of two checked checkboxes triggers a warning.
Revision
2277 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Jun 8 02:06:32 2004 UTC (8 years, 11 months ago) by
sh002i
File length: 156931 byte(s)
Diff to
previous 2243
,
to
selected 1785
Reformatted the FUNCTION_CMP subroutine to make it more readable. Also,
one functional change:
< (defined ($inputs_ref->{$prev_ans_label} and $inputs_ref->{$prev_ans_label} =~/\S/) )
> (defined $inputs_ref->{$prev_ans_label} and $inputs_ref->{$prev_ans_label} =~/\S/)
I think the latter was what was intended.
Revision
2061 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun May 9 17:45:41 2004 UTC (9 years ago) by
gage
File length: 158993 byte(s)
Diff to
previous 2056
,
to
selected 1785
Modifications to PGbasicmacros and PGanswermacros which check whether a function answer
is the same as the function answer submitted previously. Gives warning message
if the same incorrect answers is submitted twice in a row. The functions must
both compile in order to recognize that they are the same answer. Two syntactically
incorrect entries will not be recognized as equivalent, even if they are in some sense.
Revision
2056 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat May 8 22:51:38 2004 UTC (9 years ago) by
gage
File length: 154137 byte(s)
Diff to
previous 1932
,
to
selected 1785
Updating answer evaluators in PGanswermacros.pl
Beginning to include code that will allow us to
check whether the current answer is the same
as the one submitted previously.
Revision
1812 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Feb 16 20:34:01 2004 UTC (9 years, 3 months ago) by
gage
File length: 151622 byte(s)
Diff to
previous 1797
,
to
selected 1785
This is a new attempt to fix the problem that there was no
preview string if the units were incorrect. The previous fix
caused difficulties if strings were entered for numerical answers.
The new code has been added to the subroutine fix_answers_for_display
which already performed answer cleanup of various kinds.
Revision
1785 -
(
view)
(
download)
(
as text)
(
annotate)
-
[selected]
Modified
Mon Feb 9 17:18:39 2004 UTC (9 years, 3 months ago) by
gage
File length: 150922 byte(s)
Diff to
previous 1780
Modifications to checkbox_cmp to include preview_latex_string.
this completes the squashing of bug #400
Revision
1690 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Dec 28 19:46:57 2003 UTC (9 years, 4 months ago) by
gage
File length: 150880 byte(s)
Diff to
previous 1620
,
to
selected 1785
Zeroed the variable storing the responses to questionnaires. Should
fix the error on questionnaires revealed by the persistance of mod_perl
modules.
Changed warning message in dangerousMacros.pl to more accurately describe
what is wrong when the gif2eps script cannot be executed. (Based on actual
experience running a course on webwork.math.rochester.edu -- I couldn't remember
what my own warning message implied.)
--Mike
Revision
1506 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Sep 19 01:30:13 2003 UTC (9 years, 8 months ago) by
gage
File length: 150801 byte(s)
Diff to
previous 1463
,
to
selected 1785
Fixed check_string filter so that it places a
value in preivew_text_string and in preview_latex_string
in the answer hash. For example entering DNE did not
show up in answer preview, which bothered some students.
--Mike
Revision
1456 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Aug 14 16:10:01 2003 UTC (9 years, 9 months ago) by
gage
File length: 150659 byte(s)
Diff to
previous 1455
,
to
selected 1785
At least a temporary fix for mail_answers_to2
These evaluators are run in the grader and the
environment variables have disappeared?? I can't find
them at any rate.
this is at best a temporary fix until we get the global
variable situation under control when using cached code.
--Mike
Revision
1250 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jun 23 15:43:11 2003 UTC (9 years, 11 months ago) by
gage
File length: 147658 byte(s)
Diff to
previous 1080
,
to
selected 1785
Made changes required to allow caching of these files.
My tests indicate that these changes are compatible with webwork1.8
One possible problem might be the mail-to answer macros
which access the environement variable directly
I think I have this properly patched, but it has not been
tested yet.
--Mike
This form allows you to request diffs between any two revisions of this file.
For each of the two "sides" of the diff,
enter a numeric revision.