Update Value/AnswerChecker diagnostics output.#1384
Update Value/AnswerChecker diagnostics output.#1384somiaj wants to merge 1 commit intoopenwebwork:developfrom
Conversation
97c7015 to
3baf230
Compare
|
In testing this I ran across a bug where test points were not being graphed correctly when using adaptive parameters, and that was because the adaptive parameters are included in the list of variable names, but don't have test points assigned to them, so the test points being used were either nonexistent or assigned to a different variable depending on the random order of the keys from the So I updated this to remove adaptive parameters from the list of variable names. I also updated it so that the list of test points only shows the values of variable test points used in either the student or correct answer. This does make the table more useful to me when there are additional variables in the context not used. |
9ba9108 to
d3b0f5f
Compare
|
There is another possible issue where alias variables aren't correctly dealt with in determining what the test points are for the graph. I think this is similar to the parameter issue where these variables aren't given test points so the wrong list of test points is chosen to be graphed. |
This is not happening for me. The MathJax renders on initial page load for me. |
|
@drgrice1 wonder if it is a race condition where mathjax isn't fully loaded by the time the graph loads, I think I've had this happen before. |
c2dc9fc to
c691d32
Compare
|
Okay, I think I got the variables vs parameters vs aliases figured out. Aliases didn't need to be dealt with as the formula already does the substitution, parameters just need to be filtered otherwise they make the count of which list of test points to use incorrect. @dpvc Care to let me know if I'm missing something, the main bit of code I have is here: # Get the test points. This requires first determining what variables are in use and ignore parameters.
my $points = [];
my @params = $self->{context}->variables->parameters;
my %pnames = map { $_ => 1 } @params;
my @names = $self->{context}->variables->variables;
my @variables = grep { !$pnames{$_} } keys %{ $self->{variables} };
# If a single variable is found, use its test points for the graph.
# Functions with more than one variable are not graphed so test points are not needed.
if (scalar(@variables) == 1) {
my $vi = 0;
while ($names[$vi] ne $variables[0]) { $vi++ }
$points = [ map { $_->[$vi] } @{ $self->{test_points} } ];
} |
Use plots.pl to create the graphs instead of the old graphmacros. Remove use of tables for formatting. Use bordered divs instead. Cleanup some of the HTML use with this as well. Space the graphs vertically, to work better on smaller screens or in the problem editor. When finding test points, remove adaptive parameters from the list of variable names, as these can make it so the test points shown on the graphs are incorrect. Only use of a table is for the table of test points, which now uses row headers, padding, and no longer uses blank cells for spacing. Multivariable functions have the test points for each variable in their own row instead of showing them as a point. Only variables used in correct or student answers are shown.
Use plots.pl to create the graphs instead of the old graphmacros.
Remove use of tables for formatting. Using bordered divs instead. Only use of a table is for the table of test points, which now uses row headers properly and padding and no longer uses blank cells for spacing. The test point table puts each variable in its own row for multivariable functions.
Here are some test problems, one using an adaptive parameter, and one with multivariables to show each variable test points are put in their own row.
I don't think stating the domain, range, and aspect ratio of the graphs is useful. I left that there, but suggest removing it.
@drgrice1 for some reason the mathjax for the graph labels only renders when clicking on the graph, but not the original graph output. I didn't debug as to why.