NOTICE: EXAMVIEW END-OF-LIFE ANNOUNCEMENT
As of June 30, 2024, ExamView will officially reach its end of life.
Please be advised that after ExamView’s end-of-life date of June 30th, 2024, we will no longer be providing updates, security patches, or technical support for any version of ExamView. Our obligations to maintain or support ExamView will cease as of this date. Continued use of ExamView post end-of-life may expose you to increased security vulnerabilities, compatibility issues, and potentially reduced functionality. To avoid these risks and ensure uninterrupted service, we encourage migrating to EchoExam, which is designed to offer superior security, compatibility, and a range of advanced features that align with current technological standards. For questions click here.
Special Functions
ExamView Test Generator provides you with numerous special functions to use when defining variables, conditions, and user-defined functions.
choose |
expression choose(int which, expression arg1, expression arg2, ...) - or - expression choose(int which, list dataList) This function will select the argument at the which location in the list of arguments. The expression will be evaluated and returned. All of the arguments must be of the same type (string or numeric). If which is greater than the number of arguments, the function will use the remainder part of which to choose an argument. EXAMPLEwhich = rand(5) choose(which, 1, 14, 3.2, 6, 9) will return 3.2 when which = 3 - or - which = rand(5) listOfData = list(1, 14, 3.2, 6, 9) choose(which, listOfData) will return 9 when which = 5 |
decs* |
string decs(double x) This function returns a string representation of the decimal number. If the function determines that the number, x, has an infinitely repeating decimal part, the repeating part will be displayed with an overbar. EXAMPLEdecs(18.333333333333) will return decs(0.0142857142857) will return decs(4.25) will return 4.25 |
format |
string format(string format, double x) Writes formatted output to a string. For a complete description of formatting specifiers, look in any C programming manual. EXAMPLEformat("$%1.2f", 13.4) will return "$13.40" format("%d feet", 17) will return "17 feet" |
gcf |
int gcf(int x, int y) Returns the greatest common factor of the arguments, x and y. |
if |
expression if (int condition, expression arg1, expression arg2) Use to implement a conditional expression. If condition evaluates to non-zero, arg1 will be returned, else arg2 will be returned. Both of the arguments must be of the same type (string or numeric). |
isalpha |
int isalpha(string x) If the first character of the string argument, x, is in the range "A" to "Z" or "a" to "z", the function will return TRUE (1), otherwise it will return FALSE (0). |
isdigit |
int isdigit(string x) If the first character of the string argument, x, is in the range "0" to "9", the function will return TRUE (1), otherwise it will return FALSE (0). |
isprime |
int isprime(int x) Evaluates the number to see if it is prime. If the number is prime, the function will return TRUE (1), otherwise it returns FALSE (0). NOTE: Values must be in the range 2 to 1,000,000. |
isrelprime |
int isrelprime(int x, int y) Evaluates the two numbers to see if they are relatively prime. If the greatest common factor of x and y is 1, the function will return TRUE (1), otherwise it returns FALSE (0). |
isunique |
int isunique(expression arg1, expression arg2, ...) Compares the arguments to see if there are any duplicates. If there are duplicate arguments, the function will return FALSE (0), otherwise it returns TRUE (1). All of the arguments must be of the same type (string or numeric). This function is useful as a "condition" in evaluating multiple choice answer choices. EXAMPLE(condition) isunique(answerA, answerB, answerC, answerD) |
lcd |
int lcd(int x, int y) Returns the least common denominator of the arguments, x and y. |
list |
list(expression arg1, expression arg2, ...) Use this function as a container to hold a group of similar expressions. The expressions must all be of the same type--either numeric or string. If you create a list of strings, you must make sure that no string element contains a comma, since the comma is used to delimit the list. A variable defined as a "list" can be used as an argument for the "choose" function. EXAMPLEfruitList = list("apple", "pear", "peach", "tangerine") whichFruit = rand(4) fruit = choose(whichFruit, fruitList)
weightList = list(110, 142, 153, 180, 212) whichWeight = rand(5) weight = choose(whichWeight, weightList) |
prime |
int prime(int x, int y) Returns a pseudo-random prime number in the range x to y, inclusive. NOTE: Values must be in the range 2 to 1,000. |
range |
double range(double x, double y, double increment {optional}) Returns a pseudo-random number in the range x to y, inclusive. If the optional argument, increment, is included, the function will only select values in the given range that are offset from the lower limit by increment. NOTEIf increment is in the form .1, .01, .001, etc., then the result will always have the same number of decimal places as the increment. Also, if x is less than zero, and y is greater than zero, and an increment is provided, then the value 0 will never be returned by the function. |
round |
double round(double x, int precision) Rounds the argument, x, to have precision decimal places. NOTEIf precision is greater than or equal to 10, this function rounds the argument, x, to the nearest precision. EXAMPLE round(3.14159265, 4) will return 3.1416 round(1492.14, 10) will return 1490 round(1492.14, 100) will return 1500 |
sciens* |
string sciens(double x) Function returns a string representation of the argument, x, in scientific notation. NOTEYou must be sure to also change the format to Scientific Notation and select the number of decimal places when formatting the variable. EXAMPLE sciens(143948.123) will return when using 2 decimal places. |
sgns |
string sgns(double x) If the argument, x, is less than zero, this function returns "-". Otherwise it returns "+". |
sigfig |
string sigfig(double x, int numSigFigs, Boolean forceNumSigFigs) Creates a string version of the argument, x, that has numSigFigs significant digits. If forceNumSigFigs is TRUE, then the string returned will have exactly numSigFigs significant digits (even if the function has to randomly create some digits). If forceNumSigFigs is FALSE, then the function will return a string that has numSigFigs significant digits or less. EXAMPLEsigfig(12362, 3, FALSE) will return 12400 sigfig(2.14, 5, TRUE) will return 2.1400 sigfig(1400, 4, TRUE) might return 1427 |
sqrs* |
string sqrs(double x) After reducing the argument, x, to a multiple of a whole number and a radical, it returns a string representation in the form whole (square root) radical. When displayed, this function will draw a radical if necessary. EXAMPLEsqrs(18) will return sqrs(16) will return 4 sqrs(-8) will return sqrs(3.14159) will return |
symbol* |
string symbol(string x) Converts the string argument, x, to the appropriate Symbol character. NOTEOnce the variable is inserted into a question or narrative, you need to highlight the variable and change it to Symbol font for it to display properly. The following list shows valid arguments to this function. For all other Symbol characters, use the chr function. symbol ("<=") will="will" return="return" ≤="≤"></=")> symbol ("=") will return "≥" symbol ("<>") will return "≠"<></></> symbol ("x") will return "×" symbol (".") will return "▪" symbol ("/") will return "÷" |
unsort |
list unsort(list dataList) This function will "unsort" or scramble the list of arguments. The list passed in as an argument must have been composed of only numeric data. Function will return a list that can be used as an argument for choose( ) listofData = list (1, 2, 3, 4) unsort(ListofData) might return "2, 4, 3, 1" |
* Keywords marked with an asterisk are for display only and cannot be used as parts of an expression.
Fraction Functions
ExamView Test Generator provides you with numerous fraction functions to use when defining variables, conditions, and user-defined functions.
fracs* |
string fracs(double numer, double denom) After reducing the fraction numer / denom, this function will return a string as either a whole number, or a fraction in the form "numer/denom". When displayed, this function will draw a stacked fraction if necessary. If denom is 0, the function will return "0". EXAMPLEfracs(22, 6) will return fracs(22, 11) will return 2 |
mixfracs* |
string mixfracs(double numer, double denom) After reducing the fraction numer/denom, this function will return a string as either a whole number, or a fraction in the form "whole numer/denom". When displayed, this function will draw a stacked fraction if necessary. If denom is 0, the function will return "0". EXAMPLEmixfracs(22, 6) will return mixfracs(2, 6) will return |
rfracs* |
string rfracs(double numer, double denom) Reduces the fraction numer / denom. When displayed, this function will always draw a ratio in stacked fraction form. If denom is 0, the function will return "0". EXAMPLErfracs(22, 6) will return rfracs(22, 11) will return |
sfracs* |
string sfracs(double numer, double denom) After reducing the fraction numer / denom, this function will return a string as either a whole number, or a fraction in the form "numer/denom". When displayed, this function will draw a small stacked fraction if necessary. If denom is 0, the function will return "0". EXAMPLEsfracs(22, 6) will return sfracs(22, 11) will return 2 |
smixfracs* |
string smixfracs(double numer, double denom) After reducing the fraction numer/denom, this function will return a string as either a whole number, or a fraction in the form "whole numer/denom". When displayed, this function will draw a small stacked fraction if necessary. If denom is 0, the function will return "0". EXAMPLEsmixfracs(22, 6) will return smixfracs(2, 6) will return |
srfracs* |
string srfracs(double numer, double denom) Reduces the fraction numer / denom. When displayed, this function will always draw a small ratio in stacked fraction form. If denom is 0, the function will return "0". EXAMPLEsrfracs(22, 6) will return srfracs(22, 11) will return |
* Keywords marked with an asterisk are for display only and cannot be used as parts of an expression.
Logical Operators
ExamView Test Generator provides you with numerous pre-defined logical operators to use when defining variables, conditions, and user-defined functions.
AND |
expression AND expression Returns TRUE (1) only if both expressions evaluate to non-zero, otherwise returns FALSE (0). If the first expression evaluates to FALSE, the second expression is not evaluated. |
EQV |
expression EQV expression Returns TRUE (1) if both expressions evaluate to non-zero or if both expressions evaluate to zero, otherwise returns FALSE (0). |
IMP |
expression IMP expression Returns TRUE (1) if the first expression evaluates to non-zero and the second expression evaluates to zero, otherwise returns FALSE (0). |
MOD |
expression MOD expression Divides the first expression by the second expression and returns the remainder. If the second expression is equal to zero, the function will return zero. Integer division may return a negative value to satisfy the identity: (-A)/B = -(A/B) = A/(-B) EXAMPLE-34 MOD 6 will return -4 |
NOT |
NOT expression If expression evaluates to non-zero, this will return FALSE (0), otherwise it will return TRUE (1). |
OR |
expression OR expression Returns TRUE (1) if either expression evaluates to non-zero, otherwise returns FALSE (0). If the first expression evaluates to TRUE, the second expression is not evaluated. |
XOR |
expression XOR expression Returns the bitwise exclusive-OR of the two expressions. |
Statistical Functions
ExamView Test Generator provides you with numerous pre-defined statistical functions to use when defining variables, conditions, and user-defined functions.
comb |
int comb(int m, int n) Returns the number of possible combinations. If we have a group of m objects, how many ways can they be grouped as n objects when position does not matter. The actual function is: |
makelist |
list makelist(int numValues, double lowerExtreme, double lowerQuartile, double median, double upperQuartile, double upperExtreme, Boolean sortData) Use this function to create a "list" container to hold a group of data with numValues data, and the range, median, and interquartile ranges assigned. Pass TRUE if you want the data elements to be arranged in ascending order. Pass -1 for either extreme, either quartile, or the median if you do not require them to be specific values. EXAMPLEmakelist(3, 5, -1, 8, -1, 9, TRUE) will return "5, 8, 9" Both quartile values must be supplied to the makelist() function. If either one is not, they are both ignored. |
mean |
double mean(list data) Returns the arithmetic mean (or average) of the data in the list. |
median |
double median(list data) Returns the middle value of the data in the list if the number of elements in the list is odd, or the average of the two middle terms if the number of elements is even. |
mode |
double mode(list data) Returns the most common value for the data in the list. If the data is multimodal, this function returns zero. |
perm |
int perm(int m, int n) Returns the number of possible permutations. Given that position is important, if one has m objects, how many unique ways can they be placed in n positions. The actual function is: |
quartile |
double quartile(list data, int whichQuartile) Returns one of the divisions of observations of the data in the list. EXAMPLEtheList = list(30, 25, 19, 26, 31, 29, 23) quartile(theList, 0) will return "19", the lower extreme quartile(theList, 1) will return "23", the lower quartile quartile(theList, 2) will return "26", the median quartile(theList, 3) will return "30", the upper quartile quartile(theList, 4) will return "31", the upper extreme |
sdev |
double sdev(list data) Returns the standard deviation of the data values in the list. Data values are assumed to be the entire population (not a sample). Result is the square root of the population variance. |
sort |
list sort(Boolean sortAscending, double arg1, double arg2, ...) - or - list sort(Boolean sortAscending, list dataList) This function will sort the list of arguments. All of the arguments must be numeric (or the list must have been composed of only numeric data). Function will return a list that can be used as an argument for choose( ). sort(TRUE, 1, 14, 3.2, 6, 9) will return 1, 3.2, 6, 9, 14 - or - listOfData = list(12, -3, 5) sort(FALSE, listOfData) will return "12, 5, -3" |
sum |
double sum(list data) Returns the sum of the data values in the list. |
variance |
double variance(list data) Returns the variance of the data values in the list. Data values are assumed to be the entire population (not a sample). Actual formula used is: |
String Functions
ExamView Test Generator provides you with numerous pre-defined string functions to use when defining variables, conditions, and user-defined functions.
asc |
int asc(string x) Computes the ascii value of the first character in the string. If the string is empty, it returns 0. |
chr |
string chr(int x) Returns a string character with the ASCII value of the argument, x. If x is less than 32 or greater than 255, the function will return a question mark. You should use this function to generate characters found only in the Symbol font. Once the variable is inserted into a question or narrative, you need to highlight the variable and change it to Symbol font for it to display properly. |
instr |
int instr(string x, string y) Searches in the string, x, for the sub-string, y. If it finds it, the function will return the position in the string, x, where the first occurrence of y was found (between 1 and the length of string, x). If the substring is not found, the function returns FALSE (0). |
lcase |
string lcase(string x) Converts the string argument, x, to lower case. EXAMPLElcase("ExamView") will return "examview" |
left |
string left(string x, int y) Returns the first y characters of the string argument, x. EXAMPLEleft("ExamView", 3) will return "Exa" |
len |
int len(string x) Returns the number of characters in the string argument, x, not counting the null-terminating character. |
ltrim |
string ltrim(string x) Trims spaces from the left side of the string argument, x. EXAMPLEltrim(" ExamView ") will return "ExamView " |
mid |
string mid(string x, int start, int y) Returns y characters starting at the start position in the string argument, x. EXAMPLEmid("ExamView", 2, 4) will return "xamV" |
right |
string right(string x, int y) Returns the last y characters of the string argument, x. EXAMPLEright("ExamView", 3) will return "iew" |
rtrim |
string rtrim(string x) Trims spaces from the right side of the string argument, x. EXAMPLErtrim(" ExamView ") will return " ExamView" |
sentence |
string sentence(string x) Changes string argument, x, into a sentence that can be subdivided using the choose function. This allows us to create a sentence that can word wrap. EXAMPLEsentence("This is a long sentence that might need to wrap.") choose(3, mySentence) to access the 3rd tenth of the variable mySentence. |
str |
string str(double x) Returns a string representation of the argument, x. EXAMPLEstr(18) will return "18" |
strdup |
string strdup(string x, int numTimes) Returns a string by combining the string argument, x, a variable number of times. EXAMPLEstrdup("(2)", 5) will return "(2)(2)(2)(2)(2)" |
trim |
string trim(string x) Trims spaces from both the left and the right side of the string argument, x. EXAMPLEtrim(" ExamView ") will return "ExamView" |
ucase |
string ucase(string x) Converts the string argument, x, to upper case. EXAMPLEucase("ExamView") will return "EXAMVIEW" |
val |
double val(string x) Returns a numeric representation of the string argument, x. EXAMPLEval("18") will return 18 val("-4") will return -4 |
Trigonometric Functions
ExamView Test Generator provides you with numerous pre-defined trigonometric functions to use when defining variables, conditions, and user-defined functions.
acos |
double acos(double x) Computes the arc cosine of the argument, x. Arguments to the function must be in the range -1 to 1. Values are returned in the range 0 to pi inclusive. |
acosh |
double acosh(double x) Computes the hyperbolic arc cosine of the argument, x. Arguments to the function must be greater than 1. |
acot |
double acot(double x) Computes the arc cotangent of the argument, x.Arguments to the function must not be equal to zero. Values are returned in the range -pi/2 to pi/2 non-inclusive |
acoth |
double acoth(double x) Computes the hyperbolic arc cotangent of the argument, x. Arguments to the function must be less than -1 or greater than 1. |
acsc |
double acsc(double x) Computes the arc cosecant of the argument, x. Arguments to the function must be less than or equal to -1 or greater than or equal to 1. Values are returned in the range -pi/2 to pi/2 non-inclusive |
acsch |
double acsch(double x) Computes the hyperbolic arc cosecant of the argument, x. Arguments to the function must not be equal to zero. |
arccos |
double arccos(double x) Computes the arc cosine of the argument, x. Arguments to the function must be in the range -1 to 1. Values are returned in the range 0 to pi inclusive. |
arccosh |
double arccosh(double x) Computes the hyperbolic arc cosine of the argument, x. Arguments to the function must be greater than 1. |
arccot |
double arccot(double x) Computes the arc cotangent of the argument, x. Arguments to the function must not be equal to zero. Values are returned in the range -pi/2 to pi/2 non-inclusive |
arccoth |
double arccoth(double x) Computes the hyperbolic arc cotangent of the argument, x. Arguments to the function must be less than -1 or greater than 1. |
arccsc |
double arccsc(double x) Computes the arc cosecant of the argument, x. Arguments to the function must be less than or equal to -1 or greater than or equal to 1. Values are returned in the range -pi/2 to pi/2 non-inclusive |
arccsch |
double arccsch(double x) Computes the hyperbolic arc cosecant of the argument, x. Arguments to the function must not be equal to zero. |
arcsec |
double arcsec(double x) Computes the arc secant of the argument, x. Arguments to the function must be less than or equal to -1 or greater than or equal to 1. Values are returned in the range 0 to pi inclusive. |
arcsech |
double arcsech(double x) Computes the hyperbolic arc secant of the argument, x. Arguments to the function must be greater than 0 and less than or equal to 1. |
arcsin |
double arcsin(double x) Computes the arc sine of the argument, x. Arguments to the function must be in the range -1 to 1. Values are returned in the range -pi/2 to pi/2 inclusive. |
arcsinh |
double arcsinh(double x) Computes the hyperbolic arc sine of the argument, x. |
arctan |
double arctan(double x) Computes the arc tangent of the argument, x. Values are returned in the range -pi/2 to pi/2 non-inclusive |
arctan2 |
double arctan2(double y, double x) Computes the arc tangent of y / x. This function produces correct results even when the resulting angle is near -pi/2 or pi/2. Values are returned in the range -pi/2 to pi/2 non-inclusive |
arctanh |
double arctanh(double x) Computes the hyperbolic arc tangent of the argument, x. Arguments to the function must be in the range -1 to 1 non-inclusive. |
asec |
double asec(double x) Computes the arc secant of the argument, x. Arguments to the function must be less than or equal to -1 or greater than or equal to 1. Values are returned in the range 0 to pi inclusive. |
asech |
double asech(double x) Computes the hyperbolic arc secant of the argument, x. Arguments to the function must be greater than 0 and less than or equal to 1. |
asin |
double asin(double x) Computes the arc sine of the argument, x. Arguments to the function must be in the range -1 to 1. Values are returned in the range -pi/2 to pi/2 inclusive. |
asinh |
double asinh(double x) Computes the hyperbolic arc sine of the argument, x. |
atan |
double atan(double x) Computes the arc tangent of the argument, x. Values are returned in the range -pi/2 to pi/2 inclusive. |
atan2 |
double atan2(double y, double x) Computes the arc tangent of y / x. It produces correct results even when the resulting angle is near -pi/2 or pi/2. Values are returned in the range -pi/2 to pi/2 non-inclusive |
atanh |
double atanh(double x) Computes the hyperbolic arc tangent of the argument, x. Arguments to the function must be in the range -1 to 1 non-inclusive. |
cos |
double cos(double x) Computes the cosine of the argument, x. The angle is specified in radians. Values are returned in the range -1 to 1 inclusive. |
cosh |
double cosh(double x) Computes the hyperbolic cosine of the argument, x. The actual function is: |
cot |
double cot(double x) Computes the cotangent of the argument, x. The angle is specified in radians. Arguments to the function must not be equal to zero. |
coth |
double coth(double x) Computes the hyperbolic cotangent of the argument, x. This evaluates to cosh(x) / sinh(x). Arguments to the function must not be equal to zero. |
csc |
double csc(double x) Computes the cosecant of the argument, x. The angle is specified in radians. Arguments to the function must not be equal to zero. |
csch |
double csch(double x) Computes the hyperbolic cosecant of the argument, x. This evaluates to 1 / sinh(x). Arguments to the function must not be equal to zero. |
deg |
double deg(double x) Converts an argument, x, in radians to degrees. |
rad |
double rad(double x) Converts an argument, x, in degrees to radians. |
sec |
double sec(double x) Computes the secant of the argument, x. The angle is specified in radians. |
sech |
double sech(double x) Computes the hyperbolic secant of the argument, x. This evaluates to 1 / cosh(x). |
sin |
double sin(double x) Computes the sine of the argument, x. The angle is specified in radians. Values are returned in the range -1 to 1 inclusive. |
sinh |
double sinh(double x) Computes the hyperbolic sine of the argument, x. |
tan |
double tan(double x) Computes the tangent of the argument, x. The angle is specified in radians. |
tanh |
double tanh(double x) Computes the hyperbolic tangent of the argument, x. This evaluates to sinh(x) / cosh(x). |
Constants
ExamView Test Generator provides you with numerous pre-defined constants to use when defining variables, conditions, and user-defined functions.
e |
[Constant] 2.71828..., used in problems involving growth or decay (or compound interest). Usually defined by the following equation: |
false |
[Constant] 0. |
inf |
[Constant] ∞. Can be used to represent positive or negative infinity (INF). |
no |
[Constant] 0. |
pi |
[Constant] 3.1415926.... By definition, PI is the ratio of the circumference of a circle to its diameter. |
testversion |
[pseudo constant] Represents the current test version ("A", "B", "C", etc.). |
true |
[Constant] 1. |
yes |
[Constant] 1. |
Math Functions
ExamView Test Generator provides you with numerous pre-defined math functions to use when defining variables, conditions, and user-defined functions.
abs |
double abs(double x) Computes the absolute value of the argument, x. |
ceil |
double ceil(double x) Rounds up. The function finds the smallest integer not less than the argument, x. |
floor |
double floor(double x) Rounds down. The function finds the largest integer not greater than the argument, x. |
frac |
double frac(double x) Returns the fractional part of the argument, x. The return value will always be greater than or equal to 0 and less than 1. |
int |
int int(double x) Returns the integer portion of the argument, x. If x is positive, it rounds down. If x is negative, it rounds up. |
inv |
double inv(double x) Returns the inverse of the argument, x. Actual function is 1 / x. Arguments to the function must not be equal to zero. |
max |
double max(double x, double y) Returns the larger of two values. |
min |
double min(double x, double y) Returns the smaller of two values. |
rand |
int rand(int x) Returns a pseudo-random number in the range 1 to the argument, x, inclusive. |
sgn |
int sgn(double x) If the argument, x, is less than zero, this function returns -1. If the argument, x, is greater than zero, this function returns 1. Otherwise it returns zero. |
sqr |
double sqr(double x) Computes the positive square root of the argument, x. The argument must be greater than or equal to zero. |
sqrt |
double sqrt(double x) Computes the positive square root of the argument, x. The argument must be greater than or equal to zero. |
Exponential and Logarithmic Functions
ExamView Test Generator provides you with numerous pre-defined exponential and logarithmic functions to use when defining variables, conditions, and user-defined functions.
Exponential and Logarithmic Functions
ExamView Test Generator provides you with numerous pre-defined exponential and logarithmic functions to use when defining variables, conditions, and user-defined functions.
exp |
double exp(double x) Calculates the exponential e to the x. |
ln |
double ln(double x) Calculates the natural log of the argument, x. Arguments to the function must be greater than zero. |
log |
double log(double x) Calculates the natural log of the argument, x. Arguments to the function must be greater than zero. |
log10 |
double log10(double x) Calculates the base 10 logarithm of the argument, x. Arguments to the function must be greater than or equal to zero. |
logb |
double logb(double x, double b) Calculates the base b logarithm of the argument, x. Arguments to the function must be greater than zero. Actual function is: |
pow |
double pow(double x, double y) Calculates x to the power of y. |