## PREP 2014 Question Authoring - Archived

### Is there a way to turn off shuffling on matching questions?

by Murphy Waggoner -
Number of replies: 4
I am trying to find ways to help students with proof in my ComplexVariables class. I have written some dragable proofs, but I also want them to know how to justify proofs as well.

In particular, I find that students shy away from making a single string of equalities and want them to see as many examples of that as is reasonable.

I thought using a matching question would be good: provide the steps of the proof as the questions and the justifications as the answers, with some red herrings thrown in. I love the look of the question (see attached), but matching shuffles the questions and so the questions aren't in the right order for the proof.

Is there a way to shut the shuffling of? Like a parameter than can be set? I looked at the .pl file to see if I could make a copy and modify it specifically for my own purposes, but am not well versed in the language to figure that out.

(And, yes, I'm laid up with a broken ankle and I think working on Complex and WebWork are fun. Sorry for all the questions, but thanks for the help as always.)

### Re: Is there a way to turn off shuffling on matching questions?

by Paul Pearson -
Hi Murphy,

I do not understand why this type of question falls into the matching category (i.e., the typical structure of a matching problem in webwork seems to me to be a poor fit for this type of question).  Perhaps you're using ColumnMatchTable as a way to get two-column output, which is also provided by ColumnTable.  I have taken your code and rewritten parts of it in a way that I would probably write it (see below my signature).  Notice that my version uses two-column output, has the chain of equations in the left column, and has the list of possible justifications in the right column.

The only thing I don't like about my version of the problem is that the popups hide the possible choices from view until they are used.  The alternate solution I considered (having the popup options just be A through L and then enumerating the options A. addition and subtraction properties, ... in the text displayed to the students) seemed to me to be unnecessarily clunky.

Webwork is fun :)  Sorry about the ankle.  Don't hesitate to ask us questions. (Back before MathObjects were documented well, I asked Davide Cervone a million questions -- so many that he stopped replying right away with the hope that I would solve it myself in the meantime.)

Best regards,

Paul Pearson

##########################################
## DESCRIPTION
## Match justification with step of proof
## ENDDESCRIPTION

## KEYWORDS('matching', 'proof')

## DBsubject('Complex Variables')
## DBchapter('')
## DBsection('')
## Date('07/09/2014')
## Author('Murphy Waggoner')
## Institution('Simpson College')
## TitleText1('')
## EditionText1('')
## AuthorText1('')
## Section1('')
## Problem1('')

###########################
#  Initialization

DOCUMENT();

"PGstandard.pl",
"MathObjects.pl",
"parserPopUp.pl",
#"PGchoicemacros.pl",
"unionTables.pl",
);

TEXT(beginproblem());

###########################
#  Setup

Context('Numeric');

@popup = ();
@ans = ();

$choices = [ "choose", "addition and subtraction properties", "associative law of multiplication", "definition of complex conjugate", "definition of modulus", "definition of the real part of a complex number", "distributive property of multiplication over addition", "closure property of complex numbers", "commutative law of addition", "commutative law of multiplication", "definition of distance between two complex numbers", "rectangular coordinates of a complex number", "none of the above", ];$ans[1] = "rectangular coordinates of a complex number";
$ans[2] = "definition of complex conjugate";$ans[3] = "addition and subtraction properties";
$ans[4] = "definition of the real part of a complex number";$ans[5] = "rectangular coordinates of a complex number";

foreach my $i (1..5) {$popup[$i] = PopUp($choices,$ans[$i]);
}

###########################
#  Main text

Context()->texStrings;
BEGIN_TEXT
Below on the left is a proof of an identity involving complex numbers.
Justify each step of this proof by choosing the best justification
(on the right) for each numbered equation (on the left).
$PAR \{ ColumnTable( "$\begin{array}{rcl} z+\bar{z} & \mathop{=}^{1} & x+iy + \overline{x + iy} \\ & \mathop{=}^{2} & x+iy + x - iy \\ & \mathop{=}^{3} & 2x \\ & \mathop{=}^{4} & 2Re(x+iy) \\ & \mathop{=}^{5} & 2Re(z) \end{array}$" , "Equation 1: " .$popup[1]->menu() . $BR . "Equation 2: " .$popup[2]->menu() . $BR . "Equation 3: " .$popup[3]->menu() . $BR . "Equation 4: " .$popup[4]->menu() . $BR . "Equation 5: " .$popup[5]->menu()
,
indent=>30, separation=>50, valign=>"TOP"
);
\}
END_TEXT
Context()->normalStrings;

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

$showPartialCorrectAnswers = 0; # # Incremental grader # install_problem_grader(~~&custom_problem_grader_fluid);$ENV{'grader_numright'} = [3,4,5];
$ENV{'grader_scores'} = [0.3,0.6,1];$ENV{'grader_message'} = "You can earn " .
"30% partial credit for 3 correct answers, and ".
"60% partial credit for 4 correct answers.";

#
#

foreach $i (1..5) { ANS($popup[\$i]->cmp() );
}

COMMENT('MathObject version.');

ENDDOCUMENT();

### Re: Is there a way to turn off shuffling on matching questions?

by Susanna Epp -
I copied this code as a test problem into my WeBWork course from last fall (This is the basic URL: https://courses1.webwork.maa.org/webwork2) and got an error message. Could the code require a different version of WeBWork that is beyond webwork2? I'm copying the error message below, but before you devote much time to the issue, it's possible that something my husband once did that fixed (for my course) some errors in graph theory problems might be the cause of the difficulty I'm having with this problem.

MESSAGE FROM WEBWORK
WeBWorK::Utils::readFile(/opt/webwork/courses/depaul-mat660/templates/tmpEdit/local/setA13_660_Chapter_4/TestFormat-Steps) says: failed to read file /opt/webwork/courses/depaul-mat660/templates/tmpEdit/local/setA13_660_Chapter_4/TestFormat-Steps: No such file or directory at /opt/webwork/webwork2/lib/WeBWorK/Utils.pm line 162.

## WeBWorK Error

WeBWorK has encountered a software error while attempting to process this problem. It is likely that there is an error in the problem itself. If you are a student, report this error message to your professor to have it corrected. If you are a professor, please consult the error output below for more information.

### Error messages

Failed to read the problem source file.

### Error details

WeBWorK::Utils::readFile(/opt/webwork/courses/depaul-mat660/templates/tmpEdit/local/setA13_660_Chapter_4/TestFormat-Steps) says: failed to read file /opt/webwork/courses/depaul-mat660/templates/tmpEdit/local/setA13_660_Chapter_4/TestFormat-Steps: No such file or directory at /opt/webwork/webwork2/lib/WeBWorK/Utils.pm line 162. 

### Request information

Time Tue Jul 15 15:40:50 2014
Method GET
URI /webwork2/depaul-mat660/A13_660_Chapter_4/20/
 User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0 Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Connection keep-alive Referer https://courses1.webwork.maa.org/webwork2/depaul-mat660/instructor/pgProblemEditor2/A13_660_Chapter_4/20/?effectiveUser=susanna.epp&edit_level=1&status_message=%3Cdiv%20class%3D%22ResultsWithoutError%22%3ESaved%20to%20file%20%27%5BTMPL%5D%2Flocal%2FsetA13_660_Chapter_4%2FTestFormat-Steps%26Reasons.pg%27.%3C%2Fdiv%3E%3Cdiv%20class%3D%22ResultsWithoutError%22%3EThe%20source%20file%20for%20%27set%20A13_660_Chapter_4%20%2F%20problem%2020%27%20has%20been%20changed%20from%20%5BTMPL%5D%2FsetA13_660_Chapter_4%2FblankProblem.pg%20to%20%27%5BTMPL%5D%2Flocal%2FsetA13_660_Chapter_4%2FTestFormat-Steps%26Reasons.pg%27.%3C%2Fdiv%3E&key=Iv4c0pgRuq64bHLpUva07DKc7vO7ZZHc&file_type=problem&sourceFilePath=local/setA13_660_Chapter_4/TestFormat-Steps&Reasons.pg&user=susanna.epp&problemSeed=4453&theme= Accept-Encoding gzip, deflate Accept-Language en-US,en;q=0.5 Cookie WeBWorKCourseAuthen.depaul-mat660=susanna.epp%09Iv4c0pgRuq64bHLpUva07DKc7vO7ZZHc%091405453250 Host courses1.webwork.maa.org
Edit2 Edit3

You have attempted this problem 0 times.
This homework set is closed.

### PG question failed to render

Unable to obtain error messages from within the PG question.

## WeBWorK Warnings

WeBWorK has encountered warnings while processing your request. If this occured when viewing a problem, it was likely caused by an error or ambiguity in that problem. Otherwise, it may indicate a problem with the WeBWorK system itself. If you are a student, report these warnings to your professor to have them corrected. If you are a professor, please consult the warning output below for more information.

### Warning messages

• Processing of this PG problem was not completed. Probably because of a syntax error.
•  The translator died prematurely and no PG warning messages were transmitted. at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm line 700.