Your input tags need to include the following attributes:
type="checkbox"
name="qX" – where X is the
question number
value="Y" – where Y is the
option number
id="qX" – where X is the
question number
onClick="checkCheck(G, this.name, this.value, this.form)"
– where G is the group number (appears as question
on screen)
Consider each multiple answer question as a 'Group'
and each available response as an individual question.
Therefore
Group 1 has four questions and
Group 2 has 10 questions
which could either be correct or incorrect.
Questions must always be numbered sequentially starting
from 1 and should avoid numbering such as q1a, q1b, etc. unless you are
prepared to make major adjustments to the Javascript yourself. This does
not mean that a question can't be seen as 'question 1a'
to the user. There is no double-up of question numbers.
The number of options relates to the group.
In this example there are two groups: Group 1 contains
questions 1–4 and has 4 options; Group
2 contains questions 5–14 and has 10 options.
Options must always be numbered sequentially starting from 1 for each
group.
Question#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Group 1 – Option#
1
2
3
4
Group 2 – Option#
1
2
3
4
5
6
7
8
9
10
The option label should be attached to its input via the label
tag. The label tag includes the attribute for="qX"
– the same value as the id of the input.
There is always one image per question.
Images must be named according to their question. For example, name="iq1"
– i means image, q1 is the question it's
attached to. Images should start as blank.gif with an empty
alt. The Javascript will change the image as appropriate.
It's prefereable to link to a separate Javascript file although, for
pages individually loaded into Blackboard, including the script within
the HTML is acceptable.
There are three parts of the script that need to be modified:
Pre-loading of response image placeholders
Setting the question variables
Setting the response image variable paths
The response image placeholders must always start as blank.gif.
Only change the value for the number of images –
for (var i=1; i<=numberofimages; i++) {,
and adjust the path to blank.gif – eval("iq"+i+".src
= \"blank.gif\"");.
Set a new variable for each question as an Array. The variables must
appear as:
var vqX = new Array("start",true,false,true,true);
– where X is the group number and
true/false relates to the option number
as correct or incorrect.
In the example above: Group 1 has four options and options 1, 3 and 4
are all correct; Group 2 has 10 options and options 2, 3, 5, 6 and 10
are all correct.
Set the paths of the response image variables as needed. Do not
remove or rename these variables.
Below is the source code for the Javascript of the above example.