Forums

Search results: 135

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

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

by Dick Lane -
Vicki --- I'm especially interested that two projects (... for stat I, Tutorials ...) designed their work with explicit reference to a learning model (Fading, backwards or forwards).  Perhaps recent work (both at WPI and the Rochester code camp) on macros for compound problems together with simplified ways to provide custom feedback will let us inch into providing a smidgen more tutorial help.

ASSISTments is one of several open-source projects with ideas that I hope we can adapt.  [I'm drafting a separate posting about that.]

WeBWorK Main Forum -> Bleeding Edge WeBWorK

by Michael Gage -
A quick look at one thing that was accomplished at WeBWorK::Rochester::2012 code camp. Compound Problems

A collection of sample homework sets (thanks Dick Lane, Arnie Pizer David Cervone, Barbara Margulius and all others who contributed to the sets).

A more complete view of changes to the instructor interface can be obtained by logging in to https://hosted2.webwork.rochester.edu/webwork2/maa102 using profa as login and profa as password.


Let me add my 5 cents to the discussion:

1. The coding style that Davide Cervone made popular using MathObjects with the sections:  Setup, Text, Answers and Solution  make it possible in a well written problem to change a few parameters in the Setup section and presto a new problem.  It's why I have adopted that style.  Originally, particularly in multi-step problems, I mixed the four parts together which made it more organic to write, but much less easy to maintain.

2. Everyone interested in simplifying input (and retaining good flexibility) should look through all of the PGML examples on Davide Cervone's course.
Other places to learn about PGML are PGML sample problem and PGML Lab.

3. This paper about work at Worcester PolyTech Institute just came to my attention.  It looks pretty similar to the kind of form input you were thinking about. Facilitating WeBWorK problem authoring.   (There are a few more student projects on WeBWorK coming from WPI which are listed in the reference database. Way to go guys!!)

4. Adding a form front end is certainly doable, and it's not the first time it's come up.  Given a script that translates a webform into a PG problem it wouldn't be hard to plug it in as an additional editor. As a proof of concept construct a stand alone form that returns the text of a PG problem -- one could cut and paste that text into the standard PG editor window for testing purposes -- and once it's ready we can figure out how to automatically and transparently transfer the text from the form to the editor window.

5. For the current state of the art take a look at the work accomplished at WeBWorK::Rochester -- note the various versions of the classlist page, problem editors as well as the compound problem. (It looks good on an ipad too!!) BleedingEdge WeBWorK (use login/password   profa/profa to get in ). 

WeBWorK Problems -> CompoundProblem.pl limited attempts

by Chris Donnelly -
I am using the compoundproblem package and I was curious if there was a way to remove the use of the submit button after a certain number of attempts. I can come up with a version of the package that counts attempts per part I just can't seem to figure out how to get students to stop once they hit the max number of tries in that part. can someone help please?

Installation -> Problems not showing up after upgrade

by Robin Cruz -
Hi, All,
I am trying to get an installation from the Vanilla LiveDVD (WW 2.4 on Ubuntu 10.04) working on a virtual machine. I believe it was working until I upgraded Ubuntu last week--which broke it big time. I've gone through the Installation manual for 2.4, the Upgrading WeBWorK manual and the Release Notes for 2.4 and have if running again, but there are a few problems I cannot figure out. I backed the webwork2 and pg folders back to the trunk version with SVN.

1) The problems will not display and the "map" at the top of the problem page is "odd". It is not displaying the text correctly. It looks like this when I select a problem to work:

webwork > test1 > algebra_01_01_algebraicexpressions > 1 Logged in as rcruz.
Log Out
Algebra 01 01 AlgebraicExpressions: Problem 1
This set is visible to students.
This set is visible to students.

I think first line of text shown above used to have upper case letters???

2) It will generate a hardcopy of a set, but I get a message box with:
/tmp/70YC2nSR.pdf.part could not be saved, because the source file could not be read.
However, it generates the hardcopy. I can open it from the Hardcopy folder and the problems show up just fine in the PDF.

3) I tried to see if the problems would show up in the LibraryBrowser and they show up fine if you use the "From This Course" button. But, if I click the "Try it" option, the same thing happens as in 1) . If I try to see the problems from the "Set Definition Files" button I get the following error:

WeBWorK error

An error occured while processing your request. For help, please send mail to this site's webmaster (webmaster@localhost), including all of the following information as well as what what you were doing when the error occured.

Mon Aug 29 00:17:17 2011

Warning messages

Error messages

/opt/webwork/Problems/MAT105_Templates//MAT105_Templates is a recursive symbolic link at /usr/share/perl/5.10/File/Find.pm line 557.

Call stack

The information below can help locate the source of the problem.

  • in File::Find::Follow_SymLink called at line 1179 of /usr/share/perl/5.10/File/Find.pm
  • in File::Find::_find_dir_symlnk called at line 710 of /usr/share/perl/5.10/File/Find.pm
  • in File::Find::_find_opt called at line 1297 of /usr/share/perl/5.10/File/Find.pm
  • in File::Find::find called at line 170 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm
  • in WeBWorK::ContentGenerator::Instructor::SetMaker::get_set_defs called at line 704 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm
  • in WeBWorK::ContentGenerator::Instructor::SetMaker::browse_setdef_panel called at line 799 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm
  • in WeBWorK::ContentGenerator::Instructor::SetMaker::make_top_row called at line 1374 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm
  • in WeBWorK::ContentGenerator::Instructor::SetMaker::body called at line 152 of /opt/webwork/webwork2/lib/WeBWorK/Template.pm
  • in WeBWorK::Template::template called at line 494 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm
  • in WeBWorK::ContentGenerator::content called at line 198 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm
  • in WeBWorK::ContentGenerator::go called at line 370 of /opt/webwork/webwork2/lib/WeBWorK.pm

Request information

Add problems to Target Set: Select a Set from this Course Algebra_01_01_AlgebraicExpressions Algebra_01_02_OperationsWithRealNumbers Algebra_01_03_GraphingFunctions Algebra_01_04_SolveLinearEq Algebra_01_05_ProblemSolvingAndFormulas Algebra_01_06_Exponents Algebra_01_07_ScientificNotation Algebra_02_01_IntroFunctions Algebra_02_02_GraphsOfFunctions Algebra_02_03_AlgebraOfFunctions Algebra_02_04_LinearFunctionsAndSlope Algebra_02_05_PointSlopeFormofLine Algebra_03_01_SystemOfLinearEq Algebra_03_02_ProblemSolvingBusinessApp Algebra_04_01_LinearInequalities Algebra_04_02_CompoundInequ Algebra_04_03_AbsoluteValue Algebra_05_01_IntroPolynomials Algebra_05_02_MultiplyPolynomials Algebra_05_03_FactoringByGrouping Algebra_05_04_FactoringTrinomials Algebra_05_05_FactoringSpecialForms Algebra_05_06_Factoring Algebra_05_07_PolyEqAndApplications Algebra_06_01_MultDivRationalExpressions Algebra_06_02_AddSubRationalExpressions Algebra_06_06_RationalEquations TEST_PROBLEMS


Browse
or Problems from
Method POST
URI /webwork2/test1/instructor/setmaker/
HTTP Headers
Keep-Alive 115
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
User-Agent Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110628 Ubuntu/10.04 (lucid) Firefox/3.6.18
Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Connection keep-alive
Referer https://docralphv.collegeofidaho.edu/webwork2/test1/instructor/setmaker/
Content-Length 20762
Accept-Encoding gzip,deflate
Content-Type multipart/form-data; boundary=---------------------------180332438216272680691322632690
Cookie __utma=33027372.845525900.1247692761.1314560451.1314596257.385; __utmz=33027372.1311555009.343.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); __utmc=33027372; jsMath=font%3Asymbol%2Cwarn%3A0
Accept-Language en-us,en;q=0.5
Host docralphv.collegeofidaho.edu

Here is some more info: I currently have
Ubuntu 10.04.3 LTS
Perl v5.10.1
Apache2 2.2.14 (Ubuntu)
Mysql 5.1.41-3unbuntu12,10
Note, that I set this up with Option A and C.

Help! Classes start this Friday -- rac

ps I'm attaching a copy of that I have in the global.conf file
After lots of naive tries at an answer checker to handle student responses of different types, I realized that this task might be better handled before sending a student response to a single ANS command.


Problem setup:  3 points given
Task: enter a normal to plane they determine or NONE if they are collinear
student response to process: vector or string

current solution: (with $normal equal to cross product of suitable vectors and $abNorm being its norm)
  if  ($abNorm == 0)  {
ANS( List('NONE') -> cmp() ;
$msg = 'comment about collinear points' ;
  }  else  {
ANS( $normal -> cmp( parallel => 1 ) ) ;
$msg = 'scalar multiples are also correct' ;
  }
Note: both of those ANS modes seem relatively quiet about chiding a student for entering the wrong type of info.
    Late insight: this provides a method for having a relevant $msg within my SOLUTION.


failed attempts at a custom checker (with $ab being cross product of PQ and PR vectors)
[the first presumes a "lazy evaluation" of compound clauses]
ANS( $ab -> cmp( checker => sub {
        my ( $correct , $student , $ansHash ) = @_ ;
        return ( ( (norm($correct) == 0) && ($student == "NONE") )
                ||      ( $correct -> isParallel( $student ) ) ) ;
        } ,
 showCoordinateHints => 0 )
) ;

ANS( $ab -> cmp( parallel => 1 , checker => sub {
        my ( $correct , $student , $ansHash ) = @_ ;
        return $student == "none" if (norm($correct) == 0) ;
        return  ($correct == $student) ;
        } ,
 showCoordinateHints => 0 )
) ;

WeBWorK Problems -> compoundProblem in 2.4.9

by Ted Shifrin -
I wrote a number of problems using compoundProblem.pg. It's a bit clunky (especially when students have to re-enter their answers to early parts if they leave and come back), but now that I try it in 2.4.9 it seems to be inputting the answers to Part 1 as the first answers to the blanks in Part 2. Not only does this count as an extra try, but it's disconcerting for the student to start off Part 2 seeing a bunch of automatically entered wrong answers. Any idea what's going on?
Eric:

I have updated the contextReaction.pl file to allow subscripts on compounds as well as elements. (But not on molecules; should that be allowed, too? I.e., do you want (O_2)_3?)

I'm not currently set up to update the SVN repository, so I'm attaching the updated file here. I corrected the problem with Pb as well. Thanks for the catch.

Mike, perhaps you can update the SVN version? Thanks.

Davide