Forum archive 2000-2006

Dan Maynard - Conditional Problems

Dan Maynard - Conditional Problems

by Arnold Pizer -
Number of replies: 0
inactiveTopicConditional Problems topic started 7/20/2002; 10:49:45 AM
last post 7/24/2002; 9:32:06 AM
userDan Maynard - Conditional Problems  blueArrow
7/20/2002; 10:49:45 AM (reads: 1636, responses: 3)
I am currently writing a set of problems that have two parts to them. The student answers the first part, and if that is correct, then after clicking the submit button, a new problem appears based on their previous answer. If the first problem is incorrect, they continue to be asked that question until it is answered correctly. This basically uses just an "if" statement, comparing the student answers with the correct numerical value. It works correctly when the formatted text option in used, but when it is attempted using the typeset option, even if the answers are correct, it displays the test and answer boxes from the previously correctly answered question, not the new text and answer boxes that should be shown for the correct response. I know that the program has entered the correct loop, because up top it says "Answer 1 entered: ><" for the correct amount of Answers for entering the second "if" statement. I was wondering if anyone knows of a more reliable way to do this type of "if correct, then" problem, or if anyone knows of a way to get the page to refresh itself after each submit when the typeset option is chosen...or possibly also just a way to disable the students' ability to choose the typeset option. Thanks for any help

Dan

<| Post or View Comments |>


userGavin LaRose - Re: Conditional Problems  blueArrow
7/22/2002; 1:00:36 AM (reads: 1904, responses: 0)
Hi Dan,

The problem with typeset mode is that in that case LaTeX2HTML is being used to generate an HTML page with the associated Gif images for the equations. This is generated the first time a student views the problem (or when you run l2hPrecreateSet.pl), and isn't rebuilt unless the .pg file changes. Therefore the first time the student visits the problem the page they see is fixed for all subsequent viewings.

I don't know of a work-around for this; if you want to disable typeset mode entirely, it's pretty easy to find where the button allowing that is put into the page and edit it out. See the displayMacros.pl file in the system/courseScripts directory.

Gavin

<| Post or View Comments |>


userDan Maynard - Re: Conditional Problems  blueArrow
7/24/2002; 4:38:03 AM (reads: 1933, responses: 0)
I had looked into editing out the button previously. Unfortunately I only want to disable it on a single problem set, not for the whole course or any other courses. Since I'm not sure exactly how the displayMacros gets called, is there a way to disably it for this particular problem set?

Dan

<| Post or View Comments |>


userArnold K. Pizer - Re: Conditional Problems  blueArrow
7/24/2002; 9:32:06 AM (reads: 1921, responses: 0)
Hi Dan,

You raise a good point. Gavin has explained exactly what is happening. I have changed things so that in the new version of WeBWorK you will be able to write refreshLatex2HTML = 1; (in analogy with showPartialCorrectAnswers = 1;) in the .pg code for a problem to force L2H to be run every time to regenerate the HTML page in typeset mode. Since this is a slow process, you would want to use this sparingly if you have a large class or a slow server. If you really want to use this now, you can download from the CVS repository the new versions of Global.pm, PG.pl, and processProblem8.pl (there are only a few new lines of code and several more of related comments and documentation).

My suggestion for now would be to add a line to the first part of the problem telling students that for this problem, they must use formatted-text mode.

Thanks for the idea. Also, you might want to post an example of your conditional problem. Others may be interested in this type of problem.

Arnie

<| Post or View Comments |>