# Display Chemical Structures in Questions with Marvin JS

For some questions, you might want your students to interpret drawings of chemical structures or reactions. You can display these using Marvin JS in the question, the answer (for question modes like multiple-choice), or the solution.

1. Open your question in the Question Editor.
2. Create your drawing.
1. Click Marvin under Page Tools.
2. For Marvin Type, select the drawing mode to use.
Important Always draw your chemical structure using the same mode you want to use in your question. See Marvin JS Drawing Modes.
3. Draw the chemical structure or reaction.
4. Click Get Key.
5. In the text box, select and copy the entire Marvin JS XML.
3. In Question, add the following code, replacing drawing_string with the XML you copied from the Marvin JS Key Generation tool:
<eqn>
$mysketch='drawing_string'; '' </eqn>  This code assigns the Marvin JS XML to the variable $mysketch. You can use a different variable name if needed.

Note
• Always enclose the Marvin JS XML in single quotes ('), not double quotes (").
• Do not paste Marvin JS XML directly in Answer. Instead, assign it to a variable and reference the variable as described in this topic.
• Question, Answer, and Solution each have a 65,536 character limit. Any characters beyond that limit are not saved. Depending on the size and complexity of your Marvin JS XML, your question might exceed this limit without warning.
4. In Question, Answer, or Solution, add the following code where you want the drawing to be displayed:
<MARVIN type='mode' size='widthxheight'><EQN $mysketch></MARVIN> • mode is one of the following values and corresponds with the mode you used to create the drawing: complete condensed lewis mechanism mechanism_adv reaction reaction_adv resonance skeleton skeleton_adv spacefill 3D • widthxheight is an optional string specifying the width and height of the drawing in pixels — for example, 400x300. The default size is 200x200 pixels. Note • Always use <EQN> — not <eqn> — inside the <MARVIN> tag. • Question, Answer, and Solution each have a 65,536 character limit. Any characters beyond that limit are not saved. Depending on the size and complexity of your Marvin JS XML, your question might exceed this limit without warning. ## Example Displaying Marvin JS Drawing in Question The following table summarizes an actual question.  QID 1534327 Template2 5.MARVIN.04. Multiple-Choice  # ----------------------------------------------- # Set$mysketch to the drawing string created # with the MarvinSketch Key Generation tool # ----------------------------------------------- $mysketch=''; '' Identify the molecule. <_>  salicyclic acid caffeine ethanol benzoic acid hydrochloric acid ## Example Displaying a 3D Marvin JS Drawing The following table summarizes an actual question.  QID 1534323 Template2 5.MARVIN.05. Multiple-Choice  # ----------------------------------------------- # Set$mysketch to the drawing string created # with the MarvinSketch Key Generation tool # ----------------------------------------------- \$mysketch=''; '' Identify the nucleobase.
<_>
 cytosine guanine adenine thymine