Quiz

  • Thread starter Thread starter daz
  • Start date Start date
D

daz

Does anyone know how to do this?

I want to write sum simple maths times table quizzes for school children.
If they input the correct answer I want to find a way of making a tick or
something appear in the adjacent cedll to te answer of a cross if the answer
is incorrect??

Cheers

Daz
 
There are three answers (actually 3 threads) that should work out for you
from a search of the Google Groups archives (newsgroups)

http://groups.google.com/advanced_group_search?q=group:*Excel*&num=100

with all of the words: quiz hide answer* group:*Excel*

actually the group:*Excel* is already in the URL so you could just use
quiz hide answer*

pick the item that lists how many replies in the thread, so you get
to see the entire thread.
 
You could probably work something out using this scenario.

A2 contains the question,
B2 is for the answer to be entered,
Z2 is the correct answer, hidden from view,
Column C is formatted as WingDings, and contains this formula:
=IF(B2="","",IF(B2=Z2,CHAR(252),CHAR(251)))

If you wanted to dress up the checks and X's with smiley and sad faces, try
this:

=IF(B2="","",IF(B2=Z2,CHAR(252)&"J",CHAR(251)&"L"))

Drag these down to copy as needed.

Now, select all of column B and,
<Format> <Cells> <Protection> tab,
And *uncheck* "Locked", then <OK>.

Now, select all of column C, and again,
<Format> <Cells> <Protection> tab,
And *check* "Hidden", and "Locked".

You can now protect the sheet by,
<Tools> <Protection> <ProtectSheet>
And assign a password if you wish.

This set-up will hide the formulas in column C, so that the smart kids can't
see where the correct answers are stored, and also prevents any changes or
data entry, except in column B.
 
daz said:
Does anyone know how to do this?

I want to write sum simple maths times table quizzes for school children.
If they input the correct answer I want to find a way of making a tick or
something appear in the adjacent cedll to te answer of a cross if the answer
is incorrect??

Cheers

Daz


Hi,

Why not, in case for example in the case of a multiplication (with
answer in E1), use a small Sub like this:

Private Sub Worksheet_Change(ByVal Target As Range)

If Range("E1").Value <> Range("A1") * Range("C1").Value Then
Range("E1").Value = ""

End Sub

Incorrect answers are not accepted....

Regards

Jean
 
Jean's concept is okay to start with, but the details are missing,
you want the questions to be random. Here is another solution
in addition to those that you will already find on the Google Groups search.
There is only one worksheet involved. It would be up to the student
to clear out the answers when they want to really start over. A zero
allows you to terminate and continue at a later time.

You can start the Multiplication quiz game with a double click
and be asked for the answer of a multiplication
if the answer is incorrect the question is repeated.
When correct another multiplication is chosen at random.
As set up the multiplication goes up to 12 x 12
You can change the Random number ranges and the
Cell ranges if you want something more or less.

alternate method:
You can type in the answer of a multiplication of Row * Column
if the answer is incorrect the reply turns RED

Here a couple of Event Macros. Install with a rightclick on the
worksheet tab, view code, ....

Option Explicit
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
'D.McRitchie, 2004-09-12
' http://groups.google.com/[email protected]
Dim x As Integer, y As Integer, z As Integer, results As Integer
Dim msg As String, xZ As String, rng2 As Range, xx As String
msg = "game started"
results = 0
nextM:
x = Int((12 * Rnd) + 1)
y = Int((12 * Rnd) + 1)
If Cells(y, x) = x * y Then GoTo nextM
xZ = ""
retry:
On Error GoTo retry
z = InputBox("What is the value of " & x & " X " & y, msg)

On Error GoTo 0
If z = 0 Then
MsgBox "Game Over, Double Click to continue"
Exit Sub
Else
If z = x * y Then
Cells(x, y) = x * y
Cells(x, y).Font.ColorIndex = 1
Cells(y, x) = x * y
Cells(y, x).Font.ColorIndex = 1
results = results + 2
msg = "I'm asking you..."
On Error Resume Next
xx = Range("A1:L12").SpecialCells(xlCellTypeBlanks).Address
If Err.Number <> 0 Then
MsgBox "completed, Game over"
Exit Sub
End If
On Error GoTo 0
GoTo nextM
Else
MsgBox z & "is incorrect, Try again"
GoTo retry
End If
End If
End Sub

Private Sub Worksheet_Change(ByVal Target As Range)
If Cells(Target.Row, Target.Column) <> Target.Row * Target.Column Then
Target.Font.ColorIndex = 3
Else
Target.Font.ColorIndex = 1
End If
End Sub
 
Dave,

You have an undefined variable

xZ = ""

which I assme is supposed to be xx? in the Worksheet_BeforeDoubleClick sub
and the

MsgBox z & "is incorrect, Try again"

could do with a space before the "is"

Just trying to be helpful

Sandy
 
Back
Top