Webworks to moodle question conversion

Webworks to moodle question conversion

by Marc Grober -
Number of replies: 3
The question was posed in the Math Forum as to how difficult it might be to convert WebworKs question banks to Moodle quiz format. I have appended below an example WebworKs question in pg format.

#DESCRIPTION
## Algebra problem: rational inequality
##ENDDESCRIPTION
##
## Author: Mark Schmitt
## Date: 2001/02 School Year
## Course: Honors Algebra 2
##
## Revision: 7/18/02
## Rewrote to take advantage of interval_cmp written by John Jones
## I have renamed JJ_ans_eval as PGintervalmacros on my local machine, so I use that here
##
##KEYWORDS('algebra', 'rational inequality')

DOCUMENT(); # This should be the first executable line in the problem.

loadMacros(
"PG.pl",
"PGbasicmacros.pl",
"PGchoicemacros.pl",
"PGanswermacros.pl",
"PGauxiliaryFunctions.pl",
"PGintervalmacros.pl"
);

TEXT(&beginproblem);
$showPartialCorrectAnswers = 0;

$a = random(-10,10,1);
$b = random($a+1,$a**2,1);
$c = random($b+1,$b**2,1);


BEGIN_TEXT
Solve the inequality \[\frac{(x-$a)^4 (x-$b)^{13}}{x-$c}\geq 0\]
Give your answer in interval notation.
$BR
\(x \in \) \{ans_rule(20)\}
$BR
Note: Enter your answer without spaces. If you need \(-\inf\), type -inf. If you need \(\inf\),
type inf. Remember that punctuation is important.
END_TEXT
$ans1="(-inf,$b] U ($c,inf)";

&ANS(interval_cmp($ans1));

ENDDOCUMENT(); # This should be the last executable line in the problem.
Average of ratings: -
In reply to Marc Grober

Re: Webworks to moodle question conversion

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
For those wanting to find out more, WeBWorK seems to live at http://webwork.maa.org/wiki/Main_Page. (There are several other things of the same name known to Google, but that seems to be the right one.)


Looks like there is a really valuable bank of questions there. It would be really good if these could be used in Moodle.


Unfortunately, the short answer to the question as stated "How difficult would it be to convert WeBWorK question banks into Moodle questions?" is that it's impossible.

To expand on that. WeBWorK questions contain arbitrary Perl code. They can do pretty much anything. The Moodle question bank recognises questions of a few fixed types.


Some more positive suggestions:

1. It might be possible to convert some WeBWorK questions to the corresponding Moodle question type. However, working out which Moodle question type a WeBWorK question is like would be very hard to do automatically. The calculated question type can do some of the things that WeBWorK questions can do, but is one of the more complex question types, so writing an automatic coverter would be particularly hard.

2. It might be worth looking at STACK, and you can use STACK questions in Moodle if you set things up correctly. It might be more feasible to convert WeBWorK questions to STACK questions, but again making an automatic coverter would be really hard.

3. Alternatively, you could look at how STACK questions work in the Moodel quiz, and use Opaque to let WeBWorK questions be used in the Moodle quiz.

4. Finally, you could make a Moodle question type specifically for playing WeBWorK questions. The main issue to deal with would be communicating between the PHP question type and the WeBWorK Perl.


I think if I was going to tackly this, I would investigate how hard 4. is going to be, and then either do that, or fall back to 3. Either way you are probably talking about a project that lasts several months. The initial investigation to choose between 3 and 4 is very hard to quantify. Then there is probably a month's solid development. Finally, allow several months of this being used, if not more, to shake out most of the bugs and make it reliable (but that is more testing time than development time).

Based on my experience of integrating STACK and OpenMark with Moodle, I would say that if anything those estimates are optimistic. However, if the WeBWorK question bank is a good as it looks at first sight, then it would definitely be a worthwhile investment of time for someone, and it would be an interesting development project.
In reply to Tim Hunt

Re: Webworks to moodle question conversion

by Marc Grober -
Thanks Tim,

To fill in some, I am hopeful that wwmqt, webworks moodle question type, will soon be again functioning fully thanks to a number of folk working with mike leventi's code, but to shepherd through the moodle 2 transition will require commitments that have yet to be seen.

While leventi anticipated the ability to bulk load ww questionbanks, wwmqt at present will only allow for manual creation using the pg code. The manual effort required begs the question of why not simply do a full ww install with a moodle bridge, such as can be seen at a number of universities including Ohio State

as tim mentions, competing options such as STACK and Imathas exist, but all these choices require tools outside of moodle proper, and all have aspects thatcan be seen by to be either features or flaws depending on who is speaking ( ie no obvious best of breed).
In reply to Marc Grober

webwork moodle question type - wwmqt

by Marc Grober -
For those interested, I posted details on the current status of the webwork question type here: http://moodle.org/mod/forum/discuss.php?d=89886&parent=561706 which references the installation instructions at the tracker item I created which includes patch files for testing: http://tracker.moodle.org/browse/CONTRIB-1422

If you have SOAP installed and have 5-10 minutes please check this out and help us determine if the proposed patch effectively resolves the current issues.

As noted, the question banks available with webwork are very extensive and for modest usage you can employ Rochester's question server.