Home > Products > Authorware > Support > Basics
Macromedia Authorware Support Center - Basics
Paging structure and modular logic

Authorware provides a number of system functions and variables which help determine where any given icon is within a piece. These functions can be very useful for developing logic that is transportable across a variety of similar pieces or for course content that is still in the development stages.

A common course design is for the last item in the course to be a test. Often the test has an introductory page, a number of questions, and a summary page. It is important to know the number of questions because the score is based on the percentage of correct answers to the total number of questions. The introduction and summary pages will also probably display the number of questions, and the score may be printed to an external file for instructor use.

It is easy to count the number of questions in the final test by counting all the maps between the introduction page and the summary page, using that number to calculate the score. However, if the number of questions changes, each place where the value appears must be reset.

Since the test will be the final framework in the course and the number of questions in it will be the number of maps attached to it except for the introduction and summary pages, then

Number of Questions := (PageCount@IconLastChild(IconID@"All Sections") - 2)
An array to keep track of the data for the questions might look something like this:
TestScores := Array(0, Number of Questions, 3)
--Sets up test score array.
--element 1 is the problem number
--element 2 is the response given (0 if n/a)
--element 3 is whether the question is answered correctly or incorrectly (0=wrong, 1=right)
Repeat with X in list loops can be used to format, analyze, or write this data to a file once it is collected.

To Table of Contents Back to Previous document