Forums

Search results: 133

Thanks so much for your replies, Davide!

I had asked:

Can the current inequalities context handle compound inequalities like the following?

 2x + 1 <= -5 or 2x + 1 >= 5 

You answered:

The inequalities context currently requires a variable on one side and a number on the other. So it would not accept 2x+1 <= -5; you would have to enter x <= -3. But you can enter things like

 x <= -3 or x >= 2 

(which is implemented as a union of intervals internally).

This seems to be a case where the equivalent answers are not being accepted yet, even when there is only one variable.  Is this correct?

It would be great to have the ability to grade the statement above as the correct way to rewrite |2x + 1| >= 5 without absolute value symbols, but I would really want to require the form shown, i.e., accepting either

2x + 1 <= -5 or 2x + 1 >= 5

or

2x + 1 >= 5 or 2x + 1 <= -5

My hope is to guide students through the steps I require them to show on paper to solve these absolute value inequalities in my intermediate algebra class (as I currently do in MyMathLab with a series of problems I designed there).

Hopefully this makes sense, and hopefully there will be an acceptable way to do this.  It appears to me that the contextArbitraryString.pl you told me about may well allow me to do this, although as you point out, it is not yet the ideal solution.

Thanks again, Davide!

Paul


Thank you for your detailed response, Davide!

I can see that there are a lot of issues to consider here that I had not anticipated.

I think an improved inequalities macro would be quite useful in a variety of topics.  Of course the domain of a function of two variables is one.

Can the current inequalities context handle compound inequalities like the following?

2x + 1 <= -5 or 2x + 1 >= 5

Hopefully it can.  I would like to port some problems I have written for MyMathLab over to WebWork someday to help students step through the process of solving absolute value inequalities.

In the meantime though, I will try my hand at using the contextArbitraryString.pl macro that you told me how to use in your response to my other post.

You said:

It would be possible to extend the current inequalities context to make them work with a variable on one side and a formula (in other variables) on the other, so you could get things like x-1 <= y <= x+1, or y < x^2+ 1

Would it be difficult to do this?  Is this automatically acceptable to the inequalities context?  I am guessing not.  What would it involve to try to extend it to handle these possibilities?  That would help with some of my examples.

Now, concerning the issue of multiple ways to represent the correct answer condition.

I stress the importance of making the form of this condition as clear as possible, and although I certainly would accept

 { (x,y) : y < 2*x + 1 } for  { (x,y) : y < 2x + 1 }

I would not want to accept

{ (x,y) : y + 2x < 1 }

which will not work anyway right now.  =)  Ideally I would want to be able to give a hint to make the condition more clear by isolating y.

I hesitate still to use: "{ (x,y) : y < [_________] }"  since it seems to lead them way more than I want to in this kind of problem

There is so much variety in the types of conditions that arise in this context.  I want them to be able to identify whether the clearest condition can be obtained by isolating (solving for) y, by putting the inequality in circle form, ellipse form, hyperbola form, or perhaps just leaving it in its original form (e.g., xy > 0).

Thanks again, Davide!

Paul

WeBWorK Problems -> display macro for "#"?

by D. Brian Walton -
I have a problem where the author included "#" directly in the problem statement. This works fine for display-mode. However, when hard-copy is produced, the LaTeX compiler chokes on the naked # character.

When I looked in PGbasicmacros.pl, I could not find a display macro for this character. Is this an omission or is there a different method to accomplish this?

(I'm assuming that it is an omission and can be rectified by mimicking what was done for the $DOLLAR display macro.)

Also, I noticed that this is a very hard thing to search for in the forum because "number" and "pound" show up in too many settings that did not apply (e.g., "compound"). So this may have been asked before and I couldn't find it.

D. Brian Walton

WeBWorK Main Forum -> Compound problems with Hints

by Yoav Freund -
I am looking for a way to add hints to compound problems. I am thinking of the simplest type of hints: those that appear after several failed attempts to give the answer.

It seems like the macros "package.pl" and "ImprovedCompound.pl", which, I think, come out of Prof Petruccelli's group, support hints. But there is no documentation and I can't figure out how to control the number of times before the hint is shown and the number of times before the student is forced to move on to the next section.

Anybody has experience with these?

Yoav

WeBWorK Main Forum -> 4+1 projects at WPI -> Re: 4+1 projects at WPI

by Michael Gage -
That file seems to be missing from the zip file provided on the WPI site.
(Is it possible that this file was renamed improvedCompound.pl?).  Other than that suggestion I would recommend getting in touch with the students and the professor at WPI to find the missing file.

You can use .pl files in a single course by uploading those files to your course's macro directory.  Files in this directory are found first so you can also override standard .pl files (on a file by file basis -- the mechanism is not smart enough to override single subroutines). 

*.pm files cannot be changed by individual instructors. For security reasons they can only be changed by the site administrator.

There are many of us who are very interested in this project of creating one or more compoundProblem / sequential problem macros that makes this type of problem easier to write.

Please keep us informed.
I suspect Arnie is referring to PeriodicRerandomization.pl which Paul described in

http://webwork.maa.org/moodle/mod/forum/discuss.php?d=2572#p5443

with full source (including internal documentation) found at

http://svn.webwork.maa.org/npl/trunk/NationalProblemLibrary/macros/FortLewis/PeriodicRerandomization.pl


Note:Mike's message has a link to the maa102 "course" which allows Guest Logins. If your "practice#" login has recorded attempts for some problems in the compoundProblemExperiments "assignment", then you may not encounter all segments of that problem. A quick logout and login may have you become a different practice student with no prior answers.
The sequential (or compoundProblem) capabilities can still use significant additional development.   I think most of us, including the author Davide Cervone, regard the compoundProblem.pl macro as an interim solution.

Some further progress on this was done by students at WPI:
see in particular the project on WeBWorK tutorials for statistics II

and there is one further example adding javaScript UI at 

This is definitely a breadboard example.  You can see all the moving parts and it is certainly not robust.


It should be good enough as a proof of concept however.  If you tweak it gently, one step at a time, you should be able to 

make this work for a real homework problem

(make small changes and test often -- backup if something breaks -- as I said it's a breadboard and 

potentially fragile.)    Let me know how it goes.  It will help with development if I have a few real compoundProblem to experiment with and I'm completely open to collaborating on getting this capability perfected.

Is PGML compatible with CompoundProblems?

It should be. I haven't tried it out specifically, but I don't see why not.

I have just completed an expansion of the MathObject documentation on the WeBWork Wiki, so that should be a much better reference than before. But you are right, there is nothing on PGML. I never quite finished PGML and still considered it in experimental shape when it was included in WeBWorK, and so had not done the documentation, and haven't gotten back to it. I had hoped to work on that this summer, but the other MathObject documentation took all my available time.

The compounProblem macros desperately need rewriting, but that will have to wait as well. But, as you say, at least there is some documentation there. The best I can offer for PGML is the PGML lab linked from the PGlabs wiki page. In the first link, Problem 1 is a lab for PGML and it has a number of examples that describe some of how it works. The "for reference" menus list all the commands, so perhaps that is some help.

The second problem was supposed to be a lab for the Typeset context (which is part of PGML), but it doesn't seem to be working at the moment.

Davide

Dear Davide,

Is PGML compatible with CompoundProblems?

Going through the examples is helpful, but in order to work on new problems,
rather than edit old problems, it would be extremely useful to have a reference manual for PGML / MathObjects as well as for other more specialized items such as compound problems.

Without those I am just writing and praying...

A manual for the PGML markdown language would be particularly useful.

I saw some useful documentation in compoundProblem.pl but none in PGML.pl

Yoav

Jason has already pointed you to one of the key examples that you will need for your question (1). There is also the second example on the Adding Functions example on the wiki.

In order to do your multi() function, however, you will need to do a little more work, since these examples are only for one or two arguments. To do more than that, you will need to make a new subclass of the Parser::Function class and implement a few additional methods that handle checking the parameters, evaluating the function, and so on.

There are no official examples for that, but the code at pg/lib/Parser/Function/ are the ones that implement the existing functions. In particular, numeric.pm and numeric2.pm are the ones to look at.

The _check() routine is the one that checks parameters during the parsing, and these call service routines that are in lib/Parser/Function.pm. You would need to make your own version of these for handling arbitrary numbers of parameters (or at least even numbers). You would also need to make _eval() and _call() methods that handle arbitrary parameters.

I will see if I can work up an example for you, but you can start there yourself if you want.

As for question (2), the formatStudentAnswer option for the answer checkers controls how the "entered" value is displayed. By default it is "evaluated", meaning the final result, but you can change it to "parsed" or "reduced" if you want to show the original formula instead. E.g.,

    ANS($ans->cmp(formatStudentAnswer=>"parsed"));
I don't know the answer to question (3). Multi-step questions are still not easy to produce, but people are working on that. There are some macros in pg/macros/compoundProblem.pl that implement one approach, but it has its problems.

Answer hints can be handled in several ways. There are examples on the wiki; see Answer Hints, for an example using the answerHints.pl macros.

Hope that helps.

Davide