Displaying a Maple Plot

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:

  1. From the Question Bank Editor/Select Name and Type screen, select the Use HTML formatting for the question text option.

  2. If your question contains an algorithm, see Algorithmic Designer.

  3. Click Next.

  4. 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:

 

To use multiple libraries, place all libraries in the same directory and specify the path using the libname option.

 

Example Using An Essay Question Type

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>@

 

Example Using A Randomly Generated Variable

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)()");@

 

Example Using the Maple tubeplot Command

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

Maple-graded Question Type - Overview

Maple Tutorial: Maple-based Algorithmic  Question Authoring