Create Marvin JS Questions That Display an Initial Drawing

For some Marvin JS questions, you might want your students to start with an initial drawing — a template — and change it to answer the question. Sometimes the template constitutes part of your prompt, and sometimes the template helps to focus your students by requiring them only to complete the parts of the drawing that relate to the concept being taught.

Note For questions in which the relative position of each atom is important — resonance structures, reaction mechanisms, hybridization states, chiral centers, and reaction centers — you must display an initial template drawing for your students to modify.

Label some or all of the atoms with mapping numbers whenever the specific identity of each atom is important for grading, for example, for molecules having symmetry or for reaction mechanisms for which a non-equivalent choice exists between starting or ending locations.

  1. Click Questions > Create.
    The Question Editor opens.
  2. In Name, type a name for the question.
  3. In Mode, select Fill-in-the-Blank.
  4. Create your template.
    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.
  5. In Question, add the following code, replacing template with the XML you copied from the Marvin JS Key Generation tool:
    <eqn>
    $mytemplate='template';  

    This code assigns the Marvin JS template to the variable $mytemplate. 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.
  6. Create your answer key.
    Important Always use the same mode to create the template and the answer key. Always start with the template when creating the answer key. If needed, copy the template XML from your question and paste it in the drawing area.
    1. In the Marvin JS Key Generation tool, change the template exactly the way you want your students to do when they answer the question. Do not move the template's atoms.
    2. Click Get Key.
    3. In the text box, select and copy the entire Marvin JS XML.
  7. In Question, add the following code, replacing answer_key with the XML key you copied from the Marvin JS Key Generation tool:
    $mykey='answer_key';
    ''
    </eqn>

    This code assigns the Marvin JS answer key to the variable $mykey. You can use a different variable name if needed.

  8. In Question, type your question.

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

  9. In Answer, type the following items on a single line:
    <EQN $MARVIN='mode'; $MARVIN_START=$mytemplate; $mykey>
    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
    Note
    • If an answer extends beyond the right side of the Answer box, it is wrapped to the next line, but it is still considered a single line so long as you do not press ENTER.
    • You can specify alternative answer keys separated by the characters {tab}. For example:
      <EQN $MARVIN='condensed'; $MARVIN_START=$mytemplate; 
      $mykey1> {tab} <EQN $mykey2>
  10. Optional: Type a Solution.

    The solution helps your students understand the steps they need to take to determine the correct answer to the question. Your assignment settings specify when to show the solution.

  11. Click Test/Preview to test the appearance and behavior of the question. See Test Questions.
  12. Click Redisplay to show certain kinds of errors in the Display section of the Question Editor. Make any needed changes to your question.
  13. Optional: Click Show Additional Information and change the question's sharing permission or add descriptive information.
    • By default, other instructors can use your question only if you provide them with the question ID, and only you can edit the question or find it in search results. To change the permission, see Share Questions With Other Instructors.
    • If you make your question publicly available, you might want to provide descriptive information to help others search for it. See Add Search Metadata to Questions.
  14. When your question displays and functions correctly, click Save.

    WebAssign assigns it a unique question ID (QID), which is displayed in parentheses after the question name.

    You can use your question in an assignment and see it in your My Questions list only after it is saved.

Example Lewis Structure Marvin JS Question

The following table summarizes an actual question.

QID

1534324

Name

Template2 5.MARVIN.02.

Mode

Fill-in-the-Blank

Question

<eqn>
# ----------------------------------------------------------------------------
#    Set $mytemplate to the template created with the key generation tool
# ----------------------------------------------------------------------------
$mytemplate='<?xml version="1.0" encoding="UTF-8"?><cml version="ChemAxon file format v5.10.0, generated by v15.8.9"><MDocument><MChemicalStruct><molecule molID="m1"><atomArray><atom id="a1" elementType="C" x2="-0.38500000000000023" y2="1.1102230246251565e-16"/><atom id="a2" elementType="N" x2="1.1549999999999998" y2="1.1102230246251565e-16"/><atom id="a3" elementType="H" x2="-1.9249999999999998" y2="1.1102230246251565e-16"/><atom id="a4" elementType="H" x2="-0.38500000000000023" y2="1.54"/><atom id="a5" elementType="H" x2="-0.38500000000000023" y2="-1.5399999999999998"/><atom id="a6" elementType="O" x2="1.9249999999999998" y2="1.3330000000000002"/><atom id="a7" elementType="O" x2="1.9249999999999998" y2="-1.3339999999999999"/></atomArray><bondArray><bond atomRefs2="a1 a2" order="1"/><bond atomRefs2="a1 a3" order="1"/><bond atomRefs2="a1 a4" order="1"/><bond atomRefs2="a1 a5" order="1"/><bond atomRefs2="a2 a6" order="2"/><bond atomRefs2="a2 a7" order="1"/></bondArray></molecule></MChemicalStruct></MDocument></cml>';
# ----------------------------------------------------------------------------
#    Set $mykey to the answer key created with the key generation tool
# ----------------------------------------------------------------------------
$mykey='<?xml version="1.0" encoding="UTF-8"?><cml version="ChemAxon file format v5.10.0, generated by v15.8.9"><MDocument><MChemicalStruct><molecule molID="m1"><atomArray><atom id="a1" elementType="C" x2="-0.38500000000000023" y2="1.1102230246251565e-16"/><atom id="a2" elementType="N" x2="1.1549999999999998" y2="1.1102230246251565e-16" formalCharge="1"/><atom id="a3" elementType="H" x2="-1.9249999999999998" y2="1.1102230246251565e-16"/><atom id="a4" elementType="H" x2="-0.38500000000000023" y2="1.54"/><atom id="a5" elementType="H" x2="-0.38500000000000023" y2="-1.5399999999999998"/><atom id="a6" elementType="O" x2="1.9249999999999998" y2="1.3330000000000002" lonePair="2"/><atom id="a7" elementType="O" x2="1.9249999999999998" y2="-1.3339999999999999" formalCharge="-1" lonePair="3"/></atomArray><bondArray><bond atomRefs2="a1 a2" order="1"/><bond atomRefs2="a1 a3" order="1"/><bond atomRefs2="a1 a4" order="1"/><bond atomRefs2="a1 a5" order="1"/><bond atomRefs2="a2 a6" order="2"/><bond atomRefs2="a2 a7" order="1"/></bondArray></molecule></MChemicalStruct><MElectronContainer occupation="0 0" radical="0" id="o1"><MElectron atomRefs="m1.a6" difLoc="0.0 0.0 0.0"/><MElectron atomRefs="m1.a6" difLoc="0.0 0.0 0.0"/></MElectronContainer><MElectronContainer occupation="0 0" radical="0" id="o2"><MElectron atomRefs="m1.a6" difLoc="0.0 0.0 0.0"/><MElectron atomRefs="m1.a6" difLoc="0.0 0.0 0.0"/></MElectronContainer><MElectronContainer occupation="0 0" radical="0" id="o3"><MElectron atomRefs="m1.a7" difLoc="0.0 0.0 0.0"/><MElectron atomRefs="m1.a7" difLoc="0.0 0.0 0.0"/></MElectronContainer><MElectronContainer occupation="0 0" radical="0" id="o4"><MElectron atomRefs="m1.a7" difLoc="0.0 0.0 0.0"/><MElectron atomRefs="m1.a7" difLoc="0.0 0.0 0.0"/></MElectronContainer><MElectronContainer occupation="0 0" radical="0" id="o5"><MElectron atomRefs="m1.a7" difLoc="0.0 0.0 0.0"/><MElectron atomRefs="m1.a7" difLoc="0.0 0.0 0.0"/></MElectronContainer></MDocument></cml>';
''
</eqn>
Complete the following Lewis structure such that it obeys the octet rule. <BR>
(Assign lone pairs, radical electrons, and atomic charges where appropriate.)<BR>
<_>

Answer

<EQN $MARVIN='lewis'; $MARVIN_START=$mytemplate; $mykey>

Display to Students (template)

Question as displayed to students

Display to Students (answered)

Question as displayed to students

Example Resonance Structure Marvin JS Question

The following table summarizes an actual question.

QID

1534333

Name

Template2 5.MARVIN.03.

Mode

Fill-in-the-Blank

Question

<eqn>
# ----------------------------------------------------------------------------
#    Set $mytemplate to the template created with the key generation tool
# ----------------------------------------------------------------------------
$mytemplate='<?xml version="1.0" encoding="UTF-8"?><cml version="ChemAxon file format v5.10.0, generated by v15.8.9"><MDocument><MChemicalStruct><molecule molID="m1"><atomArray><atom id="a1" elementType="O" x2="-0.0004999999999999449" y2="0.38500000000000023" mrvMap="2"/><atom id="a2" elementType="O" x2="-1.3335" y2="-0.3849999999999998" mrvMap="1"/><atom id="a3" elementType="O" x2="1.3335" y2="-0.3849999999999998" mrvMap="3"/></atomArray><bondArray><bond atomRefs2="a1 a2" order="1"/><bond atomRefs2="a1 a3" order="1"/></bondArray></molecule></MChemicalStruct></MDocument></cml>';
# ----------------------------------------------------------------------------
#    Set $mykey to the answer key created with the key generation tool
# ----------------------------------------------------------------------------
$mykey='<?xml version="1.0" encoding="UTF-8"?><cml version="ChemAxon file format v5.10.0, generated by v15.8.9"><MDocument><MChemicalStruct><molecule molID="m1"><atomArray><atom id="a1" elementType="O" x2="-2.8054999999999994" y2="0.3664999999999998" formalCharge="1" mrvMap="2" lonePair="1"/><atom id="a2" elementType="O" x2="-4.1385" y2="-0.4035000000000002" mrvMap="1" lonePair="2"/><atom id="a3" elementType="O" x2="-1.4714999999999998" y2="-0.4035000000000002" formalCharge="-1" mrvMap="3" lonePair="3"/><atom id="a4" elementType="O" x2="2.8045000000000004" y2="0.40349999999999975" formalCharge="1" mrvMap="2" lonePair="1"/><atom id="a5" elementType="O" x2="1.4715000000000003" y2="-0.36650000000000027" formalCharge="-1" mrvMap="1" lonePair="3"/><atom id="a6" elementType="O" x2="4.1385000000000005" y2="-0.36650000000000027" mrvMap="3" lonePair="2"/></atomArray><bondArray><bond atomRefs2="a1 a2" order="2"/><bond atomRefs2="a1 a3" order="1"/><bond atomRefs2="a4 a5" order="1"/><bond atomRefs2="a4 a6" order="2"/></bondArray></molecule></MChemicalStruct><MElectronContainer occupation="0 0" radical="0" id="o1"><MElectron atomRefs="m1.a1" difLoc="0.0 0.0 0.0"/><MElectron atomRefs="m1.a1" difLoc="0.0 0.0 0.0"/></MElectronContainer><MElectronContainer occupation="0 0" radical="0" id="o2"><MElectron atomRefs="m1.a2" difLoc="0.0 0.0 0.0"/><MElectron atomRefs="m1.a2" difLoc="0.0 0.0 0.0"/></MElectronContainer><MElectronContainer occupation="0 0" radical="0" id="o3"><MElectron atomRefs="m1.a2" difLoc="0.0 0.0 0.0"/><MElectron atomRefs="m1.a2" difLoc="0.0 0.0 0.0"/></MElectronContainer><MElectronContainer occupation="0 0" radical="0" id="o4"><MElectron atomRefs="m1.a3" difLoc="0.0 0.0 0.0"/><MElectron atomRefs="m1.a3" difLoc="0.0 0.0 0.0"/></MElectronContainer><MElectronContainer occupation="0 0" radical="0" id="o5"><MElectron atomRefs="m1.a3" difLoc="0.0 0.0 0.0"/><MElectron atomRefs="m1.a3" difLoc="0.0 0.0 0.0"/></MElectronContainer><MElectronContainer occupation="0 0" radical="0" id="o6"><MElectron atomRefs="m1.a3" difLoc="0.0 0.0 0.0"/><MElectron atomRefs="m1.a3" difLoc="0.0 0.0 0.0"/></MElectronContainer><MElectronContainer occupation="0 0" radical="0" id="o7"><MElectron atomRefs="m1.a4" difLoc="0.0 0.0 0.0"/><MElectron atomRefs="m1.a4" difLoc="0.0 0.0 0.0"/></MElectronContainer><MElectronContainer occupation="0 0" radical="0" id="o8"><MElectron atomRefs="m1.a5" difLoc="0.0 0.0 0.0"/><MElectron atomRefs="m1.a5" difLoc="0.0 0.0 0.0"/></MElectronContainer><MElectronContainer occupation="0 0" radical="0" id="o9"><MElectron atomRefs="m1.a5" difLoc="0.0 0.0 0.0"/><MElectron atomRefs="m1.a5" difLoc="0.0 0.0 0.0"/></MElectronContainer><MElectronContainer occupation="0 0" radical="0" id="o10"><MElectron atomRefs="m1.a5" difLoc="0.0 0.0 0.0"/><MElectron atomRefs="m1.a5" difLoc="0.0 0.0 0.0"/></MElectronContainer><MElectronContainer occupation="0 0" radical="0" id="o11"><MElectron atomRefs="m1.a6" difLoc="0.0 0.0 0.0"/><MElectron atomRefs="m1.a6" difLoc="0.0 0.0 0.0"/></MElectronContainer><MElectronContainer occupation="0 0" radical="0" id="o12"><MElectron atomRefs="m1.a6" difLoc="0.0 0.0 0.0"/><MElectron atomRefs="m1.a6" difLoc="0.0 0.0 0.0"/></MElectronContainer></MDocument></cml>';
''
</eqn>
Draw the resonance structures for ozone. (Copy and paste the given template as many times as necessary. Assign lone pairs, radical electrons, and atomic charges where appropriate.)<BR>
<_>

Answer

<EQN $MARVIN='resonance'; $MARVIN_START=$mytemplate; $mykey>

Display to Students (template)

Question as displayed to students

Display to Students (answered)

Question as displayed to students
Tip WebAssign has created tutorial questions to help your students learn to use Marvin JS for specific tasks. Use any of the following tags in your question to add a link to the relevant tutorial:
  • <PRACTICE qid='marvin.micro.tutorial.charges' link='Marvin JS Tutorial' style='none'>
  • <PRACTICE qid='marvin.micro.tutorial.coordinate bonds' link='Marvin JS Tutorial' style='none'>
  • <PRACTICE qid='marvin.micro.tutorial.electron flow' link='Marvin JS Tutorial' style='none'>
  • <PRACTICE qid='marvin.micro.tutorial.functional groups' link='Marvin JS Tutorial' style='none'>
  • <PRACTICE qid='marvin.micro.tutorial.generic groups' link='Marvin JS Tutorial' style='none'>
  • <PRACTICE qid='marvin.micro.tutorial.isotopes' link='Marvin JS Tutorial' style='none'>
  • <PRACTICE qid='marvin.micro.tutorial.lone pairs' link='Marvin JS Tutorial' style='none'>
  • <PRACTICE qid='marvin.micro.tutorial.mapping' link='Marvin JS Tutorial' style='none'>
  • <PRACTICE qid='marvin.micro.tutorial.organometallics' link='Marvin JS Tutorial' style='none'>
  • <PRACTICE qid='marvin.micro.tutorial.radicals' link='Marvin JS Tutorial' style='none'>
  • <PRACTICE qid='marvin.micro.tutorial.wedge bonds' link='Marvin JS Tutorial' style='none'>

For example:

Assign lone pairs where appropriate. <PRACTICE qid='marvin.micro.tutorial.lone pairs' link='Marvin JS Tutorial' style='none'>