Forum archive 2000-2006

Andrew - Macro Issues.

Andrew - Macro Issues.

by Arnold Pizer -
Number of replies: 0
inactiveTopicMacro Issues. topic started 5/26/2004; 3:09:43 PM
last post 6/2/2004; 12:54:16 PM
userAndrew - Macro Issues.  blueArrow
5/26/2004; 3:09:43 PM (reads: 1583, responses: 9)
Hey all,
I've successfully installed WebWork2, and a problem library. An issue we've run into is that certain macros don't work right. Does anyone have a solution? (below is the output from one of the broken pages)

	Error messages

 

	
Undefined subroutine &main::init_graph called at (eval 128) line 45.

 

	Error context

 

	

        Problem1
ERROR caught by Translator while processing problem file:Library/maCalcDB/setAlgebra16FunctionGraphs/jj1.pg
*
Undefined subroutine &main::init_graph called at (eval 128) line 45.
*
------Input Read
1		##DESCRIPTION
2		##   Evaluation of a simple algebraic expression
3		##ENDDESCRIPTION
4		
5		##KEYWORDS('percent')
6		## tcao tagged and PAID on 2-20-2004
7		
8		## DBchapter('Functions')
9		## DBsection('Average Rate of Change: Increasing and Decreasing Functions')
10		## Date('6/3/2002')
11		## Author('Tangan Gao')
12		## Institution('csulb')
13		## TitleText1('College Algebra')
14		## EditionText1('3')
15		## AuthorText1('Stewart, Redlin, Watson')
16		## Section1('4.4')
17		## Problem1('24')
18		
19		#
20		# First comes some stuff that appears at the beginning of every problem
21		#
22		
23		DOCUMENT();        # This should be the first executable line in the problem.
24		
25		loadMacros(
26		PG.pl,
27		PGbasicmacros.pl,
28		PGchoicemacros.pl,
29		PGanswermacros.pl,
30		PGauxiliaryFunctions.pl,
31		PGgraphmacros.pl,
32		extraAnswerEvaluators.pl
33		);
34		
35		TEXT(&beginproblem);
36		
37		$a = random(-7,-1);
38		$b = random(1,7);
39		$c = random(1, 3.5, 0.01);
40		$up = random(-2,2,0.01);
41		
42		($x1dom, $y1dom, $x2dom, $y2dom) = (10,10, 10, 10);
43		($xgrid, $ygrid) = ($x1dom+$x2dom,$y1dom+$y2dom);
44		
45		$graph = init_graph(-$x1dom,-$y1dom,$x2dom,$y2dom,
46		   'axes'=>[0,0],
47		   'grid'=>[$xgrid,$ygrid],
48		   'size'=>[400,400]);
49		
50		$f = FEQ("$c*(((2*(x-$a)/($b-$a)-1))**3 - 3*((2*(x-$a)/($b-$a)-1))) for x in <-$x1dom,$x2dom> using color:blue and weight:2");
51		($fref) = plot_functions( $graph, $f);
52		
53		
54		# Label some points
55		#$label1 = new Label(0,$a, "$a",'black','right');
56		#$label2 = new Label($period, 0, "($period,0)",'black','left');
57		#$d = -$a;
58		#$label3 = new Label(0,$d,"$d",'black','right');
59		#$graph->lb($label1, $label2, $label3);
60		
61		
62		
63		
64		BEGIN_TEXT
65		Consider the function shown in the following graph.
66		$BR
67		{ image(insertGraph($graph), width=>203, height=>178) } $BR
68		Where is the function decreasing?
69		$BR
70		{ans_rule(40)}
71		$BR $BBOLD Note: $EBOLD use interval notation to enter your answer.
72		END_TEXT
73		
74		ANS(interval_cmp("($a,$b)", sloppy=>'yes'));
75		
76		ENDDOCUMENT();        # This should be the last executable line in the problem.


<| Post or View Comments |>


userJohn Jones - Re: Macro Issues.  blueArrow
5/27/2004; 12:12:05 AM (reads: 1765, responses: 0)
I have no answers, only questions:
  • Do you only have trouble on problems with on-the-fly-graphs?  Other graphs?  Ones with no graphs?
  • Have you gotten a fresh copy of the pg tree, and set pg root accordingly?
  • Have you updated global.conf.dist, and then updated global.conf to match?  There were lots of changes in the past week.
John

<| Post or View Comments |>


userAndrew - Re: Macro Issues.  blueArrow
5/27/2004; 10:48:43 AM (reads: 1780, responses: 0)
John-

  • No Graphs are displayed. Other functions such as NchooseK and inverse trig functions dont work as well (atan comes to mind)
  • I'm using the PG that came with previewRelease4, I'm unsure as to where the PG root needs to be set, global.conf says that $pgRoot is made available to it, implying that $pgRoot is set elsewhere. However, grep'ing the webwork folder doesn't show that assignment taking place elsewhere.
  • We havn't updated our installation via CVS since we had to go through and remove be_strict from many files because of an error that's been talked about elsewhere. I will look at the new global.conf.dist and see what's up though
Andrew


<| Post or View Comments |>


userMichael Gage - Re: Macro Issues.  blueArrow
5/27/2004; 11:01:18 AM (reads: 1776, responses: 0)
Hi

PGroot is set (along with webwork root) in the httpd.conf file (the apache config file)

These two directories are passed to the apache server so that mod_perl knows where to find everything else.

It's a good bet that your copy is not correctly loading the files PGchoicemacros.pl and PGgraphmacros.pl and that that is causing the errors. I would have expected that there would be warnings in the log file that indicated that those files could not be read. If not, you can report that as a bug. There should be some warning if the file is not loaded properly.

The be_stict problem was fixed this last weekend (at least it now works on perl 5.8.3) It involved a modification in the definition of PG_restricted_eval().

While it might be a bit of trouble initially I'd recommend updating the pg library to the latest version (unless you made substantial modifications besides the be_strict one) and probably the webwork-modperl library unless you made a great many modifications in that. Save your current versions just in case -- we don't have much experience with apache2 and I wouldn't want you to loose the changes you've made to get WeBWorK to work with apache2.

There were a lot of patches and bugs corrected over this last weekend.

-- Mike

<| Post or View Comments |>


userAndrew - Re: Macro Issues.  blueArrow
5/27/2004; 11:44:52 AM (reads: 1776, responses: 0)
Mike--

I'll update both the webwork-modpel and pg libraries and see how it goes.
Update-
For some reason, the CVS version of webwork2/pg fails to work, I"m left with the error:
ERROR in defining MODES: current display mode 'HTML_dpng' not found. available modes:
For all pages that use the pg libraries. looking in pg/macros/displayMacros.pl, I see a reference to $Global::available_mode_list, however greping the source yields no other mention to available_mode_list. Any suggestions?

Additionally, we've reverted back to apache 1.3 for the moment. After talking to the instructor, his priority is to get webwork running(and begin adding to the problem library). If there's time at the end of the summer, we may go back and retry with apache2. The stopping point for us was the fact that mod_perl2 doesn't properly support Apache::Cookie. I had tried to convert to CGI::Cookie, but a number of issues came up with that, and we decided to put it off untill later. Hopefully when the time comes for me to jump back on the apache2 server, mod_perl2 will be a bit more complete and the process won't be as painful.

--Andrew

<| Post or View Comments |>


userJohn Jones - Re: Macro Issues.  blueArrow
5/27/2004; 12:59:19 PM (reads: 1763, responses: 0)
Hi,

The available_mode_list appears in displayMacros, but only in a function which should not be called by webwork 2.  (In the cvs version, there is now an analogue for webwork2 of availableModeList defined in global.conf.dist, but I don't think that is the problem).

It sounds like your customization has been to get things to work.  If that's the case, I would start with a fresh set of both libraries.

John

<| Post or View Comments |>


userAndrew - Re: Macro Issues.  blueArrow
5/27/2004; 2:38:34 PM (reads: 1773, responses: 0)
Hey-

Starting with a fresh install fixes those errors(I hadn't updated global.conf with the new options from global.conf.dist). However, after adding the admin course as per the instructions, I am left with this error when trying to access it:
Can't locate WeBWorK/DB/Record/ProblemLibraryClassify.pm

Looking in the CVS, that file was removed on sunday. Should I manually download it?

Andrew

<| Post or View Comments |>


userMichael Gage - Re: Macro Issues.  blueArrow
5/27/2004; 2:41:24 PM (reads: 1777, responses: 0)
If I remember right this file is no longer needed. Make sure your global.conf and database.conf files are up to date. I think that will prevent this file from being called.

The functionality in that file has been moved elsewhere, at least for now.

Take care,

Mike

<| Post or View Comments |>


userJohn Jones - Re: Macro Issues.  blueArrow
5/27/2004; 5:09:51 PM (reads: 1765, responses: 1)
This error is definitely triggered by entries in database.conf which have since been removed from database.conf.dist.

John

<| Post or View Comments |>


userAndrew - Re: Macro Issues.  blueArrow
6/2/2004; 12:54:16 PM (reads: 1936, responses: 0)
I fixed it. I neglected to copy the new database.conf.dist, it works great now, outside of a few glitches.

<| Post or View Comments |>