PREP 2015 Question Authoring - Archived

Sage cell server problems

Sage cell server problems

by Gary Church -
Number of replies: 0
Hello,

I've been trying to get the sage cell server example on the wiki to work on my schools WebWork server but am having a small problem. Everything seems fine except it won't let me enter in any text in the sage cell field; I try clicking the field and nothing happens.

For your reference, here's the code:

DOCUMENT();
loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"sage.pl",
);
###############################################
##
##  pg initializations and regular WeBWorK code

$a = random(2,5,1);

$ansList = List("(-cos(pi*$a)/$a + 1/$a)");
$SageCode = <<SAGE_CODE;

Area = integrate(sin($a*x),x,0,pi)

record_answer((Area))    # leave out if you return no answer

SAGE_CODE
Sage(
    SageCode=>$SageCode,
);
## Lower WeBWorK text
##
## Problem display following the Sage cell
##

Context()->texStrings;

BEGIN_TEXT
Determine the definite integral of 
\( \sin(${a}x) \) from \(a=0\) to \(b=\pi\).

END_TEXT

Context()->normalStrings;

# Answer Evaluation

$showPartialCorrectAnswers = 1;
NAMED_ANS( sageAnswer => $ansList->cmp );   # Leave out if no Sage answer.


ENDDOCUMENT();

Below is a link to a screenshot of the problem in action