WebAssign Creating Questions Guide November 2014

Transcription

WebAssign Creating Questions Guide November 2014
WebAssign
Creating Questions Guide
November 2014
WebAssign Creating Questions Guide is published by Advanced Instructional Systems, Inc.
©
2014 by Advanced Instructional Systems, Inc. All rights reserved.
Printed in the United States of America.
11.5.2014
®
WebAssign
is a registered trademark of Advanced Instructional Systems, Inc.
®
®
®
®
®
pencilPad , chemPad , calcPad , physPad , and Personal Study Plan are registered trademarks of Advanced Instructional
®
™
Systems, Inc. (dba WebAssign ). NumberLine is a service mark of Advanced Instructional Systems, Inc.
®
®
®
®
®
Adobe , Acrobat , Acrobat Reader , Flash , and Shockwave
United States, other countries, or both.
®
®
®
®
Apple , iPad , Mac , and Safari
are registered trademarks of Adobe Systems Incorporated in the
are registered trademarks of Apple Inc., in the United States, other countries, or both.
®
™
Google is a registered trademark of Google Inc. in the United States, other countries, or both. Chrome
Inc. in the United States, other countries, or both.
®
®
®
®
Internet Explorer , Microsoft , PowerPoint , and Windows
other countries, or both.
™
Java
Linux
is a trademark of Google
are registered trademarks of Microsoft Corporation in the United States,
is a trademark of Sun Microsystems, Inc. in the United States, other countries, or both.
®
is the registered trademark of Linus Torvalds in the United States, other countries, or both.
®
Mathematica
®
Mozilla
is a registered trademark of Wolfram Research, Inc. in the United States, other countries, or both.
and Firefox
®
are registered trademarks of the Mozilla Foundation in the United States, other countries, or both.
Other product and company names mentioned herein may be the trademarks of their respective owners.
Under the copyright laws, neither this documentation nor the software may be copied, in whole or in part, without the written
consent of Advanced Instructional Systems, except in the normal use of the software.
Questions in the database that are identified with a specific textbook have been used with the permission of the publisher who owns
the copyright.
Order the WebAssign service from:
WebAssign
NC State Centennial Campus
1791 Varsity Drive, Suite 200
Raleigh, NC 27606
Web: http://webassign.net
Tel: (800) 955-8275 or (919) 829-8181
Fax: (919) 829-1516
Email: info@webassign.net
Contents i
Contents
Document Conventions..........................................................................vii
1 Get Started Creating Questions in WebAssign®................................... 1
Search for Questions.......................................................................................... 2
WebAssign® Question Modes............................................................................... 5
Question Templates............................................................................................ 6
Create Questions by Duplication.......................................................................... 6
Create Questions with the Question Editor............................................................ 7
Delete Parts of Single-Mode Questions................................................................11
Test Questions................................................................................................. 18
Share Questions With Other Instructors.............................................................. 19
2 Create General-Purpose Questions.....................................................21
Create Multiple-Choice Questions....................................................................... 22
Display Choices in a Fixed Order................................................................... 23
Display Choices as a Drop-down Menu........................................................... 24
Display Choices Horizontally or in Tables.........................................................25
Create True/False Questions.............................................................................. 27
Create Yes/No Questions................................................................................... 28
Create Multiple-Select Questions........................................................................ 30
Display Multiple-Select Choices in a Fixed Order.............................................. 32
Display Multiple-Select Choices Horizontally or in Tables................................... 33
Create Matching Questions................................................................................ 34
Match Formatted Notation or Images............................................................. 36
Display Matching Items in a Fixed Order.........................................................37
Create Ranking Questions................................................................................. 39
Create Fill-in-the-Blank Questions...................................................................... 42
Create File Upload Questions............................................................................. 44
Create PencilPad (Drawing) Questions.................................................................46
Create Free Response Questions........................................................................ 50
Create Image Map Questions.............................................................................52
3 Create Multi-Part and Tutorial Questions........................................... 57
Create Multi-Part Questions That Have One Question Mode....................................58
Create Multi-Mode Questions............................................................................. 61
Create Polling Questions................................................................................... 66
Add Expandable Sections to Multi-Part Questions................................................. 68
Create Tutorial Questions.................................................................................. 70
Create Scored Tutorial Questions................................................................... 71
Create Popup Tutorial Questions.................................................................... 75
Delete Parts of Multi-Mode Questions..................................................................83
November 2014
ii WebAssign Creating Questions Guide
4 Create Numerical Questions............................................................... 93
Create Integer or Decimal Number Questions...................................................... 95
Check Significant Figures in Numerical Questions............................................. 97
Check Decimal Places in Numerical Questions..................................................98
Change Tolerance for Numerical Questions.................................................... 100
Create Fraction Questions................................................................................101
Require Units in Numerical Questions................................................................105
Unit Names for Numerical Questions............................................................ 106
Create Answer-Dependent Questions................................................................ 111
5 Create Math Questions..................................................................... 117
Display Notation with WaTeX........................................................................... 118
WaTeX Notation..........................................................................................119
Create WaTeX Arrays and Matrices............................................................... 124
WaTeX Example: Align a System of Equations................................................126
WaTeX Example: Matrices........................................................................... 127
WaTeX Example: Arithmetic Long Division..................................................... 128
WaTeX Example: Polynomial Long Division.................................................... 129
WaTeX Example: Synthetic Division.............................................................. 130
Display Notation with LaTeX.............................................................................131
Add Symbols to Questions...............................................................................132
Display Notation with <symimage>.................................................................. 133
Display Math Notation with HTML Substitution................................................... 141
Create mathPad Questions...............................................................................144
Evaluation Modes for Math Questions........................................................... 145
Create mathPad Questions Using Symbolic Mode............................................147
Create Answer Keys for Questions Using Symbolic Mode................................. 149
Default Values and Tolerance for Symbolic Evaluation..................................... 153
Create mathPad Questions Using Algebraic Mode with Mathematica®................ 157
Create Answer Keys for Questions Using Algebraic Mode with Mathematica®...... 161
Create Number Line Questions......................................................................... 162
Create a NumberLine Question.................................................................... 164
Coding NumberLine Questions..................................................................... 166
Code a Question in Default Mode................................................................. 167
Code a Question in Points Mode...................................................................168
Answer Key Objects....................................................................................170
Grading..................................................................................................... 172
Create Graphing Questions.............................................................................. 173
Specify Equations in Graphing Question Answer Keys......................................177
Graphing Tool Grid Display and Snap Behavior...............................................177
Create Matrix Questions.................................................................................. 179
Matrix Parameters...................................................................................... 182
6 Create Physics Questions................................................................. 185
Display Notation with WaTeX........................................................................... 186
WaTeX Notation..........................................................................................187
November 2014
Contents iii
Create WaTeX Arrays and Matrices............................................................... 192
WaTeX Example: Align a System of Equations................................................194
WaTeX Example: Matrices........................................................................... 195
WaTeX Example: Arithmetic Long Division..................................................... 196
WaTeX Example: Polynomial Long Division.................................................... 197
WaTeX Example: Synthetic Division.............................................................. 198
Display Notation with LaTeX.............................................................................199
Add Symbols to Questions...............................................................................200
Display Notation with <symimage>.................................................................. 201
Display Math Notation with HTML Substitution................................................... 209
Create physPad Questions............................................................................... 212
Evaluation Modes for Math Questions........................................................... 212
Create physPad Questions Using Symbolic Mode............................................ 214
Create Answer Keys for Questions Using Symbolic Mode................................. 217
Default Values and Tolerance for Symbolic Evaluation..................................... 221
Create physPad Questions Using Algebraic Mode with Mathematica®................. 225
Create Answer Keys for Questions Using Algebraic Mode with Mathematica®...... 228
7 Create Chemistry Questions............................................................. 231
Chemistry Notation in Questions...................................................................... 232
Create chemPad Questions.............................................................................. 233
Create chemPad Questions for Formulas....................................................... 234
Create List and Rank-Order chemPad Questions............................................. 238
Create chemPad Questions for Reactions.......................................................243
Create chemPad Questions for Kinetic or Equilibrium Expressions..................... 248
Create chemPad Questions for Electrochemical Cell Notation............................ 250
Create chemPad Questions for Electron Configuration..................................... 252
Creating chemPad Answer Keys................................................................... 255
Create MarvinSketch Questions........................................................................ 257
MarvinSketch Drawing Modes...................................................................... 258
MarvinSketch Changes to Creating Questions.................................................261
Create MarvinSketch Questions That Do Not Display an Initial Drawing..............261
Create MarvinSketch Questions That Display an Initial Drawing........................ 265
Display Chemical Structures in Questions with MarvinSketch............................272
Use the MarvinSketch Key Generation Tool.................................................... 275
Create MarvinSketch Questions That Use Canonical or
Combinatorial SMILES Strings...................................................................... 282
8 Format Questions............................................................................. 287
Format Text in Questions................................................................................ 288
Add Images, Media, or Documents to Your Coursework....................................... 289
Upload Images, Media, or Documents to My Folders....................................... 290
Set Display Text for an Image, Media, or Document File..................................291
Display Images in Your Coursework..............................................................293
Add Resource Links in Your Coursework........................................................ 295
Link to External Resource Materials in Your Coursework.................................. 297
Play Media Files in Your Coursework............................................................. 298
November 2014
iv WebAssign Creating Questions Guide
Update Your Files....................................................................................... 306
Rename a Folder, Assignment, Question, or File............................................. 307
Add Symbols to Questions...............................................................................308
Add Search Metadata to Questions................................................................... 308
Add Standard Text Prompts to Questions...........................................................309
9 Question Behavior............................................................................ 311
Perl Variables and Functions............................................................................ 312
Include Perl in Questions............................................................................ 312
Set Perl Variables....................................................................................... 315
Test Perl Variables...................................................................................... 316
Use Perl Array Variables..............................................................................319
Use Perl Hash Variables.............................................................................. 324
Write Perl Functions................................................................................... 327
The {tab} Operator........................................................................................ 329
Randomize Question Values............................................................................. 330
Randomization Best Practices.......................................................................331
Use Randomized Numbers........................................................................... 334
Use Randomized Values from a List..............................................................335
Use Matching Randomized Values from Two Lists........................................... 337
Use Randomized Values from a Table........................................................... 340
Numeric Values in Questions............................................................................343
Display Numbers to a Specified Precision...................................................... 343
Add Item-Specific Feedback to Multiple-Choice Questions.................................... 346
Perform Complex Operations in Answer Keys..................................................... 347
A: List of Tags..................................................................................... 353
Tags for Displaying Content............................................................................. 354
Tags for Multi-Part, Accordion, and Tutorial Questions......................................... 355
Tags for Controlling Question Behavior.............................................................. 356
B: List of Symbols............................................................................... 359
C: List of Prompts............................................................................... 361
Prompts for Accounting Questions.................................................................... 362
Prompts for Chemistry and Physics Questions.................................................... 362
Prompts for Mathematics Questions.................................................................. 365
Prompts for Statistics Questions....................................................................... 368
Miscellaneous Prompts.................................................................................... 368
D: Perl Functions and Operators......................................................... 371
Conditional Processing and Logic Functions and Operators................................... 372
Mathematic Functions and Operators................................................................ 372
Numerical Display Functions............................................................................ 375
Randomization Functions................................................................................. 377
Informational Functions................................................................................... 377
E: Perl Variables.................................................................................. 379
November 2014
v WebAssign Creating Questions Guide
Perl Variables for Any Question Type.................................................................380
Perl Variables for Numerical Questions.............................................................. 381
Perl Variables for Math Questions (Algebraic and Symbolic Modes)........................ 382
Perl Variables for Multiple-Choice and Multiple-Select Questions............................382
Perl Variables for Matching Questions................................................................383
Perl Variables for Fill-in-the-Blank Questions...................................................... 384
Perl Variables for Essay Questions.................................................................... 384
Perl Variables for File-Upload Questions.............................................................384
Perl Variables for Chemistry Questions (Fill-in-the-Blank Mode)............................ 385
F: Numerical Tolerance........................................................................387
G: Significant Figure Checking in WebAssign®.................................... 391
November 2014
vi WebAssign Creating Questions Guide
November 2014
Document Conventions
This document uses the following typographical conventions.
Convention
Description
Examples
Boldface
Identifies items in the user
interface such as buttons or
menus. Angle brackets are used to
indicate menu sublevels.
Click OK.
Type a Description.
Click Assignments > Create.
Uppercase
Identifies the names of keys on
Press ENTER.
the keyboard. Standard Microsoft
key names are used; users of other
operating systems or keyboards
might see different labels.
Monospace
Identifies tags, functions,
variables, and code that must be
typed literally. Lines of code that
are wrapped because of length are
slightly indented.
Begin your formula with the <eqn>
Identifies text that must be typed
literally.
Type 0 if you do not want your
Monospace
with boldface
tag.
Type the following code:
<eqn>
$helpertext='Have you tested
your values using the
Pythagorean Theorem?';
''
</eqn>
students to incur a penalty for
using the automatic extension.
Italics
Note
Identifies placeholders for values
that you must supply. Sometimes
used for textual emphasis.
Provides supplementary
information.
<eqn $PULLDOWN=1;
$Select_Option="text"; ''>
where text is the default text that
you want to be displayed in the
menu.
Note: You should know
this.
November 2014
viii WebAssign Creating Questions Guide
November 2014
Convention
Description
Tip
Provides optional hints or
shortcuts.
Important
Provides cautionary information to
help prevent problems.
Best Practice
Describes recommended actions to
perform a task better.
Examples
Tip: This might make it
easier.
Important: Check this
before proceeding.
Best Practice: This way
is recommended.
1
Get Started Creating Questions in
WebAssign®
This chapter contains the
following topics:
WebAssign® provides tools for finding, duplicating, creating,
editing, and testing your own questions.
• Search for Questions
• WebAssign Question Modes
• Question Templates
• Create Questions by Duplication
• Create Questions with the Question
Editor
• Delete Parts of Single-Mode
Questions
• Test Questions
• Share Questions With Other
Instructors
November 2014
2 WebAssign Creating Questions Guide
Search for Questions
Before creating your own questions, it is often useful to look for existing questions
that are like the question you want. You might even find a question that you can
use without modification.
To search for an existing question:
Tip: If you know the question ID or part of the question name, click
Search in the toolbar. Select Question, type the question name or ID, and
then click Go.
1. Click Questions > Search.
2. On the Question Search page, specify the criteria you want to use when
performing your search.
Searches are not case-sensitive. Only questions that contain all of your
specified criteria are returned in the search results.
November 2014
Get Started Creating Questions in WebAssign® 3
Important: You are allowed to use textbook questions in your
assignments only from textbooks you have adopted for your class.
Questions from other textbooks are not displayed in the search results.
The criteria you can use for your search on are described in the following
tables.
Criterion
Description
Textbook
Select one of the textbooks that you have selected for your classes
to limit your search to questions in that textbook.
Chapter
Specify a textbook chapter, if known.
Name
Specify the entire question name or a word that occurs in the
question name.
Usable Only
Select Usable Only to include only questions that are marked as
usable.
Used
Questions
Only
Select Used Questions Only to include only questions that have
been used in an assignment.
Keywords
Specify a single keyword to find questions including that keyword. Be
aware that textbook questions do not include keywords.
Author
Specify all or part of the question author's name or WebAssign
username.
Permission/
Groups
Select the permission that is set for the question. To understand
permissions, see Share Questions With Other Instructors on page
19.
Mode
Select the type of question that you are searching for — for
example, Multiple-Choice or Numerical. Note that Multi-Mode
questions containing the selected type are also returned.
Last Saved
Select a date and time range when the question was most recently
saved. A common use of this criterion is to search for questions that
are new or have been recently modified.
®
Click Show Additional Criteria to specify the following criteria:
Criterion
Description
Question
Specify a word or phrase in the Question field for the question. You
can use this to search not only for text that is displayed to students,
but also for code, for example if you are trying to find questions
using a particular function or variable.
Answer
Specify a word or phrase in the Answer field for the question. You
can use this to search not only for text that is displayed to students,
but also for code, for example if you are trying to find questions
using a particular function or variable.
November 2014
4 WebAssign Creating Questions Guide
Criterion
Description
Solution
Specify a word or phrase in the Solution field for the question.
Comment
Specify a word or phrase in the Comment field for the question.
Discipline
Select one or more disciplines that are specified for the question.
Be aware that most textbook questions do not contain discipline
information.
Note: You cannot use operators like AND, OR, or commas to combine
multiple search terms for a criterion. Instead, use the % character
as a wildcard to match zero or more characters. For example, if you
specified velocity%acceleration in the Keywords box, you would find
questions containing any of the following values in the keywords list:
relationship between velocity and acceleration
velocityAcceleration
velocity,acceleration
Velocity, Time, Acceleration
However, you would not see questions for which acceleration precedes
velocity in the list of keywords, such as:
acceleration, time, velocity
3. Under Results Options, select how many results to be displayed per page, how
the results should be sorted, and whether to display the entire question or
summary information.
4. Click Search.
Some searches might take several minutes, depending on your search
parameters.
• If only one question matches your parameters, it is opened in the
Question Editor.
• If more than one question is found, the results are displayed as specified
by the Results Options settings.
Tip: If you perform the same search repeatedly, set the search criteria
in the Questions Search page and then click Save. This saves the
specified criteria to your user profile. To perform the same search
again, click My Search and the saved criteria are filled in on the
Questions Search page.
5. In the Question Search Results, you can:
• Click View to see the question in the Question Previewer.
• Click Edit to open the question in the Question Editor. Depending on the
permission for the question, you might not be able to save any changes
to the question.
• Click Duplicate to open a new copy of the question in the Question
Editor. The copy is a new question that is just like the original, except you
are the owner and can change it to suit your needs.
• Click Delete to remove a criterion and run the search again.
November 2014
Get Started Creating Questions in WebAssign® 5
• Click Edit Criteria to open the Questions Search page with the existing
criteria.
• Click New Search to open the Questions Search page with no specified
criteria.
• Change the Results Options and then click Update Results to change
the number of search results per page, the results sort order, and
whether to display the entire question or summary information.
WebAssign® Question Modes
®
The WebAssign Question Editor supports the following question modes.
Mode
Description
Algebraic
Students submit a mathematical expression or equation that is
evaluated algebraically.
Essay
Students submit an extended textual response. Scored manually.
File-Upload
Students submit a file. Scored manually.
Fill-in-the-Blank
Students submit a brief textual response.
Graphing
Students draw on a Cartesian coordinate plane.
Image Map
Students click a displayed image.
Java
Students use Java, Flash, or other applet to answer the question.
Matching
Students match items from two lists.
Multiple-Choice
Students select one response from a list.
Multiple-Select
Students select one or more responses from a list.
NumberLine
Students place or draw points, lines, segments, or rays.
Numerical
Students submit a numerical response which might include units or
be checked for significant figures.
PencilPad
Students draw a figure. Scored manually.
Poll
Used with other modes to create questions that collect information
only. All responses are scored correct.
Symbolic
Students submit a mathematical expression (not an equation) that
is evaluated by value substitution.
November 2014
6 WebAssign Creating Questions Guide
Question Templates
®
If you are planning to create questions, add the WebAssign Templates as a
resource text to your class. These templates provide “best practice” examples of a
wide variety of question types and techniques.
®
After you have added the WebAssign template as a resource, you can use the
Question Browser to view these example questions. To use a template question
when creating your own questions, copy the code of the question from the
Question Browser to the Question Editor, and then edit the question to fit your
needs.
Create Questions by Duplication
If you find a question that is similar to the one you want to create, you can create
a copy of the question. The copy is a new question that is just like the original,
except you are the owner and can change it to suit your needs.
Note: Observe copyright restrictions for textbook questions and questions
authored by others. Questions that are duplicated from copyrighted
questions should be treated as copyrighted material.
To create a question by duplication:
1. Click Duplicate for the question you want to copy.
You can duplicate a question from the Question Editor, My Questions, Question
Search Results, and Recently Modified pages.
The new question opens in the Question Editor.
2. In the Question Editor, make your changes to the question and test it.
3. When the question works as you want it to, click Save.
The question is created and assigned a new unique question ID.
Important: Some features of textbook questions are intentionally not
available after duplication. These features are generally textbook-specific,
and include eBook links and tutorials, simulations, and instructional
materials associated with the textbook.
See Also:
Create General-Purpose Questions on page 21
November 2014
Get Started Creating Questions in WebAssign® 7
Create Questions with the Question Editor
®
To create or edit questions in WebAssign , you use the Question Editor.
To create a question:
Note: Although you use different procedures and options when creating
different kinds of questions, the following steps describe the general
®
procedure for creating questions in WebAssign . Refer to other sections for
information about specific question types.
1. Click Questions > Create. The Question Editor opens.
Tip: You can open the Question Editor from a number of other
contexts by clicking Edit or Duplicate for a question.
November 2014
8 WebAssign Creating Questions Guide
2. In Name, type a name for the question.
Use the Name field to specify a descriptive name for the question. The
name can be up to 50 characters long, and helps you to identify the question
without having to view it.
3. In Mode, select one of the question modes to define the basic behaviors for
your question.
November 2014
Mode
Description
Multiple-Choice
Lists mutually exclusive choices with only one correct response.
Get Started Creating Questions in WebAssign® 9
Mode
Description
Multiple-Select
Lists non-exclusive choices, allowing your students to select all
the choices that apply.
Numerical
Provides a box for your students to type a numerical response
that is scored for numerical accuracy and, optionally, for
correctly specifying units, significant figures, or decimal places.
Fill-in-the-Blank
Provides a box for your students to type a short response that is
scored by comparison with one or more answers.
Matching
Lists a series of items for your students to match to items in a
second list.
Essay
Provides a box for your students to type a response of any
length. Essay questions must be manually scored.
Symbolic
Scores mathematical expressions by comparing your students'
responses to the key with variable substitution.
Algebraic
Scores mathematical expressions by comparing your students'
responses to the key algebraically.
NumberLine
Provides a number line on which your students place points or
graph their response.
Image Map
Displays an image that your students click to identify something
in the image.
Graphing
Provides a coordinate plane on which your students graph their
response.
PencilPad
Provides a virtual pad of paper on which your students draw
their response. PencilPad questions must be manually scored.
File-Upload
Allows your students to upload a file for their response. Fileupload questions must be manually scored.
Java
Displays a Java applet or other web-based simulation or tool
that provides the question and scores your students' responses.
Poll
Using any of the other modes, poll questions gather information
but score all responses as correct. See Create Multi-Part and
Tutorial Questions on page 57.
4. To create a multi-part question that uses more than one question mode, click
Multi-Mode Options.
See Create Multi-Part and Tutorial Questions on page 57.
5. In Question, type the question you are asking your students to answer.
Depending on the type of question you are creating, you will usually add an
answer placeholder string <_> to specify where your students will specify their
responses.
You can use HTML tags and CSS style attribute values in your question to
®
format its appearance, or you can use WebAssign tags to add formatting or
November 2014
10 WebAssign Creating Questions Guide
boilerplate text. You can also include images, videos, sound files, or links to
documents.
Tip: To resize the Question, Answer, or Solution boxes, click the
horizontal
or vertical resize buttons. This does not affect the
display size of the question in an assignment. Resizing these fields
affects only the question you are editing, but the field sizes are saved
with the question.
6. In Answer, specify the answer key for your question. Often, you will specify
distractors or options configuring your question's behavior.
Important: The information you specify in Answer varies
significantly based on the selected question Mode.
For multiple-choice, multiple-select, and matching questions, you can use
HTML tags and CSS style attribute values to format answer choices, or include
images, videos, sound files, or links to documents.
7. Optionally, type a Solution.
The solution helps your students understand the steps they need to take to
determine the correct answer to the question. You can configure display of
solutions in your assignment settings.
You can use HTML tags and CSS style attribute values in your solution to
®
format its appearance, or you can use WebAssign tags to add formatting or
boilerplate text. You can also include images, videos, sound files, or links to
documents.
8. Click Test/Preview to test the appearance and behavior of the question.
See Test Questions on page 18.
9. Click Redisplay to show certain kinds of errors in the Display section of the
Question Editor. Make any needed changes to your question.
10. Optionally, 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 on page 19.
• 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 on page 308.
The Author and Locked information cannot be changed. Author displays your
name and email address. Locked indicates whether or not the question has
been included in a scheduled assignment. This does not prevent you from
editing the question, but you should not edit locked questions except to
correct errors.
11. When your question displays and functions correctly, click Save.
November 2014
Get Started Creating Questions in WebAssign® 11
®
WebAssign assigns 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.
Tip:
• To discard the changes in the Question Editor and load the last saved
version of the question, click Revert.
• To view the history of saved changes for the question, including the
date, time, and user, click the Last Saved date.
See Also:
Create Multiple-Choice Questions on page 22
Create True/False Questions on page 27
Create Yes/No Questions on page 28
Create Multiple-Select Questions on page 30
Create Matching Questions on page 34
Create Ranking Questions on page 39
Create Fill-in-the-Blank Questions on page 42
Create Integer or Decimal Number Questions on page 95
Create Image Map Questions on page 52
Create Free Response Questions on page 50
Create PencilPad (Drawing) Questions on page 46
Create File Upload Questions on page 44
Create Multi-Part and Tutorial Questions on page 57
Create Math Questions on page 117
Create Chemistry Questions on page 231
Create Fraction Questions on page 101
Delete Parts of Single-Mode Questions
If you find a single-mode question with more parts than you want, you can create
a copy of the question to edit. This newly copied question is identical to the
original, except you are the owner and can edit it for your needs.
Note: Observe copyright restrictions for textbook questions and questions
authored by others. Questions that are duplicated from copyrighted
questions should be treated as copyrighted material.
To delete parts of a single-mode question:
1. Find the question you want to edit.
Note: See Search for Questions on page 2 if you need help
locating the question you want.
2. Click Duplicate for the question you want to edit.
You can duplicate a question from the Question Editor, My Questions, Question
Search Results, and Recently Modified pages.
November 2014
12 WebAssign Creating Questions Guide
The new question opens in the Question Editor, and shows that it is a
duplicated question.
3. In the Name field, prepend the question name with a unique identifier, such as
your initials, or give it a new name, and then click Save.
The question is renamed and assigned a new QID.
For example, using a duplicate of RogaCalc2 1.1.002. and prepending it
with GAM as the unique identifier, the new name and QID would be GAMRogaCalc2 1.1.002. (2661089).
Note: Make a note of your question's new name and new QID
displayed at the top of the editor. This will make it easier when you
want to add the question to an assignment.
4. Click Test/Preview to see your new question.
For example, GAM-RogaCalc2 1.1.002. (2661089) is identical to the original
question:
November 2014
Get Started Creating Questions in WebAssign® 13
5. From the Question, Answer, and Solution fields of the editor, delete the parts
of the question you want to remove.
Important: Since code lines wrap in the Question Editor, you can
adjust the Question, Answer, or Solution fields using the horizontal
or vertical resize buttons. Alternatively, if you cannot sufficiently
resize the fields without the lines wrapping, copy/paste the entire text
of a field into a text editor with word wrap turned off.
November 2014
14 WebAssign Creating Questions Guide
a) In the Question field, delete the parts you want to remove. Ensure you
delete the associated <_> because these are the Question field parts'
answer blanks.
For example, the highlighted text shows the Question field part of GAMRogaCalc2 1.1.002. that will be deleted:
• If the Question field part uses a <div> or <blockquote> tag, do not
delete the respective closing </div> or </blockquote> tag at the end
of the Question field because they are used to ensure proper display.
• If there are more than one <div> tag sets in the Question field, after
you delete the parts make sure that all the remaining <div> tags
have corresponding </div>tags.
• If the Question field uses the <table></table> tag set, you can delete
the entire table or parts of it. To delete an entire table row, identify
the tag that opens the row, <tr>, and the tag the closes the row,</
tr>. Delete these two tags and everything in between them to delete
the entire row. To delete a table column you must delete each cell that
makes the column. Identify the tag that opens the cell, <td>, and
the tag that closes the cell, </td>. Delete these tags and everything
between them. Repeat this process for each cell in the table that is
part of the column you want to delete.
b) In the Answer field, delete the parts of the answer that correspond to the
Question field parts and answer blanks you deleted. This step is important
because it directly affects how the question is scored in your assignment.
For example, the highlighted text shows the Answer field part of GAMRogaCalc2 1.1.002. that must be deleted because it corresponds with the
deleted Question field part in Step a:
November 2014
Get Started Creating Questions in WebAssign® 15
Important: Each line of the Answer field usually begins with the
EQN tag and corresponds to one answer blank in the order they
are displayed in the question. Make sure that you delete the entire
line and there are no extra carriage returns at the end. Unless the
deleted line is the last EQN line, make sure the EQN tag is at the
beginning of the next line.
c) If the question has a solution, remove any text in the Solution field that
corresponds to the deleted parts in the Question and Answer fields.
For example, the highlighted text shows the Solution field part of GAMRogaCalc2 1.1.002. that must be deleted because it corresponds with the
deleted Question and Answer fields' parts in Steps a and b:
6. If necessary, insert line breaks (carriage returns) in any field to make the
question or solution display properly, you can use the <br /> tag for each
line break you want to insert.
7. Click Redisplay.
The top of the Display section shows any Perl syntax or other errors in the
Question and Answer sections. Correct any errors, and then continue. For
more information, see Perl Variables and Functions on page 312.
8. Click Test/Preview to see how your question will de displayed to students
and that all answer blanks are grading correctly. Be sure to test the answer
blanks with both correct and incorrect answers.
November 2014
16 WebAssign Creating Questions Guide
Note: At any point in the editing process you can test to see how your
changes affect the question. You do not need to save your changes
before testing.
For example, this is edited version of GAM-RogaCalc2 1.1.002.:
9. In the Additional Information section, make changes to the following fields. If
you cannot see this section, click Show Additional Information.
a) Keywords—add a comma-delimited list of keywords that describe the
question.
For example, add "first-order, linear, differential, equation" for GAMRogaCalc2 1.1.002.
b) Classification—click Classification and select one or more topics in the
discipline that relate to the question.
Adding a classification includes your question in the collections listed in the
Question Browser for any instructors who can find the question in search
results. See Share Questions With Other Instructors on page 19.
c) Permission—select a permission. If you created permission groups, they
will display in the permission list.
November 2014
Get Started Creating Questions in WebAssign® 17
For more information on permission settings and permission groups,
see Share Questions With Other Instructors on page 19 and Manage
Permission Groups.
d) Usable/Draft—select Usable if the question is ready to be included in
assignments or Draft if it is still being edited. Draft does not prevent the
question from being included in your assignment; however, the question
will not be available to anyone you chose to share it with until it is marked
Usable.
e) Comment—add a note about what you deleted. This way, anyone who looks
at this question will know how it differs from the original, WebAssign-coded
question.
For example, add "Deleted last two true/false parts" for GAM-RogaCalc2
1.1.002.
f) Discipline—select one or more disciplines to which the question applies.
For example, the Additional Information section for GAM-RogaCalc2 1.1.002.
looks like this:
10. When the question works as you want it to, click Save.
Best Practice: A good test is to use this question as the first question
in a multi-question test assignment. This would help identify any errors
in this question that would affect other questions in the assignment
(like broken tags).
Before adding this question to an assignment for your students, create
a test course, and then add/schedule the test assignment. Using the
Student View, complete the assignment to ensure the new question is
functioning properly.
Important: Some features of textbook questions are intentionally not
available after duplication. These features are generally textbook-specific,
and include eBook links and tutorials, simulations, and instructional
materials associated with the textbook.
November 2014
18 WebAssign Creating Questions Guide
Test Questions
When creating or editing a question, always test your question to ensure that its
appearance and behavior are correct before you use it in an assignment.
To test a question:
1. In the Question Editor, click Test/Preview.
The Question Previewer window opens.
2. Check the appearance of the question.
a) Verify that the question is formatted correctly in the middle of the Question
Previewer. Ensure that all the text is displayed, as well as any media you
included in the question.
b) Select the Key, Solution, Help/Hints, Mark, and Answer Format Tips
check boxes to display those items for the question.
You can click All or None to select all or none of these check boxes.
Ensure that the key, help/hints, and solution are displayed correctly.
c) Verify that the correct method for submitting a response for the question is
displayed.
®
This might be a tool like the WebAssign graphing tool, a text box, or items
to select.
3. Check the behavior of the question.
a) If the question uses any randomization — for example, multiple-choice
questions or questions using randomly-selected values — click Show New
Randomization.
Verify that the displayed values or answer order changes in the way you
expect. Try a few different randomizations.
b) Select Mark, and then provide a correct response to the question.
Click Submit for Testing and verify that the question is marked as
correct.
Note:
• For file-upload questions, you cannot actually upload a file
in the Question Previewer. To test that functionality, add the
question to an assignment and use the Student View to submit
a file on the assignment.
• For manually-graded question types — file-upload, essay,
and PencilPad — all submissions are automatically marked as
correct.
c) If more than one response might be correct, provide each alternative
correct answer.
Click Submit for Testing each time and verify that the responses are
marked as correct.
d) Provide a likely incorrect response to the question and click Submit for
Testing.
November 2014
Get Started Creating Questions in WebAssign® 19
Verify that the response is marked as incorrect. Test a variety of probable
incorrect responses.
4. If needed, make changes to the question code and then retest the question.
Tip: If the Question Previewer window is open, you can view your
latest changes by clicking Reload from Editor.
5. When you satisfied that the question is correct, close the Question Previewer
window and save the question in the Question Editor.
Share Questions With Other Instructors
You can change sharing permissions for your questions to control whether or not
other instructors can use your questions in their assignments, or to collaborate
with specific instructors when creating questions.
Important: Changes to questions can affect scoring for both current
and past scheduled assignments. To avoid creating a situation in which
assignments might have to be rescored, do not allow other instructors to
use your questions until after you are done making changes.
You can choose among several permission values, each of which should be used
for specific goals.
November 2014
20 WebAssign Creating Questions Guide
• By default, new questions are set to Protected. This lets other instructors
use your question in their assignments only if you provide the question ID,
and ensures that other instructors cannot find your question by searching.
Only you can edit the question or find it in search results.
• If you do not want to share your question with any other instructors, choose
Private. This ensures that only you can find, use, or edit the question.
• If you want to let all instructors use your question in their assignments,
choose either Copyright (if your question contains copyrighted materials)
or Public (if all content in your question is in the public domain). Other
instructors can find the question by searching and can use the question in
their assignments. Only you can edit the question.
• If you want to collaborate with other instructors at your school when creating
a question, choose a group permission. With group permission, you can
select or create a group of instructors who can edit the question and find it in
search results. Instructors who are not in the group cannot find your question
by searching, and can use the question in their assignments only if you or
another instructor in the group provides the question ID.
When you use Protected or Group permissions and you want other instructors to
be able to use your question in their assignments, you must provide them with
the question ID (the number shown in parentheses after the question name). With
the question ID, other instructors can add your question to their assignments in
the Question Browser.
Note:
• If you are not the original author of a question and you change the
permission to anything other than Group, only the original author of
the question will be able to edit the question.
• Other instructors can duplicate any question that you allow them to
use or to edit.
To set the question permission:
1. If needed, click Show Additional Information in the Question Editor.
2. For Permission, select the permission you want to use.
3. Click Save to apply your changes.
November 2014
2
Create General-Purpose Questions
This chapter contains the
following topics:
• Create Multiple-Choice Questions
• Create True/False Questions
• Create Yes/No Questions
• Create Multiple-Select Questions
• Create Matching Questions
In WebAssign®, you can create a wide variety of questions
for use in your classes. This section provides step-by-step
instructions with examples for creating many kinds of generalpurpose questions. These questions reflect the kinds of
questions most commonly used in the classroom, but do not
include some advanced or discipline-specific question types.
See Also:
Understanding the <eqn> and <EQN> Tags on page 312
• Create Ranking Questions
• Create Fill-in-the-Blank Questions
• Create File Upload Questions
• Create PencilPad (Drawing)
Questions
• Create Free Response Questions
• Create Image Map Questions
November 2014
22 WebAssign Creating Questions Guide
Create Multiple-Choice Questions
Multiple-choice questions present mutually exclusive choices with only one
correct response. By default, the choices are displayed in random order when the
question is used.
To create a multiple-choice question:
1. Click Questions > Create.
The Question Editor opens.
2. In Name, type a name for the question.
3. In Mode, select Multiple-Choice.
4. In Question, type your question.
Use the answer placeholder string <_> to specify where the answer box should
be displayed.
Best Practice: Although technically you can omit the answer
placeholder string <_> for multiple-choice questions if you want the
answer choices to be listed at the end of your question, this string is
required for most other question types and it is a good practice always
to include it.
5. In Answer, type the correct answer on the first line and press ENTER. Then,
type one or more incorrect answers, pressing ENTER after each one.
Note:
• Incorrect answers are sometimes referred to as distractors.
• 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.
• To show feedback for each choice — sometimes called a
rejoinder — see Add Item-Specific Feedback to Multiple-Choice
Questions on page 346.
6. 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.
7. Click Test/Preview to test the appearance and behavior of the question. See
Test Questions on page 18.
8. Click Redisplay to show certain kinds of errors in the Display section of the
Question Editor. Make any needed changes to your question.
9. 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
November 2014
Create General-Purpose Questions 23
in search results. To change the permission, see Share Questions With
Other Instructors on page 19.
• 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 on page 308.
10. 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 Multiple-Choice Question
The following table summarizes an actual question.
QID
1077495
Name
Template2 2.MC.01.
Mode
Multiple-Choice
Question
What is the primary function of leaves?<br> <_>
Answer
to
to
to
to
trap light energy for photosynthesis
provide protection for the plant
provide water for the plant
enable the plant to grow taller
Display to
Students
See Also:
Create Questions with the Question Editor on page 7
Add Item-Specific Feedback to Multiple-Choice Questions on page 346
Display Choices in a Fixed Order
By default, the answer choices for multiple-choice questions are listed in random
order. You can force the choices to be displayed in a specific order by setting the
$ORDERED variable to the number of the correct choice and entering the answer
choices in the sequence in which they should be displayed.
To list answer choices in a specific sequence:
1. Start the first line of Answer with the following code:
<eqn $ORDERED=n; ''>
November 2014
24 WebAssign Creating Questions Guide
where n is the number of the correct choice. The choices are numbered
beginning with 1 for the choice on the first line of Answer.
2. Type the choices in Answer in the sequence in which they should be
displayed.
Example Ordered Multiple-Choice Question
The following table summarizes an actual question.
QID
1158608
Name
Template2 2.MC.02.
Mode
Multiple-Choice
Question
In what year was President Kennedy elected?
<_>
Answer
<eqn $ORDERED=2; ''>1959
1960
1961
1962
Display to
Students
Display Choices as a Drop-down Menu
Sometimes, you might want to list the choices for a multiple-choice question as a
drop-down menu. This can be especially useful for sentence-completion questions
or in tables, where you want the student to select an answer in a specific context.
You can do this by setting the $PULLDOWN variable in your answer. You can also
use the $Select_Option variable to specify the default text that is displayed in the
menu before your students select a response.
To display answer choices as a drop-down menu:
1. Include the answer placeholder string <_> in Question at the location where
you want the answer choices to be displayed.
2. Start the first line of Answer with the following code:
<eqn $PULLDOWN=1; $Select_Option="text"; ''>
where text is the default text that you want to be displayed in the menu.
Tip: Specifying $Select_Option="text" is optional. If you do not
specify default text for the menu, ---Select--- is displayed.
November 2014
Create General-Purpose Questions 25
Example Drop-down Multiple-Choice Question
The following table summarizes an actual question.
QID
1158615
Name
Template2 2.MC.03.
Mode
Multiple-Choice
Question
<_> is the rate of change of velocity with respect to time.
Answer
<eqn $PULLDOWN=1; $Select_Option='---'; ''>Acceleration
Velocity
Motion
Displacement
Display to
Students
Display Choices Horizontally or in Tables
By default, the choices for a multiple-choice question are displayed as a vertical
list. Sometimes, you might want to arrange the choices horizontally or in a table.
You can use the $SET_EACH_POSITION variable together with answer placeholder
strings <_> to specify the location of each answer choice in your question.
To specify the positions of answer choices:
1. Include an answer placeholder string <_> in Question for each choice.
Put the answer placeholder strings <_> where the choices should be displayed.
2. Start the first line of Answer with the following code:
<eqn $SET_EACH_POSITION=1; ''>
Example Horizontal Multiple-Choice Question
The following table summarizes an actual question.
QID
1158695
Name
Template2 2.MC.04.
Mode
Multiple-Choice
Question
What is the sum of the first five natural numbers? <br>
<_> <_> <_>
November 2014
26 WebAssign Creating Questions Guide
Answer
<eqn $SET_EACH_POSITION=1; ''>15
120
18
Display to
Students
Example Tabular Multiple-Choice Question
The following table summarizes an actual question.
Note: Always specify alternative text when adding images to your
questions.
QID
1247290
Name
Template2 2.MC.05.
Mode
Multiple-Choice
Question
Identify the wood duck.
<p class="right">(Public domain images from
http://photogallery.nrcs.usda.gov)</p>
<div class="indent">
<table>
<tr valign="top"><td><_></td><td><_></td></tr>
<tr valign="top"><td><_></td><td><_></td></tr>
</table>
</div>
Answer
<eqn $SET_EACH_POSITION=1; ''><userimage(103859, align =>
'top')>
<userimage(103853, align => 'top')>
<userimage(103855, align => 'top')>
<userimage(103857, align => 'top')>
Display to
Students
November 2014
Create General-Purpose Questions 27
See Also:
Add Images, Media, or Documents to Your Coursework on page 289
Create True/False Questions
True/false questions are multiple-choice questions with only two choices: True and
False.
Best Practice:
• Use the $ORDERED variable and list the answer choices with True first,
followed by False.
• Only allow one submission when including these questions on an
assignment.
To create a True/false question:
1. Click Questions > Create.
The Question Editor opens.
2. In Name, type a name for the question.
3. In Mode, select Multiple-Choice.
4. In Question, type your question.
Use the answer placeholder string <_> to specify where the answer box should
be displayed.
5. In Answer, type one of the following:
• If the correct response is True, type:
<eqn $ORDERED=1; ''>True
False
• If the correct response is False, type:
<eqn $ORDERED=2; ''>True
False
To show feedback for each choice — sometimes called a rejoinder — see Add
Item-Specific Feedback to Multiple-Choice Questions on page 346.
6. 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.
7. Click Test/Preview to test the appearance and behavior of the question. See
Test Questions on page 18.
8. Click Redisplay to show certain kinds of errors in the Display section of the
Question Editor. Make any needed changes to your question.
9. Optional: Click Show Additional Information and change the question's
sharing permission or add descriptive information.
November 2014
28 WebAssign Creating Questions Guide
• 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 on page 19.
• 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 on page 308.
10. 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 True/False Question
The following table summarizes an actual question.
QID
1077683
Name
Template2 2.TF.01.
Mode
Multiple-Choice
Question
If an object moves at constant velocity, then there must be at
least
one force acting on the object. <br>
<_>
Answer
<eqn $ORDERED=2; ''>True
False
Display to
Students
See Also:
Create Questions with the Question Editor on page 7
Create Yes/No Questions
Yes/no questions are multiple-choice questions with only two choices: Yes and No.
Best Practice:
• Use the $ORDERED variable and list the answer choices with Yes first,
followed by No.
• Only allow one submission when including these questions on an
assignment.
November 2014
Create General-Purpose Questions 29
To create a Yes/No question:
1. Click Questions > Create.
The Question Editor opens.
2. In Name, type a name for the question.
3. In Mode, select Multiple-Choice.
4. In Question, type your question.
Use the answer placeholder string <_> to specify where the answer box should
be displayed.
5. In Answer, type one of the following:
• If the correct response is Yes, type:
<eqn $ORDERED=1; ''>Yes
No
• If the correct response is No, type:
<eqn $ORDERED=2; ''>Yes
No
To show feedback for each choice — sometimes called a rejoinder — see Add
Item-Specific Feedback to Multiple-Choice Questions on page 346.
6. 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.
7. Click Test/Preview to test the appearance and behavior of the question. See
Test Questions on page 18.
8. Click Redisplay to show certain kinds of errors in the Display section of the
Question Editor. Make any needed changes to your question.
9. 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 on page 19.
• 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 on page 308.
10. 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.
November 2014
30 WebAssign Creating Questions Guide
Example Yes/No Question
The following table summarizes an actual question.
QID
1158782
Name
Template2 2.YN.01.
Mode
Multiple-Choice
Question
Is our Sun a red giant star?<br>
<_>
Answer
<eqn $ORDERED=2; ''>Yes
No
Display to
Students
See Also:
Create Questions with the Question Editor on page 7
Create Multiple-Select Questions
Multiple-select questions present several non-exclusive choices, allowing your
students to select all the choices that apply. By default, the choices are displayed
in random order when the question is used.
To create a multiple-select question:
1. Click Questions > Create. The Question Editor opens.
2. In Name, type a name for the question.
3. In Mode, select Multiple-Select.
4. In Question, type your question. Use the answer placeholder string <_> to
specify where the answer choices should be displayed.
Tip: Use the code <p:selectall> to insert the text “Select all that
apply.”
5. In Answer, use the following procedure to specify the correct and incorrect
answers:
a) Type one or more correct answers, pressing ENTER after each one.
b) Type <INCORRECT> before the first incorrect answer.
c) Type one or more incorrect answers, pressing ENTER after each one.
November 2014
Create General-Purpose Questions 31
Note:
• Incorrect answers are sometimes referred to as distractors.
• 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.
• If you want to write a question with no correct answer displayed,
add a correct answer with text like None of these. If you do not
specify any correct answers, students who do not attempt the
question receive credit for it.
6. 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.
7. Click Test/Preview to test the appearance and behavior of the question. See
Test Questions on page 18.
8. Click Redisplay to show certain kinds of errors in the Display section of the
Question Editor. Make any needed changes to your question.
9. 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 on page 19.
• 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 on page 308.
10. 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 Multiple-Select Question
The following table summarizes an actual question.
QID
1073354
Name
Template2 2.MS.01.
Mode
Multiple-Select
Question
Which of the following people were United States Presidents?
(<p:selectall>) <br>
<_>
November 2014
32 WebAssign Creating Questions Guide
Answer
George Washington
Abraham Lincoln
George Bush
<INCORRECT>Joseph Stalin
Winston Churchill
Display to
Students
See Also:
Create Questions with the Question Editor on page 7
Display Multiple-Select Choices in a Fixed Order
By default, the answer choices for multiple-select questions are listed in random
order.
You can force the choices to be displayed in a specific order by setting the
$ORDERED variable to indicate the numbers of the correct choices and entering the
answer choices in the sequence in which they should be displayed. You do not use
the <INCORRECT> tag when displaying multiple-select choices using this method.
To list answer choices in a specific sequence:
1. Start the first line of Answer with the following code:
<eqn $ORDERED=[n,o,p]; ''>
where n, o, and p are the numbers of the correct choices. The choices are
numbered beginning with 1 for the choice on the first line of Answer.
You can specify any number of choices. For example,
<eqn $ORDERED=[1,4]; ''> indicates that choices 1 and 4 are correct.
Tip: You can specify the range of correct choices from n through p as
[n..p]. For example, <eqn $ORDERED=[1..3]; ''> indicates that choices
1, 2, and 3 are correct.
Note: If you use the $ORDERED and $SET_EACH_POSITION variables
together, you must specify $ORDERED first, and then $SET_EACH_POSITION.
2. Type the choices in Answer in the sequence in which they should be
displayed.
November 2014
Create General-Purpose Questions 33
Example Ordered Multiple-Select Question
The following table summarizes an actual question.
QID
1158784
Name
Template2 2.MS.02.
Mode
Multiple-Select
Question
Which of the following are rational numbers?
(<p:selectall>)<br>
<_>
Answer
<eqn $ORDERED=[1,2,3,4]; ''>-321
0
2/3
321
None of these
Display to
Students
Display Multiple-Select Choices Horizontally or in
Tables
By default, the choices for a multiple-select question are displayed as a vertical
list. Sometimes, you might want to arrange the choices horizontally or in a table.
You can use the $SET_EACH_POSITION variable together with answer placeholder
strings <_> to specify the location of each answer choice in your question.
To specify the positions of answer choices:
1. Include an answer placeholder string <_> in Question for each choice.
Put the answer placeholder strings <_> where the choices should be displayed.
2. Start the first line of Answer with the following code:
<eqn $SET_EACH_POSITION=1; ''>
Note: If you use the $ORDERED and $SET_EACH_POSITION variables
together, you must specify $ORDERED first, and then $SET_EACH_POSITION.
Example Tabular Multiple-Select Question
The following table summarizes an actual question.
November 2014
34 WebAssign Creating Questions Guide
QID
1158786
Name
Template2 2.MS.03.
Mode
Multiple-Select
Question
Select the metric units:
<table>
<tr><td><_></td><td><_></td><td><_></td><td><_></td></tr>
<tr><td><_></td><td><_></td><td><_></td><td><_></td></tr>
</table>
Answer
<eqn $SET_EACH_POSITION=1; ''>meter
second
gram
liter
<INCORRECT>mile
yard
acre
pound
Display to
Students
Create Matching Questions
On paper, a matching question has two columns of items, and students draw lines
or otherwise identify the item in the second column that matches each item in the
®
first column. In WebAssign , only the first column of items is displayed; each item
in the first column has a drop-down list of the items in the second column.
Note: Although you can add extra unmatched items to one of the
columns, there must be a one-to-one correspondence between items in
the two columns. You cannot create a matching question in which choices
are reused. To do this, create a series of multiple-select or multiple-choice
questions.
By default, the choices in each column are displayed in random order when the
question is used.
November 2014
Create General-Purpose Questions 35
To create a matching question:
1. Click Questions > Create. The Question Editor opens.
2. In Name, type a name for the question.
3. In Mode, select Matching.
4. In Question, type your question.
5. In Answer, type each first-column item on a separate line followed by the
characters {tab} and its matching second-column item. Press ENTER after
each line.
Note:
• To add the {tab} operator, either type the characters {tab} or click
Add tab.You cannot enter {tab} by pressing the TAB key.
• Because second-column items are displayed in a drop-down list,
they are displayed without any text formatting. If you need to
include text formatting, such as chemical or math notation, see
Match Formatted Notation or Images on page 36.
6. If you want to specify additional distractors — second-column items that do
not match any first-column item — type them in Answer on separate lines
following the correct answers. Press ENTER after each line.
7. 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.
8. Click Test/Preview to test the appearance and behavior of the question. See
Test Questions on page 18.
9. Click Redisplay to show certain kinds of errors in the Display section of the
Question Editor. Make any needed changes to your question.
10. 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 on page 19.
• 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 on page 308.
11. 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.
November 2014
36 WebAssign Creating Questions Guide
Example Matching Question
The following table summarizes an actual question.
QID
1077498
Name
Template2 2.MATCH.01.
Mode
Matching
Question
Match the city with the country.
Answer
Paris {tab} France
London {tab} Great Britain
Madrid {tab} Spain
Moscow {tab} Russia
Athens {tab} Greece
Turkey
Italy
Belgium
Display to
Students
See Also:
Create Questions with the Question Editor on page 7
The {tab} Operator on page 329
Match Formatted Notation or Images
You can include images and formatted text, such as subscripts, in first-column
items in matching questions. However, you cannot include formatted text or
images in the drop-down list of second column items. In order to match secondcolumn items that contain images or formatting, you must use labels for the
second-column items.
You can use the $LABEL variable to set alphabetic or numeric numbering of your
second-column items. These labels are displayed beside the second-column items
in the question, and the labels are listed in the drop-down menu.
To set labels for second-column items:
Start the first line of Answer with one of the following:
November 2014
Create General-Purpose Questions 37
Label type
Code
Lowercase alphabetic (a,b,c...)
<eqn $LABEL="a"; ''>
Uppercase alphabetic (A,B,C...)
<eqn $LABEL="A"; ''>
Numeric (1,2,3...)
<eqn $LABEL="1"; ''>
Example Matching Question With Formatted Notation
The following table summarizes an actual question.
QID
1158804
Name
Template2 2.MATCH.02.
Mode
Matching
Question
Match the chemical with the formula.
Answer
<eqn $LABEL="a"; ''>water {tab} H<sub>2</sub>O
benzene {tab} C<sub>6</sub>H<sub>6</sub>
sodium chloride {tab} NaCl
ethanol {tab} CH<sub>3</sub>CH<sub>2</sub>OH
carbon dioxide {tab} CO<sub>2</sub>
CO
MgCl<sub>2</sub>
H<sub>2</sub>O<sub>2</sub>
Display to
Students
See Also:
The {tab} Operator on page 329
Display Matching Items in a Fixed Order
By default, the choices in each column of a matching question are displayed in
random order when the question is used.
You can use either the $ORDERLEFT or $ORDERRIGHT variable to force items in either
the left or right column to be listed in the order in which you specify them in
Answer.
November 2014
38 WebAssign Creating Questions Guide
To list matching items in a specific sequence:
1. Start the first line of Answer with one of the following:
List to be displayed in order
Code
Left (prompt) list
<eqn $ORDERLEFT=1; ''>
Right (drop-down) list
<eqn $ORDERRIGHT=1; ''>
Note: Although you can use both $ORDERLEFT and $ORDERRIGHT
variables together, doing so is not recommended. If both lists are
displayed in a fixed order, students will quickly catch on that the nth
item in the left list always matches the nth item in the right list.
2. Type the items in Answer in the sequence in which they should be displayed
for the specified list.
Example Ordered Matching Question
The following table summarizes an actual question.
QID
1159108
Name
Template2 2.MATCH.03.
Mode
Matching
Question
Match the inventor and the invention.
Answer
<eqn $ORDERLEFT=1; ''>Babbage {tab} analytical engine
Bell {tab} telephone
Edison {tab} phonograph
Franklin {tab} lightning rod
Newton {tab} reflecting telescope
Volta {tab} battery
Whitney {tab} cotton gin
magnifying glass
printing press
Display to
Students
See Also:
The {tab} Operator on page 329
November 2014
Create General-Purpose Questions 39
Create Ranking Questions
Ranking questions require your students to put a list of items in the correct
sequence based on some characteristic of the items.
If you can think about the sequence in which you want your students to rank
items as its own list — from low to high, or some other progression based on the
ranking characteristic — you can see your ranking question as a special case of
a matching question, with the ranking characteristic defining the left list and the
items to be ranked as the right list.
To create a ranking question:
1. Decide how you want to identify the endpoints for ranking, and if you need
to label any other points in the series. For example, you might want to use
“dimmest” and “brightest” as endpoints, or you might want your students to
rank items from 1 to 10. The list describing your ranking characteristic does
not need to specify text for every item being ranked.
2. Click Questions > Create. The Question Editor opens.
3. In Name, type a name for the question.
4. In Mode, select Matching.
5. In Question, type your question.
6. In Answer, type the following code:
<eqn $ORDERLEFT=1; ''>
7. On the same line, type the first item in your ranking characteristic list,
followed by the characters {tab} and the item having the corresponding rank.
Then, press ENTER.
For example, if you were ranking types of electromagnetic radiation by energy
levels and the lowest energy item was microwave:
<eqn $ORDERLEFT=1; ''><i>lowest</i> {tab} microwave
Note:
• To add the {tab} operator, either type the characters {tab} or click
Add tab.You cannot enter {tab} by pressing the TAB key.
• 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.
• Because second-column items are displayed in a drop-down list,
they are displayed without any text formatting. If you need to
include text formatting, such as chemical or math notation, see
Match Formatted Notation or Images on page 36.
8. Type successive items in your ranking characteristic list on separate lines,
each followed by the characters {tab} and the item having the corresponding
rank. Press ENTER after each line.
November 2014
40 WebAssign Creating Questions Guide
Important: If your ranking characteristic list does not specify text
for every item being ranked — for example, in the middle of a ranking
from slowest to fastest — type &nbsp; for the ranking characteristic list
item. This will ensure that the list item is displayed correctly.
9. After typing the final ranking characteristic followed by {tab} and the final
item to be ranked, do not press ENTER. Unlike other matching questions,
ranking questions must have the same number of items in both lists.
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 on page 18.
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 on page 19.
• 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 on page 308.
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 Ranking Question
The following table summarizes an actual question.
November 2014
QID
1078579
Name
Template2 2.RANK.01.
Mode
Matching
Question
Rank the following types of electromagnetic radiation from
lowest
energy to highest energy.
Create General-Purpose Questions 41
Answer
<eqn $ORDERLEFT=1; ''><i>lowest</i> {tab} microwave
&nbsp; {tab} infrared
&nbsp; {tab} visible
&nbsp; {tab} ultraviolet
<i>highest</i> {tab} x-ray
Display to
Students
Example Ranking Question with Equality
Sometimes, you need to allow your students to specify multiple items as being
equal to each other in rank. You can use distractors to facilitate this behavior. The
following table summarizes an actual question.
QID
1247378
Name
Template2 2.RANK.02.
Mode
Matching
Question
The figure shows a series of sound waves leaving a moving
source.
<div class="indent"><userimage(103873)></div>
Rank the locations by frequency heard by a stationary listener
at
each letter location.
Answer
<eqn $ORDERLEFT=1; ''><i>lowest</i> {tab} B
&nbsp; {tab} A and D
&nbsp; {tab} C
<i>highest</i> {tab} E
A
D
A and B
A and C
A and E
B and C
B and D
B and E
C and D
C and E
D and E
November 2014
42 WebAssign Creating Questions Guide
Display to
Students
See Also:
Create Questions with the Question Editor on page 7
The {tab} Operator on page 329
Create Fill-in-the-Blank Questions
Fill-in-the-blank questions provide an answer box for students to type a short
textual response, and are used when the correct answer can be stated in a word
or short phrase for which only a small number of acceptable variations exist.
Note: For questions that should be evaluated numerically or
mathematically, create one of the numerical or math question types, not
fill-in-the-blank. See Create Integer or Decimal Number Questions on page
95 or Create Math Questions on page 117.
By default, spaces and character case are not considered when scoring fill-inthe-blank questions; thus, Isaac Newton, isaac newton, and iSaaCnewtOn
®
would all be considered equivalent answers. You can force WebAssign to consider
character case, spaces, or both.
By default, answer format tips tell your students if your question is case-sensitive.
You can hide answer format tips for your assignments.
To create a fill-in-the-blank question:
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. In Question, type your question.
Use the answer placeholder string <_> to specify where the answer box should
be displayed.
5. Optional: Set grading and display options for the answer box.
November 2014
Create General-Purpose Questions 43
Option
Begin Answer With:
Notes
Make the question
case-sensitive
<EQN $CASE=1; ''>
By default, answers are not casesensitive.
Make the question
space-sensitive
<EQN $SPACE=1; ''>
By default, spaces are ignored when
grading answers.
Make the answer box n <EQN $size=n; ''>
characters wide
By default, the answer box is 10
characters wide.
Changing the size of the answer box
does not restrict the length of your
students' responses.
You can combine these declarations using a single <EQN> tag by separating
each declaration with a semicolon.
For example:
<EQN $CASE=1; $SPACE=1; $size=20; ''>
6. In Answer, type one or more correct answers to the question on a single line,
separated by the characters {tab}.
Note:
• To add the {tab} operator, either type the characters {tab} or click
Add tab.You cannot enter {tab} by pressing the TAB key.
• 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.
7. 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.
8. Click Test/Preview to test the appearance and behavior of the question. See
Test Questions on page 18.
9. Click Redisplay to show certain kinds of errors in the Display section of the
Question Editor. Make any needed changes to your question.
10. 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 on page 19.
• 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 on page 308.
11. When your question displays and functions correctly, click Save.
November 2014
44 WebAssign Creating Questions Guide
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 Fill-in-the-Blank Question
The following table summarizes an actual question.
QID
1069783
Name
Template2 2.FITB.01.
Mode
Fill-in-the-Blank
Question
Who wrote the <i>Principia Mathematica®</i>? <br> <_>
Answer
<eqn $CASE=1; $size=20; ''>Newton {tab} Isaac Newton {tab} Sir
Isaac Newton
Display to
Students
See Also:
Create Questions with the Question Editor on page 7
The {tab} Operator on page 329
Create File Upload Questions
File upload questions allow your students to submit a file — for example, a
spreadsheet, presentation, or research paper — as their response.
®
File upload questions are not automatically graded by WebAssign ; they must be
manually graded.
To create a file upload question:
1. Click Questions > Create. The Question Editor opens.
2. In Name, type a name for the question.
3. In Mode, select File-Upload.
4. In Question, type your question. Use the answer placeholder string <_> to
specify where the answer box should be displayed. Describe any restrictions
on the file type or size that will be accepted.
5. Optionally, set the $FILEUPLOADMAX, $ACCEPTFILETYPE, or $size variables at the
beginning of Answer to specify any restrictions on the size or type of file to
be uploaded, or to set the size of the file upload box.
November 2014
Create General-Purpose Questions 45
• By default, files that your students upload must be no larger than
100 KB. Although you can increase this size if needed, encourage your
students to submit the smallest file size they can. This both helps your
students who might have limited connection speeds, and it helps you,
because you will need to download all of your students' files to score
them. Students who upload extremely large files might experience
timeouts depending on their Internet connection and browser settings.
• By default, your students can submit any file type. When restricting
allowable file types, let your students know ahead of time what file
formats will be accepted. You should ensure that you will be able to
safely open and view any files that your students submit. At the same
time, unless the assignment requires use of a specific application or
creation of a specific type of file, you might not want to impose arbitrary
restrictions on the tools that your students can use.
To do this:
Begin Answer with this:
Set the maximum
allowed file size to n
bytes
<eqn $FILEUPLOADMAX=n; ''>
Restrict file uploads to
files with the specified
filename extensions
<eqn $ACCEPTFILETYPE=['.ext', '.ext']; ''>
Make the file upload box <eqn $size=n; ''>
n characters wide
You can combine these declarations using a single <eqn> tag by separating
each declaration with a semicolon. For example:
<eqn $FILEUPLOADMAX=52488; $ACCEPTFILETYPE=['.doc',
'.docx','.odt','.pdf']; ''>
6. In Answer, type a key to help the grader evaluate the student's response.
This will often reference a rubric used to assess the submitted file. This
information and any <eqn> tags should all be on a single line.
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.
Even if you will be grading the questions yourself, you must enter something
in Answer in order for the file upload box to be displayed when the question
is used.
7. 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.
8. Click Test/Preview to test the appearance and behavior of the question. See
Test Questions on page 18.
November 2014
46 WebAssign Creating Questions Guide
9. Click Redisplay to show certain kinds of errors in the Display section of the
Question Editor. Make any needed changes to your question.
10. 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 on page 19.
• 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 on page 308.
11. 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 File Upload Question
The following table summarizes an actual question.
QID
1078920
Name
Template2 2.FILE.01.
Mode
File-Upload
Question
Upload your research project. <_><br>
You can upload a PDF, Word, or OpenOffice Writer file. It must
be less than 512 KB in size.
Answer
<eqn $size=5; $FILEUPLOADMAX = 524288; $ACCEPTFILETYPE =
['.doc','.docx','.odt','.pdf']; ''>Use the rubric.
Display to
Students
See Also:
Create Questions with the Question Editor on page 7
Create PencilPad (Drawing) Questions
PencilPad questions allow your students to create and submit a drawing in
®
WebAssign .
®
PencilPad questions are not automatically graded by WebAssign ; they must be
manually graded.
November 2014
Create General-Purpose Questions 47
To create a PencilPad question:
1. Click Questions > Create. The Question Editor opens.
2. In Name, type a name for the question.
3. In Mode, select PencilPad.
4. In Question, type your question. Use the answer placeholder string <_> to
specify where the answer box should be displayed.
5. In Answer, type a key that will help the grader determine whether or not the
student's answer is correct. The key must be on a single line.
Note:
• Even if you will be grading the PencilPad answers yourself, you
must enter something in Answer.
• 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.
Tip: Because PencilPad questions require students to submit a
drawing, you might want to add an image to the key to help the grader.
1. Under Page Tools, click My Files. If you have already uploaded
®
your image to WebAssign , skip to step 5.h on page 47.
2. In the My Files window, click
Import File.
3. Click Browse or Choose File, depending on your browser.
4. Navigate to the file you want to upload.
5. Click Open or Choose, depending on your browser.
6. In the Import File window, click go.
7. Close the Import File window.
8. In the My Files window, navigate to the file you want to use and
select its check box.
9. Set Paste location of file (selected below) as to Image.
10. Set Destination Field to Answer.
11. Click go. A <userimage> tag is added to Answer on a new line.
12. Move the <userimage> tag to the same line as the key for your
question.
6. 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.
7. Click Test/Preview to test the appearance and behavior of the question. See
Test Questions on page 18.
November 2014
48 WebAssign Creating Questions Guide
8. Click Redisplay to show certain kinds of errors in the Display section of the
Question Editor. Make any needed changes to your question.
9. 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 on page 19.
• 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 on page 308.
10. 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 PencilPad Question
The following table summarizes an actual question.
November 2014
QID
1078917
Name
Template2 2.PP.01.
Mode
PencilPad
Question
Draw a picture of a sine wave. Identify the Crest, Trough,
Amplitude,
and Wavelength.<br>
You can use the letters C, T, A, W for labels.<_>
Answer
<userimage(92022)><br>Student must correctly identify all parts
for
credit.
Create General-Purpose Questions 49
Key
Display
Display to
Students
See Also:
Create Questions with the Question Editor on page 7
November 2014
50 WebAssign Creating Questions Guide
Create Free Response Questions
Short-answer and essay questions are free response questions that allow your
students to demonstrate their knowledge by providing an extended textual answer
in their own words. There is no qualitative difference between the two kinds of
questions; whether you describe the question as short-answer or essay generally
is a reflection of the length of the expected response.
®
Short-answer and essay questions are not automatically graded by WebAssign ;
they must be manually graded.
To create a short-answer or essay question:
1. Click Questions > Create. The Question Editor opens.
2. In Name, type a name for the question.
3. In Mode, select Essay.
4. In Question, type your question. Use the answer placeholder string <_> to
specify where the answer box should be displayed.
5. Optionally, set the $rows or $cols variables at the beginning of Answer to
change the size of the answer box.
To do this:
Begin Answer with this:
Make the answer box n rows high
<eqn $rows=n; ''>
Make the answer box n characters
wide
<eqn $cols=n; ''>
You can combine these declarations using a single <eqn> tag by separating
each declaration with a semicolon. For example:
<eqn $rows=10; $cols=60; ''>
The default size of the answer box is 6 rows by 65 characters. The size of the
answer box does not constrain the length of the student's response, but it can
suggest to students whether a brief or extended answer is expected.
Tip: If an extended answer is required, you might suggest to students
that they can compose their answer using their preferred wordprocessing software, and then copy and paste the text into the answer
box when they are ready to submit their response.
6. In Answer, type a key that will help the grader determine whether or not the
student's response is correct.
You might state the points that should be awarded for correctly addressing
particular topics, or refer to a grading rubric. The key must be on a single line.
November 2014
Create General-Purpose Questions 51
Note:
• Even if you will be grading the essay answers yourself, you must
type a key in Answer for the question to display correctly. You
can use two periods for the answer key if you do not want to
include meaningful text.
• 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.
7. 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.
8. Click Test/Preview to test the appearance and behavior of the question. See
Test Questions on page 18.
9. Click Redisplay to show certain kinds of errors in the Display section of the
Question Editor. Make any needed changes to your question.
10. 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 on page 19.
• 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 on page 308.
11. 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 Short-answer or Essay Question
The following table summarizes an actual question.
QID
1070062
Name
Template2 2.ESS.01.
Mode
Essay
Question
Define economics in your own words.<_>
Answer
<eqn $rows=3; $cols=60; ''>Economics is the social science
that
studies the production, distribution, and consumption of goods
and services.
November 2014
52 WebAssign Creating Questions Guide
Display to
Students
See Also:
Create Questions with the Question Editor on page 7
Create Image Map Questions
An image map question requires your students to identify something in an image
by clicking the image. Image map questions are particularly useful when you
want your students to identify a named anatomical part in an illustration or
geographical feature in a map.
To create an image map question:
1. Create the image file that you want to use for your question.
Best Practice: Keep the image dimensions smaller than 800 by 600
pixels to ensure that the image is displayed in the question without
scrolling.
2. Click Questions > Create. The Question Editor opens.
3. In Name, type a name for the question.
4. In Mode, select Image Map.
5. In Question, type your question.
6. Click My Files under Page Tools.
®
7. If you have not already uploaded your image to WebAssign , use the following
steps to do so.
a) Click
Import File.
b) Click Browse or Choose File, depending on your browser.
c) Navigate to the file you want to upload.
d) Click Open or Choose, depending on your browser.
e) Click go.
Note: Uploading a large file might take some time, especially with
a slower Internet connection.
8. In the My Files window, navigate to the file you want to use and select its
check box.
November 2014
Create General-Purpose Questions 53
9. Set Paste location of file (selected below) as to ID Only.
10. Set Destination Field to Question.
11. Click go.
®
The unique WebAssign ID number for the image is added to Question on a
new line.
12. Edit the line with the image ID number to add an answer placeholder string
for the image map question like the following:
<_ src="ID">
where ID is the ID number of the image you want to use. You can move this
answer placeholder string to wherever it should be displayed in the question.
13. Click Redisplay.
The question and image are displayed in the Display section of the Question
Editor.
14. Click Coordinates below the image.
15. In the Coordinates window, select a shape and define the boundaries for
a part of the image that your students should click to correctly answer the
question.
Note: Each shape defines a single key for the answer. You can define
multiple keys to allow students to click any of several areas of the
image for a correct response.
• To add a rectangular key, click rectangle. Click the image to set the
upper left point of the key. Click the image to set the lower right point.
• To add a circular key, click circle. Click the image to set the center of the
circle. Click the image at the edge of the circle to set the radius.
• To add a polygonal key, click polygon. Click the image at each vertex of
the polygon, specifying adjacent vertices consecutively.
Click Draw Key to preview the key on your image. The key you defined is
drawn in bright green on the image, and its definition is added to a list of Keys
below the image.
If a key is not correct, select its check box and click Remove Selected.
Tip: To fine-tune the dimensions for a key that is not quite correct,
add a new key of the same shape. Using the not-quite-correct key as
a reference, type the new coordinate values instead of clicking the
image.
Repeat this step until you have defined all the keys you need for the question.
November 2014
54 WebAssign Creating Questions Guide
16. When the keys are drawn correctly on the image, select the check boxes for
the keys you want to use and click Add Selected Key to Answer.
The Coordinates window closes and the keys are added to Answer.
Important:
If you need to use the Coordinates window more than once to add keys
to your question, you will need to manually edit the keys in Answer to
ensure that all of the keys for each question part are listed on a single
line and are delimited with the {tab} characters.
This is necessary because although all of the keys for a question part
must be listed on the same line, each time you click Add Selected
Key to Answer, the keys are added on a new line.
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.
If you need to manually edit the keys in Answer, the following reference
information about how image map keys are specified might be useful:
November 2014
Create General-Purpose Questions 55
Shape
Key
Rectangle
rect:left_x,top_y,right_x,bottom_y
Circle
circle:center_x,center_y,radius
Polygon
poly:x1,y1,x2,y2,x3,y3...
17. 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.
18. Click Test/Preview to test the appearance and behavior of the question. See
Test Questions on page 18.
19. Click Redisplay to show certain kinds of errors in the Display section of the
Question Editor. Make any needed changes to your question.
20. 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 on page 19.
• 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 on page 308.
21. 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 Image Map Question
The following table summarizes an actual question.
QID
1159575
Name
Template2 2.MAP.01.
Mode
Image Map
Question
Click the cochlea to identify it. <br>
<_ src="92012">
Answer
circle:310,175,24
November 2014
56 WebAssign Creating Questions Guide
Display to
Students
See Also:
Create Questions with the Question Editor on page 7
The {tab} Operator on page 329
November 2014
3
Create Multi-Part and Tutorial
Questions
This chapter contains the
following topics:
• Create Multi-Part Questions That
Have One Question Mode
• Create Multi-Mode Questions
• Create Polling Questions
• Add Expandable Sections to MultiPart Questions
• Create Tutorial Questions
• Delete Parts of Multi-Mode Questions
Single-part questions work well for assessment and practice of
simple factual material. But you can provide a richer learning
experience for your students by creating multi-part or tutorial
questions. You can format your questions with expandable
headings to group question parts.
• Multi-part questions have multiple question parts,
and can be created using just one question mode or
by combining multiple question modes (multi-mode
questions).
• Tutorial questions help your students work step by step
through a series of question parts designed to provide
instruction about a concept or procedure.
See Also:
Create Questions with the Question Editor on page 7
Understanding the <eqn> and <EQN> Tags on page 312
November 2014
58 WebAssign Creating Questions Guide
Create Multi-Part Questions That Have One Question
Mode
When all parts of your question use the same question mode — for example,
numerical — you can add additional answer placeholder strings <_> in Question
and additional answer keys in Answer. For multiple-choice, multiple-select, and
matching questions, you also need to indicate where each new set of answer
choices begins.
For most question modes, each answer box is created by adding the answer
placeholder string <_> in Question, and each answer key is specified using a
single line in Answer. Each new answer placeholder string <_> and answer key
create a new question part.
For multiple-choice, multiple-select, and matching questions, however, each
answer key is specified using multiple lines, so you must indicate the beginning of
each new answer key in one of the following ways:
• For multiple-choice questions, add the <MCPART> tag at the start of each new
answer key.
• For multiple-select questions, add the <MSPART> tag at the start of each new
answer key.
• For matching questions, no tag is provided. Instead, create the question as
a multi-mode question with multiple matching parts. See Create Multi-Mode
Questions on page 61.
To create a multi-part question that uses only one question
mode:
1. Click Questions > Create. The Question Editor opens.
2. In Name, type a name for the question.
3. In Mode, select the question mode that you want to use.
4. In Question, type your question. Use an answer placeholder string <_> to
specify where the answer box should be displayed for each question part.
Tip: Optionally, add the <MARK> tag to specify where the correct/
incorrect mark should be displayed for each question part. This might
be necessary when displaying answer choices horizontally or in tables
for multiple-choice or multiple-select questions.
5. In Answer, provide an answer key for each question part.
• For a multiple-choice question, type <MCPART> at the beginning of each
new set of choices after the first question part.
• For a multiple-select question, type <MSPART> at the beginning of each
new set of choices after the first question part.
• For a matching question, create the question as a multi-mode question
with multiple matching parts. See Create Multi-Mode Questions on page
61.
November 2014
Create Multi-Part and Tutorial Questions 59
• For all other question modes, provide each answer key on a single line as
described in the documentation for that question type.
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.
Important:
Each line in Answer is significant.
• Do not specify <MCPART> or <MSPART> on a separate line.
• Do not add blank lines in Answer, for example, by pressing
ENTER after the last answer key.
6. 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.
7. Click Test/Preview to test the appearance and behavior of the question. See
Test Questions on page 18.
8. Click Redisplay to show certain kinds of errors in the Display section of the
Question Editor. Make any needed changes to your question.
9. 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 on page 19.
• 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 on page 308.
10. 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 Multi-Part Numerical Question
The following table summarizes an actual question.
QID
1589520
Name
Template2 3.MULTP.01.
Mode
Numerical
November 2014
60 WebAssign Creating Questions Guide
Question
Find the following for a sphere having a diameter of 8 cm.
Specify units.<br>
Volume: <_><br>
Surface area: <_>
Answer
268.08 cm^3
201.06 cm^2
Display
Example Multi-Part Multiple-Choice Question
The following table summarizes an actual question.
QID
1589518
Name
Template2 3.MULTP.02.
Mode
Multiple-Choice
Question
Identify the organ system to which each organ belongs.<br>
heart <_><br>
lungs <_><br>
kidneys <_>
Answer
<EQN $PULLDOWN=1; $ORDERED=1; ''>circulatory system
digestive system
endocrine system
excretory system
lymphatic system
nervous system
reproductive system
respiratory system
<MCPART><EQN $PULLDOWN=1; $ORDERED=8; ''>circulatory system
digestive system
endocrine system
excretory system
lymphatic system
nervous system
reproductive system
respiratory system
<MCPART><EQN $PULLDOWN=1; $ORDERED=4; ''>circulatory system
digestive system
endocrine system
excretory system
lymphatic system
nervous system
reproductive system
respiratory system
Display to
Students
November 2014
Create Multi-Part and Tutorial Questions 61
Example Multi-Part Multiple-Select Question
The following table summarizes an actual question.
QID
1589516
Name
Template2 3.MULTP.03.
Mode
Multiple-Select
Question
Identify the primary colors: <br><_> <_> <_> <_> <_> <_> <MARK>
<br><br>
Identify the secondary colors: <br><_> <_> <_> <_> <_> <_>
<MARK>
Answer
<EQN $ORDERED=[1,3,5]; $SET_EACH_POSITION=1; ''>red
orange
yellow
green
blue
purple
<MSPART><EQN $ORDERED=[2,4,6]; $SET_EACH_POSITION=1; ''>red
orange
yellow
green
blue
purple
Display to
Students
Create Multi-Mode Questions
When different parts of your question use different question modes — for
example, numerical and multiple-choice — you can create a multi-mode question
to specify a list of the modes used in your question, and indicate where each new
mode begins with <SECTION> tags in both Question and Answer. You use this
method also when creating multi-part matching questions.
To create a multi-mode question:
1. Click Questions > Create. The Question Editor opens.
2. In Name, type a name for the question.
3. Beside Mode, click Multi-Mode Options.
November 2014
62 WebAssign Creating Questions Guide
4. In the Multi-Mode Options window, click the question modes that you want to
use in your question in the order in which they will be used, or type the mode
abbreviations in the Current Modes box at the bottom.
Each mode that you add is shown in the Current Modes list on the right. You
can click
to delete a mode from the list, or drag a mode to rearrange the
list.
Important: When your question has consecutive multiple-choice,
multiple-select, or matching question parts, you must specify the mode
for each question part, for example, MM to create a question with two
matching parts.
For other question modes, you can choose to specify the mode either
for each question part or only when the question mode changes. For
example, to create a question with three numerical question parts
followed by a multiple-choice part, you could select either NNNC or
simply NC.
Tip: The Poll mode lets you create polling questions with other modes.
See Create Polling Questions on page 66.
When the list of modes is correct, click Save.
5. In Question, type your question.
After the first question mode, type the <SECTION> tag at the start of each
additional question mode. If you specified consecutive instances of the same
mode — for example, MM for two matching parts — type a <SECTION> tag at
the beginning of each subsequent question part. By default, the <SECTION> tag
adds a line break. If you do not want a line break added, type <SECTION NOBR>.
Use an answer placeholder string <_> to specify where the answer box should
be displayed for each question part.
Note: Omit the answer placeholder string <_> for matching question
parts.
November 2014
Create Multi-Part and Tutorial Questions 63
Tip: Optionally, add the <MARK> tag to specify where the correct/
incorrect mark should be displayed for each question part. This might
be necessary when displaying answer choices horizontally or in tables
for multiple-choice or multiple-select questions.
6. In Answer, provide an answer key for each question part as described in the
documentation for that question type.
After the first question mode, type the <SECTION> tag at the start of each
additional question mode. If you specified consecutive instances of the same
mode — for example, MM for two matching parts — type a <SECTION> tag at
the beginning of each subsequent question part.
Each line in Answer is significant.
• Do not specify <SECTION>, <MCPART>, or <MSPART> on a separate line.
• Do not add blank lines in Answer, for example, by pressing ENTER after
the last answer key.
Note: To avoid several common errors with multi-mode questions,
check your question carefully to ensure all of the following:
• The question specifies the correct number of modes.
• Question includes a <SECTION> tag at the start of each new mode
after the first mode.
• Question contains one fewer <SECTION> tag than modes.
• Answer contains a corresponding <SECTION> tag for every
<SECTION> tag in Question.
• In Answer, the answer key for each section begins immediately
after the <SECTION> tag on the same line, not on a separate line.
7. 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.
8. Click Test/Preview to test the appearance and behavior of the question. See
Test Questions on page 18.
9. Click Redisplay to show certain kinds of errors in the Display section of the
Question Editor. Make any needed changes to your question.
10. 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 on page 19.
• 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 on page 308.
11. When your question displays and functions correctly, click Save.
November 2014
64 WebAssign Creating Questions Guide
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 Multi-Mode Question (Fill-in-the-Blank and
Multiple-Choice)
The following table summarizes an actual question.
QID
1589516
Name
Template2 3.MULTM.01.
Mode
Multi-Mode...BC
Question
Cephalopoda, Gastropoda, and Bivalvia are all classes of
phylum
<_>.
<SECTION>These animals are <_>.
Answer
Mollusca
<SECTION><EQN $PULLDOWN=1; ''>invertebrates
vertebrates
Display
Example Multi-Mode Question (Algebraic, Numerical, and
Multiple- Choice)
The following table summarizes an actual question.
November 2014
QID
1589510
Name
Template2 3.MULTM.02.
Mode
Multi-Mode...QNC
Question
What is the formula for the volume of a sphere (use <i>r</i>
for
the radius)? <br>
<i>V</i> = <_>
<SECTION>What is the volume of a sphere with a radius of 5?
<br>
<_>
<SECTION>If the radius doubles, what happens to the volume?
<br>
<_>
Create Multi-Part and Tutorial Questions 65
Answer
<EQN $PAD='devmath'; ''>r: 4/3 * pi * r^3
<SECTION>523.599
<SECTION>The volume increases by a factor of 2<sup>3</sup>
The volume remains the same
The volume doubles
The volume quadruples
It depends on the sphere
Display
Example Multi-Part Matching Question
The following table summarizes an actual question.
QID
1589512
Name
Template2 3.MULTM.03.
Mode
Multi-Mode...MM
Question
Order the <b>terrestrial</b> planets by their
characteristics.<br><br>
<b>Average orbital distance from the Sun <MARK></b>
<SECTION><b>Mass <MARK></b>
Answer
<EQN $ORDERLEFT=1; ''><i>nearest the sun</i> {tab} Mercury
&nbsp; {tab} Venus
&nbsp; {tab} Earth
<i>furthest from the sun</i> {tab} Mars
Jupiter
Saturn
Uranus
Neptune
<SECTION><EQN $ORDERLEFT=1; ''><i>least massive</i> {tab}
Mercury
&nbsp; {tab} Mars
&nbsp; {tab} Venus
<i>most massive</i> {tab} Earth
Uranus
Neptune
Saturn
Jupiter
November 2014
66 WebAssign Creating Questions Guide
Display
See Also:
The {tab} Operator on page 329
Create Polling Questions
You can configure one or more question parts as polling questions in order
to grant students credit for any response. You can use polling questions to
gather opinions from your students (as in a poll) or to record observational
information, for example, the results of an experiment, when any response should
be considered correct.
Note: To gather numerical data from experiments, see Create AnswerDependent Questions on page 111.
Your students' responses, marks, and scores are shown normally for polling
questions, as per your assignment settings. The only difference is that polling
questions are marked correct for any response. Your students receive no credit if
they do not respond to the question.
To configure a question mode as a polling question:
1. If needed, open your question in the Question Editor.
2. Beside Mode, click Multi-Mode Options.
3. In the Multi-Mode Options window, add the Poll mode before the mode that
you want to use as a polling question.
You can use either the mode buttons or the mode abbreviation:
• Click Poll in the list of Available Modes, and then drag it above the mode
you want to use in the Current Modes list on the right.
• Type P before the mode you want to use in the Current Modes box at
the bottom.
November 2014
Create Multi-Part and Tutorial Questions 67
Note:
• The entire question mode is configured as a polling question. To
add subsequent question parts that are not polling questions,
add a new mode after the configured mode. Remember to add
<SECTION> tags in Question and Answer.
• When you configure multiple-choice or multiple-select modes as
polling questions, the order of the choices is not randomized.
4. When the list of modes is correct, click Save.
5. Click Test/Preview to test the appearance and behavior of the question. See
Test Questions on page 18.
6. 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 Polling Question
The following table summarizes an actual question.
QID
1589521
Name
Template2 3.MULTM.04.
Mode
Multi-Mode...PCE
Question
Was your experiment successful?
<_>
<SECTION>Explain
<_>
Answer
Yes
No
<SECTION>Student explanation
Display
November 2014
68 WebAssign Creating Questions Guide
Add Expandable Sections to Multi-Part Questions
Because multi-part and multi-mode questions can be long, you can use the
<accordion> and <part> tags to subdivide your question into sections that your
students can individually expand or collapse. This lets your students work through
the question in whatever order they choose. Each expandable section can include
one or more question parts or instructional content.
Note: To make your students work through a question in order from
beginning to end, use the <tutorial> tag to create a tutorial question.
Important: Do not use the <accordion> and <tutorial> tags in the same
question. The one exception to this rule is that in a question that uses the
<accordion> tag, you can create a popup tutorial.
To add expandable sections to a multi-part or multi-mode
question:
1. Open your question in the Question Editor.
2. In Question, add <accordion> and <part> tags as needed.
Enclose a set of expandable sections with the <accordion> tag. You must use
the closing </accordion> tag at the end of the expandable sections.
Enclose each expandable section with the <part> tag. You must use the
closing </part> tag at the end of each section.
Note: The <part> and <SECTION> tags are not interchangeable. You
must specify the <SECTION> tag wherever the question mode changes.
For example:
<accordion>
<part>My first part: <_></part>
<part><SECTION>My second part: <_></part>
</accordion>
3. Optionally, add <part_label> or <part_title> tags for each section.
By default, the title bar for the first expandable section displays the part label
Part 1, and subsequent parts are numbered consecutively. You can use the
<part_label> tag to change the part label for any part, or the <part_title>
tag to add text that follows the part label.
For example, the following code displays A - Introductory Material in the
section title bar:
<part><part_label>A</part_label>
<part_title>Introductory Material</part_title>
4. Click Test/Preview to test the appearance and behavior of the question. See
Test Questions on page 18.
5. When your question displays and functions correctly, click Save.
November 2014
Create Multi-Part and Tutorial Questions 69
Example Accordion Question
The following table summarizes an actual question.
QID
1589515
Name
Template2 3.ACC.01.
Mode
Multi-Mode...CCCCE
Question
<b>Battle of Guilford Courthouse</b>
<accordion><part><part_label>Part I</part_label><part_title>MultipleChoice</part_title>
When did this battle take place? <_><br>
<SECTION>Where did this battle take place? <_><br>
<SECTION>Who were the commanders? Americans:<_> <SECTION NOBR>British:<_><br>
</part>
<part><part_label>Part II</part_label><part_title>Short-Answer</part_title>
<SECTION>What was the outcome of this battle, and why was it a turning point
in the
Revolutionary War? <_><br>
</part></accordion>
Answer
<EQN $PULLDOWN=1; ''>March 15, 1781
July 4, 1776
April 19, 1775
October 9, 1781
June 16, 1775
<SECTION><EQN $PULLDOWN=1; ''>Greensboro, NC
Yorktown, VA
Charlestown, MA
Manhattan, NY
Cowpens, SC
<SECTION><EQN $PULLDOWN=1; ''>Nathanael Greene
George Washington
Dr. Joseph Warren
Israel Putnam
William Prescott
<SECTION><EQN $PULLDOWN=1; ''>Lord Cornwallis
Sir William Howe
Sir Henry Clinton
Banastre Tarleton
General John Burgoyne
<SECTION>Although Cornwallis technically won the battle, his forces were
severely
weakened, leading to his eventual surrender to Washington at Yorktown.
November 2014
70 WebAssign Creating Questions Guide
Display
Create Tutorial Questions
You can transform part or all of a multi-part or multi-mode question into a tutorial
that guides your students step by step through the solution of a problem.
Tutorial questions have a distinctive user flow:
• Students must either correctly answer, skip, or use all of their submissions
for each step before viewing the next step.
• Students cannot go back to complete steps they have skipped.
• The answer key is always displayed for steps after all submissions have been
used or the step is answered correctly or skipped.
• Students can click tutorial hint icons
to display hints.
Note:
• You cannot turn off display of answer keys or tutorial hints within a
tutorial question.
• To let your students work through a question in any order, see Add
Expandable Sections to Multi-Part Questions on page 68.
As the name suggests, you use tutorial questions principally to help your students
learn, not to evaluate their progress. Frequently, tutorials are used to help
students understand how to solve a problem posed in the question. Because of
this, sometimes you might not want your tutorial questions to count toward your
students' assignment scores. You can create both scored tutorials and unscored
popup tutorials.
• Scored tutorial questions are shown in the assignment itself and count
toward the assignment score. In the Assignment Editor, you can set the point
value for the entire tutorial or for each question part.
• Popup tutorial questions are shown as buttons in the assignment, and do
not count toward the assignment score. When your students click the button,
the tutorial opens in a new window.
November 2014
Create Multi-Part and Tutorial Questions 71
Your tutorial might be the entire question or only part of the question. You can
create more than one tutorial in a single question, and you can mix scored and
popup tutorials in the same question.
Important: For scored tutorial questions to work correctly, you must
allow question part submission in your assignment.
Create Scored Tutorial Questions
You can transform part or all of a multi-part or multi-mode question into a scored
tutorial that guides your students step by step through the solution of a problem.
Scored tutorial questions are shown in the assignment itself and count toward the
assignment score. In the Assignment Editor, you can set the point value for the
entire tutorial or for each question part.
Note:
• To create a tutorial that is not scored and is displayed in a separate
window, see Create Popup Tutorial Questions on page 75.
• To let your students work through a question in any order, see Add
Expandable Sections to Multi-Part Questions on page 68.
Important:
• Do not use the <accordion> and <tutorial> tags in the same question.
The one exception to this rule is that in a question that uses the
<accordion> tag, you can create a popup tutorial.
• For scored tutorial questions to work correctly, you must allow
question part submission in your assignment.
Your tutorial might be the entire question or only part of the question. You can
create more than one tutorial in a single question, and you can mix scored and
popup tutorials in the same question.
Skipping and Points
For scored tutorials, the decision about whether to allow students to skip tutorial
steps affects not only your students' learning experience, but also the points that
they can earn for the tutorial.
By default, your students are allowed to skip tutorial steps, but they cannot go
back later to complete the skipped steps. This means that students who skip a
step permanently forgo any points they could have earned on the step, but they
have an opportunity to earn points on any remaining steps in the tutorial.
If you disallow skipping, your students must either answer each step correctly or
use all of their submissions for the step before going on to the next step.
Each method has its merits. Skipping steps gives your students an opportunity
to move through the tutorial more quickly if they do not understand a step.
November 2014
72 WebAssign Creating Questions Guide
Disallowing skipping encourages your students to attempt each step, even if only
by guessing.
Tip: If you disallow skipping, the number of allowed submissions for
the tutorial question is very important. Too many submissions might
cause students to give up on a step that they do not understand; too few
submissions might not give students enough opportunity to figure out a
step for themselves before showing the correct answer.
To create a scored tutorial from a multi-part or multi-mode
question:
1. Open your question in the Question Editor.
2. In Question, add the <tutorial> tag at the beginning of your tutorial.
You can set several attributes to change the way your tutorial behaves.
Attribute
Description
order="ascending"
Shows steps in ascending order with the current step at the
bottom. (By default, steps are displayed in ascending order
with the current step at the top.)
order="descending"
Shows steps in descending order with the current step at the
top. (By default, steps are displayed in ascending order with
the current step at the top.)
skip="no"
Requires students to answer each step correctly or use all
their submissions before going on to the next step. (By
default, students can skip tutorial steps.)
skip_text="text"
Renames the Skip button to text (if you allow students to skip
tutorial steps.)
For example:
<tutorial order="ascending" skip_text="Show the answer (no points
earned) and move to the next step">
3. After the <tutorial> tag, use the <premise> tag to set a title for the tutorial
and display the overall problem or concept the tutorial addresses. You must
use the closing </premise> tag at the end of the premise.
Note:
• You must specify a title attribute for the <premise> tag.
• Do not include any answer boxes in the premise.
• The premise is always displayed at the top of the tutorial.
• The premise is optional, but strongly recommended.
For example:
<premise title="Multiplying Fractions">
When you multiply fractions, you multiply the numerators and you
multiply the denominators.<br><br>
<watex>\[ \frac{3}{4} * \frac{13}{16} = \]</watex>
November 2014
Create Multi-Part and Tutorial Questions 73
</premise>
4. Enclose each tutorial step with the <step> tag. You must use the closing </
step> tag at the end of each step.
You can set several attributes to change the way each step is displayed.
Attribute
Description
button="text"
Requires students to click a button with the specified text
in order to see the step. (By default, each step is displayed
as soon as the student either correctly answers or skips the
previous step.)
label="text"
Replaces the default label Step n of m with the specified
text.
title="text"
Displays the specified text after the step label.
skip_text="text"
Renames the Skip button to text (if you allow students to
skip tutorial steps.)
Note: The <step> and <SECTION> tags are not interchangeable. You
must specify the <SECTION> tag wherever the question mode changes.
For example:
<step button="Start" label="Part I" title="Multiply the
Numerators">
3 · 13 = <_>
</step>
5. Optionally, add tutorial hints in any step with the <hint> tag. You must end
each hint with the closing </hint> tag.
Tutorial hints are shown as a lightbulb icon
and display either Hint or a
label that you specify with the label attribute. When your student clicks the
icon, the contents of the <hint> tag are displayed in place of the label.
Note:
• The <hint> tag can be used only in <step>.
• Each step can contain only one <hint> tag.
• The <hint> and <HINT> tags are not interchangeable.
For example:
<hint label="Show hint">Use the Pythagorean Theorem.</hint>
6. Optionally, use the <conclusion> tag to display information after your students
complete or skip the last step.
You must end the conclusion with the closing </conclusion> tag.
Note: You must specify a title attribute for the <conclusion> tag.
For example:
<conclusion title="Conclusion">You have finished the
tutorial.</conclusion>
November 2014
74 WebAssign Creating Questions Guide
7. End the tutorial with the closing </tutorial> tag.
8. Click Test/Preview to test the appearance and behavior of the question. See
Test Questions on page 18.
9. 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 Tutorial Question
The following table summarizes an actual question.
QID
1251029
Name
Template2 3.TUT.01.
Mode
Multi-Mode...QN
Question
<tutorial skip="no" order="ascending">
<premise title="Using the Substitution Method">
<watex>For simple systems of equations, you can often use the substitution
method to
solve for \[x\] and \[y\].\vspace{1em}\[ x + y = 6 \\ x - y = 2
\]</watex></premise>
<step><watex>Solve for \[x\] in terms of \[y\].\vspace{1em}
\[ x + y = 6 \\ x = <_> \]</watex></step>
<step><watex>Rewrite the second equation, substituting \[ 6-y \] for \[ x \].
\vspace{1em}\[ x - y = 2 \\ <_> = 2 \]</watex></step>
<SECTION><step><watex>Solve for \[y\].\vspace{1em}\[ 6 - y - y = 2 \\ y =
<_>
\]</watex></step>
<step><watex>Substitute 2 for \[y\] in either equation and solve for
\[x\].\vspace{1em}
\[ x + 2 = 6 \\x - 2 = 2 \\ x = <_> \]</watex></step>
</tutorial>
Answer
<EQN $PAD='devmath'; ''>y:6-y
<EQN $PAD='devmath'; ''>y:(6-y)-y
<SECTION><EQN $size=2; ''>2
<EQN $size=2; ''>4
November 2014
Create Multi-Part and Tutorial Questions 75
Display to
Students
Create Popup Tutorial Questions
You can transform part or all of a multi-part or multi-mode question into an
unscored popup tutorial that guides your students step by step through the
solution of a problem. Popup tutorial questions are shown as buttons in the
assignment, and do not count toward the assignment score. When your students
click the button, the tutorial opens in a new window.
Note:
• To create a tutorial that is scored, see Create Scored Tutorial
Questions on page 71.
• To let your students work through a question in any order, see Add
Expandable Sections to Multi-Part Questions on page 68.
Important: Do not use the <accordion> and <tutorial> tags in the same
question. The one exception to this rule is that in a question that uses the
<accordion> tag, you can create a popup tutorial.
Your popup tutorial will usually be only part of the question. You can create more
than one tutorial in a single question, and you can mix scored and popup tutorials
in the same question.
November 2014
76 WebAssign Creating Questions Guide
Each popup tutorial is shown in the assignment as a button at the location of the
<tutorial> tag.
When your students click the button, the popup tutorial opens in a new window.
If your popup tutorial includes randomized values, your students can click Try
Another Version at the bottom of the tutorial to see different values. You cannot
turn off the Try Another Version link.
Tip: To reuse a popup tutorial in multiple questions, consider creating it
as a scored tutorial and using the <PRACTICE> tag in each of your questions
to display the tutorial as a practice question for no credit. This method also
allows you to rename the button to something other than Tutorial.
To create a popup tutorial from a multi-part or multi-mode
question:
1. Open your question in the Question Editor.
2. In Question, add the <tutorial type="popup"> tag at the beginning of your
tutorial.
You can set several attributes to change the way your tutorial behaves.
Attribute
Description
button="text"
Sets the window and page title that are displayed
in the popup tutorial. (By default, the window and
page title are set to Tutorial.)
order="ascending"
Shows steps in ascending order with the current
step at the bottom. (By default, steps are
displayed in ascending order with the current step
at the top.)
order="descending"
Shows steps in descending order with the current
step at the top. (By default, steps are displayed in
ascending order with the current step at the top.)
skip="no"
Requires students to answer each step correctly
or use all their submissions before going on to the
next step. (By default, students can skip tutorial
steps.)
skip_text="text"
Renames the Skip button to text (if you allow
students to skip tutorial steps.)
For example:
<tutorial type="popup" button="Multiplying Fractions Tutorial"
order="ascending" skip_text="Show the answer (no points earned)
and move to the next step">
3. After the <tutorial> tag, use the <premise> tag to set a title for the tutorial
and display the overall problem or concept the tutorial addresses.
November 2014
Create Multi-Part and Tutorial Questions 77
You must use the closing </premise> tag at the end of the premise.
Note:
• You must specify a title attribute for the <premise> tag.
• The contents of the <premise> tag are always displayed at the top
of the tutorial.
• The <premise> tag is optional, but strongly recommended.
For example:
<premise title="Multiplying Fractions">
When you multiply fractions, you multiply the numerators and you
multiply the denominators.<br><br>
<watex>\[ \frac{3}{4} * \frac{13}{16} = \]</watex>
</premise>
4. Enclose each tutorial step with the <step> tag.
You must use the closing </step> tag at the end of each step.
You can set several attributes to change the way each step is displayed.
Attribute
Description
button="text"
Requires students to click a button with the
specified text in order to see the step. (By default,
each step is displayed as soon as the student
either correctly answers or skips the previous
step.)
label="text"
Replaces the default label Step n of m with the
specified text.
title="text"
Displays the specified text after the step label.
skip_text="text"
Renames the Skip button to text (if you allow
students to skip tutorial steps.)
Note: The <step> and <SECTION> tags are not interchangeable. You
must specify the <SECTION> tag wherever the question mode changes.
For example:
<step button="Start" label="Part I" title="Multiply the
Numerators">
3 · 13 = <_>
</step>
5. Optionally, add tutorial hints in any step with the <hint> tag. You must end
each hint with the closing </hint> tag.
Tutorial hints are shown as a lightbulb icon
and display either Hint or a
label that you specify with the label attribute. When your student clicks the
icon, the contents of the <hint> tag are displayed in place of the label.
November 2014
78 WebAssign Creating Questions Guide
Note:
• The <hint> tag can be used only in <step>.
• Each step can contain only one <hint> tag.
• The <hint> and <HINT> tags are not interchangeable.
For example:
<hint label="Show hint">Use the Pythagorean Theorem.</hint>
6. Optionally, use the <conclusion> tag to display information after your students
complete or skip the last step.
You must end the conclusion with the closing </conclusion> tag.
Note: You must specify a title attribute for the <conclusion> tag.
For example:
<conclusion title="Conclusion">You have finished the
tutorial.</conclusion>
7. End the tutorial with the closing </tutorial> tag.
8. Click Save.
Note: You cannot preview your tutorial changes until you save your
question.
9. Click Test/Preview to test the appearance and behavior of the question. See
Test Questions on page 18.
10. 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 Question with Popup Tutorial
The following table summarizes an actual question.
QID
1589511
Name
Template2 3.TUT.02.
Mode
Multi-Mode...CCNC
November 2014
Create Multi-Part and Tutorial Questions 79
Question
Two cars display fuel economy in different ways. Determine which car uses less
fuel
to travel the same distance. (Use the following conversion factors: 1 mile =
1.609 km; 1 gallon = 3.785 L.)<br><br>
<_><br>
<tutorial type="popup" button="Converting Fuel Economy" order="ascending">
<premise title="Converting Fuel Economy">
Two cars display fuel economy in different ways. Which car uses less fuel to
travel
the same distance?
<ul><li>a car rated at 13 L/100 km</li>
<li>a car rated at 22 miles/gallon</li></ul></premise>
<SECTION><step title="Determine the units to use">Which units best answer the
question "how much fuel is required to travel the same distance?"<br>
<_> <_> <MARK></step>
<SECTION NOBR><step title="Switch gallons and miles">
22 miles/gallon = <_> gallons/mile <MARK></step>
<step title="Change gallons to liters">
0.0455 gallons/mile = <_> L/mile <MARK> (1 gallon = 3.785 L)</step>
<step title="Change miles to 100 km">
0.1720 L/mile = <_> L/100 km <MARK> (1 mile = 1.609 km) Note that 100 km is
used as
a unit.</step>
<SECTION><step title="Compare values">Which car uses less fuel to travel the
same
distance? <_></step>
</tutorial>
Answer
A car rated at 5.8 L/100 km
A car rated at 34 miles/gallon
<SECTION><EQN $SET_EACH_POSITION=1; ''>L/100 km
miles/gallon
<SECTION>0.04545
0.1720
27.68
<SECTION>a car rated at 13 L/100 km
a car rated at 22 miles/gallon (27.68 L/100 km)
November 2014
80 WebAssign Creating Questions Guide
Display to
Students
Example Question with Reusable Popup Tutorial Using
<PRACTICE>
Reusable popup tutorials comprise two questions: the actual tutorial question, and
any question that displays the tutorial link.
November 2014
Create Multi-Part and Tutorial Questions 81
The following table summarizes an actual question that uses the <PRACTICE> tag to
show a tutorial question.
QID
1589523
Name
Template2 3.TUT.03.
Mode
Multiple-Choice
Question
Two cars display fuel economy in different ways. Determine which car uses less
fuel
to travel the same distance. (Use the following conversion factors: 1 mile =
1.609 km; 1 gallon = 3.785 L.)<br><br>
<_><br>
<span class="tutorialButton iButton"><PRACTICE qid="1589517" link="Tutorial:
Converting Fuel Economy" title="Converting Fuel Economy" style="none"></span>
Answer
A car rated at 5.8 L/100 km
A car rated at 34 miles/gallon
Display to
Students
The following table summarizes an actual tutorial question that can be shown
using the <PRACTICE> tag.
QID
1589517
Name
Template2 3.TUT.04.
Mode
Multi-Mode...CNC
November 2014
82 WebAssign Creating Questions Guide
Question
<tutorial order="ascending">
<premise title="Converting Fuel Economy">
Two cars display fuel economy in different ways. Which car uses less fuel to
travel the same
distance?
<ul><li>a car rated at 13 L/100 km</li>
<li>a car rated at 22 miles/gallon</li></ul></premise>
<step title="Determine the units to use">Which units best answer the question
"how much fuel
is required to travel the same distance?"<br>
<_> <_> <MARK></step>
<SECTION NOBR><step title="Switch gallons and miles">
22 miles/gallon = <_> gallons/mile <MARK></step>
<step title="Change gallons to liters">
0.0455 gallons/mile = <_> L/mile <MARK> (1 gallon = 3.785 L)</step>
<step title="Change miles to 100 km">
0.1720 L/mile = <_> L/100 km <MARK> (1 mile = 1.609 km) Note that 100 km is
used as a
unit.</step>
<SECTION><step title="Compare values">Which car uses less fuel to travel the
same distance?
<_></step>
</tutorial>
Answer
<EQN $SET_EACH_POSITION=1; ''>L/100 km
miles/gallon
<SECTION>0.04545
0.1720
27.68
<SECTION>a car rated at 13 L/100 km
a car rated at 22 miles/gallon (27.68 L/100 km)
November 2014
Create Multi-Part and Tutorial Questions 83
Display to
Students
Delete Parts of Multi-Mode Questions
If you find a multi-mode question with more parts than you want, you can create
a copy of the question to edit. This newly copied question is identical to the
original, except you are the owner and can edit it for your needs.
Before you attempt to delete part of a multi-mode question, you should know how
to Create Multi-Mode Questions on page 61.
Note: Observe copyright restrictions for textbook questions and questions
authored by others. Questions that are duplicated from copyrighted
questions should be treated as copyrighted material.
November 2014
84 WebAssign Creating Questions Guide
To delete parts of a multi-mode question:
1. Find the question you want to edit.
Note: See Search for Questions on page 2 if you need help locating
the question you want.
2. Click Duplicate for the question you want to edit.
You can duplicate a question from the Question Editor, My Questions, Question
Search Results, and Recently Modified pages.
The new question opens in the Question Editor, and shows that it is a
duplicated question.
3. In the Name field, prepend the question name with a unique identifier, such as
your initials, or give it a new name, and then click Save.
The question is renamed and assigned a new QID.
For example, if you create a duplicate of RogaCalc2 10.4.001. and prepend
it with GAM as the unique identifier, the new name and QID would be GAMRogaCalc2 10.4.001. (2643762).
Note: Make a note of your question's new name and QID displayed at
the top of the editor. This will make it easier when you want to add the
question to an assignment.
4. Click Test/Preview to see your new question.
For example, GAM-RogaCalc2 10.4.001. (2643762) is identical to the original
question:
November 2014
Create Multi-Part and Tutorial Questions 85
5. Identify the question parts you want to delete and their modes.
For example, the question parts/modes for GAM-RogaCalc2 10.4.001. are:
• Parts (a) and (b) are Multiple-Choice.
• Part (c) is Algebraic.
• Part (d) is Symbolic. This is the question part that will be deleted.
6. If necessary, click Multi-Mode Options to remove the mode of the part that
will be deleted.
Note: If you are removing a mode, ensure that it is the only question
part using that mode. If more than one question part uses a mode, do
not remove it unless you are deleting both question parts.
November 2014
86 WebAssign Creating Questions Guide
For example, since part (d) is the only Symbolic mode question part of GAMRogaCalc2 10.4.001., (Q) Symbolic must be removed to avoid an error:
7. From the Question, Answer, and Solution fields of the editor, delete the parts
of the question you want to remove.
Important: Since code lines wrap in the Question Editor, you can
adjust the Question, Answer, or Solution fields using the horizontal
or vertical resize buttons. Alternatively, if you cannot sufficiently
resize the fields without the lines wrapping, copy/paste the entire text
of a field into a text editor with word wrap turned off.
a) In the Question field, delete the parts you want to remove. Ensure you
delete the associated <_> because these are the Question field parts'
answer blanks.
For example, the highlighted text shows the Question field part of GAMRogaCalc2 10.4.001. that will be deleted:
November 2014
Create Multi-Part and Tutorial Questions 87
• If the Question field part uses a <div> or <blockquote> tag, do not
delete the respective closing </div> or </blockquote> tag at the end
of the Question field because they are used to ensure proper display.
• If there are more than one <div> tag sets in the Question field, after
you delete the parts make sure that all the remaining <div> tags
have corresponding </div>tags.
• If the Question field uses the <table></table> tag set, you can delete
the entire table or parts of it. To delete an entire table row, identify
the tag that opens the row, <tr>, and the tag the closes the row,</
tr>. Delete these two tags and everything in between them to delete
the entire row. To delete a table column you must delete each cell that
makes the column. Identify the tag that opens the cell, <td>, and
the tag that closes the cell, </td>. Delete these tags and everything
between them. Repeat this process for each cell in the table that is
part of the column you want to delete.
• Since this is a multi-mode question, the number of <SECTION> or
<SECTION NOBR> tags in the Question field must match the number
of <SECTION> tags in the Answer field. Ensure you have edited the
multi-mode settings, as described in Step 6, to delete the modes that
correspond to the answer blanks you deleted.
b) In the Answer field, delete the parts of the answer that correspond to the
Question field parts and answer blanks you deleted. This step is important
because it directly affects how the question is scored in your assignment.
For example, the highlighted text shows the Answer field part of GAMRogaCalc2 10.4.001. that must be deleted because it corresponds with the
deleted Question field part in Step a:
November 2014
88 WebAssign Creating Questions Guide
Important: Each line of the Answer field usually begins with the
EQN tag and corresponds to one answer blank in the order they
are displayed in the question. Make sure that you delete the entire
line and there are no extra carriage returns at the end. Unless the
deleted line is the last EQN line, make sure the EQN tag is at the
beginning of the next line.
c) If the question has a solution, remove any text in the Solution field that
corresponds to the deleted parts in the Question and Answer fields.
For example, the highlighted text shows the Solution field part of GAMRogaCalc2 10.4.001. that must be deleted because it corresponds with the
deleted Question and Answer fields' parts in Steps a and b:
8. If necessary, insert line breaks (carriage returns) in any field to make the
question or solution display properly, you can use the <br /> tag for each
line break you want to insert.
9. Click Redisplay.
The top of the Display section shows any Perl syntax or other errors in the
Question and Answer sections. Correct any errors, and then continue. For
more information, see Perl Variables and Functions on page 312.
November 2014
Create Multi-Part and Tutorial Questions 89
10. Click Test/Preview to see how your question will be displayed to students
and that all answer blanks are grading correctly. Be sure to test the answer
blanks with both correct and incorrect answers.
Note: At any point in the editing process you can test to see how your
changes affect the question. You do not need to save your changes
before testing.
For example, this is how GAM-RogaCalc2 10.4.001. now looks:
11. In the Additional Information section, make changes to the following fields. If
you cannot see this section, click Show Additional Information.
a) Keywords—add a comma-delimited list of keywords that describe the
question.
For example, add "first-order, linear, differential, equation" for GAMRogaCalc2 10.4.001.
b) Classification—click Classification and select one or more disciplines that
relate to the question, and then click Update.
November 2014
90 WebAssign Creating Questions Guide
Adding a classification includes your question in the collections listed in the
Question Browser for any instructors with permissions to find the question
in search results. See Share Questions With Other Instructors on page 19.
c) Permission—select a permission. If you created permission groups, they
will display in the permission list.
For more information on permission settings and permission groups, see
Share Questions With Other Instructors on page 19 and Manage Permission
Groups.
d) Usable/Draft—select Usable if the question is ready to be included in
assignments or Draft if it is still being edited. Draft does not prevent the
question from being included in your assignment; however, the question
will not be available to anyone you chose to share it with until it is marked
Usable.
e) Comment—add a note about what you deleted. This way, anyone who looks
®
at this question will know how it differs from the original, WebAssign coded question.
For example, add "Duplicated question - deleted part (d)" for GAMRogaCalc2 10.4.001.
f) Discipline—select one or more disciplines to which the question applies.
For example, the Additional Information section for GAM-RogaCalc2 10.4.001.
looks like this:
12. When the you are satisfied with the question and it works as you want it to,
click Save.
Best Practice: A good test is to use this question as the first question
in a multi-question test assignment. This would help identify any errors
in this question that would affect other questions in the assignment
(like broken tags).
Before adding this question to an assignment for your students, create
a test course, and then add/schedule the test assignment. Using the
Student View, complete the assignment to ensure the new question is
functioning properly.
November 2014
Create Multi-Part and Tutorial Questions 91
Important: Some features of textbook questions are intentionally not
available after duplication. These features are generally textbook-specific,
and include eBook links and tutorials, simulations, and instructional
materials associated with the textbook.
November 2014
92 WebAssign Creating Questions Guide
November 2014
4
Create Numerical Questions
This chapter contains the
following topics:
Numerical questions are fill-in-the-blank questions that are
graded for numerical accuracy.
• Create Integer or Decimal Number
Questions
Depending on the question, a numerical question might require
any of the following kinds of answers:
• Create Fraction Questions
• Require Units in Numerical Questions
Type of Numerical Question
Example Answers
• Create Answer-Dependent Questions
Integer or decimal number
-103
6.4
NO SOLUTION
6.4e2
Fraction
13/16
Number and unit
10.4 ml
Number specified to significant
figures
302.0
Number specified to decimal
places
0.005
By default, answer format tips help your students know what
kind of answer is expected. If needed, you can hide answer
format tips for your assignments.
Tolerance
By default, answers within ±2% of the answer key are
considered to be correct. For example, if the answer is 3, then
2.94, 3.06, and any value in between are all accepted as correct
responses.
You can set the required tolerance for your numerical questions.
November 2014
94 WebAssign Creating Questions Guide
Precision
By default, the numerical precision of your students' answers is
not considered. For example, if the answer is 3, then 3.0 is also
accepted as a correct response.
You can set the required precision for your numerical questions.
Answer-Dependent Questions
Answer-dependent questions are multi-part numerical questions
that let your students provide numerical data or estimates and
then perform calculations based on the provided data.
See Also:
Understanding the <eqn> and <EQN> Tags on page 312
November 2014
Create Numerical Questions 95
Create Integer or Decimal Number Questions
You can create numerical questions that ask your students to answer with an
integer or decimal value.
• Fractional answers are also allowed, but answers are not required to be
specified as a fraction.
• Students can enter scientific notation like 6.4e2.
• Unless you disallow it, students can also enter simple mathematical
expressions like 19 * 23.
To create an integer or decimal question:
1. Click Questions > Create.
The Question Editor opens.
2. In Name, type a name for the question.
3. In Mode, select Numerical.
4. In Question, type your question.
Use the answer placeholder string <_> to specify where the answer box should
be displayed.
5. Optional: Set grading and display options for the answer box.
Option
Begin Answer With:
Notes
Require student to
calculate the answer
<EQN $SIMPLIFIED=1; Unless you set $SIMPLIFIED,
''>
students can use basic mathematical
operators — addition, subtraction,
multiplication, division, and
exponentiation — in their answer
and be awarded credit for
correctly stating the problem as a
mathematical expression without
actually performing the computation.
For example, a student might answer
28 * 19 instead of 532.
Make the answer box n <EQN $size=n; ''>
characters wide
By default, the answer box is 10
characters wide.
Changing the size of the answer box
does not restrict the length of your
students' responses.
You can combine these declarations using a single <EQN> tag by separating
each declaration with a semicolon.
For example:
<EQN $SIMPLIFIED=1; $size=20; ''>
6. In Answer, type the correct numerical answer to the question.
November 2014
96 WebAssign Creating Questions Guide
Important: Observe the following rules regarding the format of your
numerical answer:
• Do not use commas, spaces, or other separators between digits.
• You can use scientific (“e”) notation, for example, 1.51e7.
• You can type one or more words such as NONE, INFINITY, DNE,
or NO SOLUTION; numerical questions are not case- or spacesensitive, but your students must type the words exactly to be
marked correct.
These rules also apply to your students when they respond to your
question.
7. 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.
8. Click Test/Preview to test the appearance and behavior of the question. See
Test Questions on page 18.
9. Click Redisplay to show certain kinds of errors in the Display section of the
Question Editor. Make any needed changes to your question.
10. 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 on page 19.
• 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 on page 308.
11. 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 Numerical Question
The following table summarizes an actual question.
November 2014
QID
1077998
Name
Template2 2.NUM.01.
Mode
Numerical
Create Numerical Questions 97
Question
How many miles will a car travel in 3 minutes if its speed is
constant at 60 mph? <br>
<_> miles
Answer
<EQN $size=2; ''>3
Solution
Since there are 60 minutes/hour, at 60 mph the car is
traveling
at 1 mile/minute.
Display to
Students
Example Numerical Question Requiring a Computed
Response
The following table summarizes an actual question.
QID
1203080
Name
Template2 2.NUM.06.
Mode
Numerical
Question
34 + 10 + 5 = <_>
Answer
<EQN $SIMPLIFIED=1; ''>49 {tab} 0
Display to
Students
See Also:
Create Questions with the Question Editor on page 7
Mathematic Functions and Operators on page 372
Check Significant Figures in Numerical Questions
You can require your students to specify the correct number of significant figures
in their response by setting the $SIGFIGS variable in Answer.
If you check significant figures, you might want to award partial credit for
responses that use the correct number of significant figures even if the student's
calculation is not correct.
When your question checks significant figures, the default tolerance for the
question is ±1 at the last significant digit. For example, if the answer is 330 to 2
significant digits, the responses 320, 330, and 340 would all be accepted.
November 2014
98 WebAssign Creating Questions Guide
By default, answer format tips tell your students whether significant figures are
checked. You can hide answer format tips for your assignments.
To check students' responses for significant figures:
1. In Answer, type the following code before the correct numerical answer:
<EQN $SIGFIGS=digits; ''>
where digits is the correct number of significant figures.
2. Type the correct answer on the same line.
Ensure that your answer is specified to the correct number of significant
figures. If it is not, it will be rounded to the correct number of significant
figures and the tolerance will be based on the rounded answer.
Example Numerical Question With Significant Figure
Checking
The following table summarizes an actual question.
QID
1079760
Name
Template2 2.NUM.03.
Mode
Numerical
Question
If the space shuttle maintains a constant speed of 7740 m/s
for
32.5 minutes, how far will it have traveled? <br>
<_> km
Answer
<EQN $SIGFIGS=3; 7740*1e-3*(32.5*60)>
Display to
Students
See Also:
Mathematic Functions and Operators on page 372
Check Decimal Places in Numerical Questions
You can require your students to specify a certain number of decimal places in
their response by setting the $DECFIGS variable in Answer.
If you check decimal places, you might want to award partial credit for responses
that use the correct number of decimal places even if the student's calculation is
not correct.
When your question checks decimal places, the default tolerance for the question
is ±1 at the last digit. For example, if the answer is 1.33 to 2 decimal places, the
responses 1.32, 1.33, and 1.34 would all be accepted.
November 2014
Create Numerical Questions 99
By default, answer format tips tell your students whether decimal places are
checked. You can hide answer format tips for your assignments.
To check students' responses for decimal places:
1. In Answer, type the following code before the correct numerical answer:
<EQN $DECFIGS=n; ''>
where n represents the nearest decimal value to which the answer should be
specified, such as 10, 1, 0.1, 0.01, 0.001, or 0.0001.
Important: Always set $DECFIGS to a power of 10. You can use “e”
notation, such as 1e2.
2. Type the correct answer on the same line.
Ensure that your answer is specified to the correct number of decimal places.
If it is not, it will be rounded to the correct number of decimal places and the
tolerance will be based on the rounded answer.
Example Numerical Question With Decimal Place Checking
The following table summarizes an actual question.
QID
1159495
Name
Template2 2.NUM.04.
Mode
Numerical
Question
Write the quotient of 3 and 7 to 5 decimal places.<br>
<_>
Answer
<EQN $DECFIGS=0.00001; 3/7>
Display to
Students
See Also:
Mathematic Functions and Operators on page 372
November 2014
100 WebAssign Creating Questions Guide
Change Tolerance for Numerical Questions
You can set the tolerance for your numerical questions as a numerical value by
adding {tab} and the tolerance value after the answer.
Important:
®
• In most cases, the default tolerances used in WebAssign (±2% or
±1 at the last significant digit) or specified in the code for a textbook
question result in accurate scoring of correct and incorrect answers
and should not be changed.
• If you change the tolerance, your students' answers might not be
scored accurately.
• Do not set the tolerance to 0; this often results in some correct
answers being marked incorrect. Instead, use a very small tolerance
such as ±0.01%.
The default tolerance for numerical questions depends on the type of question.
If the Numerical Question:
Its Default Tolerance Is:
Requires a fractional answer
0
Checks significant figures or decimal places
±1 at the last digit
Does not otherwise set the tolerance
±2% of the answer key
Note: Tolerances set in the question are ignored if different tolerance
values are set for the sections or assignments for which the question is
scheduled.
To set the tolerance as a numerical value:
In Answer, type the following code immediately after the correct numerical
answer:
{tab} tolerance
where tolerance is the non-negative numerical tolerance value by which your
students' responses can differ from your answer and be considered correct.
For example, to specify an answer of 56 and accept answers between 55.97
and 56.03, type 56 {tab} 0.03.
Note: To add the {tab} operator, either type the characters {tab} or
click Add tab.You cannot enter {tab} by pressing the TAB key.
To specify the tolerance as a percentage of a non-randomized answer,
manually calculate the tolerance by multiplying the answer by the
percentage tolerance you want to use.
Example Numerical Question With Specified Tolerance
The following table summarizes an actual question.
November 2014
Create Numerical Questions 101
QID
1159554
Name
Template2 2.NUM.05.
Mode
Numerical
Question
34 + 10 + 5 = <_>
Answer
49 {tab} 0
Display to
Students
See Also:
The {tab} Operator on page 329
Mathematic Functions and Operators on page 372
Create Fraction Questions
You can create numerical questions that require your students to answer with a
fraction.
Note: Because fraction questions set numerical tolerance to 0, students
cannot enter decimal approximations. For example, 0.33333 is not the
same as 1/3.
To create a fraction question:
1. Click Questions > Create.
The Question Editor opens.
2. In Name, type a name for the question.
3. In Mode, select Numerical.
4. In Question, type your question.
Use the answer placeholder string <_> to specify where the answer box should
be displayed.
5. Set grading and display options for the answer box.
Option
Begin Answer With:
Notes
Require student to
specify a fraction,
integer, or decimal
<EQN $FRACTION=1;
''>
Requires answers to take one of the
following forms:
• integer (example: 64)
• exact decimal (example: 6.4)
• any fraction (example: 6/4)
This option also sets the numerical
tolerance to 0.
November 2014
102 WebAssign Creating Questions Guide
Option
Begin Answer With:
Notes
Require student to
specify a reduced
fraction or integer
<EQN
Requires answers to take one of the
$PROPERFRACTION=1; following forms:
''>
• integer (example: 64)
• reduced fraction (example: 3/2)
This option also sets the numerical
tolerance to 0.
Best Practice: Include
<p:reduce> in Question to
let your students know to
reduce fractions.
Make the answer box n <EQN $size=n; ''>
characters wide
By default, the answer box is 10
characters wide.
Changing the size of the answer box
does not restrict the length of your
students' responses.
You can combine these declarations using a single <EQN> tag by separating
each declaration with a semicolon.
For example:
<EQN $PROPERFRACTION=1; $size=20; ''>
6. In Answer, specify the answer using the fraction function in the <EQN> tag
using the following syntax:
fraction(numerator,denominator)
For example:
<EQN $PROPERFRACTION=1; fraction(13,16)>
The fraction function ensures that your answer key is correctly parsed as a
fraction, not as the decimal quotient of the numerator and denominator.
Do not use commas, spaces, or other separators between digits.
7. 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.
8. Click Test/Preview to test the appearance and behavior of the question. See
Test Questions on page 18.
9. Click Redisplay to show certain kinds of errors in the Display section of the
Question Editor. Make any needed changes to your question.
10. 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
November 2014
Create Numerical Questions 103
in search results. To change the permission, see Share Questions With
Other Instructors on page 19.
• 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 on page 308.
11. 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 Numerical Question Requiring a Fraction or
Decimal
The following table summarizes an actual question.
QID
1204532
Name
Template2 2.NUM.07.
Mode
Numerical
Question
<watex>\frac{1}{2} + \frac{7}{8} = </watex><_>
Answer
<EQN $FRACTION=1; fraction(11,8)>
Display to
Students
Example Numerical Question Requiring a Reduced Fraction
or Integer
The following table summarizes an actual question.
QID
1203084
Name
Template2 2.NUM.08.
Mode
Numerical
Question
<p:reduce>
<div class="indent">
<watex>\frac{1}{2} <s:divide> \frac{7}{8} = </watex><_>
</div>
Answer
<EQN $PROPERFRACTION=1; fraction(4,7)>
November 2014
104 WebAssign Creating Questions Guide
Display to
Students
Example Fraction Question With Randomization
The following table summarizes an actual question.
QID
2703262
Name
Template2 2.NUM.07a.
Mode
Numerical
Question
<eqn>
$n1 = randnum(1,50,1);
$d1 = randnum(2,50,1);
$gcd1 = gcd($n1, $d1);
$n1 = $n1 / $gcd1;
$d1 = $d1 / $gcd1;
denominator
$n2 =
way
$d2 =
$gcd2
$n2 =
$d2 =
randnum(1,50,1);
#
#
#
#
#
first numerator
first denominator
find GCD
Use GCD to reduce fraction
by dividing numerator &
# Create second fraction the same
randnum(2,50,1);
= gcd($n2, $d2);
$n2 / $gcd2;
$d2 / $gcd2;
$n_key =
$d_key =
$gcd_key
$n_key =
$d_key =
$n1 * $d2 + $n2 * $d1;
$d1 * $d2;
= gcd($n_key, $d_key);
$n_key / $gcd_key;
$d_key / $gcd_key;
# Numerator of answer key
# Denominator of answer key
# Reduce key with GCD
''
</eqn>
<watex>\[\frac{$n1}{$d1} + \frac{$n2}{$d2} = <_>\]</watex>
Answer
<EQN $FRACTION=1; fraction($n_key, $d_key)>
Display to
Students
See Also:
Create Questions with the Question Editor on page 7
Randomize Question Values on page 330
Mathematic Functions and Operators on page 372
November 2014
Create Numerical Questions 105
Require Units in Numerical Questions
You can require your students to enter a unit with their response by adding the
correct unit after the numeric value in Answer.
If you specify units, any equivalent answer specifying equivalent units is accepted.
For example, your student could respond 1 mi or 5280 ft. You can configure your
assignments to award partial credit for specifying compatible units even if the
numerical part of the response is incorrect.
®
Note: WebAssign cannot restrict the allowable units for numerical
questions, for example, to require entry of MKS system units. If you need
your students to enter a specific unit, create a multiple-part question that
uses a numerical question for the value and a fill-in-the-blank question for
the unit.
By default, answer format tips tell your students whether units are checked. You
can hide answer format tips for your assignments.
To require students to enter a unit with their response:
1. In Answer, type the correct numerical answer followed by a space and the
unit, for example, km or m/s^2.
Observe the following rules when specifying units.
Rule
Incorrect
Correct
Type a space between the
number and the unit.
20g
20 g
Units are case-sensitive.
1 minute = 60 S
1 minute = 60 s
Do not combine multiple
values and units.
3 minutes 15 seconds
3.25 minutes
20
g
To change the dimension
3 square miles
of a unit, follow the unit
3 mi**2
with a caret (^) and an
exponent. Do not use the
words “square” or “cubic.” Do
3 mi^2
not use two asterisks (**) to
specify the exponent.
To divide a unit, use /. Do not
use “per.”
miles per hour
miles/hour
To multiply a unit, use a
space or asterisk. Do not use
a raised dot or hyphen.
kW·h
kW*h
kilowatt-hour
kilowatt hour
Many unit names accept
singular and plural forms
interchangeably. Do not
pluralize unit abbreviations.
3 mis
3 mi
3 miles
November 2014
106 WebAssign Creating Questions Guide
Rule
Incorrect
Correct
Do not enter a fraction for
the number when units are
required.
3/4 inch
0.75 inch
®
2. When testing your question, test with alternative units. WebAssign supports
most standard units and unit abbreviations in common use. However, to
ensure that the unit in your question is supported, test it with each of the
following criteria:
• correct and incorrect responses using the unit you specified
• correct and incorrect responses using standard abbreviations or variant
spellings of the unit you specified
• correct and incorrect responses using at least one different compatible
unit
Example Numerical Question With Units
The following table summarizes an actual question.
QID
1159423
Name
Template2 2.NUM.02.
Mode
Numerical
Question
How far will a car travel in 3 minutes if its speed is
constant
at 60 mph? <br>
<_>
Answer
3 miles
Display to
Students
See Also:
Mathematic Functions and Operators on page 372
Unit Names for Numerical Questions
Many different unit names and abbreviations can be used in numerical questions
requiring units.
Rules for Units
Observe the following rules when specifying units.
November 2014
Create Numerical Questions 107
Rule
Incorrect
Correct
Type a space between the
number and the unit.
20g
20 g
Units are case-sensitive.
1 minute = 60 S
1 minute = 60 s
Do not combine multiple values
and units.
3 minutes 15 seconds
3.25 minutes
To change the dimension of
a unit, follow the unit with a
caret (^) and an exponent. Do
not use the words “square”
or “cubic.” Do not use two
3 square miles
3 mi^2
20
g
3 mi**2
asterisks (**) to specify the
exponent.
To divide a unit, use /. Do not
use “per.”
miles per hour
miles/hour
To multiply a unit, use a space
or asterisk. Do not use a raised
dot or hyphen.
kW·h
kW*h
kilowatt-hour
kilowatt hour
Many unit names accept
singular and plural forms
interchangeably. Do not
pluralize unit abbreviations.
3 mis
3 mi
Do not enter a fraction for
the number when units are
required.
3/4 inch
3 miles
0.75 inch
Units
This is not an exhaustive list, but includes the most commonly used units and
abbreviations. For SI units, most derived units are not listed here.
Note: For units having different values in different countries, the U.S.
value is used.
Unit
Abbreviation
ampere
A
angstrom
Å, ångström
astronomicalunit
au, AU
atmosphere
atm
atomicmassunit
u, amu
Notes
bar
becquerel
Bq
britishthermalunit
btu
November 2014
108 WebAssign Creating Questions Guide
Unit
Abbreviation
bushel
bu
calorie
cal
candela
cd
Notes
candle
carat
ct
cc
Cubic centimeter. Do not use cubic
centimeter.
century
click
cm^3
Cubic centimeter. Do not use cubic
centimeter.
coulomb
C
cup
curie
Ci
day
d
decade
diopter
dollar
The alternative spelling “dioptre”
can also be used.
$
The unit must follow the number,
as in 3.25 $. Do not specify
$3.25.
November 2014
farad
F
feet/minute
fpm
feet/second
fps
foot
ft
foot^3/second
cfs
gallon/hour
gal/h, gph
gallon/minute
gpm
gallon
gal
grain
gr
gram
g, gm
henry
H
hertz
Hz, hz
horsepower
hp
hour
h, hr
Alternatively, feet.
Create Numerical Questions 109
Unit
Abbreviation
inch
in
joule
J
kilocalorie
Calorie
kilogram
kg
kilometer/hour
kph
kilowatt hour
kWh
Notes
knot
liter/minute
lpm
liter/hour
L/h
liter
L
The alternative spelling “litre” can
also be used.
m
The alternative spelling “metre”
can also be used.
lumen
mach
meter
mho
micron
microsecond
µs, us
mile/gallon
mpg
mile/hour
mph
mile
mi
minute
min
Use for time only.
mmHg
molar
M
mole
mol
nauticalmile
newton
N
ohm
You cannot use the Ω character.
ounce
oz
partsperbillion
ppb
Uses U.S. definition: 10 .
partspermillion
ppm
Uses U.S. definition: 10 .
partspertrillion
ppt
Uses U.S. definition: 10
pascal
Pa, pa
picometer
pm
-9
-6
-12
.
November 2014
110 WebAssign Creating Questions Guide
Unit
Abbreviation
pint
pt
pound
lb
Notes
proof
psi
quart
qt
roentgen
rontgen, röntgen
second
s, sec
sievert
Sv
Use for time only.
slug
slugf
solaryear
tablespoon
tbl, tbsp
teaspoon
tsp
tesla
T
torr
volt
V
watt
W
weber
Wb
week
wk
yard
yd
year
yr
Combining Prefixes for SI Units
The following prefixes can be combined with SI base units to specify derived units.
The derived unit or abbreviation cannot contain a space between the prefix and
base unit.
Prefix
November 2014
Abbreviation
Value
Example
15
1.2 Pm
12
2.3 terajoule
9
3.4 Gg
6
4.5 megavolt
3
5.6 km
2
peta
P
10
tera
T
10
giga
G
10
mega
M
10
kilo
k
10
hecto
h
10
6.7 hectometer
deca, deka
da
10
7.8 dag
Create Numerical Questions 111
Prefix
Abbreviation
Value
deci
d
10
centi
c
10
Example
-1
8.9 deciliter
-2
9.0 cm
-3
0.1 milliampere
-6
2.4 µg
-9
4.6 nanosecond
-12
6.8 ps
-15
8.0 femtometer
milli
m
10
micro
µ
10
Note:
You cannot
substitute u
or mu.
nano
n
10
pico
p
10
femto
f
10
Create Answer-Dependent Questions
You can create multi-part numerical questions that require your students to enter
their observed or estimated data and to perform calculations based on their
data. These questions are often used for lab classes to record the results of an
experiment and perform analysis of the data.
A well-designed answer-dependent question implements the following behaviors:
• Allows students to enter observed or estimated numerical data. Any response
that falls within a defined range of values is scored correct.
• Optionally, provides feedback to students for observed or estimated
numerical data based on whether the value is lower than, higher than, or
within the range of acceptable values.
• Requires students to perform calculations based on the provided data points.
• Enforces sequential entry of data and calculations so students cannot enter
the results of calculations before entering the required data. The answer
boxes for calculations are not enabled until your students enter the data
required for the calculation.
• Indicates to students when a calculation was performed correctly based on
underlying data that are not within the range of acceptable values. Each
calculation is scored correct only if the calculation was performed correctly
and the underlying data are within the range of acceptable values.
November 2014
112 WebAssign Creating Questions Guide
Like all numerical questions, answer-dependent questions can require students to
specify units or to use a specified number of significant digits or decimal places in
their responses.
To create an answer-dependent question:
1. Create a multi-part or multi-mode question with numerical question parts for
students to enter observed or estimated data and calculations based on that
data.
2. Add the following code at the beginning of Question:
<eqn include('/userimages/feedback/physlabs1.pl')>
This code is required in order to use the userinput() function described in this
topic.
3. Optional: To provide feedback to students for observed or estimated numerical
data based on whether the response is lower than, higher than, or within the
range of acceptable values, add the following code in Question to specify the
information that you want to provide:
<eqn>
%feedback = ( low => 'feedback_text',
high => 'feedback_text',
acceptable => 'feedback_text' );
''
</eqn>
where feedback is the name of a hash variable that contains any
feedback_text that you specify for responses that are lower than, higher than,
or within the range of acceptable values.
Tip: A hash is a special kind of array consisting of name/value pairs.
In Perl, hash names are prefixed with %.
You do not have to specify feedback for all three conditions. You might choose,
for example, only to specify text for low and high conditions.
To provide different kinds of feedback for different question parts, you can
define multiple hashes. Each hash must have a unique name.
Note: For your feedback to be displayed, you must reference the hash
for an answer key as described in the following step. Your assignment
settings must also allow hints to be shown.
November 2014
Create Numerical Questions 113
4. To allow students to enter observed or estimated numerical data for
a question part, specify the answer key as a range of values with the
userinput() function.
You can set a default value that is shown if no response is provided, units, and
feedback for responses that are lower than, higher than, or within the range of
acceptable values. Use the following code:
<EQN $response=userinput(low,high,default,'unit',\%feedback)> unit
where:
• response is the name of a variable that stores your student's response
for later calculations.
• low and high define the lower and upper limits of the range of acceptable
values.
• default is a value in between low and high that is displayed as the default
answer key if no response was provided.
• unit is an optional unit specification for question parts that require
students to enter units. You must specify the units in two places — in
the userinput() function to indicate units for the low, high, and default
values, and at the end of the answer key to make the question part
check units in your students' responses.
• feedback is the optional name of a hash variable that defines values for
feedback to be shown if the student's response is lower than, higher
than, or within the range of acceptable values. Always prefix feedback
with \% — userinput() requires you to reference the hash name with this
syntax rather than passing the hash directly.
Tip: You can omit both low and high (but not one or the other), if
needed. If you do this, your student's response must match default
to be scored as correct; however, you can provide feedback based on
whether the response is higher or lower than default.
For example, the following code in Answer accepts student measurements for
the mass and displacement of two objects and provides different feedback for
measurements of mass and volume:
<EQN
<EQN
<EQN
<EQN
$mass1=userinput(0,10000,5000,'g',\%mass_feedback)> g
$volume1=userinput(0,5000,2500,'ml',\%vol_feedback)> ml
$mass2=userinput(0,10000,5000,'g',\%mass_feedback)> g
$volume2=userinput(0,5000,2500,'ml',\%vol_feedback)> ml
5. To require students to perform calculations based on the provided data points,
specify the answer key as a calculation in terms of the variables used to store
your student's observed or estimated numerical data for other question parts.
For example, the following code in Answer accepts two values between 20
and 100, and then requires your students to multiply them:
<EQN $A=userinput(20,100,50)>
<EQN $B=userinput(20,100,50)>
<EQN $SIMPLIFIED=1; $A * $B>
To require your students to perform the computations instead of stating their
response as a mathematical expression, set the $SIMPLIFIED, $FRACTION, or
$PROPERFRACTION variables to 1 as you would for any other numerical question.
November 2014
114 WebAssign Creating Questions Guide
6. To enforce sequential entry of data and calculations, and to indicate to
students when a calculation was performed correctly based on underlying
data that are not within the range of acceptable values, define the relationship
between the prerequisite data and calculation answer keys using the $LABEL
and $LINK variables.
In each line in Answer that defines an answer key for student data, set
$LABEL to a unique identifier for the answer box.
Important:
The value that you set for $LABEL:
• must be unique for each answer box
• must not be the same as any variable name in the question
One way to ensure this is to use a unique prefix, such as box_, for
all $LABEL values.
For example:
<EQN $LABEL='box_A'; $A=userinput(20,100,50)>
<EQN $LABEL='box_B'; $B=userinput(20,100,50)>
In each line in Answer that defines an answer key for a calculation based on
student data, set $LABEL to a unique identifier for the answer box. Then, set
$LINK to identify the prerequisite answer boxes (using their $LABEL identifiers)
followed by a colon and the calculation to be performed. For example:
<EQN $LABEL='box_C'; $LINK='box_A, box_B: box_A * box_B';
$SIMPLIFIED=1; $A * $B>
Specifying $LINK in this way enables two behaviors:
• The current answer box is not enabled until your student enters values in
the answer boxes labeled box_A and box_B.
• If the values in either box_A or box_B are not within the range of
acceptable values, but the student correctly calculates the value of
box_A * box_B, the current answer box displays an icon
indicating that
the calculation was correct even though the data were not.
Tip:
If you do not want to indicate that the calculation is correct before your
students provide correct data, set the formula in $LINK to no_icon. For
example:
<EQN $LABEL='box_C'; $LINK='box_A, box_B: no_icon';
$SIMPLIFIED=1; $A * $B>
You can use any text value that is not a valid response to a numerical
question, but no_icon is easy to remember.
The values of $LABEL and $LINK are never displayed to your students.
7. When testing your question, be sure to test each of the following conditions:
• Data that are lower or higher than the range of acceptable values
• Calculations that are made correctly based on out-of-range data
• Data that are within the range of acceptable values
November 2014
Create Numerical Questions 115
• Incorrect calculations
• Correct calculations that are made based on data that are within the
range of acceptable values
• Data and calculations that correctly and incorrectly specify units
8. When your question displays and functions correctly, click Save.
Example Answer-Dependent Question Without Feedback
The following table summarizes an actual question.
QID
1589519
Name
Template2 3.ANDS.01.
Mode
Numerical
Question
<eqn include('/userimages/feedback/physlabs1.pl')>
Multiply two numbers between 20 and 100. <br><br>
<_> &times; <_> = <_>
Answer
<EQN $A=userinput(20,100,50)>
<EQN $B=userinput(20,100,50)>
<EQN $A * $B>
Display to
Students
Example Answer-Dependent Question With Feedback and
Units
The following table summarizes an actual question.
QID
1589509
Name
Template2 3.ANDS.02.
Mode
Numerical
November 2014
116 WebAssign Creating Questions Guide
Question
<eqn include('/userimages/feedback/physlabs1.pl')>
<eqn>
%feedback = (low => 'Check your measurements.',
high => 'Check your measurements.');
''
</eqn>
For both of the samples at your lab station, measure the volume
and mass.<br>
Then, calculate the density. Specify units for all
values.<br><br>
<table frame="void" rules="all">
<thead>
<tr><th>Sample</th><th>Mass</th><th>Volume</th><th>Density</
th></tr>
</thead>
<tbody>
<tr><th>A</th><td><_></td><td><_></td><td><_></td></tr>
<tr><th>B</th><td><_></td><td><_></td><td><_></td></tr>
</tbody>
</table>
Answer
<EQN $LABEL='box_massA'; $massA=userinput(0,20,10,'kg',\
%feedback)> kg
<EQN $LABEL='box_volA'; $volA=userinput(0,200,10,'cm^3',\
%feedback)> cm^3
<EQN $LABEL='box_densityA'; $LINK='box_massA,box_volA:
box_massA/box_volA';
$massA/$volA> kg/cm^3
<EQN $LABEL='box_massB'; $massB=userinput(0,20,10,'kg',\
%feedback)> kg
<EQN $LABEL='box_volB'; $volB=userinput(0,200,10,'cm^3',\
%feedback)> cm^3
<EQN $LABEL='box_densityB'; $LINK='box_massB,box_volB:
box_massB/box_volB';
$massB/$volB> kg/cm^3
Display to
Students
See Also:
Mathematic Functions and Operators on page 372
November 2014
5
Create Math Questions
This chapter contains the
following topics:
• Display Notation with WaTeX
• Display Notation with LaTeX
• Add Symbols to Questions
• Display Notation with <symimage>
• Display Math Notation with HTML
Substitution
• Create mathPad Questions
• Create Number Line Questions
• Create Graphing Questions
You can create questions for your math and science courses that
allow your students to enter formatted mathematical notation
or work with number lines or two-dimensional graphs. And, you
can display correctly formatted mathematical notation in your
questions using several different methods.
Note: To create questions requiring your students to
enter numerical answers, see Create Integer or Decimal
Number Questions on page 95.
See Also:
Create Questions with the Question Editor on page 7
Understanding the <eqn> and <EQN> Tags on page 312
• Create Matrix Questions
November 2014
118 WebAssign Creating Questions Guide
Display Notation with WaTeX
®
WebAssign provides a markup language — WaTeX — that you can use to display
well-formatted math notation in your questions and assignments. WaTeX is similar
in some respects to LaTeX in that both markup languages let you focus more on
content and spend less time solving layout problems.
But because WaTeX is rendered in HTML and LaTeX is rendered as a static image,
WaTeX has some clear benefits for online coursework:
• WaTeX display can be enlarged with the browser settings to accommodate
students with visual impairments.
• WaTeX markup allows you to put answer boxes in your markup, so you can,
for example, prompt students to provide the numerator of a fraction, the
argument of a trigonometric function, or the bounds of an integral. You can
also use WaTeX to format matrix or long division problems.
To use WaTeX markup in your questions or assignments, add the following code,
where markup is any valid WaTeX notation:
<watex>\[markup\]</watex>
The \[ and \] delimiters start and end WaTeX math mode. Usually, you will want
to use math mode in WaTeX, but if needed, you can omit \[ and \] to use WaTeX
markup without math mode.
Understanding Math Mode
Math mode in WaTeX corresponds to math mode in LaTeX, and provides the
following behaviors to simplify entering math notation:
• Alphabetic characters that are not part of a function name or Perl variable are
presumed to be variables and are italicized.
• Hyphens are replaced by minus signs.
• Exponents can be typed using a caret (^).
• Subscripts can be typed using an underscore (_).
Note:
• To display non-italicized text such as words or units in math mode,
enclose them in the WaTeX \pre{} notation.
®
• In math mode, you cannot use any of the WebAssign HTML
substitution tags, but this formatting can be performed using WaTeX.
Tip: You can use WaTeX in Question or Solution. For multiple-choice,
multiple-select, and matching questions, you can also use WaTeX in
Answer. If your markup is very long, you might want to assign it (using
double quotes) to a variable in Question and then reference that variable
in Answer.
See Also:
Display Math Notation with HTML Substitution on page 141
November 2014
Create Math Questions 119
WaTeX Notation
The code listed in this table is valid in the <watex> tag. Unless specified otherwise,
all of the examples in the following table are shown as they are displayed when
using math mode.
Note: As in HTML, successive whitespace characters in WaTeX are ignored.
To add multiple spaces, you can use <s:space>.
Expression
Code
Example
Display
Perl variables
$variable
$a
35
${variable}
${a}x
35x
<EQN $variable>
<EQN $a>
35
2x\pre{ km}
2x km
Use braces when the Perl variable is
followed by other text.
Use <EQN> to display the variable in
black.
Roman text,
®
WebAssign tags, or
HTML
\pre{text}
Answer placeholder
strings
<_>
Line breaks
\\
Not needed unless using math mode.
Not needed for answer placeholder
string <_>.
\frac{6}{8} = \frac{<_>}{4}
This cannot be done with
<symimage> or LaTeX.
3x \\ 4y
3x
4y
Use \\ instead of <br \>.
Consecutive line breaks are treated
as a single line break. To add more
vertical spacing, use \vspace.
Line breaks with
vertical spacing
\vspace{nem}
3x \vspace{1em} 4y
\vspace{npx}
3x
4y
Adds a line break with the specified
amount of space between the lines.
Do not add a space between the
number and the unit.
For on-screen display, ems and pixels
are preferred units, but you can also
use cm, in, mm, pc, or pt.
Addition
+
x + 1
x+1
Subtraction
-
x - 1
x−1
November 2014
120 WebAssign Creating Questions Guide
Expression
Code
Example
Display
Multiplication
*
x * 2
x·2
\times
x \times 2
x×2
(implicit)
2x
2x
Division
\div
x \div 2
x÷2
Fractions
\frac{num}{den}
\frac{x}{4}
You can put a fraction in the
numerator or denominator of another
fraction.
Binomial
\left(\over{n}{k}\right)
\left(\over{a}{b}\right)
Combinations,
permutations, and
isotopes (over/under
notation)
\over{top}{bottom}
\left(\over{52}{5}\right)
=
2598960
This is sometimes used with
<s:space> in the top or bottom to help
vertical alignment.
P\over{10}{3} = 720
\over{233}{91}\pre{Pa}
Exponents
(superscripts)
^ (caret)
x^2
x
2
If the superscript is more than 1
character, enclose it in braces {}.
x^{12}
x
12
Bases (subscripts)
_ (underscore)
x_2
x2
If the subscript is more than 1
character, enclose it in braces {}.
x_{(y + 3)}
x(y + 3)
(arg)
(x)
(x)
\left[size](
\left[1]( \frac{x}{3}
\right[1])
Parentheses
\right[size])
Specify the optional size as an integer
from 1 through 9.
Brackets
[arg]
[x]
\left[size][
\left[1][ \frac{x}{3}
\right[1]]
\right[size]]
[x]
Specify the optional size as an integer
from 1 through 9.
Braces
{arg}
{x}
\left[size]\{
\left[1]\{ \frac{x}{3}
\right[1]\}
\right[size]\}
Specify the optional size as an integer
from 1 through 9.
November 2014
{x}
Create Math Questions 121
Expression
Code
Example
Angle brackets
\left[size]<
\left<x\right>
\right[size]>
\left[1]< \frac{x}{3}
\right[1]>
Specify the optional size as an integer
from 0 through 9.
Absolute values
(vertical bars)
|arg|
|x|
\left[size]|
\left[1]| \frac{x}{3}
\right[1]|
\right[size]|
Display
|x|
Specify the optional size as an integer
from 1 through 9.
Magnitude (double
vertical bars)
\lleft[size]|
\rright[size]|
\lleft[0]|\overrightarrow{v
}\rright[0]|
Specify the optional size as an integer
from 0 through 9.
Greatest integer
function (double
brackets)
\lleft[size][
\lleft[x\rright]
Square root
\sqrt{arg}
\sqrt{16}
\sqrt{size}{arg}
\sqrt{3}{\frac{1}{2}}
\rright[size]]
Specify the optional size as an integer
from 1 through 9.
Specify the optional size in positive
integers; the height is approximately
size lines.
Nth root
\sqrt[n]{arg}
\sqrt[3]{27x}
\sqrt{size}[n]{arg}
\sqrt{3}[4]{\frac{x}{81}}
Specify the optional size in positive
integers; the height is approximately
size lines.
Factorial
!
5!
5!
November 2014
122 WebAssign Creating Questions Guide
Expression
Code
Example
Display
Trigonometry
\sin
\cos
\tan
\asin x
arcsin x
\arcsin
\arccos
\arctan
\cos <s:theta>
cos θ
\isin
\icos
\itan
\csch a
csch a
\sinh
\cosh
\tanh
\tan(45<s:degree>)
tan(45°)
\arcsinh
\arccosh
\arctanh
\icoth(x)
coth (x)
\isinh
\icosh
\itanh
\sec
\csc
\cot
\arcsec
\arccsc
\arccot
\isec
\icsc
\icot
\sech
\csch
\coth
\arcsech
\arccsch
\arccoth
\isech
\icsch
\icoth
-1
\arccos, \arcsin, and so on can be
abbreviated like \acos or \asin, but
the longer version of the function
name is displayed.
2
Exponential function
e^n
e^2
e
Logarithms
\ln(n)
\ln(e^x) = x
ln(ex) = x
\log(n)
\log(1000) = 3
log(1000) = 3
\log_b(n)
\log_2(128) = 7
log2(128) = 7
Equality
=
a = 2<s:pi>r
a = 2πr
Inequality
>
x > 3
x>3
<
x < 3
x<3
\geq
x \geq 3
x≥3
\leq
x \leq 3
x≤3
\neq
x \neq 3
x≠3
<s:notgreater>
x <s:notgreater> 3
x
3
<s:notless>
x <s:notless> 3
x
3
Approximate
\approx
x \approx 3
x≈3
Plus or minus
\pm
x \pm 3
x±3
Minus or plus
\mp
x \mp 3
x
Infinity
\infty
\infty
∞
Greek
<s:letter_name>
<s:pi>
π
Capital Greek
<s:Letter_name>
<s:Omega>
Ω
November 2014
3
Create Math Questions 123
Expression
Code
Example
Arrays
\begin{array}{alignment}
\begin{array}{rl}
cell & cell \\
y = & <s:space>3x + 10 \\
cell & cell
2y = & <s:space>4x - 5
\end{array}
\end{array}
Display
For more information, see Create
WaTeX Arrays and Matrices on page
124.
Matrices
\begin{matrix}{alignment}
A = \begin{matrix}{c}{2}
cell & cell \\
x & y & z\\
cell & cell
a & b & c
\end{matrix}
\end{matrix}
For more information, see Create
WaTeX Arrays and Matrices on page
124.
Determinants
For more information, see Create
WaTeX Arrays and Matrices on page
124.
\pre{det}(A) = |A|
det(A) = |A|
\left|\begin{array}{c}
a & b \\ c & d
\end{array}\right| = ad bc
\ddots
\ddots
\cdots
\cdots
\vdots
\vdots
\iddots
\iddots
\ldots
\ldots
Overline
\overline{}
0.\overline{3}
Indefinite
summation
\sum{arg}
\sum{x_i}
Definite summation
\sum_{lower}^{upper}{arg}
\sum_{i = 0}^{n}{x_i}
Indefinite integrals
\int{arg}
\int{f(x)dx}
Definite integrals
\int_{lower}^{upper}{arg}
\int_{0}^{1}{\sqrt{x}dx}
Ellipses
0.3
November 2014
124 WebAssign Creating Questions Guide
Expression
Code
Example
Limits
\lim_{lower}{arg}
\lim_{n\rightarrow\infty}{x
_n}
\lim{}_{lower}
Right arrows
\lim{}_{n\rightarrow
\infty}
x_n
\rightarrow
\rightarrow
\Longrightarrow
\Longrightarrow
Arrows over notation \overleftarrow{arg}
Display
→
\overleftarrow{AB}
\overrightarrow{arg}
\overrightarrow{AB}
\overleftrightarrow{arg}
\overleftrightarrow{AB}
\overleftharpoon{arg}
\overleftharpoon{AB}
\overrightharpoon{arg}
\overrightharpoon{AB}
\overleftrightharpoon{arg}
\overleftrightharpoon{AB}
Middle dot
\cdot
\cdot
Circle
\circ
\circ
Non-breaking text
\nobr{}
\nobr{1.2 \times 10^2}
1.2 × 10
Italics
\it{}
text \it{italicized} text
text italicized
text
Harpoons over
notation
Not needed in math mode.
·
2
Boldface
\bf{}
\bf{boldface}
boldface
Strikeout
\sout{}
\sout{strikeout}
strikeout
Underline
\uline{}
\uline{underlined}
underlined
See Also:
Add Symbols to Questions on page 132
Create WaTeX Arrays and Matrices
WaTeX provides notation for adding arrays and matrices to your questions.
In WaTeX, an array is a simple table with no borders; you can therefore use arrays
not only to display tabular data, but also to control the positioning of items such
as answer boxes or choices, equations, or even other arrays. For many questions,
creating a WaTeX array is simpler and less time-consuming than creating the
equivalent table using HTML.
A matrix is a special kind of WaTeX array that automatically displays brackets
around it just like mathematical matrices.
You can:
November 2014
Create Math Questions 125
• add horizontal or vertical ruling for particular cells
• put arrays and matrices inside of other arrays or matrices
You cannot:
• directly apply HTML or CSS attributes to change the appearance or size of
arrays or matrices
• span cells horizontally or vertically in arrays or matrices
To use complicated formatting or to allow entry of large amounts of tabular data,
you might want to use an HTML table instead of a WaTeX array or matrix.
Creating Arrays
To add an array, type code using the following general syntax:
\begin{array}{alignment}
cell_contents & cell_contents \\
cell_contents & cell_contents
\end{array}
where:
• \begin{array} starts the array.
• alignment is a string comprised of one or more lowercase letters l, r, or c
specifying left, right, or center alignment for each column. If you use fewer
characters than there are columns, the last character defines the alignment
for all remaining columns.
• cell_contents represents anything you want to put in the cell.
• An ampersand (&) separates each cell in a row.
• A double backslash (\\) ends each row. This code is not needed to end the
last row.
• \end{array} ends the array.
For example, to align two equations with respect to the equals sign, you could use
the following code:
Code
Display
\begin{array}{rcl}
y & = & 3x + 10 \\
2y & = & 4x - 5
\end{array}
Creating Matrices
To add a matrix, type code using the following general syntax:
\begin{matrix}{alignment}{rows}
cell_contents & cell_contents \\
cell_contents & cell_contents
\end{matrix}
where:
• \begin{matrix} starts the matrix.
November 2014
126 WebAssign Creating Questions Guide
• alignment is a string comprised of one or more lowercase letters l, r, or c
specifying left, right, or center alignment for each column. If you use fewer
characters than there are columns, the last character defines the alignment
for all remaining columns.
• rows specifies the number of rows (1-9) in the matrix and is required to
correctly display the brackets around the matrix.
• cell_contents represents anything you want to put in the cell.
• An ampersand (&) separates each cell in a row.
• A double backslash (\\) ends each row. This code is not needed to end the
last row.
• \end{matrix} ends the matrix.
For example, to display a simple 3×2 matrix, you could use the following code:
Code
Display
A = \begin{matrix}{c}{2}
x & y & z\\
a & b & c
\end{matrix}
Adding Row or Column Ruling
You can add row or column ruling in arrays and matrices.
• To add vertical ruling left of any cell, add the following markup in the cell:
\vline
• To add horizontal ruling above particular columns in a row, add the following
markup anywhere in the row:
\cline{from-to}
where from and to are the column numbers where the ruling should be displayed.
Columns are numbered starting with 0 for the leftmost column. To add ruling
above discontinuous columns, use multiple instances of \cline. To add ruling
above a single column, specify the same column number for both from and to.
For example:
Code
Display
\begin{matrix}{c}{2}
A & \vline B\\
C & \vline D \cline{0-1}
\end{matrix}
WaTeX Example: Align a System of Equations
This example illustrates how to align a system of equations with WaTeX notation.
November 2014
QID
1215889
Name
Template2 4.WATEX.01.
Create Math Questions 127
Mode
Numerical
Question
Solve the system of equations.
<div class="indent">
<watex>\[
\left[2]\{ \begin{array}{rcl}
2x + 4y & = & 26 \\
3x - y & = & 4
\end{array}\]</watex>
</div>
<watex>\[
x = <_>\\
y = <_>
\]</watex>
</div>
Answer
3
5
Display to
Students
WaTeX Example: Matrices
This example illustrates how to display matrices with WaTeX notation.
QID
1216105
Name
Template2 4.WATEX.02.
Mode
Numerical
November 2014
128 WebAssign Creating Questions Guide
Question
Answer
The following matrices show the numbers of wins
at
home and away for three youth soccer teams.
<div class="indent">
<watex>
\begin{array}{ccl}
& W<s:space><s:space>L & \\
Home = & \begin{matrix}{c}{3} 2 & 3 \\ 0 & 4 \\
\end{matrix} &
\begin{array}{l} Bears \\ Cardinals \\
Giants \end{array} \end{array}
<s:quad>
\begin{array}{ccl}
& W<s:space><s:space>L & \\
Away = & \begin{matrix}{c}{3} 1 & 2 \\ 0 & 3 \\
\end{matrix} &
\begin{array}{l} Bears \\ Cardinals \\
Giants \end{array} \end{array}
</watex>
</div>
Use matrix addition to determine the total wins
for
each team.
<div class="indent">
<watex>
\begin{array}{ccl}
& W<s:quad><s:quad>L & \\
Total = & \begin{matrix}{c}{3} <_> & <_> \\ <_>
&
<_> \end{matrix} &
\begin{array}{l} Bears \\ Cardinals \\
Giants \end{array} \end{array}
</watex>
</div>
and losses
3 & 2
1 & 3
and losses
& <_> \\ <_>
<eqn $size=1; ''>3
5
0
7
4
5
Display to
Students
WaTeX Example: Arithmetic Long Division
This example illustrates how to create a long division problem with WaTeX
notation.
QID
November 2014
1212389
Create Math Questions 129
Name
Template2 4.WATEX.03.
Mode
Numerical
Question
Divide.
<div class="indent">
<watex>
\begin{array}{c}
&
\cline{1-5} 123 & \vline 5
&
<_>
\cline{1-3}
&
&
\cline{2-4}
&
&
\cline{3-5}
&
\end{array}
</watex>
</div>
Answer
&
& <_> & <_> & <_> & R<_>\\
& 6 & 1 & 7 & 4 &
\\
& <_> & <_> &
&
&
\\
& <_> & <_> & 7 &
&
\\
& <_> & <_> & <_> &
&
\\
&
& <_> & <_> & 4 &
\\
&
& <_> & <_> & <_> &
\\
&
&
& <_> & <_> &
\\
<eqn $size=1; ''>4
5
6
86
4
9
2
6
9
6
1
5
8
2
7
3
8
8
6
Display to
Students
WaTeX Example: Polynomial Long Division
This example illustrates how to create a polynomial long division problem with
WaTeX notation.
QID
1212380
Name
Template2 4.WATEX.04.
November 2014
130 WebAssign Creating Questions Guide
Mode
Symbolic
Question
Divide. Type ^ to indicate exponents, as in x^2.
<div class="indent">
<watex>
\[ \begin{array}{c}
&
&
& <_> & + & <_>
\cline{1-5} x - 4 & \vline 2x^2 & + & 5x & - & 50
& <_>
& - & <_> &
&
\cline{1-3}
&
&
& <_> & - & 50
&
&
& <_> & - & <_>
\cline{3-5}
&
&
&
&
& <_>
\end{array}\]
</watex>
</div>
Answer
\\
\\
\\
\\
\\
<eqn $size=1; ''>x:2*x
13
x:2*x^2
x:8*x
x:13*x
x:13*x
52
2
Display to
Students
WaTeX Example: Synthetic Division
This example illustrates how to create a synthetic division problem with WaTeX
notation.
November 2014
QID
1215844
Name
Template2 4.WATEX.05.
Mode
Multi-Mode...NQN
Question
Divide <watex>\[x^3 - 2x^2 - 11x + 12 \pre{ by } x - 3\]</
watex>.
Use synthetic division.
<div class='indent'>
<watex>
\[
\begin{array}{c}
<_>
& \vline & <_> & <_> & <_> & <_> \\
\cline{1-5}&
&
& <_> & <_> & <_> \\
\cline{1-5}&
& <_> & <_> & <_> & <_>
\end{array}
\]
</watex></div>
<SECTION>Express your answer as a polynomial: <_> <br />
<SECTION>Remainder: <_>
Create Math Questions 131
Answer
<eqn $size=1; ''>3
1
-2
-11
12
3
3
-24
1
1
-8
-12
<SECTION><EQN $PAD='devmath'; ''>x: x^2 + x - 8
<SECTION>-12
Display to
Students
Display Notation with LaTeX
You can include LaTeX markup to display well-formatted math notation in your
®
questions and assignments in WebAssign . Unlike WaTeX, LaTeX is displayed as a
static image in your questions and does not offer the flexibility to include answer
boxes in your math notation.
®
Note: WebAssign 's LaTeX installation does not include every LaTeX
package. Always test your notation to ensure that it displays correctly.
Use LaTeX to display math notation for the following reasons:
• You need to display a formatted solution or learning materials as a PDF that
is linked from your question or assignment.
• You are already familar with LaTeX and do not want to use another method
for displaying math notation.
If you are not already familiar with LaTeX and do not need to display notation as a
PDF, use WaTeX, the <symimage> tag, or HTML substitution.
To include LaTeX markup in your question or assignment, enclose it in the <latex>
tag:
<latex>latex_markup</latex>
Displaying Perl Variables in LaTeX
To display the values of Perl variables in your LaTeX markup (for example, to use
randomized values), use one of the methods described in the following table.
November 2014
132 WebAssign Creating Questions Guide
Method
Code
Example
Display
Display value in
red
$variable
<latex>$
${p}x=13
$</latex>
3x = 13
<latex>$
<EQN $p>x=13
$</latex>
3x = 13
<latex eqn=black>$
${p}x=13
$</latex>
3x = 13
${variable}
Use braces or add a space
after each variable name to
distinguish it from other text.
Display value in
black
<EQN $variable>
Display all
values in black
<latex eqn=black>
$variable
Do not use the lowercase
<eqn> tag.
<latex eqn=black>
${variable}
Use braces or add a space
after each variable name to
distinguish it from other text.
Displaying LaTeX as a PDF
To display a larger set of LaTeX notation than a single mathematical expression —
for example, to use LaTeX to format a solution or additional learning materials —
you can display your LaTeX markup as a PDF that is linked from the question or
assignment.
To display your LaTeX markup as a linked PDF, set the pdf attribute in the <latex>
tag to the text of the link you want your students to click:
<latex pdf='link_text'>
In your question or assignment, the specified link text will be displayed. When
your students click the link, a PDF is displayed with your formatted notation.
See Also:
http://www.ctan.org
http://www.latex-project.org
Add Symbols to Questions
®
You can use the WebAssign <s> tag to add a number of symbols to your
questions. Some symbols are displayed as characters, and others are displayed as
images.
See www.webassign.net/manual/instructor_guide/c_i_list_symbols.htm for lists of
symbols that you can add to your questions.
November 2014
Create Math Questions 133
Display Notation with <symimage>
You can use the <symimage> tag to display well-formatted math notation in your
®
questions and assignments in WebAssign . The markup used in the <symimage>
tag is also used in NumberLine questions to display labels for points.
Unlike WaTeX, notation displayed with the <symimage> tag is displayed as a
static image in your questions and does not offer the flexibility to include answer
boxes in your math notation.
To use symimage markup in your questions or assignments, add the following
code:
<symimage(markup)>
where markup is any symimage markup described in <symimage> Notation on
page 134.
Note:
• When creating a flag for a NumberLine question, do not include the
<symimage> tag itself; just specify the markup.
• As in HTML, successive whitespace characters in symimage markup
are ignored. To add a space explicitly, precede the space with two
backslash characters (\\ ).
Alphabetic characters that are not part of a function name or Perl variable are
presumed to be variables and are italicized.
Controlling the Size of the Displayed Notation
Unlike WaTeX, which is automatically resized with the text in the browser window,
images generated with the <symimage> tag are static. However, you can scale
the initial image to one of seven sizes.
Note: You cannot change the size of notation displayed in NumberLine
questions.
To change the size of the displayed notation, append the following notation in your
<symimage> tag:
, size => n
where n is an integer from 1 through 7, with 3 being the default if you do not
specify a size. For example:
<symimage(sqrt(x/a), size => 6)>
The following image shows how each size value is displayed.
Controlling the Placement of the Displayed Notation
You can control the vertical alignment and spacing of the displayed notation
relative to the surrounding text.
November 2014
134 WebAssign Creating Questions Guide
Note: You cannot change the placement of notation displayed in
NumberLine questions.
To align the displayed notation relative to the surrounding text, append one of the
following notations in your <symimage> tag:
, align => top
, align => middle
, align => bottom
The top, middle, or bottom of the image is aligned with respect to the top, middle,
or bottom of the text line where the image is displayed. The default alignment is
bottom.
To add extra space around the displayed notation, append the following notation
in your <symimage> tag:
, padding => n
where n is a positive integer representing the number of pixels of whitespace to
add on every side of the displayed notation. This is particularly useful when the
<symimage> tag is used in multiple choice answers.
For example:
<symimage((3x+12)/(x^2), align => top, padding => 10)>
aligns the top of the displayed fraction with the top of the line of text and adds 10
pixels of space on every side of the displayed image.
<symimage> Notation
Expression
Code
Example
Display
Perl variables
$variable
$a x
7x
Leave a space after the variable
name.
Note: Perl variables are
not displayed in red with
<symimage>.
Roman text
text(text_string)
2x+1 text( if ) x <= -1
2x + 1 if x ≤ −1
Addition
+
x + 1
x+1
Subtraction
-
x - 1
x−1
Multiplication
*
2 * x
2·x
cross
2 cross x
2×x
(implicit)
2x
\/
x\/y
Division
You cannot display the division sign
(÷) using <symimage>
November 2014
2x
x/y
Create Math Questions 135
Expression
Code
Example
Fractions
/
x/y
Display
You can put a fraction in the
numerator or denominator of another
fraction.
Exponents
(superscripts)
^ (caret)
x^2
x2
**
x**(2y)
x2y
If the superscript is not just a
number or a variable, enclose it in
parentheses ().
^1text(H)^alpha
Precede the superscript with a
space if it precedes notation.
Bases
(subscripts)
_ (underscore)
x_2
x2
If the subscript is not just a
number or a variable, enclose it in
parentheses ().
x_(y + 3)
x2y + 3
Precede the subscript with a
space if it precedes notation.
Binomial (over/
under notation)
(top__bottom)^()
Permutations
and isotopes
(combined
subscript and
superscript)
_bottom^top
Parentheses
(arg)^()
(7__3)^()
Type two underscores between the
top and bottom expressions.
Precede the subscript with a
space if the combined subscript/
superscript precedes notation.
P_3^10 = 720
_91^233text(Pa)
(x/2)^()
Use this notation to explicitly add
automatically-sized parentheses
around an expression when they
might otherwise be omitted.
Brackets
[arg]
[x]
matrix(1,1,[arg])
matrix(1,1,[x/3])
[x]
When using the matrix notation, the
brackets are automatically sized to fit
the contents. Some contents, such as
fractions, are also resized.
November 2014
136 WebAssign Creating Questions Guide
Expression
Code
Example
Braces
matrix(1,1,{arg})
matrix(1,1,{x/3})
Display
You cannot use {} without the
matrix notation. When using the
matrix notation, the brackets
are automatically sized to fit the
contents. Some contents, such as
fractions, are also resized.
Angle brackets
langle arg rangle
langle x/3 rangle
Angle brackets are not resized.
Absolute values
(vertical bars)
|arg|
|x|
abs(arg)
abs(x/3)
|x|
When using the abs notation, the
vertical bars are automatically sized
to fit the contents.
Overbrace
arg^^\\}
(x+y+z)^^\\}
After the argument, add 2 carets,
2 backslashes, and the right brace.
Enclose the argument in parentheses
if needed.
Underbrace
arg__\\_}
(x+y+z)__\\_}
After the argument, add 2
underscores, 2 backslashes, another
underscore, and the right brace.
Enclose the argument in parentheses
if needed.
Square root
sqrt(arg)
sqrt(16)
Nth root
rootn(arg)
root3(27x)
You can use only alphanumeric
characters (a-z, A-Z, 0-9) and
underscores for n.
Factorial
!
Trigonometry
sin(x)
cos(x)
asin(x)
November 2014
5!
5!
tan(x)
asin(x)
asin(x)
acos(x)
atan(x)
cos(theta)
cos(θ)
sinh(x)
cosh(x)
tanh(x)
csch(a)
asinh(x)
acosh(x)
atanh(x)
tan(45 deg)
sec(x)
csc(x)
cot(x)
asec(x)
acsc(x)
acot(x)
sech(x)
csch(x)
coth(x)
asech(x)
acsch(x)
acoth(x)
csch(a)
tan(45°)
Create Math Questions 137
Expression
Code
Example
Display
Exponential
function
e^n
e^2
e2
exp(n)
exp(2)
exp(2)
Logarithms
ln(n)
ln(e^x) = x
ln(ex) = x
log(n)
log(1000) = 3
log(1000) = 3
log_b(n)
log_2(128) = 7
log2(128) = 7
You can use only alphanumeric
characters (a-z, A-Z, 0-9) and
underscores for b.
Equality
=
a = 2 pi r
a = 2πr
Inequality
>
x > 3
x>3
<
x < 3
x<3
>=
x >= 3
<=
x <= 3
!=
x != 3
~=
x ~= 3
x≈3
!~=
x !~= 3
x≉3
Plus or minus
+/-
x +/- 3
x±3
Infinity
infinity
infinity
∞
Greek
Type the name of lowercase Greek
letters in lowercase. Type the names
of uppercase Greek letters in proper
case.
pi
π
Omega
Ω
matrix(rows,cols,[cell,cell])
matrix(2,3,[a,b,c,d,e,f])
matrix(rows,cols,{cell,cell})
matrix(3,2,{a,b,c,d,e,f})
Approximate
Matrices
x≥3
x≤3
x≠3
matrix(rows,cols,|cell,cell|)
The contents of the matrix are
specified cell by cell in row-column
order.
Use brackets, braces, or vertical bars
to enclose the matrix contents.
Determinants
Use either the text or matrix notation text(det)(A) = |A|
illustrated in the example.
matrix(2,2,|a,b,c,d|)=ad-bc
Ellipses
...
...
_...
_...
\...
\...
det(A) = |A|
November 2014
138 WebAssign Creating Questions Guide
Expression
Code
Example
Indefinite
summation
sum arg
sum x_i
Definite
summation
sum_lower^upper arg
sum_(i = 0)^n x_i
sum__lower^^upper arg
You can use two underscores and two
carets to display the bounds using
the same font size as the argument;
see the example for Display Notation
with <symimage> on page 133.
Indefinite
integrals
int arg
int f(x)dx
Definite
integrals
int_lower^upper arg
int_0^1 sqrt(x)dx
int__lower^^upper arg
int__0^^1 sqrt(x)dx
You can use two underscores and
two carets to display the bounds
above and below the integral using
the same font size as the argument.
Products
prod_lower^upper arg
prod_(i=m)^infinity x_i
prod__lower^^upper arg
You can use two underscores and two
carets to display the bounds using
the same font size as the argument;
see the example for Display Notation
with <symimage> on page 133.
Closed integrals cintegral_lower^upper arg
cintegral__lower^^upper arg
cintegral_C y^3 \\ dx + x^2
\\ dy
You can use two underscores and
two carets to display the bounds
above and below the integral using
the same font size as the argument;
see the example for Display Notation
with <symimage> on page 133.
Differentiation
diff
(difff(x))/(diffx)
Partial
derivatives
partial
(partial^2u)/(partialx^2)
November 2014
Display
Create Math Questions 139
Expression
Code
Example
Limits
lim_(x->p)
lim_(x->0)
Display
lim__(x->p)
Any expression can be used below
the limit function.
You can use two underscores to
display the expression below the limit
function using the same font size as
the argument; see the example for
Display Notation with <symimage>
on page 133.
Arrows
Arrows over
notation
->
->
→
-->
-->
⟶
<-
<-
<--
<--
<->
<->
==>
==>
<==
<==
<=>
<=>
^^->
A^^->
^^-->
A^^-->
^^<-
A^^<-
^^<--
A^^<--
^^<->
A^^<->
←
⟵
↔
⇒
⇐
⇔
Enclose the argument in parentheses
as needed.
Arrows under
notation
__->
A__->
__-->
A__-->
__<-
A__<-
__<--
A__<--
__<->
A__<->
Use two underscores. Enclose the
argument in parentheses as needed.
Harpoons
~>
~>
⇀
<~
<~
↽
<~>
<~>
⇌
November 2014
140 WebAssign Creating Questions Guide
Expression
Code
Example
Harpoons over
notation
^^~>
A^^~>
^^<~
A^^<~
^^<~>
A^^<~>
Display
Enclose the argument in parentheses
as needed.
Harpoons under __~>
notation
__<~
__<~>
A__~>
A__<~
A__<~>
Use two underscores. Enclose the
argument in parentheses as needed.
Middle dot
middot
x middot y
x·y
Bold Roman
<b>text</b>
text(For all ) x text( in )
<b>R</b>,
For all x in R,
<u>text</u>
<u>all </u>\\ x
all x
To display un-italicized text with
underlining, put text() inside of <u>
<u>text(all)</u>\\ x
all x
Text is displayed in bold and unitalicized. Do not use inside text()
notation.
Underline
and not the other way around.
Union
union
A union B
A∪B
Intersection
intersect
A intersect B
A∩B
Proportional To
propto
x propto y
x∝y
x perp y
x⟂y
proportional
Perpendicular
To
perp
Hat
^^\\^
x^^\\^
Vector
^^->
x^^->
perpendicular
^^\\->
Accent
^^\\'
x^^\\'
Tilde
^^\\~
x^^\\~
Grave
^^\\`
x^^\\`
Script small L
ell
ell
November 2014
ℓ
Create Math Questions 141
Expression
Code
Example
Display
Reduced Planck
constant (hbar)
hbar
E=hbar omega
E = ℏω
Overline
^^\\_
x^^\\_
x
Formula
{(statement,statement)
f(x)={(|2x| text(if)\\ x <=
0,3x text(if)\\ x
>0)
Use as many statements as needed.
Each statement must contain the
same number of text() codes. These
codes are used to control horizontal
alignment of the statements with
each other. You can put empty text()
codes in each statement to align
items even if you do not need to
display Roman text.
Display Math Notation with HTML Substitution
®
WebAssign provides several special tags that allow you to render specific kinds of
notation using HTML substitution. Like WaTeX — and unlike LaTeX or <symimage>
markup — you can include answer boxes in your formatted notation. Using HTML
substitution is often simpler than using WaTeX, but its functionality is also much
more limited than WaTeX.
Note:
• You cannot use HTML substitution tags inside of other HTML
substitution tags, WaTeX, LaTeX, or <symimage> markup.
• You cannot use WaTeX, LaTeX, or <symimage> markup inside of HTML
substitution tags.
HTML Substitution Tags for Math
Six tags are provided for displaying math notation using HTML substitution. Inside
each of these tags, you can use the math notation described in Notation That Can
Be Used in HTML Substitution Tags for Math on page 142.
Expression
Code
Example
Display
General math
<h:math>markup</h:math>
<h:math> $a x^2
</h:math>
9x
Fractions
<h:frac>
n='numerator' d='denominator'
</h:frac>
<h:frac>
n='x^2' d='x+$
a' </h:frac>
2
Use WaTeX to display a fraction in the
numerator or denominator of another
fraction or under a square root.
November 2014
142 WebAssign Creating Questions Guide
Expression
Code
Example
Square roots
<h:sqrt>markup</h:sqrt>
<h:sqrt> x + 6
</h:sqrt>
Matrices
<h:matrix>
cell | cell ; cell | cell
</h:matrix>
<h:matrix>
a | b | c ; d | e | f
</h:matrix>
Display
Use | to separate columns and ; to indicate
the end of a row. Ensure that there is a
space between the contents of a cell and
the | or ; delimiters.
Determinants
<h:determinant>
cell | cell ; cell | cell
</h:determinant>
Use | to separate columns and ; to indicate
the end of a row. Ensure that there is a
space between the contents of a cell and
the | or ; delimiters.
Long division
<h:longdiv> divisor | dividend
</h:longdiv>
<h:determinant>
$a | b ; c | d
</h:determinan
t>
<h:longdiv>
x+5 | x^2+6x+5
</h:longdiv>
Notation That Can Be Used in HTML Substitution Tags for
Math
Except where noted, you can use all of the notation in the following table in each
of the HTML substitution tags for displaying math notation. Math variables are
automatically italicized. You can also use any of the <s> tags described in Add
Symbols to Questions on page 132.
Expression
Code
Example
Display
Perl variables
$variable
$a x + 1
${variable}
${a}x + 1
<EQN $variable>
<EQN $a>x + 1
9x + 1
9x + 1
9x + 1
Use braces or add a space after each
variable name to distinguish it from other
text. Do not use the lowercase <eqn> tag.
Addition
+
x + 1
x+1
Subtraction
-
x - 1
x−1
Multiplication
*
x * 2
times
x times 2
cross
x cross 2
x·2
x×2
x×2
2x
(implicit)
2x
November 2014
Create Math Questions 143
Expression
Code
Example
Display
Division
divide
x divide 2
/
x / 2
x÷2
x/2
Exponents
(superscripts)
^ (caret)
x^2
If the superscript is more than a single
number or a single variable, enclose it in
parentheses.
x^(2y)
Bases
(subscripts)
_ (underscore)
x_2
If the subscript is more than a single
number or a single variable, enclose it in
parentheses.
x_((y + 3))
Parentheses
()
4(x+1)
In cases where a set of parentheses is
required to format notation, such as with
exponents, use two pairs of parentheses to
explicitly display the parentheses.
x_((y + 3))
4(x + 1)
x(y + 3)
|arg|
|x|
|x| abs(x)
abs(arg)
abs(x)
Absolute value
2
x
2y
x
x2
x(y + 3)
You cannot use vertical bars to specify
absolute values in in the <h:longdiv> tag.
Square root
sqrt(arg)
x + sqrt(y+3)
You cannot use sqrt() in the <h:sqrt> or
<h:longdiv> tags.
5!
5!
tan
asin x
arccos
arctan
cos theta
sinh
cosh
tanh
csch<s:space>a
sin x
cosθ
csch a
tan(45°)
arcsinh
arccosh
arctanh
tan(45<s:degree>)
sec
csc
cot
arcsec
arccsc
arccot
sech
csch
coth
arcsech
arccsch
arccoth
Factorial
!
Trigonometry
sin
cos
arcsin
-1
When arccos, arcsin, and so on are
abbreviated like acos or asin, the function
is displayed using exponential notation, like
-1
sin x.
Exponential
function
e^n
e^2
e
2
November 2014
144 WebAssign Creating Questions Guide
Expression
Code
Example
Display
Logarithms
ln(n)
ln(e^x) = x
log(n)
log(1000) = 3
log_b(n)
log_2(128) = 7
ln(ex) = x
log(1000) = 3
log2(128) = 7
Equality
=
a = 2 pi r
a = 2πr
Inequality
>
x > 3
<
x < 3
>=
x >= 3
<=
x <= 3
x
x
x
x
x
!=
x != 3
Approximate
~=
x ~= 3
x≈3
Infinity
infinity
infinity
∞
Greek
Type the name of lowercase Greek letters
in lowercase. Type the names of uppercase
Greek letters in proper case.
pi
π
Omega
Ω
>
<
≥
≤
≠
3
3
3
3
3
Create mathPad Questions
®
WebAssign 's mathPad and calcPad tools let your students quickly enter the
standard mathematical notation that is displayed in their textbook.
The difference between mathPad and calcPad is that calcPad provides tools for
entering the kinds of mathematical notation that are needed in pre-calculus and
later math classes but which might be confusing to students taking developmental
math, algebra, and basic trigonometry courses.
See Also:
Create Integer or Decimal Number Questions on page 95
Create a numerical question if you want your students to respond with a
numerical answer and not a mathematical expression.
November 2014
Create Math Questions 145
Evaluation Modes for Math Questions
®
For many question types in WebAssign , such as Multiple-Choice or pencilPad,
the question mode you select has immediately visible effects on the question you
are creating. When you create questions that evaluate mathematical expressions,
however, the question mode you select affects what kind of responses your
students can enter and how your students' responses are evaluated, but has no
corresponding visual effect.
Note: If your students should respond with a numerical answer and not a
mathematical expression, see Create Integer or Decimal Number Questions
on page 95.
Before creating a question that asks your students to enter a mathematical
expression or equation, determine how that expression should be evaluated.
Symbolic Mode
Symbolic questions evaluate your students' responses symbolically by substituting
a series of values for the variables in the response and in the key. If the response
and the key are equal for all tested values, then the response is accepted as
correct.
This evaluation behavior provides reliable scoring of responses and can accept
any form of a mathematical expression that is equivalent to the key. However,
it cannot evaluate responses that are equations, and it cannot evaluate whether
responses are in a particular form, such as a completely factored expression.
Algebraic Mode using Mathematica®
Algebraic questions evaluate your students' responses algebraically using
®
Mathematica , in much the same way you would solve an equation.
Note:
®
• You must know how to write Mathematica expressions. For
reference information, see Mathematica reference information at
reference.wolfram.com/mathematica/.
• Older questions created using Algebraic mode do not necessarily use
®
Mathematica ; however, the general principles still apply, and these
questions will continue to function.
Algebraic mode is a much more powerful method for evaluating your students'
responses, but specifying your key in Algebraic mode can sometimes be more
complicated than with Symbolic mode. Additionally, you cannot by default
accept any mathematically equivalent response using Algebraic mode; you must
therefore make sure that your students understand what form of response is
needed.
Choosing a Mode to use Based on Selected Criteria
Refer to the following table to help you decide which mode to use.
November 2014
146 WebAssign Creating Questions Guide
Best Practice: If you can use either Symbolic mode or Algebraic mode,
use Symbolic mode.
Criterion / Example
Accept any response that is equivalent to the key
Allow your students to type commas in large numbers
The answer is a single mathematical expression that
is not an equation.
Solve for x:
2
2x+y -6=0
The answer is a finite list of set members.
List the first three natural numbers.
The answer is any member of a set.
List any multiple of both 2 and 3.
The answer is a single ordered pair.
What are the coordinates of the center of the circle
defined by the following equation:
2
2
(x+3) +(y-4) =25
The answer is two or more ordered pairs.
List the coordinates of the first five data points shown
on the graph.
The answer is a vector.
Find a vector perpendicular to ‹1,2›.
The answer is an equation.
What is the equation for a circle with center (x,y) and
radius r?
Only a particular form of the answer is correct.
Factor the expression:
2
x -x-12
Key can specify multiple correct answers.
Key can perform complex evaluation functions for
you, such as factoring polynomials or computing
derivatives.
November 2014
Symbolic Mode Algebraic
Mode using
®
Mathematica
Create Math Questions 147
Create mathPad Questions Using Symbolic Mode
You can create mathPad questions that use Symbolic mode to evaluate arithmetic
and algebraic expressions, but not equations, for equivalency to the answer.
Because responses are graded for mathematical equivalency, the form of the
student's response is not considered. For example, 4x+12 would be equivalent to
(x+3)4.
Note: Do not require your students to use function notation in an answer.
®
WebAssign cannot grade answers that use function notation.
To create a mathPad question using Symbolic mode:
1. Click Questions > Create.
The Question Editor opens.
2. In Name, type a name for the question.
3. In Mode, select Symbolic.
4. In Question, type your question.
• Use the answer placeholder string <_> to specify where the answer box
should be displayed.
• Be sure that your question identifies any variables that the student
should use in their answer.
5. In Answer, type the following items on a single line:
<eqn $PAD='devmath'; ''>variable_list:answer_key
where variable_list is a comma-delimited list of the variables used in the
answer key, and answer_key specifies the correct answer to the problem in
symbolic notation. For example:
x_1, y_1, x_2, y_2: sqrt((x_1-x_2)^2 + (y_1-y_2)^2)
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.
• For information about specifying answer keys for Symbolic
questions, see Create Answer Keys for Questions Using Symbolic
Mode on page 149.
6. 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.
7. Click Test/Preview to test the appearance and behavior of the question. See
Test Questions on page 18.
8. Click Redisplay to show certain kinds of errors in the Display section of the
Question Editor. Make any needed changes to your question.
November 2014
148 WebAssign Creating Questions Guide
9. 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 on page 19.
• 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 on page 308.
10. 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 mathPad Question Using Symbolic Mode
The following table summarizes an actual question.
QID
1078951
Name
Template2 4.MATHP.01.
Mode
Symbolic
Question
<watex>What is the formula for the distance \[d\] between the
two
points \[(x_1,y_1)\] and \[(x_2,y_2)\]?\\
\begin{array}{rl}
\[ d = \] & <_>\\
\end{array}</watex>
Answer
<eqn $PAD='devmath'; ''> x_1,y_1,x_2,y_2:sqrt((x_2-x_1)^2+(y_2y_1)^2)
Display to
Students
See Also:
Create Answer Keys for Questions Using Symbolic Mode on page 149
November 2014
Create Math Questions 149
Create Answer Keys for Questions Using Symbolic
Mode
When typing the answer key for a question in Symbolic mode, you can include a
broad range of mathematical expressions.
Specifying Numeric Values in Answer Keys
Do not use commas to separate digits in numbers. This can cause ambiguous
answer keys and let your students receive credit for incorrect answers. For
example, x + 1,234 is interpreted both as 1234 + x and as a list with two
elements: x + 1 and 234.
Do not use mixed numbers. Instead, use improper fractions or express the mixed
number as a sum, for example 7/4 or 1+3/4.
Specifying Math Variables in Answer Keys
Although not always required, you can declare your math variables at the
beginning of the answer key in a comma-delimited list ending with a colon, as in
the following example.
x_1, y_1, x_2, y_2: sqrt((x_1-x_2)^2 + (y_1-y_2)^2)
Best Practice: Declare your variables to ensure that WebAssign
interprets your answer key exactly as you intend.
®
Variable names in answer keys must observe the following conventions:
• Variable names must start with a letter.
• Variable names must include only letters, numbers, and underscores;
underscores in variable names indicate subscripting.
• Variable names are case-sensitive; X is different from x.
• Variable names should not duplicate the names of functions or of the numeric
value pi.
• Variables having the names of Greek letters are displayed in mathPad and
calcPad as the corresponding Greek letters. Greek letters except for π are
treated as variables. The letter π is treated as a constant.
• The variable e can be used, but it will be treated as both Euler's number and
as a variable name, so either response is marked correct.
The following table lists some examples.
Math Notation
Answer Key Notation
x
x
x1
x1
x1
x_1
books
books
λ
lambda
November 2014
150 WebAssign Creating Questions Guide
Be sure that your question identifies any variables that the student should use in
the answer.
Specifying Perl Variables in Answer Keys
If you have defined a Perl variable for use in your answer key — for example, to
randomize numeric values in your question — always enclose it with the <EQN> tag
as in the following example:
<EQN $d>x + <EQN $e>
To avoid confusion, use different names for Perl variables and math variables
in your question. For more information variables, see Perl Variables for Math
Questions (Algebraic and Symbolic Modes) on page 382 and Default Values and
Tolerance for Symbolic Evaluation on page 153
Specifying Math Expressions in Answer Keys
The functions and values in the following table are case-sensitive- for example,
ABS(x) cannot be substituted for abs(x).
For many functions in the following table, parentheses can be omitted if the
argument is simple and unambiguous — for example, a single variable or
constant. Include parentheses when you need to ensure that a specific order
of operations is observed. The default order of operations for symbolic answer
keys is: subscripts, then factorials, then exponentiation, then multiplication and
division, then addition and subtraction.
Expression
Math Notation
Symbolic
Answer Key
Notation
Addition
x+y
x + y
Subtraction
x−y
x - y
Multiplication
2x
2∙x
2×x
2x
2 * x
No distinction is made between
explicit or implicit multiplication.
Division or
fractions
x÷3
x / 3
No distinction is made between
responses specified as stacked
fractions or using the division sign
(÷).
Exponentiation x
November 2014
3
Notes
x^3
x**3
Square root
sqrt(x)
Other roots
rootn(x)
root(x,n)
rootn(x) works only when n is an
integer.
Create Math Questions 151
Expression
Math Notation
Symbolic
Answer Key
Notation
Notes
Subscript
xn
x(a + b)
x_n
x_(a + b)
If the subscript includes
mathematical operators, including
implicit multiplication, enclose it in
parentheses.
Factorial
x!
x!
Factorials are calculated only for
natural numbers.
Absolute value
|x|
abs(x)
Greek letters
α+β
alpha + beta
Omega
Ω
Type the name of lowercase Greek
letters in lowercase. Type the
names of uppercase Greek letters
in proper case.
Greek letters except for π are
treated as variables. The letter π is
treated as a constant.
In mathPad, your students must
type the names of all Greek letters
except for π and θ.
Pi (π)
pi
π
Substituting 3.14 only
approximates this value. You
and your students should use pi
to indicate the exact value of pi
unless the question specifically
instructs the student to use an
approximation to pi.
e
exp(1)
Euler's number e
3
e^3
exp(3)
Exponential
function
e
Logarithm
(base 10)
log x
log10 x
log x
log(x)
Logarithm
(arbitrary
base)
log16(x)
logb(x)
log_16(x)
log_(b)(x)
Natural
logarithm
ln x
ln(x)
ln x
Grouping,
Order of
Operations
4 (x + 1)
4 [x + 1]
4 {x + 1}
4(x + 1)
4[x + 1]
4{x + 1}
If the base is anything other than a
number, enclose it in parentheses.
No distinction is made among the
three types of grouping symbols.
Parentheses can also be used to
delimit ordered tuples; braces can
also be used to delimit unordered
lists.
November 2014
152 WebAssign Creating Questions Guide
Expression
Math Notation
Scientific / “e”
notation
2.46 × 10
2.46e+6
Trigonometric
functions
sin x
cos x
tan θ
cot (π − θ)
6
sec A
csc x
Inverse
trigonometric
functions
arcsin x
-1
sin (x)
arccos x
-1
cos (x)
arctan x
-1
tan (x)
arccot x
-1
cot (x)
arcsec x
-1
sec (x)
arccsc x
-1
csc (x)
Hyperbolic
functions
sinh x
cosh x
tanh x
coth x
sech x
Symbolic
Answer Key
Notation
2.46 * 10^6
2.46e+6
sin x
cos(x)
tan theta
cot(pi theta)
sec(A)
csc x
Angles are expressed in radians.
arcsin x
sin^(-1)(x)
arccos x
cos^(-1)(x)
arctan x
tan^(-1)(x)
arccot x
cot^(-1)(x)
arcsec x
sec^(-1)(x)
arccsc x
csc^(-1)(x)
Angles are expressed in radians.
sinh
cosh
tanh
coth
sech
csch
In mathPad questions, your
students must type these functions
rather than selecting them from
mathPad.
x
x
x
x
x
x
csch x
Ordered pairs,
ordered tuples
(x, y)
(x, y, z)
Sets,
{1, 2}
unordered lists 3, 4
of elements
Notes
For each inverse trigonometric
function, you can abbreviate “arc”
to “a” as in asin(x).
Specify inverse hyperbolic
-1
functions using the
notation as
for trigonometric functions.
(x, y)
(x, y, z)
Comma-delimited lists in
parentheses are evaluated as
ordered tuples.
{1, 2}
3, 4
To accept only standard roster
notation with braces, set
$ROSTER_ONLY=1.
By default, your students'
responses will match your key if
they enumerate every element at
least once, regardless of repetition.
Thus, {1,2,2} = {1,2}. To require
your students to enumerate all
instances of repeated elements in a
set, set $NO_REPETITION=1.
November 2014
Infinity
∞
infinity
Undefined
UNDEFINED
UNDEFINED
Create Math Questions 153
Expression
Math Notation
Symbolic
Answer Key
Notation
Notes
Degree
30°
30 deg
Degrees are not evaluated
mathematically by default. For
this reason, your students must
enter the exact form of the
answer that you provide and not
a mathematically- equivalent
response. For example, if you
specified cos(60 deg), your
students would be marked
incorrect for submitting either 0.5
or sin(30°).
Imaginary unit i
i
No solution
NO SOLUTION
NO SOLUTION
Empty set
empty
empty
Use only for mathPad questions.
See Also:
Default Values and Tolerance for Symbolic Evaluation on page 153
Default Values and Tolerance for Symbolic Evaluation
Your students' responses to symbolic questions are evaluated by substituting
numeric values for each variable in the answer key and in your students'
responses. If the answer key and response are equivalent to within a specified
tolerance for all three values, the answer is considered correct. You can change
both the default values and the tolerance that are used when evaluating
responses to your symbolic questions.
Understanding Default Values and Tolerance
By default, the following three numeric values are substituted for each variable in
your answer key and in your students' responses:
• 0.123456789012
• 0.345678901234
• 0.890123456789
For each of these values, your student's response is compared to the answer
key. If the response and the key are within the specified tolerance — by default,
0.001 — for every value, the response is considered to be correct.
2
For example, if the correct answer to your question is x + 1 and your student
2
submitted 2x + 1, the response and the answer key would be compared for three
values of x, as illustrated in the following graph and table.
November 2014
154 WebAssign Creating Questions Guide
Value of x (rounded)
Value of Answer Key
2
(x + 1)
Value of Response
2
(2x + 1)
Difference
0.1235
1.0152
1.0305
0.0152
0.3457
1.1195
1.2390
0.1195
0.8901
1.7923
2.5846
0.7923
Although at the first comparison point, the difference between the answer and
the student's response seems small — 0.0152 — this difference is much greater
than the default tolerance of 0.001, so the response is marked incorrect. In this
example, because the key and response contained only one variable, only three
values were checked.
When the key or response contains multiple variables, each value is substituted
for each variable so every combination of values is checked. This is illustrated in
the following table.
Value of x
(rounded)
Value of y
(rounded)
Value of Answer
2
2
Key 2(x + y )
Value of Response
2
2
(x + y )
Difference
0.1235
0.1235
0.0610
0.0305
-0.0305
0.1235
0.3457
0.2695
0.1347
-0.1347
0.1235
0.8901
1.6151
0.8076
-0.8076
0.3457
0.1235
0.2695
0.1347
-0.1347
0.3457
0.3457
0.4780
0.2390
-0.2390
0.3457
0.8901
1.8236
0.9118
-0.9118
0.8901
0.1235
1.6151
0.8076
-0.8076
0.8901
0.3457
1.8236
0.9118
-0.9118
0.8901
0.8901
3.1693
1.5846
-1.5846
The number of comparisons that are performed between the answer key and
response increases exponentially with the number of variables used in the key.
November 2014
Create Math Questions 155
Best Practice: Use four or fewer variables in your questions.
Although the default values used for evaluating symbolic questions might seem
to be arbitrary, they work well for a wide variety of questions. How and why you
might need to change the default values or tolerance — such as for absolute-value
questions — are discussed in the following sections.
Changing the Default Values for Symbolic Evaluation
®
To change the values WebAssign substitutes for variables in your answer key and
your students' responses, you set the array variable $DEFAULTVALS to the values
you want to use.
Best Practice: Use four or fewer values for each variable in your
questions.
To set values:
Prepend this to your answer key:
Notes
As a list
<EQN $DEFAULTVALS=[a, b, c];''>
If you specify only one list,
the values are substituted only
for the first variable in your
answer key and your students'
responses. Additional variables
For example:
<EQN $DEFAULTVALS=[1.23,-3.45];''>x:x^2+1
use the default values.
As a range of
integers
<EQN $DEFAULTVALS=[a..b];''>
For example:
<EQN $DEFAULTVALS=[3..6];''>x:x^2+1
If you specify only one range,
the values are substituted only
for the first variable in your
answer key and your students'
responses. Additional variables
use the default values.
Differently for
different variables
<EQN $DEFAULTVALS=[[a, b, c],[a, b, c]];''>
or
<EQN $DEFAULTVALS=[[a..b],[a..b]];''>
For example:
<EQN $DEFAULTVALS=[[-3,1],
[-2,2]];''>x,y:x^2+y^2
or
<EQN $DEFAULTVALS=[[-3..1],
[-2..2]];''>x,y:x^2+y^2
Only for specific
variables
<EQN $DEFAULTVALS=[[],[a, b, c]];''>
or
<EQN $DEFAULTVALS=[[],[a..b]];''>
For example:
<EQN $DEFAULTVALS=[[-3,1],[]];''>x,y:x^2+y^2
or
<EQN $DEFAULTVALS=[[],[-2..2]];''>x,y:x^2+y^2
The first set of values is
substituted for the first declared
variable, the second set for the
second variable, and so on.
You must explicitly declare the
variables in your answer key.
See Create Answer Keys for
Questions Using Symbolic Mode
on page 149.
Specify an empty list [] for any
variable for which you would
like to use the default values.
You must explicitly declare the
variables in your answer key.
See Create Answer Keys for
Questions Using Symbolic Mode
on page 149.
November 2014
156 WebAssign Creating Questions Guide
Changing the Tolerance for Symbolic Evaluation
®
To change the tolerance WebAssign uses when comparing your answer key and
your students' responses, you set the variable $MAXERR to the tolerance you want
to use.
To set the tolerance:
Add this to your answer key:
As a numeric value
<EQN $MAXERR=value;''>
Notes
For example:
<EQN $MAXERR=0.01;''>
As a percent of the
evaluated answer key
<EQN $MAXERR='n%';''>
For example:
Enclose the percent string
in single quotation marks.
<EQN $MAXERR='0.1%';''>
Specific situations requiring you to change either the default values or the
tolerance are discussed in the following sections.
Changing the Default Values for Absolute-Value Questions
If the answer key for your symbolic question contains the absolute value of
an expression containing a variable, you need to ensure that the expression
evaluates to both positive and negative values to ensure that your students'
responses also include the absolute value notation.
For example, if your answer key is
abs(x+1)
your students could respond with x+1 and still be marked correct, since x+1
evaluates to a positive number for all of the default values. To avoid this situation,
you could change your answer key to the following:
<EQN $DEFAULTVALS=[-1.123, 0.345, 0.890]; ''>abs(x+1)
This causes your answer key and your students' responses to be compared not
for the default values, but for the values you specified: -1.123, 0.345, and 0.890.
With the new values, x+1 evaluates to -0.123, 1.345, and 1.890 and is marked as
incorrect, while |x+1| is marked correct.
Changing the Default Values for Factorial Questions
If the answer key for your symbolic question contains the factorial of an
expression containing a variable, you need to ensure that the expression
evaluates only to natural numbers.
For example, if your answer key is
(x/2)!
x/2 must evaluate to a natural number to correctly compare your students'
responses to the answer key. To ensure this, you could change your answer key to
the following:
<EQN $DEFAULTVALS=[2, 4, 6]; ''>(x/2)!
November 2014
Create Math Questions 157
This causes your answer key and your students' responses to be compared not
for the default values, but for the values you specified: 2, 4, and 6. With the new
values, (x/2)! evaluates to 1, 2, and 6.
Changing the Default Values or Tolerance for Questions with
Fractions or Exponents
In some symbolic questions with fractions or exponents, the default values can
evaluate too close to 0 to distinguish correct and incorrect responses. You must
determine from the question itself whether changing the default values or the
tolerance will resolve the problem.
For example, if your answer key is
1/(x+100)
Your students could enter 1/(x+110) and still be marked correct because the
expression evaluates very close to 0 using the default values. In this case, you
could use a couple different approaches.
You could change the default values as in the following answer key:
<EQN $DEFAULTVALS=[-101..-99]; ''>1/(x+100)
Or, you could decrease the tolerance, as in the following answer key:
<eqn $MAXERR=1e-5; ''>1/(x+100)
Consider a different example. If your answer key is
(x/2)^20
20
Your students could enter (x ÷ 3) and still be marked correct because the
expression evaluates very close to 0 using the default values.
In this case, the best approach is probably to change the default values so the
expression will not evaluate so close to 0. You could change your answer key to
the following:
<EQN $DEFAULTVALS=[1.234, 2.346, 8.901]; ''>(x/2)^20
See Also:
Create Answer Keys for Questions Using Symbolic Mode on page 149
Create mathPad Questions Using Algebraic Mode with
Mathematica®
You can create mathPad questions that use Algebraic mode and a Mathematica
grading statement to compare the answer key and your students' responses
®
for mathematical equivalence. Using Algebraic mode and Mathematica lets
you accurately evaluate your students' responses in situations where Symbolic
evaluation cannot be used — for example, to distinguish between factored and
unfactored expressions, or for questions with multiple correct answers.
®
Note: Do not require your students to use function notation in an answer.
®
WebAssign cannot grade answers that use function notation.
November 2014
158 WebAssign Creating Questions Guide
To create a mathPad question using Algebraic mode with
Mathematica®:
1. Click Questions > Create.
The Question Editor opens.
2. In Name, type a name for the question.
3. In Mode, select Algebraic.
4. In Question, type your question.
• Use the answer placeholder string <_> to specify where the answer box
should be displayed.
• Be sure that your question identifies any variables that the student
should use in their answer.
5. In the Question Editor, click Mathematica under Page Tools to create and test
®
your Mathematica grading statement and answer key.
®
a) In the Mathematica window, type your grading statement, using
®
Mathematica expressions for the answer key and student response that
you want to test.
®
• Your grading statement is a Mathematica statement providing
information about how to compare your answer key and your
students' responses.
®
• Your answer key is a Mathematica expression specifying the correct
answer to the question; sometimes the answer key is one of multiple
possible correct answers.
b) Click Execute.
Your grading statement is evaluated using the expressions you specified for
the answer key and student response, and the result is displayed. If your
grading statement evaluates to True, then the response will be marked
correct. Otherwise, the response will be marked incorrect.
For example, if your question asks students to calculate an indefinite integral,
your grading statement might compare the derivatives of your answer key and
of your student's response:
2
The answer key specifies one of the correct responses: 3 · sin(x ) + 2x + C.
The specified response is also a valid answer and the grading statement
evaluates as True.
November 2014
Create Math Questions 159
®
Note: Most, but not all, Mathematica expressions are valid
®
®
in WebAssign . Any expression that works in the WebAssign
®
Mathematica tool will work in your question.
6. In Answer, type the following items on a single line:
<eqn $CASGRADER='mathematica'; $PAD='devmath'; ''>
variable_list:answer_key {tab} grading_statement
where:
• variable_list is a comma-delimited list of the variables used in the answer
key.
®
• answer_key is the Mathematica answer key you created in the previous
step.
®
• grading_statement is the Mathematica grading statement you created,
with your answer key and student response expressions replaced by
the keywords key and response. When the question is scored, the actual
answer key and student response values will be used in place of these
keywords.
Note:
• To add the {tab} operator, either type the characters {tab} or click
Add tab.You cannot enter {tab} by pressing the TAB key.
• 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.
For example, the following answer key and grading statement allows students
to submit the equation of an ellipse in standard form with the 1 on either side
of the equation:
<EQN $CASGRADER='mathematica'; $PAD='devmath';'' >
x,y:(x+4)^2/9+(y-5)^2/5 == 1 {tab} Apply[List,key] ==
{(response)[[1]],(response)[[2]]}||Apply[List,key] ==
{(response)[[2]],(response)[[1]]}
The following responses would be accepted as correct:
or
Responses not in the standard form, such as the following, would be marked
incorrect:
7. Optional: Type a Solution.
November 2014
160 WebAssign Creating Questions Guide
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.
8. Click Test/Preview to test the appearance and behavior of the question. See
Test Questions on page 18.
9. Click Redisplay to show certain kinds of errors in the Display section of the
Question Editor. Make any needed changes to your question.
10. 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 on page 19.
• 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 on page 308.
11. 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 mathPad Question Using Algebraic Mode with
Mathematica®
The following table summarizes an actual question.
November 2014
QID
1344935
Name
Template2 4.MATHP.02.
Mode
Algebraic
Question
Find the equation in standard form of the following ellipse:
<div class="indent">
Center: (-4, 5)<br>
Vertices: (-7, 5) and (-1, 5)<br>
Foci: (-6, 5) and (-2, 5)
</div>
<_>
Answer
<EQN $CASGRADER='mathematica'; $PAD='devmath';'' >
x,y:(x+4)^2/9+(y-5)^2/5 == 1 {tab} Apply[List,key] ==
{(response)[[1]],(response)[[2]]}||Apply[List,key] ==
{(response)[[2]],(response)[[1]]}
Create Math Questions 161
Display to
Students
See Also:
Create Answer Keys for Questions Using Algebraic Mode with Mathematica on
page 161
The {tab} Operator on page 329
Create Answer Keys for Questions Using Algebraic
Mode with Mathematica®
To write answer keys and grading expressions for questions that use Algebraic
®
®
mode with Mathematica , you must know how to write Mathematica expressions.
®
In addition, you should be aware of the following WebAssign -specific
considerations.
Specifying Math Variables in Answer Keys
Although not always required, you can declare your math variables at the
beginning of the answer key in a comma-delimited list ending with a colon, as in
the following example.
x_1, y_1, x_2, y_2: sqrt((x_1-x_2)^2 + (y_1-y_2)^2)
Best Practice: Declare your variables to ensure that WebAssign
interprets your answer key exactly as you intend.
®
Variable names in answer keys must observe the following conventions:
• Variable names must start with a letter.
• Variable names must include only letters, numbers, and underscores;
underscores in variable names indicate subscripting.
• Variable names are case-sensitive; X is different from x.
• Variable names should not duplicate the names of functions or of the numeric
value pi.
• Variables having the names of Greek letters are displayed in mathPad and
calcPad as the corresponding Greek letters. Greek letters except for π are
treated as variables. The letter π is treated as a constant.
November 2014
162 WebAssign Creating Questions Guide
• The variable e can be used, but it will be treated as both Euler's number and
as a variable name, so either response is marked correct.
The following table lists some examples.
Math Notation
Answer Key Notation
x
x
x1
x1
x1
x_1
books
books
λ
lambda
Be sure that your question identifies any variables that the student should use in
the answer.
Specifying Perl Variables in Answer Keys
If you have defined a Perl variable for use in your answer key — for example, to
randomize numeric values in your question — always enclose it with the <EQN> tag
as in the following example:
<EQN $d>x + <EQN $e>
To avoid confusion, use different names for Perl variables and math variables in
your question.
Creating Mathematica® Expressions
®
®
Most, but not all, Mathematica expressions are valid in WebAssign . Any
®
®
expression that works in the WebAssign Mathematica tool will work in your
question.
See Also:
Mathematica reference information at reference.wolfram.com/mathematica/
The {tab} Operator on page 329
Create Number Line Questions
There are two types of number line questions that use the NumberLine tool: one
in which students locate points and graph intervals and inequalities on a real
number line graph, referred to as default mode, and another, referred to as points
mode, where students indicate point positions on a number line graph.
Default Mode
The NumberLine tool in this mode includes a formatted display area in the middle
and a row of buttons at the bottom. The first five buttons are tool buttons. The
next six are graphing symbols.
November 2014
Create Math Questions 163
Students use the tools to manipulate symbols on the number line graph to solve
the exercise. Note that students can use either the open and closed circles or the
®
parentheses and brackets to answer questions; when WebAssign scores their
response, no distinction is made about which kind of notation was used so long as
it is equivalent to the answer key.
You can drag symbols from the graphing symbols palette onto the number line
graph. Note that you cannot completely overlap a symbol with another symbol.
Upon placing a symbol, the symbol style drawer opens above the symbol.
Students can use the symbol style drawer to change the type of symbol that is
displayed.
Below is an example of what this mode looks like in an exercise within
®
WebAssign .
Points Mode
The NumberLine tool in points mode includes a set of points at the top, a
formatted display area in the middle, and a row of tool buttons at the bottom.
November 2014
164 WebAssign Creating Questions Guide
The student drags the points from above the number line graph to the correct
place on the number line graph to solve the exercise. Note that you cannot
completely overlap two points.
Below is an example of what this mode looks like in an exercise within
®
WebAssign .
Create a NumberLine Question
The NumberLine tool is a palette for students to input solutions to exercises that
require the use of a number line. There are two modes: one is used to locate
points, graph intervals, and graph inequalities on a number line; the other to
indicate point positions on a number line graph.
To create a number line question:
1. From the Create menu, select Question.
2. Enter a name for the question and select NumberLine as the Mode. This
name will be listed on your My Questions list.
3. In the Question field, type the text that you want to be displayed for the
question. For each instance of the NumberLine tool, use a <_>.
Example code:
Plot the following interval on the real number line.
<div class='indent'>(-2, 1]</div>
<_>
4. In the Answer field, type the correct answer to your question.
November 2014
Create Math Questions 165
Example code:
(-2,1]
5. Click Test/Preview to view and test the question.
The key icon
is displayed at the bottom of the question next to the
numerical portion of the answer key. The students will not see the correct
answer marked with the key icon unless they are viewing the key.
6. When editing is complete, click Save to assign a question ID number to the
question.
The question will be accessible from your My Questions list.
Example NumberLine Question
QID
1237726
Name
Template2 4.NL.01.
Mode
NumberLine
Question
Plot the following interval on the real number line.
<div class='indent'>(-2, 1]</div>
<_>
Answer
(-2,1]
Displayed to
Students
November 2014
166 WebAssign Creating Questions Guide
Coding NumberLine Questions
You can code two types of questions that use the NumberLine tool: one in which
students locate points and graph intervals and inequalities on a number line
graph, referred to as default mode, and another, referred to as points mode,
where students indicate point positions on a number line graph. Note that all code
is typed in the answer field.
Parameters for Answer Field
The text for a NumberLine answer field involves:
• all display attributes and their values
• answer key objects (for example, 3.2; (6.45, 6.75])
• (For points mode only) all distractors.
Best Practices for All Randomizations
So that students have a consistent user experience, the following rules must be
observed for randomization to work effectively:
• NumberLine tool attributes (range, tickmarks, minor_tickmarks) must not be
randomized.
• If an answer key object or endpoint falls on a labeled tickmark, all
randomizations of that object or endpoint must fall on a labeled tickmark.
• If an answer key object or endpoint falls on an unlabeled tickmark, all
randomizations of that object or endpoint must fall on an unlabeled tickmark.
• If an answer key object or endpoint falls between two consecutive tickmarks,
all randomizations of that object or endpoint must fall between two
consecutive tickmarks.
NumberLine Tool Algorithm
For an optimum user experience for students, the following rules have been
implemented.
• Between a labeled and unlabeled tickmark, there must be space for at least
two closed circle symbols.
• Between two labeled tickmarks, there must be space for at least four closed
circle symbols.
• There must be an odd number of tickmarks.
• Unlabeled (or minor) tickmarks must evenly bisect the intervals in which they
are found.
If a specified range display attribute does not follow all of these rules, the
NumberLine tool will instead extend the range slightly to attempt to enforce this
rule. If the specified range display attribute is found to be completely unworkable,
the algorithm will return the default tickmarks based on a range of -5 to 5.
November 2014
Create Math Questions 167
Code a Question in Default Mode
In default mode, the following syntax is used in the answer field.
range:[-1,1]; (-0.75,0.25]
Note: A semicolon is necessary to delimit multiple elements.
The following table shows the display attributes that you can specify.
Attribute
Syntax
Description
Default Value
range
range:[lower_bound,
upper_bound]
Indicates the desired minimum
range. If the tickmarks attribute
is specified, the range attribute is
ignored.
[-5,5]
tickmarks
tickmarks:[lower_bound,
increment,upper_bound]
Indicates the lower bound
(lower_bound) and upper bound
Calculated
by the
NumberLine
tool
(upper_bound) of the labeled
tickmarks, as well as the tickmark
interval size (increment) desired.
minor_tickmarks
minor_tickmarks:[false]
Indicates whether to display
unlabeled tickmarks. Valid values
are true or false.
true
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.
If no values are specified for the range attribute, the tool defaults to a range
value of [-5,5]. For the range attribute and for the tickmarks attributes, the range
or the interval size between tickmarks is determined automatically. The tool
will attempt to use the specified range or interval size; however, if the specified
range or interval size returns no usable images for the number line graph, the
tool determines an appropriate range or interval size. If the tickmarks attribute
is specified, a range attribute is unnecessary and is ignored. If the value of
minor_tickmarks is not set to false, the tool populates as many minor tickmarks as
possible.
Examples
The following tables show a few coding examples.
Code
range:[-1,1]; (-0.75,0.25]
Description
• The range is from -1 to 1.
• The answer key is (-0.75,0.25].
November 2014
168 WebAssign Creating Questions Guide
Displayed to
Students
Code
range:[-8,8]; minor_tickmarks:[false]; -3;0;3;6
Description
• The requested range is from -8 to 8.
• minor_tickmarks is set to false, so no minor, that is, unlabeled, tickmarks are
displayed. In this example, since no minor tickmarks would be displayed by
default given a range of [-8,8], it is not necessary to specify this attribute.
• The answer key is -3;0;3;6.
Displayed to
Students
Code
range:[-8,9];[-2,2]
Description
• The requested range is from -8 to 9. The tool determines that for an optimum
student user experience, the range needs to be extended to [-8,12].
• The answer key is [-2,2].
Displayed to
Students
Code a Question in Points Mode
In points mode, the following syntax is used to code a question:
flag#:[position,label]
November 2014
Create Math Questions 169
where # is a number, position specifies the location on the number line graph to
which the point must be dragged, and label specifies the label for the point.
Note: A semicolon is necessary to delimit multiple elements.
For the label variable, use the syntax for the <symimage> tag; for details see
Creating Math Questions. The following table shows examples for coding the label
variable.
To Show:
Code This:
Example Code Block
pi symbol
pi
flag1:[3.14,pi]
stacked fraction
x/y
flag1:[0.5,1/2]
square root
sqrt(x)
flag1:[3,sqrt(9)]
nth root
rootn(x)
flag1:[<EQN
2**(1/3)>,root3(2)]
Displayed to
Students
For points that cannot be located within the range of the number line graph, the
position value is distractor. If all point values are set to distractor, the answer
key must be specified as no solution.
Examples
The following table shows example code using points mode and its explanation.
Example
Description
flag1:[0.5,1/2]
Indicates that flag1 has a correct position value of 0.5
on the number line graph and the stacked fraction
1/2 is displayed as its label.
flag1:[3.14,pi]
Indicates that flag1 has a correct position value of
3.14 on the number line graph and an image of pi is
displayed as its label.
November 2014
170 WebAssign Creating Questions Guide
Example
Description
flag1:[1,1];
flag2:[distractor,1
5]
Indicates that flag1 has a correct position value of
1 on the number line graph and an image of 1 is
displayed as its flag. Flag2 is a distractor and the
image of 15 is displayed as its label.
Note: The upper_bound of the range must be
set to less than 15.
flag1:[distractor,1];
flag2:[distractor,2
];
no solution
Since all two points are distractors, the answer key
must be set to no solution.
Answer Key Objects
The answer key objects (for example, 3.2; (6.45, 6.75]) specify the correct
answer for the question.
The Number Line mode uses an intuitive syntax to distinguish between objects on
the number line. Note that punctuation endpoints refers to the parentheses and
bracket graphing symbols.
To Do This:
Use This Notation:
Example
Single closed circle
Expressed as an
evaluated number.
3.2
Single open circle
Expressed as
an evaluated
number wrapped in
parentheses.
(1.4)
Punctuation endpoints for
intervals
Expressed as
evaluated numbers
with the punctuation
[-1.3, 2.4)
mark at the
appropriate position.
Multiple objects and
intervals
Specify -infinity and
infinity as left and right
Separated by
semicolons.
Intervals are expressed per
usual mathematical notation
(i.e., the lower and upper
bounds are separated by a
comma).
3.2; (6.45,
6.75]
(-infinity, 3]
(5, infinity]
endpoints of intervals,
respectively.
Specify the answer key as no
solution
no solution
Specify the answer key as
the entire real number line
(-infinity,
infinity)
November 2014
Notes
Create Math Questions 171
Note:
• Two answer key objects must not be placed so that they are less than
1/4 of the distance between two consecutive tickmarks.
• If an answer key object is overlapping a tickmark but the answer
is not actually on the tickmark, your tickmark spacing is too small.
Decrease the range attribute to a smaller range.
Below are examples of malformed answer keys and the corrected version.
Malformed Example
Why?
Corrected Example
(3,5];[4,6)
The intervals overlap.
(3,6)
or
(3,4;4,5;5,6)
3;[2,4]
3 is in the interval [2,4].
[2,4]
or
[2,3;3,4]
Note: If for some reason your answer key cannot be understood —
because of a typographical or other error — by default the key changes
to -2;[1,3] with a default range of -5 to 5. If you see this answer key
unexpectedly, there is a problem with the answer key you specified.
Syntax examples
Since all values must be evaluated to work, no values should include expressions
involving operators that are not evaluated. You must use the <eqn> tag to
evaluate expressions. The following examples show the proper syntax for the
answer field for both single objects and intervals. In the examples, n is an
evaluated number.
Type
Syntax
Description
Single point
n
Closed point at x = n
Single point
(n)
Open point at x = n
Interval
n0, n1
Interval between two closed points
Interval
(n0), (n1)
Interval between two open points
Interval
n0, n1)
Interval between a closed point at
x = n0 and a right parenthesis at x
= n1
Interval
(n0, n1
Interval between a left parenthesis
at x = n0 and a closed point at x =
n1
Interval
[n0, n1]
Interval between a left bracket at x
= n0 and a right bracket at x = n1
November 2014
172 WebAssign Creating Questions Guide
Type
Syntax
Description
Interval
(-infinity, n
Interval between the left infinity
arrow and a closed point at x = n
Interval
n, infinity)
Interval between a closed point
and the right infinity arrow
Interval
(-infinity,
infinity)
Entire real line
Grading
For the purposes of grading, no partial credit is awarded. Each instance of the
number line graph is worth one point.
If a student enters a mathematically malformed response, the student receives an
error message and does not lose a submission attempt, unless you have chosen to
count syntax errors as submissions at the class or assignment level. For example,
if a student enters an interval from a right parenthesis to a left parenthesis, an
error message is displayed.
Mathematically-Equivalent Answers
For the purposes of grading, the following equivalent answers are acceptable:
• Lone open points in the user's response are ignored. For example, a response
of
will be graded as though it were simply a response of
.
Note: However, an answer key of 3;(4) is malformed and will not function.
• Punctuation endpoints and point endpoints are treated as equivalent. For
example, a response of
.
November 2014
will be graded the same as a response of
Create Math Questions 173
• Mathematically equivalent intervals are treated as equivalent. For example,
a response of
will be graded the same as a response of
.
Tolerance
If an answer key object lies on a tickmark (labeled or unlabeled), a response
object that overlaps that tickmark is counted as correct.
If an answer key object lies in a space between two consecutive tickmarks, a
response object that is within a small distance (1/4 of the distance between
two consecutive tickmarks) of the answer key object's position is counted as
correct provided that the response object falls between the same two consecutive
tickmarks that the answer key object falls between. A handy way to remember
this rule is that this precision is expected when a student measures using a ruler.
Create Graphing Questions
A graphing question provides a graphing tool in the question for students to graph
points, lines, segments, rays, circles, parabolas, and inequalities on a Cartesian
coordinate plane. Graphing questions are automatically scored.
To create a graphing question:
1. Click Questions > Create. The Question Editor opens.
November 2014
174 WebAssign Creating Questions Guide
2. In Name, type a name for the question.
3. In Mode, select Graphing.
4. In Question, type your question. Use the answer placeholder string <_> to
specify where the graphing tool should be displayed.
5. In Answer, type notation that describes the objects that you want the
student to graph and the appearance of the grid. Each line in Answer
represents a separate answer and defines a new graph, so do not press ENTER
unless you wish to have the student create multiple separate graphs.
The following table describes the notation used to specify the objects that
you want the student to graph. If the student needs to graph more than one
object, separate each object with a semicolon, for example:
point:(9,3);point:(6,7);point:(2,2)
Object
How to specify answer
Examples
point
Specify the point coordinates.
point: (-9, 3)
point: (x, y)
line
Specify a linear equation for x and y, or
specify two points on the line.
line: y = 3*x - 6
line: (0,-6), (2,0)
line: y = m*x + b
line: y - k = m * (x - h)
line: (x1,y1), (x2,y2)
ray - closed endpoint Specify the endpoint of the ray, followed by
another point on the ray.
ray: [(0,0), (4,4))
ray: [(x1,y1), (x2,y2))
ray - open endpoint
Specify the endpoint of the ray, followed by
another point on the ray.
ray: ((5,0), (10,12))
ray: ((x1,y1), (x2,y2))
segment: [(5,0), (4,0)]
line segment closed endpoints
Specify the endpoints of the line segment.
line segment - open
endpoints
Specify the endpoints of the line segment.
line segment closed and open
endpoints
Specify the endpoints of the line segment.
circle
Specify the center coordinates and radius of circle: (4, 3), 5
circle: (x-4)^2+(y-3)^2 = 25
the circle or specify an equation.
segment: [(x1,y1), (x2,y2)]
segment: ((x1,y1), (x2,y2))
segment: ((x1,y1), (x2,y2)]
segment: [(x1,y1), (x2,y2))
circle: (a, b), r
circle: (x-a)^2 + (y-b)^2 =r^2
November 2014
segment: ((212,45), (52,10))
segment: ((5,0), (52,10)]
segment: [(5,0), (52,10))
Create Math Questions 175
Object
How to specify answer
Examples
parabola - vertical
axis
Specify an equation for the parabola in
the following form, or specify its vertex, a
second point, and orientation:
parabola: y = (x^2)/4 + 2*x - 6
parabola: (3,3), (5,5), V
parabola: y = a*x^2 + b*x + c
parabola: (x1,y1), (x2,y2), V
parabola - horizontal
axis
Specify an equation for the parabola in
the following form, or specify its vertex, a
second point, and orientation:
parabola: x = y^2 - 2*y
parabola: (3,3), (5,5), H
parabola: x = a*y^2 + b*y + c
parabola: (x1,y1), (x2,y2), H
dashed line or
Prefix the keyword line or parabola with the dashed line: y = 3*x - 6
parabola
keyword dashed.
linear inequality
Specify an equation for the linear
inequality.
region:
region:
region:
region:
region:
region:
region:
region:
circular inequality
y
y
y
y
y
y
y
y
dashed parabola: (3,3), (5,5), H
region: y - 5 >= 3*x
> m*x + b
>= m*x + b
< m*x + b
<= m*x + b
- k > m * (x - h)
- k >= m * (x - h)
- k < m * (x - h)
- k <= m * (x - h)
Specify an equation for the circular
inequality in the following form:
region: (x-4)^2+(y-3)^2 <= 25
region: (x-a)^2 + (y-b)^2 > r^2
parabolic inequality
Specify an equation for the parabolic
inequality using the same form as for a
parabola.
region: x > 3*y^2 - 5*y + 6
region: y > a*x^2 + b*x + c
region: x <= a*y^2 + b*y + c
intersection of
inequalities
Specify equations for each inequality on the region:y >= x^2 - 5; region:y < 2
same line, separated by semicolons.
no solution
Specify the following code for a question
with no solution:
nosol
nosol
6. 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.
7. Click Test/Preview to test the appearance and behavior of the question. See
Test Questions on page 18.
8. Click Redisplay to show certain kinds of errors in the Display section of the
Question Editor. Make any needed changes to your question.
November 2014
176 WebAssign Creating Questions Guide
9. 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 on page 19.
• 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 on page 308.
10. 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 Graphing Question
The following table summarizes an actual question.
QID
1077759
Name
Template2 4.GRAPH.01.
Mode
Graphing
Question
<watex>Graph the equation \[y = 3x + 5\].</watex><br>
<_>
Answer
line: y=3*x+5
Display to
Students
November 2014
Create Math Questions 177
Specify Equations in Graphing Question Answer Keys
When you use line, circle, parabola, or region in your graphing question answer
key, you have the option of specifying an equation for the key. You can use the
following notation in your equations.
Note:
• Do not use commas or spaces to separate digits in numbers. For
example, 1000000 is correct, but 1,000,000 and 1 000 000 are not.
• Do not use mixed numbers. Instead, use improper fractions. For
example, 7/4 is correct, but 1 3/4 is not correct.
Expression
Notation
Examples
Math variables
The only allowed variables in
graphing question answer keys are
x and y.
line: y=x+1
Addition
+
line: y=x+1
Subtraction
-
line: y=x-1
Multiplication
*
line: y=x*2
You must use explicit
multiplication.
Division or
fractions
/
Exponentiation ^
Ensure that your equation specifies
a linear, circular, or parabolic
function.
line: y=x/4
parabola: y=x^2
circle:(x-1)^2+(y+3)^2=25
Equality
=
line: y=x+1
Inequality
>
<
>=
<=
region:
region:
region:
region:
Order of
Operations
()
circle:(x-1)^2+(y+3)^2=25
Pi (π)
pi
parabola: y=pi*x^2
y>x+1
y<x+1
y>=x^2+3*x+1
(x-1)^2+(y+3)^2<=25
Substituting 3.14 only
approximates this value.
Graphing Tool Grid Display and Snap Behavior
In your graphing questions, you can specify the display and behaviors for each
coordinate axis. You can set the minimum and maximum displayed values and
the spacing between gridlines and value labels. You can hide gridlines, labels, or
November 2014
178 WebAssign Creating Questions Guide
coordinate axes. And you can configure the snap spacing, which determines how
objects drawn on the graphing tool are positioned relative to the coordinate grid
when they “snap” to the nearest specified unit.
To configure the grid display and snap behavior for the graphing tool, you can
add any of the following notation to the answer line, delimiting each item with a
semicolon. For example, to set the minimum and maximum values displayed for
the graph of a linear equation, your answer key could be:
Examples
line: y=x+1; axes: [0, 30, 0, 30]
Spacing values must be positive decimal numbers; minimum and maximum
values for axes must be decimal numbers, and the maximum must be greater
than the minimum.
November 2014
Configuration
Notation
Default Value
Example
Set the maximum
and minimum values
displayed on the grid.
axes: [x_minimum,
-10, 10, -10, 10
x_maximum, y_minimum,
y_maximum]
axes: [0, 30,
0, 30]
Hide the y-axis
yav:false
true
yav:false
Hide the x-axis
xav:false
true
xav:false
Hide the y-axis value
labels
yvv:false
true
yvv:false
Hide the x-axis value
labels
xvv:false
true
xvv:false
Hide horizontal
gridlines
ygv:false
true
ygv:false
Hide vertical gridlines
xgv:false
true
xgv:false
Set the y-axis value
label spacing
yvs:spacing
1
yvs:50
Set the x-axis value
label spacing
xvs:spacing
1
xvs:40
Set the y-axis grid
spacing
ygs:spacing
1
ygs:25
Set the x-axis grid
spacing
xgs:spacing
1
xgs:20
Set the y-axis snap
spacing
yss:spacing
1
yss:0.25
Set the x-axis snap
spacing
xss:spacing
1
xss:0.1
Create Math Questions 179
Create Matrix Questions
When you create a matrix question, you have the option to use an expandable or
static matrix in your answer key. By default, matrix answer keys are expandable,
which means you are not providing the dimensions of the answer matrix to your
students.
To create a matrix question:
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. In Question, type your question.
Note: An asterisk (*) must be used for multiplication in variable
expressions. For an example of this requirement, see question
®
2431015, ExpandableMatrixExample 1.1.007. in WebAssign .
a) Set the variables in the question using Perl statements. For more
information, see Set Perl Variables on page 315.
For example:
<eqn>
($a, $b) = pick(2, 2..9);
''
</eqn>
b) Create the question using WaTeX notation. For more information on the
general syntax, see Create WaTeX Arrays and Matrices on page 124.
For example:
Find the product: <watex>\[\begin{matrix}{rrr}{2} 1 & $a & 2 \\ $b
& 0 & 1 \end{matrix}
\begin{matrix}{rr}{3} -1 & 0 \\ 0 & 5 \\ 1 & 1 \end{matrix}.\]</
watex><br />
(Use the green arrows to change the dimensions of your answer
matrix.)
c) Using the following parameters, create the answer blank in matrix form <_
matrix_mode='mode' matrix_dimensions='RxC'>, where mode is the display
value and RxC is the number of rows and columns:
• matrix_mode is a required parameter and sets the visual presentation
using one of four values:
• matrix_mode='matrix' displays the matrix in expandable columns
and rows
• matrix_mode='determinant' displays the matrix as an expandable
determinant matrix
November 2014
180 WebAssign Creating Questions Guide
• matrix_mode='columnvectors' displays the matrix as expandable
column vectors
• matrix_mode='rowvectors' displays the matrix as expandable row
vectors
• matrix_dimensions is a required parameter and determines how many
rows and columns are initially displayed to the student. For example,
matrix_dimensions='4x2' means the initial matrix will have 4 rows and
2 columns. Values 1-8 are supported.
• matrix_label is an optional parameter that adds labels (in plain text
format) to the matrix. The position and type of label depends on the
matrix mode.
• matrix_static is an optional parameter set to true to make a matrix
static (non-expandable). If this is not set, the matrix is expandable by
default.
For example:
<_ matrix_mode='matrix' matrix_dimensions='3x3'>
The example code in the Question block now looks like this:
<eqn>
($a, $b) = pick(2, 2..9);
''
</eqn>
Find the product: <watex>\[\begin{matrix}{rrr}{2} 1 & $a & 2 \\ $b &
0 & 1 \end{matrix}
\begin{matrix}{rr}{3} -1 & 0 \\ 0 & 5 \\ 1 & 1 \end{matrix}.\]</
watex><br />
(Use the green arrows to change the dimensions of your answer
matrix.)
<_ matrix_mode='matrix' matrix_dimensions='3x3'>
5. In Answer, type the answer to the question. You must use <EQN
$MATRIX=1;''> to initiate the matrix mode followed by your answer_key.
For example:
<EQN $MATRIX=1; '';>[1, <EQN 2+5*$a>; <EQN 1 - $b>, 1]
®
You can view this example question in WebAssign : 2645454, Test Matrix
Mode Instructions 001.
6. 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.
7. Click Test/Preview to test the appearance and behavior of the question. See
Test Questions on page 18.
November 2014
Create Math Questions 181
8. Click Redisplay to show certain kinds of errors in the Display section of the
Question Editor. Make any needed changes to your question.
9. 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 on page 19.
• 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 on page 308.
10. 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 Question using an Expandable Matrix
The following table summarizes an actual question.
QID
1787200
Name
CheneyLinAlg2 1.2.007.
Mode
Fill in the Blank
Question
<eqn>
$a31 = randnum(2, 4, 1);
$a32 = 3*$a31;
$a34 = 3*$a31;
$c1 = randnum(4, 7, 1);
$d2 = randnum(2, 5, 1);
$c2 = 2*$c1 + $d2;
$c3 = $c1*$a31;
''
</eqn>
Consider <watex>\[
\begin{matrix}{r}{3}
1 & 3 & 0 & 5 & <eqn $c1>\\
2 & 6 & 1 & 8 & <eqn $c2>\\
<eqn $a31> & <eqn $a32> & 0 & <eqn $a34> & <eqn $c3>
\end{matrix}
\]</watex> Find the reduced row echelon form of this
matrix <br />
<_ matrix_mode='matrix' matrix_dimensions='3x5'>
Answer
<EQN $MATRIX=1; '';>[1, 3, 0, 5, <EQN $c1>; 0, 0, 1, -2, <EQN
$d2>; 0, 0, 0, 0, 0]
November 2014
182 WebAssign Creating Questions Guide
Display to
Students
Matrix Parameters
For questions using matrix mode, the parameters listed in this table are used to
set the type and size of the matrix, as well as provide label and expandable/static
options.
Parameter
Description
Required?
Values
matrix_mode
Turns an answer blank
into a matrix mode blank,
setting the visual display.
Yes
Values can be set to one of the following:
• matrix_mode='matrix' creates a matrix
with expandable rows and columns
Used instead of an <_>
answer blank.
• matrix_mode='columnvectors' creates a
By default, the matrix is
expandable.
• matrix_mode='rowvectors' creates a
matrix with expandable columns
matrix with expandable rows
• matrix_mode='determinant' creates a
determinant matrix with expandable rows
and columns
matrix_dimensions
Sets the default number of Yes
rows and columns.
matrix_dimensions='RxC'
Values are set in the form of rows x
columns and support numbers 1 to 8. For
example, matrix_dimensions='3x5' sets
the default dimensions to 3 rows and 5
columns.
matrix_label
Adds a label in plain text
format to the matrix.
No
matrix_label='myLabel'
Values can be set using plain text format.
Values for column vectors have the same
label, but with a subscript. Values for row
vectors have the same label, but with a
subscript.
Note: WaTex, HTML, and symbol
space format are not valid in a
label; use an HTML table as a
workaround.
November 2014
Create Math Questions 183
Parameter
Description
Required?
Values
matrix_static
Turns off expandability
of matrix. By default, a
matrix is expandable.
No
matrix_static='true'
Value can only be set to true, which
changes the matrix from expandable to
static.
November 2014
184 WebAssign Creating Questions Guide
November 2014
6
Create Physics Questions
This chapter contains the
following topics:
• Display Notation with WaTeX
You can create questions for your physics courses that allow
your students to answer questions with correctly formatted
physics notation. And, you can display correctly formatted
notation in your questions using several different methods.
• Display Notation with LaTeX
• Add Symbols to Questions
• Display Notation with <symimage>
• Display Math Notation with HTML
Substitution
• Create physPad Questions
Note: To create questions requiring your students to
enter numerical answers, see Create Integer or Decimal
Number Questions on page 95.
See Also:
Understanding the <eqn> and <EQN> Tags on page 312
November 2014
186 WebAssign Creating Questions Guide
Display Notation with WaTeX
®
WebAssign provides a markup language — WaTeX — that you can use to display
well-formatted math notation in your questions and assignments. WaTeX is similar
in some respects to LaTeX in that both markup languages let you focus more on
content and spend less time solving layout problems.
But because WaTeX is rendered in HTML and LaTeX is rendered as a static image,
WaTeX has some clear benefits for online coursework:
• WaTeX display can be enlarged with the browser settings to accommodate
students with visual impairments.
• WaTeX markup allows you to put answer boxes in your markup, so you can,
for example, prompt students to provide the numerator of a fraction, the
argument of a trigonometric function, or the bounds of an integral. You can
also use WaTeX to format matrix or long division problems.
To use WaTeX markup in your questions or assignments, add the following code,
where markup is any valid WaTeX notation:
<watex>\[markup\]</watex>
The \[ and \] delimiters start and end WaTeX math mode. Usually, you will want
to use math mode in WaTeX, but if needed, you can omit \[ and \] to use WaTeX
markup without math mode.
Understanding Math Mode
Math mode in WaTeX corresponds to math mode in LaTeX, and provides the
following behaviors to simplify entering math notation:
• Alphabetic characters that are not part of a function name or Perl variable are
presumed to be variables and are italicized.
• Hyphens are replaced by minus signs.
• Exponents can be typed using a caret (^).
• Subscripts can be typed using an underscore (_).
Note:
• To display non-italicized text such as words or units in math mode,
enclose them in the WaTeX \pre{} notation.
®
• In math mode, you cannot use any of the WebAssign HTML
substitution tags, but this formatting can be performed using WaTeX.
Tip: You can use WaTeX in Question or Solution. For multiple-choice,
multiple-select, and matching questions, you can also use WaTeX in
Answer. If your markup is very long, you might want to assign it (using
double quotes) to a variable in Question and then reference that variable
in Answer.
See Also:
Display Math Notation with HTML Substitution on page 141
November 2014
Create Physics Questions 187
WaTeX Notation
The code listed in this table is valid in the <watex> tag. Unless specified otherwise,
all of the examples in the following table are shown as they are displayed when
using math mode.
Note: As in HTML, successive whitespace characters in WaTeX are ignored.
To add multiple spaces, you can use <s:space>.
Expression
Code
Example
Display
Perl variables
$variable
$a
35
${variable}
${a}x
35x
<EQN $variable>
<EQN $a>
35
2x\pre{ km}
2x km
Use braces when the Perl variable is
followed by other text.
Use <EQN> to display the variable in
black.
Roman text,
®
WebAssign tags, or
HTML
\pre{text}
Answer placeholder
strings
<_>
Line breaks
\\
Not needed unless using math mode.
Not needed for answer placeholder
string <_>.
\frac{6}{8} = \frac{<_>}{4}
This cannot be done with
<symimage> or LaTeX.
3x \\ 4y
3x
4y
Use \\ instead of <br \>.
Consecutive line breaks are treated
as a single line break. To add more
vertical spacing, use \vspace.
Line breaks with
vertical spacing
\vspace{nem}
3x \vspace{1em} 4y
\vspace{npx}
3x
4y
Adds a line break with the specified
amount of space between the lines.
Do not add a space between the
number and the unit.
For on-screen display, ems and pixels
are preferred units, but you can also
use cm, in, mm, pc, or pt.
Addition
+
x + 1
x+1
Subtraction
-
x - 1
x−1
November 2014
188 WebAssign Creating Questions Guide
Expression
Code
Example
Display
Multiplication
*
x * 2
x·2
\times
x \times 2
x×2
(implicit)
2x
2x
Division
\div
x \div 2
x÷2
Fractions
\frac{num}{den}
\frac{x}{4}
You can put a fraction in the
numerator or denominator of another
fraction.
Binomial
\left(\over{n}{k}\right)
\left(\over{a}{b}\right)
Combinations,
permutations, and
isotopes (over/under
notation)
\over{top}{bottom}
\left(\over{52}{5}\right)
=
2598960
This is sometimes used with
<s:space> in the top or bottom to help
vertical alignment.
P\over{10}{3} = 720
\over{233}{91}\pre{Pa}
Exponents
(superscripts)
^ (caret)
x^2
x
2
If the superscript is more than 1
character, enclose it in braces {}.
x^{12}
x
12
Bases (subscripts)
_ (underscore)
x_2
x2
If the subscript is more than 1
character, enclose it in braces {}.
x_{(y + 3)}
x(y + 3)
(arg)
(x)
(x)
\left[size](
\left[1]( \frac{x}{3}
\right[1])
Parentheses
\right[size])
Specify the optional size as an integer
from 1 through 9.
Brackets
[arg]
[x]
\left[size][
\left[1][ \frac{x}{3}
\right[1]]
\right[size]]
[x]
Specify the optional size as an integer
from 1 through 9.
Braces
{arg}
{x}
\left[size]\{
\left[1]\{ \frac{x}{3}
\right[1]\}
\right[size]\}
Specify the optional size as an integer
from 1 through 9.
November 2014
{x}
Create Physics Questions 189
Expression
Code
Example
Angle brackets
\left[size]<
\left<x\right>
\right[size]>
\left[1]< \frac{x}{3}
\right[1]>
Specify the optional size as an integer
from 0 through 9.
Absolute values
(vertical bars)
|arg|
|x|
\left[size]|
\left[1]| \frac{x}{3}
\right[1]|
\right[size]|
Display
|x|
Specify the optional size as an integer
from 1 through 9.
Magnitude (double
vertical bars)
\lleft[size]|
\rright[size]|
\lleft[0]|\overrightarrow{v
}\rright[0]|
Specify the optional size as an integer
from 0 through 9.
Greatest integer
function (double
brackets)
\lleft[size][
\lleft[x\rright]
Square root
\sqrt{arg}
\sqrt{16}
\sqrt{size}{arg}
\sqrt{3}{\frac{1}{2}}
\rright[size]]
Specify the optional size as an integer
from 1 through 9.
Specify the optional size in positive
integers; the height is approximately
size lines.
Nth root
\sqrt[n]{arg}
\sqrt[3]{27x}
\sqrt{size}[n]{arg}
\sqrt{3}[4]{\frac{x}{81}}
Specify the optional size in positive
integers; the height is approximately
size lines.
Factorial
!
5!
5!
November 2014
190 WebAssign Creating Questions Guide
Expression
Code
Example
Display
Trigonometry
\sin
\cos
\tan
\asin x
arcsin x
\arcsin
\arccos
\arctan
\cos <s:theta>
cos θ
\isin
\icos
\itan
\csch a
csch a
\sinh
\cosh
\tanh
\tan(45<s:degree>)
tan(45°)
\arcsinh
\arccosh
\arctanh
\icoth(x)
coth (x)
\isinh
\icosh
\itanh
\sec
\csc
\cot
\arcsec
\arccsc
\arccot
\isec
\icsc
\icot
\sech
\csch
\coth
\arcsech
\arccsch
\arccoth
\isech
\icsch
\icoth
-1
\arccos, \arcsin, and so on can be
abbreviated like \acos or \asin, but
the longer version of the function
name is displayed.
2
Exponential function
e^n
e^2
e
Logarithms
\ln(n)
\ln(e^x) = x
ln(ex) = x
\log(n)
\log(1000) = 3
log(1000) = 3
\log_b(n)
\log_2(128) = 7
log2(128) = 7
Equality
=
a = 2<s:pi>r
a = 2πr
Inequality
>
x > 3
x>3
<
x < 3
x<3
\geq
x \geq 3
x≥3
\leq
x \leq 3
x≤3
\neq
x \neq 3
x≠3
<s:notgreater>
x <s:notgreater> 3
x
3
<s:notless>
x <s:notless> 3
x
3
Approximate
\approx
x \approx 3
x≈3
Plus or minus
\pm
x \pm 3
x±3
Minus or plus
\mp
x \mp 3
x
Infinity
\infty
\infty
∞
Greek
<s:letter_name>
<s:pi>
π
Capital Greek
<s:Letter_name>
<s:Omega>
Ω
November 2014
3
Create Physics Questions 191
Expression
Code
Example
Arrays
\begin{array}{alignment}
\begin{array}{rl}
cell & cell \\
y = & <s:space>3x + 10 \\
cell & cell
2y = & <s:space>4x - 5
\end{array}
\end{array}
Display
For more information, see Create
WaTeX Arrays and Matrices on page
124.
Matrices
\begin{matrix}{alignment}
A = \begin{matrix}{c}{2}
cell & cell \\
x & y & z\\
cell & cell
a & b & c
\end{matrix}
\end{matrix}
For more information, see Create
WaTeX Arrays and Matrices on page
124.
Determinants
For more information, see Create
WaTeX Arrays and Matrices on page
124.
\pre{det}(A) = |A|
det(A) = |A|
\left|\begin{array}{c}
a & b \\ c & d
\end{array}\right| = ad bc
\ddots
\ddots
\cdots
\cdots
\vdots
\vdots
\iddots
\iddots
\ldots
\ldots
Overline
\overline{}
0.\overline{3}
Indefinite
summation
\sum{arg}
\sum{x_i}
Definite summation
\sum_{lower}^{upper}{arg}
\sum_{i = 0}^{n}{x_i}
Indefinite integrals
\int{arg}
\int{f(x)dx}
Definite integrals
\int_{lower}^{upper}{arg}
\int_{0}^{1}{\sqrt{x}dx}
Ellipses
0.3
November 2014
192 WebAssign Creating Questions Guide
Expression
Code
Example
Limits
\lim_{lower}{arg}
\lim_{n\rightarrow\infty}{x
_n}
\lim{}_{lower}
Right arrows
\lim{}_{n\rightarrow
\infty}
x_n
\rightarrow
\rightarrow
\Longrightarrow
\Longrightarrow
Arrows over notation \overleftarrow{arg}
Display
→
\overleftarrow{AB}
\overrightarrow{arg}
\overrightarrow{AB}
\overleftrightarrow{arg}
\overleftrightarrow{AB}
\overleftharpoon{arg}
\overleftharpoon{AB}
\overrightharpoon{arg}
\overrightharpoon{AB}
\overleftrightharpoon{arg}
\overleftrightharpoon{AB}
Middle dot
\cdot
\cdot
Circle
\circ
\circ
Non-breaking text
\nobr{}
\nobr{1.2 \times 10^2}
1.2 × 10
Italics
\it{}
text \it{italicized} text
text italicized
text
Harpoons over
notation
Not needed in math mode.
·
2
Boldface
\bf{}
\bf{boldface}
boldface
Strikeout
\sout{}
\sout{strikeout}
strikeout
Underline
\uline{}
\uline{underlined}
underlined
See Also:
Add Symbols to Questions on page 132
Create WaTeX Arrays and Matrices
WaTeX provides notation for adding arrays and matrices to your questions.
In WaTeX, an array is a simple table with no borders; you can therefore use arrays
not only to display tabular data, but also to control the positioning of items such
as answer boxes or choices, equations, or even other arrays. For many questions,
creating a WaTeX array is simpler and less time-consuming than creating the
equivalent table using HTML.
A matrix is a special kind of WaTeX array that automatically displays brackets
around it just like mathematical matrices.
You can:
November 2014
Create Physics Questions 193
• add horizontal or vertical ruling for particular cells
• put arrays and matrices inside of other arrays or matrices
You cannot:
• directly apply HTML or CSS attributes to change the appearance or size of
arrays or matrices
• span cells horizontally or vertically in arrays or matrices
To use complicated formatting or to allow entry of large amounts of tabular data,
you might want to use an HTML table instead of a WaTeX array or matrix.
Creating Arrays
To add an array, type code using the following general syntax:
\begin{array}{alignment}
cell_contents & cell_contents \\
cell_contents & cell_contents
\end{array}
where:
• \begin{array} starts the array.
• alignment is a string comprised of one or more lowercase letters l, r, or c
specifying left, right, or center alignment for each column. If you use fewer
characters than there are columns, the last character defines the alignment
for all remaining columns.
• cell_contents represents anything you want to put in the cell.
• An ampersand (&) separates each cell in a row.
• A double backslash (\\) ends each row. This code is not needed to end the
last row.
• \end{array} ends the array.
For example, to align two equations with respect to the equals sign, you could use
the following code:
Code
Display
\begin{array}{rcl}
y & = & 3x + 10 \\
2y & = & 4x - 5
\end{array}
Creating Matrices
To add a matrix, type code using the following general syntax:
\begin{matrix}{alignment}{rows}
cell_contents & cell_contents \\
cell_contents & cell_contents
\end{matrix}
where:
• \begin{matrix} starts the matrix.
November 2014
194 WebAssign Creating Questions Guide
• alignment is a string comprised of one or more lowercase letters l, r, or c
specifying left, right, or center alignment for each column. If you use fewer
characters than there are columns, the last character defines the alignment
for all remaining columns.
• rows specifies the number of rows (1-9) in the matrix and is required to
correctly display the brackets around the matrix.
• cell_contents represents anything you want to put in the cell.
• An ampersand (&) separates each cell in a row.
• A double backslash (\\) ends each row. This code is not needed to end the
last row.
• \end{matrix} ends the matrix.
For example, to display a simple 3×2 matrix, you could use the following code:
Code
Display
A = \begin{matrix}{c}{2}
x & y & z\\
a & b & c
\end{matrix}
Adding Row or Column Ruling
You can add row or column ruling in arrays and matrices.
• To add vertical ruling left of any cell, add the following markup in the cell:
\vline
• To add horizontal ruling above particular columns in a row, add the following
markup anywhere in the row:
\cline{from-to}
where from and to are the column numbers where the ruling should be displayed.
Columns are numbered starting with 0 for the leftmost column. To add ruling
above discontinuous columns, use multiple instances of \cline. To add ruling
above a single column, specify the same column number for both from and to.
For example:
Code
Display
\begin{matrix}{c}{2}
A & \vline B\\
C & \vline D \cline{0-1}
\end{matrix}
WaTeX Example: Align a System of Equations
This example illustrates how to align a system of equations with WaTeX notation.
November 2014
QID
1215889
Name
Template2 4.WATEX.01.
Create Physics Questions 195
Mode
Numerical
Question
Solve the system of equations.
<div class="indent">
<watex>\[
\left[2]\{ \begin{array}{rcl}
2x + 4y & = & 26 \\
3x - y & = & 4
\end{array}\]</watex>
</div>
<watex>\[
x = <_>\\
y = <_>
\]</watex>
</div>
Answer
3
5
Display to
Students
WaTeX Example: Matrices
This example illustrates how to display matrices with WaTeX notation.
QID
1216105
Name
Template2 4.WATEX.02.
Mode
Numerical
November 2014
196 WebAssign Creating Questions Guide
Question
Answer
The following matrices show the numbers of wins
at
home and away for three youth soccer teams.
<div class="indent">
<watex>
\begin{array}{ccl}
& W<s:space><s:space>L & \\
Home = & \begin{matrix}{c}{3} 2 & 3 \\ 0 & 4 \\
\end{matrix} &
\begin{array}{l} Bears \\ Cardinals \\
Giants \end{array} \end{array}
<s:quad>
\begin{array}{ccl}
& W<s:space><s:space>L & \\
Away = & \begin{matrix}{c}{3} 1 & 2 \\ 0 & 3 \\
\end{matrix} &
\begin{array}{l} Bears \\ Cardinals \\
Giants \end{array} \end{array}
</watex>
</div>
Use matrix addition to determine the total wins
for
each team.
<div class="indent">
<watex>
\begin{array}{ccl}
& W<s:quad><s:quad>L & \\
Total = & \begin{matrix}{c}{3} <_> & <_> \\ <_>
&
<_> \end{matrix} &
\begin{array}{l} Bears \\ Cardinals \\
Giants \end{array} \end{array}
</watex>
</div>
and losses
3 & 2
1 & 3
and losses
& <_> \\ <_>
<eqn $size=1; ''>3
5
0
7
4
5
Display to
Students
WaTeX Example: Arithmetic Long Division
This example illustrates how to create a long division problem with WaTeX
notation.
QID
November 2014
1212389
Create Physics Questions 197
Name
Template2 4.WATEX.03.
Mode
Numerical
Question
Divide.
<div class="indent">
<watex>
\begin{array}{c}
&
\cline{1-5} 123 & \vline 5
&
<_>
\cline{1-3}
&
&
\cline{2-4}
&
&
\cline{3-5}
&
\end{array}
</watex>
</div>
Answer
&
& <_> & <_> & <_> & R<_>\\
& 6 & 1 & 7 & 4 &
\\
& <_> & <_> &
&
&
\\
& <_> & <_> & 7 &
&
\\
& <_> & <_> & <_> &
&
\\
&
& <_> & <_> & 4 &
\\
&
& <_> & <_> & <_> &
\\
&
&
& <_> & <_> &
\\
<eqn $size=1; ''>4
5
6
86
4
9
2
6
9
6
1
5
8
2
7
3
8
8
6
Display to
Students
WaTeX Example: Polynomial Long Division
This example illustrates how to create a polynomial long division problem with
WaTeX notation.
QID
1212380
Name
Template2 4.WATEX.04.
November 2014
198 WebAssign Creating Questions Guide
Mode
Symbolic
Question
Divide. Type ^ to indicate exponents, as in x^2.
<div class="indent">
<watex>
\[ \begin{array}{c}
&
&
& <_> & + & <_>
\cline{1-5} x - 4 & \vline 2x^2 & + & 5x & - & 50
& <_>
& - & <_> &
&
\cline{1-3}
&
&
& <_> & - & 50
&
&
& <_> & - & <_>
\cline{3-5}
&
&
&
&
& <_>
\end{array}\]
</watex>
</div>
Answer
\\
\\
\\
\\
\\
<eqn $size=1; ''>x:2*x
13
x:2*x^2
x:8*x
x:13*x
x:13*x
52
2
Display to
Students
WaTeX Example: Synthetic Division
This example illustrates how to create a synthetic division problem with WaTeX
notation.
November 2014
QID
1215844
Name
Template2 4.WATEX.05.
Mode
Multi-Mode...NQN
Question
Divide <watex>\[x^3 - 2x^2 - 11x + 12 \pre{ by } x - 3\]</
watex>.
Use synthetic division.
<div class='indent'>
<watex>
\[
\begin{array}{c}
<_>
& \vline & <_> & <_> & <_> & <_> \\
\cline{1-5}&
&
& <_> & <_> & <_> \\
\cline{1-5}&
& <_> & <_> & <_> & <_>
\end{array}
\]
</watex></div>
<SECTION>Express your answer as a polynomial: <_> <br />
<SECTION>Remainder: <_>
Create Physics Questions 199
Answer
<eqn $size=1; ''>3
1
-2
-11
12
3
3
-24
1
1
-8
-12
<SECTION><EQN $PAD='devmath'; ''>x: x^2 + x - 8
<SECTION>-12
Display to
Students
Display Notation with LaTeX
You can include LaTeX markup to display well-formatted math notation in your
®
questions and assignments in WebAssign . Unlike WaTeX, LaTeX is displayed as a
static image in your questions and does not offer the flexibility to include answer
boxes in your math notation.
®
Note: WebAssign 's LaTeX installation does not include every LaTeX
package. Always test your notation to ensure that it displays correctly.
Use LaTeX to display math notation for the following reasons:
• You need to display a formatted solution or learning materials as a PDF that
is linked from your question or assignment.
• You are already familar with LaTeX and do not want to use another method
for displaying math notation.
If you are not already familiar with LaTeX and do not need to display notation as a
PDF, use WaTeX, the <symimage> tag, or HTML substitution.
To include LaTeX markup in your question or assignment, enclose it in the <latex>
tag:
<latex>latex_markup</latex>
Displaying Perl Variables in LaTeX
To display the values of Perl variables in your LaTeX markup (for example, to use
randomized values), use one of the methods described in the following table.
November 2014
200 WebAssign Creating Questions Guide
Method
Code
Example
Display
Display value in
red
$variable
<latex>$
${p}x=13
$</latex>
3x = 13
<latex>$
<EQN $p>x=13
$</latex>
3x = 13
<latex eqn=black>$
${p}x=13
$</latex>
3x = 13
${variable}
Use braces or add a space
after each variable name to
distinguish it from other text.
Display value in
black
<EQN $variable>
Display all
values in black
<latex eqn=black>
$variable
Do not use the lowercase
<eqn> tag.
<latex eqn=black>
${variable}
Use braces or add a space
after each variable name to
distinguish it from other text.
Displaying LaTeX as a PDF
To display a larger set of LaTeX notation than a single mathematical expression —
for example, to use LaTeX to format a solution or additional learning materials —
you can display your LaTeX markup as a PDF that is linked from the question or
assignment.
To display your LaTeX markup as a linked PDF, set the pdf attribute in the <latex>
tag to the text of the link you want your students to click:
<latex pdf='link_text'>
In your question or assignment, the specified link text will be displayed. When
your students click the link, a PDF is displayed with your formatted notation.
See Also:
http://www.ctan.org
http://www.latex-project.org
Add Symbols to Questions
®
You can use the WebAssign <s> tag to add a number of symbols to your
questions. Some symbols are displayed as characters, and others are displayed as
images.
See www.webassign.net/manual/instructor_guide/c_i_list_symbols.htm for lists of
symbols that you can add to your questions.
November 2014
Create Physics Questions 201
Display Notation with <symimage>
You can use the <symimage> tag to display well-formatted math notation in your
®
questions and assignments in WebAssign . The markup used in the <symimage>
tag is also used in NumberLine questions to display labels for points.
Unlike WaTeX, notation displayed with the <symimage> tag is displayed as a
static image in your questions and does not offer the flexibility to include answer
boxes in your math notation.
To use symimage markup in your questions or assignments, add the following
code:
<symimage(markup)>
where markup is any symimage markup described in <symimage> Notation on
page 202.
Note:
• When creating a flag for a NumberLine question, do not include the
<symimage> tag itself; just specify the markup.
• As in HTML, successive whitespace characters in symimage markup
are ignored. To add a space explicitly, precede the space with two
backslash characters (\\ ).
Alphabetic characters that are not part of a function name or Perl variable are
presumed to be variables and are italicized.
Controlling the Size of the Displayed Notation
Unlike WaTeX, which is automatically resized with the text in the browser window,
images generated with the <symimage> tag are static. However, you can scale
the initial image to one of seven sizes.
Note: You cannot change the size of notation displayed in NumberLine
questions.
To change the size of the displayed notation, append the following notation in your
<symimage> tag:
, size => n
where n is an integer from 1 through 7, with 3 being the default if you do not
specify a size. For example:
<symimage(sqrt(x/a), size => 6)>
The following image shows how each size value is displayed.
Controlling the Placement of the Displayed Notation
You can control the vertical alignment and spacing of the displayed notation
relative to the surrounding text.
November 2014
202 WebAssign Creating Questions Guide
Note: You cannot change the placement of notation displayed in
NumberLine questions.
To align the displayed notation relative to the surrounding text, append one of the
following notations in your <symimage> tag:
, align => top
, align => middle
, align => bottom
The top, middle, or bottom of the image is aligned with respect to the top, middle,
or bottom of the text line where the image is displayed. The default alignment is
bottom.
To add extra space around the displayed notation, append the following notation
in your <symimage> tag:
, padding => n
where n is a positive integer representing the number of pixels of whitespace to
add on every side of the displayed notation. This is particularly useful when the
<symimage> tag is used in multiple choice answers.
For example:
<symimage((3x+12)/(x^2), align => top, padding => 10)>
aligns the top of the displayed fraction with the top of the line of text and adds 10
pixels of space on every side of the displayed image.
<symimage> Notation
Expression
Code
Example
Display
Perl variables
$variable
$a x
7x
Leave a space after the variable
name.
Note: Perl variables are
not displayed in red with
<symimage>.
Roman text
text(text_string)
2x+1 text( if ) x <= -1
2x + 1 if x ≤ −1
Addition
+
x + 1
x+1
Subtraction
-
x - 1
x−1
Multiplication
*
2 * x
2·x
cross
2 cross x
2×x
(implicit)
2x
\/
x\/y
Division
You cannot display the division sign
(÷) using <symimage>
November 2014
2x
x/y
Create Physics Questions 203
Expression
Code
Example
Fractions
/
x/y
Display
You can put a fraction in the
numerator or denominator of another
fraction.
Exponents
(superscripts)
^ (caret)
x^2
x2
**
x**(2y)
x2y
If the superscript is not just a
number or a variable, enclose it in
parentheses ().
^1text(H)^alpha
Precede the superscript with a
space if it precedes notation.
Bases
(subscripts)
_ (underscore)
x_2
x2
If the subscript is not just a
number or a variable, enclose it in
parentheses ().
x_(y + 3)
x2y + 3
Precede the subscript with a
space if it precedes notation.
Binomial (over/
under notation)
(top__bottom)^()
Permutations
and isotopes
(combined
subscript and
superscript)
_bottom^top
Parentheses
(arg)^()
(7__3)^()
Type two underscores between the
top and bottom expressions.
Precede the subscript with a
space if the combined subscript/
superscript precedes notation.
P_3^10 = 720
_91^233text(Pa)
(x/2)^()
Use this notation to explicitly add
automatically-sized parentheses
around an expression when they
might otherwise be omitted.
Brackets
[arg]
[x]
matrix(1,1,[arg])
matrix(1,1,[x/3])
[x]
When using the matrix notation, the
brackets are automatically sized to fit
the contents. Some contents, such as
fractions, are also resized.
November 2014
204 WebAssign Creating Questions Guide
Expression
Code
Example
Braces
matrix(1,1,{arg})
matrix(1,1,{x/3})
Display
You cannot use {} without the
matrix notation. When using the
matrix notation, the brackets
are automatically sized to fit the
contents. Some contents, such as
fractions, are also resized.
Angle brackets
langle arg rangle
langle x/3 rangle
Angle brackets are not resized.
Absolute values
(vertical bars)
|arg|
|x|
abs(arg)
abs(x/3)
|x|
When using the abs notation, the
vertical bars are automatically sized
to fit the contents.
Overbrace
arg^^\\}
(x+y+z)^^\\}
After the argument, add 2 carets,
2 backslashes, and the right brace.
Enclose the argument in parentheses
if needed.
Underbrace
arg__\\_}
(x+y+z)__\\_}
After the argument, add 2
underscores, 2 backslashes, another
underscore, and the right brace.
Enclose the argument in parentheses
if needed.
Square root
sqrt(arg)
sqrt(16)
Nth root
rootn(arg)
root3(27x)
You can use only alphanumeric
characters (a-z, A-Z, 0-9) and
underscores for n.
Factorial
!
Trigonometry
sin(x)
cos(x)
asin(x)
November 2014
5!
5!
tan(x)
asin(x)
asin(x)
acos(x)
atan(x)
cos(theta)
cos(θ)
sinh(x)
cosh(x)
tanh(x)
csch(a)
asinh(x)
acosh(x)
atanh(x)
tan(45 deg)
sec(x)
csc(x)
cot(x)
asec(x)
acsc(x)
acot(x)
sech(x)
csch(x)
coth(x)
asech(x)
acsch(x)
acoth(x)
csch(a)
tan(45°)
Create Physics Questions 205
Expression
Code
Example
Display
Exponential
function
e^n
e^2
e2
exp(n)
exp(2)
exp(2)
Logarithms
ln(n)
ln(e^x) = x
ln(ex) = x
log(n)
log(1000) = 3
log(1000) = 3
log_b(n)
log_2(128) = 7
log2(128) = 7
You can use only alphanumeric
characters (a-z, A-Z, 0-9) and
underscores for b.
Equality
=
a = 2 pi r
a = 2πr
Inequality
>
x > 3
x>3
<
x < 3
x<3
>=
x >= 3
<=
x <= 3
!=
x != 3
~=
x ~= 3
x≈3
!~=
x !~= 3
x≉3
Plus or minus
+/-
x +/- 3
x±3
Infinity
infinity
infinity
∞
Greek
Type the name of lowercase Greek
letters in lowercase. Type the names
of uppercase Greek letters in proper
case.
pi
π
Omega
Ω
matrix(rows,cols,[cell,cell])
matrix(2,3,[a,b,c,d,e,f])
matrix(rows,cols,{cell,cell})
matrix(3,2,{a,b,c,d,e,f})
Approximate
Matrices
x≥3
x≤3
x≠3
matrix(rows,cols,|cell,cell|)
The contents of the matrix are
specified cell by cell in row-column
order.
Use brackets, braces, or vertical bars
to enclose the matrix contents.
Determinants
Use either the text or matrix notation text(det)(A) = |A|
illustrated in the example.
matrix(2,2,|a,b,c,d|)=ad-bc
Ellipses
...
...
_...
_...
\...
\...
det(A) = |A|
November 2014
206 WebAssign Creating Questions Guide
Expression
Code
Example
Indefinite
summation
sum arg
sum x_i
Definite
summation
sum_lower^upper arg
sum_(i = 0)^n x_i
sum__lower^^upper arg
You can use two underscores and two
carets to display the bounds using
the same font size as the argument;
see the example for Display Notation
with <symimage> on page 133.
Indefinite
integrals
int arg
int f(x)dx
Definite
integrals
int_lower^upper arg
int_0^1 sqrt(x)dx
int__lower^^upper arg
int__0^^1 sqrt(x)dx
You can use two underscores and
two carets to display the bounds
above and below the integral using
the same font size as the argument.
Products
prod_lower^upper arg
prod_(i=m)^infinity x_i
prod__lower^^upper arg
You can use two underscores and two
carets to display the bounds using
the same font size as the argument;
see the example for Display Notation
with <symimage> on page 133.
Closed integrals cintegral_lower^upper arg
cintegral__lower^^upper arg
cintegral_C y^3 \\ dx + x^2
\\ dy
You can use two underscores and
two carets to display the bounds
above and below the integral using
the same font size as the argument;
see the example for Display Notation
with <symimage> on page 133.
Differentiation
diff
(difff(x))/(diffx)
Partial
derivatives
partial
(partial^2u)/(partialx^2)
November 2014
Display
Create Physics Questions 207
Expression
Code
Example
Limits
lim_(x->p)
lim_(x->0)
Display
lim__(x->p)
Any expression can be used below
the limit function.
You can use two underscores to
display the expression below the limit
function using the same font size as
the argument; see the example for
Display Notation with <symimage>
on page 133.
Arrows
Arrows over
notation
->
->
→
-->
-->
⟶
<-
<-
<--
<--
<->
<->
==>
==>
<==
<==
<=>
<=>
^^->
A^^->
^^-->
A^^-->
^^<-
A^^<-
^^<--
A^^<--
^^<->
A^^<->
←
⟵
↔
⇒
⇐
⇔
Enclose the argument in parentheses
as needed.
Arrows under
notation
__->
A__->
__-->
A__-->
__<-
A__<-
__<--
A__<--
__<->
A__<->
Use two underscores. Enclose the
argument in parentheses as needed.
Harpoons
~>
~>
⇀
<~
<~
↽
<~>
<~>
⇌
November 2014
208 WebAssign Creating Questions Guide
Expression
Code
Example
Harpoons over
notation
^^~>
A^^~>
^^<~
A^^<~
^^<~>
A^^<~>
Display
Enclose the argument in parentheses
as needed.
Harpoons under __~>
notation
__<~
__<~>
A__~>
A__<~
A__<~>
Use two underscores. Enclose the
argument in parentheses as needed.
Middle dot
middot
x middot y
x·y
Bold Roman
<b>text</b>
text(For all ) x text( in )
<b>R</b>,
For all x in R,
<u>text</u>
<u>all </u>\\ x
all x
To display un-italicized text with
underlining, put text() inside of <u>
<u>text(all)</u>\\ x
all x
Text is displayed in bold and unitalicized. Do not use inside text()
notation.
Underline
and not the other way around.
Union
union
A union B
A∪B
Intersection
intersect
A intersect B
A∩B
Proportional To
propto
x propto y
x∝y
x perp y
x⟂y
proportional
Perpendicular
To
perp
Hat
^^\\^
x^^\\^
Vector
^^->
x^^->
perpendicular
^^\\->
Accent
^^\\'
x^^\\'
Tilde
^^\\~
x^^\\~
Grave
^^\\`
x^^\\`
Script small L
ell
ell
November 2014
ℓ
Create Physics Questions 209
Expression
Code
Example
Display
Reduced Planck
constant (hbar)
hbar
E=hbar omega
E = ℏω
Overline
^^\\_
x^^\\_
x
Formula
{(statement,statement)
f(x)={(|2x| text(if)\\ x <=
0,3x text(if)\\ x
>0)
Use as many statements as needed.
Each statement must contain the
same number of text() codes. These
codes are used to control horizontal
alignment of the statements with
each other. You can put empty text()
codes in each statement to align
items even if you do not need to
display Roman text.
Display Math Notation with HTML Substitution
®
WebAssign provides several special tags that allow you to render specific kinds of
notation using HTML substitution. Like WaTeX — and unlike LaTeX or <symimage>
markup — you can include answer boxes in your formatted notation. Using HTML
substitution is often simpler than using WaTeX, but its functionality is also much
more limited than WaTeX.
Note:
• You cannot use HTML substitution tags inside of other HTML
substitution tags, WaTeX, LaTeX, or <symimage> markup.
• You cannot use WaTeX, LaTeX, or <symimage> markup inside of HTML
substitution tags.
HTML Substitution Tags for Math
Six tags are provided for displaying math notation using HTML substitution. Inside
each of these tags, you can use the math notation described in Notation That Can
Be Used in HTML Substitution Tags for Math on page 210.
Expression
Code
Example
Display
General math
<h:math>markup</h:math>
<h:math> $a x^2
</h:math>
9x
Fractions
<h:frac>
n='numerator' d='denominator'
</h:frac>
<h:frac>
n='x^2' d='x+$
a' </h:frac>
2
Use WaTeX to display a fraction in the
numerator or denominator of another
fraction or under a square root.
November 2014
210 WebAssign Creating Questions Guide
Expression
Code
Example
Square roots
<h:sqrt>markup</h:sqrt>
<h:sqrt> x + 6
</h:sqrt>
Matrices
<h:matrix>
cell | cell ; cell | cell
</h:matrix>
<h:matrix>
a | b | c ; d | e | f
</h:matrix>
Display
Use | to separate columns and ; to indicate
the end of a row. Ensure that there is a
space between the contents of a cell and
the | or ; delimiters.
Determinants
<h:determinant>
cell | cell ; cell | cell
</h:determinant>
Use | to separate columns and ; to indicate
the end of a row. Ensure that there is a
space between the contents of a cell and
the | or ; delimiters.
Long division
<h:longdiv> divisor | dividend
</h:longdiv>
<h:determinant>
$a | b ; c | d
</h:determinan
t>
<h:longdiv>
x+5 | x^2+6x+5
</h:longdiv>
Notation That Can Be Used in HTML Substitution Tags for
Math
Except where noted, you can use all of the notation in the following table in each
of the HTML substitution tags for displaying math notation. Math variables are
automatically italicized. You can also use any of the <s> tags described in Add
Symbols to Questions on page 132.
Expression
Code
Example
Display
Perl variables
$variable
$a x + 1
${variable}
${a}x + 1
<EQN $variable>
<EQN $a>x + 1
9x + 1
9x + 1
9x + 1
Use braces or add a space after each
variable name to distinguish it from other
text. Do not use the lowercase <eqn> tag.
Addition
+
x + 1
x+1
Subtraction
-
x - 1
x−1
Multiplication
*
x * 2
times
x times 2
cross
x cross 2
x·2
x×2
x×2
2x
(implicit)
2x
November 2014
Create Physics Questions 211
Expression
Code
Example
Display
Division
divide
x divide 2
/
x / 2
x÷2
x/2
Exponents
(superscripts)
^ (caret)
x^2
If the superscript is more than a single
number or a single variable, enclose it in
parentheses.
x^(2y)
Bases
(subscripts)
_ (underscore)
x_2
If the subscript is more than a single
number or a single variable, enclose it in
parentheses.
x_((y + 3))
Parentheses
()
4(x+1)
In cases where a set of parentheses is
required to format notation, such as with
exponents, use two pairs of parentheses to
explicitly display the parentheses.
x_((y + 3))
4(x + 1)
x(y + 3)
|arg|
|x|
|x| abs(x)
abs(arg)
abs(x)
Absolute value
2
x
2y
x
x2
x(y + 3)
You cannot use vertical bars to specify
absolute values in in the <h:longdiv> tag.
Square root
sqrt(arg)
x + sqrt(y+3)
You cannot use sqrt() in the <h:sqrt> or
<h:longdiv> tags.
5!
5!
tan
asin x
arccos
arctan
cos theta
sinh
cosh
tanh
csch<s:space>a
sin x
cosθ
csch a
tan(45°)
arcsinh
arccosh
arctanh
tan(45<s:degree>)
sec
csc
cot
arcsec
arccsc
arccot
sech
csch
coth
arcsech
arccsch
arccoth
Factorial
!
Trigonometry
sin
cos
arcsin
-1
When arccos, arcsin, and so on are
abbreviated like acos or asin, the function
is displayed using exponential notation, like
-1
sin x.
Exponential
function
e^n
e^2
e
2
November 2014
212 WebAssign Creating Questions Guide
Expression
Code
Example
Display
Logarithms
ln(n)
ln(e^x) = x
log(n)
log(1000) = 3
log_b(n)
log_2(128) = 7
ln(ex) = x
log(1000) = 3
log2(128) = 7
Equality
=
a = 2 pi r
a = 2πr
Inequality
>
x > 3
<
x < 3
>=
x >= 3
<=
x <= 3
x
x
x
x
x
!=
x != 3
Approximate
~=
x ~= 3
x≈3
Infinity
infinity
infinity
∞
Greek
Type the name of lowercase Greek letters
in lowercase. Type the names of uppercase
Greek letters in proper case.
pi
π
Omega
Ω
>
<
≥
≤
≠
3
3
3
3
3
Create physPad Questions
The physPad tool lets your students enter correctly formatted mathematical
expression that might include symbols used in physics.
Before you create a physPad question, decide whether to use Symbolic Mode or
®
Algebraic Mode using Mathematica to evaluate your students' mathematical
expressions.
Evaluation Modes for Math Questions
®
For many question types in WebAssign , such as Multiple-Choice or pencilPad,
the question mode you select has immediately visible effects on the question you
are creating. When you create questions that evaluate mathematical expressions,
November 2014
Create Physics Questions 213
however, the question mode you select affects what kind of responses your
students can enter and how your students' responses are evaluated, but has no
corresponding visual effect.
Note: If your students should respond with a numerical answer and not a
mathematical expression, see Create Integer or Decimal Number Questions
on page 95.
Before creating a question that asks your students to enter a mathematical
expression or equation, determine how that expression should be evaluated.
Symbolic Mode
Symbolic questions evaluate your students' responses symbolically by substituting
a series of values for the variables in the response and in the key. If the response
and the key are equal for all tested values, then the response is accepted as
correct.
This evaluation behavior provides reliable scoring of responses and can accept
any form of a mathematical expression that is equivalent to the key. However,
it cannot evaluate responses that are equations, and it cannot evaluate whether
responses are in a particular form, such as a completely factored expression.
Algebraic Mode using Mathematica®
Algebraic questions evaluate your students' responses algebraically using
®
Mathematica , in much the same way you would solve an equation.
Note:
®
• You must know how to write Mathematica expressions. For
reference information, see Mathematica reference information at
reference.wolfram.com/mathematica/.
• Older questions created using Algebraic mode do not necessarily use
®
Mathematica ; however, the general principles still apply, and these
questions will continue to function.
Algebraic mode is a much more powerful method for evaluating your students'
responses, but specifying your key in Algebraic mode can sometimes be more
complicated than with Symbolic mode. Additionally, you cannot by default
accept any mathematically equivalent response using Algebraic mode; you must
therefore make sure that your students understand what form of response is
needed.
Choosing a Mode to use Based on Selected Criteria
Refer to the following table to help you decide which mode to use.
Best Practice: If you can use either Symbolic mode or Algebraic mode,
use Symbolic mode.
November 2014
214 WebAssign Creating Questions Guide
Criterion / Example
Symbolic Mode Algebraic
Mode using
®
Mathematica
Accept any response that is equivalent to the key
Allow your students to type commas in large numbers
The answer is a single mathematical expression that
is not an equation.
Solve for x:
2
2x+y -6=0
The answer is a finite list of set members.
List the first three natural numbers.
The answer is any member of a set.
List any multiple of both 2 and 3.
The answer is a single ordered pair.
What are the coordinates of the center of the circle
defined by the following equation:
2
2
(x+3) +(y-4) =25
The answer is two or more ordered pairs.
List the coordinates of the first five data points shown
on the graph.
The answer is a vector.
Find a vector perpendicular to ‹1,2›.
The answer is an equation.
What is the equation for a circle with center (x,y) and
radius r?
Only a particular form of the answer is correct.
Factor the expression:
2
x -x-12
Key can specify multiple correct answers.
Key can perform complex evaluation functions for
you, such as factoring polynomials or computing
derivatives.
Create physPad Questions Using Symbolic Mode
You can create physPad questions that use Symbolic mode to evaluate arithmetic
and algebraic expressions, but not equations, for equivalency to the answer.
November 2014
Create Physics Questions 215
Because responses are graded for mathematical equivalency, the form of the
student's response is not considered.
To create a physPad question using Symbolic mode:
1. Click Questions > Create. The Question Editor opens.
2. In Name, type a name for the question.
3. In Mode, select Symbolic.
4. In Question, type your question.
• Use the answer placeholder string <_> to specify where the answer box
should be displayed.
• Be sure that your question identifies any variables that students should
use in their answer.
5. In Answer, type the following items on a single line:
<eqn $PAD='phys'; ''>variable_list:answer_key
where variable_list is a comma-delimited list of the variables used in the
answer key, and answer_key specifies the correct answer to the problem in
symbolic notation. For example:
''>K, L, g: K sqrt(L g)
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.
• For information about specifying answer keys for Symbolic
questions, see Create Answer Keys for Questions Using Symbolic
Mode on page 149.
6. 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.
7. Click Test/Preview to test the appearance and behavior of the question. See
Test Questions on page 18.
8. Click Redisplay to show certain kinds of errors in the Display section of the
Question Editor. Make any needed changes to your question.
9. 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 on page 19.
November 2014
216 WebAssign Creating Questions Guide
• 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 on page 308.
10. 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 physPad Question Using Symbolic Mode
The following table summarizes an actual question.
QID
2594685
Name
Template2 6.PHYSICS.01.
Mode
Symbolic
Question
Using <watex>\[d_{\pre{o}}\]</watex> and <watex>\[d_{\pre{i}}\]</watex>
respectively for the object and image distance and <watex>\[P_{\pre{e}}\]</
watex>
for the refractive power of the woman's eye, write an expression for the
refractive
power of her eye in terms of the object and image distance.
<watex>\[P_{\pre{e}} = <_>\]</watex>
Answer
Display to
Students
November 2014
<eqn $PAD = 'phys';''>d_o,d_i:1/d_o + 1/d_i
Create Physics Questions 217
Create Answer Keys for Questions Using Symbolic
Mode
When typing the answer key for a question in Symbolic mode, you can include a
broad range of mathematical expressions.
Specifying Numeric Values in Answer Keys
Do not use commas to separate digits in numbers. This can cause ambiguous
answer keys and let your students receive credit for incorrect answers. For
example, x + 1,234 is interpreted both as 1234 + x and as a list with two
elements: x + 1 and 234.
Do not use mixed numbers. Instead, use improper fractions or express the mixed
number as a sum, for example 7/4 or 1+3/4.
Specifying Math Variables in Answer Keys
Although not always required, you can declare your math variables at the
beginning of the answer key in a comma-delimited list ending with a colon, as in
the following example.
x_1, y_1, x_2, y_2: sqrt((x_1-x_2)^2 + (y_1-y_2)^2)
Best Practice: Declare your variables to ensure that WebAssign
interprets your answer key exactly as you intend.
®
Variable names in answer keys must observe the following conventions:
• Variable names must start with a letter.
• Variable names must include only letters, numbers, and underscores;
underscores in variable names indicate subscripting.
• Variable names are case-sensitive; X is different from x.
• Variable names should not duplicate the names of functions or of the numeric
value pi.
• Variables having the names of Greek letters are displayed in mathPad and
calcPad as the corresponding Greek letters. Greek letters except for π are
treated as variables. The letter π is treated as a constant.
• The variable e can be used, but it will be treated as both Euler's number and
as a variable name, so either response is marked correct.
The following table lists some examples.
Math Notation
Answer Key Notation
x
x
x1
x1
x1
x_1
books
books
λ
lambda
November 2014
218 WebAssign Creating Questions Guide
Be sure that your question identifies any variables that the student should use in
the answer.
Specifying Perl Variables in Answer Keys
If you have defined a Perl variable for use in your answer key — for example, to
randomize numeric values in your question — always enclose it with the <EQN> tag
as in the following example:
<EQN $d>x + <EQN $e>
To avoid confusion, use different names for Perl variables and math variables
in your question. For more information variables, see Perl Variables for Math
Questions (Algebraic and Symbolic Modes) on page 382 and Default Values and
Tolerance for Symbolic Evaluation on page 153
Specifying Math Expressions in Answer Keys
The functions and values in the following table are case-sensitive- for example,
ABS(x) cannot be substituted for abs(x).
For many functions in the following table, parentheses can be omitted if the
argument is simple and unambiguous — for example, a single variable or
constant. Include parentheses when you need to ensure that a specific order
of operations is observed. The default order of operations for symbolic answer
keys is: subscripts, then factorials, then exponentiation, then multiplication and
division, then addition and subtraction.
Expression
Math Notation
Symbolic
Answer Key
Notation
Addition
x+y
x + y
Subtraction
x−y
x - y
Multiplication
2x
2∙x
2×x
2x
2 * x
No distinction is made between
explicit or implicit multiplication.
Division or
fractions
x÷3
x / 3
No distinction is made between
responses specified as stacked
fractions or using the division sign
(÷).
Exponentiation x
November 2014
3
Notes
x^3
x**3
Square root
sqrt(x)
Other roots
rootn(x)
root(x,n)
rootn(x) works only when n is an
integer.
Create Physics Questions 219
Expression
Math Notation
Symbolic
Answer Key
Notation
Notes
Subscript
xn
x(a + b)
x_n
x_(a + b)
If the subscript includes
mathematical operators, including
implicit multiplication, enclose it in
parentheses.
Factorial
x!
x!
Factorials are calculated only for
natural numbers.
Absolute value
|x|
abs(x)
Greek letters
α+β
alpha + beta
Omega
Ω
Type the name of lowercase Greek
letters in lowercase. Type the
names of uppercase Greek letters
in proper case.
Greek letters except for π are
treated as variables. The letter π is
treated as a constant.
In mathPad, your students must
type the names of all Greek letters
except for π and θ.
Pi (π)
pi
π
Substituting 3.14 only
approximates this value. You
and your students should use pi
to indicate the exact value of pi
unless the question specifically
instructs the student to use an
approximation to pi.
e
exp(1)
Euler's number e
3
e^3
exp(3)
Exponential
function
e
Logarithm
(base 10)
log x
log10 x
log x
log(x)
Logarithm
(arbitrary
base)
log16(x)
logb(x)
log_16(x)
log_(b)(x)
Natural
logarithm
ln x
ln(x)
ln x
Grouping,
Order of
Operations
4 (x + 1)
4 [x + 1]
4 {x + 1}
4(x + 1)
4[x + 1]
4{x + 1}
If the base is anything other than a
number, enclose it in parentheses.
No distinction is made among the
three types of grouping symbols.
Parentheses can also be used to
delimit ordered tuples; braces can
also be used to delimit unordered
lists.
November 2014
220 WebAssign Creating Questions Guide
Expression
Math Notation
Scientific / “e”
notation
2.46 × 10
2.46e+6
Trigonometric
functions
sin x
cos x
tan θ
cot (π − θ)
6
sec A
csc x
Inverse
trigonometric
functions
arcsin x
-1
sin (x)
arccos x
-1
cos (x)
arctan x
-1
tan (x)
arccot x
-1
cot (x)
arcsec x
-1
sec (x)
arccsc x
-1
csc (x)
Hyperbolic
functions
sinh x
cosh x
tanh x
coth x
sech x
Symbolic
Answer Key
Notation
2.46 * 10^6
2.46e+6
sin x
cos(x)
tan theta
cot(pi theta)
sec(A)
csc x
Angles are expressed in radians.
arcsin x
sin^(-1)(x)
arccos x
cos^(-1)(x)
arctan x
tan^(-1)(x)
arccot x
cot^(-1)(x)
arcsec x
sec^(-1)(x)
arccsc x
csc^(-1)(x)
Angles are expressed in radians.
sinh
cosh
tanh
coth
sech
csch
In mathPad questions, your
students must type these functions
rather than selecting them from
mathPad.
x
x
x
x
x
x
csch x
Ordered pairs,
ordered tuples
(x, y)
(x, y, z)
Sets,
{1, 2}
unordered lists 3, 4
of elements
Notes
For each inverse trigonometric
function, you can abbreviate “arc”
to “a” as in asin(x).
Specify inverse hyperbolic
-1
functions using the
notation as
for trigonometric functions.
(x, y)
(x, y, z)
Comma-delimited lists in
parentheses are evaluated as
ordered tuples.
{1, 2}
3, 4
To accept only standard roster
notation with braces, set
$ROSTER_ONLY=1.
By default, your students'
responses will match your key if
they enumerate every element at
least once, regardless of repetition.
Thus, {1,2,2} = {1,2}. To require
your students to enumerate all
instances of repeated elements in a
set, set $NO_REPETITION=1.
November 2014
Infinity
∞
infinity
Undefined
UNDEFINED
UNDEFINED
Create Physics Questions 221
Expression
Math Notation
Symbolic
Answer Key
Notation
Notes
Degree
30°
30 deg
Degrees are not evaluated
mathematically by default. For
this reason, your students must
enter the exact form of the
answer that you provide and not
a mathematically- equivalent
response. For example, if you
specified cos(60 deg), your
students would be marked
incorrect for submitting either 0.5
or sin(30°).
Imaginary unit i
i
No solution
NO SOLUTION
NO SOLUTION
Empty set
empty
empty
Use only for mathPad questions.
See Also:
Default Values and Tolerance for Symbolic Evaluation on page 153
Default Values and Tolerance for Symbolic Evaluation
Your students' responses to symbolic questions are evaluated by substituting
numeric values for each variable in the answer key and in your students'
responses. If the answer key and response are equivalent to within a specified
tolerance for all three values, the answer is considered correct. You can change
both the default values and the tolerance that are used when evaluating
responses to your symbolic questions.
Understanding Default Values and Tolerance
By default, the following three numeric values are substituted for each variable in
your answer key and in your students' responses:
• 0.123456789012
• 0.345678901234
• 0.890123456789
For each of these values, your student's response is compared to the answer
key. If the response and the key are within the specified tolerance — by default,
0.001 — for every value, the response is considered to be correct.
2
For example, if the correct answer to your question is x + 1 and your student
2
submitted 2x + 1, the response and the answer key would be compared for three
values of x, as illustrated in the following graph and table.
November 2014
222 WebAssign Creating Questions Guide
Value of x (rounded)
Value of Answer Key
2
(x + 1)
Value of Response
2
(2x + 1)
Difference
0.1235
1.0152
1.0305
0.0152
0.3457
1.1195
1.2390
0.1195
0.8901
1.7923
2.5846
0.7923
Although at the first comparison point, the difference between the answer and
the student's response seems small — 0.0152 — this difference is much greater
than the default tolerance of 0.001, so the response is marked incorrect. In this
example, because the key and response contained only one variable, only three
values were checked.
When the key or response contains multiple variables, each value is substituted
for each variable so every combination of values is checked. This is illustrated in
the following table.
Value of x
(rounded)
Value of y
(rounded)
Value of Answer
2
2
Key 2(x + y )
Value of Response
2
2
(x + y )
Difference
0.1235
0.1235
0.0610
0.0305
-0.0305
0.1235
0.3457
0.2695
0.1347
-0.1347
0.1235
0.8901
1.6151
0.8076
-0.8076
0.3457
0.1235
0.2695
0.1347
-0.1347
0.3457
0.3457
0.4780
0.2390
-0.2390
0.3457
0.8901
1.8236
0.9118
-0.9118
0.8901
0.1235
1.6151
0.8076
-0.8076
0.8901
0.3457
1.8236
0.9118
-0.9118
0.8901
0.8901
3.1693
1.5846
-1.5846
The number of comparisons that are performed between the answer key and
response increases exponentially with the number of variables used in the key.
November 2014
Create Physics Questions 223
Best Practice: Use four or fewer variables in your questions.
Although the default values used for evaluating symbolic questions might seem
to be arbitrary, they work well for a wide variety of questions. How and why you
might need to change the default values or tolerance — such as for absolute-value
questions — are discussed in the following sections.
Changing the Default Values for Symbolic Evaluation
®
To change the values WebAssign substitutes for variables in your answer key and
your students' responses, you set the array variable $DEFAULTVALS to the values
you want to use.
Best Practice: Use four or fewer values for each variable in your
questions.
To set values:
Prepend this to your answer key:
Notes
As a list
<EQN $DEFAULTVALS=[a, b, c];''>
If you specify only one list,
the values are substituted only
for the first variable in your
answer key and your students'
responses. Additional variables
For example:
<EQN $DEFAULTVALS=[1.23,-3.45];''>x:x^2+1
use the default values.
As a range of
integers
<EQN $DEFAULTVALS=[a..b];''>
For example:
<EQN $DEFAULTVALS=[3..6];''>x:x^2+1
If you specify only one range,
the values are substituted only
for the first variable in your
answer key and your students'
responses. Additional variables
use the default values.
Differently for
different variables
<EQN $DEFAULTVALS=[[a, b, c],[a, b, c]];''>
or
<EQN $DEFAULTVALS=[[a..b],[a..b]];''>
For example:
<EQN $DEFAULTVALS=[[-3,1],
[-2,2]];''>x,y:x^2+y^2
or
<EQN $DEFAULTVALS=[[-3..1],
[-2..2]];''>x,y:x^2+y^2
Only for specific
variables
<EQN $DEFAULTVALS=[[],[a, b, c]];''>
or
<EQN $DEFAULTVALS=[[],[a..b]];''>
For example:
<EQN $DEFAULTVALS=[[-3,1],[]];''>x,y:x^2+y^2
or
<EQN $DEFAULTVALS=[[],[-2..2]];''>x,y:x^2+y^2
The first set of values is
substituted for the first declared
variable, the second set for the
second variable, and so on.
You must explicitly declare the
variables in your answer key.
See Create Answer Keys for
Questions Using Symbolic Mode
on page 149.
Specify an empty list [] for any
variable for which you would
like to use the default values.
You must explicitly declare the
variables in your answer key.
See Create Answer Keys for
Questions Using Symbolic Mode
on page 149.
November 2014
224 WebAssign Creating Questions Guide
Changing the Tolerance for Symbolic Evaluation
®
To change the tolerance WebAssign uses when comparing your answer key and
your students' responses, you set the variable $MAXERR to the tolerance you want
to use.
To set the tolerance:
Add this to your answer key:
As a numeric value
<EQN $MAXERR=value;''>
Notes
For example:
<EQN $MAXERR=0.01;''>
As a percent of the
evaluated answer key
<EQN $MAXERR='n%';''>
For example:
Enclose the percent string
in single quotation marks.
<EQN $MAXERR='0.1%';''>
Specific situations requiring you to change either the default values or the
tolerance are discussed in the following sections.
Changing the Default Values for Absolute-Value Questions
If the answer key for your symbolic question contains the absolute value of
an expression containing a variable, you need to ensure that the expression
evaluates to both positive and negative values to ensure that your students'
responses also include the absolute value notation.
For example, if your answer key is
abs(x+1)
your students could respond with x+1 and still be marked correct, since x+1
evaluates to a positive number for all of the default values. To avoid this situation,
you could change your answer key to the following:
<EQN $DEFAULTVALS=[-1.123, 0.345, 0.890]; ''>abs(x+1)
This causes your answer key and your students' responses to be compared not
for the default values, but for the values you specified: -1.123, 0.345, and 0.890.
With the new values, x+1 evaluates to -0.123, 1.345, and 1.890 and is marked as
incorrect, while |x+1| is marked correct.
Changing the Default Values for Factorial Questions
If the answer key for your symbolic question contains the factorial of an
expression containing a variable, you need to ensure that the expression
evaluates only to natural numbers.
For example, if your answer key is
(x/2)!
x/2 must evaluate to a natural number to correctly compare your students'
responses to the answer key. To ensure this, you could change your answer key to
the following:
<EQN $DEFAULTVALS=[2, 4, 6]; ''>(x/2)!
November 2014
Create Physics Questions 225
This causes your answer key and your students' responses to be compared not
for the default values, but for the values you specified: 2, 4, and 6. With the new
values, (x/2)! evaluates to 1, 2, and 6.
Changing the Default Values or Tolerance for Questions with
Fractions or Exponents
In some symbolic questions with fractions or exponents, the default values can
evaluate too close to 0 to distinguish correct and incorrect responses. You must
determine from the question itself whether changing the default values or the
tolerance will resolve the problem.
For example, if your answer key is
1/(x+100)
Your students could enter 1/(x+110) and still be marked correct because the
expression evaluates very close to 0 using the default values. In this case, you
could use a couple different approaches.
You could change the default values as in the following answer key:
<EQN $DEFAULTVALS=[-101..-99]; ''>1/(x+100)
Or, you could decrease the tolerance, as in the following answer key:
<eqn $MAXERR=1e-5; ''>1/(x+100)
Consider a different example. If your answer key is
(x/2)^20
20
Your students could enter (x ÷ 3) and still be marked correct because the
expression evaluates very close to 0 using the default values.
In this case, the best approach is probably to change the default values so the
expression will not evaluate so close to 0. You could change your answer key to
the following:
<EQN $DEFAULTVALS=[1.234, 2.346, 8.901]; ''>(x/2)^20
See Also:
Create Answer Keys for Questions Using Symbolic Mode on page 149
Create physPad Questions Using Algebraic Mode with
Mathematica®
®
You can create physPad questions that use Algebraic mode and a Mathematica
grading statement to compare the answer key and your students' responses
®
for mathematical equivalence. Using Algebraic mode and Mathematica lets
you accurately evaluate your students' responses in situations where Symbolic
evaluation cannot be used.
• Before using this procedure, see Evaluation Modes for Math Questions on
page 145.
®
• You must know how to write Mathematica expressions. For
reference information, see Mathematica reference information at
reference.wolfram.com/mathematica/.
November 2014
226 WebAssign Creating Questions Guide
To create a physPad question using Algebraic mode with
Mathematica®:
1. Click Questions > Create.
The Question Editor opens.
2. In Name, type a name for the question.
3. In Mode, select Algebraic.
4. In Question, type your question.
• Use the answer placeholder string <_> to specify where the answer box
should be displayed.
• Be sure that your question identifies any variables that the student
should use in their answer.
5. In the Question Editor, click Mathematica under Page Tools to create and test
®
your Mathematica grading statement and answer key.
®
a) In the Mathematica window, type your grading statement, using
®
Mathematica expressions for the answer key and student response that
you want to test.
®
• Your grading statement is a Mathematica statement providing
information about how to compare your answer key and your
students' responses.
®
• Your answer key is a Mathematica expression specifying the correct
answer to the question; sometimes the answer key is one of multiple
possible correct answers.
b) Click Execute.
Your grading statement is evaluated using the expressions you specified for
the answer key and student response, and the result is displayed. If your
grading statement evaluates to True, then the response will be marked
correct. Otherwise, the response will be marked incorrect.
For example, if your question asks students to calculate an indefinite integral,
your grading statement might compare the derivatives of your answer key and
of your student's response:
2
The answer key specifies one of the correct responses: 3 · sin(x ) + 2x + C.
The specified response is also a valid answer and the grading statement
evaluates as True.
November 2014
Create Physics Questions 227
®
Note: Most, but not all, Mathematica expressions are valid
®
®
in WebAssign . Any expression that works in the WebAssign
®
Mathematica tool will work in your question.
6. In Answer, type the following items on a single line:
<eqn $CASGRADER='mathematica'; $PAD='phys'; ''>
variable_list:answer_key {tab} grading_statement
where:
• variable_list is a comma-delimited list of the variables used in the answer
key.
®
• answer_key is the Mathematica answer key you created in the previous
step.
®
• grading_statement is the Mathematica grading statement you created,
with your answer key and student response expressions replaced by
the keywords key and response. When the question is scored, the actual
answer key and student response values will be used in place of these
keywords.
Note:
• To add the {tab} operator, either type the characters {tab} or click
Add tab.You cannot enter {tab} by pressing the TAB key.
• 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.
7. 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.
8. Click Test/Preview to test the appearance and behavior of the question. See
Test Questions on page 18.
9. Click Redisplay to show certain kinds of errors in the Display section of the
Question Editor. Make any needed changes to your question.
10. 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 on page 19.
• 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 on page 308.
11. 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.
November 2014
228 WebAssign Creating Questions Guide
You can use your question in an assignment and see it in your My Questions
list only after it is saved.
Example physPad Question Using Algebraic Mode with
Mathematica®
The following topic contains examples that you can reference:
• Create mathPad Questions Using Algebraic Mode with Mathematica on page
157
Create Answer Keys for Questions Using Algebraic
Mode with Mathematica®
To write answer keys and grading expressions for questions that use Algebraic
®
®
mode with Mathematica , you must know how to write Mathematica expressions.
®
In addition, you should be aware of the following WebAssign -specific
considerations.
Specifying Math Variables in Answer Keys
Although not always required, you can declare your math variables at the
beginning of the answer key in a comma-delimited list ending with a colon, as in
the following example.
x_1, y_1, x_2, y_2: sqrt((x_1-x_2)^2 + (y_1-y_2)^2)
Best Practice: Declare your variables to ensure that WebAssign
interprets your answer key exactly as you intend.
®
Variable names in answer keys must observe the following conventions:
• Variable names must start with a letter.
• Variable names must include only letters, numbers, and underscores;
underscores in variable names indicate subscripting.
• Variable names are case-sensitive; X is different from x.
• Variable names should not duplicate the names of functions or of the numeric
value pi.
• Variables having the names of Greek letters are displayed in mathPad and
calcPad as the corresponding Greek letters. Greek letters except for π are
treated as variables. The letter π is treated as a constant.
• The variable e can be used, but it will be treated as both Euler's number and
as a variable name, so either response is marked correct.
The following table lists some examples.
November 2014
Math Notation
Answer Key Notation
x
x
x1
x1
Create Physics Questions 229
Math Notation
Answer Key Notation
x1
x_1
books
books
λ
lambda
Be sure that your question identifies any variables that the student should use in
the answer.
Specifying Perl Variables in Answer Keys
If you have defined a Perl variable for use in your answer key — for example, to
randomize numeric values in your question — always enclose it with the <EQN> tag
as in the following example:
<EQN $d>x + <EQN $e>
To avoid confusion, use different names for Perl variables and math variables in
your question.
Creating Mathematica® Expressions
®
®
Most, but not all, Mathematica expressions are valid in WebAssign . Any
®
®
expression that works in the WebAssign Mathematica tool will work in your
question.
See Also:
Mathematica reference information at reference.wolfram.com/mathematica/
The {tab} Operator on page 329
November 2014
230 WebAssign Creating Questions Guide
November 2014
7
Create Chemistry Questions
This chapter contains the
following topics:
• Chemistry Notation in Questions
• Create chemPad Questions
• Create MarvinSketch Questions
You can create questions for your chemistry courses that let
your students enter correctly formatted chemical notation
or draw chemical structures and reactions that are scored
automatically. You can also use tools to display chemical
notation or chemical structures in your questions.
ChemPad lets your students enter chemical notation that
includes correctly formatted subscripts, superscripts, and
reaction arrows. What's more, chemPad provides chemically
aware scoring and hints that help your students identify
mistakes in their responses.
MarvinSketch lets your students answer questions by drawing
chemical structures and reactions that are scored automatically.
You can also use MarvinSketch to display chemical structures in
your questions using a variety of modes, including ball-and-stick
drawings that your students can rotate in 3 dimensions to view
from any angle.
See Also:
Create Questions with the Question Editor on page 7
Understanding the <eqn> and <EQN> Tags on page 312
November 2014
232 WebAssign Creating Questions Guide
Chemistry Notation in Questions
Although you can use standard HTML tags like <i> and <sup> to display correctly
®
formatted chemistry notation in your questions, WebAssign provides several tags
that can make displaying chemistry notation easier.
Note: Do not combine the notation described in this topic with LaTeX or
<symimage> markup.
Displaying Chemical Formulas
You can use the <h:chemical> tag to display most chemical formulas correctly
using a simplified notation that precedes subscripts with an underscore (_) and
superscripts with a caret (^). See the following examples.
Example
Display
<h:chemical> H_2O </h:chemical>
H2O
<h:chemical> Ca^2+ </h:chemical>
Ca
<h:chemical> SO_4^2- </h:chemical>
SO4
<h:chemical> [Co(SCN)_2(H_2O)_4]^+ </h:chemical>
[Co(SCN)2(H2O)4]
2+
2+
Displaying Isotopes
You can use the <watex> tag and its \over markup to display isotope mass
numbers over atomic numbers. See the following example.
Example
Display
<watex> \over{233}{91}Pa </watex>
Displaying Chemical Reactions
You can use the <h:reaction> tag to display most chemical reactions correctly
using a simplified notation that precedes subscripts with an underscore (_) and
superscripts with a caret (^), and replaces ->, <-, and <-> with reaction arrows.
See the following examples.
November 2014
Example
Display
<h:reaction> 2 H_2O_2 -> 2 H_2O + O_2
</h:reaction>
2 H2O2 → 2 H2O + O2
<h:reaction> N_2(g) + O_2(g) <-> 2 NO(g)
</h:reaction>
N2(g) + O2(g) ↔ 2 NO(g)
<h:reaction> 4 NO(g) + O_2(g) <- 2 N_2O_3(g)
</h:reaction>
4 NO(g) + O2(g) ←
2 N2O3(g)
Create Chemistry Questions 233
Optionally, you can type either <s:revrxarrow> or &#8652; to display ⇌ .
Displaying Electron Configurations
You can use the <h:e-config> tag to display electron configuration notation
correctly without having to indicate superscripts or italics. See the following
examples.
Example
Display
<h:e-config> 1s2 2s2 2p5 </h:e-config>
1s 2s 2p
<h:e-config> [He] 2s2 2p5 </h:e-config>
[He] 2s 2p
2
2
5
2
5
Displaying Equilibrium Expressions
You can combine the <watex> tag and its \frac markup with the <h:chemical> tag
to display equilibrium expressions with fractions. See the following example.
Example
Display
<watex>\[ K_b \] = \frac{ <h:chemical>[OH^- ]
<s:middot> [C_5H_5NH^+] </h:chemical> } {
<h:chemical>[C_5H_5N] </h:chemical> } </watex>
Tip:
• In the <h:chemical>, <h:reaction>, <h:e-config>, and <watex> tags,
you can display Perl variables without enclosing them in <eqn> or
<EQN>. Just type the variable, for example, $a, inside the tag where its
value should be displayed. You might need to use a space to separate
the variable name from any letters or numbers that follow it.
• You can add uppercase or lowercase Greek letters by typing
<s:lettername> in your question, for example, <s:nu> for ν or
<s:Delta> for Δ.
Create chemPad Questions
You can create chemPad questions to let your students enter chemical notation
that includes correctly formatted subscripts, superscripts, and reaction arrows.
November 2014
234 WebAssign Creating Questions Guide
The chemPad tool also provides chemically aware hints when your students submit
incorrect responses, for example, to let your students know that they have an
unbalanced equation.
Note: ChemPad hints are shown to your students only after they submit
a response to the question, and only if you enable displaying Hints,
Tutorials & eBook Links for the assignment.
Enabling the chemPad tool when you are writing a question is simple — you set
$PAD='chem' in Answer. But creating effective chemPad questions also involves
specifying how your students' responses should be parsed, in order to:
• restrict or allow different kinds of chemically equivalent notation, for
example, elements in a formula listed in non-standard order
• accurately score correct and incorrect student responses
• provide meaningful hints when your students enter incorrect responses
To do this, you must set the $CHEM variable to specify one or more parsing
methods as described in the following topics.
Tip: Use the question titled chemPad.tutorial in an assignment to teach
yourself and your students how to answer questions using chemPad.
Create chemPad Questions for Formulas
When you create chemPad questions that are answered with a chemical formula,
you can choose whether to allow chemically equivalent responses or to require
your students to enter the standard formula that matches your answer key. You
can also create chemPad questions for which the correct response is the keyword
NONE.
You can enable support for specific kinds of chemically equivalent notation in your
students' responses:
• For some introductory chemistry questions, you can let your students specify
elements in any order, for example, either CH4N2O or CN2H4O.
• You can let your students enter condensed formulas such as (NH2)2CO for
CH4N2O. Allowing condensed formulas also allows potentially undesirable
variations like HNHCHNHO.
• You can let your students enter charges with the sign either preceding or
2+
+2
following the value, such as Mg or Mg .
• You can let your students specify ionizable protons either at the beginning of
the formula or in their standard place, such as CH3CO2H or HCH3CO2.
• You can let your students use alternative nuclear particle names, such as
β or e, and specify nuclide superscripts and subscripts in either order, for
example, by typing either ^0_-1beta or _-1^0beta to display
.
• You can let your students enter solvate dot notation, such as CoCl2 · 2 H2O.
• When the correct chemical formula must be stated in exactly one way — or if
the answer is the keyword NONE — you can require your students' responses
to exactly match your answer key.
November 2014
Create Chemistry Questions 235
To create a chemPad question for which the answer is a
formula:
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. In Question, type your question. Provide relevant information about
assumptions or expectations for the question, for example, the conditions
for the question — STP, SATP, or reaction/prevailing conditions — or whether
states-of-matter should be specified in the response. Use the answer
placeholder string <_> to specify where the answer box should be displayed.
5. In Answer, type the following items on a single line:
<EQN $PAD='chem'; $CHEM='method'; ''>answer_key
where answer_key specifies the correct answer to the problem, and method is
one of the following chemPad parsing methods:
Allowed Notation
Example
Method
Only exact key match
CH4N2O
none
(specify
$CHEM='none')
Formula elements in any order
CH4N2O or CN2H4O
fmla
Condensed formulas
(NH2)2CO or CH4N2O
fmla,index
Ion charges
Mg
Ionizable protons first
CH3CO2H or HCH3CO2
Nuclear particles and nuclides
2+
+2
or Mg
or
ion,acid
nclr
nclr,ion
Nuclear particles with charges
Solvate dot
ion
CoCl2 · 2 H2O
solvate
For example:
Answer
Code
H2SO4
<EQN $PAD='chem'; $CHEM='none'; ''>H_{2}SO_{4}
HNO3
<EQN $PAD='chem'; $CHEM='fmla'; ''>HNO_{3}
CH4N2O
<EQN $PAD='chem'; $CHEM='fmla,index'; ''>CH_{4}N_{2}O
Mg
2+
NH4
+
<EQN $PAD='chem'; $CHEM='ion'; ''>Mg^{2+}
<EQN $PAD='chem'; $CHEM='ion,acid'; ''>NH_{4}^{+}
November 2014
236 WebAssign Creating Questions Guide
Answer
Code
<EQN $PAD='chem'; $CHEM='nclr'; ''>^{0}_{-1}beta
CuSO4 · 6 H2O
<EQN $PAD='chem'; $CHEM='solvate'; ''>CuSO_{4} . 6 H_{2}O
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.
• As with other fill-in-the-blank questions, you can specify
alternative answer keys separated by the characters {tab}.
• For information about how to specify chemical notation in your
answer key, see Creating chemPad Answer Keys on page 255.
6. 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.
7. Click Test/Preview to test the appearance and behavior of the question. See
Test Questions on page 18.
8. Click Redisplay to show certain kinds of errors in the Display section of the
Question Editor. Make any needed changes to your question.
9. 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 on page 19.
• 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 on page 308.
10. 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 chemPad Question (Allow Equivalent Formulas)
The following table summarizes an actual question.
November 2014
QID
1534325
Name
Template2 5.CHEMP.01.
Create Chemistry Questions 237
Mode
Fill-in-the-Blank
Question
Write the formula for the product of SO<sub>3</sub> +
H<sub>2</sub>O. <br>
<_>
Answer
<EQN $PAD='chem'; $CHEM='fmla'; ''>H_{2}SO_{4}
Display to
Students
Example chemPad Question (Require Exact Key Matching)
The following table summarizes an actual question.
QID
1534329
Name
Template2 5.CHEMP.02.
Mode
Fill-in-the-Blank
Question
Provide the chemical formula for nitric acid. <br>
<_>
Answer
<EQN $PAD='chem'; $CHEM='none'; ''>HNO_{3}
Display to
Students
Example chemPad Question (Solvate)
The following table summarizes an actual question.
QID
1534314
Name
Template2 5.CHEMP.03.
Mode
Fill-in-the-Blank
Question
Provide the chemical formula for cobalt(II) chloride
dihydrate.<br>
<_>
Answer
<EQN $PAD='chem'; $CHEM='solvate'; ''>CoCl_{2} . 2 H_{2}O
November 2014
238 WebAssign Creating Questions Guide
Display to
Students
See Also:
The {tab} Operator on page 329
Create List and Rank-Order chemPad Questions
When you create chemPad questions that are answered with a list of items, you
can choose whether order is important or not.
Unordered lists are delimited by commas and order is not important, so the
following responses are equivalent:
• Li, Na, K
• K, Na, Li
Rank-order lists are delimited by three symbols: >, <, and =. These symbols
are used to indicate items' relative ranking, so the following responses are not
equivalent:
• H < He < Li
• Li < H < He
Either-order lists, like rank-order lists, are delimited by three symbols: >,
<, and =. These symbols are used to indicate items' relative ranking, but your
students can specify their response either in ascending or descending order, so the
following responses are equivalent:
• H < He < Li
• Li > He > H
Note: Do not specify answer keys containing the < or > characters
directly in Answer, as these characters might be interpreted as the
start or end of a tag. Instead, assign your answer key to a variable and
reference the variable as described in this topic.
To create a chemPad question for which the answer is a list:
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. In Question, add the following code, replacing answer_key with your answer
key:
<eqn>
$mykey='answer_key';
November 2014
Create Chemistry Questions 239
''
</eqn>
This code assigns your answer key to the variable $mykey. You can use a
different variable name if needed.
For example:
Answer
Code
He, Ne, Ar, Kr, Xe, Rn (in any order)
<eqn>
$mykey='He, Ne, Ar, Kr, Xe, Rn';
''
</eqn>
NO2 > N2 > NH3
<eqn>
$mykey='NO_{2} > N_{2} > NH_{3}';
''
</eqn>
NO2 > N2 > NH3
or NH3 < N2 < NO2
<eqn>
$mykey='NO_{2} > N_{2} > NH_{3}';
''
</eqn>
Note: To ensure that your answer key is unambiguous, always specify
rank-order answer keys in either ascending or descending order.
Incorrect: Li > H < He
Correct: H < He < Li
Correct: Li > He > H
5. In Question, type your question.
Provide relevant information about assumptions or expectations for the
question, for example, the conditions for the question — STP, SATP, or
reaction/prevailing conditions — or whether states-of-matter should be
specified in the response. Use the answer placeholder string <_> to specify
where the answer box should be displayed.
6. In Answer, type the following items on a single line:
<EQN $PAD='chem'; $CHEM='method'; $mykey>
where method is one of the following chemPad parsing methods:
List Type
Delimiters
Method
Unordered
,
rnk
Rank-order
><=
rnk
Either-order
><=
rnk,either
For example:
Answer
Code
He, Ne, Ar, Kr, Xe, Rn (in any order)
<EQN $PAD='chem'; $CHEM='rnk';
$mykey>
November 2014
240 WebAssign Creating Questions Guide
Answer
Code
NO2 > N2 > NH3
<EQN $PAD='chem'; $CHEM='rnk';
$mykey>
NO2 > N2 > NH3
<EQN $PAD='chem';
$CHEM='rnk,either'; $mykey>
or NH3 < N2 < NO2
By default, your students must specify each chemical formula exactly as listed
in your answer key. To allow specific kinds of notation, you can add a comma
and one of the following methods after rnk or rnk,either:
Notation
Example
Method
Formula elements in any order
CH4N2O or CN2H4O
fmla
Condensed formulas
(NH2)2CO or CH4N2O
fmla,index
Solvate dot
CuSO4 · 6 H2O
solvate
Nuclear particles and nuclides
nclr
or
nclr,ion
Nuclear particles with charges
2+
+2
Ion charges
Mg
or Mg
Ionizable protons first
CH3CO2H or HCH3CO2
ion
ion,acid
For example:
<EQN $PAD='chem'; $CHEM='rnk,either,fmla,index'; $mykey>
Note:
• Specify methods only in the order listed here.
• 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.
• As with other fill-in-the-blank questions, you can specify
alternative answer keys separated by the characters {tab}. For
example:
<EQN $PAD='chem'; $CHEM='rnk'; $mykey> {tab} <EQN $mykey2>
• For information about how to specify chemical notation in your
answer key, see Creating chemPad Answer Keys on page 255.
7. 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.
8. Click Test/Preview to test the appearance and behavior of the question. See
Test Questions on page 18.
9. Click Redisplay to show certain kinds of errors in the Display section of the
Question Editor. Make any needed changes to your question.
November 2014
Create Chemistry Questions 241
10. 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 on page 19.
• 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 on page 308.
11. 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 chemPad Question (Unordered List)
The following table summarizes an actual question.
QID
1534331
Name
Template2 5.CHEMP.04.
Mode
Fill-in-the-Blank
Question
<eqn>
$mykey='He, Ne, Ar, Kr, Xe, Rn';
''
</eqn>
List the noble gases in any order. (Separate substances in the
list
with a comma.)<br>
<_>
Answer
<EQN $PAD='chem'; $CHEM='rnk'; $mykey>
Display to
Students
Example chemPad Question (Rank-Order List)
The following table summarizes an actual question.
QID
1534321
Name
Template2 5.CHEMP.05.
November 2014
242 WebAssign Creating Questions Guide
Mode
Fill-in-the-Blank
Question
<eqn>
$mykey='NO_{2} > N_{2} > NH_{3}';
''
</eqn>
Rank the following gases by mass density (at identical
temperatures
and pressures) in decreasing order: <h:chemical>N_2, NH_3, and
NO_2</h:chemical>. (Use the appropriate <, =, or > symbol to
separate substances in the list.)<br>
<_>
Answer
<EQN $PAD='chem'; $CHEM='rnk'; $mykey>
Display to
Students
Example chemPad Question (Either-Order List)
The following table summarizes an actual question.
November 2014
QID
1534315
Name
Template2 5.CHEMP.06.
Mode
Fill-in-the-Blank
Question
<eqn>
$mykey='NO_{2} > N_{2} > NH_{3}';
''
</eqn>
Rank the following gases by mass density (at identical
temperatures
and pressures): <h:chemical>N_2, NH_3, and NO_2</h:chemical>.
(Use the appropriate <, =, or > symbol to separate substances
in the list.)<br>
<_>
Answer
<EQN $PAD='chem'; $CHEM='rnk,either'; $mykey>
Create Chemistry Questions 243
Display to
Students
See Also:
The {tab} Operator on page 329
Create chemPad Questions for Reactions
When you create chemPad questions that are answered with a reaction
expression, your students can enter the order of compounds (with their
coefficients) differently from the answer key in either the reactants or the
products. For example, O2 + CH4 → CO2 + H2O is considered equivalent to
CH4 + O2 → H2O + CO2. Your students can also enter solvate dot notation if
needed.
You can choose whether to allow alternative reaction arrows in your students'
responses. You can require your students to use the reaction arrow specified in
your answer key, allow them to use any reaction arrow, allow either an equilibrium
arrow or a right arrow, or allow either an equilibrium arrow or a left arrow.
Note: Do not specify answer keys containing the < or > characters
directly in Answer, as these characters might be interpreted as the
start or end of a tag. Instead, assign your answer key to a variable and
reference the variable as described in this topic.
To create a chemPad question for which the answer is a
reaction:
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. In Question, add the following code, replacing answer_key with your answer
key:
<eqn>
$mykey='answer_key';
''
</eqn>
This code assigns your answer key to the variable $mykey. You can use a
different variable name if needed.
For example:
November 2014
244 WebAssign Creating Questions Guide
Answer
Code
CH4 + 2 O2 → CO2 + 2 H2O
<eqn>
$mykey='CH_{4} + 2 O_{2} -->
CO_{2} +
2 H_{2}O';
''
</eqn>
2 SO2 + O2 ⇌ 2 SO3
<eqn>
$mykey='2 SO_{2} + O_{2} <=>
2 SO_{3} ';
''
</eqn>
H3PO4(aq) + 3 NaOH(aq) → 3 H2O(l) + Na3PO4(aq) <eqn>
$mykey='H_{3}PO_{4}(aq) +
3 NaOH(aq) -->
3 H_{2}O(l) + Na_{3}PO_{4}
(aq)';
''
</eqn>
4 NO(g) + O2(g) ← 2 N2O3(g)
<eqn>
$mykey='4 NO(g) + O_{2}(g)
<=>
2 N_{2}O_{3}(g)';
''
</eqn>
5. In Question, type your question. Provide relevant information about
assumptions or expectations for the question, for example, the conditions
for the question — STP, SATP, or reaction/prevailing conditions — or whether
states-of-matter should be specified in the response. Use the answer
placeholder string <_> to specify where the answer box should be displayed.
6. In Answer, type the following items on a single line:
<EQN $PAD='chem'; $CHEM='method'; $mykey>
where method is one of the following chemPad parsing methods:
Reaction Type
Allowed Reaction Arrows
Method
Any
Only the reaction arrow specified by the
answer key.
rxn
Equilibrium
→ or ⇌ or ←
rxn,equ
Product-favored
→ or ⇌
rxn,eqr
Reactant-favored
← or ⇌
rxn,eql
For example:
November 2014
Answer
Code
CH4 + 2 O2 → CO2 + 2 H2O
<EQN $PAD='chem';
$CHEM='rxn'; $mykey>
Create Chemistry Questions 245
Answer
Code
2 SO2 + O2 ⇌ 2 SO3
<EQN $PAD='chem';
$CHEM='rxn,equ'; $mykey>
H3PO4(aq) + 3 NaOH(aq) → 3 H2O(l) + Na3PO4(aq) <EQN $PAD='chem';
$CHEM='rxn,eqr'; $mykey>
<EQN $PAD='chem';
$CHEM='rxn,eql'; $mykey>
4 NO(g) + O2(g) ← 2 N2O3(g)
By default, your students must specify each chemical formula exactly as listed
in your answer key. To allow specific kinds of notation, you can add a comma
and one of the following methods after rxn, rxn,equ, rxn, eqr, or rxn,eql:
Notation
Example
Method
Formula elements in any
order
CH4N2O or CN2H4O
fmla
Condensed formulas
(NH2)2CO or CH4N2O
fmla,index
Nuclear particles and
nuclides
nclr
or
nclr,ion
Nuclear particles with
charges
2+
+2
Ion charges
Mg
or Mg
Ionizable protons first
CH3CO2H or HCH3CO2
ion
ion,acid
For example:
<EQN $PAD='chem'; $CHEM='rxn,equ,fmla,index'; $mykey>
Note:
• You do not need to specify the solvate mode for your students to
enter solvate dot notation.
• Specify methods only in the order listed here.
• 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.
• As with other fill-in-the-blank questions, you can specify
alternative answer keys separated by the characters {tab}. For
example:
<EQN $PAD='chem'; $CHEM='rxn'; $mykey> {tab} <EQN $mykey2>
• For information about how to specify chemical notation in your
answer key, see Creating chemPad Answer Keys on page 255.
7. 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.
November 2014
246 WebAssign Creating Questions Guide
8. Click Test/Preview to test the appearance and behavior of the question. See
Test Questions on page 18.
9. Click Redisplay to show certain kinds of errors in the Display section of the
Question Editor. Make any needed changes to your question.
10. 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 on page 19.
• 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 on page 308.
11. 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 chemPad Question (Reaction)
The following table summarizes an actual question.
QID
1534317
Name
Template2 5.CHEMP.07.
Mode
Fill-in-the-Blank
Question
<eqn>
$mykey='2 HCl + CaCO_{3} --> CaCl_{2} + CO_{2} + H_{2}O';
''
</eqn>
Show the reaction between hydrochloric acid and calcium
carbonate
that produces calcium chloride, water, and carbon dioxide.
(<p:lowcoeff> Omit states-of-matter in your answer.)<br>
<_>
Answer
<EQN $PAD='chem'; $CHEM='rxn'; $mykey>
Display to
Students
November 2014
Create Chemistry Questions 247
Example chemPad Question (Reaction)
The following table summarizes an actual question.
QID
1534332
Name
Template2 5.CHEMP.08.
Mode
Fill-in-the-Blank
Question
<eqn>
$mykey='C_{5}H_{5}N(aq) + H_{2}O(l) <=> C_{5}H_{5}NH^{+}(aq) +
OH^{-}(aq)';
''
</eqn>
Write the reaction for pyridine,
<h:chemical>C_5H_5N</h:chemical>, acting as a base in water.
(<p:lowcoeff> Include states-of-matter under SATP conditions
in your answer.)<br>
<_>
Answer
<EQN $PAD='chem'; $CHEM='rxn,ion,acid'; $mykey>
Display to
Students
Example chemPad Question (Nuclear Equation)
The following table summarizes an actual question.
QID
1534326
Name
Template2 5.CHEMP.09.
Mode
Fill-in-the-Blank
Question
<eqn>
$mykey='^{131}_{53}I --> ^{0}_{-1}beta + ^{131}_{54}Xe';
''
</eqn>
Write the nuclear equation for beta decay of Iodine-131.
(<p:lowcoeff> Omit states-of-matter in your answer.)<br>
<_>
Answer
<EQN $PAD='chem'; $CHEM='rxn,nclr'; $mykey>
November 2014
248 WebAssign Creating Questions Guide
Display to
Students
See Also:
The {tab} Operator on page 329
Create chemPad Questions for Kinetic or Equilibrium
Expressions
When you create chemPad questions that are answered with a kinetic or
equilibrium expression, your students can change the order of compounds (with
their exponents) relative only to their position in a fraction.
For example,
is considered equivalent to
.
Your students can also enter multiplication or solvate dot notation if needed.
Note:
• When your students enter subscripted or superscripted letters in
chemPad, they must enclose the subscript or superscript in braces {}
to receive credit. For example, to enter Kb, your students must type
K_{b}.
• Your students must specify solvate dots in their responses. However,
if they omit multiplication dots, their responses will still be scored
correctly.
To create a chemPad question for which the answer is a
kinetic or equilibrium expression:
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. In Question, type your question. Provide relevant information about
assumptions or expectations for the question, for example, the conditions
for the question — STP, SATP, or reaction/prevailing conditions — or whether
states-of-matter should be specified in the response. Use the answer
placeholder string <_> to specify where the answer box should be displayed.
5. In Answer, type the following items on a single line:
<EQN $PAD='chem'; $CHEM='rqn'; ''>answer_key
November 2014
Create Chemistry Questions 249
where answer_key specifies the correct answer to the problem, and method is
one of the following chemPad parsing methods:
Notation
Example
Method
Formula elements in order
specified by answer key
CH4N2O
rqn
Formula elements in any order
CH4N2O or CN2H4O
rqn,fmla
Condensed formulas
(NH2)2CO or CH4N2O
rqn,fmla,index
Ion charges
Mg
Ionizable protons first
CH3CO2H or HCH3CO2
2+
+2
or Mg
rqn,ion
rqn,ion,acid
For example:
Answer
Code
<EQN $PAD='chem'; $CHEM='rqn,ion'; ''>
K_{b} = [OH^{-}] . [C_{5}H_{5}NH^{+}] /
[C_{5}H_{5}N]
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.
• As with other fill-in-the-blank questions, you can specify
alternative answer keys separated by the characters {tab}.
• For information about how to specify chemical notation in your
answer key, see Creating chemPad Answer Keys on page 255.
6. 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.
7. Click Test/Preview to test the appearance and behavior of the question. See
Test Questions on page 18.
8. Click Redisplay to show certain kinds of errors in the Display section of the
Question Editor. Make any needed changes to your question.
9. 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 on page 19.
November 2014
250 WebAssign Creating Questions Guide
• 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 on page 308.
10. 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 chemPad Question (Equilibrium Expression)
The following table summarizes an actual question.
QID
1534319
Name
Template2 5.CHEMP.10.
Mode
Fill-in-the-Blank
Question
Write the <i>K</i><sub>b</sub> equilibrium expression for
pyridine, C<sub>5</sub>H<sub>5</sub>N, acting as a base in
water. (<p:lowcoeff> Omit states-of-matter in your
answer.)<br>
<_>
Answer
<EQN $PAD='chem'; $CHEM='rqn,ion,acid'; ''>K_{b} = [OH^{-}] .
[C_{5}H_{5}NH^{+}] / [C_{5}H_{5}N]
Display to
Students
See Also:
The {tab} Operator on page 329
Create chemPad Questions for Electrochemical Cell
Notation
When you create chemPad questions that are answered with electrochemical cell
notation, your students must enter the notation in the manner prescribed by the
answer key, so, for example, Zn(s) | ZnSO4(aq) || CuSO4(aq) | Cu(s) can not be
+2
+2
substituted for Zn(s) | Zn (aq) || Cu (aq) | Cu(s). Your students can specify
2+
+2
charges in various ways, for example, either Mg or Mg .
November 2014
Create Chemistry Questions 251
To create a chemPad question for which the answer is
electrochemical cell notation:
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. In Question, type your question.
Provide relevant information about assumptions or expectations for the
question, for example, the conditions for the question — STP, SATP, or
reaction/prevailing conditions — or whether states-of-matter should be
specified in the response.
Use the answer placeholder string <_> to specify where the answer box should
be displayed.
5. In Answer, type the following items on a single line:
<EQN $PAD='chem'; $CHEM='vcell'; ''>answer_key
where answer_key specifies the correct answer to the problem.
For example:
Answer
+
H | H2 | Pt
Code
<EQN $PAD='chem'; $CHEM='vcell'; ''>H^{+} | H_{2} | Pt
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 information about how to specify chemical notation in your
answer key, see Creating chemPad Answer Keys on page 255.
6. 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.
7. Click Test/Preview to test the appearance and behavior of the question. See
Test Questions on page 18.
8. Click Redisplay to show certain kinds of errors in the Display section of the
Question Editor. Make any needed changes to your question.
9. 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
November 2014
252 WebAssign Creating Questions Guide
in search results. To change the permission, see Share Questions With
Other Instructors on page 19.
• 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 on page 308.
10. 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 chemPad Question (Electrochemical Cell Notation)
The following table summarizes an actual question.
QID
1534320
Name
Template2 5.CHEMP.11.
Mode
Fill-in-the-Blank
Question
Write the standard line notation for the following cell.
Assume
all concentrations are 1.0 <i>M</i> and all partial pressures
are 1.0 atm.<br >
<h:chemical>Zn(s) + Ag^+(aq) &#8652; Zn^2+(aq) +
Ag(s)</h:chemical><br>
<_>
Answer
<EQN $PAD='chem'; $CHEM='vcell'; ''>Zn(s) | Zn^{2+}(aq) ||
Ag^{+}(aq) | Ag(s)
Display to
Students
See Also:
The {tab} Operator on page 329
Create chemPad Questions for Electron Configuration
When you create chemPad questions that are answered with electron
configuration notation, your students can use either numerical or Aufbau order,
2
10
but answer keys are shown in Aufbau order, for example, [Ar] 4s 3d . You can
November 2014
Create Chemistry Questions 253
choose the kinds of electron configuration notation to allow in your students'
responses.
2
2
2
Full requires your students to use full notation — for example, 1s 2s 2p .
Noble requires your students to use noble gas notation — for example,
2
2
[He] 2s 2p .
2
2
2
Either lets your students use either full notation — for example, 1s 2s 2p — or
2
2
noble gas notation — for example, [He] 2s 2p .
Orbit lets your students use variants for orbital hybridization, for example, dsp
3
or sp d, that are considered equivalent.
3
To create a chemPad question for which the answer is an
electron configuration:
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. In Question, type your question. Provide relevant information about
assumptions or expectations for the question. Use the answer placeholder
string <_> to specify where the answer box should be displayed.
5. In Answer, type the following items on a single line:
<EQN $PAD='chem'; $CHEM='method'; ''>answer_key
where answer_key specifies the correct answer to the problem, and method is
one of the following chemPad parsing methods:
Behavior
Example
Require full notation
1s 2s 2p
Require noble gas notation
[He] 2s 2p
Allow either full or noble gas
notation
1s 2s 2p or [He] 2s 2p
Allow variants for orbital
hybridization
dsp or sp d
2
2
Method
2
2
2
2
3
econf,full
2
2
econf,noble
2
3
2
econf,either
econf,orbit
For example:
Answer
2
2
Code
2
<EQN $PAD='chem'; $CHEM='econf,full'; ''>
1s 2s 2p
1s^{2} 2s^{2} 2p^{2}
2
[He] 2s 2p
2
<EQN $PAD='chem'; $CHEM='econf,noble'; ''>
[He] 2s^{2} 2p^{2}
November 2014
254 WebAssign Creating Questions Guide
Answer
2
Code
2
2
2
1s 2s 2p or [He] 2s 2p
2
<EQN $PAD='chem'; $CHEM='econf,either';
''>
1s^{2} 2s^{2} 2p^{2}
sp
2
<EQN $PAD='chem'; $CHEM='econf,orbit';
''>sp^{2}
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.
• As with other fill-in-the-blank questions, you can specify
alternative answer keys separated by the characters {tab}.
• For information about how to specify chemical notation in your
answer key, see Creating chemPad Answer Keys on page 255.
6. 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.
7. Click Test/Preview to test the appearance and behavior of the question. See
Test Questions on page 18.
8. Click Redisplay to show certain kinds of errors in the Display section of the
Question Editor. Make any needed changes to your question.
9. 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 on page 19.
• 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 on page 308.
10. 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 chemPad Question (Electron Configuration)
The following table summarizes an actual question.
QID
November 2014
1534316
Create Chemistry Questions 255
Name
Template2 5.CHEMP.12.
Mode
Fill-in-the-Blank
Question
Write the electron configuration for Ca.<br>
<_>
Answer
<EQN $PAD='chem'; $CHEM='econf,either'; ''>1s^{2} 2s^{2}
2p^{6}
3s^{2} 3p^{6} 4s^{2}
Display to
Students
Example chemPad Question (Orbital Hybridization)
The following table summarizes an actual question.
QID
1534318
Name
Template2 5.CHEMP.13.
Mode
Fill-in-the-Blank
Question
What hybrid orbital would be expected for the central atom in
SO<sub>2</sub>?<br>
<_>
Answer
<EQN $PAD='chem'; $CHEM='econf,orbit'; ''>sp^{2}
Display to
Students
See Also:
The {tab} Operator on page 329
Creating chemPad Answer Keys
When you create your chemPad answer key, use the codes described in the
following table. Type spaces where they belong in your notation, such as between
November 2014
256 WebAssign Creating Questions Guide
quantum levels in an electron configuration and between chemical formulas and
arrows or plus signs in reaction equations.
Note: Be sure that your question provides relevant information about
assumptions or expectations for the question, for example, the conditions
for the question — STP, SATP, or reaction/prevailing conditions — or
whether states-of-matter should be specified in the response.
Best Practice: Always enclose the contents of superscripts or subscripts
in braces {}, even though technically you can omit them when the
superscript or subscript includes only numbers and charges.
Expression
Code
Example
Display
Subscript
_ (underscore)
H_{2}O
H2O
Superscript
^ (caret)
Ca^{2+}
Ca
Electron
configuration
See examples.
1s^{2} 2s^{2} 2p^{5}
[He] 2s^{2} 2p^{5}
1s 2s 2p
Combining
subscripts and
superscripts
See examples.
SO_{4}^{2-}
[Co(SCN)_{2}(H_{2}O)_{4}]
^{+}
^{233}_{91}Pa
SO4
Forward reaction
arrow
-->
2 H_{2}O_{2} --> 2 H_{2}O
+ O_{2}
2 H2O2 → 2 H2O + O2
Equilibrium
reaction
<=>
N_{2}(g) + O_{2}(g) <=> 2
NO(g)
N2(g) + O2(g) ⇌ 2 NO(g)
Reverse reaction
arrow
<--
4 NO(g) + O_{2}(g) <-2 N_{2}O_{3}(g)
4 NO(g) + O2(g) ← 2 N2O3(g)
States of matter
(g)
(l)
(s)
CH_{4}(g) + 4 S(s) -->
CH4(g) + 4 S(s) →
Lowercase Greek
letters
The lowercase letter
name
^{0}_{-1}beta
Uppercase Greek
letters
The capitalized letter
name
DeltaH_{f}
Stacked fraction
/
K_{c} = [COCl] . [Cl] /
[CO] . [Cl_{2}]
Multiplication or
solvate dot (·)
. (period)
K_{c} = [COCl] . [Cl] /
[CO] . [Cl_{2}]
Delimiters
between items
in rank-order
questions
>
<
=
K < P < Br
November 2014
CS_{2}(l) + 2 H_{2}S(
g)
2+
2
2
5
2
[He] 2s 2p
5
2+
[Co(SCN)2(H2O)4]
CS2(l) + 2 H2S(g)
ΔHf
K < P < Br
Create Chemistry Questions 257
Expression
Code
Example
Display
Delimiters
between items in
an unordered list
,
HClO, H^{+}, ClO^{-}
HClO, H , ClO
Phase boundary,
salt bridge
(electrochemical
cell)
|, ||
Zn(s) | Zn^{2+}(aq) ||
Ag^{+}(aq) | Ag(s)
Zn(s) | Zn
Ag(s)
NONE
NONE
None (no solution) NONE
+
2+
-
+
(aq) || Ag (aq) |
(Students enter
NONE instead of
leaving answer
box empty)
As with other Fill-in-the-Blank questions, you can specify multiple correct answers
delimited with the {tab} characters. This is most commonly used when you
require exact key matching. For example, to allow students to identify chromic
acid as either H2CrO4 or H2Cr2O7, your answer key would be:
H_{2}CrO_{4} {tab} H_{2}Cr_{2}O_{7}
See Also:
The {tab} Operator on page 329
Create MarvinSketch Questions
You can create questions that use the MarvinSketch tool to allow your students to
create or complete drawings of chemical structures and reactions that are scored
automatically. You can also use MarvinSketch to display chemical structures in
your questions.
Tip: Use the question titled marvinsketch.tutorial in an assignment
to teach yourself and your students how to answer questions using
MarvinSketch.
November 2014
258 WebAssign Creating Questions Guide
MarvinSketch Drawing Modes
Whether you are using MarvinSketch to display chemical structures and reactions
or to have your students draw them, you need to select the correct drawing mode
for your drawing.
Important: The treatment of hydrogen atoms varies by drawing mode
and affects how your students' drawings are scored.
• Explicit means that all hydrogens must be added to the drawing
manually.
• Implicit means that the correct number of hydrogens are
automatically assumed to be present, and might be labeled either for
all atoms or for heteroatoms only.
When hydrogens are displayed implicitly, you and your students can still
draw them manually, but chemically equivalent drawings that differ from
the answer key by representing implicit hydrogens explicitly or vice-versa
will be scored as incorrect.
The following table describes the MarvinSketch drawing modes that are available
®
in WebAssign :
Drawing Mode
Description
complete
Used to draw the entire molecular
structure, including hydrogens.
• Hydrogens: explicit, labeled
• Carbons: labeled
condensed
Used to draw the molecular structure
except for hydrogens, especially in organic
chemistry.
• Hydrogens: implicit, labeled
• Carbons: labeled
skeleton
Used to draw complex organic molecules.
• Hydrogens: implicit, labeled only for
heteroatoms
• Carbons: not labeled
skeleton_adv
For students in higher-level chemistry
courses, displays molecules like skeleton
mode and enables the Advanced Templates
toolbar.
Used to draw complex organic molecules.
• Hydrogens: implicit, labeled only for
heteroatoms
• Carbons: not labeled
November 2014
Display
Create Chemistry Questions 259
Drawing Mode
Description
reaction
Used to draw chemical reactions. Displays
molecules like condensed mode, but lets
you add a reaction arrow and automatically
adds + signs among the reactants and the
products.
Display
• Hydrogens: implicit, labeled
• Carbons: labeled
reaction_adv
For students in higher-level chemistry
courses, displays molecules like skeleton
mode and enables the Advanced Templates
toolbar.
Used to draw chemical reactions. Lets you
add a reaction arrow and automatically
adds + signs among the reactants and the
products.
• Hydrogens: implicit, labeled only for
heteroatoms
• Carbons: not labeled
lewis
Used to draw Lewis structures.
• Hydrogens: explicit, labeled
• Carbons: labeled
• Lone pairs and radicals: explicit, displayed
• Formal atomic charges: explicit, displayed
resonance
Used to draw resonance structures.
You must provide a template with mapping
numbers for molecules having symmetry.
Providing a template with mapping
numbers is a best practice for all resonance
structure drawings.
• Hydrogens: explicit, labeled
• Carbons: labeled
• Lone pairs and radicals: explicit, displayed
• Formal atomic charges: explicit, displayed
November 2014
260 WebAssign Creating Questions Guide
Drawing Mode
Description
mechanism
Used to draw reaction mechanisms showing
the movement of electrons.
Display
You must provide a template with
mapping numbers for molecules displaying
symmetry or for reaction mechanisms
for which a non-equivalent choice exists
between starting or ending locations.
Providing a template with mapping
numbers is a best practice for all reaction
mechanism drawings.
• Hydrogens: explicit, labeled
• Carbons: labeled
• Lone pairs and radicals: explicit, displayed
• Formal atomic charges: explicit, displayed
mechanism_adv
For students in higher-level chemistry
courses, displays molecules like skeleton
mode and enables the Advanced Templates
toolbar.
Used to draw reaction mechanisms showing
the movement of electrons.
You must provide a template with
mapping numbers for molecules displaying
symmetry or for reaction mechanisms
for which a non-equivalent choice exists
between starting or ending locations.
Providing a template with mapping
numbers is a best practice for all reaction
mechanism drawings.
• Hydrogens: implicit, labeled only for
heteroatoms
• Carbons: not labeled
3D
Used to draw ball-and-stick models that can
be rotated in three dimensions.
• Hydrogens: explicit, not labeled
• Carbons: not labeled
• Heteroatoms: not labeled
spacefill
Used to draw space-filling models that can
be rotated in three dimensions.
• Hydrogens: explicit, not labeled
• Carbons: not labeled
• Heteroatoms: not labeled
Use the three advanced modes — mechanism_adv, reaction_adv, and
skeleton_adv — to let your students in higher-level chemistry courses quickly
November 2014
Create Chemistry Questions 261
draw rings and other structures using the Advanced Templates toolbar in
MarvinSketch.
MarvinSketch Changes to Creating Questions
®
With the June 5, 2013 release, WebAssign updated MarvinSketch to version
5.12.1. New questions created using the MarvinSketch Key Generation tool
will use version 5.12.1. As of January 1, 2014, all MarvinSketch content was
converted to use version 5.12.1 and support for previous versions of MarvinSketch
was discontinued.
™
Note: Java version 1.7.51 is required. See Required Browser Plug-Ins.
Writing MarvinSketch Questions
Some of the changes between versions 5.3.8 and 5.12.1 might require you to
change how you write MarvinSketch questions.
• Students can no longer copy structures between different MarvinSketch
questions or question parts. In some modes, students cannot copy structures
at all. These modes include skeleton, condensed, complete, 3D, and spacefill.
You might consider using an initial drawing in your question; see Create
MarvinSketch Questions That Display an Initial Drawing on page 265.
• Some tools are not displayed in all modes. Test your questions to be sure
your students can answer them.
You might need to select a different mode or change the question.
• The MarvinSketch Key Generation tool displays the same toolbars for the
selected mode that your students will see. This means that you can add
some drawing elements like graphical arrows only by using the menus. Your
students can add only those elements that are available from the toolbars.
Create MarvinSketch Questions That Do Not Display an
Initial Drawing
For many MarvinSketch questions, you might want your students to draw a
structure or reaction starting with an empty drawing area. This kind of question
November 2014
262 WebAssign Creating Questions Guide
can ask your students to perform both analytical and synthetic thinking, much like
an essay question.
Note: For questions where the relative position of each atom is
important — resonance structures, reaction mechanisms, hybridization
states, chiral centers, and reaction centers — you must display an initial
drawing. See Create MarvinSketch Questions That Display an Initial
Drawing on page 265.
To create a MarvinSketch question without a template:
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 answer key using the MarvinSketch Key Generation tool.
a) Click Marvin under Page Tools.
b) For Marvin Type, select the drawing mode that you want to use.
c) Draw the chemical structure.
d) Click Get Key.
e) Select and copy the entire contents of the text box.
5. In Question, add the following code, replacing answer_key with the XML you
copied from the MarvinSketch Key Generation tool:
<eqn>
$mykey='answer_key';
''
</eqn>
Important:
• Always enclose the MarvinSketch XML in single quotes ('), not
double quotes (").
• Do not paste MarvinSketch XML directly in Answer. Instead,
assign your answer key to a variable and reference the variable as
described in this topic.
This code assigns the MarvinSketch answer key to the variable $mykey. You
can use a different variable name if needed.
Note: 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 MarvinSketch XML, your
question might exceed this limit without warning.
6. In Question, type your question.
Use the answer placeholder string <_> to specify where the answer box should
be displayed.
November 2014
Create Chemistry Questions 263
7. In Answer, type the following items on a single line:
<EQN $MARVIN='mode'; $mykey>
where mode is the MarvinSketch drawing mode that you want to use.
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'; $mykey1> {tab} <EQN $mykey2>
8. 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.
9. Click Test/Preview to test the appearance and behavior of the question. See
Test Questions on page 18.
10. Click Redisplay to show certain kinds of errors in the Display section of the
Question Editor. Make any needed changes to your question.
11. 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 on page 19.
• 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 on page 308.
12. 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 MarvinSketch Question
The following table summarizes an actual question.
QID
1534330
Name
Template2 5.MARVIN.01.
Mode
Fill-in-the-Blank
November 2014
264 WebAssign Creating Questions Guide
Question
<eqn>
# ----------------------------------------------#
Set $mykey to the answer key created
#
with the MarvinSketch Key Generation tool
# ----------------------------------------------$mykey='<?xml version="1.0" encoding="UTF-8"?><cml
version="ChemAxon file format v5.10.0, generated by
v5.12.1"><MDocument> <MChemicalStruct>
<molecule
molID="m1">
<atomArray atomID="a1 a2 a3" elementType="O
H H" x2="0.000 -1.334 1.334" y2="0.000 -0.770 -0.770"/>
<bondArray>
<bond atomRefs2="a1 a2" order="1"/>
<bond atomRefs2="a1 a3" order="1"/>
</bondArray>
</
molecule> </MChemicalStruct></MDocument></cml>';
''
</eqn>
Draw a water molecule. <BR>
<_>
Answer
<EQN $MARVIN='complete'; $mykey>
Display to
Students
November 2014
Create Chemistry Questions 265
®
Tip: WebAssign has created tutorial questions to help your students learn
to use MarvinSketch 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='MarvinSketch
Tutorial' style='none'>
• <PRACTICE qid='marvin.micro.tutorial.coordinate bonds'
link='MarvinSketch Tutorial' style='none'>
• <PRACTICE qid='marvin.micro.tutorial.electron flow'
link='MarvinSketch Tutorial' style='none'>
• <PRACTICE qid='marvin.micro.tutorial.functional groups'
link='MarvinSketch Tutorial' style='none'>
• <PRACTICE qid='marvin.micro.tutorial.generic groups'
link='MarvinSketch Tutorial' style='none'>
• <PRACTICE qid='marvin.micro.tutorial.isotopes' link='MarvinSketch
Tutorial' style='none'>
• <PRACTICE qid='marvin.micro.tutorial.lone pairs'
link='MarvinSketch Tutorial' style='none'>
• <PRACTICE qid='marvin.micro.tutorial.mapping' link='MarvinSketch
Tutorial' style='none'>
• <PRACTICE qid='marvin.micro.tutorial.organometallics'
link='MarvinSketch Tutorial' style='none'>
• <PRACTICE qid='marvin.micro.tutorial.radicals' link='MarvinSketch
Tutorial' style='none'>
• <PRACTICE qid='marvin.micro.tutorial.wedge bonds'
link='MarvinSketch Tutorial' style='none'>
For example:
Assign lone pairs where appropriate. <PRACTICE
qid='marvin.micro.tutorial.lone pairs' link='MarvinSketch Tutorial'
style='none'>
See Also:
The {tab} Operator on page 329
Use the MarvinSketch Key Generation Tool on page 275
Create MarvinSketch Questions That Display an Initial
Drawing
For some MarvinSketch questions, you might want your students to start with an
initial drawing — a template — and modify 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.
November 2014
266 WebAssign Creating Questions Guide
Note: Use a template that labels some or all of the atoms with mapping
numbers whenever the specific identity of each atom is important
for grading — for example, for molecules displaying symmetry, or for
mechanisms when alternative starting or ending locations are not correct.
Using a template that labels atoms with mapping numbers can be helpful
for any question for which the relative position of each atom is important —
resonance structures, reaction mechanisms, hybridization states, chiral
centers, and reaction centers.
To create a MarvinSketch question with a template:
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 using the MarvinSketch Key Generation tool.
a) Click Marvin under Page Tools.
b) For Marvin Type, select the drawing mode that you want to use.
c) Draw the chemical structure.
d) Click Get Key.
e) Select and copy the entire contents of the text box.
5. In Question, add the following code, replacing template with the XML you
copied from the MarvinSketch Key Generation tool:
<eqn>
$mytemplate='template';
Important:
• Always enclose the MarvinSketch XML in single quotes ('), not
double quotes (").
• Do not paste MarvinSketch XML directly in Answer. Instead,
assign your answer key to a variable and reference the variable as
described in this topic.
This code assigns the MarvinSketch template to the variable $mytemplate. You
can use a different variable name if needed.
6. Create your answer key using the MarvinSketch Key Generation tool.
Important: Always start with the template when creating your
answer key.
a) If needed, click Marvin under Page Tools and select the drawing mode that
you want to use.
b) If needed, copy the template from your question and paste it into the
drawing area.
November 2014
Create Chemistry Questions 267
c) Change the template exactly the way you want your students to do when
they answer the question. Do not move the template's atoms.
d) Click Get Key.
e) Select and copy the entire contents of the text box.
7. In Question, add the following code, replacing answer_key with the XML key
you copied from the MarvinSketch Key Generation tool:
$mykey='answer_key';
''
</eqn>
Important:
• Always enclose the MarvinSketch XML in single quotes ('), not
double quotes (").
• Do not paste MarvinSketch XML directly in Answer. Instead,
assign your answer key to a variable and reference the variable as
described in this topic.
This code assigns the MarvinSketch answer key to the variable $mykey. You
can use a different variable name if needed.
Note: 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 MarvinSketch XML, your
question might exceed this limit without warning.
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>
where mode is the MarvinSketch drawing mode that you want to use.
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 on page 18.
November 2014
268 WebAssign Creating Questions Guide
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 on page 19.
• 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 on page 308.
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 MarvinSketch Question
The following table summarizes an actual question.
QID
1534324
Name
Template2 5.MARVIN.02.
Mode
Fill-in-the-Blank
November 2014
Create Chemistry Questions 269
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 v5.12.1"><MDocument> <MChemicalStruct>
<molecule molID="m1">
<atomArray atomID="a1 a2 a3 a4 a5 a6 a7"
elementType="C N H H H O O" x2="-3.520 -1.980 -5.060 -3.520 -3.520 -1.210
-1.210" y2="0.587 0.587 0.587 2.127 -0.953 1.920 -0.747"/>
<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 v5.12.1"><MDocument> <MChemicalStruct>
<molecule molID="m1">
<atomArray atomID="a1 a2 a3 a4 a5 a6 a7"
elementType="C N H H H O O" formalCharge="0 1 0 0 0 0 -1" lonePair="0 0 0
0 0 2 3" x2="-3.520 -1.980 -5.060 -3.520 -3.520 -1.210 -1.210" y2="0.587
0.587 0.587 2.127 -0.953 1.920 -0.747"/>
<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>';
''
</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)
November 2014
270 WebAssign Creating Questions Guide
Display to
Students
(answered)
Example Resonance Structure MarvinSketch 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 v5.12.1"><MDocument> <MChemicalStruct>
<molecule molID="m1">
<atomArray atomID="a1 a2 a3" elementType="O
O O" mrvMap="2 1 3" x2="-1.027 -2.360 0.307" y2="3.483 2.713 2.713"/
>
<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 v5.12.1"><MDocument> <MChemicalStruct>
<molecule molID="m1">
<atomArray atomID="a1 a2 a3 a4 a5 a6"
elementType="O O O O O O" formalCharge="1 0 -1 1 -1 0" mrvMap="2 1 3 2 1 3"
lonePair="1 2 3 1 3 2" x2="-1.027 -2.360 0.307 4.583 3.250 5.917" y2="3.483
2.713 2.713 3.520 2.750 2.750"/>
<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></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>
November 2014
Create Chemistry Questions 271
Display to
Students
(template)
Display to
Students
(answered)
November 2014
272 WebAssign Creating Questions Guide
®
Tip: WebAssign has created tutorial questions to help your students learn
to use MarvinSketch 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='MarvinSketch
Tutorial' style='none'>
• <PRACTICE qid='marvin.micro.tutorial.coordinate bonds'
link='MarvinSketch Tutorial' style='none'>
• <PRACTICE qid='marvin.micro.tutorial.electron flow'
link='MarvinSketch Tutorial' style='none'>
• <PRACTICE qid='marvin.micro.tutorial.functional groups'
link='MarvinSketch Tutorial' style='none'>
• <PRACTICE qid='marvin.micro.tutorial.generic groups'
link='MarvinSketch Tutorial' style='none'>
• <PRACTICE qid='marvin.micro.tutorial.isotopes' link='MarvinSketch
Tutorial' style='none'>
• <PRACTICE qid='marvin.micro.tutorial.lone pairs'
link='MarvinSketch Tutorial' style='none'>
• <PRACTICE qid='marvin.micro.tutorial.mapping' link='MarvinSketch
Tutorial' style='none'>
• <PRACTICE qid='marvin.micro.tutorial.organometallics'
link='MarvinSketch Tutorial' style='none'>
• <PRACTICE qid='marvin.micro.tutorial.radicals' link='MarvinSketch
Tutorial' style='none'>
• <PRACTICE qid='marvin.micro.tutorial.wedge bonds'
link='MarvinSketch Tutorial' style='none'>
For example:
Assign lone pairs where appropriate. <PRACTICE
qid='marvin.micro.tutorial.lone pairs' link='MarvinSketch Tutorial'
style='none'>
See Also:
The {tab} Operator on page 329
Use the MarvinSketch Key Generation Tool on page 275
Display Chemical Structures in Questions with
MarvinSketch
For some questions, you want to display sketches of chemical structures or
reactions. You can display these using MarvinSketch in the question, the answer
(for question modes like multiple-choice), or the solution. For 3-dimensional
structures, your students can even rotate the structure to examine it from all
angles.
To display a MarvinSketch drawing in your question:
1. Open your question in the Question Editor.
November 2014
Create Chemistry Questions 273
2. Create your drawing using the MarvinSketch Key Generation tool.
a) Click Marvin under Page Tools.
b) For Marvin Type, select the drawing mode that you want to use.
c) Draw the chemical structure.
d) Click Get Key.
e) Select and copy the entire contents of the text box.
3. In Question, add the following code, replacing drawing_string with the XML
you copied from the MarvinSketch Key Generation tool:
<eqn>
$mysketch='drawing_string';
''
</eqn>
This code assigns the MarvinSketch XML to the variable $mysketch. You can
use a different variable name if needed.
Important:
• Always enclose the MarvinSketch XML in single quotes ('), not
double quotes (").
• Do not paste MarvinSketch XML directly in Answer. Instead,
assign your answer key to a variable and reference the variable as
described in this topic.
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>
where:
• mode is the MarvinSketch drawing mode you want to use for your
drawing (see MarvinSketch Drawing Modes on page 258).
• 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 MarvinSketch XML, your
question might exceed this limit without warning.
Example Displaying MarvinSketch Drawing in Question
The following table summarizes an actual question.
QID
1534327
Name
Template2 5.MARVIN.04.
November 2014
274 WebAssign Creating Questions Guide
Mode
Multiple-Choice
Question
<eqn>
# ----------------------------------------------#
Set $mysketch to the drawing string created
#
with the MarvinSketch Key Generation tool
# ----------------------------------------------$mysketch='<?xml version="1.0" encoding="UTF-8"?><cml version="ChemAxon
file format v5.10.0, generated by v5.12.1"><MDocument> <MChemicalStruct>
<molecule molID="m1">
<atomArray atomID="a1 a2 a3 a4 a5 a6 a7 a8
a9 a10" elementType="C C C C C C O C O O" x2="-3.520 -2.186 -0.853 -0.853
-2.186 -3.520 0.481 -2.186 -0.853 -3.520" y2="3.337 4.107 3.337 1.797 1.027
1.797 4.107 5.647 6.417 6.417"/>
<bondArray>
<bond atomRefs2="a1
a2" order="1"/>
<bond atomRefs2="a2 a3" order="2"/>
<bond
atomRefs2="a3 a4" order="1"/>
<bond atomRefs2="a4 a5" order="2"/
>
<bond atomRefs2="a5 a6" order="1"/>
<bond atomRefs2="a6
a1" order="2"/>
<bond atomRefs2="a3 a7" order="1"/>
<bond
atomRefs2="a2 a8" order="1"/>
<bond atomRefs2="a8 a9" order="1"/>
<bond atomRefs2="a8 a10" order="2"/>
</bondArray>
</molecule> </
MChemicalStruct></MDocument></cml>';
''
</eqn>
Identify the molecule.
<table><tr><td width="250"><_></td>
<td><MARVIN type="skeleton"><EQN $mysketch></MARVIN></td></tr></table>
Answer
salicyclic acid
caffeine
ethanol
benzoic acid
hydrochloric acid
Display to
Students
Example Displaying a 3D MarvinSketch Drawing
The following table summarizes an actual question.
QID
1534323
Name
Template2 5.MARVIN.05.
Mode
Multiple-Choice
November 2014
Create Chemistry Questions 275
Question
<eqn>
# ----------------------------------------------#
Set $mysketch to the drawing string created
#
with the MarvinSketch Key Generation tool
# ----------------------------------------------$mysketch='<?xml version="1.0" encoding="UTF-8"?><cml version="ChemAxon
file format v5.10.0, generated by v5.12.1"><MDocument> <MChemicalStruct>
<molecule molID="m1">
<atomArray atomID="a1 a2 a3 a4 a5 a6 a7 a8"
elementType="N C C C N C O N" x3="1.518 0.710 1.264 0.389 -0.941 -1.454
-2.684 -0.629" y3="0.457 0.823 1.057 1.422 1.538 1.308 1.423 0.954" z3="0.275
-0.804 -2.078 -3.117 -2.872 -1.635 -1.440 -0.616"/>
<bondArray>
<bond atomRefs2="a1 a2" order="1"/>
<bond atomRefs2="a2 a3" order="2"/
>
<bond atomRefs2="a3 a4" order="1"/>
<bond atomRefs2="a4
a5" order="2"/>
<bond atomRefs2="a5 a6" order="1"/>
<bond
atomRefs2="a6 a7" order="2"/>
<bond atomRefs2="a6 a8" order="1"/>
<bond atomRefs2="a2 a8" order="1"/>
</bondArray>
</molecule> </
MChemicalStruct></MDocument></cml>';
''
</eqn>
Identify the nucleobase.
<table><tr><td width="250"><_></td>
<td><MARVIN type="3D"><EQN $mysketch></MARVIN></td></tr></table>
Answer
cytosine
guanine
adenine
thymine
Display to
Students
See Also:
Use the MarvinSketch Key Generation Tool on page 275
Use the MarvinSketch Key Generation Tool
You can use MarvinSketch to draw chemical structures to display in your questions
or to use as question keys or templates when your students use MarvinSketch to
draw their responses.
Tip: Use the question titled marvinsketch.tutorial to teach yourself how to
draw structures using MarvinSketch.
To draw a chemical structure or reaction:
1. In the Question Editor, click Marvin under Page Tools.
2. For Marvin Type, select the MarvinSketch drawing mode you want to use.
See MarvinSketch Drawing Modes on page 258.
November 2014
276 WebAssign Creating Questions Guide
Important: Always draw your chemical structure using the mode that
you want to specify in your question. If you are creating a question
with a template, always use the same mode to create the template and
the answer key.
3. Draw the chemical structure or reaction using the same tools that are
available to your students, as described below.
The following considerations apply only when you are creating a question:
• Your students do not have access to the menu bar in MarvinSketch, but
will instead draw structures using the toolbars.
• You can click File > Clear Desk to erase your entire drawing.
• You can click File > Save to save your structure in a variety of formats,
including MarvinSketch XML and SMILES strings.
• You can copy MarvinSketch XML, SMILES strings, or other formatted
notation recognized by MarvinSketch and paste it in the drawing area to
quickly create the specified structures.
• Changes that you make in the View menu — for example, to the
background color or zoom level — are not reflected in your questions,
either in displayed chemical structures, templates, or answer keys. In
your questions, the zoom level is automatically changed so that the
entire structure is displayed.
• Do not create a multi-page document using File > Document Settings.
Although this is useful when printing chemical structures, it can cause
®
display problems in WebAssign questions.
4.
If the location of single and double bonds is not relevant, click
to aromatize
the structure before creating your answer key. This lets MarvinSketch score
equivalent responses correctly.
If needed, you can select a specific part of a molecule — for example, the
maleimide in phthalimide — and click
to dearomatize it to help with proper
bond assignment in the 5-membered ring.
Tip: Aromatize benzene rings unless the placement of the double
bonds is important for the grading of the answer, for example, if you
want your students to provide two separate resonance structures.
If you do not aromatize a benzene ring structure, your students will be
graded correct only when the double bond placement in their answer
matches that in your answer key.
5.
When you are finished drawing the structure, click either
dimensional drawings) or
three things:
(for 2-
(for 3-dimensional drawings). This accomplishes
• The drawing is converted to either a 2-dimensional or 3-dimensional
representation.
• Bond lengths and angles are standardized or optimized.
November 2014
Create Chemistry Questions 277
• If any bonds were inadvertently not connected, or were connected to
incorrect locations, the problem should become apparent and you can
then correct it.
6. Click Get Key.
7. Click in the text box, and then press CTRL+A followed by CTRL+C to select
and copy the MarvinSketch XML.
You can use the MarvinSketch XML in your questions to display the chemical
structure drawing in a question, to specify a MarvinSketch answer key, or to
define a MarvinSketch template.
See Also:
Create MarvinSketch Questions That Do Not Display an Initial Drawing on page
261
Create MarvinSketch Questions That Display an Initial Drawing on page 265
Display Chemical Structures in Questions with MarvinSketch on page 272
Create MarvinSketch Questions That Use Canonical or
Combinatorial SMILES Strings on page 282
Draw Chemical Structures in MarvinSketch
The following table describes how to draw and edit chemical structures and
reactions in MarvinSketch.
Important: The MarvinSketch Key Generation tool displays the same
toolbars for the selected mode that your students will see. This means that
you can add some drawing elements like graphical arrows only by using the
menus. Your students can add only those elements that are available from
the toolbars.
Task
Steps
Add an atom of one of the
following elements: H, C,
N, O, P, S, F, Cl, Br, I
1. Click the element symbol.
Add any atom
1.
2. Click in the drawing area.
Click
.
2. Click the element symbol in the periodic table.
3. Close or move the Periodic System window.
4. Click in the drawing area.
Add a special atom type
or node, such as Q, M, X,
and LP
1.
Click
.
2. Click the Advanced tab.
3. Click the symbol on the Advanced page.
4. Close or move the Periodic System window.
5. Click in the drawing area.
November 2014
278 WebAssign Creating Questions Guide
Task
Steps
Add an atom and its bond
to an existing atom
1. Click the element symbol for the new atom.
Add two bonded carbon
atoms
1.
2. Drag from the existing atom until the symbol for the new
atom is displayed under the pointer.
Click
.
2. Click in the drawing area.
Add a chain of carbon
atoms
1.
Click
.
2. Drag in the drawing area until the number of carbon
atoms you want to insert is displayed under the pointer.
Replace an atom
1. Click the element symbol for the new atom.
2. Click the atom to be replaced.
Add a single bond
between existing atoms
1.
Click
.
2. Drag from one atom to another.
Note: If the bond does not end at an existing atom, a
carbon atom is automatically added at the end of the
bond.
Add a double bond
between existing atoms
1.
Click
.
2. Drag from one atom to another.
Change a bond type
1. Click the button for the bond type you want to use.
2. Click the bond to be changed.
Draw a reaction arrow
1.
(adds + signs among
reactants and products;
treats structures and
2. Drag the pointer in the drawing area in the direction the
arrow should point.
names above arrow as
agents)
November 2014
Click
.
Create Chemistry Questions 279
Task
Add agent names to a
reaction arrow
Steps
1.
Click
.
2. Click the Advanced tab.
3. Click Pseudo on the Advanced page.
4. Type the agents in Value (subscripts are automatically
formatted for values like H2O).
5. Close or move the Periodic System window.
6. Click above the reaction arrow.
Add a single electron
(monovalent radical) to
an atom
1.
Add lone pairs to an atom
1.
Click the radical tool
.
2. Click an atom.
Expand the lone pairs tool
and select the number of
lone pairs to add.
2. Click an atom.
Draw a curved harpoon
to show the movement of
electrons
1.
and select either 1
Expand the electron flow tool
Electron or 2 Electrons.
2. Click the source atom for the electron.
3. Click the target atom for the electron, or to create a bond,
click the midpoint between atoms.
Set the charge for an
atom
1. Right-click the atom.
Decrease an atom's
charge
1.
2. Select Charge > value, where value is the charge you
want to use.
Click
.
2. Click an atom.
Increase an atom's
charge
1.
Click
.
2. Click an atom.
Select a single item
1.
Expand the selection tool
and select
Rectangle Selection.
2. Click the item you want to select.
Select an entire structure
1.
Expand the selection tool
and select
Structure Selection.
2. Click any part of a structure.
November 2014
280 WebAssign Creating Questions Guide
Task
Select items in a
rectangular region
Steps
1.
Expand the selection tool
and select
Rectangle Selection.
2. Drag the pointer diagonally across the drawing area to
select items.
Select items in an
arbitrary region
1.
Expand the selection tool
and select
Lasso Selection.
2. Drag the pointer to draw a boundary around the items
you want to select.
Select multiple items
1.
Expand the selection tool
and select
Rectangle Selection.
2. Click the first item you want to select.
3. Hold the SHIFT key and click any additional items you
want to select.
Copy selected items to
the clipboard
Paste items from the
clipboard
Click
1.
.
Click
.
2. Click in the drawing area where you want to paste the
clipboard items.
Delete selected items
Delete items by clicking
Click
1.
or press DELETE.
Click
.
2. Click the items you want to delete.
Move an atom
1. Drag the atom to a new location.
Move selected items
1. Move the pointer toward the center of the selection until a
square is displayed.
2. Drag the selection to a new location.
Undo your last change
Set a mapping number
for an atom
November 2014
Click
or press CTRL+Z.
1. Right-click the atom you want to change.
2. Select Map > M# where # is the mapping number to set.
Create Chemistry Questions 281
Task
Transform selected
structure or entire
drawing to aromatic
representation
Transform selected
structure or entire
drawing to non-aromatic
representation
Steps
Click
.
Click
.
Flip a structure
horizontally
1. Select the structure to flip.
Flip a structure vertically
1. Select the structure to flip.
2. Right-click the structure and click Transform > Flip >
Flip Horizontally.
2. Right-click the structure and click Transform > Flip >
Flip Vertically.
Rotate a structure to align
a bond horizontally
1. Right-click a bond in the structure.
Rotate a structure to align
a bond vertically
1. Right-click a bond in the structure.
Rotate selected items in
2 dimensions
1. Move the pointer toward the center of the selection until a
2. Select Align > Horizontally.
2. Select Align > Vertically.
rotation cue
is displayed.
2. Drag the selection to rotate it around its center.
Rotate the drawing in
3 dimensions
1.
Click
.
2. Drag the pointer to rotate the drawing.
Rotate selected structure
in 3 dimensions
1. Move the pointer toward the center of the selection until a
square is displayed.
2. Right-click in the square and select Transformation >
Rotate in 3D > Free 3D Rotation.
3. Drag the pointer to rotate the structure.
Clean drawing in
2 dimensions
Click
.
This standardizes bond lengths and angles to improve
appearance. The drawing is converted to a 2-dimensional
drawing if needed.
November 2014
282 WebAssign Creating Questions Guide
Task
Steps
Clean drawing in
3 dimensions
Click
Zoom in
Zoom out
Zoom to a specific
magnification
.
This standardizes bond lengths and angles to improve
appearance. The drawing is converted to a 3-dimensional
drawing if needed.
Click
.
Click
.
Select a zoom level from the zoom level list
a new zoom level in the box.
or type
Create MarvinSketch Questions That Use Canonical or
Combinatorial SMILES Strings
Sometimes, you want to display a randomly selected molecule in your question.
Or, you might even want to combine molecules — for example, in condensation
reactions or peptide sequences. Specifying the chemical structure using SMILES
(Simplified Molecular Input Line Entry System) strings instead of the native
MarvinSketch XML lets you combine or otherwise change the chemical structure
programmatically, and offers a space-efficient method for defining arrays of
chemical structures that can be used in your question.
Canonical SMILES strings uniquely identify a particular molecule. The canonical
SMILES representation of any molecule is dependent on the software program's
canonicalization algorithm. For this reason, the canonical SMILES string for a
molecule in MarvinSketch might be different from the canonical SMILES string
generated by another application.
Combinatorial SMILES strings identify a discrete structure in a molecule, and
can be combined to form canonical SMILES strings.
Important:
• Always use canonical or combinatorial SMILES strings.
• Only a subset of SMILES notation is supported for use in MarvinSketch
questions.
• Do not use SMILES strings for reactions or to specify atom mapping.
• Other formats, such as molfile formats, protein data bank files, InChi
®
strings, and IUPAC names, are not supported for use in WebAssign
questions. You might be able to use one of these formats to display a
structure in your question, but you should never use them to define
answer keys that your students must draw, as this could result in
scoring problems with your students' responses.
Although the native MarvinSketch XML format provides the most comprehensive
description of your chemical structures, it is long, difficult to read, and cannot be
manipulated by your question code. With SMILES, your question code can easily
November 2014
Create Chemistry Questions 283
combine or change SMILES strings, for example, to reflect a chemical process or
to randomize your question.
For example, you could use either MarvinSketch XML or SMILES to display an
ethanol molecule:
MarvinSketch XML
SMILES
<?xml version="1.0" encoding="UTF-8"?><cml version="ChemAxon CCO
file format v5.10.0, generated by v5.12.1"><MDocument>
<MChemicalStruct>
<molecule molID="m1">
<atomArray
atomID="a1 a2 a3" elementType="C C O" x2="2.310 3.644
4.977" y2="-1.334 -2.104 -1.334"/>
<bondArray>
<bond atomRefs2="a1 a2" order="1"/>
<bond
atomRefs2="a2 a3" order="1"/>
</bondArray>
</
molecule> </MChemicalStruct></MDocument></cml>
The best way to ensure that your SMILES string works correctly in MarvinSketch is
to use MarvinSketch to generate SMILES.
To use a SMILES string in your question:
1. Create your drawing using the MarvinSketch Key Generation tool.
a) Click Marvin under Page Tools.
b) For Marvin Type, select the drawing mode that you want to use.
c) Draw the chemical structure.
2. In the MarvinSketch Key Generation tool, save the drawing using the SMILES
format.
a) Click File > Save.
b) In Files of Type, select SMILES.
c) Navigate to the location where you want to save the file, type a File
Name, and then click Save.
3. In a text editor, open the SMILES file you saved and copy its contents.
4. Paste the SMILES string that you copied into your question.
You can use the SMILES string in your questions instead of MarvinSketch
XML to display the chemical structure drawing in a question, to specify a
MarvinSketch answer key, or to define a MarvinSketch template.
Example Displaying Chemical Structures Using SMILES
The following table summarizes an actual question.
QID
1534322
Name
Template2 5.MARVIN.06.
Mode
Multiple-Choice
November 2014
284 WebAssign Creating Questions Guide
Question
<eqn>
# ---------------------------------------------------#
Select 1 of 8 molecules to identify
# ---------------------------------------------------@dat = (["ethanol", "CCO"],
["isopropanol", "CC(O)C"],
["methanol", "CO"],
["n-propanol", "CCCO"],
["n-butanol", "CCCCO"],
["isobutanol", "CC(C)CO"],
["propene", "C=CC"],
["ethylene", "C=C"]);
@choices = pick(5, 0..$#dat);
''
</eqn>
Identify the molecule.
<table><tr><td width="250"><_></td>
<td><MARVIN type='condensed'><EQN
$dat[$choices[0]][1]></MARVIN></td></tr></table>
Answer
<EQN
<EQN
<EQN
<EQN
<EQN
$dat[$choices[0]][0]>
$dat[$choices[1]][0]>
$dat[$choices[2]][0]>
$dat[$choices[3]][0]>
$dat[$choices[4]][0]>
Display to
Students
Example MarvinSketch Question Using SMILES Answer Key
The following table summarizes an actual question.
November 2014
QID
1534328
Name
Template2 5.MARVIN.07.
Mode
Fill-in-the-Blank
Create Chemistry Questions 285
Question
<eqn>
# ---------------------------------------------------#
Set $mykey to one of 2730 possible tripeptides
# ---------------------------------------------------@dat = (["Ala", "NC(C)C(=O)"],
["Arg", "NC(CCCNC(N)=N)C(=O)"],
["Asn", "NC(CC(N)=O)C(=O)"],
["Asp", "NC(CC(O)=O)C(=O)"],
["Cys", "NC(CS)C(=O)"],
["Gln", "NC(CCC(N)=O)C(=O)"],
["Glu", "NC(CCC(O)=O)C(=O)"],
["Gly", "NCC(=O)"],
["Ile", "NC(C(C)CC)C(=O)"],
["Leu", "NC(CC(C)C)C(=O)"],
["Lys", "NC(CCCCN)C(=O)"],
["Met", "NC(CCSC)C(=O)"],
["Ser", "NC(CO)C(=O)"],
["Thr", "NC(C(C)O)C(=O)"],
["Val", "NC(C(C)C)C(=O)"]);
($a, $b, $c) = pick(3, 0..$#dat);
$label = $dat[$a][0] . '-' . $dat[$b][0] . '-' . $dat[$c][0];
$mykey = $dat[$a][1] . $dat[$b][1] . $dat[$c][1] . 'O';
''
</eqn>
Draw the structure of the tripeptide <eqn $label>. <br> <_>
Answer
<EQN $MARVIN='condensed'; $mykey>
Display to
Students
See Also:
SMILES notation: www.daylight.com/dayhtml/doc/theory/theory.smiles.html
Use the MarvinSketch Key Generation Tool on page 275
November 2014
286 WebAssign Creating Questions Guide
November 2014
8
Format Questions
This chapter contains the
following topics:
You can insert videos, sound files, or mathematical notation in
your questions.
• Format Text in Questions
• Add Images, Media, or Documents
to Your Coursework
• Add Symbols to Questions
• Add Search Metadata to Questions
• Add Standard Text Prompts to
Questions
November 2014
288 WebAssign Creating Questions Guide
Format Text in Questions
When typing your Question, Solution, and for some modes also your Answer,
you can use HTML tags and CSS style attribute values to add formatting to your
questions.
Note: Not all HTML tags and CSS attributes are displayed in the same way
on all browsers. In addition, some tags or attributes might not display as
®
expected because of other formatting rules in the WebAssign application.
Always test your formatting.
If you are not familiar with using HTML, the following information might be useful:
• HTML is a markup language with tags enclosed in angle brackets <>.
• Most HTML tags have a start tag that identifies the formatting to be applied
and a matching end tag that begins with a forward slash, for example,
<b>your_content_here</b>
• When the < and & characters are followed by a letter, you must use a
character entity reference to prevent these characters from being interpreted
as HTML markup.
To type <, type &lt;
To type &, type &amp;
• Most spaces and line breaks are considered unimportant for HTML formatting
and are ignored.
Important: Line breaks in Answer are very important for
®
WebAssign and determine the start of each answer or answer choice,
depending on the question mode.
See the following table for examples of some of the most commonly used
formatting.
Formatting
Example Code
Display
Bold
<b>bold text</b>
bold text
Italics
<i>italic text</i>
italic text
Underline
<u>underlined text</u>
underlined text
Subscript
text<sub>subscript </sub>
textsubscript
Superscript
text<sup>superscript</sup>
text
Line break
line<br>new line
line
new line
New paragraph
paragraph<p>new paragraph
paragraph
superscript
new paragraph
Indented text
November 2014
text
<div class='indent'>indented</div>
Format Questions 289
Formatting
Example Code
Centered text
text
<div class='center'>centered</div>
Right-aligned text
text
<div class='right'>right-aligned</
div>
Bulleted list
<ul>
<li>first list item</li>
<li>next list item</li>
<li>last list item</li>
</ul>
Numbered list
Display
• first list item
• next list item
• last list item
<ol>
<li>first list item</li>
<li>next list item</li>
<li>last list item</li>
</ol>
Simple table - no
borders
<table>
<tr><td>top left</td><td>top right</
td></tr>
<tr><td>bottom left</td><td>bottom
right</td></tr>
</table>
Simple table - with
borders
<table border="1">
<tr><td>top left</td><td>top right</
td></tr>
<tr><td>bottom left</td><td>bottom
right</td></tr>
</table>
1. first list item
2. next list item
3. last list item
Add Images, Media, or Documents to Your
Coursework
You can add images, media such as audio or video files, or documents to your
questions, assignments, or announcements.
For example, you might want to:
• display an image as part of your question prompt
• include a brief video that your students watch before completing an
assignment
• supply a template document like a spreadsheet or code example that your
students complete and then upload as their response
• provide a worked solution to a problem as a PDF document
November 2014
290 WebAssign Creating Questions Guide
Important: Before sharing images, media, or documents with your
students:
• Obtain the image, media, or document as a file on your computer in a
standard file format for the content — for example, JPG, GIF, or PNG
for images.
• If your content must be opened with proprietary software, ensure that
your students will have access to this software.
• Make sure that you have permission to use any materials that you
share with your students. Do not share copyrighted materials like
music files or content from a textbook you have not adopted for your
class.
To add images, media, or document files to your
coursework, perform the following steps as described in this
section:
®
1. Upload the images, media, or documents from your computer to WebAssign .
2. Set the display text that you want to use for your images, media, or
documents.
3. Add code to perform one of the following:
• Display an image
• Provide a linked document
• Play a media file
Upload Images, Media, or Documents to My Folders
You can copy image, media, or document files from your computer to WebAssign
for use as part of your course materials.
Important: Before sharing images, media, or documents with your
students:
• Obtain the image, media, or document as a file on your computer in a
standard file format for the content — for example, JPG, GIF, or PNG
for images.
• If your content must be opened with proprietary software, ensure that
your students will have access to this software.
• Make sure that you have permission to use any materials that you
share with your students. Do not share copyrighted materials like
music files or content from a textbook you have not adopted for your
class.
To copy an image, media, or document file from your
computer to WebAssign®:
1.
November 2014
In the toolbar, click
Folders.
®
Format Questions 291
Alternatively, open the My Files window when editing an assignment, question,
or announcement.
From this page:
Do this:
Question Editor
Click My Files in the Page Tools panel.
Assignment Editor Click Include File for either the Description or Instructions.
Communication
Home
Click My Files to the left of your announcement text.
2. Navigate to the folder where you want to put your file.
3. Click
Import File.
4. Select the file to upload.
a) Click Browse or Choose File, depending on your browser.
b) Navigate to the file you want to upload.
c) Click Open or Choose, depending on your browser.
5. Click go.
Note: Uploading a large file might take some time, especially with a
slower Internet connection.
6. Close the Import window.
®
The file is copied from your computer to WebAssign and is listed in the contents
of the selected folder.
®
After copying your file to WebAssign , you can use it in your questions, in your
assignment description or instructions, in announcements, or as a class resource.
After adding an image file, always provide alternative text for the image.
Set Display Text for an Image, Media, or Document File
®
After you upload a file or image to WebAssign for use in your classes, set the link
or alternative text for the file or image.
• Link text is the text shown to your students when you provide a link to the
file or image.
If you omit this, the file name will be used as the link text. You can override
the link text any time you insert a link to your file.
• Alternative text is spoken by screen readers to help students with visual
limitations understand the content of an image.
Important: Always specify meaningful alternative text when you use
®
an image in WebAssign .
Note: This text is not used for displaying class resources.
November 2014
292 WebAssign Creating Questions Guide
To specify link, hover, or alternative text for an image,
media, or document file:
1.
In the toolbar, click
Folders.
Alternatively, open the My Files window when editing an assignment, question,
or announcement.
From this page:
Do this:
Question Editor
Click My Files in the Page Tools panel.
Assignment Editor Click Include File for either the Description or Instructions.
Communication
Home
Click My Files to the left of your announcement text.
2. Navigate to the file or image you want to change.
3. Click the file name.
The File View window opens.
4. Set the link or alternative text for your file or image.
For a:
File that is not
an image
Do this:
1. Select Link at the top of the Attributes list.
2. Type the link text you want to be displayed.
3. Optional: Provide information for the title attribute of the link.
Depending on the browser or screen reader's behavior, this
might be displayed as hover text in the browser or read by
a screen reader, but it also might not be shown or read to
students at all.
November 2014
Format Questions 293
For a:
Image file
Do this:
1. Select Image at the top of the Attributes list.
2. Type the alternative text you want to be read by screen readers
in both the alt tag and title fields.
Screen readers might read the contents of the alt or title
attributes of an image. To ensure that your content is
accessible, provide the same information in both fields.
3. Optional: Provide a link to a longer description of the content
in the longdesc field.
Note: If you want your students to open the image using a
link, specify the link attributes as described for non-image
files.
5. Click Save.
Your changes are saved. To see your changes, close and then reopen the File View
window.
Display Images in Your Coursework
You can display images in your questions, assignments, or announcements.
Alternatively, see:
• Add Resource Links in Your Coursework on page 295
• Play Media Files in Your Coursework on page 298
November 2014
294 WebAssign Creating Questions Guide
®
Note: Always use the file ID to reference a file uploaded to WebAssign .
®
Using the ID ensures that WebAssign can locate the file even if you
rename or move it.
Best Practice:
• Use one of the following image formats to ensure compatibility with all
Web browsers: PNG, GIF, or JPG.
• Keep the image dimensions smaller than 800 by 600 pixels to ensure
that the image is displayed in the question without scrolling.
To display an image in a question, assignment, or
announcement:
1. Open the question, assignment, or announcement in which you want to
display your image file.
2. Open the My Files window.
From this page:
Do this:
Question Editor
Click My Files in the Page Tools panel.
Assignment Editor Click Include File for either the Description or Instructions.
Communication
Home
Click My Files to the left of your announcement text.
3. Navigate to the file you want to use and select its check box.
You can select more than one file.
4. For Paste location of file (selected below) as, select Image.
5. Set the display text for the image.
To do this
Do this
Use the
existing
display
attributes
In Attributes, select use saved attributes.
Override
the existing
display
attributes
1. In Attributes, select enter new attributes.
2. Type the alternative text you want to be read by screen readers
in both the alt tag and title fields.
Screen readers might read the contents of the alt or title
attributes of an image. To ensure that your content is
accessible, provide the same information in both fields.
3. Optional: Provide a link to a longer description of the content
in the longdesc field.
6. Select where you want your file to be included.
November 2014
Format Questions 295
In a:
Do this:
Question
For Destination Field, select Question, Answer, or Solution.
Note: You can include files or images in Answer
only for multiple-choice, multiple-select, or matching
questions.
Assignment
For Destination Field, select Description or Instructions.
Announcement
For Destination Field, select Announcement.
7. Click go.
For each image to be displayed, a <userimage> tag is added to your content
referencing the image's file ID and specifying any overrides to the display
attributes.
Examples:
<userimage(12345)>
<userimage(23456, alt => "gingko leaf", title => "gingko leaf")>
8. Optional: If needed, cut and paste the <userimage> tag to the location where
your image should be displayed.
9. Optional: Specify other attributes that are valid for the <img> tag in HTML —
for example, align, height, width, or style — in the same way that the alt,
title, and longdesc attributes are specified.
For example, the following code displays the image with a 2-pixel solid gray
border:
<userimage(103854, style => "border: 2px solid gray;")>
Add Resource Links in Your Coursework
You can display links to your resource materials in your questions, assignments, or
announcements.
Alternatively, see:
• Display Images in Your Coursework on page 293
• Play Media Files in Your Coursework on page 298
®
Note: Always use the file ID to reference a file uploaded to WebAssign .
®
Using the ID ensures that WebAssign can locate the file even if you
rename or move it.
To add a link to a file in a question, assignment, or
announcement:
1. Open the question, assignment, or announcement in which you want to add a
link to your file.
2. Open the My Files window.
November 2014
296 WebAssign Creating Questions Guide
From this page:
Do this:
Question Editor
Click My Files in the Page Tools panel.
Assignment Editor Click Include File for either the Description or Instructions.
Communication
Home
Click My Files to the left of your announcement text.
3. Navigate to the file you want to use and select its check box.
You can select more than one file.
4. For Paste location of file (selected below) as, select Link.
5. Set the display text for the file.
To do this
Do this
Use the
existing
display
attributes
In Attributes, select use saved attributes.
Override
the existing
display
attributes
1. In Attributes, select enter new attributes.
2. Type the link text you want to be displayed.
3. Optional: Provide information for the title attribute of the link.
Depending on the browser or screen reader's behavior, this
might be displayed as hover text in the browser or read by
a screen reader, but it also might not be shown or read to
students at all.
6. Select where you want your file to be included.
In a:
Do this:
Question
For Destination Field, select Question, Answer, or Solution.
Note: You can include files or images in Answer
only for multiple-choice, multiple-select, or matching
questions.
Assignment
For Destination Field, select Description or Instructions.
Announcement
For Destination Field, select Announcement.
7. Click go.
For each file to be linked, a <userfile> tag is added to your content
referencing the file ID and specifying any overrides to the display attributes.
Examples:
<userfile(12345)>
<userfile(987654, link => "Syllabus", title => "Syllabus for BIO-201")>
November 2014
Format Questions 297
8. Optional: If needed, cut and paste the <userfile> tag to the location where
your file link should be displayed.
9. Optional: Specify other attributes that are valid for the <a> tag in HTML — for
example, style or target — in the same way that the title attribute is specified.
For example, the following code displays the link in bold and opens the
document in a new browser window or tab:
<userfile(103854, style => "font-weight: bold;", target => "_blank")>
Link to External Resource Materials in Your
Coursework
You can add links in your questions, assignments, or announcements to resource
®
materials hosted outside of WebAssign . For example, you might have materials
hosted on your school's Web servers, or you might want to point your students to
a YouTube video or materials that another colleague has shared with you. To add
links to external resources, use the HTML <a> tag as described in this topic.
You can link to external resources in the following course materials:
Questions
You can add links in the Question, Answer, or Solution.
Note: You can include links in Answer only for multiple-choice, multipleselect, or matching questions.
Assignments
You can add links in the Description or Instructions.
Announcements
You can add links in the body of an announcement.
Tip: You can also add links in the body of other communications in
®
WebAssign such as Private Messages and Ask Your Teacher messages.
To add a link to an external resource in a question,
assignment, or announcement:
1. Open the question, assignment, or announcement in which you want to add
the link.
2. Type the following code where you want to add the link:
<a href="web_address" target="_blank">link_text</a>
where
• web_address is the Web address (often called URL) of the resource
material to which you want to link.
• link_text is the text of the link that you want to show your students.
For example, you could link to one of the student help topics using the
following code:
November 2014
298 WebAssign Creating Questions Guide
<a href="http://www.webassign.net/manual/student_guide/
t_s_answering_multiple_choice.htm"
target="_blank">How to answer multiple-choice questions</a>
This link would behave like this: How to answer multiple-choice questions.
Play Media Files in Your Coursework
You can include media files such as video tutorials or audio clips in your
assignments, questions, or class announcements.
Alternatively, see:
• Display Images in Your Coursework on page 293
• Add Resource Links in Your Coursework on page 295
• Link to External Resource Materials in Your Coursework on page 297
Many formats exist for distributing media on the Internet. This section documents
®
methods that have been tested for use in WebAssign .
®
Other media formats have not been tested with WebAssign and might not work
as expected.
Where to Include Media
Where and how you should include media like videos in your coursework —
questions, assignments, or announcements — depends on the content of the
media and how you want your students to use it.
Linking to Media or Embedding It in WebAssign®
When you use media such as videos, you can usually choose whether to give
®
your students a link to the media or to display the media in WebAssign on the
student’s home page or in an assignment.
Linking to Media
Linking displays a link on the student's page which he or she clicks to open the
media in a new browser window or tab.
On some platforms, students might find it difficult or annoying to switch between
the media and an assignment if the student needs to answer questions based on
the media.
On the other hand, linking does not slow down the loading of pages in
®
WebAssign .
Embedding Media in WebAssign
®
®
Embedding displays the media and its player in WebAssign . The student usually
clicks a play button to start the media, and can watch it in the context of the
course or assignment.
Pages with multiple videos can load slowly, depending on how many videos are
embedded.
November 2014
Format Questions 299
Where to Include Linked or Embedded Media
Media Content
Where to Include It
Notes
Recording of a class lecture
Resources or Announcement
This is especially valuable for
flipped or online classes.
Consider linking to the video.
Instructions for an
assignment
Assignment Instructions
Consider embedding the
video rather than linking to
it.
Learning material that
applies to an entire
assignment
Assignment Instructions
Consider embedding the
video rather than linking to
it.
Short demo that your
students will use to answer
no more than a few
questions
Question (Question box)
Explanation that you want
your students to watch after
attempting a question
Question (Solution box)
Short video about which you
won't be asking questions
directly
Resources or Announcement
Video that your students
need to watch before
completing an assignment,
but which should not be
available to view while
Resources or Announcement
Turn on display of worked
solutions.
Consider using the following
assignment settings:
• Require entire assignment
submission
• Allow only one submission
completing the assignment
• Don't allow students to
save work
• Use LockDown Browser
One of several videos
students should watch while
completing an assignment
Question
Use one question at a time
display for your assignment.
Resources or Announcements
For media that does not need to be displayed as part of an assignment, you
have two choices: you can include the media in a class announcement, or
you can upload it as a class resource. Either way, the media are linked or
®
displayed on your students' home page in WebAssign . However, there are some
implementation differences between the two.
November 2014
300 WebAssign Creating Questions Guide
Resources
Announcements
Media hosting
You must upload the media file to
®
WebAssign .
You can either upload a media file
®
to WebAssign or share media
hosted externally, such as on
YouTube or your school's Web
servers.
Context for
students
Can be organized on the student's
home page by textbook chapter
or section, but you can't add other
information or instructions.
You can add your own information,
description, or instructions
for using the media in the
announcement. You can
change the order of each class'
announcements list as needed.
Difficulty to
implement
After uploading, select a check
box to make media available to
students.
After uploading or obtaining link to
media, create an announcement
and add code to link to or embed
media.
Time-based
availability
You must make resource available
or unavailable manually.
You can schedule when
announcements become available
to your students and when they
become unavailable .
Reuse for
other classes
Can be reused across your classes
over time.
Can be reused across your classes
over time.
Play YouTube, Vimeo, or Other Hosted Videos in Your Coursework
®
The best way to embed video in your WebAssign coursework is to use a video
hosted on your school's Web server or a video sharing service like YouTube or
Vimeo.
Alternatively, see Link to External Resource Materials in Your Coursework on page
297.
Video sharing services like YouTube and Vimeo are free and offer a number of
advantages:
• Existing videos uploaded by other instructors who have made them publicly
available
• Privacy controls that let you manage access to your videos
• Automatic optimization for the device on which it is being viewed, including
mobile devices
If for whatever reason you don't want to use these services, most schools also
provide instructors with Web space for their classes; if you are not sure about this,
ask your school's IT department. Depending on your school, you usually will not
have many of the features offered by video sharing services.
Before starting, upload or locate the video that you want to use.
To add a YouTube video to your question or assignment:
1. Navigate to the video in your Web browser.
November 2014
Format Questions 301
2. Copy the video embedding code.
Video Hosting
YouTube
Steps
1. Click Share.
2. Under the Share link, click Embed.
A box displays the embed code.
3. Copy the entire embedding code.
Vimeo
1.
Click
.
The Share This Video panel displays both the video Link and
Embed code.
2. Copy the entire embedding code.
School or
other web
server
It's unlikely that your school server has a video sharing mechanism
that generates the code for you. However, you can create the code
yourself.
1. Copy the Web address of the video.
2. Use the following code:
<iframe
src="web_address"
width="width"
height="height"
frameborder="0" seamless></iframe>
where web_address is the Web address of the video, and width
and height specify the size of the frame in which the video will
be embedded.
Tip: If you don't know what dimensions to use, start
with width="640" height="360" and adjust as needed
for your video.
3. If the Web address you copied begins with either http: or
https:, remove those characters so the src attribute begins
with //.
Making this change helps ensure that your video won't be
blocked by your students' browser security settings.
3. Open your question, assignment, or announcement for editing.
4. Paste the embedding code where you want the video to be embedded.
5. Save your question, assignment, or announcement.
Note: Embedded videos usually will not play in the Assignment
Previewer or in your view of an announcement. Use the Student View
to verify that your video is displayed correctly for your students.
November 2014
302 WebAssign Creating Questions Guide
Example Assignment with YouTube Video
Assignment 5345850 (Quadratic Equations Example Assignment) includes a
YouTube video explaining how to solve quadratic equations by factoring.
Instructions
Watch the following video and solve the problems by
factoring.<br><br>
<iframe width="640" height="360" src="//www.youtube.com/
embed/MoWkK2nTFxw?rel=0"
frameborder="0" allowfullscreen></iframe>
Display to
students
Example Announcement with Vimeo Video
Announcement Watch the following video before Wednesday's class and try
completing some of your homework problems. Come to class
as edited by
prepared to ask any questions you have.
instructor
<iframe src="//player.vimeo.com/video/87211276" width="500"
height="311" frameborder="0" webkitallowfullscreen
mozallowfullscreen allowfullscreen></iframe>
<p><a href="http://vimeo.com/87211276">Exponential and Log
regression</a>
from <a href="http://vimeo.com/user10440384">Jack Narayan</
a> on <a href="https://vimeo.com">Vimeo</a>.</p>
November 2014
Format Questions 303
Display to
students
Play Adobe® Flash® Videos in Your Coursework
®
®
You can include Adobe Flash videos in your coursework.
®
®
Note: Your students must have or be able to install Adobe Flash Player
®
®
®
in order to view Adobe Flash videos. Flash is not supported for iOS
®
devices like iPad .
To include a Flash® video in a question, assignment, or
announcement:
1. Open the question, assignment, or announcement in which you want to play
your media file.
2. Open the My Files window.
From this page:
Do this:
Question Editor
Click My Files in the Page Tools panel.
Assignment Editor Click Include File for either the Description or Instructions.
Communication
Home
Click My Files to the left of your announcement text.
3. Navigate to the file you want to use and click its file name.
4. Click Show File Info to display additional information about the file.
• File Type: The type of the file, such as image/jpeg.
November 2014
304 WebAssign Creating Questions Guide
®
• Location: The path to the file on the WebAssign servers.
• File ID: The unique ID number assigned to the file.
• Last Modified: The date and time of the last time you changed the file
or file properties.
• Size: The file size.
Click Hide File Info to hide this information.
5. Add the following code to your question, assignment, or announcement.
<object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/
swflash.cab"
width="width" height="height">
<param name="movie" value="location/name" />
<object type="application/x-shockwave-flash"
width="width" height="height" data="location/name">
</object>
</object>
where:
• height and width are the height and width of your video, in pixels.
• location and name are the Location and Name from the File View window.
Note:
• To display videos correctly on all Web browsers that are supported
®
for WebAssign , each of these values is specified twice. Be sure
these values are correct in both places or your content might not
display correctly on some Web browsers.
• Do not rename your video file or move it to another folder. If you
change the location of the video, it will not be displayed in your
question. This is not a problem when using the <userfile> or
<userimage> tags.
• You can include media in a question's Answer only for multiplechoice, multiple-select, or matching questions.
®
6. When testing your content, be sure to view it both in Internet Explorer and in
®
®
either Firefox or Safari .
Example Question with Flash Video
The following table summarizes an actual question.
QID
1545601
Name
Template2 1.MEDIA.01.
Mode
Multiple-Choice
November 2014
Format Questions 305
Question
Watch the following video and then answer the question.<br>
<div style="margin: 10px; width: 680px; border: 1px solid gray;">
<object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/
swflash.cab"
width="680" height="555">
<param name="movie"
value="/userimages/mplopez@webassign/Media/
adding_media_to_questions.swf" />
<object type="application/x-shockwave-flash"
width="680" height="555"
data="/userimages/mplopez@webassign/Media/adding_media_to_questions.swf">
</object>
</object>
</div>
What tag do you use to add video to a question? <br>
<_>
Answer
object
userfile
userimage
Display to
Students
November 2014
306 WebAssign Creating Questions Guide
Best Practices for Using Media in WebAssign®
These recommendations can help you when using media such as videos in your
®
WebAssign coursework.
• Keep media files as brief as possible.
Except for recorded lectures, most videos should ideally run 3 minutes or less
in order to keep your students' attention. Consider editing longer materials
into multiple shorter segments.
• Keep video size or resolution no greater than is needed.
Although you want to ensure that your students can clearly see the subject
matter, higher resolutions generally result in larger videos that download
more slowly. If you need to use a high-definition video, consider linking to it
instead of embedding it.
• Don't include videos or media in the assignment description, but only the
instructions.
Embedded media in the assignment description is shown on the student's My
Assignments page. This is rarely useful, and can cause the My Assignments
page to load slowly.
• Don't show more than one video on the page at a time.
When using video or audio clips in your questions, change your assignment
settings to show only one question at a time.
Embed at most one video in each question, announcement, or assignment
instructions. If more than one video is needed, consider creating multiple
questions, announcements, or assignments.
• Be aware that when you share media with your students, they might be able
to share it again with their peers.
Update Your Files
®
You can replace any of your files in WebAssign with a new version.
To replace an image, media, or document file from the My
Folders page:
1.
In the toolbar, click
Folders.
Alternatively, open the My Files window when editing an assignment, question,
or announcement.
From this page:
Do this:
Question Editor
Click My Files in the Page Tools panel.
Assignment Editor Click Include File for either the Description or Instructions.
Communication
Home
Click My Files to the left of your announcement text.
2. Navigate to the file or image you want to change.
November 2014
Format Questions 307
3. Click the file name.
The File View window opens.
4. In the Replace File field, select another file to replace the one that is
currently displayed.
a) Click Browse or Choose File, depending on your browser.
b) Navigate to the file you want to upload.
c) Click Open or Choose, depending on your browser.
5. Click Save.
Your existing file is replaced with the new file you uploaded.
• Any references to your file now use the new file. This includes both current
and past classes and assignments.
• If your new file has a different name than your old file, the new filename is
used.
Rename a Folder, Assignment, Question, or File
®
You can rename a folder, assignment, question, or file in WebAssign .
Renaming an item does not affect links or references to the item because those
references are based on the item's unique ID number, which does not change.
To rename a folder, assignment, question, or file from the
My Folders page:
1.
In the toolbar, click
Folders.
Alternatively, open the My Files window when editing an assignment, question,
or announcement.
November 2014
308 WebAssign Creating Questions Guide
From this page:
Do this:
Question Editor
Click My Files in the Page Tools panel.
Assignment Editor Click Include File for either the Description or Instructions.
Communication
Home
Click My Files to the left of your announcement text.
2. Navigate to the item you want to rename and select its check box.
Note: You can rename one item at a time only.
3. In the Modify Selected Items list, select Rename.
4. Type the new name for the item and click OK.
Important: Do not include the forward slash (/) or backslash (\)
characters in folder or file names.
These characters are interpreted as part of the item's location and can
prevent you from opening the item. You can use a space or underscore
if needed.
Your item is renamed. Any references to it now use the new name. This includes
both current and past classes and assignments.
Add Symbols to Questions
®
You can use the WebAssign <s> tag to add a number of symbols to your
questions. Some symbols are displayed as characters, and others are displayed as
images.
See www.webassign.net/manual/instructor_guide/c_i_list_symbols.htm for lists of
symbols that you can add to your questions.
Add Search Metadata to Questions
If you make your questions publicly available, you might want to add search
metadata to your questions that indicate the covered subject matter or discipline.
You might also want to indicate whether the question is still being edited or
provide a comment about the question.
To add search metadata to a question:
1. If needed, click Show Additional Information in the Question Editor.
2. Under Additional Information, specify any of the following information:
November 2014
Field
Description
Keywords
A comma-delimited list of keywords describing the question.
Format Questions 309
Field
Description
Classification
For math, physics, and chemistry questions, one or more topics in
the discipline that relate to the question.
Adding a classification includes your question in the collections
listed in the Question Browser for any instructors who can find
the question in search results. See Share Questions With Other
Instructors on page 19.
Usable/Draft
Whether the question is ready to be included in assignments
(Usable) or is still being edited (Draft). This does not prevent the
question from being included in an assignment.
Comment
Any information about the question.
Discipline
One or more disciplines to which the question applies.
3. Click Save to apply your changes.
Add Standard Text Prompts to Questions
®
You can use the special WebAssign prompt <p> tag to add a number of commonly
used text prompts to your questions.
See Also:
List of Prompts on page 361
Create Integer or Decimal Number Questions on page 95
November 2014
310 WebAssign Creating Questions Guide
November 2014
9
Question Behavior
This chapter contains the
following topics:
You can configure many aspects of your question's behavior in
WebAssign®.
• Perl Variables and Functions
• The {tab} Operator
• Randomize Question Values
• Numeric Values in Questions
• Add Item-Specific Feedback to
Multiple-Choice Questions
• Perform Complex Operations in
Answer Keys
November 2014
312 WebAssign Creating Questions Guide
Perl Variables and Functions
®
Most question behaviors in WebAssign are controlled by variables or functions
in Perl, a programming language. You do not need to learn Perl to write good
®
questions in WebAssign using the documentation and examples. But, knowing
®
some basics about Perl and how it is implemented in WebAssign questions
lets you create more sophisticated questions that use randomized values,
provide meaningful feedback based on your student's answers, or grade answers
automatically in novel ways.
See Also:
Perl Functions and Operators on page 371
Perl Variables on page 379
Perl documentation at perldoc.perl.org
Include Perl in Questions
You can use the <eqn> and <EQN> tags to include one or more Perl statements
in your questions. The value of the last Perl statement in the <eqn> or <EQN>
tag is returned by the tag when the question is used.
Understanding the <eqn> and <EQN> Tags
®
The <eqn> and <EQN> tags are WebAssign tags that let you put Perl statements
in your questions. Most often, these statements are used to set or read the values
of variables in order to make the question behave in a certain way.
For example, to change the size of the answer box for numerical or fill-in-theblank questions, you would add this code to Answer:
<EQN $size=5; ''>
This code consists of three parts:
®
1. The <EQN> tag itself, which tells WebAssign that the enclosed values
should be processed as Perl statements.
2. The first Perl statement, $size=5; which assigns the value 5 to the
®
WebAssign variable $size, which is used to specify how wide the answer box
should be.
3. The second Perl statement, '' which is an empty string. Because the result
of the last Perl statement is always included in your question, answer key,
or solution (depending on where the code occurs), the empty string is often
used as the last statement.
Both the <eqn> and <EQN> tags include Perl statements, but they display
values differently depending on whether they are used in Question, Answer, or
Solution.
Intended Use
November 2014
<eqn>
<EQN>
Use in Question and Solution.
Use in Answer.
Question Behavior 313
<eqn>
<EQN>
A circle of radius <eqn
A circle of radius <EQN
$r=randnum(3,7,1)> has area <eqn
$r=randnum(3,7,1)> has area <EQN
$a=$pi * $r**2>.
$a=$pi * $r**2>.
Display in
Question and
Solution
A circle of radius 5 has area
78.5398163397448.
A circle of radius 5 has area
78.5398163397448.
Behavior in
Question and
Solution
• Displays values in red.
• Displays values in black.
• Displays numeric values up to 15
significant digits.
• Displays numeric values up to 15
significant digits.
Display in
Answer
A circle of radius 5 has area 78.5.
A circle of radius 5 has area
78.5398163397448.
Behavior in
Answer
• Displays values in black.
• Displays values in black.
• Answer key uses 15 significant
digits for evaluation with student
answers.
• Answer key uses 15 significant
digits for evaluation with student
answers.
• In numerical mode, displays
the number of significant digits
specified by the answer key.
• In numerical mode, displays
the number of significant digits
specified by the answer key.
• If the answer key does not
specify significant digits, displays
3 significant digits.
• If the answer key does not
specify significant digits, displays
up to 15 significant digits.
Example code
Paired and Unpaired Forms
Both the <eqn> and <EQN> tags can be used in paired and unpaired forms.
• The unpaired form consists of a single tag and is used most frequently to
display values or in Answer. It has the following syntax (using either eqn or
EQN):
<EQN perl_statement; perl_statement>
• The paired form consists of an opening tag and a closing tag and is usually
used to include longer blocks of Perl statements. It has the following syntax
(using either eqn or EQN):
<eqn>
perl_statement;
perl_statement
</eqn>
Note: If your Perl statements include the greater-than character (>),
you must use the paired form.
To include Perl statements in your question:
1. If needed, open your question in the Question Editor.
2. Start the <eqn> or <EQN> tag.
You can use either the paired or unpaired form, as described above.
November 2014
314 WebAssign Creating Questions Guide
Best Practice:
• In Question or Solution, use <eqn>.
• In Answer, use <EQN>.
3. Type the Perl statements that you want to perform.
Note:
®
• To ensure the security of the WebAssign service, some Perl
functions are not supported.
®
• The Perl newline character (\n) does not work in WebAssign .
Instead, include the HTML <br> tag where you need a line break.
You must use the paired form of the <eqn> or <EQN> tag.
End each Perl statement except for the last one with a semicolon (;). The
value returned by the last statement is displayed as part of your question or
answer key.
Tip: Use two single quotes ('') as your last Perl statement if you do not
want any value displayed by your code.
4. End the </eqn> or </EQN> tag.
• When using paired tags, the ending tag must match the start tag. You
cannot, for example, start with <eqn> and end with </EQN>.
• When using the unpaired form, do not add a slash at the end of the tag
as with XML tags. Just use the closing angle bracket (>).
Example Multiple-Choice Question Using <eqn> and <EQN>
The following table summarizes an actual question.
QID
Name
Mode
Multiple-Choice
Question
<eqn>
$weight = randnum(40,150,1);
# pick a random integer between 40
and 150
$venuswt = decform($weight * 0.907, 0);
# calculate weight on Venus
$marswt = decform($weight * 0.377, 0);
# calculate weight on Mars
$jupiterwt = decform($weight * 2.364, 0);
# calculate weight on Jupiter
''
</eqn>
If you weighed <eqn $weight> kg on Earth:<br>
<ul>
<li>Your weight on Venus would be <eqn $venuswt> kg</li>
<li>Your weight on Mars would be <eqn $marswt> kg</li>
<li>Your weight on Jupiter would be <eqn $jupiterwt> kg</li>
</ul>
On which planet would your mass be the least? <_>
November 2014
Question Behavior 315
Answer
<EQN $ORDERED=5; 'Earth'>
Venus
Mars
Jupiter
Your mass would be the same
Display to
Students
See Also:
Perl Functions and Operators on page 371
Perl Variables on page 379
Perl documentation at perldoc.perl.org
Set Perl Variables
Often, you only need to use a variable to store a single text or numeric value.
Such variables are referred to as scalar variables in Perl.
Note: Whether the variable contains a text or numeric value does not
matter to Perl; the variable is evaluated as either a text string or a number
based on what you are trying to do. If you try to perform a numeric
operation on a text string, Perl will look for any digits at the beginning of
the text and use that value, or if no digits are found, 0. If you perform a
text operation on a number, Perl will treat the number as a text string.
Scalar Variable Names
Perl scalar variables are prefixed by the dollar sign ($) character. In addition, all
Perl variable names must follow these rules:
• Variable names must contain only letters (a-z, A-Z), underscores (_), and
numeric digits (0-9).
• The first character of a variable name must be a letter (a-z, A-Z) or
underscore (_).
• Variable names are case-sensitive, so myvariable is not the same as
MyVariable.
®
Some variable names are used by WebAssign . These variables are listed in the
documentation.
November 2014
316 WebAssign Creating Questions Guide
To set the value of a Perl variable:
In an <EQN> or <eqn> tag, include an assignment statement like the
following:
$variable = value;
where variable is the variable name and value is the value to be assigned. The
value can be either a single value or a Perl expression that results in a value.
Examples
The following example variable assignment statements should be inside an
<EQN> or <eqn> tag.
# set $radius equal to 5
$radius = 5;
# calculate the $diameter
$diameter = $radius * 2;
# use the predefined variable $pi
$circumference = $diameter * $pi;
# use ** for exponentiation
$area = $pi * $radius ** 2;
# use quotes to enclose a text value
$message1 = 'The radius is ';
# concatenate strings as text with the period (.)
$message2 = $message1 . $radius;
# in double quotes, the value of a variable is substituted
$message3 = "The diameter is $diameter.";
See Also:
Perl Functions and Operators on page 371
Perl Variables on page 379
Perl documentation at perldoc.perl.org
Test Perl Variables
You can test the values of Perl variables and perform different actions based on
the result. This lets you add sophisticated functionality to your questions like
custom feedback or grading functions.
The if Statement
Perl includes several ways to test variables and perform different actions based on
the result, but the most fundamental of these methods is the if statement, which
has the following syntax:
if (condition)
{do_if_true}
elsif (condition)
{do_if_true}
else
{do_if_false}
November 2014
Question Behavior 317
where:
• condition is a testable condition, such as $a > 3
• do_if_true is one or more statements to be performed if the tested condition
is true
• do_if_false is one or more statements to be performed if all tested conditions
are false
The elsif and else clauses are optional.
Use elsif to test additional conditions; statements will be performed only for the
first true condition, not for every true condition.
Use else to specify statements to be performed only if none of the tested
conditions are true.
Tip: You can also use the following abbreviated syntax for an if statement:
(condition) ? do_if_true : do_if_false
Comparison Operators
You can use the following comparison operators when testing values in your
questions. You use different operators depending on whether you want to compare
values numerically or textually.
Comparison
Numerical
Operator
Example
Text
Operator
Example
Equality (=)
==
$a == 3
eq
$a eq 'red'
Inequality (≠)
!=
$a != 3
ne
$a ne 'red'
Greater Than (>)
>
$a > 3
gt
$a gt 'red'
Less Than (<)
<
$a < 3
lt
$a lt 'red'
Greater Than or Equal To
(≥)
>=
$a >= 3
ge
$a ge 'red'
Less Than or Equal To (≤)
<=
$a <= 3
le
$a le 'red'
Note: A single equals sign (=) is the assignment operator. If you
substitute it for the double equals sign (==) in a test condition, the
condition will not work correctly and depending on your code, the tested
variable might be assigned a new value.
You can use logical and, or, and not operators to combine or negate test criteria as
shown in the following table.
Logic
Operator
Example
And
&&
$a == 3 && $b eq 'red'
Or
||
$a == 3 || $b eq 'red'
Not
!
!($a == 3 || $b eq 'red')
November 2014
318 WebAssign Creating Questions Guide
To perform an action based on the value of a variable:
In an <EQN> or <eqn> tag, include an if statement that tests a condition and
performs one or more actions.
Examples
The following examples should be inside an <EQN> or <eqn> tag.
# if $x is greater than 5, make it equal to 5
if ($x > 5) {$x = 5};
# if $x is greater than 5, make y = 10; otherwise, make y = x squared
if ($x > 5) {$y = 10} else {$y = x**2};
if ($x == 5)
{
$a = 10;
$b = 2;
}
elsif ($x == 4)
{
$a = 8;
$b = 2;
}
else
{
$a = 0;
$b = 0;
}
# test whether $x = 5
# if so, set $a = 10
# and $b = 2
# if $x ≠ 5, test if $x = 4
# if so, set $a = 8
# and $b = 2
# if $x ≠ 5 and $x ≠ 4
# set $a = 0
# and $b = 0
# if $x equals "lion," make $y equal to "cat"
($x eq 'lion') ? {$y = 'cat'};
Example Multiple-Choice Question With Two Correct Answer
Choices
The following table summarizes an actual question.
QID
Name
November 2014
Mode
Multiple-Choice
Question
Which is a characteristic of jellyfish? <_>
Answer
<EQN $ORDERED=1; if ($thisanswer==2) {$ORDERED=3}; ''>Sexual
reproduction
Exoskeleton
Asexual reproduction
Respiratory system
Question Behavior 319
Display to
Students
Note: In this example, both $thisanswer==2 and $ORDERED=3 refer to the
®
third choice in the list. This is because the WebAssign variables $ORDERED
and $thisanswer are indexed differently. While $ORDERED starts at 1 for the
first item, $thisanswer starts at 0.
See Also:
Perl Functions and Operators on page 371
Perl Variables on page 379
Perl documentation at perldoc.perl.org
Use Perl Array Variables
Perl arrays let you use tabular data or iterate over a list of values, for example,
a set of data points for a question. In addition, the Question Editor supports a
special array called @dat.
Perl array variables are prefixed by the at sign (@). In addition, all Perl variable
names must follow these rules:
• Variable names must contain only letters (a-z, A-Z), underscores (_), and
numeric digits (0-9).
• The first character of a variable name must be a letter (a-z, A-Z) or
underscore (_).
• Variable names are case-sensitive, so myvariable is not the same as
MyVariable.
®
Some variable names are used by WebAssign . These variables are listed in the
documentation.
One-Dimensional Arrays
One-dimensional arrays are like grocery lists. For example:
wine
cheese
bread
In Perl, you enclose the list in parentheses and separate individual list items with
commas. For example:
@groceries = ('wine', 'cheese', 'bread');
To refer to a single element in the array, specify the array variable as a scalar with
an index indicating which element you are referring to. The index starts with 0
and follows the variable name in brackets. For example:
The second item on my grocery list is <eqn $groceries[1]>.
November 2014
320 WebAssign Creating Questions Guide
You can mix numeric and text data in an array.
Tip: To specify a sequential range of integers, you can list the first value,
two periods, and the last value. For example:
@one_to_ten = (1..10);
Two-Dimensional Arrays
Two-dimensional arrays let you work with tabular data. For example:
Mercury
0.39
Venus
0.72
Earth
1
Mars
1.52
Jupiter
5.20
Saturn
9.54
Uranus
19.18
Neptune
30.06
In Perl, you enclose the entire table in parentheses, enclose each row in brackets,
and separate both rows and table cells with commas. For example:
@dat = ( ['Mercury'
['Venus'
['Earth'
['Mars'
['Jupiter'
['Saturn'
['Uranus'
['Neptune'
,
,
,
,
,
,
,
,
0.39 ],
0.72 ],
1
],
1.52 ],
5.20 ],
9.54 ],
19.18],
30.06] );
Note: Technically, two-dimensional arrays in Perl are arrays of arrays.
Each "row" is itself a reference to the anonymous array in brackets.
To refer to an element in a two-dimensional array, specify the array variable
as a scalar with two indexes indicating the row and column of the element you
are referring to. The index values start with 0 and follow the variable name in
brackets. For example:
The average distance from the Sun to <eqn $dat[4][0]> is <eqn $dat[4][1]>
AU.
The @dat Array
®
WebAssign provides support for viewing one- and two-dimensional array values
in the Question Previewer when you use an array named @dat. If your question
contains the @dat array, the Question Previewer displays an additional tab named
Array, which displays the contents of the array in addition to the question code
and a preview of your question.
November 2014
Question Behavior 321
Note: The letters in the row headings are not meaningful index values for
the elements in @dat. Use numeric index values for both axes.
For example, in the array shown above, $dat[2][0] is "Earth" but $dat[C]
[0] would be parsed as $dat[0][0] and return "Mercury."
In all other respects, the @dat array is a normal array and can contain whatever
values you want.
To use an array in your question:
1. In an <EQN> or <eqn> tag, set the values for elements of the array using
assignment statements like the following examples.
@planets = ('Mercury', 'Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn',
'Uranus', 'Neptune');
@mean_au = (0.39, 0.72, 1, 1.52, 5.20, 9.54, 19.18, 30.06);
@dat = ( ['Mercury' , 0.39 ],
['Venus'
, 0.72 ],
['Earth'
, 1
],
['Mars'
, 1.52 ],
['Jupiter' , 5.20 ],
['Saturn' , 9.54 ],
['Uranus' , 19.18],
['Neptune' , 30.06] );
$dwarf_planets[0] = 'Pluto';
$dwarf_planets[1] = 'Eris';
Best Practice: Initialize arrays and other variables at the very
beginning of Question.
November 2014
322 WebAssign Creating Questions Guide
2. In an <EQN> or <eqn> tag, reference specific array element values by
specifying the array variable as a scalar with an index indicating which
element you are referring to, as in the following examples.
$thisplanet = $planets[7];
$thismean_au = $mean_au[7];
$firstplanet = $dat[0][0];
$firstorbit = $dat[0][1];
#
#
#
#
sets
sets
sets
sets
$thisplanet = Neptune
$thismean_au = 30.06
$firstplanet = Mercury
$firstorbit = 0.39
Example Question Using Array to Define Possible Answers
The following table summarizes an actual question.
QID
Name
Mode
Fill-in-the-Blank
Question
<eqn>
@dat= ('John Lennon', 'Paul McCartney', 'George Harrison',
'Ringo Starr');
''
</eqn>
Name one of the Beatles: <_>
Answer
<EQN join("\t",@dat)>
Display to
Students
Example Question Using Array and Randomization
The following table summarizes an actual question.
November 2014
QID
1950001
Name
Template2 RAND.ARRAY
Mode
Multiple-Choice
Question Behavior 323
Question
<eqn>
# weight in Newtons
$weight = randnum(495,940,1);
# calculate weight on
@dat = ( ['Mercury' ,
['Venus'
,
['Mars'
,
['Jupiter' ,
['Saturn' ,
['Uranus' ,
['Neptune' ,
other planets
decform($weight
decform($weight
decform($weight
decform($weight
decform($weight
decform($weight
decform($weight
*
*
*
*
*
*
*
0.348,
0.907,
0.377,
2.364,
1.064,
0.889,
1.125,
0)
0)
0)
0)
0)
0)
0)
],
],
],
],
],
],
] );
# pick three indices for @dat
@selected = pick(3, 0..$#dat);
''
</eqn>
If you weighed <eqn $weight> N on Earth:<br>
<ul>
<li>Your weight on <eqn $dat[$selected[0]][0]> would be <eqn
$dat[$selected[0]][1]> N</li>
<li>Your weight on <eqn $dat[$selected[1]][0]> would be <eqn
$dat[$selected[1]][1]> N</li>
<li>Your weight on <eqn $dat[$selected[2]][0]> would be <eqn
$dat[$selected[2]][1]> N</li>
</ul>
On which planet would your mass be the least? <_>
Answer
<EQN
<EQN
<EQN
<EQN
Your
$ORDERED=5; 'Earth'>
$dat[$selected[0]][0]>
$dat[$selected[1]][0]>
$dat[$selected[2]][0]>
mass would be the same
Display to
Students
See Also:
Perform Complex Operations in Answer Keys on page 347
join at perldoc.perl.org/functions/join.html
The {tab} Operator on page 329
November 2014
324 WebAssign Creating Questions Guide
Use Perl Hash Variables
Perl hashes are special kinds of arrays consisting of named key/value pairs. You
can return a value by specifying the corresponding key.
Perl hash variables are prefixed by the percent sign (%) character. In addition, all
Perl variable names must follow these rules:
• Variable names must contain only letters (a-z, A-Z), underscores (_), and
numeric digits (0-9).
• The first character of a variable name must be a letter (a-z, A-Z) or
underscore (_).
• Variable names are case-sensitive, so myvariable is not the same as
MyVariable.
®
Some variable names are used by WebAssign . These variables are listed in the
documentation.
Hashes
Hashes are like a lookup table with a key column and a value column. Instead of
specifying a numeric index, you use the key as an index to find the corresponding
value.
Key
Value
Mercury
0.39
Venus
0.72
Earth
1
Mars
1.52
Jupiter
5.20
Saturn
9.54
Uranus
19.18
Neptune
30.06
In Perl, you enclose the entire table in parentheses, separate rows with commas,
and use the => operator between the key and the value. For example:
%planets = ( 'Mercury'
'Venus'
'Earth'
'Mars'
'Jupiter'
'Saturn'
'Uranus'
'Neptune'
=>
=>
=>
=>
=>
=>
=>
=>
0.39 ,
0.72 ,
1
,
1.52 ,
5.20 ,
9.54 ,
19.18,
30.06 );
Best Practice: Initialize hashes and other variables at the very beginning
of Question.
You can add a single key/value pair to your hash by specifying the hash variable
as a scalar followed by the key name in braces. For example:
$planets{'Neptune'} = 30.06;
November 2014
Question Behavior 325
Note: Because this is a simple assignment statement, you use = and not
=>.
To look up a value in a hash variable, you also specify the hash variable as a
scalar followed by the key name in braces. For example:
The average orbital distance of Venus is <eqn $planets{'Venus'}> AU.
To use a hash in your question:
1. In an <EQN> or <eqn> tag, set the keys and values for the hash as in the
following examples.
%elements = ( 'H' => 'Hydrogen',
'He' => 'Helium',
'Li' => 'Lithium',
'Be' => 'Beryllium',
'B' => 'Boron',
'C' => 'Carbon',
'N' => 'Nitrogen',
'O' => 'Oxygen',
'F' => 'Fluorine',
'Ne' => 'Neon' );
$elements{'Na'} = 'Sodium';
%oxygen = ( 'symbol' => 'O',
'number' => 8,
'weight' => 15.9994,
'econfig' => '1s<sup>2</sup> 2s<sup>2</sup> 2p<sup>4</sup>
');
Best Practice: Initialize arrays and other variables at the very
beginning of Question.
2. In an <EQN> or <eqn> tag, look up hash values by specifying the hash
variable as a scalar followed by the key name in braces, as in the following
examples.
$element_name = $elements{'He'};
# sets $element_name = Helium
if ($this_weight == $oxygen{'weight'}) {$my_element = 'Oxygen'};
# compares $this_weight and 15.9994
Example Question Using Hash Variables
The following table summarizes an actual question.
QID
Name
Mode
Fill-in-the-Blank
November 2014
326 WebAssign Creating Questions Guide
Question
<eqn>
$keyA = "He\tNe\tAr\tKr\tXe\tRn"; # \t creates a {tab} in the answer key.
$keyB = $keyA;
%names =
( 'He' => 'Helium',
'Ne' => 'Neon',
'Ar' => 'Argon',
'Kr' => 'Krypton',
'Xe' => 'Xenon',
'Rn' => 'Radon');
%numbers = ( 'He' => 2,
'Ne' => 10,
'Ar' => 18,
'Kr' => 36,
'Xe' => 54,
'Rn' => 86);
%econfig = ( 'He' => '1s^{2}',
'Ne' => '1s^{2} 2s^{2} 2p^{6}',
'Ar' => '[Ne] 3s^{2} 3p^{6}',
'Kr' => '[Ar] 3d^{10} 4s^{2} 4p^{6}',
'Xe' => '[Kr] 5s^{2} 4d^{10} 5p^{6}',
'Rn' => '[Xe] 4f^{14} 5d^{10} 6s^{2} 6p^{6}');
''
</eqn>
Provide the following information for any two of the six naturally-occurring
noble gases:<br><br>
<table border=1 rules="all">
<thead style="background-color: #9DC2DF;">
<tr><td>Symbol</td><td>Name</td><td>Atomic Number</td><td>Electron
Configuration</td><tr>
</thead>
<tbody>
<tr style="vertical-align: top;"><td><_></td><td><_></td><td><_></td><td><_></
td></tr>
<tr style="vertical-align: top;"><td><_></td><td><_></td><td><_></td><td><_></
td></tr>
</tbody>
</table>
Answer
<EQN
<EQN
<EQN
<EQN
<EQN
<EQN
<EQN
<EQN
Display to
Students
November 2014
$CASE=1; $A=$thisresponse; $keyA>
$names{$A}>
$numbers{$A}>
$PAD='chem'; $CHEM='econf,either'; $econfig{$A}>
$CASE=1; $B=$thisresponse; $keyB =~ s/($A)//; $keyB>
($A eq $B) ? '' : $names{$B}>
($A eq $B) ? '' : $numbers{$B}>
$PAD='chem'; $CHEM='econf,either'; ($A eq $B) ? '' : $econfig{$B}>
Question Behavior 327
See Also:
The {tab} Operator on page 329
Write Perl Functions
You can create your own functions in order to perform complex operations in
answer keys, to perform the same steps or calculations multiple times in a
question, or to perform the same steps or calculations in multiple questions.
To create your own Perl functions, you use the sub keyword. Your function will
have a name and might accept parameters or return one or more values. After
creating your function, you can use it by referencing the function name and
optionally passing one or more parameters, just like any of the predefined Perl
functions. For example:
$myvalue = myfunction(parameter, parameter);
Function names must follow the same rules used for variable names:
• Function names must contain only letters (a-z, A-Z), underscores (_), and
numeric digits (0-9).
• The first character of a function name must be a letter (a-z, A-Z) or
underscore (_).
• Function names are case-sensitive, so myfunction is not the same as
MyFunction.
To write and call a Perl function:
1. In Question, write your function in an <eqn> tag using syntax like the
following:
sub function_name {
my ($parameter_name, $parameter_name ...) = @_;
function_statements
return value;
}
where
• function_name is the name of your function.
• parameter_name is the variable name of any parameter that is passed to
the function.
List the parameters in the order in which they will be passed to the
function. For example, if your function receives x and y coordinates in
that order, you would specify my ($xvalue, $yvalue) = @_; .
Note: The special array @_ always contains all the values that are
passed to a function, but otherwise behaves like any other array.
For example, $_[2] contains the third parameter passed to the
function.
November 2014
328 WebAssign Creating Questions Guide
Best Practice: Precede any variable assignments in the function
with the keyword my, for example, my $a = 7;. This identifies
the variable as private to the function, meaning that the variable
exists only within the scope of the function and does not affect a
variable with the same name outside of the function.
• function_statements are the statements in the body of the function that
determine what actions are performed by the function.
• value is one or more values that are returned by the function.
For example, the following function calculates the area of an ellipse, given
radii of r1 and r2:
sub ellipse_area {
my ($r1, $r2) = @_;
my $area = $r1 * $r2 * $pi;
return $area;
}
2. In Question, Answer, or Solution, call the function in an <EQN> or <eqn>
tag using syntax like the following:
$variable = function_name(parameter_value, parameter_value ...)
where
• variable is the name of the variable that should get the value returned by
your function. To receive multiple values, you can specify an array or a
list of variables.
• function_name is the name of your function.
• parameter_value is the value of any parameter that is passed to the
function.
For example, the following statement calls the ellipse_area function shown
above, passes two radius values to the function, and assigns a value to $key:
$key = ellipse_area(4,5);
Note: If your function does not return a value, you do not need to
assign it to a variable to call it. Instead, simply use the function name
and any required parameters.
Example Question With Function
The following table summarizes an actual question.
QID
Name
Mode
November 2014
Numerical
Question Behavior 329
Question
<eqn>
sub orbital_period {
my ($a) = @_;
my $period = decform($a**(3/2),0);
return $period;
}
@a = (randnum(320,990,1)/10, randnum(320,990,1)/10,
randnum(320,990,1)/10);
''
</eqn>
Use Kepler's Third Law to estimate the periods of hypothetical
minor planets with the following semimajor axes:<br><br>
<eqn $a[0]> AU: <_> years<br>
<eqn $a[1]> AU: <_> years<br>
<eqn $a[2]> AU: <_> years
Answer
<EQN orbital_period($a[0])>
<EQN orbital_period($a[1])>
<EQN orbital_period($a[2])>
Display to
Students
See Also:
Perl Functions and Operators on page 371
Perl Variables on page 379
Perl documentation at perldoc.perl.org
Perform Complex Operations in Answer Keys on page 347
perlsub at perldoc.perl.org/functions/join.html
The {tab} Operator
Several question types use the {tab} operator to specify answer key behaviors.
Behaviors
The {tab} operator is used in Answer to define answer key behaviors for several
question types.
Question Type
Behavior
Algebraic (includes
mathPad, calcPad, and
physPad questions using
Algebraic grading)
Separates the answer key from the grading statement used
to compare the student's answer with the key.
Fill-in-the-Blank,
chemPad, MarvinSketch,
Image Map
Separates multiple acceptable answers in the answer key.
November 2014
330 WebAssign Creating Questions Guide
Question Type
Behavior
Matching
Separates the first-column entry from the matching secondcolumn entry.
Numerical
Separates the answer key from an optional numerical
tolerance for the question part.
Adding the {tab} Operator
To add the {tab} operator, either type the characters {tab} or click Add tab.You
cannot enter {tab} by pressing the TAB key. You can also abbreviate {tab} as {}.
Note: You cannot enter {tab} by pressing the TAB key.
Representing the {tab} Operator in Perl Strings Used in
Answer
From time to time, you might want to include the {tab} operator in a Perl string —
usually defined in Question — that you will use in Answer to specify an answer
key. This is usually the case for Fill-in-the-Blank questions for which the number
of alternative answers might vary.
Inserting the characters {tab} in a Perl string will not add the {tab} operator when
the string is used in Answer. Instead, you must use one of two approaches:
• Specify the {tab} operator literally in Answer. You can define multiple
variables for the alternative answer keys and separate them with literal {tab}
operators. Any null answer keys are ignored.
• Specify the {tab} operator using the characters \t in a double-quoted Perl
string that is used in Answer.
Note: This method might not work for chemPad or MarvinSketch
questions.
See Also:
Change Tolerance for Numerical Questions on page 100
Create Fill-in-the-Blank Questions on page 42
Create Image Map Questions on page 52
Create Matching Questions on page 34
Create mathPad Questions Using Algebraic Mode with Mathematica on page 157
Randomize Question Values
®
Your questions in WebAssign can use randomly-selected values. The simplest use
of this is a math question that uses different numbers for different students, but
you can also show different chemical equations, text, images, or other information
appropriate to the question.
When you randomize values in your questions, those values are assigned to Perl
variables that can then be used in Question, Answer, or Solution.
November 2014
Question Behavior 331
Some of the advantages of using randomized values in your questions include the
following:
To deter cheating
Depending on the randomization settings you choose for the assignment, your
question can use different randomized values for each student or for each class.
This makes it difficult for students to crib answers from each other.
To reuse questions
You can use the same question on an exam that you used for a previous
homework assignment. The concept you are testing remains the same; only the
values your students use to solve the problem are different.
To allow students to practice another version
You can enable the Practice Another Version feature for your assignments, but
students can only use the feature for questions that use randomized values.
To help your students learn by providing another version after a
specified number of attempts
Your assignment can require a new randomization after a specified number of
attempts. This lets your student see the answer to a question that he was unable
to answer correctly, figure out how the problem should be worked, and then
answer the problem for credit using a different set of values.
Although they are enabled in your assignment settings, all of these behaviors
work only for questions that use some method to randomize question values.
See Also:
Perl Variables and Functions on page 312
Randomization Best Practices
Adding randomized values to questions is relatively easy. Adding good
randomizations to questions requires more effort.
Keep It Simple
Consider what you are trying to accomplish when randomizing values in a
question, and whether adding more complexity — by randomizing more variables,
or by allowing a wider range of randomized values — is the best solution.
To deter cheating, it is not necessary that every student in your class have
completely different assignments, only that there be sufficient variation to make it
unproductive for any two students who want to share answers to do so. If a given
question has two variables, it's usually necessary only to use five or six possible
values for each variable to deter cheating.
For example, in a class of 100 students, a question with two variables that each
have five possible values will have 25 variants, meaning that on average, only four
students in the class have the same version of the question.
Avoid randomizing interdependent values in the question. Instead, randomize
one or two base values and calculate other values based on your randomized
values. This simplifies your work when testing the question to ensure that
all randomizations are solvable. When your question is displayed, both the
November 2014
332 WebAssign Creating Questions Guide
randomized and calculated values are shown in red so your students do not know
which values were randomized and which were calculated.
Sometimes, rather than increasing the complexity of a question's randomization,
it is more productive to create several similar questions that are essentially
the same but differ in their surface features — for example, a bomb dropped
from a moving plane or a cannonball shot from a moving ship. Your alternative
questions can vary the randomized values that are used, and if appropriate, also
use different units or significant figures. You can either create a pool of these
questions on your assignment, or use these questions for additional non-credit
practice with the <PRACTICE> tag.
Keeping your questions simple makes them easier to test and makes it less likely
that your students will have problems with them.
Keep It Real
Make sure all of the possible values your randomizations are reasonable, are
possible, make sense, and result in a solvable problem.
• Ensure that all possible values in your question result in an answerable
question, and do not result in answers that cannot be entered.
• Watch out for measurements that are impossible or could not be measured,
for example, negative diameters or masses that are orders of magnitude
smaller than the mass of an electron.
• Do not randomize known constants like the speed of light.
• Be careful that your values do not result in division by zero or similar
problems.
• When creating problems with fractions, ensure that the numerators and
denominators are integers and not decimals.
• Ensure that the variations of your numeric values do not cross orders of
magnitude or change the expected number of significant figures in the
answer.
• Avoid “edge case” values that require a judgement call, for example, whether
a pH of 6.9 is neutral or acidic.
• Ensure that the values you select in your question do not change the number
of correct answers, or code your question in such a way as to accommodate
this.
Frequently, it might make sense to pick tested values from a list instead of
selecting them from a numeric range.
Think Like a Student
Try to see your question from a student's perspective, and ensure that an honest
effort and understanding of the material is rewarded.
• Ensure that none of the randomized values change the difficulty of the
question. For example, two randomizations of a question might evaluate the
student's understanding of a procedure, but one might require much more
computation than another.
• Generally, avoid giving values beyond five or six decimal places. There are
several reasons for this:
November 2014
Question Behavior 333
• Most known physical constants are provided to a limited number of
decimal places, and some sources for these values might disagree
slightly.
• Students are usually allowed to use calculators, which do not always
®
have the same precision as the WebAssign servers.
• There is no need to make the mathematical computation of the answer
unduly difficult, if computational proficiency is not what is being learned.
• If you display a figure, expect some students to attempt to measure it with a
ruler or protractor. If the figure is not to scale or representative of the values
in the question, indicate this in the question.
Important:
®
• In most cases, the default tolerances used in WebAssign (±2% or
±1 at the last significant digit) or specified in the code for a textbook
question result in accurate scoring of correct and incorrect answers
and should not be changed.
• If you change the tolerance, your students' answers might not be
scored accurately.
• Do not set the tolerance to 0; this often results in some correct
answers being marked incorrect. Instead, use a very small tolerance
such as ±0.01%.
Test Your Questions
Randomization errors are probably the most common kind of question error for
two reasons:
• Because randomization results in multiple versions of a question, errors are
not immediately apparent.
• Because randomization changes the terms of the question, errors can make
your question unanswerable.
Thoroughly test your questions with a wide range of randomized values to be sure
that no combination of values causes problems like those described here.
When you have more than one randomized numeric value:
• test each combination of the upper and lower limits of your randomized
values
• a good rule of thumb is that any one randomized value should vary by no
more than ±15%
See Also:
Use Randomized Numbers on page 334
Use Matching Randomized Values from Two Lists on page 337
Use Randomized Values from a List on page 335
Use Randomized Values from a Table on page 340
Tags for Displaying Content on page 354
Change Tolerance for Numerical Questions on page 100
Test Questions on page 18
Numerical Tolerance on page 387
November 2014
334 WebAssign Creating Questions Guide
Use Randomized Numbers
®
You can use the WebAssign randnum() function in your questions to generate
randomized integer values within a specified range. If needed, you can use the
randomized integer values to compute decimal or fractional values.
Best Practice: Assign each randomized value to a variable. Then use the
variable to perform additional computation or to display the value in the
question, answer key, or solution.
To add a randomized number to your question:
1. If needed, open your question in the Question Editor.
2. In an <EQN> or <eqn> tag, use the randnum() function to generate a
randomized integer.
If needed, calculate a decimal or fractional value using the randomized
integer.
Use the following syntax:
randnum(low, high, increment, exclude)
where:
• low and high are integers defining the smallest and greatest values to be
returned by the function.
• increment is a natural number defining the interval of values to be
returned between low and high.
• exclude is an optional single value that should not be returned. One
reason to use this is to prevent a problem from using the same values as
an example in the textbook.
Note: Ensure that the value you are excluding is one that might
otherwise be returned. For example, in the following code, $a is
never excluded because $a is one of (1,3,5,7,9) and $b can never
be any of those values.
$a = randnum(1,9,2);
$b = randnum(2,10,2,$a);
For example:
# an integer between 1 and 8:
$a = randnum(1,8,1);
# an even number between 20 and 50:
$b = randnum(20,50,2);
# an integer between 1 and 9 ≠ $a:
$c = randnum(1,9,1,$a);
# a multiple of 0.25 between 1.50 and 2.50:
$d = decform(randnum(150,250,25)/100,2)
# a multiple of 1/6 between 3 and 4, as a reduced
# fraction (3, 19/6, 10/3, 7/2, 11/3, 23/6, 4):
$e = fraction(randnum(18,24,1),6)
November 2014
Question Behavior 335
Example Numerical Question With Randomized Values
The following table summarizes an actual question.
QID
1870653
Name
Template2 numerical_randomization
Mode
Numerical
Question
<eqn>
$minutes = randnum(3,8,1);
$mph = randnum(30,90,6,60);
$mpm = $mph / 60;
$distance = $mpm * $minutes;
''
</eqn>
How many miles will a car travel in <eqn $minutes> minutes
if its speed is constant at <eqn $mph> mph? <br>
<_> miles
Answer
<EQN $size=2; $distance>
Solution
Since there are 60 minutes/hour, at <eqn $mph> mph the car is
traveling at <eqn $mpm> miles/minute.
Display to
Students
See Also:
Randomization Best Practices on page 331
Display Numbers to a Specified Precision on page 343
Use Randomized Values from a List
®
You can use the WebAssign pick() function in your questions to select one or
more distinct items at random from a list, for example, to select three molecules
from a list of simple hydrocarbons.
Best Practice: Assign each randomized value to a variable. Then use the
variable to perform additional computation or to display the value in the
question, answer key, or solution.
To select values randomly from a list in your question:
1. If needed, open your question in the Question Editor.
2. In an <EQN> or <eqn> tag, use the pick() function to select distinct values from
a list.
Use the following syntax:
pick(n,list)
November 2014
336 WebAssign Creating Questions Guide
where:
• n is the number of different values you want to select, and must be less
than or equal to the number of items in list.
• list is either an array variable or a comma-delimited list of values.
Note:
• Use a list of variables (in parentheses) or an array to store the
values returned by pick().
• The pick() function selects the specified number of different items
from the list. For example, pick(2,'a','b','c') will never return
('a','a').
However, pick(2,'a','b','b') might return ('b','b') because
there are two different items in the list with a value of 'b'.
For example:
# select a single color
($a) = pick(1,'red','orange','yellow','green','blue','violet');
# select two different colors
($a,$b) = pick(2,'red','orange','yellow','green','blue','violet');
# or
@a = pick(2,'red','orange','yellow','green','blue','violet');
# select two different integers between 15 and 25
($c, $d) = pick(2,15..25);
# select one, two, or four values from an array
@firstprimes = (1,2,3,5,7,11,13,17,19,23);
($x)
= pick(1,@firstprimes);
($x,$y) = pick(2,@firstprimes);
@x
= pick(4,@firstprimes);
Example Question Using pick()
The following table summarizes an actual question.
November 2014
QID
1931415
Name
pick() example 1
Mode
Numerical
Question
<eqn>
# select primes for $a and $b so students need not simplify
($a) = pick(1,7,11,13,17,19);
($b) = pick(1,61,67,71,73,79,83,89,97);
@color =
pick(2,'red','purple','blue','green','yellow','orange');
''
</eqn>
A jar contains <eqn $b> marbles, of which <eqn $a> are <eqn
$color[0]> and <eqn $b-$a> are <eqn $color[1]>. If you take 1
marble out of the jar without looking, what is the probability
that the marble you choose is <eqn $color[0]>?
<br><_>
Question Behavior 337
Answer
<EQN $FRACTION=1; fraction($a,$b)>
Display to
Students
Example Question Using pick()
The following table summarizes an actual question.
QID
1947949
Name
pick() example 2
Mode
Multiple-Choice
Question
<eqn>
@lanthanides = pick(3, 'La', 'Ce', 'Pr', 'Nd', 'Pm', 'Sm',
'Eu', 'Gd', 'Tb', 'Dy', 'Ho', 'Er', 'Tm', 'Yb', 'Lu');
@distractors = pick(4, 'Actinides', 'Metalloids', 'Halogens',
'Alkali Metals', 'Alkaline earth metals', 'Transition metals',
'Noble gases');
''
</eqn>
The elements <eqn @lanthanides[0]>, <eqn @lanthanides[1]>, and
<eqn @lanthanides[2]> are all:<br>
<_>
Answer
Lanthanides
<EQN @distractors[0]>
<EQN @distractors[1]>
<EQN @distractors[2]>
<EQN @distractors[3]>
Display to
Students
See Also:
Randomization Best Practices on page 331
Use Matching Randomized Values from Two Lists
®
You can use the WebAssign pick() function to randomly select an index value
in order to use corresponding randomized values from two or more lists, for
example, an element and its atomic number.
Ensure that the number of items in each list is the same.
November 2014
338 WebAssign Creating Questions Guide
Tip: A common use of this method is to select a value that is displayed
in the question, and a corresponding value that is used to determine the
answer key.
Best Practice: Assign each randomized value to a variable. Then use the
variable to perform additional computation or to display the value in the
question, answer key, or solution.
This procedure describes a recommended way to select matching items from two
or more lists. This can be accomplished in several ways, but the method described
here is less prone to error than some other approaches.
To use corresponding randomly selected values from two
lists:
1. If needed, open your question in the Question Editor.
Note: The code in each of the following steps must be in an <EQN> or
<eqn> tag.
2. Assign the lists of items from which to select to array variables.
Ensure that each array lists the corresponding items in the same position, so
the nth item from one list corresponds to the nth item in the other list.
For example:
@symbols = ('He','Ne','Ar','Kr','Xe','Rn');
@weights = (4.00, 20.18, 39.95, 83.80, 131.29, 222);
3. Use the pick() function to randomly select an index value for the list items.
Use the following syntax:
pick(1,0..$#array_name)
where array_name is the variable name — without the @ sign — of one of the
arrays containing values that you want to select.
Note: Remember that pick() returns a list of values.
For example:
($thiselement) = pick(1,0..$#symbols);
4. Display the array elements using the randomly selected index.
Use the following syntax:
$array_name[$index_name]
For example:
$a = $symbols[$thiselement];
$b = $weights[$thiselement];
Example Question Selecting Atomic Symbols and Element
Names
The following table summarizes an actual question.
November 2014
Question Behavior 339
QID
1929960
Name
Mode
Fill-in-the-Blank
Question
<eqn>
@symbols = ('He','Ne','Ar','Kr','Xe','Rn');
@elements =
('Helium','Neon','Argon','Krypton','Xenon','Radon');
($idx) = pick(1,0..$#symbols);
''
</eqn>
The atomic symbol for <eqn $elements[$idx]> is: <_>
Answer
<EQN $CASE=1; $symbols[$idx]>
Display to
Students
Example Question Selecting Number Set Names and
Definitions
The following table summarizes an actual question.
QID
1928870
Name
Mode
Fill-in-the-Blank
Question
<eqn>
@terms = (
"Integer \t Integers",
"Natural \t Naturals \t Natural Number \t Natural Numbers",
"Whole \t Wholes \t Whole Number \t Whole Numbers",
"Rational \t Rationals \t Rational Number \t Rational
Numbers" );
@definitions = (
'All numbers that can be written without fractions or
decimals.',
'Numbers > 0 that can be written without fractions or
decimals.',
'Numbers &#8805; 0 that can be written without fractions or
decimals.',
'Numbers that can be written as the quotient of two
integers.' );
($idx) = pick(1,0..$#terms);
''
</eqn>
Name the set.<br/>
<eqn $definitions[$idx]><br/><_>
Answer
<EQN $terms[$idx]>
Display to
Students
November 2014
340 WebAssign Creating Questions Guide
See Also:
The {tab} Operator on page 329
Randomization Best Practices on page 331
Use Randomized Values from a Table
®
You can use the WebAssign randomization functions to select values from a
table stored as a two-dimensional array. This is particularly useful in subjects like
chemistry where simple substitution of independent values like a coefficient is
often not possible.
To select values randomly from a table:
1. If needed, open your question in the Question Editor.
2. Store question values that you want to choose from in a Perl array.
®
Note: Use the WebAssign @dat array to view the values as a table in
the Question Previewer.
®
3. Use WebAssign randomization functions to select values from the array to
use in your question.
Best Practice: Select index values between 0 and $#dat. This
ensures that the index is valid even when you add or remove rows
from the @dat array.
See the examples and prerequisite topics for specific information.
Example Question Using Array and Randomization
The following table summarizes an actual question.
November 2014
QID
1950001
Name
Template2 RAND.ARRAY
Mode
Multiple-Choice
Question Behavior 341
Question
<eqn>
# weight in Newtons
$weight = randnum(495,940,1);
# calculate weight on
@dat = ( ['Mercury' ,
['Venus'
,
['Mars'
,
['Jupiter' ,
['Saturn' ,
['Uranus' ,
['Neptune' ,
other planets
decform($weight
decform($weight
decform($weight
decform($weight
decform($weight
decform($weight
decform($weight
*
*
*
*
*
*
*
0.348,
0.907,
0.377,
2.364,
1.064,
0.889,
1.125,
0)
0)
0)
0)
0)
0)
0)
],
],
],
],
],
],
] );
# pick three indices for @dat
@selected = pick(3, 0..$#dat);
''
</eqn>
If you weighed <eqn $weight> N on Earth:<br>
<ul>
<li>Your weight on <eqn $dat[$selected[0]][0]> would be <eqn
$dat[$selected[0]][1]> N</li>
<li>Your weight on <eqn $dat[$selected[1]][0]> would be <eqn
$dat[$selected[1]][1]> N</li>
<li>Your weight on <eqn $dat[$selected[2]][0]> would be <eqn
$dat[$selected[2]][1]> N</li>
</ul>
On which planet would your mass be the least? <_>
Answer
<EQN
<EQN
<EQN
<EQN
Your
$ORDERED=5; 'Earth'>
$dat[$selected[0]][0]>
$dat[$selected[1]][0]>
$dat[$selected[2]][0]>
mass would be the same
Display to
Students
Randomized chemPad Example Using a Table
The following table summarizes an actual question.
QID
1931882
Name
Mode
Fill-in-the-Blank
November 2014
342 WebAssign Creating Questions Guide
Question
<eqn>
@dat = (
['2 CO + O_2 ->','2 CO_{2}'],
['2 H_2 + O_2 ->','2 H_{2}O'],
['4 Fe + 3 O_2 ->','2 Fe_{2}O_{3}'],
['SO_2 + H_2O_2 ->','H_{2}SO_{4}']
);
# pick an index to use for the array
($a) = pick(1,0..$#dat);
''
</eqn>
Complete and balance the following chemical equation. <br />
<h:reaction><eqn $dat[$a][0]></h:reaction> <br />
<_>
Answer
<EQN $PAD='chem'; $CHEM='fmla'; $dat[$a][1]>
Display to
Students
Example Multiple-Select Question with a Random Number of
Correct Answers
The following table summarizes an actual question.
Note: In this example, the second column of @dat displays as
ARRAY(0xnnnnnnnn) in the Array tab of the Question Previewer. This is
because the answer key is stored as an array within the @dat array.
QID
1930563
Name
November 2014
Mode
Multiple-Select
Question
<eqn>
@dat = (
['white',[1,3,4]],
['yellow',[1,3]],
['magenta',[1,4]],
['cyan',[3,4]]
);
($a) = pick(1,0..$#dat);
''
</eqn>
What primary colors of light can be combined to make <eqn
$dat[$a][0]> light?<br>
<_>
Question Behavior 343
<EQN $ORDERED = $dat[$a][1]; ''>red
indigo
green
blue
orange
Answer
Display to
Students
See Also:
Randomization Best Practices on page 331
Numeric Values in Questions
®
WebAssign provides a number of options for displaying numeric values in your
questions.
See Also:
Perl Variables and Functions on page 312
Display Numbers to a Specified Precision
You can use the sigform() and decform() functions to display numeric values to a
specified number of significant digits or decimal places.
sigform()
Displays a value rounded to the specified number of significant digits. If needed,
“e” notation is used.
The sigform() function is usually used when significant figures are important,
such as scientific measurements.
decform()
Displays a value rounded to the specified number of decimal places.
The decform() function is typically used to display like values in the question
with a consistent and reasonable precision, for example, to two or three decimal
places.
Note: If your answer key uses $SIGFIGS or $DECFIGS to require a specified
precision, the answer key will be displayed to the correct precision
automatically without using the sigform() or decform() functions.
November 2014
344 WebAssign Creating Questions Guide
To display numeric values to your specified precision:
1. If needed, open your question in the Question Editor.
2. In an <EQN> or <eqn> tag, use either the sigform() or decform() function to
display a numeric value.
To do this
Do this
Specify the
number of
significant digits
Use the following syntax:
Specify the
number of
decimal places
Use the following syntax:
sigform(n, digits)
where n is the number you want to format, and digits is a
positive integer specifying the number of significant digits to
use.
decform(n, digits)
where n is the number you want to format, and places is a nonnegative integer specifying the number of decimal places to use.
For example:
# sigform examples
$shortpi = sigform($pi,3);
$a = sigform(100,1)
$b = sigform(100,2)
#
#
#
3.14
100
1.0e+02
#
#
#
3.142
100.0
100.00
#decform examples
$shortpi = decform($pi,3);
$a = decform(100,1)
$b = decform(100,2)
Example Question Using sigform()
The following table summarizes an actual question.
QID
1940827
Name
Mode
November 2014
Numerical
Question Behavior 345
Question
<eqn>
# Pick two different significant figures for the measurements
($m_sigfigs,$v_sigfigs) = pick(2,2..5);
# Randomize measurements & round to the specified significant
figures
$mass = sigform(randnum(300000,1200000,1)/100000,$m_sigfigs);
$volume = sigform(randnum(106000,110000,1)/100000,$v_sigfigs);
# Calculate answer key and determine correct significant
figures
$density = $mass/$volume;
$d_sigfigs = min($m_sigfigs,$v_sigfigs);
''
</eqn>
In the lab, you measure the displacement of a metal sphere as
<eqn $volume> liters.<BR/>
You also determine its mass to be <eqn $mass> kg.<BR/>
Calculate its density. <_> kg/l
Answer
<EQN $SIGFIGS=$d_sigfigs; $density>
Display to
Students
Example Question Using decform()
The following table summarizes an actual question.
QID
1944303
Name
Mode
Numerical
Question
<eqn>
# Pick the number of decimal places for the problem
($decimals) = pick(1,2..4);
# Randomize addends
$a = decform(randnum(100000,999999,1)/10000,$decimals);
$b = decform(randnum(100000,999999,1)/10000,$decimals);
''
</eqn>
<watex>\begin{array}{r}
$a \\
+ $b \\
\cline{0-0} <_>
\end{array}</watex>
Answer
<EQN $SIMPLIFIED=1; decform($a + $b, $decimals)> {tab} 0
Display to
Students
November 2014
346 WebAssign Creating Questions Guide
Tip: For known constants, you can enclose the value in single quotes
to store both the value and the precision with which you specified it. For
example, $e = '2.718'; assigns a value to $e with four significant digits.
See Also:
Use Randomized Numbers on page 334
Check Significant Figures in Numerical Questions on page 97
Check Decimal Places in Numerical Questions on page 98
Add Item-Specific Feedback to Multiple-Choice
Questions
You can help your students learn by providing feedback — sometimes called
rejoinders — after your students submit responses for multiple-choice questions.
For each distractor, your feedback should help your students understand why that
response was not correct without giving away the answer. You can also provide
feedback for the correct answer to reinforce or supplement the concept.
Note: Item-specific feedback is displayed to your students only after they
submit a response to the question, and only if you enable displaying Hints,
Tutorials & eBook Links for the assignment.
To add item-specific feedback to a multiple-choice question:
1. Optional: Include the <HINT> tag in Question to specify where the feedback
should be displayed.
If you omit <HINT>, the feedback is displayed below the question.
2. Specify the feedback for each choice by prepending each line in Answer with
the following code:
<EQN $hints{choice_number}='feedback'; ''>choice
where
• choice_number is the number of the choice, starting with 0 for the first
choice.
• feedback is the text you want to display after students submit that choice
as their response.
• choice is the text of the answer or distractor.
Best Practice: Although you could specify the feedback for each
choice in Question, defining it in Answer as described helps to ensure
that your feedback matches the answer choices you are providing.
3. In the last answer line, add the following statement inside the <EQN> tag after
you define the last value for $hints:
$HINT=$hints{$thisanswer};
This sets the value of $HINT to the correct feedback text based on the
response that your student submits.
November 2014
Question Behavior 347
4. If you want to display feedback after your student submits the correct answer,
add the following statement inside any <EQN> tag in Answer:
$HINT_ON_CORRECT=1;
Otherwise, your feedback will be displayed only after your student submits
incorrect responses.
Example Multiple-Choice Question with Item-Specific
Feedback
The following table summarizes an actual question.
QID
1236642
Name
Template2 2.MC.06.
Mode
Multiple-Choice
Question
What is the best unit for measuring the length of a pencil?
<div class="indent">
<_> <HINT>
</div>
Answer
<EQN $hints{0}='Centimeters are a good unit of length for
measuring
a pencil.';''>cm
<EQN $hints{1}='Kilograms are used to measure mass.';''>kg
<EQN $hints{2}='Milliliters are used to measure volume.';''>ml
<EQN $hints{3}='Amperes are used to measure electric
current.';''>A
<EQN $hints{4}='Candelas are used to measure the intensity of
light.'; $HINT_ON_CORRECT=1; $HINT=$hints{$thisanswer};''>cd
Display to
Students
See Also:
Create Multiple-Choice Questions on page 22
Perform Complex Operations in Answer Keys
When you create multi-part or multi-mode questions, especially answerdependent questions, you sometimes need to determine answer keys for later
parts of the question based on your student's responses to earlier parts of the
question. But, your answer key must be specified on a single line in Answer. To
perform complex or repetitive parsing or computations for answer keys, you can
use the postcalc() function.
November 2014
348 WebAssign Creating Questions Guide
The postcalc() function lets you define a variable in Question that holds the
code that you want to evaluate in Answer. You can pass values to your code, and
postcalc() returns the result of the last statement in your code. This helps you
accomplish two things:
• You can define a complex, multi-line algorithm that is evaluated to define an
answer key based on your student's responses to other parts of the question.
• You can reuse a formula with different values for multiple lines in your
answer key.
To use the postcalc() function in an answer key:
1. Open your question in the Question Editor.
2. Add the following code at the beginning of Question:
<eqn include('/userimages/feedback/physlabs1.pl')>
This code is required in order to use the postcalc() function.
3. In Question, define a variable that contains the code that you want to be
evaluated in your answer key. For example:
<eqn>
$mycalc='decform($a**2 + $b**2,3)';
''
</eqn>
Your code can include multiple statements, and you can format it using
multiple lines.
Values that are passed to your code from the postcalc() function are assigned
to the special variables $_[0], $_[1], and so on.
Important:
• Be sure to escape single or double quotation marks in your
code that would end the variable definition. You can do this by
preceding the quotation mark with a backslash as in the following
example:
$mycalc='$a=\'test\'; $b=3*$firstresult';
• Do not use the postcalc() function in your code.
4. In Answer, add the postcalc() function where your code should be
evaluated. For example:
<EQN postcalc($mycalc)>
To pass values to your code, list them after the variable that contains your
code. For example:
<EQN postcalc($mycalc,6)>
The postcalc() function returns the result of the last statement in your code,
so you can use it for variable assignment. For example:
<EQN $mychoices[2] = postcalc($mycalc,6)>
5. Click Test/Preview to test the appearance and behavior of the question. See
Test Questions on page 18.
November 2014
Question Behavior 349
6. When your question displays and functions correctly, click Save.
Example Question Using postcalc() to Calculate the Answer
Key
The following table summarizes an actual question.
QID
1589522
Name
Template2 3.POSTC.01
Mode
Numerical
Question
<eqn include('/userimages/feedback/physlabs1.pl')>
<eqn>
%total_feedback = (low => "Count more cells for an accurate
sample.");
%ID_feedback = (low => "Check your identification.", high =>
"Check your
identification." );
$calc_range = '$LINK=\'box_total: no_icon\';
decform(userinput(max(0,$total*($_[0]-0.05)),
$total*($_[0]+0.05),
$total*$_[0], \%ID_feedback),0)';
''
</eqn>
View the slide of an onion root tip and count the cells in each
phase of cell
division. <br><br>
<table frame="void" rules="none" border="0">
<tr><th>TOTAL</th><td><_></td></tr>
<tr><th>Interphase</th><td><_></td></tr>
<tr><th>Prophase</th><td><_></td></tr>
<tr><th>Metaphase</th><td><_></td></tr>
<tr><th>Anaphase</th><td><_></td></tr>
<tr><th>Telophase</th><td><_></td></tr>
</table>
Answer
<EQN $LABEL='box_total';
$total=decform(userinput(60,1000,100,\%total_feedback),0)>
{tab} 0
<EQN $LABEL='box_inter'; $inter=postcalc($calc_range,0.56)>
{tab} 0
<EQN $LABEL='box_proph'; $proph=postcalc($calc_range,0.28)>
{tab} 0
<EQN $LABEL='box_metap'; $metap=postcalc($calc_range,0.08)>
{tab} 0
<EQN $LABEL='box_anaph'; $anaph=postcalc($calc_range,0.06)>
{tab} 0
<EQN $LABEL='box_telop'; $telop=postcalc($calc_range,0.03)>
{tab} 0
November 2014
350 WebAssign Creating Questions Guide
Display to
Students
Example Question Using postcalc() to Parse Responses
The following table summarizes a question that uses postcalc() to determine
characteristics of the student's triangle based on the lengths of its sides.
November 2014
QID
1589514
Name
Template2 3.POSTC.02
Mode
Multi-Mode...NS
Question Behavior 351
Question
<eqn include('/userimages/feedback/physlabs1.pl')>
<eqn>
@clues=(' ',
'Are all three sides equal?',
'Are two sides equal?',
'Are any sides equal?',
'Is there a right angle?',
'Is there an obtuse angle?',
'Are all the angles acute?'
);
@reinforcement=(' ',
'A triangle with three equal sides is <i>equilateral</i>.',
'A triangle with two equal sides is <i>isosceles</i>.',
'A triangle with three different sides is <i>scalene</i>.',
'When one angle is 90&deg;, it is a <i>right triangle</i>.',
'When one angle is greater than 90&deg;, it is <i>obtuse</i>.',
'When all angles are less than 90&deg;, it is <i>acute</i>.'
);
$triangle='
@squares = sort {$a <=> $b} ($AB**2,$AC**2,$BC**2);
if (@squares[0] == @squares[2]) {@choices=(1,2)}
elsif (@squares[0] == @squares[1]) {@choices=(2)}
elsif (@squares[1] == @squares[2]) {@choices=(2)}
elsif ((@squares[0] != @squares[1]) && (@squares[0] !=
@squares[2]) && (@squares[1]
!= @squares[2])) {@choices=(3)}
if (abs(@squares[2] - @squares[1] - @squares[0]) < @squares[2]
* 0.05)
{@choices=(@choices,4)}
elsif (@squares[2] > @squares[0] + @squares[1])
{@choices=(@choices,5)}
elsif (@squares[2] < @squares[0] + @squares[1])
{@choices=(@choices,6)}
$HINT=join(\'<br>\',@clues[@choices]);
$CORRECT_HINT=join(\'<br>\',@reinforcement[@choices]);
$ORDERED=[@choices]
';
''
</eqn>
<tutorial order="ascending" skip="no">
<premise title="Types of Triangles">
On a sheet of paper, draw a triangle. Label the vertices A, B,
and C. </premise>
<step title="Measurement">
Measure each side of your triangle.
<br>
AB = <_> inches<br>
AC = <_> inches<br>
BC = <_> inches
</step>
<step title="Identification">
<SECTION>Which terms describe your triangle?
(<p:selectall>)<br>
<_>
</step>
</tutorial>
Answer
<EQN $AB=userinput(1,100,5)>
<EQN $AC=userinput(1,100,5)>
<EQN $BC=userinput(1,100,5)>
<SECTION><EQN postcalc($triangle); ''>equilateral
isosceles
scalene
right
obtuse
acute
November 2014
352 WebAssign Creating Questions Guide
Display to
Students
See Also:
Write Perl Functions on page 327
Use Perl Array Variables on page 319
The {tab} Operator on page 329
November 2014
A
List of Tags
This chapter contains the
following topics:
Use the following tags in questions that you create in
WebAssign®.
• Tags for Displaying Content
• Tags for Multi-Part, Accordion, and
Tutorial Questions
• Tags for Controlling Question
Behavior
November 2014
354 WebAssign Creating Questions Guide
Tags for Displaying Content
®
Use the following tags to display content in questions you create in WebAssign .
The listed tags are valid in Question, Answer, and Solution unless otherwise
indicated.
Content
Tag
Notes
Image
<userimage(file_ID)>
Displays an image that you have copied to
®
WebAssign .
Chemical drawings
<MARVIN>
Displays a chemical drawing. See Create
MarvinSketch Questions on page 257.
Symimage markup
<symimage(markup)>
Displays image of markup. See Display
Notation with <symimage> on page 133.
LaTeX markup
<latex> markup
</latex>
<latex pdf=
'link_text'> markup
</latex>
Displays LaTeX as an image or as a linked
PDF file.
Math or chemistry
notation
<h:>
See:
• Display Math Notation with HTML
Substitution on page 141
• Chemistry Notation in Questions on page
232
WaTeX markup
<watex> markup
</watex>
Displays scalable HTML representation of
markup. See Display Notation with WaTeX
on page 118.
Predefined prompts
<p:>
See List of Prompts on page 361
Symbols
<s:>
See List of Symbols on page 359
Link to a file
<userfile(file_ID)>
Adds a link to a file that you have copied
®
to WebAssign .
Link to practice
question
<PRACTICE>
qid='question_id'
</PRACTICE>
<PRACTICE
qid='question_id'
link='link_text'
title='window_title
' style='none'>
In Question or Solution, opens the
specified question in a new window;
no credit is awarded for answers to the
practice question. Optionally set the style
attribute to 'none' or use CSS values.
November 2014
List of Tags 355
Content
Tag
Notes
HTML textbook
simulation
<asset
position='horizontal_alignment'
noimage></asset>
Note:
• This tag has no effect for
instructor-created questions,
including duplicates of textbook
questions.
• The closing tag must be
included.
Tags for Multi-Part, Accordion, and Tutorial
Questions
Use the following tags in multi-part and tutorial questions you create in
®
WebAssign .
The listed tags are valid only in Question unless otherwise indicated.
Purpose
Tag
Notes
Accordion
<accordion>
<part>
<part_label> label </part_label>
<part_title> title </part_title>
content
</part>
...more_parts...
</accordion>
Do not use in the same
question with tutorial.
In-Line
Tutorial
<tutorial>
<premise title="title"> content </
premise>
<step label="label"
title="title"> content
<hint> hint_text </hint>
</step>
...more_steps...
<conclusion title="title"> content
</conclusion>
</tutorial>
Do not use in the same
question with accordion.
Pop-Up
Tutorial
<tutorial type='popup'
button='button_label'>
<premise title="title"> content </
premise>
<step label="label"
title="title"> content
<hint> hint_text </hint>
</step>
...more_steps...
<conclusion title="title"> content
</conclusion>
</tutorial>
Do not use in the same
question with accordion.
November 2014
356 WebAssign Creating Questions Guide
Purpose
Tag
Notes
MultipleChoice
<MCPART>
In Answer, separates
parts of multi- part
Multiple-Choice questions.
Multiple-Select <MSPART>
In Answer, separates
parts of multi- part
Multiple-Select questions.
Multi-Mode
<SECTION>
In both Question and
Answer, marks the break
between question modes.
Multi-Mode
<SECTION NOBR>
In Question, marks
the break between
question modes without
adding <br>. Insert a
corresponding <SECTION>
tag in Answer.
Tags for Controlling Question Behavior
Use the following tags to add or change question behaviors in questions you
®
create in WebAssign .
The listed tags are valid only in Question unless otherwise indicated.
November 2014
Purpose
Tag
Notes
Answer box
<_>
Specifies placement of the answer
box or control.
Identify
incorrect
choices
<INCORRECT>
Marks the start of incorrect choices
(Multiple-Select Answer only).
Significant
figures help
<SIGFIGS>
Sets position of significant figures
help.
Symbolic
formatting
help
<SYMBOLIC>
Sets position of symbolic
formatting help.
Hints
<HINT>
Sets the position of a hint.
Correct /
incorrect
marks
<MARK>
Sets the position of correct/
incorrect marks.
List of Tags 357
Purpose
Tag
Notes
Use Perl
<eqn>
<EQN>
Use <eqn> in Question or
Solution. Displays the result in
red (to 3 significant figures for
Numerical mode).
Use <EQN> in Answer (optionally,
in Question or Solution).
Displays the result without
modification.
Deprecated Tags
The following tags have been deprecated and should no longer be used:
• <SUBMIT>
November 2014
358 WebAssign Creating Questions Guide
November 2014
B
List of Symbols
See www.webassign.net/manual/instructor_guide/c_i_list_symbols.htm for lists of
symbols that you can add to your questions.
November 2014
360 WebAssign Creating Questions Guide
November 2014
C
List of Prompts
This chapter contains the
following topics:
Prompts that you can add to your questions using the
WebAssign® <p> tag are listed in the following sections.
• Prompts for Accounting Questions
• Prompts for Chemistry and Physics
Questions
• Prompts for Mathematics Questions
• Prompts for Statistics Questions
• Miscellaneous Prompts
November 2014
362 WebAssign Creating Questions Guide
Prompts for Accounting Questions
You can use these prompts in your questions or assignments.
Tag
Displayed Prompt
<p:fset>
You MUST enter the number "0", the number zero, in all
cells that should be BLANK.
<p:taccount>
Enter transactions in the T-accounts in the order they
appear, including the beginning balances, if available.
You MUST enter the number "0", the number zero, in all
cells that should be BLANK. Compute the final balance, if
requested.
Prompts for Chemistry and Physics Questions
You can use these prompts in your questions or assignments.
November 2014
Tag
Displayed Prompt
<p:agree>
A difference of ±10% would be considered acceptable in this
situation.
<p:agree2>
For values to be in agreement, percent error should be less
than percent uncertainty.
<p:anion>
[Ni(CN)4]2- for Ni(CN)4
<p:cation>
[NH4]+ for NH4
<p:ccw>
counterclockwise from the +x-axis
<p:charge>
Type your answer using the format +1 and -2.
<p:chempad-Kc>
Concentration equilibrium expressions take the general form
2
'Kc = [HCl] / [H2] . [Cl2]'.
<p:chempad-Keq>
Equilibrium expressions take the general form 'Keq = [HCl] /
[H2] . [Cl2]'.
<p:chempad-Kp>
Pressure equilibrium expressions take the general form 'Kp =
2
pHCl / pH2 . pCl2'.
<p:chempad-Kpp>
Pressure equilibrium expressions take the general form 'Kp =
2
(pHCl) / H2 . Cl2'.
<p:chempad-Ksp>
Solubility equilibrium expressions take the general form 'Ksp =
+
[Ag ] . [Cl ]'.
<p:chempad-lst>
Separate substances in a list with a comma.
<p:chempad-rate>
Rate expressions take the general form 'rate = k . [H2] .
[Cl2]'.
2-
+
2
List of Prompts 363
Tag
Displayed Prompt
<p:chempad-rnk>
Use the appropriate <, =, or > symbol to separate substances
in the list.
<p:chempad-som-given>
Include states-of-matter under the given conditions in your
answer.
<p:chempad-som-omit>
Omit states-of-matter from your answer.
<p:chempad-som-satp>
Include states-of-matter under SATP conditions in your
answer.
<p:chempad-som-stp>
Include states-of-matter under STP conditions in your answer.
<p:chempad-som-tss>
Include states-of-matter under TSS conditions in your answer.
<p:data>
Use the exact values you enter for your data to make later
calculations.
<p:electronconfig1>
Type your answer using the format 1s2 2s2 for 1s 2s .
<p:electronconfig2>
Type your answer using the format [Ar] 4s2 3d10 4p2 for
2
10
2
[Ar]4s 3d 4p .
<p:formula1>
CO2 for CO2
<p:formula2>
Al(OH)3 for Al(OH)3
<p:hyper>
Use the from the Advanced menu to designate a generic
portion of the molecule.
<p:includeunits>
Include units in your answer. More information
<p:indicate>
Indicate the direction with the sign of your answer.
<p:kcomplex>
[A2]1+ / ([B2] * [C]1-) for [A2
<p:ksimple>
[CO2]2/[H2][Fe]2 for [CO2] / [H2][Fe]
<p:marvin-eflow>
Draw the appropriate arrows.
<p:marvin-nlp>
Omit lone pairs and any spectator ions from your answer.
<p:marvin-noH>
Omit all hydrogen atoms from your answer.
<p:marvin-showD>
All hydrogen atoms are implied, but any deuterium isotopes
must be shown where appropriate.
2
1+
2
2
1-
] / ([B2] * [C ])
2
<p:marvinformalcharge> To confirm that the charges are correct, right click on an atom
and select the Charge submenu.
<p:microunits>
When entering units, use micro for the metric system prefix µ.
<p:multistep>
Select "none" if no further reagents are needed. If there are
multiple possibilities, give the shortest route.
<p:namecomplexion>
Type your answer using the format iron(II) ion for Fe
2+
.
November 2014
364 WebAssign Creating Questions Guide
November 2014
Tag
Displayed Prompt
<p:nameioniccompound>
Type your answer using the format copper(II) chloride for
CuCl2.
<p:nameioniccompoundarchaic>
Type your answer using the format copper(II) chloride or
cupric chloride for CuCl2.
<p:nonphysical>
If the situation described is non-physical enter NONPHYSICAL.
<p:norounding>
Enter an unrounded value.
<p:novariables>
Substitute numeric values, do not use variables.
<p:nuclear>
Enter the first (raised) number in the first box, the second
(lower) number in the second box, and the symbol of the
element in the third box.
<p:nuclear2>
Use beta for β and e to represent an electron.
<p:orbitaldiagram>
Enter UP to indicate an upwards pointing arrow, DOWN to
indicate a downwards pointing arrow, UP/DOWN to indicate
two arrows, and BLANK to indicate no arrows.
<p:oxidation>
Type your answer using the format +1 and -2.
<p:padvariable>
Use any variable or symbol stated above as necessary.
<p:padvariableplus>
Use any variable or symbol stated above along with the
following as necessary:
<p:ranking>
Use only '>' or '=' symbols. If any elements are equal, show
their equality in alphabetic order - for example: a>b=c.
<p:ranking2>
Use only ">" or "=" symbols. Do not include any parentheses
around the letters or symbols.
<p:samplecalc>
The values you enter for your sample calculation should
exactly match the corresponding values you entered above.
<p:scinot>
Type your answer using one of the following formats, 1.2e-3
for 0.0012 and 1.20e+2 for 120.
<p:sciround>
If you enter your answer in scientific notation, round the
decimal value to two decimal places. Use equivalent rounding
if you do not enter your answer in scientific notation.
<p:spreadsheet>
You will not submit this spreadsheet. However, the results will
be needed later in this problem.
<p:unitsohm>
When entering units, use ohm for Ω .
<p:unrounded>
Enter an unrounded value. Use at least one more digit than
given.
<p:usevariables>
Do not substitute numerical values, use variables only.
<p:variable>
Use the following as necessary:
List of Prompts 365
Tag
Displayed Prompt
<p:variables>
Use the following variables as necessary:
<p:zerodir>
If the magnitude is zero enter NONE for the direction.
<p:zeromag>
The magnitude is zero.
Prompts for Mathematics Questions
You can use these prompts in your questions or assignments.
Tag
Displayed Prompt
<p:arctrig>
Remember to enter inverse trigonometric functions such as
–1
sin (x) as either asin(x) or arcsin(x).
<p:calc_programs>
Graphing utility programs are available here.
<p:calc_question>
A graphing calculator is recommended.
<p:commalist>
Enter your answers as a comma-separated list.
<p:commalisteq>
Enter your answers as a comma-separated list of equations.
<p:constraint>
Include each constraint.
<p:constraintcorner>
Include each constraint and corner point.
<p:dependent>
If the system is dependent, enter DEPENDENT.
<p:diverges>
If the quantity diverges, enter DIVERGES.
<p:dne>
If an answer does not exist, enter DNE.
<p:emptyset>
Enter EMPTY for the empty set.
<p:emptysetsym>
Enter EMPTY or Ø for the empty set.
<p:eqnvars>
Let x be the independent variable and y be the dependent
variable.
<p:exact>
Enter an exact number as an integer, fraction, or decimal.
<p:exactform>
Enter your answer in exact form.
<p:exactform_plural>
Enter your answers in exact form.
<p:expand>
Expand your answer completely.
<p:factor>
Factor your answer completely.
<p:fraction>
Enter your answer as a fraction.
<p:graphline>
Graph the points and the line.
<p:graphsegments>
Graph segments with closed endpoints only.
November 2014
366 WebAssign Creating Questions Guide
November 2014
Tag
Displayed Prompt
<p:impossible>
If not possible, enter IMPOSSIBLE.
<p:inconsistent>
If the system is inconsistent, enter INCONSISTENT.
<p:independent>
If the system is independent, enter INDEPENDENT.
<p:infinitelymany>
If there are infinitely many solutions, enter INFINITELY MANY.
<p:infinity>
If you need to use ∞ or –∞, enter INFINITY or –INFINITY,
respectively.
<p:integration>
Use C for the constant of integration.
<p:interval>
Enter your answer using interval notation.
<p:interval_plural>
Enter your answers using interval notation.
<p:lnabs>
Remember to use ln |u| where appropriate.
<p:logic>
Use ~ for logical not, \/ for logical or, /\ for logical and, -> for
implies and <-> to represent the biconditional.
<p:lowcoeff>
Use the lowest possible coefficients.
<p:lowintcoeff>
Use the lowest possible whole number coefficients.
<p:lrslope>
larger slope
<p:lrv>
larger value
<p:lrxv>
larger x-value
<p:lryv>
larger y-value
<p:lrzv>
larger z-value
<p:ltv>
largest value
<p:ltxv>
largest x-value
<p:ltyv>
largest y-value
<p:ltzv>
largest z-value
<p:matrixlist>
Enter each matrix in the form [[row 1], [row 2], ...], where
each row is a comma-separated list.
<p:multiplicity>
Enter all answers including repetitions.
<p:nf>
If the expression is not factorable, enter NF.
<p:nfinteger>
If it is not factorable using integers, enter NF.
<p:nointercept>
If there is no intercept, enter NONE.
<p:noinverse>
If the inverse is undefined, enter UNDEFINED.
<p:norealsoln>
If there is no real solution, enter NO REAL SOLUTION.
List of Prompts 367
Tag
Displayed Prompt
<p:nosoln>
If there is no solution, enter NO SOLUTION.
<p:notreal>
If the solution is not a real number, enter NOT REAL.
<p:ordercomplex>
Order your answers smallest to largest first by real part, then
by imaginary part.
<p:orderop>
Order your answers from smallest to largest x, then from
smallest to largest y.
<p:padvariable>
Use any variable or symbol stated above as necessary.
<p:padvariableplus>
Use any variable or symbol stated above along with the
following as necessary:
<p:powertrig>
Enter trigonometric powers such as sin (x) as (sin(x)) .
<p:prime>
If the expression is not factorable using integers, enter PRIME.
<p:primepoly>
If the polynomial is prime, enter PRIME.
<p:reals>
If all real numbers are solutions, enter REALS.
<p:reduce>
Reduce all fractions completely.
<p:rosternotation>
Enter your answer in roster notation.
<p:rowop>
Enter your row operation as a formula using R_1 for row 1
and so on. Example: 'add two times row 3 to row 2' would
be written as 2*R_3 + R_2 -> R_2. 'Swap row 1 with row 2'
would be written as R_1 <-> R_2.
<p:selectgraph>
Select the correct graph.
<p:setnotation>
Enter your answer in set notation.
<p:simplestform>
If the fraction is already in simplest form, enter the original
fraction.
<p:simplify>
Simplify your answer completely.
<p:srslope>
smaller slope
<p:srv>
smaller value
<p:srxv>
smaller x-value
<p:sryv>
smaller y-value
<p:srzv>
smaller z-value
<p:stv>
smallest value
<p:stxv>
smallest x-value
<p:styv>
smallest y-value
<p:stzv>
smallest z-value
2
2
November 2014
368 WebAssign Creating Questions Guide
Tag
Displayed Prompt
<p:undefined>
If an answer is undefined, enter UNDEFINED.
<p:vector>
Enter each vector as a comma-separated list of its
components.
<p:vectorlist>
Enter each vector in the form [x1, x2, ...].
Prompts for Statistics Questions
You can use these prompts in your questions or assignments.
Tag
Displayed Prompt
<p:exact>
Enter an exact number as an integer, fraction, or
decimal.
<p:fraction>
Enter your answer as a fraction.
<p:lrtv>
larger t-value
<p:lttv>
largest t-value
<p:srtv>
smaller t-value
<p:sttv>
smallest t-value
Miscellaneous Prompts
You can use these prompts in your questions or assignments.
November 2014
Tag
Displayed Prompt
<p:fig>
Figure
<p:filemax>
Submit a file with a maximum size of 1 MB.
<p:filemaxvar>
Submit a file with a maximum size of
<p:filemovie>
Submit your movie clip as a file with a maximum size of 8 MB.
<p:filetype>
The type of file uploaded should be
<p:format>
Type your answer using the format
<p:order12>
Enter your answers from smallest to largest.
<p:orderaz>
Enter your answers in alphabetical order.
<p:orderroots>
Enter your answers from smallest to largest starting with
the first answer blank. Enter NONE in any remaining answer
blanks.
List of Prompts 369
Tag
Displayed Prompt
<p:papersub>
Do this on paper. Your instructor may ask you to turn in this
work.
<p:selectall>
Select all that apply.
<p:unused>
Enter NONE in any unused answer blanks.
<p:upload1MB>
Submit your answer as a file with a maximum size 1 MB.
November 2014
370 WebAssign Creating Questions Guide
November 2014
D
Perl Functions and Operators
This chapter contains the
following topics:
• Conditional Processing and Logic
Functions and Operators
The following list includes both WebAssign®-specific and
commonly-used Perl functions and operators that are available
when creating questions.
• Mathematic Functions and Operators
• Numerical Display Functions
• Randomization Functions
• Informational Functions
November 2014
372 WebAssign Creating Questions Guide
Conditional Processing and Logic Functions and
Operators
®
The following list includes both WebAssign -specific and commonly-used Perl
functions and operators that are available when creating questions.
Operation
Usage
Notes
Conditional Behavior
if (condition)
{do_if_true}
else
{do_if_false};
An abbreviated form is:
&&
You can also use the words and, or,
Logical And, Or, Not
||
(condition) ?
do_if_true :
do_if_false;
!
not — but the symbols have higher
precedence.
Mathematic Functions and Operators
®
The following list includes both WebAssign -specific and commonly used Perl
functions and operators that are available when creating questions.
Numerical Operators
Operation
Usage
Notes
Test Numerical
Equality
==
Returns true (1) or false (0). Use
eq to compare strings.
Test Numerical
Inequalities ( ≠ > < ≥
≤)
!=
>
<
>=
<=
Returns true (1) or false (0).
Addition, Subtraction,
Multiplication, Division
+
*
Exponentiation
**
Order of Operations
()
To compare strings, use ne, gt, lt,
ge, le.
/
Do not use [] or {}.
Mathematic Functions
November 2014
Operation
Usage
Absolute value
abs(n)
Notes
Perl Functions and Operators 373
Operation
Usage
Notes
Average (mean)
avg(n1,n2,...)
Returns the mean of the values.
Argument can be a list or an array.
Example:
$mean = avg(@array_x)
$mean2 = avg(3,4,5)
Greatest Common
Divisor
gcd(n1,n2,...)
Argument can be a list or an array.
Least Common Multiple
lcm(n1,n2,...)
Argument can be a list or an array.
Maximum value
max(n1,n2,...)
Returns the greatest value.
Argument can be a list or an array.
Minimum value
min(n1,n2,...)
Returns the least value. Argument
can be a list or an array.
Pearson's correlation
coefficient
corr(@array_x,
@array_y)
Returns the correlation between
the values in two arrays. The
arrays should be the same size.
Sample standard
deviation
stdev(n1,n2, ...)
Returns the sample standard
deviation of the values. Argument
can be a list or an array.
Example:
$s = stdev(@array_x)
Slope of a bivariate
linear regression
linreg(@array_x,
@array_y)
Returns the slope of a linear
regression using the values in two
arrays. The arrays should be the
same size.
Example:
$slope =
linregb(@array_x,@array_y)
Square root
sqrt(n)
n≥0
Sum of array or list
sum(n1,n2,...)
Returns the sum of the array or
list. Argument can be a list or an
array.
Example:
$total = sum(23,45,56,78)
$total2 = sum(@array_x)
Sum of products
ssxy(@array_x,
@array_y)
Returns the sum of the products of
the deviations of the values of two
arrays. The arrays should be the
same size.
November 2014
374 WebAssign Creating Questions Guide
Operation
Usage
Notes
Sum of squared
deviations
ssx(n1,n2, ...)
Returns the sum of squared
deviations about the mean of the
values. Argument can be a list or
an array.
Example:
$ssofx = ssx(@array_x)
Y intercept of a
bivariate linear
regression
linrega(@array_x,
@array_y)
Returns the y intercept of a linear
regression using the values in two
arrays. The arrays should be the
same size.
Example:
$intercept =
linrega(@array_x,@array_y)
Trigonometric Functions
Operation
Usage
Notes
Trigonometric
Functions
sin(n)
cos(n)
tan(n)
Inverse
Trigononometric
Functions
asin(n)
acos(n)
atan(n)
Arctangent of y/x
atan2(y,x)
pi (π)
pi
Degrees to radians
rad(n)
Converts degrees to radians.
Radians to degrees
deg(n)
Converts radians to degrees.
Get canonical angle in
degrees
canonicaldeg(n)
Converts angle in degrees to value
in range −180 to 180.
sec(n)
csc(n)
cot(n)
asec(n)
acsc(n)
acot(n)
The value of n must be in radians.
Non-canonical values of n might
return approximate values.
Returns principal values in radians.
Returns radians from −π through π.
Logarithmic Functions
November 2014
Operation
Usage
Notes
Exponential function
exp(n)
Euler's number raised to n.
Natural Log
log(n)
n>0
Log (base 10)
log10(n)
n>0
Perl Functions and Operators 375
Combinatoric Functions
Operation
Usage
Notes
Combinations C(n,k)
combination(n,k)
Returns the number of sets of k
elements that can be picked from
an n-element set.
Permutations P(n,k)
permutation(n,k)
Returns the number of unique
(ab is different from ba) sets of k
elements that can be picked from
an n-element set.
Factorial (n!)
factorial(n)
n must be an integer from 1
through 100.
Numerical Display Functions
®
The following list includes both WebAssign -specific and commonly-used Perl
functions that are available when creating questions.
Rounding, Significant Digits, Scientific Notation
Operation
Usage
Notes
Round to specified
decimal places
decform(n,
places)
Returns n rounded to the specified
number of decimal places.
Round up (next greater ceil(n)
integer)
Returns the first integer greater
than n, for example, ceil(23.2) is
24, ceil(-23.7) is -23.
Round down (next
lesser integer)
floor(n)
Returns the first integer less than
n, for example, floor(23.7) is 23,
floor(-23.2) is - 24.
Return integer only
int(n)
Returns only the integer
component of n, for example,
int(23.7) is 23, int(-23.2) is - 23.
Get significant digits
sigfigs(n)
Returns the number of significant
digits in n, ignoring trailing zeros.
Display significant
digits
sigform(n,
digits)
Returns n rounded to the specified
number of significant digits.
Uses “e” notation if needed, for
example, 2.30e+04.
Get decimal places
decfigs(n)
Returns a power of 10 that
represents the smallest significant
decimal place in n. Ignores trailing
zeros.
November 2014
376 WebAssign Creating Questions Guide
Operation
Usage
Notes
Display scientific
notation
scinot(n,
digits)
Returns n formatted as scientific
notation with the specified number
of significant digits, for example
4
2.31 × 10 . Do not use results for
additional computation.
Display “e” notation
sciform(n,
digits)
Returns n in “e” notation with up to
the specified number of significant
digits after the decimal point, for
example 2.31e+04.
Display of Numerical Values
The listed functions are mostly used in Question or Solution to format values for
display.
November 2014
Operation
Usage
Notes
Reduced fraction
fraction(n,d)
Returns the fraction n/d in
reduced form, for example, 1/2
or 1. If used in Answer, specify
$FRACTION=1.
Rounded integer
decdisplay(n)
Returns n rounded to the nearest
integer. Uses “e” notation when
|n| ≥ 1e+05.
Add commas
commas(n)
Returns n with commas between
digit groups to the left of the
decimal point, for example,
12,345.678901. Do not use results
for additional computation.
Add spaces
spaces(n)
Returns n with spaces between
digit groups on both sides of
the decimal point, for example,
12 345.678 901. Do not use results
for additional computation.
Display as words
spell_number(n)
Returns the integer part of n in
words, for example, “negative
twenty-three”. Does not add
commas.
Display as words
(ordinal)
spell_ordinal(n)
Returns the integer part of n as
an ordinal number in words, for
example, “thirteenth”. Does not
add commas.
Perl Functions and Operators 377
Randomization Functions
®
The following list includes both WebAssign -specific and commonly-used Perl
functions that are available when creating questions.
Operation
Usage
Notes
Pick values from a list
pick(n,list)
Returns n randomly selected values
from list.
Pick a random integer
randnum(low,
high,
increment,
exclude)
Returns a random integer in the
range from low through high in the
specified increments. Optionally,
specify a single value to exclude.
Deprecated Functions
The following functions have been deprecated and should no longer be used:
• pickone()
• picksame()
See Also:
Randomize Question Values on page 330
Informational Functions
®
The following list includes both WebAssign -specific and commonly-used Perl
functions that are available when creating questions.
Operation
Usage
Notes
Time submitted before
due
&beforeDue('days')
Returns the number of days, hours,
&beforeDue('hours')
or minutes before the assignment
&beforeDue('minutes')
is due (including any granted
extensions) that the question was
submitted.
Assignment responses
get_data(deployID,
studentID)
get_data(deployID,
studentID,
questionID)
Returns an array of one student's
responses for an assignment
(optionally, a single question
on the assignment). Use
$DEPLOYMENT_ID and $STUDENT
to specify the current assignment
instance and the current student.
November 2014
378 WebAssign Creating Questions Guide
November 2014
E
Perl Variables
This chapter contains the
following topics:
• Perl Variables for Any Question Type
The following reserved Perl variables are used to return
information or set behaviors in questions that you create in
WebAssign®.
• Perl Variables for Numerical
Questions
• Perl Variables for Math Questions
(Algebraic and Symbolic Modes)
• Perl Variables for Multiple-Choice
and Multiple-Select Questions
• Perl Variables for Matching Questions
• Perl Variables for Fill-in-the-Blank
Questions
• Perl Variables for Essay Questions
• Perl Variables for File-Upload
Questions
• Perl Variables for Chemistry
Questions (Fill-in-the-Blank Mode)
November 2014
380 WebAssign Creating Questions Guide
Perl Variables for Any Question Type
The following reserved Perl variables are used to return information or set
®
behaviors in questions that you create in WebAssign .
These variables can be used in all questions.
Variable
Description
$ASSIGNMENT_ID
Returns current assignment ID.
$CORRECT
Returns true (1) if student's response is correct.
$DEPLOYMENT_ID
Returns the unique identifier for this scheduled instance of this
assignment. Not the same as the assignment ID.
$EMAIL
Returns the email address of the student completing the
question.
$FULLNAME
Returns the full name of the student completing the question.
$HINT
Set the hint to be displayed.
$CORRECT_HINT
Set the hint to be displayed after a correct response.
$HINT_ON_CORRECT
Set to displays available hints even when your student's
response is correct.
$pi
Returns a calculated value of pi.
$POINTS
Returns point value of question part.
$QUESTION_ID
Returns the current QID.
$QUESTION_NUM
Returns current question number on assignment.
$RESPONSE_NUM
Returns number of submissions made.
$STUDENT
Returns unique ID of the student completing the question.
$THIS_SCORE
Set to override question part score.
$THISBOXNAME
Returns full name of answer box, for example,
RN_355_1_0_83 is the box name for a random numerical box
of question ID 355. It is the first part (0) of the first question
(1) on the assignment and 83 is the random seed.
$thisresponse
Returns student's response for the answer box.
Important: Changing the value of this variable can
cause your student's answer to be graded incorrectly.
$TOOLTIP
In Answer, customizes or hides answer format tip for one
answer box, for example, $TOOLTIP='Enter a whole number'. To
hide the answer format tip for an answer box, set $TOOLTIP=' '
(with a space).
November 2014
Perl Variables 381
Perl Variables for Numerical Questions
The following reserved Perl variables are used to return information or set
®
behaviors in questions that you create in WebAssign .
Variable
Description
$DECFIGS
Sets the required decimal places, for example, $DECFIGS=100 or
$DECFIGS=0.01.
$SIGFIGS
Sets the required number of significant figures as a positive
integer, for example, $SIGFIGS=3.
$NO_SIGFIGS_HINT
Hides the significant figures help icon/link.
$FRACTION
Set $FRACTION=1 to require students to perform computations
and accept only exact answers as integers, decimals, fractions,
or mixed numerals.
$PROPERFRACTION
Set $PROPERFRACTION=1 to require students to perform
computations and accept only exact answers as integers or
reduced fractions.
$SIMPLIFIED
Set $SIMPLIFIED=1 to require students to perform
computations. Otherwise, students can enter either 5 or 2+3.
Students can specify proper or improper fractions, for example,
10/2.
$size
Sets the width of the answer box, for example, $size=20.
$thisnum
Returns numerical value from student's response to numerical
with units question.
Important: Changing the value of this variable can
cause your student's answer to be graded incorrectly.
$thisunit
Returns unit from student's response to numerical with units
question.
Important: Changing the value of this variable can
cause your student's answer to be graded incorrectly.
$TOL
Sets asymmetrical tolerances. For example:
$TOL={min => 0, max => 4}
$LABEL
For answer-dependent questions, set $LABEL to a unique
identifier for each answer box that is used as a dependency for
another answer box.
$LINK
For answer-dependent questions, set $LINK to define the
dependencies of the current answer box by referencing the
labels of other answer boxes.
See Also:
Create Integer or Decimal Number Questions on page 95
November 2014
382 WebAssign Creating Questions Guide
Perl Variables for Math Questions (Algebraic and
Symbolic Modes)
The following reserved Perl variables are used to return information or set
®
behaviors in questions that you create in WebAssign .
Variable
Description
$CASGRADER
(Algebraic) Sets the grading mechanism, for example,
$CASGRADER=mathematica.
$DEFAULTVALS
(Symbolic) Sets the list of values that will be used when
comparing student responses to the answer key, for example,
$DEFAULTVALS=[-1.1, 0.4, 0.9].
$MAXERR=n
$MAXERR='n%'
(Symbolic) Set $MAXERR to the allowable tolerance (>0) for
evaluated student responses.
$NO_REPETITION
(Symbolic) Set $NO_REPETITION=1 to match each element of a
set only once, so {1,2,2} ≠ {1,2}.
$NO_SYMBOLIC_HINT
(Symbolic) Set $NO_SYMBOLIC_HINT=1 to hide the symbolic
formatting help icon/link for the current answer box only.
$ROSTER_ONLY
(Symbolic) Set $ROSTER_ONLY=1 to require that students enclose
unordered sets in braces, e.g., {1,2}.
$PAD
Enables one of two pads for answering math questions (and
hides symbolic formatting help icon):
$PAD='devmath' enables mathPad.
$PAD='calc' enables calcPad.
$size
Sets the width of the answer box when not using mathPad or
calcPad, for example, $size=20.
See Also:
Create Math Questions on page 117
Perl Variables for Multiple-Choice and Multiple-Select
Questions
The following reserved Perl variables are used to return information or set
®
behaviors in questions that you create in WebAssign .
November 2014
Variable
Description
$ORDERED=n
$ORDERED=list
To display choices in the order listed in Answer, set
$ORDERED to the positions (starting with 1) of one or more
correct choices.
Perl Variables 383
Variable
Description
$SET_EACH_POSITION
To set the location of each choice individually, set
$SET_EACH_POSITION=1 in Answer. In Question, add an answer
box <_> for each choice. Choices are still displayed in random
order.
$thisanswer
Returns position (starting with 0) of student's response
to multiple-choice question. For multiple- select, use @
$thisanswer.
Important: Changing the value of this variable can
cause your student's answer to be graded incorrectly.
$PULLDOWN
(Multiple-Choice) Set $PULLDOWN=1 to display choices as a dropdown list.
$Select_Option
(Multiple-Choice) When choices are displayed as a drop-down
list, set $Select_Option to the text that should be displayed by
default. If not specified, ---Select--- is shown.
$thiskey
(Multiple-Choice) Returns position (starting with 0) of correct
response to multiple-choice question.
See Also:
Create Multiple-Select Questions on page 30
Create Multiple-Choice Questions on page 22
Perl Variables for Matching Questions
The following reserved Perl variables are used to return information or set
®
behaviors in questions that you create in WebAssign .
Variable
Description
$LABEL
For matching questions, set $LABEL to "a", "A", or "1" to set
the numbering style when displaying images or formatted
notation in the second column.
$ORDERLEFT
Set $ORDERLEFT=1 to display the left-hand list in the specified
order.
$ORDERRIGHT
Set $ORDERRIGHT=1 to display the right-hand list in the specified
order.
See Also:
Create Matching Questions on page 34
November 2014
384 WebAssign Creating Questions Guide
Perl Variables for Fill-in-the-Blank Questions
The following reserved Perl variables are used to return information or set
®
behaviors in questions that you create in WebAssign .
Variable
Description
$CASE
Make answer case-sensitive. Also for Java mode.
$SPACE
Make answer space-sensitive. Also for Java mode.
$REDUCE
Ignores multiple, preceding, and trailing whitespace in
responses. Also for Java mode.
$size
Sets the width of the answer box, for example, $size=20.
See Also:
Create Fill-in-the-Blank Questions on page 42
Perl Variables for Essay Questions
The following reserved Perl variables are used to return information or set
®
behaviors in questions that you create in WebAssign .
Variable
Description
$cols
Sets the width of the answer box, for example, $cols=50.
$rows
Sets the height of the answer box, for example, $rows=8.
See Also:
Create Free Response Questions on page 50
Perl Variables for File-Upload Questions
The following reserved Perl variables are used to return information or set
®
behaviors in questions that you create in WebAssign .
Variable
Description
$ACCEPTFILETYPE
Sets acceptable filename extensions, for example,
$ACCEPTFILETYPE=['.doc','.docx'].
$FILEUPLOADMAX
Sets maximum file size in bytes, for example,
$FILEUPLOADMAX=204800.
$size
Sets the width of the answer box, for example, $size=80.
See Also:
Create File Upload Questions on page 44
November 2014
Perl Variables 385
Perl Variables for Chemistry Questions (Fill-in-theBlank Mode)
The following reserved Perl variables are used to return information or set
®
behaviors in questions that you create in WebAssign .
Variable
Description
$PAD
Enables a pad for answering chemistry questions (and hides
symbolic formatting help icon):
$PAD='chem' enables chemPad.
$CHEM
Sets the chemPad grading mode.
$CP_MAX_WIDTH
Sets the maximum width of the chemPad tool, for example,
$CP_MAX_WIDTH=400.
$MARVIN
Displays the MarvinSketch tool for answer entry and sets the
MarvinSketch mode, for example, $MARVIN='complete'.
$MARVIN_START
Sets a template for a MarvinSketch question, usually using a
key generated with the MarvinSketch Key Generation tool.
See Also:
Create Chemistry Questions on page 231
November 2014
386 WebAssign Creating Questions Guide
November 2014
F
Numerical Tolerance
Numerical tolerance determines whether student answers that are close to the
®
answer key are counted as correct. In WebAssign , numerical tolerance can be set
in four different places to override the default numerical tolerance of ±2%.
Note: When significant figure checking is turned on, questions that specify
significant figures in the answer key use a different tolerance setting than
is discussed here.
By default, new assignments do not override the class settings for numerical
tolerance.
Tip: To change this default behavior, create an assignment template that
overrides the class settings and set it as your default template.
You can set numerical tolerance values for a class, an assignment, or for a specific
question on an assignment. These tolerances override each other, the tolerance
®
set in the question code, and the default WebAssign tolerance.
The actual tolerance that is used is the tolerance with the highest priority:
Tolerance type in
highest priority order
Overrides
Set for specific
questions in the
assignment
Overrides all other
tolerances
Set in the assignment
or assignment
template for the entire
assignment
Overrides tolerance
set in class settings
and question code, and
®
WebAssign default
tolerance
Set in class settings
Overrides tolerance set
in question code and
®
WebAssign default
tolerance
Notes
Default class settings do not
specify tolerance.
November 2014
388 WebAssign Creating Questions Guide
Tolerance type in
highest priority order
Overrides
Set in question code
Overrides WebAssign
default tolerance
Notes
®
A tolerance of 0 is almost always
specified for mathematics textbook
questions, textbook questions
requiring students to enter
fractions, and textbook questions
requiring simple computation of
integers.
Note: Symbolic mode
questions that require
tolerance must be set in
the question code.
®
®
WebAssign default tolerance
of ±2% is used when no other
tolerances are set. This is
a standard used by many
professional scientists and
WebAssign default
tolerance
engineers, and ensures that
the answer is correct to three
significant figures.
Important: Changing numerical tolerance settings can result in granting
credit for incorrect responses, as in the following examples:
• When asking about the speed of a relativistic electron, a 1% tolerance
would allow students who round a response of 0.99975c up to 1.00c
to be marked correct.
• When asking students to determine the area of a rectangle that
2
is 32.5 m by 3 m, the exact answer of 97.5 m is correct, not, for
2
2
example, 98 m or 100 m .
If you do change numerical tolerance settings, test every question carefully
to ensure that your students receive credit for all correct responses and do
not receive credit for incorrect responses.
You can set numerical tolerance as a non-negative number of units, or as a
percentage of the answer key.
Key value
Tolerance setting
Responses scored as correct
120
2% (default)
117.6-122.4
120
10 units
110-130
For questions with multiple parts, any tolerances that you set in the assignment or
class settings apply to all parts of the question. Only the question author can set
different tolerances for different parts of a multiple-part question.
November 2014
Numerical Tolerance 389
Best Practice: Do not change assignments that your students are already
working on. You are likely to cost your students points, submissions, or
both. Instead, consider creating a copy of the scheduled assignment and
making your changes to the copy.
If you must change a scheduled assignment, notify your students of the
change and rescore the assignment. See Rescore Assignments.
November 2014
390 WebAssign Creating Questions Guide
November 2014
G
Significant Figure Checking in
WebAssign®
Enabling significant figure checking does not make every question check
significant figures.
Many textbook questions, even in physics and chemistry, do not specify significant
figures. If the questions on your assignment do not specify significant figures in
the answer key, changing significant figure checking options will have no effect.
To determine whether the questions on your assignment specify significant
figures, see Identify Questions That Check Significant Figures.
By default, new assignments do not override the class settings for significant
figure checking.
Tip: To change this default behavior, create an assignment template that
overrides the class settings and set it as your default template.
The default class settings enable the following behaviors for questions that specify
significant figures in the answer key:
• Significant figure checking is enabled.
• These questions display the sigfigs icon
, and it links to information about
®
entering significant figures in WebAssign .
• Tolerance for these questions is ±1 at the last significant digit, if the answer
key specifies that at least 2 digits are significant. If only 1 digit is significant,
responses must specify the correct answer exactly.
• No partial credit is awarded for responses that do not specify the correct
number of significant figures.
You can change these behaviors for your classes or for your assignments. Your
assignment settings override your class settings.
Checking Significant Figures
If significant figure checking is turned on, questions that specify significant
figures in the answer key are treated differently from other numerical questions
based on the significant figure checking options that are set.
November 2014
392 WebAssign Creating Questions Guide
If significant figure checking is turned off, questions that specify significant
figures in the answer key are treated like numerical questions and all other
significant figure checking options are turned off.
Significant Figures Help
If enabled, the sigfigs icon
helps your students identify answer boxes for
which significant figures are checked. If answer format tips are also enabled,
the answer format tips instruct students to use the correct number of significant
figures. Your students are not given information about how many significant
figures to specify.
Tip: If answer format tips are enabled but the sigfigs icon is not, your
students will not see answer format tips for questions that check for
significant figures. If you think that the absence of answer format tips
for some questions will inform your students that significant figures are
checked, you can hide all answer format tips for the assignment.
If enabled, the sigfigs icon
links to the student help topic with information
®
about entering significant figures in WebAssign .
Significant Figures Tolerance
When significant figure checking is turned on, questions that specify significant
figures in the answer key use a different tolerance value than other numerical
questions. In order to reflect the precision with which the answer should be
specified, the tolerance for significant figure questions is specified as the value by
which the last significant digit can differ from the key and still be considered to be
correct. The following table illustrates this concept.
Answer Key
Correct Responses (Tolerance
is ±1)
Correct Responses (Tolerance
is ±2)
4100
4.0e3, 4100, 4200
3900, 4.0e3, 4100, 4200, 4300
12.28
12.27, 12.28, 12.29
12.26, 12.27, 12.28, 12.29, 12.30
0.04
0.04
0.04
Note: If the question
sets the number of
significant figures to 1,
the exact answer must
be specified regardless of
Note: If the question
sets the number of
significant figures to 1,
the exact answer must
be specified regardless of
tolerance.
tolerance.
®
The WebAssign default value is ±1. This allows students to receive credit if their
calculation is correct but they have made a small rounding error. All calculations
should be done without rounding until final answer is achieved.
The significant figures tolerance set in the assignment or assignment template for
the assignment as a whole override all other tolerances.
Partial Credit for Value
When significant figure checking is turned on, you can award partial credit for
numerically correct responses that are specified with too many significant figures.
No credit is awarded for responses that specify too few significant figures.
November 2014
Terms of Use
Introduction
Welcome to WebAssign®. We hope our assessment service helps you meet your
educational goals and objectives. WebAssign® is used by students to enter their
answers to class assignments and receive a score and by instructors to provide
assignments and communications with their students. We provide this service
to you subject to the following Terms of Use (TOU).
By accessing and using our service, you are agreeing to your acceptance,
without limitation or qualification, these TOU. If you do not agree with these
TOU, you may not access or use WebAssign®.
The WebAssign® Service
WebAssign® (the "Service") is an online homework delivery, grading, and
assessment service available to instructors through paid subscription for
specified classes and time durations. The purpose of the Service is to provide
instructors with a secure, accessible platform in which to assign and grade
homework in order to assess student performance and comprehension. The
Service can also be used for quizzes and testing depending on the instructor's
application of the system.
The Service enables instructors to post of online class discussion, internal
communications, grades, schedule of class events, class notes, and syllabi. We
may offer other features in the future, or change or eliminate current features
at any time. All of the features of the Service are subject to these TOU.
Use of Account
To use the Service, you will need a username, institution, and password.
Student usernames are provided to WebAssign® by an instructor, the institution
name is determined by WebAssign®, and the initial password is provided by
the instructor. You should change your password before starting to use the
Service to prevent unauthorized access to your assignments. To facilitate
communication and for retrieval of a new password, we use email addresses.
You are solely responsible for maintaining the confidentiality of your username
and password. Furthermore, you are responsible for all activities, charges,
and liabilities associated with your account. You must immediately notify
WebAssign® of any unauthorized use of your account. In the event that you are
a minor, WebAssign® reserves the right to provide access to your account to
your parents, guardian or other authorized adult, upon such adult's request.
Content
Any content that you upload or otherwise make available in the Service
remains your sole property or the property of your licensors. If you mark any
of your content public domain (Public Domain Content) in the Service, you
automatically grant and/or warrant that the owner has granted WebAssign®,
the perpetual royalty-free, non-exclusive right and license to use, reproduce,
modify, publish, distribute, perform, display, and transmit the Public Domain
Content through the Service. You also permit any other user of the Service,
subject to your restrictions, to access, view, store, and reproduce the Public
Domain Content to the same extent permitted herein.
Copyright
You acknowledge that the Service, any underlying technology used in
connection with the Service, and all software, material, information,
communications, text, graphics, links, electronic art, animations, audio, video,
photos, and other data (collectively, the "Content") available within the Service
are provided by WebAssign® or third-party providers and are protected by
copyright. You may not store any significant portion of any Content owned
by, or licensed to WebAssign® in any form, whether archival files, computerreadable files, or any other medium.
We encourage you to download and print a reasonable number of copies of
Content for noncommercial personal or educational use only. You acknowledge
that WebAssign® and/or third-party providers remain the owners of the Content
and that you do not acquire any intellectual property rights in such Content by
downloading, modifying, or printing the Content.
Internet Links
Some links on the Service lead to sites posted by independent site owners.
Because WebAssign® has no control over these sites, WebAssign® is not
responsible for such sites' accessibility via the Internet and does not endorse
products, services, or information provided by such sites. As such, WebAssign®
shall not be responsible or liable, directly or indirectly, for any damage or loss
caused or alleged to be caused by or in connection with, use or reliance on any
Content, goods, or services available on or through any other site. Further,
the inclusion of these links does not imply that the other sites have given
permission for inclusion of these links, or that there is any relationship between
WebAssign® and the linked sites. WebAssign® is an independent operating
company and reference to other companies do not imply any partnership, joint
venture, or other legal connection where WebAssign® would be responsible for
the actions of their respective owners.
Conduct
You may only access the Service for lawful purposes. You are solely responsible
for the knowledge of and adherence to any and all laws, rules, and regulations
pertaining to your use of the Service. You agree that you will not:
1. use the Service to commit a criminal offense or to encourage conduct
that would constitute a criminal offense or give rise to a civil liability,
or otherwise violate any local, state, Federal, or international law
or regulation, including, but not limited to, export control laws and
regulations;
2. upload, post, e-mail, or otherwise transmit any unlawful, threatening,
libelous, harassing, defamatory, vulgar, obscene, pornographic, profane, or
otherwise objectionable content;
3. disrupt the normal flow of communication or otherwise act in a manner
that negatively affects other users' ability to engage in real-time
exchanges; or
4. interfere with or disrupt the service or servers or networks connected
to the services, or disobey any requirements, procedures, policies, or
regulations of networks connected to the Service.
Warranty Limitations
WEBASSIGN IS NOT RESPONSIBLE FOR ANY INFORMATION OR CONTENT
CONTAINED WITHIN WEBASSIGN AND MAKES NO REPRESENTATIONS ABOUT
THE SUITABILITY OF THE INFORMATION CONTAINED IN WEBASSIGN FOR ANY
PURPOSE OR AUDIENCE OR ABOUT ITS LEGITIMACY, LEGALITY, VALIDITY,
ACCURACY, CORRECTNESS, RELIABILITY, QUALITY, STABILITY, COMPLETENESS,
OR CURRENTNESS.
YOU AGREE THAT YOUR ACCESS TO WEBASSIGN AND YOUR USE OF THE
SERVICES IS AT YOUR OWN RISK. NEITHER WEBASSIGN, NOR ITS OFFICERS,
DIRECTORS, EMPLOYEES, AFFILIATES, OR AGENTS WARRANT THAT THE
SERVICES WILL BE UNINTERRUPTED OR ERROR-FREE; NOR DO THEY MAKE
ANY WARRANTY AS TO THE RESULTS THAT MAY BE OBTAINED FROM THE USE
OF THE SERVICES OR AS TO THE ACCURACY, RELIABILITY, SUITABILITY OR
CONTENT OF THE SERVICES.
WEBASSIGN AND THE SERVICES ARE PROVIDED ON AN "AS IS," "AS
AVAILABLE" BASIS WITHOUT REPRESENTATIONS OR WARRANTIES OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE OR AUDIENCE, AND NON-INFRINGEMENT. IN NO EVENT WILL
WEBASSIGN OR ITS DIRECTORS, OFFICERS, EMPLOYEES, AFFILIATES, OR
AGENTS BE LIABLE TO YOU OR ANY THIRD PARTY FOR ANY INCIDENTAL,
INDIRECT, SPECIAL, OR CONSEQUENTIAL DAMAGES (EVEN IF WEBASSIGN
HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES), ARISING
OUT OF YOUR USE OF OR INABILITY TO ACCESS WEBASSIGN OR USE
THE SERVICES, INCLUDING WITHOUT LIMITATION, LOSS OF REVENUE OR
ANTICIPATED PROFITS, LOSS OF GOODWILL, LOST BUSINESS, LOST DATA,
COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES
OR LOSSES THAT RESULT FROM MISTAKES, OMISSIONS, INTERRUPTIONS,
DELETIONS OF FILES, ERRORS, DEFECTS, VIRUSES, DELAYS IN OPERATION
OR TRANSMISSION, OR ANY FAILURE OF PERFORMANCE, WHETHER OR
NOT LIMITED TO ACTS OF GOD, COMMUNICATIONS FAILURE, THEFT,
DESTRUCTION, OR UNAUTHORIZED ACCESS TO WEBASSIGN'S RECORDS,
PROGRAMS, OR SERVICES. BECAUSE SOME STATES DO NOT ALLOW
THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR
INCIDENTAL DAMAGES, IN SUCH STATES WEBASSIGN'S LIABILITY IS LIMITED
TO THE GREATEST EXTENT PERMITTED BY LAW.
Indemnification
You agree to indemnify and hold WebAssign®, and its affiliates, officers, agents,
partners, and employees, harmless from any claim or demand, including
reasonable attorney's fees, made by any third party due to or arising out of
content you submit, post to, email, or otherwise transmit through WebAssign®,
your use of the Service, your connection to the Service, or your breach of the
TOU.
Trademarks
WebAssign® is a registered trademark of Advanced Instructional Systems, Inc.
(WebAssign®). pencilPad®, chemPad®, calcPad®, physPad®, and Personal Study
Plan® are registered trademarks of Advanced Instructional Systems, Inc. (dba
WebAssign®). NumberLine is a service mark of Advanced Instructional Systems,
Inc. All other trademarks, service marks, trade dress, and logos used in the
Service are the trademarks, service marks, trade dress, and logos of their
respective owners.
Local Laws
WebAssign® controls and operates the Service from its headquarters in the
United States and makes no representation that the Content is appropriate or
available for use in other locations. If you use the Service from other locations,
you are responsible for compliance with applicable local laws, including, but not
limited to, export and import regulations of other countries. Unless otherwise
explicitly stated, all marketing or promotional materials found on the Service
are solely directed to individuals, companies, or other entities located in the
United States.
Modifications to the Service
WebAssign® reserves the right at any time and from time to time to modify or
discontinue, temporarily or permanently, the Service with or without notice.
You agree that WebAssign® will not be liable to you or to any third party for any
modification, suspension, or discontinuance of the Service.
Termination
You may discontinue your participation in and access to the Service at any time.
The TOU will continue to apply to all past use of the Service by you, even if you
are no longer using them. You acknowledge and agree that WebAssign® may
terminate or block your use of all or part of the Service, without prior notice
for any reason, including, without limitation, if WebAssign® believes you have
engaged in conduct prohibited by this TOU. You agree that upon termination or
discontinuance for any reason, we may delete all information related to you on
the Service and may bar your access to and use of the Service.
General
By accessing the Service, you agree to the above stated TOU. This Agreement
is entered into in the State of North Carolina and shall be construed in
accordance with the laws of North Carolina, exclusive of its choice of law rules.
Each party to this TOU submits to the exclusive jurisdiction of the state and
federal courts having jurisdiction in the State of North Carolina, and waives
any jurisdictional, venue, or inconvenient forum objections to such courts. In
any action to enforce this TOU, the prevailing party will be entitled to costs
and attorney fees. In the event that any provisions of this TOU are held to be
unenforceable, such provisions shall be limited or eliminated to the minimum
extent necessary so that this TOU shall otherwise remain in full force and effect.
This TOU and any posted guidelines or rules applicable to certain services within
the Service constitutes the entire understanding between the parties pertaining
to the subject matter hereof, and any prior written or oral agreements between
the parties are expressly canceled.
If you have any questions about this Agreement, you may contact:
WebAssign®
1791 Varsity Drive, Suite 200
Raleigh, NC 27606