## WeBWorK Main Forum

### Issues with draggableProof.pl on WW3 ### Issues with draggableProof.pl on WW3

by Lijuan Cao -
Number of replies: 6

Our university recently upgraded to WW3 and it works nicely. Earlier this week, we experienced some issues with a draggable proof problem. If a student submits the same answer twice in a roll, the second answer is recorded as 'empty'. Because of which, the right column disappears. This was not an issue with WW2 and we are not sure how to fix it. Any suggestions? Thank you.

Below is the problem pg file:

DOCUMENT();

"PGstandard.pl",

"MathObjects.pl",

"PGML.pl",

"PGbasicmacros.pl",

"draggableProof.pl",

"PGcourse.pl"

);

TEXT(beginproblem());

###########################

#  Setup

Context("Numeric");

$CorrectProof = DraggableProof([ "Let $$n$$ be even.", "By the definition of even, $$n = 2k$$ for some integer $$k$$.", "It follows that $$\\n^2 + 3n + 5 = (2k)^2 + 3(2k) + 5$$ $$\\ \hspace{38mm}= 4k^2 + 6k + 5$$ $$\\ \hspace{37mm} = 2(2k^2 + 3k+ 2) + 1$$", "Since $$k$$ is an integer,", "$$2k^2 + 3k+ 2$$ is an integer.", "Since $$n^2 + 3n + 5$$ equals $$2$$ times an integer plus one,", "$$n^2 + 3n + 5$$ is odd."], ["$$2k^2 + 3k+ 2$$ is even.", "By the definition of odd, $$n = 2k + 1$$ for some integer $$k$$.", "Let $$n$$ be odd."] , SourceLabel => "Choose from this list of sentences", TargetLabel => "Direct proof of the statement (in order):", ); ################################### # Main text BEGIN_PGML Order *[$CorrectProof->numNeeded] of* the following sentences so that they form a direct proof of the statement: If [n] is even, then [n^2 + 3n + 5] is odd.

[@ $CorrectProof->Print @]* END_PGML ############################ # Answer evaluation$showPartialCorrectAnswers = 0;

ANS(\$CorrectProof->cmp);

ENDDOCUMENT(); ### Re: Issues with draggableProof.pl on WW3

by Glenn Rice -
WW3 has not been released, and is in no shape to even do what you are claiming.  So I assume you mean that you upgraded to a recent version of WW2.  The latest release is version 2.17.  Is that what you have upgraded to?  Please give the correct version of webwork2 that you did upgrade to.

I tested your problem (recreated from what you gave), and I can not reproduce this issue.  Could you attach the actual problem?  The way you posted the problem in the text didn't work out so well. ### Re: Issues with draggableProof.pl on WW3

by Lijuan Cao -
My bad. Our university uses webwork3 as the prefix so I thought it was version 3. You are correct, we currently use 2.17. I am attaching the problem below. Thank you.

Below are some screenshots to show what happened.

At the beginning, there were 10 blocks in the left column, I moved 7 to the right, and click submit. Everything worked as expected. Then, without a change, I clicked submit again. The Answer Preview does not show anything and the right column disappeared. The past answers showed that the answer submitted for the attempt was 'empty'. I checked the draggableProof macro and noticed that the content of the right column is created using the answer submitted on each attempt. This explained why the right column disappeared if the answer was 'empty'. But I am not sure what causes the answer of the second attempt to be 'empty'. ### Re: Issues with draggableProof.pl on WW3

by Glenn Rice -

Looking at your screenshots, those don't look right for WeBWorK 2.17.  I think you need to run "npm install" from the /opt/WeBWorK/pg/htdocs directory. ### Re: Issues with draggableProof.pl on WW3

by Glenn Rice -

There was a typo in my last comment.  That should have been "npm install".  If you have the javascript and css up to date, this is what the draggable proof problems should look like. Notice that the coloring is quite different than what you show in your screen shots.   