From an administrator's home page, the Admin page can be reached by clicking the "Go to Admin Page" link near the end of the page.
Not all the options described here may be available to you depending upon your rights setting
When you add a new course or click the "Modify" link next to a course name, enter the course name and an enrollment key. If you are allowing students to self-enroll then the enrollment key should be given to students, and will be required for them to enroll in this course, along with the Course ID. For new courses, the course ID will display when you return to the Admin page.
Other option:
Clicking the "Manage Question Set" link will allow you to search through the Question Set, modify questions, add questions, remove question, transfer ownership, or add a set of questions to a question library. Only administrators or question owners have the rights to remove a question. Be aware that if you remove a question that is currently being used in an assessment (as shown in the "Times Used" column), it will mess up that assessment.
The options available in the question set manager are:
Note that the assignment of questions into libraries can be done by anyone, but only the person who made the assignment is able to remove the question from the assigned library
Use the library manager to remove, rename, change rights, change parent, or transfer ownership of question libraries. Be aware that if a library is deleted, the questions in that library will become unassigned; they are not deleted.
Libraries have a tree structure, where each library has a parent library. When you add or modify a library, you can change it's parent library. If you change a library's parent, all children library move with a library. You can only specify an empty library or existing parent library as a parent.
Libraries have use rights. Options are:
With library rights, child rights take precedence over parent rights. For example, if an open library is a child to a private library, the parent will not be hidden from other users. However a private library as child to a private parent will be hidden from other users.
Depending upon the system configuration, non-admins may be limited to creating libraries that are private to others outside their group. If this is the case, a non-admin will need to contact an admin to create a library that is closed or open to all.
Library assignments are done in question management. Library assignments can be done by any user, but only the person who made the assignment can remove that assignment.
Use the "Import Libraries" feature to import an entire library or tree of libraries. Note this feature may be restricted to admin users only. After selecting a file, the tree of libraries in the import file will be shown, and you can deselect libraries you do not want to import. Note that if a parent library is not selected, NONE of the children libraries will be added, regardless of whether they're checked or not.
You will be asked if you want to update existing questions/libraries, or add as new. If a library or question (identified by a unique id) in the import already exists on your system, this will tell the importer whether to update the existing libraries/questions, or import the libraries/questions as a new copy (a new unique id is assigned). If you have modified questions previously imported, you may want to add as new.
Imported libraries and questions will have ownership assigned to the importer. Select the userights you want to apply to all imported questions and libraries. You can select a parent in the library tree for all (top level) imported libraries
If you load a file that does not have a library tree embedded in the file, you will be told to use the Import Question Set feature instead. Even if a file has a library tree, you can use the Import Question Set feature to import specific questions from the file.
A Macro Library contains macros (functions) which can be used in questions. These expand the capabilities of IMathAS. If allowed, installation requires selecting the file name from your local computer and clicking "Submit". Be aware that any existing macro library of the same name will be replaced. A help file is automatically generated for newly installed macro libraries.
Warning!: Macro libraries are pure PHP (programming code), and have a large security risk. Only install macro libraries from a trusted source
The form will guide you through specifying which columns of the CSV file contain First name, Last name, email address, and desired username. Once setting these options, the first five rows of the file will be displayed so you can verify that the import settings are correct. If you selected a class to enroll the imported students in, the students will be both registered and enrolled in that class upon submission.
Groups allow instructors to be divided into groups (by school, for example). Groups can create group-specific libraries, and Group Admins can be assigned to have Admin rights over group users and libraries. By default, users are added to a Default group.
Click Edit Groups to add, modify, or delete groups.
Diagnostics allow you to create a special login page for larger-scale diagnostic assessment. This provides a way for students to access and take the diagnostic without needing to register and enroll in a course. Also, it delivers them the correct assessment based on a specified selection.
If you are a group admin or full admin, click the "Add New Diagnostic" button to set up a new diagnostic. Diagnostics are linked with assessments in a course, so you should first create a course and add your diagnostic assessments to that course.
Over two pages, you will be asked for:
After submitting the second page, you will be provided with the direct access link to the diagnostic, which you can provide to students or use to create a link from another website
In courses for which a diagnostic has been set up, the gradebook will display differently, showing the student unique ID, the term, and the first and second selector values in addition to the students' names and scores
Blocks have a colored header. If a block is displayed collapsed, click the block name or the "Expand" button to view the block's contents. If the block is displayed as a folder (has a folder icon next to it), click the block name to view the block items.
Text items are preceded with an information ! icon, forums are preceded with a F icon, and assessments are preceded with a ? icon. The icons will be grey when the item is not available, and (depending upon install settings) may change color as a deadline approaches. The color is green at two weeks, yellow at one week, and red on due date.
The item order can be rearranged by using the number selector to the left of the item. Items can also be moved into or out of blocks using this selector.
When you as a teacher start a new thread, you are given the option to have it be:
You can use the middle two options to, for example, post discussion instructions. You can use the last option to post a question in class, and have students respond without seeing other students' replies.
When viewing the forum thread list as an instructor, there is a "List Posts by Name" link which will list all posts in the forum, grouped by student name. New threads are colored in black, replies in green
Qustion-specific instructions (deprecated)
Note: The following approach is deprecated, and no longer recommended. Using the [+Text] button on the Add/Remove Questions page instead to insert text between questions.
In the Intro/Instructions box, you can make question-specific instructions by putting a tag of the form [Q #] or [Q #-#] before the text specific to that question or range of questions. Here is an example:
This is the general info
[Q 1]
This text will display before question 1
[Q 3-4]
This text will display before questions 3 and 4. Since there was no tag for question 2, it will display directly after question 1, with no associated intro text. Likewise, if there was a question 5, it would display directly after question 4 with no associated intro text.
You can add existing questions to an assessment by clicking the "Select Library" button to choose libraries to search, then the "Search" button to list potential questions. Leave the "Search" entry blank to list all questions in the libraries selected. The checkboxes can be used to search in all libraries (not just the selected ones), list only questions you own, or exclude questions you've already added to your assessment.
From this list you can:Alternatively, you can click the "Select from Assessments" button to choose questions from existing assessments. In this mode, select the assessments you wish to pull questions from and click "Use these assessments". Then select the questions you wish to use.
Once added to the assessment you can:
Has a video help (if
is shown, the video has captions)
Has help resource
Has a written solutionIn addition to the assignment Introduction, each question can have an individual introduction. A common example is to display a video and then a related question as part of a video assignment.
To add a question introduction, click on + Text below the last question. An editable text box will appear where you can write instuctions or drag in a video link. After you edit your text, click the Save All icon in the editor toolbar. You can expand/collapse each question intro by clicking the Expand and Edit or Collapse icons in the lower right of the question intro. Once you modify a question intro, you'll need to save it to collapse it.
When you click Save All, all changes you have made in any other question intros will also be saved. If you leave a question intro with unsaved changes, the Save All button will be highlighted.
A question intro can be displayed for multiple consecutive questions (except on Embedded assignments). In the Show for selector, select the number of questions that question intro should be used for.
Embedded assignments can include page titles. Check the New Page checkbox to add a page title. Then add your title in the editor and save it.
Below the last questions is an Expand All button which will expand all the question intros. Click on any one to edit it.
If students have taken the assessment, you will not be allowed to make as many changes to the assessment, as it will mess up existing student attempts. If you need to change the assessment a lot, you can clear all student attempts. Otherwise you can change individual question settings (be careful!) or edit the question if it's yours. If there is a problem with the question, you modify it, and want to give students another chance on that question, you can clear all attempts on a single question by clicking the "Clear Attempts" link here
After adding questions to an assessment, click the "Categorize Questions" button to categorize the questions in the assessment. Categorization allows you and students to see a score breakdown by question category.
In the question categorization page, you will see each question listed, followed by a category pull-down. By default, the list contains the names of all libraries containing the question. If you'd like to define a category not in the lists, type in the new category name in the box provided and click the "Add Category" button. The new category name will now appear in the pull-down lists next to each question, and can be selected to assign the question to that category. When you are done, click the "Record" button.
After adding questions to an assessment, click the "Create Print Version" to layout your assessment for printing.
On the first page, you will be asked what you would like to include in the test header. You will also be asked to enter your print margins setup. These can be found by choosing "Page Setup" from the "File" menu in your browser. In the Page Setup you may also wish to remove the default header and footer materials included in printouts by your browser.
On the next page, you will see alternating blue and green rectangles indicating the size of pages. Use the resizing buttons next to each question to increase or decrease the space after each question until the questions fall nicely onto the pages. You can use Print Preview in your browser to verify that the print layout looks correct. After you have completed the print layout, you will be given the chance to specify additional print options. Longer questions, such as those with graphs, may appear cut off in the print layout page. Be sure to resize those questions to show the entire question.
On the next page, select how many versions of the test you would like to generate, and whether you'd like to generate answer keys. After hitting continue, you print version of the test will be displayed. Choose Print in your browser to print your tests.
Quick view is a condensed view of the course page. You can use it to quickly look over your entire course. It is more useful for major editing
It allows easy drag-and-drop reordering of course items. Changes will not be recorded until the "Record Changes" button is pressed.
You can also quickly rename items by clicking on their titles and changing the text. Again, changes will not be recorded until the "Record Changes" button is pressed.
When done in quick view, click the "Return to regular view" link to get back to the regular course page
The calendar can be accessed from the course navigation bars, or by embedding the calendar on your course page. The calendar autopopulates with assessment item due dates, and discussion forum post-by and reply-by dates. Text items have options to place them on the calendar. The calendar displays with the current date on the top line; you can jump later in the future or look in the past using the "< <" and "> >" links above the calendar.
You can add additional items to the Calendar using the "Manage Events" link on the calendar. All items to be placed on the calendar need a date, a description, and a single letter or symbol tag that will show on the calendar
Clicking the "Manage Question Set" link will allow you to search through the Question Set, modify questions, add questions, remove question, transfer ownership, or add a set of questions to a question library. Only administrators or question owners have the rights to remove a question. Be aware that if you remove a question that is currently being used in an assessment (as shown in the "Times Used" column), it will mess up that assessment.
The options available in the question set manager are:
Note that the assignment of questions into libraries can be done by anyone, but only the person who made the assignment is able to remove the question from the assigned library
Use the library manager to remove, rename, change rights, change parent, or transfer ownership of question libraries. Be aware that if a library is deleted, the questions in that library will become unassigned; they are not deleted.
Libraries have a tree structure, where each library has a parent library. When you add or modify a library, you can change it's parent library. If you change a library's parent, all children library move with a library. You can only specify an empty library or existing parent library as a parent.
Libraries have use rights. Options are:
With library rights, child rights take precedence over parent rights. For example, if an open library is a child to a private library, the parent will not be hidden from other users. However a private library as child to a private parent will be hidden from other users.
Depending upon the system configuration, non-admins may be limited to creating libraries that are private to others outside their group. If this is the case, a non-admin will need to contact an admin to create a library that is closed or open to all.
Library assignments are done in question management. Library assignments can be done by any user, but only the person who made the assignment can remove that assignment.
Use the "Import Libraries" feature to import an entire library or tree of libraries. Note this feature may be restricted to admin users only. After selecting a file, the tree of libraries in the import file will be shown, and you can deselect libraries you do not want to import. Note that if a parent library is not selected, NONE of the children libraries will be added, regardless of whether they're checked or not.
You will be asked if you want to update existing questions/libraries, or add as new. If a library or question (identified by a unique id) in the import already exists on your system, this will tell the importer whether to update the existing libraries/questions, or import the libraries/questions as a new copy (a new unique id is assigned). If you have modified questions previously imported, you may want to add as new. Note that only the original importer can update questions they imported.
Imported libraries and questions will have ownership assigned to the importer. Select the userights you want to apply to all imported questions and libraries. You can select a parent in the library tree for all (top level) imported libraries
If you load a file that does not have a library tree embedded in the file, you will be told to use the Import Question Set feature instead. Even if a file has a library tree, you can use the Import Question Set feature to import specific questions from the file.
Use the "List Students" link to list the students in your class. On this page you can import (register and enroll) students from a file, enroll a student (already registered) with a known username. This is the easiest way to add a guest user to your class. Note that the "Last Login" date shows the last time the student logged into IMathAS, not necessarily the last time they accessed your course.
The List Students page also gives you access to student email addresses, as well as a link to send out a mass email or message to all students
The form will guide you through specifying which columns of the CSV file contain First name, Last name, email address, and desired username. Once setting these options, the first five rows of the file will be displayed so you can verify that the import settings are correct. The students will be both registered and enrolled in the current class upon submission.
Click the "Assign section and/or code numbers" link to assign section or code numbers to students. These only serve for identification purposes, the the gradebook will be sorted first by section, then by name. Section can be alphanumeric; code number must be numeric, up to 4 digits.
Click the "Manage LatePasses" link to give students LatePasses. Students can redeed a LatePass for an extension on an online assessment without your intervention, provided you have clicked the "Allow use of latepasses" option in that assessment.
On this page you can also define the number of hours extension a LatePass will grant
Click the "Manage Tutors" link to manage tutors for your class. Tutors can have an instructor account or student account. Tutors will be able to view students' scores and online assessments. If given permission, tutors can edit or enter online or offline scores.
Add tutors by listing their usernames in the box provided. Remove tutors by clicking the "Remove" checkboxes next to tutors and clicking Update
Once tutors are added, you can limit them to a single section of the course. If selected, tutors will only be able to see scores for students in the section they're limited to. This can be used in conjunction with the diagnostic system, since second-level selections become the student's section identifier
Click the "Gradebook" link to show the gradebook. The gradebook shows each student's score on each assessment and any offline grades you've entered. Click on a student's assessment score to show detail on their assessment attempt, or on a student's offline grade to change their grade. Click the Settings link in the table header if you need to change an assessment's settings. Click on an assessment's average score to view an breakdown showing the average score on each question. Click on an offline grade's average score or the Settings link in the table header to change the settings for that item or modify all students' grades at once.
By using checkboxes next to student's names, you can send messages or emails to multiple students, or make due date exceptions for multiple students at once
Click the "Gradebook Settings" to change Gradebook settings and create or modify categories. This allows you to create a grading scheme.
Your overall settings are:
The next section lets you define categories. There is always the "Default" category, but it will not display if there are no items assigned to it. To add a new category, click the "Add Category" link to add a new line to the table, then fill in the name and other info, then click "Update"
For each category, you can specify:
You can then enter grades for each student. If you leave a grade blank, no grade will be recorded for that student. You can edit these settings or edit all students' grades at a later time by clicking the "Average" in the gradebook for this item. You can edit an individual student's grade by clicking on their score in the gradebook for this item. You can leave feedback for students about their grade using the boxes provided.
You can manage offline grades by clicking the "Offline Grades: Manage" link on the gradebook page. This page allows you to delete, change the availability, or change the gradebook assignment of a set of offline grade items.
When you click on a student's score in the gradebook, you will see the specific assessment that they received and the last answer they provided, as well as their score on each question and the attempts used. You can override the scores they received on this page. You can also send a student a message about a question, quoting their version of the question in the message. At the bottom of the page is a box to leave the student feedback about the assessment.
If you wish to give a student another chance to take an assessment, click the "Clear Attempt" or "Clear Scores" link. Note: This will clear their current scores, answers, and attempts used. The "Clear Attempt" link will make it appear the student never started the assessment, and the student will receive a different version of the assessment when they access the assessment. The "Clear Scores" link will clear the student's scores and attempts to 0, but the student will receive the same version of the assessment when they access it.
If you categorized the questions in the assessment, you will also see a category breakdown at the bottom of the details page
The Student Groups page allows you to manipulate student groups associated with assessments that you have designated as group assessments. When you first access this page, you will be presented with a list of group assessments. Select the assessment you want to modify groups for
You will be presented with a list of groups (the group number is arbitrary) with the students in each group. To separate a student from the group, click the "Break from Group" link.
At the bottom of the page is a list of students not assigned to a group. If you wish to assign students to groups, click the checkboxes next to the students' names. In the "add to group: " pulldown, select the group you want to add the students to, or select "New Group", and click Add
When students are broken from the group, they retain the version of the assessment and progress the group had acheived before you broke them from the group. If a student is added to a group, any work they've already done is lost and replaced with the group's version and progress. Any changes to an assessment made by one group member affects all group members.
The message system allows you to send a message to students in the class. This is an internal message system; it is not emailed unless the student has requested email notification.
Click Send New Message to send a new message to a student. If you want to send a message to multiple students, use the "List Students" page. Select a student from the pull-down list, and type your message.
When viewing messages, you can either Reply to the message, or use the "Quote in Reply" option to quote the original message in your reply.
Course Item Copy allows you to copy items in your course or an entire course structure, or copy items from another instructor's course. Note that item structure, items, and settings are exported, but not students, assessment attempts, or forum threads.
On the first page, select a course to copy from. If you select a course that is not one of your own courses, you must enter the course Enrollment Key as verification that you have received permission to copy from the course.
On the second page, select the items you wish to import. If you export an item currently contained in a block and do not export the block, the item will be exported as an item on the main course page.
You can optionally append words to the end of the title of each item, or place the copied items into an existing block.
You can optionally also specify to copy the course settings (the items you'd set under Modify on the Admin page), or copy the gradebook scheme and gradebook categories. Copying the gradebook scheme will overwrite the existing gradebook scheme in your course. Copying the gradebook scheme will also retain any category assignments for the assessments you're copying.
The Change Dates page allows you to change the dates for all your course items on one page. On this page you will see a list of your course items, with inputs for start date, end date, and review date (for assessments). You can filter the list to only show one item type using the Filter selection at the top of the page, and you can change the sort order to sort by start date, end date, or name.
If you change dates on any line and click the "Send down list" button on that line, the date change will be made to all items below that item in the list. For example, if you add one day to an item and click "Send down list", one day will be added to all items lower in the list. By default the system only allows Monday-Friday dates; you can switch to a 7-day week by unchecking the "Shift by weekdays only" checkbox
The Change Assessments page allows you to change assessment settings for many assessments at the same time. Begin by selecting all the assessments you want to change settings for using the checkboxes next to each assessment's name
Select which options you want to change by clicking the checkbox in the "Change?" column, then adjust the setting in the "Option" column. When you are done, click "Submit"
Course Item import/export allows you to share a course setup with other instructors, or copy a class for yourself. Note that item structure and questions are exported, but not students, assessment attempts, or forum threads.
On Export, start by selecting the items you wish to export. If you export an item currently contained in a block and do not export the block, the item will be exported as an item on the main course page. There are options on whether or not to include course and gradebook settings in the export.
On Import, first provide the import file. If there are assessment questions that do not already exist on your system, they will be added to the system. Select the library into which these questions should be imported. If a question already exists, you can select whether to update the existing question with the import question (if it is newer), or create a new copy of the question in the designated library. Select the items to import, and click "Import Items".
IMathAS can be used as a LTI tool using a course-level configuration (LTI 1.1 only) or a global college-wide configuration (LTI 1.1 or 1.3). Use of LTI 1.3 is highly recommended.
Key Types
For a course-level configuration, your LTI key will take the form LTKkey_###_#. The first number, ###, is your course ID. The last number determines how authentication is handled. If that last digit is 0, then when the student accesses the LTI placement, the first time they will be asked to sign into their IMathAS account or create one, and that account will be linked with the account at the host LMS. From then on, when the same student accesses any LTI placement, they will not need to sign in again. They will be able to sign in directly to IMathAS as well.
If the last digit of your LTI key is 1, then a student account will automatically be created the first time a student accesses the LTI placement, and that account will be linked with the host LMS account. The student will not be provided an IMathAS username or password, so they will only be able to access IMathAS resources through the LMS LTI placements.
Note that grade return ONLY works reliably with the _1 type keys, so that type of key is recommended.
LTI Connection Options
IMathAS supports several types of LTI integration, including whole course single-signon, and new links created from the LMS.
The recommended integration technique is to setup individual LTI links for each assessment. This is necessary if you want the grade to be returned from IMathAS to your LMS. The easiest way to set up LTI links in the LMS is to use the Export feature in IMathAS to create links and import those into your LMS. To do this, go to Course Items -> Export, select the items you want to export, your LMS, and Download the CC Export. Then follow the appropriate instructions below.
Alternatively, you can manually create individual links to assignments, or you can create a single link that launches your entire IMathAS course. Be aware that in many LMSs, manually created links to assignments will lose their association with IMathAS assessments when the course is copied in the LMS, so using the Import process is recommened when supported by the LMS.
IMathAS can also be an LTI 1.1 consumer, using the External Tool option for Link items.
LTI 1.3 must be installed by the LMS administrator.
There are two general ways to set up an LTI connection:
The easiest way to set up LTI links in the LMS is to use the Export feature in IMathAS to create links and import those into your LMS. To do this, go to Course Items -> Export, select the items you want to export, your LMS, and Download the CC Export. Then follow the appropriate instructions below.
Alternatively, you can setup individual links to assignments, using your LMS's "deep linking" feature. The specific process varies by LMS.
Note that LTI 1.3 does not support a "whole course link" option, since that option does not allow grade passback.
Go to Course Items → Export, select the items you want to export, select your LMS, and Download the Export Cartridge
To import the cartridge in Canvas:
LTIkey_####_1, where #### is your Course IDhttps://yourIMathASsite/bltilaunch.phpNext you will need to establish the connection between your IMathAS course and Canvas course
Note: When configuring a course-level configuration, the use of a key in the form LTIkey_###_1 is recommended.
With this type of key, students will not have or need a username for IMathAS, and they must
access assignments via the LMS. This is usually desired when doing integration, and is necessary to ensure
grades are passed from IMathAS back to the LMS.
If, however, you are not interested in grade return, and simply want to provide single-signon from your LMS
into IMathAS while allowing direct login to IMathAS as well, then you can
use a key of the form LTIkey_###_0 instead. This will require students to have or create an
account on IMathAS, which they'll have to log into once to establish the connection.
If you have an LTI 1.3 connection or global LTI 1.1 college-wide key and secret, you do not need to set up a course-level configuration. If you need to set up a course level configuration, in your Canvas course:
LTIkey_####_1, where #### is your Course IDhttps://yourIMathASsite/canvas.phpTo create a link to an individual assessment, in Canvas:
To create a single link to your entire IMathAS course, in Canvas:
Go to Course Items → Export, select the items you want to export, select your LMS, and Download the Export Cartridge
To import the cartridge in BlackBoard:
LTIkey_####_1, where #### is your Course IDNext you will need to establish the connection between your IMathAS course and BlackBoard course
Note: When configuring a course-level configuration, the use of a key in the form LTIkey_###_1 is recommended.
With this type of key, students will not have or need a username for IMathAS, and they must
access assignments via the LMS. This is usually desired when doing integration, and is necessary to ensure
grades are passed from IMathAS back to the LMS.
If, however, you are not interested in grade return, and simply want to provide single-signon from your LMS
into IMathAS while allowing direct login to IMathAS as well, then you can
use a key of the form LTIkey_###_0 instead. This will require students to have or create an
account on IMathAS, which they'll have to log into once to establish the connection.
To manually create a link to IMathAS, in Blackboard:
https://yourIMathASsite/bltilaunch.phpLTIkey_####_1, where #### is your Course IDBe aware assessment links created manually in this way will lose their association with IMathAS assessments when the course is copied in BlackBoard, so using the Export/Import process is recommened if you are creating individual assessment links.
Go to Course Items → Export, select the items you want to export, select your LMS, and Download the Export Cartridge
To import the cartridge in Brightspace:
LTIkey_####_1, where #### is your Course IDIMathASNext you will need to establish the connection between your IMathAS course and Brightspace course
Note: When configuring a course-level configuration, the use of a key in the form LTIkey_###_1 is recommended.
With this type of key, students will not have or need a username for IMathAS, and they must
access assignments via the LMS. This is usually desired when doing integration, and is necessary to ensure
grades are passed from IMathAS back to the LMS.
If, however, you are not interested in grade return, and simply want to provide single-signon from your LMS
into IMathAS while allowing direct login to IMathAS as well, then you can
use a key of the form LTIkey_###_0 instead. This will require students to have or create an
account on IMathAS, which they'll have to log into once to establish the connection.
Go to Course Items → Export, select the items you want to export, select your LMS, and Download the Export Cartridge
To import the cartridge in Moodle:
LTIkey_####_1, where #### is your Course IDNext you will need to establish the connection between your IMathAS course and Moodle course
Note: When configuring a course-level configuration, the use of a key in the form LTIkey_###_1 is recommended.
With this type of key, students will not have or need a username for IMathAS, and they must
access assignments via the LMS. This is usually desired when doing integration, and is necessary to ensure
grades are passed from IMathAS back to the LMS.
If, however, you are not interested in grade return, and simply want to provide single-signon from your LMS
into IMathAS while allowing direct login to IMathAS as well, then you can
use a key of the form LTIkey_###_0 instead. This will require students to have or create an
account on IMathAS, which they'll have to log into once to establish the connection.
Go to Course Items → Export, select the items you want to export, select your LMS, and Download the Export Cartridge. The cartridge is an IMS Common Cartridge format.
Import the cartridge into your LMS. If you have an LTI 1.3 connection or global LTI 1.1 college-wide key and secret, skip ahead. Otherwise, you'll likely need to configure the LTI connection by providing the key and secret, which can be found on the Course Settings page.
Next you will need to establish the connection between your IMathAS course and LMS course
Note: When configuring a course-level configuration, the use of a key in the form LTIkey_###_1 is recommended.
With this type of key, students will not have or need a username for IMathAS, and they must
access assignments via the LMS. This is usually desired when doing integration, and is necessary to ensure
grades are passed from IMathAS back to the LMS.
If, however, you are not interested in grade return, and simply want to provide single-signon from your LMS
into IMathAS while allowing direct login to IMathAS as well, then you can
use a key of the form LTIkey_###_0 instead. This will require students to have or create an
account on IMathAS, which they'll have to log into once to establish the connection.
If you have an LTI 1.3 connection or global LTI 1.1 college-wide key and secret, you do not need to set up a course-level configuration. Otherwise, you will need to set up a course-level LTI configuration. Consult your LMS's help for how to do this; some LMSs configure an LTI took at the course settings level, while some have you enter the credentials with each link.
If you need to set up a course-level LTI configuration, you will need:
LTIkey_####_1, where #### is your Course IDhttps://yourIMathASsite/bltilaunch.phpThe process to set up LTI links varies by LMS, so consult your LMS for details.
Be aware assessment links created manually in this way will lose their association with IMathAS assessments when the course is copied in the LMS, so using the Export/Import process is recommened if you are creating individual assessment links and your LMS supports it.
Lines of the common control, question control, and answer sections usually take the form of variable definition. In IMathAS, variables are identified with a dollarsign ($) prefix. For example, $a is the variable a. Most lines will take one of these forms:
$a = 3$a = 3*$b*$c$a = showplot("sin(x)")$a = rand(-5,5)There are a few types of variables:
$a = 15. A calculation like $a = 3^2 will also result in a number$a = array(6,8,10) or $a = [6,8,10]. This is a collection of variables. You can reference the parts using an index (note that arrays are zero-indexed), so $a[0] = 6.$a = array('x'=>3, 'y'=>5) or $a = ['x'=>3, 'y'=>5]. This is a collection of variables, referenced by keys. You can reference the parts using the key as index so $a['x'] = 3.$a = "hi there", or $b = "2/3".$a = trueNote that numbers are not in quotes, and strings are in quotes. When you use the double-quote mark (") to define a string, you can interpolate variables into the string. Example:
$a = 3 $b = 5 $str = "What is $a/$b"
In this example, $str now contains "What is 3/5".
If you need to insert a variable adjacent to text, you can wrap it in curly braces:
$a = rand(2,10)
$str = "The height is {$a}ft"
Note that strings in single quotes will not interpolate variables
As a warning, strings are interpolated literally, so if you had $a = -4 and then defined $b = "$a^2" you would end up with "-4^2", which may not be what you intended. Use explicit parentheses in these cases.
Warning: Strings that we as mathematicians think of as numbers are not numbers.
If $a = "3/4", that defines a string, and if you try to compute
$b = $a*5, that's going to give an error, because you can't multiply
a string by a number. Usually there is an easy workaround, but if you really need
to evaluate something like that, you'll need to use hte evalnumstr function.
In some cases you want to define several variables at once. There are two ways to do this:
In the first example, variables $a and $b each take on a single value. In the second example, the variable $ar is an array; the elements can be accessed as $ar[0] and $ar[1] (note that arrays are zero-indexed). If you use this approach, enclose the variable reference in parenthesis in calculations, like $new = ($ar[0])^2, and in curly brackets inside strings, like $string = "there were {$ar[0]} people".
You can also literally define an array using the "array" function. Examples: $ar = array(2,3,4,5), or $ar = array("red","green","blue")
You can also use a shorthand notation for an array, using square brackets. Example: $ar = [2,3,4,5].
If needed, you can concatenate (combine) two strings using the . operator. Example:
$a = "string one " $b = "string two" $both = $a . $b
Here, $both now contains the string "string one string two"
If you have a long command to type, you can put a "&" at the end of a line to specify it continues on the next line. Example:
$questions = array("this is choice 1",&
"this is choice 2")
If defining a string for display, you can put a "&&" at the end of a line to specify it continues on the next line and insert an HTML line break. Example:
$showanswer = "Do this first. && Then do this."
will be interpreted as:
$showanswer = "Do this first. <br/>Then do this."
For more ways to work with strings, see the string macros section.
Comments
You can insert comments in your code by starting the comment with two forward slashes: //this is a comment. Typically it's best to put comments on their own line, but they can also be placed after a line of code.
Any assignment line can be followed by one of two conditional: "where" or "if".
"where" is used to repeat the previous assignment if the condition provided is not met. The "where" condition is almost exclusively used with array randomizers. Example: to select two different numbers that are not opposites:
$a,$b = diffrands(-5,5,2) where ($a+$b!=0)
Beware that the system will give up if it's unable to meet the specified conditions after 200 tries,
so be sure your where condition has fairly high probability of success, ideally at least 10%. If it doesn't,
you should consider where there are other ways to generate your values. Alternatively, you can
specify a fallback value to use if the condition fails using else:
$a = rand(1,100) where (gcd($a,$b)==1) else ($a = 7)
"where" can also be applied to a block of code:
{
$a = rand(-5,-1)
$b = rand(1,5)
} where ($a+$b !==0)
or with a fallback
{
$a = rand(-5,-1)
$b = rand(1,5)
} where ($a+$b !==0) else {
$a = -3
$b = 5
}
Note that where can also be used for looping. See the help on Loops for examples.
"if" is used to make an assignment conditional. For example:
$a = rand(0,1) $b = "sin(x)" if ($a==0) $b = "cos(x)" if ($a==1)
Note the use of double equal signs (==) for testing equality. A single equal sign (=) will make an assignment (change the value of $a in this example) and return "true", which is probably not what you intended to do.
The "if" condition can also be used before or after a code block like this:
$a = rand(0,1)
if ($a==0) {
$b = 1
$c = 2
}
or
$a = rand(0,1)
{
$b = 1
$c = 2
} if ($a==0)
When "if" is used before a block of code, it can optionally be followed with "elseif" and/or an "else" statement, like this:
$a = rand(0,5)
if ($a==0) {
$b = 1
} elseif ($a==2) {
$b = 3
} else {
$b = 2
}
For very simple if/else cases, you can use the shorthand condition ? then : else ternary syntax. For example:
$b = ($a > 0) ? "increasing" : "decreasing"
An equivalent but potentially friendlier looking option is the ifthen(condition,trueval,falseval) macro (see General Macros)
$b = ifthen($a > 0, "increasing", "decreasing")
For situations where you want to do a series of conditions based on the value options of a variable, you can use the cases macro (see General Macros).
For example, these two code blocks do the same thing:
$a = rand(0,5)
if ($a==0) {
$b = "AA"
} elseif ($a==2) {
$b = "BB"
} else {
$b = "CC"
}
$a = rand(0,5) $b = cases($a, [0, 2], ["AA", "BB"], "CC")
Comparison operators available for "if" and "where" statements:
To do compound conditionals, use || for "or", and && for "and". For example:
$a = nonzerorand(-9,9) where ($a!=1 && $a!=-1)
Within the question text, it's possible to have a section of text display based on the value of a variable. If the text is a single string, it's preferable to define the string conditionally in the question code, then insert the variable for the string in the question text. Putting a conditional direclty in the question text is primarily intended for cases where there is a large block of text to control.
To do conditional text, wrap the text in [if variable==value][/if]. Note that the variable name
should be given without the preceeding dollar sign here. You can use other simple comparisons like != or <, but
not more complicated expressions. The value should not be in quotes, even if it is text. It is fine to have things
like $answerbox inside two conditionals, so long as only one will display at at time.
Example:
[if graphdispmode==0] Given f(x)=$func, estimate f'(x) at x=$x. $answerbox [/if] [if graphdispmode>0] $graph Given the graph above, estimate f'(x) at x=$x. $answerbox [/if]
There are several looping macros (such as calconarray) that can meet most needs. For more general use there is a "for" loop:
for ($i=a..b) { action }
Here a and b represent whole numbers, variables, or simple expressions.
Examples:
$f = 0
for ($i=1..5) { $f = $f + $i }
$a = rands(1,5,5)
$b = rands(1,5,5)
for ($i=0..4) {
$c[$i] = $a[$i]*$b[$i]
}
For associative arrays (arrays with non-numeric or non-consecutive keys) you can use a "foreach" loop:
foreach ($arr as $k=>$v) { action }
Here $arr is the associative array, and as it loops the keys will be assigned to $k and the values to $v.
Example:
$arr = ['red' => 3, 'green' => 5, 'blue' => 2]
$str = ''
foreach ($arr as $color=>$num) {
$str .= "There are $num balls that are $color. "
}
where can be used in the same way a do...until loop might
used in other languages. Example:
{
$a = rand(1,10)
$b = rand(-10,-1)
} where ($a+$b != 0)
while loops are similar to where loops, but evaluate the
condition at the start rather than at the end. Example:
$index = 0
$a = $str[$index]
while ($a == '') {
$index = $index + 1
$a = $str[$index]
}
Conditions after the statement can be used inside a for loop, but not outside without explicit blocking
for ($i=1..5) {$a = $a+$i if ($i>2) } WORKS
for ($i=1..5) {$a = $a+$i} if ($a>2) DOES NOT WORK
{for ($i=1..5) {$a = $a+$i} } if ($a>2) WORKS
Conditions using blocking inside a loop are fine
for ($i=1..5) { if ($i>2) {$a = $a+$i} } WORKS
Inside a for or foreach loop,
break can be used to break out of the loop, and
continue can be used to move on to the next iteration without executing
any further code in the block.
Note on macros: The descriptions below explain macros available and the arguments the functions should be called with. Arguments in [square brackets] are optional arguments, and can be omitted.
For all randomizers, all bounds (min,max) are inclusive.
Single result randomizers:
$a = rand(1,10) // $a might be 7 $b = rand(-5,5) // $b might be -2
$a = rrand(2,5,.1) // $a might be 3.4 $b = rrand(2,5,.01) // $b might be 3.27 $c = rrand(2,8,2) // $c might be 2, 4, 6, or 8
$a = nonzerorand(-5,5) // $a might be -3 or 4, but never 0
$a = nonzerorrand(-2,2,.5) // $a might be -1.5 or 3, but never 0
$color = randfrom("red,green,blue"); // might return "green"
$n = randfrom("2,4,6,8") // might return 4
$arr = [10,20,30]
$val = randfrom($arr) // might return 20$name = randname() // might return "Sofia" $name = randmalename() // might return "Carlos" $name = randfemalename() // might return "Aisha"
$name,$heshe,$himher,$hisher,$hishers,$himherself = randnamewpronouns()
// might give: $name="Carlos", $heshe="he", $himher="him", $hisher="his"...
$str = "$name went to the store to buy a gift for $hisher friend"
$name,$heshe,$himher,$hisher,$hishers,$himherself = randnamewpronouns('neutral')
// always gives they/them pronouns$id = uniqid() // might return "a64f3a2b1c" // Typical use: creating unique HTML element ids in question markup // <div id='graph$id'>
Array randomizers (return multiple results):
$a,$b,$c = rands(1,10,3) // might give 3, 7, 1 (duplicates possible) $a,$b,$c = rands(1,10,3,'inc') // sorted ascending, e.g. 1, 3, 7 $arr = rand(1,10,2) // reference using $arr[0] and $arr[1]
$a,$b,$c = rrands(0,1,.25,3) // might give 0.25, 0.75, 0.5 $a,$b,$c = rrands(0,1,.25,3,'dec') // sorted descending, e.g. 0.75, 0.5, 0.25
$a,$b = nonzerorands(-3,3,2) // might give -1, 2 (never 0) $a,$b = nonzerorands(-3,3,2,'inc') // sorted: -1, 2
$a,$b = nonzerorrands(-3,3,.5,2) // might give -2.5, 1 (never 0)
$a,$b = randsfrom("red,green,blue,yellow", 2) // e.g. "blue", "red"
$arr = [2,4,6,8]
$a,$b = randsfrom($arr, 2, 'inc'); // sorted ascending, e.g. 2, 6$first,$last = jointrandfrom("Alice,Bob,Carlos", "Smith,Jones,Rivera")
// picks the same index from each list, so names stay paired:
// e.g. $first="Bob", $last="Jones"
// can be used to randomly pick a question prompt and answer from corresponding arrays:
$prompt,$answer = jointrandfrom($questionprompts, $allanswers)$a,$b,$c = diffrands(1,6,3) // three distinct values, e.g. 4, 1, 6 $a,$b,$c = diffrands(1,6,3,'inc') // sorted ascending, e.g. 1, 4, 6
$a,$b = diffrrands(0,1,.1,2) // two distinct values, e.g. 0.3, 0.7
$a,$b = diffrandsfrom("red,green,blue,yellow", 2) // two distinct colors, e.g. "green", "red"$a,$b = nonzerodiffrands(-3,3,2) // two distinct nonzero values, e.g. -2, 3
$a,$b = nonzerodiffrrands(-1,1,.5,2) // e.g. -0.5, 1.0 (distinct and nonzero)
// Shuffle names and scores together so they stay paired:
$names,$scores = jointshuffle("Alice,Bob,Carlos", array(95,82,71))
// e.g. $names=array("Bob","Carlos","Alice"), $scores=array(82,71,95)
// Pick 2 from each:
$names,$scores = jointshuffle("Alice,Bob,Carlos", array(95,82,71), 2)
// e.g. $names=array("Bob","Alice"), $scores=array(82,95)
$shuffled = singleshuffle("1,2,3,4,5") // e.g. array(3,1,5,2,4)
$two = singleshuffle("1,2,3,4,5", 2) // pick 2: e.g. array(4,2)$a,$b,$c = randnames(3) // e.g. "Sofia", "Carlos", "Aisha" $a,$b = randmalenames(2) // e.g. "Marcus", "Eli" $a,$b = randfemalenames(2) // e.g. "Priya", "Helena"
$city = randcity() // e.g. "Portland"
$city = randcity("Canada") // e.g. "Calgary"
$c1,$c2 = randcities(2) // e.g. "Austin", "Denver"$state = randstate() // e.g. "Oregon"
$prov = randstate("Canada") // e.g. "Alberta"
$s1,$s2 = randstates(2) // e.g. "Texas", "Ohio"$c = randcountry() // e.g. "Brazil" $c1,$c2 = randcountries(2) // e.g. "Japan", "Mexico"
$a,$b,$c = randpythag() // e.g. 3, 4, 5 (satisfies a^2+b^2=c^2) $a,$b,$c = randpythag(5,20) // triple with values between 5 and 20
Alternate call form: showarrays(array of column headers, array of data arrays, [options]).
Options can be a string "c", "l", or "r" to center, left-align, or right-align data, or an array with
$opts["align"] for alignment, $opts["tablealign"]="center" to center the whole table,
and $opts["caption"] to add a caption. To align each column differently use a character-per-column string like "rcc".
$xs = array(1,2,3)
$ys = array(1,4,9)
$table = showarrays("x", $xs, "y", $ys)
// all columns centered
$table = showarrays("x", $xs, "y", $ys, 'c')
// With alignment and caption:
$opts["align"] = "rc"
$opts["caption"] = "Squares"
$table = showarrays("x", $xs, "y", $ys, $opts)
// or equivalently
$table = showarrays("x", $xs, "y", $ys, ['align'=>"rc", 'caption'=>"Squares"])
// Array-of-arrays alternate call form:
$table = showarrays(array("x","y"), array($xs,$ys))Data is presented in one column unless a column count is provided. Options can be a string "c", "l", or "r" to align data,
or an array with $opts["align"], $opts["tablealign"]="center", and $opts["caption"].
$data = array(10,20,30,40,50,60) $table = showdataarray($data) // single column $table = showdataarray($data, 3) // spread across 3 columns $table = showdataarray($data, 2, "c") // 2 columns, centered $table = showdataarray($data, 2, ['align'=>'c', 'caption'=>"Scores"]) // 2 columns, centered, with caption
Options can be a string "c", "l", or "r" to align data, or an array with $opts["align"],
$opts["tablealign"]="center", and $opts["caption"].
$xs = array(1,2,3,4)
$ys = array(1,4,9,16)
$table = horizshowarrays("x", $xs, "y", $ys)
// Creates a two-row table: "x" row and "y" row, values in columns$data[0] is the first row.
rowlabels and columnlabels are arrays of label strings. Options can be a string "c", "l", or "r" to align data,
or an array with $opts["align"], $opts["tablealign"]="center", and $opts["caption"].
$data = array(array(10,20), array(30,40))
$cols = array("A","B")
$rows = array("Row1","Row2")
$table = showrecttable($data, $cols, $rows)
// table with column headers A and B, row headers Row1 and Row2, first row 10, 20
// Single function:
$graph = showplot("x^2")
// With window
$graph = showplot("x^2,blue", -3, 3, -1, 9, 1, 1, 300, 300)
// Drawn larger, 300x300
$graph = showplot("x^2", -5, 5, -5, 5, 1, 1, 300, 300)
// With window and scaling, labels spaced at 2 in x and 20 in y,
// grid spaced at 1 in x, 10 in y.
$graph = showplot("2^x", -3, 12, -20, 200, "2:20", "1:10")
// dashed line, with axes labeled x and y, no grid lines
$graph = showplot("3-x,blue,,,,,,dash", -5, 5, -5, 5, "1:1:x:y", 0)
// Multiple functions with dot and label:
$funcs = array("x^2,blue", "2*x+1,red", "dot,1,1,closed,blue", "text,1,1,A,blue,above")
$graph = showplot($funcs, -4, 4, -2, 10)
// Parametric curve:
$graph = showplot("[cos(t),sin(t)],blue,0,6.28", -1.5, 1.5, -1.5, 1.5)
// Domain with hole:
$graph = showplot("1/x,black,-5,5!0", -5, 5, -5, 5)
// Piecewise, first line ends at closed dot, second starts at open dot
$funcs = ["3-x,blue,-6,1,,closed","-2+x,blue,1,6,open"]
$graph = showplot($funcs)
$g1 = showplot("x^2,blue")
$g2 = showplot("2*x,red")
$combined = mergeplots($g1, $g2)// Draw x = y^2 by drawing y = x^2 then inverting:
$g = showplot("x^2,blue")
$g = invertplot($g)
$g = replacealttext($g, "Graph of x equals y squared")Set axis to "y" for the y-axis; defaults to x-axis.
Step can be a fraction like "1/4" or a pi multiple like "pi/4" or "2pi".
// Trig graph with pi/2 labels on x-axis:
$g = showplot("sin(x),blue", 0, 6.3, -1.2, 1.2)
$g = addfractionaxislabels($g, "pi/2")
// x-axis now shows 0, pi/2, pi, 3pi/2, 2pi$g = showplot("x^2,blue")
$g = addlabel($g, 1, 1, "A", "red", "above")
$g = addlabel($g, -2, 4, "(-2,4)", "blue", "left")$g = showplot("x^2,blue")
$g = addlabelabs($g, 0, 200, "My Graph", "black", "belowright")$g = showplot("x^2,blue", 0, 10, 0, 10)
$g = addplotborder($g, 30) // 30px border all sides
$g = addplotborder($g, 30, 30, 5, 5) // wide left and bottom border for axis labels$g = showplot("x^2,blue")
$g = adddrawcommand($g, "stroke='green'; line([0,0],[1,1]);")$g = showasciisvg("initPicture(0,10,0,10);path([[0,0],[0,10],[10,10],[0,0]]);", 100, 100, "A Triangle")$g = showplot("x^2,blue")
$g = replacealttext($g, "Graph of y equals x squared, a parabola opening upward")// assuming $img is an attached image $img = changeimagesize($img, 300) // 300px wide $img = changeimagesize($img, 300, 400) // 300x400px
Image can be a URL or an uploaded image variable. Not screenreader-friendly — provide alt text on the image.
Put "centerelements" anywhere after the image to center subsequent labels at their coordinates instead of using top-left anchoring.
Alternate form: textonimage(img, array("Label A", 50, 30, "Label B", 150, 30)).
You can use this helper tool to help
you form the inputs.
// $img is an uploaded image variable $img = replacealttext($img, "A diagram of a field with width $w ft and height $h ft.") $result = textonimage($img, "$w ft", 50, 30, "$h ft", 150, 80) // Centered labels: $result = textonimage($img, "centerelements", "A", 100, 50, "B", 200, 50) // answerboxes on image. use [AB0], [AB1] etc for multipart // define $readerlabel for each to describe what its the input for $img = replacealttext($img, "A right triangle with legs $a and $b. The hypotenuse is unknown.") $res = textonimage($img, $a,50,80, $b,20,50, "[AB]",60,60) $readerlabel = "The hypotenuse of the triangle"
$img2 = addimageborder($img) // default 1px border $img2 = addimageborder($img, 2, 5) // 2px border, 5px whitespace margin
$xs = array(1,2,3,4) $ys = calconarray($xs, "x^2") $dots = arraystodoteqns($xs, $ys, "blue") $g = showplot($dots, "0:-1", 5, "0:-2", 20, "1:2", "1:2")
$xs = array(0,1,2,3) $ys = array(0,2,1,3) $lines = connectthedots($xs, $ys, "red") $g = showplot($lines, -1, 4, -1, 4)
$answerformat = "twopoint,dot" $xs = array(1,2,3) $ys = array(1,4,9) $answers = arraystodots($xs, $ys) // an $answers for a Drawing question
$answerformat = "twopoint,line"
$grid = "-5,5,-5,5"
$snaptogrid = .5
if (stuansready($stuanswers, $thisq, null, 'draw')) {
$lines = gettwopointlinedata($stuanswers[$thisq], $grid, $snaptogrid)
if (count($lines)==1) {
// $lines[0] = array(x1, y1, x2, y2) for the first line drawn
$slope = ($lines[0][3] - $lines[0][1]) / ($lines[0][2] - $lines[0][0])
}
}Type should be one of: 'line', 'lineseg', 'ray', 'parab', 'halfparab', 'horizparab', 'sqrt', 'cubic', 'cuberoot', 'rational', 'exp', 'genexp', 'log', 'genlog', 'sin', 'cos', 'abs', 'vector', 'circle', 'ellipse', 'rect'. Points are returned in click order — for 'parab', the first point is the vertex; for 'rect', the two opposite corners. 'genexp'/'genlog' return a 5th array entry for the asymptote value. Use 'circlerad' to return array(x-center, y-center, radius), 'ellipserad' for array(x-center, y-center, x-radius, y-radius), or 'rectdim' for array(width, height).
$answerformat="twopoint,parab"
if (stuansready($stuanswers, $thisq, null, 'draw')) {
$curves = gettwopointdata($stuanswers[$thisq], 'parab');
// For a parabola: $curves[0] = array(x_vertex, y_vertex, x_point, y_point)
if (count($curves)>0) {
$vx = $curves[0][0];
$vy = $curves[0][1];
}
}Type should be one of: 'line', 'lineseg', 'ray', 'parab', 'halfparab', 'horizparab', 'sqrt', 'cubic', 'cuberoot', 'rational', 'exp', 'genexp', 'log', 'genlog', 'sin', 'cos', 'abs', 'circle', 'ellipse'. For 'horizparab', output is in terms of y. For 'circle'/'ellipse', output is an expression in x and y equaling 1. Add a final argument 'showequation' (optionally with custom variable names like 'showequation,x,y') to return implicit equations.
$answerformat = "twopoint,sqrt"
$grid = "-5,5,-5,5"
$snaptogrid = .5
if (stuansready($stuanswers, $thisq, null, 'draw')) {
$formulas = gettwopointformulas($stuanswers[$thisq], 'sqrt', $grid, $snaptogrid)
// $formulas[0] is a string like "3*sqrt(x-2)"
$eqns = gettwopointformulas($stuanswers[$thisq], 'sqrt', $grid, $snaptogrid, 'showequation,t,y')
// $eqns[0] is a string like "y=2*sqrt(t+1)"
}if (stuansready($stuanswers, $thisq, null, 'draw')) {
$dots = getdotsdata($stuanswers[$thisq]);
// $dots[0] = array(x, y) of the first closed dot
}if (stuansready($stuanswers, $thisq, null, 'draw')) {
$dots = getopendotsdata($stuanswers[$thisq]);
// $dots[0] = array(x, y) of the first open dot
}if (stuansready($stuanswers, $thisq, null, 'draw')) {
$lines = getlinesdata($stuanswers[$thisq]);
// $lines[0] = array of points for the first curve
// $lines[0][0] = array(x, y) of the first point on that curve
}Type should be 'linear' or 'quadratic'. style will be 'ne' for strict inequality (dashed border) or 'eq' for inequality with equality (solid border).
if (stuansready($stuanswers, $thisq, null, 'draw')) {
$ineqs = getineqdata($stuanswers[$thisq], 'linear', $grid, $snaptogrid);
// $ineqs[0][0] = 'ne' or 'eq' (dashed or solid border)
// $ineqs[0][1..6] = x1,y1,x2,y2,x3,y3 of the three control points:
// (x1,y1) and (x2,y2) for the line, (x3,y3) for the shading point
}$dims = getsnapwidthheight(-5, 5, -5, 5, 200, 200, 0.5) // Use $dims[0] as width and $dims[1] as height where you need the actual width and heightNote: You generally can avoid needing to use this function by passing $grid and $snaptogrid to any of the get___data functions above, rather than passing the width and height. In some cases you might want to use this function to determine a more exact width and height to use in the $grid to ensure pixel-perfect snapping.
$a = rand(-5,5)
$nice = makepretty("x+$a") // "x+3" or "x-2" depending on sign of $a$a = rand(-5,5)
$disp = makeprettydisp("(x+$a)/7"); // e.g. "`(x-3)/7`"$a = rand(1,5) $poly = "$a x^2 + 0 x + 1 x^0" $nice = polymakepretty($poly); // e.g. "3x^2+1" or "x^2+1" $disp = polymakeprettydisp($poly); // backtick-wrapped math display version
$expr = "1*x^2+0*x^1+1*x^0" $nice = makexxpretty($expr) // "x^2+1" $disp = makexxprettydisp($expr) // math display version
(1)(x^1)sin(x) -> x sin(x))
3x+x+3+5/2 -> 4x+3+5/2)3x+x+3+5/2 -> 4x+11/2)
5x^2*2x^5 -> 10x^7, x/x^2 -> 1/x)
false to add explicit *.simplifyexpr("1x^2+0x+(3)") // "x^2+3"
simplifyexpr("2x+5+3y+(4x-1)","x,y",1) // "6x+4+3y"
simplifyexpr("1/2x+1/4x+1+1/2^2","x",2) // "3/4x+5/4"
simplifyexpr("(6xy)/(8y^3)","x,y",3) // "(3x)/(4y^2)"
$b = rand(-5,-1) // a negative number $expr = "3+$b" // like "3+-4" $nice = makepretynegative($expr) // "3+(-4)"
numtowords(1203) // "one thousand two hundred three" numtowords(1203, true) // "one thousand two hundred third" (ordinal) numtowords(1203, false, true) // "1203rd" (numeric with ordinal suffix) numtowords(1203, false, false, true) // "one thousand, two hundred three" (with comma)
Options is a string combining any of: 'mixed' (mixed number output), 'literal' (suppress simplifications), 'over' or 'by' (connect with that word), 'hyphen' (hyphenate the fraction). If both 'over' and 'by' are given, 'over' wins. If both 'mixed' and 'literal' are given, 'mixed' wins.
fractowords(5, -2) // "negative five halves" fractowords(6, 3) // "two" (reduced to integer) fractowords(6, 3, 'literal') // "six thirds" (no simplification) fractowords(2, 3, 'hyphen') // "two-thirds" fractowords(3, 4, 'by') // "three by four" fractowords(3, 4, 'over') // "three over four" fractowords(-7, 4, 'mixed') // "negative one and three fourths" fractowords(-7, 4, 'mixed over') // "negative one and three over four"
numtoroman(14) // "XIV" numtoroman(14, false) // "xiv" numtoroman(1999) // "MCMXCIX"
prettyint(1234567) // "1,234,567" prettyint(1000) // "1,000"
prettyreal(1234.567, 2) // "1,234.57" prettyreal(1.8, 3) // "1.800" prettyreal(1234.5, 2, "") // "1234.50" (no comma)
prettyreal_instring("The value is 1234.567 dollars", 2)
// "The value is 1,234.57 dollars"round_instring("Pi is about 3.14159", 3) // "Pi is about 3.142"
round_instring("roughly 3.7 people", 0) // "roughly 4 people"prettysmallnumber(0.0000002) // "0.0000002" (not "2E-7") prettysmallnumber(0.0000002, true) // "0.000 000 2"
prettysigfig(12345.6, 3) // "12,300" prettysigfig(0.00456, 2) // "0.0046" prettysigfig(123, 4) // "123.0" prettysigfig(123, 4, ",", true) // "123" prettysigfig(12345.6, 3, "", false, true) // "1.23*10^4" (sci notation)
prettysigfig_instring("The mass is 1234.56 kg", 3) // "The mass is 1,230 kg"makescinot(1234.5) // "1.2345 xx 10^3" makescinot(1234.5, 2, '*') // "1.23*10^3" makescinot(1234.5, 2, "E") // "1.23E3"
prettytime(90, 'm', 'hm') // "1 hour and 30 minutes" prettytime(3661, 's', 'hms') // "1 hour, 1 minute, and 1 second" prettytime(754, 'm', 'clock') // "12:34pm" prettytime(754, 'm', 'sclock') // includes seconds: "12:34:00pm"
dispreducedfraction(6, 9) // "`2/3`" dispreducedfraction(3, 4, true) // "`3//4`" dispreducedfraction(2, 3, false, 'pi') // "`(2pi)/3`"
makereducedfraction(6, 9) // "2/3" makereducedfraction(3, 4, true) // "3//4" makereducedfraction(6, 9, false, 'pi') // "(2pi)/3" // Get reduced parts as separate values: $num,$den = makereducedfraction(6, 9, 'parts'); // $num=2, $den=3
decimaltofraction(0.75) // "3/4" decimaltofraction(1.5) // "3/2" decimaltofraction(1.5, 'mixednumber') // "1 1/2"
htmldisp("x_1^2 + x_2^2") // renders subscripts and superscripts in HTML
htmldisp("x^2 + y^2", "x,y") // also italicizes the variables x and y
Note: It's usually better for accessibility to use the math renderer (wrap the expression in backticks).formatcomplex(2, 3) // "2+3i" formatcomplex(2, -3) // "2-3i" formatcomplex(0, 1) // "i" formatcomplex(3, 0) // "3"
rawurlencode("hello world!") // "hello%20world%21"stringappend("hello", " world") // "hello world"
stringappend(array("cat","dog"), "s") // array("cats","dogs")stringprepend("world", "hello ") // "hello world"
stringprepend(["A","B"], "$") // array("$A","$B")today() // "July 3, 2026"
today("Y-m-d") // "2026-07-03"
today("D, M j") // "Tue, Jul 3"stringpos("lo", "hello") // 3
stringpos("xyz", "hello") // -1 (not found)stringlen("hello") // 5
stringlen("") // 0stringclean(" hello ") // "hello"
stringclean("h e l l o ", 1) // "hello"
stringclean("hi there! 2", 2) // "hithere2"substr("hello abc", 6) // "abc"
substr("hello abc", 0, 5) // "hello"
substr("hello abc", -3) // "abc"
substr("hello abc", 6, -1) // "ab"strtoupper("hello") // "HELLO"ucfirst("hello world") // "Hello world"strtolower("HELLO") // "hello"lcfirst("Hello World") // "hello World"substr_count("hello world", "l") // 3
substr_count("aababc", "ab") // 2str_replace("cat", "dog", "I have a cat") // "I have a dog"
// Array replacement:
str_replace(array("cat","dog"), array("feline","canine"), "I have a cat and a dog")
// "I have a feline and a canine"$found = preg_match("/\d+/", "abc123", $m);
// $found = true, $m[0] = "123"
$found = preg_match("/^[a-z]+$/", "hello", $m);
// $found = true (all lowercase letters)$count = preg_match_all("/\d+/", "abc 12 def 34", $m);
// $count = 2, $m[0] = array("12","34")preg_replace("/\s+/", "_", "hello world foo") // "hello_world_foo"
preg_replace("/\d+/", "NUM", "abc 12 def 34") // "abc NUM def NUM"levenshtein("hello","help") // 2; one deletion, one replacement
listtoarray("1,2,3,4") // array("1","2","3","4")
listtoarray("red,green,blue") // array("red","green","blue")
listtoarray("1,2,3,4", true) // array(1,2,3,4) (as numbers)calclisttoarray("2^2,3^2,4^2") // array(4,9,16)
calclisttoarray("pi,3/2") // array(3.14159..., 1.5)explode(",", "a,b,c") // array("a","b","c")
explode(":", "x:y:z") // array("x","y","z")arraytolist(array(1,2,3)) // "1,2,3" arraytolist(array(1,2,3), true) // "1, 2, 3"
joinarray(array("a","b","c")) // "a,b,c"
joinarray(array("a","b","c"), " + ") // "a + b + c"
joinarray(array("x","y"), " and ") // "x and y"
$a[2]="c";$a[0]="a";$a[1]="b";
$g = joinarray($a) // "c,a,b" in order defined
$g = joinarray($a,",",true) // "a,b,c" ordered by key/index
stringtoarray("abc") // array("a","b","c")
stringtoarray("123", true) // array(1,2,3)fillarray(0, 5) // array(0,0,0,0,0)
fillarray("x", 3, 2) // array(2=>"x", 3=>"x", 4=>"x")
fillarray(1, array(0,2,4)) // array(0=>1, 2=>1, 4=>1)
// for a multipart question with 5 number parts:
$anstypes = fillarray("number",5)
consecutive(1, 5) // array(1,2,3,4,5) consecutive(0, 1, .25) // array(0, 0.25, 0.5, 0.75, 1) consecutive(2, 10, 2) // array(2,4,6,8,10)
// Set a single value at multiple keys: $arr = fillarray(0, 5); // array(0,0,0,0,0) $arr = arraysetvalues($arr, array(1,3), 99); // array(0,99,0,99,0) // Set different values at each key: $arr = fillarray(0, 5); // array(0,0,0,0,0) $arr = arraysetvalues($arr, array(0,2), array(10,20)); // array(10,0,20,0,0) // If you had 10 large inputs and two small ones at parts 3 and 7: $answerboxsize = fillarray(20, 10) // 10 inputs, size 20 $answerboxsize = arraysetvalues($answerboxsize, [3,7], 5) // set index 3 and 7 to size 5.
sortarray(array(3,1,4,1,5)) // array(1,1,3,4,5)
sortarray(array(3,1,4,1,5), "rev") // array(5,4,3,1,1)
$a = ['c'=>1, 'a'=>4, 'b'=>5]
sortarray($a, 'key') // array("a" => 4, "b" => 5, "c" => 1)
$b[0]=3; $b[5]=2; $b[2]=5;
sortarray($b, 'keyfill', 7) // array(3,"",5,"","",2,"","")
$xs = array(3,1,2) $ys = array(9,1,4) $xs,$ys = jointsort($xs,$ys) // $xs=array(1,2,3), $ys=array(1,4,9)
$a = consecutive(1,4) $b = calconarray($a, "x^2") // array(1,4,9,16) $c = calconarray($a, "2*x+1") // array(3,5,7,9)
$xs = array(1,2,3)
$ys = array(4,5,6)
$zs = multicalconarray("x*y", "x,y", $xs, $ys) // array(4,10,18)$a = array(1,2,3,4,5) $b = calconarrayif($a, "x^2", "x>3") // array(1,2,3,16,25) // Only squares elements greater than 3 $b = calconarrayif($a,"x+.1","floor(x)==x") // will add .1 to add whole numbers in the array, and leave the other elements unchanged.
$a = array(1,2,3,4,5,6); keepif($a, "x%2==0") // array(2,4,6) — keep only even numbers keepif($a, "x>3") // array(4,5,6)
subarray($a,2,4,6): picks $a[2], $a[4], $a[6]subarray($a,"1:3","6:8"): picks $a[1] through $a[3] and $a[6] through $a[8]subarray($a,$b): picks entries from $a at the indices listed in array $b$a = array(10,20,30,40,50); subarray($a, 1, 3) // array(20,40) subarray($a, "1:3") // array(20,30,40) subarray($a, array(0,2,4)) // array(10,30,50)
$a = array(5,6,7,8,9); splicearray($a, 1, 2) // array(5,8,9) (removed 2 elements at index 1) splicearray($a, 1, 2, array(20,30)) // array(5,20,30,8,9)
$a = array(1,2,3) $b = array(4,5,6) mergearrays($a, $b) // array(1,2,3,4,5,6)
unionarrays([1,2,3], [2,3,4]) // array(1,2,3,4)
intersectarrays(array(1,2,3,4), array(2,4,6)) // array(2,4)
diffarrays(array(1,2,3,4), array(2,4)) // array(1,3)
array_unique([1,2,2,3,3,3]) // array(1,2,3) (possibly non-consecutive keys) array_values(array_unique(array(1,2,2,3,3,3))) // re-indexed: [0,1,2]
array_values(array(2=>"a", 5=>"b", 8=>"c")) // array(0=>"a", 1=>"b", 2=>"c")
array_keys(array("x"=>1, "y"=>2, "z"=>3)) // array("x","y","z")count(array(10,20,30,40)) // 4
is_array(array(1,2,3)) // true is_array(5) // false
sumarray(array(1,2,3,4,5)) // 15
in_array(3, array(1,2,3,4,5)) // true
in_array("red", array("blue","green")) // falsearrayfindindex("green", array("red","green","blue")) // 1
$a = arrayfindindex(4, [3,4,5,4]) // 1, since that is the index of the first 4
arrayfindindices("x", array("x","y","x","z","x")) // array(0,2,4)
$a = arrayfindindex(4, [3,4,5,4]) // array(1,3)
array_flip(array("a"=>1, "b"=>2, "c"=>3)) // array(1=>"a", 2=>"b", 3=>"c")print_r($a) // prints array structure in question warning output $s = print_r($a, true); // store as string, then include $s in question text
$a = rand(1,10); $desc = ifthen($a > 5, "large", "small"); // "large" or "small" $sign = ifthen($a >= 0, "positive", "negative");
Tolerance defaults to 0.0015 relative error. Prefix with | for absolute tolerance, like "|0.1". String comparison is exact — "0.5" will not match 1/2.
$n = rand(1,4);
$word = cases($n, array(1,2,3,4), array("one","two","three","four"));
// if $n=3, returns "three"
// With default fallback:
$result = cases($n, array(1,2), array("yes","no"), "other");
// returns "other" if $n is neither 1 nor 2$def = formhoverover("compound interest", "Interest calculated on principal and accumulated interest");
// Place $def in question text to show a tooltip on hover$popup = formpopup("See formula", "A = P(1 + r/n)^(nt)");
$popup = formpopup("Help", "https://example.com/help", 400, 300, "button");$hint = forminlinebutton("Show hint", "Try factoring the numerator.", "button");
$note = forminlinebutton("Note", "Remember to simplify.", "link", "inline");$requiretimes = makenumberrequiretimes(array(2, 3, 3, 12)) // "#2,=1,#3,=2,#12,=1" // $requiretimes ensures 2, 3, and 12 all appear in the student's answer
$boxes = ABarray(5, 3); // array("[AB5]","[AB6]","[AB7]")
// Embed answer boxes in a table:
$anstypes = fillarray("number", 3)
$xs = array(1,2,3);
$table = showarrays("x", $xs, "y", ABarray(0,3));if (stuansready($stuanswers, $thisq, null)) {
$parts = getntupleparts($stuanswers[$thisq], 2, true)
// For student answer "(3,4)": $parts = array(3,4)
// Returns false if input is not a valid ntuple
if ($parts !== false) {
$x = $parts[0]
$y = $parts[1]
}
}
// for calculated n-tuple question, use $stuanswervals to get decimal values
// if student entered "(3/4, 5)"
getntupleparts($stuanswers[$thisq],2) // array("3/4", "5")
getntupleparts($stuanswersval[$thisq],2,true) // array(0.75, 5)
$stuanswers[$thisq].
For calculated types, use $stuanswersval[$thisq].$answer. Must be called after $answer is defined.'0;1' — parts 0 and 1 are swappable'0;1;2' — parts 0, 1, and 2 are all swappable['0;1','2;3'] — 0↔1 and 2↔3 independently'0,1,2;3,4,5' — the group [0,1,2] is swappable with the group [3,4,5].
Comparison is only made on the first entry to decide whether to swap the groups.['variables'=>$variables] when type is 'numfunc'.// Allow parts 0 and 1 to be answered in either order: $answer = scoremultiorder($stuanswers[$thisq], $answer, '0;1', 'number'); // With weights also swapped: $answer,$answeights = scoremultiorder($stuanswers[$thisq], $answer, '0;1', 'number', $answeights) // numfunc with variables: $answer = scoremultiorder($stuanswers[$thisq],$answer,'0;1','numfunc',null,['variables'=>$variables]) // based on choice in calculated part at index 0 and 3, swap groups $answer = scoremultiorder($stuanswersval[$thisq], $answer, '0,1,2;3,4,5', 'calculated');
// Single-part algebraic expression question: $answerformat = "list"; $variables = "k"; $answer = "pi/6 + 2pik, pi/3+2pik"; $showanswer = "`$answer`"; $answer = scoreperiodic($answer, $stuanswers[$thisq], "k"); // "-11pi/6+2pik" will now be accepted as equivalent // Multipart (part index 3, numfunc type): $answer[3] = "pi/12 + pi/3*n"; $variables[3] = "n"; $showanswer[3] = "`$answer[3]`"; $answer[3] = scoreperiodic($answer[3], getstuans($stuanswers,$thisq,3), "n");
Place the returned string in question text instead of $answerboxes.
To show a single combined answer key, define $showanswer[lastpart] and place [SAB0-N]
after the entry in the question text. Use $answerboxsize[part] to adjust box size.
Set $showanswerstyle = "inline" to keep the key on the same line.
The alt format string should be a plain text string using the same [AB#] inputs, which will be used for
students who have disabled the equation editor for accessibility
// Integral with three fill-in areas (lower limit, upper limit, integrand): $anstypes = "number,number,numfunc" $entry = setupmathquillfillin( "int_([AB0])^([AB1]) [AB2] dx", "The integral from [AB0] to [AB1] of [AB2] dx" ); $showanswer[2] = "`int_$a^$b $func dx`" // Place $entry in question text where the expression goes, [SAB0-2] after it
$a = sin(pi/6); // 0.5 $b = cos(0); // 1 $c = tan(pi/4); // 1
arcsin(0.5) // pi/6 ≈ 0.5236 arccos(1) // 0 arctan(1) // pi/4 ≈ 0.7854 atan2(1, 1) // pi/4 (first quadrant) atan2(-1, 0) // -pi/2
abs(-5) // 5 abs(3) // 3
sqrt(16) // 4 root(3)(8) // 2 (cube root of 8) root(4)(81) // 3
gcd(12, 8) // 4 gcd(12, 8, 6) // 2
lcm(4, 6) // 12 lcm(3, 4, 6) // 12
sign(-7) // -1 sign(3) // 1 sign(-7, true) // "-" sign(3, true) // "+" sign(-7, "onlyneg") // "-" sign(3, "onlyneg") // ""
sgn(-7) // -1 sgn(0) // 0 sgn(3) // 1
hexdec("1F") // 31
hexdec("FF") // 255dechex(31) // "1f" dechex(255) // "ff"
$n = 5 $result = $n! // 120 $result = 0! // 1
evalfunc("x^2", "x", 3) // 9
evalfunc("x^2*y", "x,y", 2, 3) // 12
evalfunc("x^2+x", "x", "sin(x)") // (sin(x))^2+(sin(x))
evalnumstr("(2*pi)/3") // ≈ 2.0944
evalnumstr("sqrt(2)+1") // ≈ 2.4142
evalnumstr("3/2+3i", true) // array(1.5,3)
$ans = getstuans($stuanswers, $thisq) // single-part question $ans = getstuans($stuanswersval, $thisq, 2) // numerical part index 2 of a calculated multipart
'number'// Single-part question:
if (stuansready($stuanswers, $thisq, null)) {
// safe to use $stuanswers[$thisq]
}
// Multipart — require parts 0 and 1, allow part 2 to be blank:
if (stuansready($stuanswers, $thisq, array(0,1,"~2"), $anstypes)) {
// process answers
}
// verify $stuanswers[$thisq] is a matrix with numeric entries
if (stuansready($stuanswers, $thisq, null, 'matrix', 'checknumeric')) {
// verified
}
// verify a calculated answer represented a valid number
if (stuansready($stuanswersval, $thisq, null, 'calculated', 'checknumeric')) {
// $stuanswerval[$thisq] is a number
}
comparenumbers(0.3333, 1/3) // true (within default 0.1% tolerance)
comparenumbers(1.001, 1, .01) // true (within 1% relative tolerance)
comparenumbers(1.5, 1.49, "|0.02") // true (within 0.02 absolute)
comparenumbers("sqrt(4)", 2) // true (evaluates expressions)Each value must be of the form: [number]*[unit]^[power]*[unit]^[power].../[unit]^[power]....
'per' may be used for division. 'unit squared', 'square unit', 'unit cubed', 'cubic unit' are accepted.
Tolerance defaults to 0.1% (0.001) relative; prefix with | for absolute.
comparenumberswithunits("3.45 feet", "3.5 feet", "|.1") // true to .1 absolute tolerance
comparenumberswithunits("9.8 meters per second squared", "9.8 m/s^2") // true
comparenumberswithunits("100 cm", "1 m") // true
comparenumberswithunits("100 cm", "100") // falsecomparecomplex("2+3i", "2+3i") // true
comparecomplex("sqrt(-4)", "2i") // true
comparecomplex("e^(pi*i)", "-1") // truecomparentuples("(1,2,3)", "(1,2,3)") // true
comparentuples("(1,2)", "[1,2]") // false (brackets differ)
comparentuples("(1,2)", "[1,2]", .001, "ignoreparens") // true
comparentuples("(1.005,2.02)", "(1,2)", array(.01,.1)) // true. different tol per element"xmin,xmax" to specify a domain for comparison, or
"xmin,xmax,integers" to restrict to integer values.comparefunctions("x^2+2*x+1", "(x+1)^2") // true
comparefunctions("sin(t)^2+cos(t)^2", "1", "t") // true
comparefunctions("x*y", "y*x", "x,y") // true (multivariable)
comparefunctions("sqrt(x)", "x^(1/2)", "x", .001, "0,5") // true, test domain adjustedcomparesameform("x+2", "2+x") // true (commutation ok)
comparesameform("2*(x+1)", "2*x+2") // false (expanded vs factored)
comparesameform("(t+2)(t+3)", "(t+3)(t+2)", "t") // true comparelogic("p^^q", "q^^p", "p,q") // true (and is commutative)
comparelogic("~(p^^q)", "~p vv ~q", "p,q") // true (De Morgan's law)
comparelogic("p->q", "~p vv q", "p,q") // true (material conditional)$a = 5 isset($a) // true isset($b) // false ($b not yet defined)
is_numeric("3.14") // true
is_numeric("3/4") // false
is_numeric("abc") // falseare_numeric(1, 2.5, 3) // true are_numeric(1, "x", 3) // false are_numeric([3,"3/2"]) // false
$a = sqrt(-1)
is_nan($a) // true
is_nan(5) // false
is_nan("sqrt(-1)") // triggers an error; cannot use on strings$words = array("slope", "negative")
// Single-part question:
$answer,$showanswer = scorestring($answer, "", $words, $stuanswers, $thisq);
// Multipart question (part 2):
$answer,$showanswer = scorestring($answer, $showanswer, $words, $stuanswers, $thisq, 2);checkanswerformat("3/4", "fraction") // true
checkanswerformat("0.75", "fraction") // false
checkanswerformat("6/8", "reducedfraction") // falsegetsigfigs("0.0450") // 3
getsigfigs(0.0450) // 2 because it's not a string so the 0 gets lost
getsigfigs("1.234") // 4
getsigfigs("1200") // 2, but is ambiguous without hint
getsigfigs("1200", 3) // 3 (resolves ambiguity)//single part
$feedback = getfeedbackbasic("Great job!", "Not quite — try again.", $thisq);
// Part 2 of a multipart:
$feedback = getfeedbackbasic("Correct!", "Check your work.", $thisq, 2);
// Correct message only shows when all three parts are right:
$feedback = getfeedbackbasic("All correct!", "Review your answers.", $thisq, [0,1,2]);$feedbacktxt = array( "That's too small.", "Correct!", "That's too large.", "Way off." ); $feedback = getfeedbacktxt($stuanswers[$thisq], $feedbacktxt, $answer);
// for part 2 of a multipart $feedback = getfeedbacktxtessay( getstuans($stuanswers, $thisq, 2) "Thank you for your response. The key concepts to include are..." );
$partialcredit = array(10, 1, 10.3, 0.5) // answer 10 = full credit, 10.3 = half credit
$feedback = getfeedbacktxtnumber(
$stuanswers[$thisq],
$partialcredit,
array("Correct!", "Close, but check your rounding."),
"Incorrect, the answer is 10."
)// Check the answer "1/2" twice: once requiring fraction format, once without:
$partialcredit = array("1/2", 1, "1/2", 0.5)
$answerformat = ["fraction", ""] // different answerformat per check in $partialcredit
$feedback = getfeedbacktxtcalculated(
$stuanswers[$thisq],
$stuanswersval[$thisq],
$partialcredit,
array("Correct!", "Right value, but give your answer as a fraction"),
"Incorrect",
$answerformat
)$partialcredit = array("x+1", 1, "x^2+1", 0.5)
$feedback = getfeedbacktxtnumfunc(
$stuanswers[$thisq],
$partialcredit,
array("Correct!", "Close, check whether that's linear or quadratic."),
"Incorrect, the answer is x+1."
)If an IMathAS administrator has installed other Macro Libraries, you can load a macro library by entering the line
loadlibrary("list of library names") at the beginning of the Common Control section.
Examples: loadlibrary("stats") or loadlibrary("stats,misc")
Click on the "Macro Library Help" link in the question editor to get a list of installed macro libraries and the macros available in each library
IMathAS uses ASCIIMath for math entry. In question text or inside strings that
will be displayed in the question text, wrap expressions to be rendered in the
backtick/grave symbol, like `x^2`. That key is usually located on the same keyboard button as the tilde.
For calculations, a limited subset is available:
| Symbol | Meaning |
|---|---|
| * / + - | Multiply, divide, add, subtract |
| ^ | Powers. 2^3 = 8. |
| e, pi | The standard constants |
| % | Modulus of integers (remainder after division. 5%2 = 1) |
| mod(p,n) | Modulus of integers. This version gives positive results for modulus of negative numbers. |
| fmod(p,n) | Modulus of decimal values. May give negative results from negative inputs. |
| ! | Factorial |
| sqrt | Square root |
| sin,cos,tan,cot,sinh,cosh | Standard trig function. Be sure to enter as sin(2), not sin 2 |
| arcsin,arccos,arctan,arcsinh,arccosh | Inverse trig functions. |
| sin^-1, cos^-1, tan^-1 | Alternative entry for inverse trig functions. Use like sin^-1(0.5) |
| ln | Natural Logarithm base e |
| log | Common Logarithm base 10 |
| abs | Absolute Value. Note that while abs() is used for calculations, you may prefer to use | brackets for display |
| round(n,d) | round number n to d decimal places |
| roundsigfig(n,s) | round number n to s significant digits. This is for calculations; if you need a value for display and want to ensure trailing 0's display, use prettysigfig |
| floor,ceil | floor/ceiling: integer below/above given number |
| min,max | min or max of the passed values. Can be used as min($a,$b,$c) or min($arrayvariable). |
For display only, the full ASCIIMath language is available (which includes support for a limited subset of LaTeX). For more info, see the ASCIIMath syntax.
While writing a question, it can be handy to quickly solve a formula for a variable. For example, if you're writing a question that asks students to solve y=($a x + $b)/($b x - $a) for x, where $a and $b are randomized variables. You might need to calculate the correct answer. The Solver tool can help solve or check the solution.
#create symbolic variables
x,y,a,b,c,d = var('x,y,a,b,c,d')
# solve the equation for x
solve( y==(a*x+b)/(c*x-d) , x )
x = var('x')
#Differentiate
diff( 3*x^4 , x )
x = var('x')
#Plot in a standard window
plot( -x^2+4 , (x,-10,10) )
x = var('x')
#Simplify
simplify( 5*x+7*(-3*x-4) )
Tips:
var() as above. By default, x is a variable.
solve() diff() integral() give the independent variable after a comma.
plot() a range for the independent variable must be specified, e.g. (x, -10, 10).
$answer = result to the Common Control (not available if $answer is already defined).
The accessible alternative option, near the bottom of the question editor, allows you to specify an alternative question ID to display if the student has accessibility settings enabled.
You most likely should not use this feature. It is intended for the rare case where a question cannot be made accessible using the built-in accessibility features, like some questions using jsxgraph, Geogebra, etc. If your question uses static images, graphs generated using showplot, or is a standard Drawing type question, you DO NOT NEED this feature, and will make things worse by using it.
The system automatically generates textual alternatives for graphs generated using showplot, histogram,
etc., and displays those when the student has the visual text alternatives setting enabled. If the default
text alternative is insufficient or inappropriate, use replacealttext to replace the
default with a custom-written alternative. If using a non-interactive jsxgraph visual, you can use the
description> option in jsxBoard to add alternative text.
To check what is generated and shown, you can test the question with
different accessibility settings in the question Preview. Note you may need to use the browser's
inspector to "see" alt-text added to static images.
Likewise, the system automatically provides a keyboard-based alternative for drawing questions when the student has the keyboard based drawing setting enabled.
It is always preferable to make the original question accessible when possible rather than specifying an alternative. But if your question cannot be reasonably made accessible, this option allows you to specify a different question ID to show the student instead. Your goal should be to pick a question that assesses equivalent concepts but in a different way.
For the "Use accessible alternative", you can select to have the alternative displayed:
<div aria-hidden=true></div> to hide it from a screenreader, and add
a <div class="sr-only"></div> after it containing a textual description
of the visual element, which will be visually hidden but available to a screenreader.
All question types can support these options:
For a single question (not multipart), to use hints, in the common control (or question control) section define the array $hints where:
$hints[attempt number] = "hint text"
For example:
$hints[0] = "This will show on first display" $hints[1] = "This will show on second attempt (after 1 missed attempt)" $hints[2] = "This will show on third and subsequent attempts, since no later values have been defined"
It is fine, for example, to not define $hints[0] if you want nothing to display initially.
Then in the question text, place the location of the hint using the variable $hintloc.
In multipart questions, you can follow the process above if you just want a single strand of hints for the entire problem. If you want per-part hints, define the $hints array as:
$hints[question part number][attempt number] = "hint text"
Then in question text, place each hint using $hintloc[question part number]
To have the hint to display based on a set of previous answers, you can use:
$hints[question part number][attempt number] = array("hint text", [part num1, part num 2])
This will display the hint after all the parts listed have had the required attempts or are correct.
To override the default Hint: text, set $hintlabel.
To provide help of some sort for a question (typically, links to videos, book references, etc), define $helptext in the common control section. Any text assigned to this variable will show at the bottom of the question. The display of this text is controlled by the same "show hints?" option that controls the display of hints described above.
To create multipart questions that are graded on consistency, or to create a set of lab-type problems that rely on student-provided data, you can reference students' previous answers in your question code. You will only be able to reference the student answer to some question types
Notes (important!):
1) If the student has not answered the question, then $stuanswers[N] === null, with the exception of drop-down select questions, where $stuanswers[N] == "NA" if no selection is made. To prevent divide-by-zero errors and other issues and to prevent students from exploiting this, it is highly recommended that you do something like:
if (stuansready($stuanswers, $thisq, [0])) {
// stuff using $stuanswers[$thisq][0]
}
2) If you use $stuanswers in your $answer, $showanswer will not be defined until the student answers. If you follow the advice in #1 above, then your $showanswer will reflect the random number assigned to $a. For this reason, it is highly recommended that you custom define the $showanswer.
3) If using the $stuanswers array in a string or in the Question Text, you must enclose it with curly brackets:
Your answer was {$stuanswers[$thisq][0]}. If using it directly in a calculation,
enclose it in parentheses just to be safe.
4) $stuanswers[$thisq] is defined for question scoring, but may not be for question display.
5) You can use the function getstuans($stuanswers,N,P) to retrieve a student answer value. This method bypasses some strange things that happen when there is a multipart question with only one part, so is recommended.
6) You can use the function stuansready($stuanswers,$thisq,[p1,p2,...]) to determine if the parts have been answered, instead of checking for null. It also provides options for checking format or if the entry is numeric, so is highly recommended.
A few other special purpose variables can be referenced:
$requestclearla = true if ($attemptn==2 && !$scoreiscorrect[$thisq])You can import in the Common Control code from another question using
includecodefrom(questionid)
where questionid is the ID number of the question you want to import the code of. In the source question, the variable $included will automatically be set to true when the question has been included, so it can be used to determine if the question has been imported into another question, or is running independently.
For example, in the master/source question, you might use the code:
if (!$included) {
$type = rand(0,4)
}
do stuff here
In a question using this code, you could limit to a specific type using:
$type = 0 includecodefrom(1234)
Question text can be also brought in from another question by using
includeqtextfrom(questionid)
somewhere in the Question Text portion of the question.
In the question text, you can add a note that will only be viewable by the teacher while grading.
Do this by wrapping the teacher note in the [teachernote] shortcode like this: [teachernote]This is the note[/teachernote]
If you need to hide content from view, you can wrap it in <div class="hidden"></div>.
Be aware the content is still in the page, so a student can still view the hidden content
using the browser inspector, so don't use this to hide secret info, but it can be helpful
if you need to hide an answerbox that is being populated by some other means.
If you want to toggle a block of content, one option for shorter content is to use
forminlinebutton. For longer content, you can wrap the content in a block using
<div data-toggler="Title for button"></div>. That will
hide the wrapped content, and add a button with the specified title for toggling the
content. You can optionally add a data-toggler-hide attribute as well
if you want a different button label once the content is showing.
The student is asked to enter a number (integer, decimal, or scientific notation). The answer is compared to a given tolerance. Can also accept DNE, oo (Infinity), and -oo (Negative Infinity) as answers.
// a question asking for the mean of 3 numbers $a,$b,$c = diffrands(1,20,3) $answer = ($a+$b+$c)/3 // a rounding question $a = rand(1,9) + rand(2,9)/10 + rand(5,9)/100 $answer = round($a,1) $abstolerance = 0 // require an exact answer, no tolerance // a money question $answer = $initial*(1+$rate/100)^$years $reqdecimals = 2 // require accurate to cents; allows more than 2 // $reqdecimals = "=2" // would require exactly 2 decimals // a list of answers $answerformat = "list" $answer = "$root1,$root2"
Required Variables
Optional Variables
$answer = "3 kg/m^2".
The student's answer can be in other equivalent units, so "300 cm" is considered equivalent to "3 m".
The answer must be in the format [decimal number]*[unit]^[power]*[unit]^[power].../[unit]^[power]*[unit]^[power]...,
though multiplication can be implied. Also, 'per' may be used for division of units, and 'unit squared', 'square unit',
'unit cubed' and 'cubic unit' may be used. Note that the units do not require mathematically-proper parens around the denominator.
The decimal number can include basic scientific notation in 3E5 or 3*10^5 formats. Examples: 4 cm, and 3.5E4 feet per second squared
Note that tolerances are scaled to the unit, so $answer = "3m" with $abstolerance = .1 would mean
.1 meters, so "310cm" would still be within tolerance. If $reqsigfigs is set, the specified
number of sigfigs will need to be present in the student's answer, regardless of units.
A student is asked to enter a number or a calculation, like 2/3, 5^2, or sin(2). Can also accept DNE, oo (Infinity), and -oo (Negative Infinity) as answers.
// an answer expecting a reduced fraction answer to a/b+c/d $answer = makereducedfraction($a*d+$c*$b, $b*$d) $answerformat = "reducedfraction" // check the stu answer is reduced // require two answers to x^2=$a $answerformat = "list" $answer = "sqrt($a),-sqrt($a)" // have student evaluate sin(pi/6) $answerformat = "notrig" // prevents them just typing sin(pi/6) $answer = "1/2"
Required Variables
Optional Variables
$ansprompt = "One value, x=;No values;Many values"A student is asked to select the correct answer from those given. The order of choices is automatically randomized.
// select the what function to use $questions = ['sin','cos','tan'] $answer = 0 // index 0, so the answer is 'sin' // define one option at a time $questions[0] = "There is exactly one solution" $questions[1] = "There are no solutions" $questions[2] = "There are infinitely many solutions" $answer = 1 // index 1: There are no solutions $noshuffle = "all" // don't shuffle option order // Make a dropdown for completing an expression $questions = ['>','<','='] $answer = 0 $displayformat = "select" // display as drop-down
Required Variables
Optional Variables
A student is asked to select all the choices given that are correct. The order of choices is automatically randomized.
// select all the functions with period 2pi $questions = ['sin','cos','tan'] $answers = "0,1" // indexes 0 and 1 are both correct
Required Variables
Optional Variables
$answers="", and you can
add "None of these" yourselv to $questions, but this provides another way to always include the
"None of these" option.A student is asked to match answers with questions
// match each function with its derivative
$questions = ['sin(x)','cos(x)','x^2','e^x']
$answers = ['cos(x)','-sin(x)','2x','e^x']
// matchlist when one answer matches with multiple questions
$questions=array("34","`2/3`","3+4i")
$answers=array("real","complex")
$matchlist = "0,0,1"
$displayformat = "select" // puts the $answers in dropdowns next to each $question
Required Variables
Optional Variables
A student is asked to enter a function (algebraic expression or equation).
// basic expression in x. System will accept anything algebraically equivalent $answer = "$a(x-$h)^$k" // an equation answer $variables = "x,y" $answerformat = "equation" $answer = "y=$m x + $b" // multiple expressions $answerformat = "list" $answer = "x+$a,x+$b" // require "same form" $variables = "t" $answer = "$g(t-$a)(t-$b)" $answerformat = "sameform" // check for something specific in answer $answer = "$a(x-$b)^2+$c" // make sure there 1 $a and 0 sqrt in the student answer $requiretimes = "#$a,=1,sqrt,=0" // specify domain, to prevent evaluation issues $answer = "sqrt(x-$a)" $domain = "$a,$a+10" // calc integral answer; allow anything +c $answer = "x^3+4" $answerformat = "toconst"
Required Variables
Optional Variables
A student is asked to enter a string (a word or list of letters).
// basic vocab question $answer = "categorical" // scoring logic expressions $variables = "p,q" $answer = "p vv q"
Required Variables
Optional Variables
A student is asked to enter a free-response answer. The essay type is not automatically graded.
// enable the text editor on the essay box $answerformat = "editor" // give credit for any non-blank answer $scoremethod = "takeanything"
Required Variables
None - the essay type is not computer graded.
Optional Variables
Drawing questions require the student to draw one or more lines/curves or dots. Dots are graded right/wrong. Lines/curves are graded based on the deviation of the drawn line from the correct line.
// have students graph a parabola on a standard grid
$answerformat = "twopoint"
$snaptogrid = 0.5
$answers = "$a(x-$h)^2+$k"
// have students graph an exponential on a modified grid
$grid = "-2,10,-2,10"
$answerformat = "twopoint,exp,genexp,log,genlog"
$answers = "$a*$b^x"
$snaptogrid = 0.25
// have students draw a tangent line to a drawn parab
$answerformat = "twopoint,line"
$background = "x^2,red"
$answers = "2x-1"
$snaptogrid = 0.5
// have students plot points in the first quadrant
$grid = "0:-1,10,0:-10,100,2,10"
$answerformat = "twopoint,dot"
$answers = ["$x1,$y1","$x2,$y2"]
$snaptogrid = "1:5"
// graph on a number line
loadlibrary("interval")
$answerformat = "numberline"
$answers = intervalstodraw("(-2,3]")
Required Variables
Recommended Variables
$answerformat="twopoint" will use a different set of drawing tools for specific shapes that all use two control points to define the shape. It is strongly recommended you use these instead of the older tools.
$answerformat = "polygon" can be used for drawing a single polygon; give $answer as array of points in order joined with edges.
$answerformat = "closedpolygon" can be used for drawing a single polygon that is closed; the enclosed area will be shaded and the drawing terminate when the shape is closed. The format is the same as "polygon", except make sure the first and last entry of your $answers array are identical.
$answerformat="inequality" will use a set of drawing tools for graphing linear inequalities in two variables. Give $answers for non-vertical lines in form like ">=3x+4", "<5x+4", and "x<=3" for vertical lines.
$answerformat="inequality,parab" will use a set of drawing tools for graphing quadratic inequalities in two variables. Give $answers in form like ">=x^2-4", "<x^2+1". Use $answerformat="inequality,both" to turn on lines and parabolas.
$answerformat="inequality,abs" will use a set of drawing tools for graphing absolute value inequalities in two variables. Give $answers in form like ">=abs(x-3)+4", "<3abs(x)". Use $answerformat="inequality,line,abs,parab" or some combo to turn on multiple tools.
$answerformat="numberline" will use a set of drawing tools for graphing inequalities or points in one variable on a number line. Give $answers as dots and line segments, or use the intervalstodraw function from the interval macro library to form the $answers array.
$answerformat="freehand" will allow freehand drawing without any drawing tools. This mode can NOT be autograded, and should only be used for manually graded answers.
$answerformat can also be used to limit the older tools: $answerformat = "line", or $answerformat = "line,dot"
Optional Variables
$background = ["x^2,red","alt:a parabola"]. For a background using draw, add the alt at the
end of your commands, like: "draw:line([1,1],[3,3]);alt:a line segment". Note that this
provided alt will replace everything, including the basic window information.
N-Tuple questions require the student to enter an n-tuple or list of n-tuples. This can be used for coordinate points, vectors, or any other n-tuple of numbers.
// enter two points $displayformat = "pointlist" $answer = "($a,$b),($c,$d)" // enter a vector $displayformat = "vector" $answerformat = "dimensionhint" $answer = "<$a,$b,$c>"
Required Variables
Optional Variables
Calculated N-Tuple questions require the student to enter an n-tuple or list of n-tuples. This can be used for coordinate points, vectors, or any other n-tuple of numbers. This is identical the the N-tuple answer type, but allows students to enter mathematical expressions rather than just numbers, such as (5/3, 2/3).
// enter a point with fraction components $displayformat = "point" $fx = makereducedfraction($nx,$dx) $fy = makereducedfraction($ny,$dy) $answers = "($fx,$fy)" $answerformat = "fraction"
Required Variables
Optional Variables
Complex N-Tuple questions require the student to enter an n-tuple or list of n-tuples of complex numbers. This can be used for coordinate points, vectors, or any other n-tuple of complex numbers. This will require the student to enter each complex number in a+bi form.
// enter a complex point $displayformat = "point" $answer = "(2+3i,4-5i)"
Required Variables
Optional Variables
Calculated Complex N-Tuple questions require the student to enter an n-tuple or list of n-tuples of complex numbers. This can be used for coordinate points, vectors, or any other n-tuple of complex numbers. This is identical the the Complex N-tuple answer type, but allows students to enter mathematical expressions rather than just numbers, such as (5/3+sqrt(2)i, 2/3+1/4i).
// enter a complex point $displayformat = "point" $answer = "(2/3+3i,1/2-5i)" $answerformat = "reducedfraction"
Required Variables
Optional Variables
Algebraic N-Tuple questions require the student to enter an n-tuple or list of n-tuples of algebraic expressions. This can be used for parameterized points or vectors, or any other n-tuple of algebraic expressions. This is similar to the other N-tuple answer types, but allows students to enter algebraic expressions rather than just numbers, such as (x, x^2, 4-x).
// enter a vector of functions $displayformat = "vector" $variables = "t" $answer = "<cos(t),sin(t),t>"
Required Variables
Optional Variables
Complex questions require the student to enter a complex number in a+bi form.
// basic answer $answer = "$a + $b i"
Required Variables
Optional Variables
Calculated Complex questions require the student to enter a complex number in a+bi form. This is identical to the Complex answer type, but allows students to enter mathematical expressions rather than just numbers, such as 1/3+sqrt(2)i.
// basic answer $answer = "1/2 + 3/4 i" // to allow non-"a+bi" form $answerformat = "sloppycomplex" $answer = "(5+3i)/2" // allow plus/min $answerformat = "sloppycomplex,allowplusminus" $answer = "(3+-sqrt(2)i)/2" // allow complex-equivalent $answerformat = "generalcomplex" $answer = -1 // will accept e^(i pi)
Required Variables
Optional Variables
The student is asked to enter a matrix of numbers (integer, decimal, or scientific notation). The entries are compared to a given tolerance.
// standard entry; student will use equation editor $answer = "[(1,2),(3,4)]" // provide a 2x3 grid of boxes to fill in $answersize = "2,3" $displayformat = "augmented" // put augment lines in entry $answer = "[(1,2,3),(4,5,6)]"
Required Variables
Optional Variables
The student is asked to enter a matrix of numbers or calculations, like 2/3 or 5^2. The entries are compared to a given tolerance.
// standard entry; student will use equation editor $answer = "[(1/2,2),(sqrt(3),4)]" // provide a 2x3 grid of boxes to fill in $answersize = "2,3" $answer = "[(1/2,2,5),(-1/3,5,6)]" $answerformat = "fraction" // require entries be fractions
Required Variables
Optional Variables
The student is asked to enter a matrix of complex numbers in a+bi form with decimal or integer coefficients.
// standard entry; student will use equation editor $answer = "[(1+i,2,3i),(8,5+i,6)]"
Required Variables
Optional Variables
The student is asked to enter a matrix of complex numbers or calculations, like 2/3+1/3i or 5^2.
// 2x2 grid of boxes to enter answer $answersize = "2,2" $answer = "[(1/2+i,3i),(8,5+i)]" $answerformat = "nodecimal" // disallow decimal answers
Required Variables
Optional Variables
The student is asked to enter a matrix of algebraic expressions, like x^2 or 3t+1.
$answer = "[(x,x^2,3),(4,5+x,2)]"
Required Variables
Optional Variables
A student is asked to enter an interval notation answer. Example: (2,5]U(7,oo)
// an interval notation answer $answer = "(2,3]" // two acceptable answers $answer = "(2,3) or [2,3]"
Required Variables
Optional Variables
A student is asked to enter an interval notation answer. Example: (2,5]U(7,oo). Values can be entered as calculations rather than numbers, like [2/5,sqrt(8)]. Can use $answerformat="inequality" to require the student to use inequalities rather than interval notation.
// an interval notation answer $answer = "(1/2,5]U(7,oo)" $answerformat = "fraction" // require fraction answers // inequality format answer $answerformat = "inequality" $variables = "t" // $answer is still specified in interval notation, // but student will enter t>=2 $answer = "[2,oo)"
Required Variables
Optional Variables
A student is asked to enter a chemical formula, or use $answerformat="reaction" to ask for a reaction equation.
// A basic molecule answer $answer = "Ca (O H)_2" // a reaction $answerformat = "reaction" $answer = "2H+O->H_2O" $variables = "H,O" // adds buttons to the editor
Required Variables
-> for a right arrow,
and <-> for an equilibrium arrow, like "2H+O->H_2O".Optional Variables
A student is asked to enter a sketch a molecule, using the Kekule drawing tool. If the student has enabled the keyboard-based drawing accessibility option, they will be presented with a textbox for them to write out a description instead.
Required Variables
Optional Variables
A student is asked to upload a file. The file upload type is not automatically graded. The file must be an allowed file type, one of these extensions: @whitelist@.
Required Variables
None - the file upload type is not computer graded.
Optional Variables
This type of question can contain multiple parts, where each part is one of the previous question types.
// A basic multipart question with an ntuple part and an expression
$anstypes = "ntuple,numfunc"
$displayformat[0] = "point" // sets displayformat on part index 0
// answer to the first part (index 0): coordinate of vertex
$answer[0] = "($h,$k)"
// answer to second part: equation of parab
$answer[1] = "(x-$h)^2+$k"
// A multipart question with 3 number parts
$anstypes = fillarray("number",3)
// the answers to the parts, defined as
$answer[0] = $a
$answer[1] = $b
$answer[2] = $c
// if we don't index an option, it will apply to all parts
$answerboxsize = 3
Required Variables
Optional Variables
$reqdecimals=1, and it will apply to all parts.
But if you do this, you can't set an indexed value for one one/some parts.
If you want to change the default value for most parts but have a different value for some, set
$defaults['variable'] = value, like $defaults['answerboxsize'] = 5,
and that will change the default value for that variable, and you can still override that
default for specific parts, like $answerboxsize[2]=3. Be aware that using
$defaults will generally apply the variable for ALL parts, which may cause some unexpected behavior.
Note that defaults for abstolerance or reltolerance will not be applied to Drawing question parts, since
those variables have special meaning in that context.Scaffolding
Scaffolded questions, also know as Sequential Multipart questions, allow you to break a question up into chunks, where the second chunk only shows after the first chunk is correctly answered or the student runs out of tries. This allows you to use the answer to the first chunk in the second without "giving away" the answer, and allows a student who gets stuck on the first chunk to move on to the rest of the question.
Note: scaffolding is only available in the new assessment interface. If you are using the old interface, the question will behave like a regular multipart question.
Scaffolded questions are an extension of Multipart questions. To turn a multipart question into a scaffolded question, just add an isolated line with three or more slashes in the Question Text where you want the chunks broken apart.
An example: (in the Question Text)
To simplify $a(x+$b) + $c, first we need to distribute: $a(x+$b) = $answerbox[0] /// Next, combine like terms: $a x + $ab + $c = $answerbox[1]
A variation on multipart questions, a conditional question can include multiple answer boxes, but assigns a single score. The score is based on applying some comparison or conditional test to the student answers, referenced through the $stuanswers array. This allows the question writer to essentially create their own question type.
// A simple "two numbers that add to 5"
$anstypes = "number,number"
if (stuansready($stuanswers,$thisq,[0,1],$anstypes,'checknumeric')) {
$a = getstuans($stuanswers, $thisq, 0)
$b = getstuans($stuanswers, $thisq, 1)
$answer = comparenumbers($a+$b, 5) // answer can be true/false
}
Required Variables
'manual': will assign a score of 0 but treat the whole question
as a manual-grade question.Optional Variables
Scaffolding
While not as simple as scaffolding multipart questions,
you can add scaffolding to a Conditional question. As with multipart,
put an isolated line with three slashes in the question text to indicate
where the breaks occur. Then you will need to set $seqPartDone[pn]
to true for each part index once that part should be considered
completed. The scaffolding will move onto the next chunk when
all parts in the previous chunk have $seqPartDone
set to true.
At the Login page, if you are not currently registered as a student, click the "Register as a New Student" link. You will be asked to provide:
When you click "Sign Up", you will be taken back to the Login page so you can log in
At the Login page, you will be asked to supply your login credidentials (username and password).
If you forget your password, click the "Forgot Password" link and enter your username. The system will send you an email with a link to click to reset your password. Check your email's spam filter if you don't receive the email in a few minutes.
If you forget your username, click the "Forgot Username" link and enter your email address. The system will send you an email with your username. Check your email's spam filter if you don't receive the email in a few minutes.
If you still having trouble logging in, or never receive the "Forgot Password" or "Forgot Username" emails, contact your instructor. They can help you check that your email address is correct, look up your username, and reset your password.
The home page lists the classes you're currently taking, and also has options for enrolling in a course, changing your password, changing your user profile, or logging out of the system.
To modify your user profile, click the "Change User Info" link in the top right corner.
Your profile allows you correct errors in your name, update your email address, and change your password. You can also upload a picture of yourself or an avatar that your instructor and other students will see with your forum posts and messages.
You can also adjust settings for whether or not to show a list of new messages and forum posts on the home page.
The Accessibility and Display Preferences in the user profile allow you to personalize how you interact with the system, and allow you to work around technical issues.
x^2+4sqrt(x).At your home page, click the "Enroll in a New Class" button to sign up for a new course. You'll need to enter the Course ID number and Enrollment Key in the box provided. If you do not know these, ask your instructor.
Many courses will have a Calendar link which will display a calendar showing upcoming due dates and other special events. You can click on a specific day to view a more detailed listing of the events for that day. You can use that list to access assignments and other items.
Keep in mind that not everything from the course will display on the calendar, so be sure to actually look at the course page, not just rely on the calendar.
The color of the items on the calendar will change based on how far away the due date is; items in green are futher away, items in yellow are closer, and items in red are approaching the due date.
The course page will have a link to the Course Map, a condensed list view of everything in the course. The Course Map can help you locate items in the course that are buried in folders.
For some types of questions, you need to enter a mathematical expression. The system follows order of operations, so use grouping symbols as much as necessary.
Many times, you can click a yellow arrow that displays next to the answer box when you click in it, which will open up the MathQuill equation editor, which you can use to help enter your answers.
Alternatively, you can enter your answer using calculator-style notation. Here is some help on how to enter expressions:
| Symbol | Meaning |
|---|---|
| * / + - | Multiply, divide, add, subtract |
| ^ | Powers. 2^3 = 8. |
| sqrt | Square root. sqrt(4) = 2 |
| ( ) | Parentheses, for grouping. (2+6)/2 = 4, while 2+6/2 = 5. |
| e, pi | The standard constants |
| abs | Absolute Value. abs(-4) = 4 |
| sin,cos,tan,sec,csc,cot,sinh,cosh | Standard trig function. Be sure to enter as sin(2), not sin 2 |
| arcsin,arccos,arctan,arcsinh,arccosh | Inverse trig functions. Note arcsec, arccsc, and arccot are not defined |
| sin^-1, cos^-1, tan^-1 | Alternative entry for inverse trig functions. Use like sin^-1(0.5) |
| ln | Natural Logarithm base e |
| log | Common Logarithm base 10 |
| ! | Factorial |
| DNE | Does Not Exist. This is also often used for "no solutions". |
| oo | Infinity. Those are two lowercase o's, like the middle of the word "look" |