WeBWorK Problems

Problems not rendering after upgrade to 2.17

Re: Problems not rendering after upgrade to 2.17

by Glenn Rice -
Number of replies: 8
I don't think this is an issue with the macro. On webwork version 2.17 the macro still works fine.

This looks like a module issue, based on your errors.

What do you get when you run check_modules.pl?
In reply to Glenn Rice

Re: Problems not rendering after upgrade to 2.17

by Glenn Rice -
I just noticed the copyright symbol in your file. That may be the problem considering that Encode is having issues. Change that to © instead, and see if that helps.

By the way, what version of WeBWorK did you upgrade from?
In reply to Glenn Rice

Re: Problems not rendering after upgrade to 2.17

by Lukas Fredriksson -
check_modules.pl says everything is found and loaded.

I included two different problems here, still being randomized using the code we had in my example above. This first one is NOT working:

DOCUMENT();

# Load whatever macros you need for the problem
loadMacros("PGstandard.pl",
           "MathObjects.pl",
           );

## Do NOT show partial correct answers
$showPartialCorrectAnswers = 0;
TEXT(beginproblem());

$A = random(1,9,1);

BEGIN_TEXT

Bestäm derivatan till funktionen \(f(x) = \ln(x^2+${A}) \)
$PAR$PAR

\( f'(x) = \) \{ans_rule(20) \}
$PAR

END_TEXT

$ans = Compute("2*x/(x**2+${A})");
ANS($ans->cmp);

ENDDOCUMENT();





And this second one is working just fine:

DOCUMENT();

# Load whatever macros you need for the problem
loadMacros("PGstandard.pl",
           "MathObjects.pl",
          );

## Do NOT show partial correct answers
$showPartialCorrectAnswers = 0;
TEXT(beginproblem());

$A = random(2,5,1);
$B = random(1,5,1);

BEGIN_TEXT

Bestäm derivatan till funktionen \(f(x) = \sin(${A} x-${B}) \)
$PAR$PAR

\( f'(x) = \) \{ans_rule(20) \}
$PAR

END_TEXT

$ans = Compute("${A}*cos(${A}*x-${B})");
ANS($ans->cmp);

ENDDOCUMENT();
In reply to Lukas Fredriksson

Re: Problems not rendering after upgrade to 2.17

by Glenn Rice -

Both problems seems to work fine for me.  Even if included via includeRandomProblem of unionInclude.pg.

I don't think it is the problems or the macro.  Except possible the copyright symbol.  Does one of those have the copyright symbol in the top part of the file and the other not?  Your first post included the following

# Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net
If not there is something else going on with your setup here.
In reply to Glenn Rice

Re: Problems not rendering after upgrade to 2.17

by Lukas Fredriksson -
Yes they both include the copyright symbol. I upgraded from 2.15 to 2.17, doing all the steps in the guide to upgrade from 2.15 to 2.16 as well.
The only issue encountered during our upgrade was that webwork complained about TikZImage.pg not being found, so I downloaded it from 2.16. We don't use TikZ though.
In reply to Lukas Fredriksson

Re: Problems not rendering after upgrade to 2.17

by Glenn Rice -

Did you try changing that copyright symbol to © to see if that helps anyway?  I would be surprised if it didn't cause an issue.

In reply to Glenn Rice

Re: Problems not rendering after upgrade to 2.17

by Lukas Fredriksson -
So I did some testing, both writing the problem directly without randomizing and copying one of the working files and changing the text so that it matched one of the non-working. Both of these methods worked.

That made me think that there had to be some problem with the encoding, and sure enough the problems that didn't work had CRLF line terminators while the working problems didn't.

So after changing encoding to just UTF-8 Unicode text the other problems also work!

Have to try this on our production server as well but it seems like this solves the issue.

Thank you for all the help!
In reply to Lukas Fredriksson

Re: Problems not rendering after upgrade to 2.17

by Lukas Fredriksson -
This problem with the line endings, is this a common issue as well? Should this even be an issue or could there be something else broken with my installation?
In reply to Lukas Fredriksson

Re: Problems not rendering after upgrade to 2.17

by Glenn Rice -
This shouldn't be an issue. Files that have CRLF line terminators should work just as well as those that don't. I tested a file with the old Dos style CRLF line endings on my production webwork 2.17 server, and the file worked fine with no warnings or errors.

Although, it seems something has changed on the develop branch and files with such line terminators are not working. I will probably need to fix that.

In any case, it is probably time that you convert those files to proper unix style line endings. Eventually, we are going to stop trying to support such stupid line endings. The only operating system in the world that has ever worked with CRLF's is Microsoft Windows, and even Microsoft is finally fixing that. It should be pretty easy to find a tool to do this. On linux you can use the command line utility dos2unix (available on Ubuntu in the dos2unix package).