Forums

Search results: 133

Hello dear community,

I am trying for the following setup. I want a student to answer two multiple choice questions to achieve two points. The questions are drawn from an array of five different multiple choice questions, randomly. In case she is successful, nothing else happens due to passing. In case he fails at both questions, failure is complete. But in case one questions is correct and the other not, she is to get one additional chance and another new multiple choice is drawn out of the array. So I want to genrate a problem where a new problem or a new problem part appears when out of the initial multiple choice questions, exactly one is false.

Is that even possible? I was thinking of scaffold or compoundProblem5 and drew three out of five initially. But I could not get to the point where I have access to the students achieved grading points to set a conditional. I am linked to Moodle and also thought of a condition in Moodle for the exactly one point scenario. But that the new link would be visible when one question has been answered correctly but the second was not tried already. Apart from that the new link would aim at new set where I could not set the same seed as in the first one, could I? I would also go with a gateway quiz if that would suit my setup.

I have though about that.  I have several problems that ask the student to solve a linear inequality or compound linear inequality, and then graph it.  The first part is a standard MathObject interval answer, but for the graph I use a radio multiple choice type answer.  It would certainly be nicer to have the students construct the number line graph instead. 

In addition, these problems are scaffold problems where the second graph part is not visible until after the first part is correct.  The reason for this is because the multiple choice graphs give away what the solutions for the equality are.  In addition, I have to have alternate version of the problems on quizzes that do not ask the graph part, because the scaffold is open and again the graph gives information away for working the first part.  If the student were constructing the graph from scratch, this wouldn't be an issue.

I actually use JSXGraph for the graphs in the multiple choice radio answers, but they are static graphs.  Sp JSXGraph is certainly capable of making these sorts of graphs.  However, the graphTool javascript would need considerable retooling to achieve this, and that would be difficult to do without messing up the two dimensional graphing capabilities.  It might be easier to make another macro and javascript to handle this.

Here is a screenshot of a graph from one of these problems: interval graph

WeBWorK is not great at cleaning up memory after processing problems, which is why the memory used by apache processes tends to grow, and the settings you quote above are necessary.

Those guidelines are pretty good for most scenarios. There are a couple of confounding factors that may be at play here:

  • When a gateway quiz is served to a student, WeBWorK processes all of the problems at once, which can cause an individual apache process to eat up more memory than you would otherwise see.  This means that gateway quizzes with a large number of problems cause apache to use more memory.  If a large number of students access a quiz in a short period of time, then this effect will compound before the process gets killed off (after serving 50 requests as per the configuration).
  • Since your system has a larger amount of RAM and you have set MaxRequestWorkers to a higher value, there is room for more ballooning of memory usage, so the values may need to be tweaked.

If you lower the value of MaxConnectionsPerChild you will likely see the amount of memory taken by the apache processes decrease, as they will be serving less requests before being killed off.  The tradeoff is that there is some overhead in starting new apache processes to replace them, which will lead to a performance hit.  I don't have any gauge of how significant that hit will be.

Another factor to consider is if you are using lighttpd to serve static content, then a larger proportion of the requests handled by apache will be memory intensive.  If that's the case then it is probably a good idea to lower MaxConnectionsPerChild.

Summary:

  • Check to see if one (or more) of your courses is running gateway quizzes with a large number of questions, and where many students start the quiz at the same time.
  • If you lower MaxConnectionsPerChild, you will likely see less memory used by each process, but more processor usage and disk I/O as new apache processes are started.
  • If you lower MaxRequestWorkers then the total memory used by all apache processes will decrease (since there will be less processes), but it will also reduce the number of concurrent requests your server can handle.  If there are more requests to the server than there are apache workers, then new requests will have to wait until an apache worker becomes available.
Here's the problem code. It's adapted from some PCC problems and another by Robin Cruz from about 2014.

Again, the issue is that when an answer is entered for the set-builder notation answer in text mode (Tt), the answer is processed correctly, and maintained in the Entered and Preview columns, but not displayed in the student's answer blank after each submission. And it is not there at all, even when I click into it.

##DESCRIPTION
## Compound Inequalities - OR
##
## Adapted from a problem by RA Cruz by Paul Seeburger
##
##ENDDESCRIPTION
## DBsubject(Algebra)
## DBchapter(Algebra of real numbers and simplifying expressions)
## DBsection(Inequalities and intervals)
## Institution('Monroe Community College')
## Author('Paul Seeburger, RA Cruz')
## MLT(Compound_inequality)
## KEYWORDS('inequalities','compound','and')
## Date('9/24/2014')

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

loadMacros(
"PGstandard.pl",
"PGchoicemacros.pl",
"MathObjects.pl",
"contextInequalitySetBuilder.pl",
"PGML.pl",
"PGcourse.pl",
);

TEXT(beginproblem());

######################################
# Setup
#This is an (-infinity,a) or (b,infinity) problem:

$a = non_zero_random(-3,2,1);
$c = random(2,3,1);
$ac = $a*$c;
do {$b = random(-4,4,1);} while ($a==$b);
$d = random(-3,-2,1);
$bd = $b*$d;

@inequal = ("$c x < $ac","$d x > $bd" );
@slice = NchooseK(2,2);

InequalitySetBuilder::UseVerticalSuchThat();
Context("InequalitySetBuilder-Only");
Context()->flags->set("formatStudentAnswer"=>'parsed');
Context()->strings->add("null set"=>{},
"empty set"=>{alias=>'null set'},
"{}"=>{alias=>'null set'},
"all real numbers"=>{},
);

#Context()->operators->undefine(">");
#Context()->{error}{msg}{"Can't use ' > ' in this context"} =
# "Simplest form for a chain inequality will never involve the > symbol. Rewrite it using <.";

$ans = Compute("x<$a");
if ($a<$b) {$ans = Compute("x<$b");}
$setans = Compute("{ x | $ans}");

Context("Interval");
Context()->strings->add("none"=>{}, "null set"=>{alias=>'none'});
if ($a<$b) {
$intans = Compute("(-inf,$b)");
}
else {
$intans = Compute("(-inf,$a)");
}
######################################
# Main text

BEGIN_TEXT
Solve the compound inequality.
\[ \Large {$inequal[$slice[0]] \quad\mbox{ or }\quad $inequal[$slice[1]] }\]
END_TEXT

$rn = "\{x \mid x \in \mathbb{R}\}";
BEGIN_PGML

Please type: *inf* for [`\infty`], *[$GTS]=* for [`\geq`], and *[$LTS]=* for [`\leq`]

In set-builder notation, the solution set is [______________].

If the answer is [`\varnothing`], type *null set*. If the answer is [`[$rn]`], type *all real numbers*.

An example of set-builder notation is [`\{x\mid x < 10\}`].

In interval notation, the solution set is [______________].
An example of interval notation is [`[1,\infty)`]. If the answer is [`\varnothing`], type *none* or *null set*.


END_PGML

$showPartialCorrectAnswers = 1;

ANS($setans->cmp(mathQuillOpts => "spaceBehavesLikeTab: false"));
ANS($intans->cmp(mathQuillOpts => "spaceBehavesLikeTab: false"));

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

COMMENT('MathObject version');
ENDDOCUMENT();

WeBWorK Main Forum -> Scaffold sections

by Andrew Dabrowski -

I'm just starting the process of revising old problems to use scaffold.pl (rather than compoundProblem.pl).  But it seems that scaffold isn't working as advertised: later parts are open whether or not earlier parts have been completed successfully.  I saw a post here from a few years ago,

https://webwork.maa.org/moodle/mod/forum/discuss.php?d=4004,

with the same complaint, for which the problem turned out to be registering the answers outside the section; but that doesn't seem to be the issue with me. 

Here's a MWE:


DOCUMENT();        

loadMacros(
  "PG.pl",
  "PGbasicmacros.pl",
  "PGanswermacros.pl",
  "scaffold.pl"
);

TEXT(&beginproblem);
    
Scaffold::Begin(can_open => "when_previous_correct");
Section::Begin("Part 1");

BEGIN_TEXT
    1+1=\{ans_rule(4)\}
END_TEXT

ANS(std_num_cmp(2) );
Section::End();

Section::Begin("Part 2");

BEGIN_TEXT
    2+2=\{ans_rule(4)\}
END_TEXT

ANS( std_num_cmp(4) );
Section::End();

Scaffold::End();

ENDDOCUMENT();      


WeBWorK Main Forum -> Gateway/Quiz scoring problems

by Andrew Dabrowski -

Just tried gateway/quiz for the first time, and there scoring anomalies. Now this may just be because two of the four problems used the deprecated compoundproblem.pl macro, but I'm not sure that explains everything.  Here are the previous answers and scores for one student.

previous answers:

previous entries

score:

scores

Aren't these blatantly contradictory?  The previous entries show the student getting everything correct, while the score is 2.75/4.


WeBWorK Main Forum -> compoundProblem -> Re: compoundProblem

by Michael Gage -
Despite the hassle I recommend upgrading the problems to use scaffold.pl -- it's a lot of work but it could be worse -- a lot of the original text and code can be reused. However it would be a substantial project and probably not something you want to do immediately.

scaffold.pl is not (yet) perfect, but it's way better than compoundProblem.pl,
compoundProblem2.pl and compoundProblem5.pl -- all of which I believe are in your 2.13 distro. You might try to switching the problem to use compoundProblem5.pl -- that might have better backward compatibility but would still solve the issue you mention.

I no longer recall whether this issue was known -- compoundProblem evolved over a fairly long time period which was required since in the beginning we really didn't know what features were needed for a problem type like this and it took a lot of experimentation to come up with a generally accepted feature set.
I would say that scaffold.pl is much better, but probably still far from perfect.

Let us know how things work out.

WeBWorK Main Forum -> compoundProblem

by Andrew Dabrowski -
We are running WW 2.13, and we have dozens of old problems written using compoundProblem.pl. I see that it is now deprecated in favor of scaffold.pl, but rewriting all the old problems is nontrivial and I'd be able to maintain them in working order. There are two issues we've run across.

1. Later parts of a problem, i.e. after the first, are not reloaded when a student returns to the problem. This means all the answers in parts 2, 3, etc. must re-entered by hand before the student can proceed to the parts not completed the first time.

2. A student's score reflects only the parts attempted. This means that a student can get a 100% by completing only the 1ts part and not attempting any later parts.

I can provide a MWE if that would help.

Are these known issues? Were they new in WW 2.13? Is there a workaround to avoid rewriting all these problems to use scaffold?
Thanks John. I admit I don't understand the MediaWiki templates very well either and some of their documentation is out of date. (So I guess WeBWorK is in good company in that regard.)

After much futzing around I've created a new template:

Template:OutdatedRedirect
which accepts an additional parameter, any phrase you want.
{{OutdatedRedirect | You can write multi-part problems using the [[Scaffold|scaffold.pl]] macro file }}

gives you

Outdated
IMPORTANT: The content of this page is outdated. Do not rely on the information contained in this page.
You can write multi-part problems using the scaffold.pl macro file.

The template is at Template:OutdatedRedirect in the Altert_templates category:

http://webwork.maa.org/wiki/Category:Alert_templates

Someone with more knowledge can got ahead and improve this template (and others in that category). Then we can update all the wiki pages to use OutdatedRedirect to point to the current information.

Thanks for the help.

-- Mike