EDU uses Maple plotting features to display plots. Maple provides many ways of representing data and mathematical expressions graphically using plots. You can display a plot with any question type.
To display a plot with a question:
From the Question Bank Editor/Select Name and Type screen, select the Use HTML formatting for the question text option.
If your question contains an algorithm, see Algorithmic Designer.
Click Next.
In the text field for the particular question type, enter the HTML script for plotting questions, for example:
<script>drawMaplePlot("maplecode",width,height,"libname");</script>
<script>drawMaplePlot("plot(sin(x), x=0..10)",400,400);</script>
The script requires the following syntax:
<script> and </script> tags
drawMaplePlot command
Expression enclosed in quotation marks and parentheses
Closing semicolon
width (optional) - specifies plot width
height (optional) - specifies plot height
libname (optional) - specifies path to Maple libraries
To use multiple libraries, place all libraries in the same directory and specify the path using the libname option.
The following is the source file for an Essay question type that displays a plot.
mode=Essay@
editing=useHTML@
question=Discuss the following wave.
<script>drawMaplePlot("plot(sin(x),x=0..10)");</script>@
The following is the source file for a Maple-graded Formula question type that displays a plot.
question= Here is a graph.
<script>drawMaplePlot("plot(x^$n,x=-2..2)");</script>@
maple=@
type=formula@
mode=Maple@
name=Diplaying a Plot@
editing=useHTML@
algorithm=$n=maple("randomize():rand(0..10)()");@
The following is the source file for a True-False question type that displays a tube plot.
Note: You must use the long form name for Maple package functions
mode=True False@
name=tube plot@
editing=useHTML@
question=This displays a tube plot using the Maple long form name for the plots package.
<script>drawMaplePlot("plots[tubeplot]( [t*cos(3*Pi*t), t*sin(3*Pi*t), t], t=0..4, radius=.05, numpoints=70 )");</script>@
answer=1@
choice.1=True@
choice.2=False@
Important: You must test your plot code prior to publishing assignments. EDU does not display error messages if the plot does not work correctly.
See Also:
Maple-graded questions in the Question Bank Editor