Graph a Function with WAPlot

Plot a simple non-asymptotic function using Mathematica®.
graph with slope 1/2 and y intercept -1

This type of Mathematica graph is primarily used to plot lines, curves, and basic functions with or without asymptotes.
  1. Click Questions > Create.
    The Question Editor opens.
  2. In Name, type a name for the question.
  3. In Mode, select one of the question modes to define the basic behaviors for your question.
  4. In Question, type your question.

    Use the answer placeholder string <_> to specify where the answer box should be displayed.

  5. In Answer, specify the answer key for your question. Often, you will specify distractors or options configuring your question's behavior.
  6. Add WAPlot tags to the question, answer, or solution field of a question.
    If a WAPlot image is used in the answer field, the question mode must be multiple-choice, and there cannot be linebreaks in the WAPlot code. WAPlot images cannot be placed in assignment descriptions.
    <waplot type='MathematicaSyntax'> </waplot>
  7. Insert the Mathematica code for your function inside the WAPlot tags.
    More options are available on the Mathematica site. Because WebAssign uses version 7 of Mathematica, not everything on the Mathematica site is available for use in WebAssign.
    <waplot type='MathematicaSyntax'> 
        Plot[
            x/2 - 1, 
            {x, -10,10}, 
            PlotRange->{{-10,10}, {-10,10}}, 
            AxesLabel->{x, y}, 
            AspectRatio->1, 
            PlotStyle->Directive[Blue, Thick]
        ]
    </waplot>
    Do not include "y =" before your expression. All expressions are assumed to be of the form "y =" and adding this will cause the solution to your function to be displayed as the y-axis label.
  8. In the <waplot> tag, use the @alt attribute to add alternative text describing the image for students using screen readers.
    <waplot type='MathematicaSyntax' alt='graph with slope 1/2 and y intercept -1'>
    Make sure the content of the alternative text is appropriate to the pedagogy of your question.

Graphing a Function

The following table summarizes an actual question.

QID

3969548

Name

Template2 6.WAPLOT.01.

Mode

Multiple-Choice

Question


Is the graph below a direct variation?
<figure>
    <waplot type='MathematicaSyntax' alt='graph with slope 1/2 and y intercept -1'>
        Plot[
            x/2 - 1, 
            {x, -10,10}, 
            PlotRange->{{-10,10}, {-10,10}}, 
            AxesLabel->{x, y}, 
            AspectRatio->1, 
            PlotStyle->Directive[Blue, Thick]
        ]
    </waplot>
</figure>
<_>

Answer

<EQN $ORDERED=2;''>Yes
No

Display to Students

Question as displayed to students

Graphing a Randomized Function

The following table summarizes an actual question.

QID

3969543

Name

Template2 6.WAPLOT.02.

Mode

Multiple-Choice

Question


<eqn>
# $m represents the denominator for the slope
$m = randnum(2,5,1);

# (-$b) represents the y-intercept
$b = randnum(1,5,1);
 ''</eqn>

Is the graph below a direct variation?
<figure>
    <waplot type='MathematicaSyntax' alt='graph with slope 1/$m and y intercept -$b'>
        Plot[
            x/$m - $b, 
            {x, -10,10}, 
            PlotRange->{{-10,10}, {-10,10}}, 
            AxesLabel->{x, y}, 
            AspectRatio->1, 
            PlotStyle->Directive[Blue, Thick]
        ]
    </waplot>
</figure>
<_>

Answer

<EQN $ORDERED=2;''>Yes
No

Display to Students

Question as displayed to students