nivo_title=the 24 hour digital clock versus a "normal" clock<br>Choose the right one
!set n=$teller
bewerking=bewerking2.proc
!if $graad=0
    R=$teller
!else
    R=$graad
!endif
        #digitale klok
!if $HINT=1
    hint=no hints today
!endif

GOED$n=!randint 1,$aantal_vragen
width=45
height=45
punt=<img src='$gifdir/digits/punt.gif' border='noborder'  width='$width' height='$height'>
keuze=!randitem 1,1,1,2
!if $nivo=5
    max=23
!else
    max=11
!endif        
!for p=1 to $aantal_vragen
    uren=!randint 1,$max
    minuten=!randint 1,59
    seconden=!randint 1,59
    !if $p=$(GOED$n)
	!if $keuze=1
	    tijd_nu=$uren,$minuten,$seconden
	!else
	    !if $nivo=5
		tijd_nu=!date  +%H,%M,%S
	    !else
		tijd_nu=!date  +%l,%M,%S
	    !endif
	    uren=!item 1 of $tijd_nu
	    minuten=!item 2 of $tijd_nu
	    seconden=!item 3 of $tijd_nu
	!endif
	!if $nivo=5
	    wims_read_parm=$uren:$minuten:$seconden
	    !readproc slib/draw/clock $wims_read_parm,200,$style
	    som$n=$slib_out 
	!endif
    !endif
	#digiklok:tijd in uren minuten seconden
    test=!charcnt $uren
    !if $test!=2
	H=<img src='$gifdir/digits/0.png' border='noborder' width='$width' height='$height'><img src='$gifdir/digits/$uren.png' border='noborder' width='$width' height='$height'>
    !else
	T=!char 1 of $uren
	E=!char 2 of $uren
	H=<img src='$gifdir/digits/$T.png' border='noborder' width='$width' height='$height'><img src='$gifdir/digits/$E.png' border='noborder' width='$width' height='$height'>
    !endif    
    test=!charcnt $minuten
    !if $test!=2
	M=<img src='$gifdir/digits/0.png' border='noborder' width='$width' height='$height'><img src='$gifdir/digits/$minuten.png' border='noborder' width='$width' height='$height'>
    !else
	T=!char 1 of $minuten
	E=!char 2 of $minuten
	M=<img src='$gifdir/digits/$T.png' border='noborder' width='$width' height='$height'><img src='$gifdir/digits/$E.png' border='noborder' width='$width' height='$height'>
    !endif    
    test=!charcnt $seconden
    !if $test!=2
	S=<img src='$gifdir/digits/0.png' border='noborder' width='$width' height='$height'><img src='$gifdir/digits/$seconden.png' border='noborder' width='$width' height='$height'>
    !else
	T=!char 1 of $seconden
	E=!char 2 of $seconden
	S=<img src='$gifdir/digits/$T.png' border='noborder'  width='$width' height='$height'><img src='$gifdir/digits/$E.png' border='noborder' width='$width' height='$height'>
    !endif    
    klok$p=$H $punt $M $punt $S 
!next p	    

uren=!item 1 of $tijd_nu
minuten=!item 2 of $tijd_nu
seconden=!item 3 of $tijd_nu 

!if $R isin 1,2,3
    !if $uren=12 
	mooizo=1
    !else
	mooizo=$[$uren+1]
    !endif    
    !if $minuten <= 15
	!if $minuten=0 
	    uur=!item $uren of $telwoorden
	    text_m=It's now exactly $uur hour
	    !goto KLAAR
	!endif	
	!if $minuten=15
	    uur=!item $uren of $telwoorden
	    text_m=It's now a quarter past $uur
	    !goto KLAAR
	!endif
	min=!item $minuten of $telwoorden
	uur=!item $uren of $telwoorden
	text_m=It's now $min minutes past $uur 
	!goto KLAAR    
    !endif
    !if $minuten <= 30
	!if $minuten=30
	    uur=!item $uren of $telwoorden
	    text_m=It's now half past $uur
	    !goto KLAAR
	!endif
	    min=!item $minuten of $telwoorden
	    uur=!item $uren of $telwoorden
	    text_m=It's now $min minutes past $uur  
	    !goto KLAAR
    !endif
    !if $minuten <= 45
	!if $minuten=45
	    uur=!item $mooizo of $telwoorden
	    text_m=It's a quarter to $uur
	    !goto KLAAR
	!endif
	uur=!item $uren of $telwoorden
	text_m=It's now $minuten minutes past $uur 
	!goto KLAAR
    !endif
    !if $minuten <= 60
	    min=$[60-$minuten]
	    min=!item $min of $telwoorden
	    uur=!item $mooizo of $telwoorden
	    text_m=It's now $min minutes to $uur 
	    !goto KLAAR
    !endif

    :KLAAR    
    !if $printbaar=0
	somtekst$n=<p align="center"><b>$text_m\
	<font color=blue id="test1" onClick="this.innerHTML='(and  $seconden seconds...)'"> and ... </font>\
	</b><br>which one of these clocks gives the <em>right time</em>?</b></p>
    !else
	somtekst$n=<p align="center"><b>$text_m and  $seconden seconds </b>.\
	<br>which one of these clocks gives the <em>right time</em>?</b></p>
    !endif
 !exit
!endif 


!if $R>3
    !if $printbaar=0
	somtekst$n=<p align="center"><b>Now its $uren hours and $minuten minutes.\
	<font color=blue id="test1" onClick="this.innerHTML='(and  $seconden seconds...)'"> and ... </font>\
	</b><br>which one of these clocks gives the <em>right time</em>?</b></p>
    !else
	somtekst$n=<p align="center"><b>Now its $uren hours and $minuten minutes and  $seconden seconds.\
	</b><br>which one of these clocks gives the <em>right time</em>?</b></p>
    !endif
 !exit
!endif

#!if $R>4
#    !if $printbaar=0
#	somtekst$n=<p align="center"><b>And now its $uren <blink>:</blink> $minuten <blink>:</blink> $seconden\
#	</b><br>which one of these clocks gives the <em>right time</em>?</b></p>
#    !else
#	somtekst$n=<p align="center"><b>And now its $uren : $minuten : $seconden\
#	</b><br>which one of these clocks gives the <em>right time</em>?</b></p>    
#    !endif	
#!endif
