|List.pm||topic started 6/9/2000; 11:47:24 AM
last post 6/9/2000; 11:47:24 AM
|Michael Gage - List.pm
6/9/2000; 11:47:24 AM (reads: 3037, responses: 0)
List.pm -- super-class for all list structures
List.pm is not intended to be used as a stand alone object.
It is a super-class designed to be inherited by sub-classes that, through small changes, can be used for a variety of different questions that involve some sort of list of questions and/or answers.
List.pm has been used to construct Match.pm, Select.pm, and Multiple.pm.
These three classes are objects that can be used to create the following question types:
Matching list: Given a list of questions and answers, match the correct answers to the questions. Some answers may be used more than once and some may not be used at all. The order of the answers is usually random but some answers can be appended to the end in a set order (i.e. 'None of the above'). Answers are given corresponding letters as shortcuts to typing in the full answer. (i.e. the answer to #1 is A).
Select list: Given a list of questions and (usually) implied answers, give the correct answer to each question. This is intended mainly for true/false questions or other types of questions where the answers are short and can therefore be typed in by the user easily. If a select list is desired but the answers are too long to really type in, a popup-list of the answers can be used.
Multiple choice: Given a single question and a list of answers, select the single correct answer. This structure creates a standard multiple choice question as would be seen on a standardize test. Extra answers are entered along with the question in a simple format and (as with Match.pm), if necessary, can be appended in order at the end (i.e. 'None of the above')
See Match.pm, Select.pm, Multiple.pm, and PGchoicemacros.pl
Variables and methods available to sub-classes
questions # array of questions as entered using qa()
selected_q # randomly selected subset of "questions"
ans_rule_len # determines the length of the answer blanks
slice # index used to select specific questions
inverted_shuffle # the inverse permutation array
rf_print_q # reference to any subroutine which should
rf_print_a # reference to any subroutine which should
ra_pop_up_list # Field used in sub classes that use pop_up_list_print_q
ans_rule_len # field which can be used in the question printing routines
qa( array ) # accepts an array of strings which can be used
extra( array ) # accepts an array of strings which can be used
print_q # yields a formatted string of question to be
choose([3, 4], 1) # chooses questions indexed 3 and 4 and one other
ra_correct_ans # outputs a reference to the array of correct answers
None -- see SYNOPSIS above
File path = /ww/webwork/pg/lib/List.pm