Placing an image in a question

Setting the image base

If graphics files will be incorporated into some of the questions in your question bank, then a path must be provided to the location of the folder in your EDU class web site where the graphics files will eventually reside. This is the purpose of the \setImageBase macro.

It is a good idea to set up a separate image location for each testbank that you create. For example, if your EDU classname were calculus205, and you planned to place your graphics files in the chapter1 folder of your EDU class web site, then you would use

\setImageBase{../classes/calculus205/chapter1/}

The final slash is optional.

The \image macro

This is the preferred method for including graphics in a question. During preview processing—that is, running LaTeX locally on your file to preview its contents—if the file is available locally as an Encapsulated Postscript (eps or epsf) file, then it will be included in the dvi file (\image will call \epsfig to include the graphic).

Warning: Do not explicitly call \epsfig. Directly using \epsfig will not guarantee that proper EDU code results. The same holds for \includegraphics.

Here are the necessary steps to follow to place an image:

  1. Use the \setImageBase macro to define the path to your images.
  2. Include graphics in a question using the \image macro.
    \image[ext]{filename}
    
    ext option
    The extension to be appended to the filename (the second argument) when the testbank is converted to EDU format. If the second argument is a full filename with extension, the first argument is ignored.
    filename
    The filename of the graphic.

Notes