rendered paste body;o
Menu * {
-
CompleX Overhoor V1.0:/dialog -md Overhoor Overhoor
-
}
alias F3 {
/dialog -md Overhoor Overhoor
}
alias F6 {
run dialogoverhoor.txt
}
Dialog Overhoor {
Title CompleX Overhoor V1.0 Made by Ano.
size -1 -1 150 100
Menu "Opties", 1
Item "Vragen Maken", 2, 1
Item "Multiple Choise", 3, 1
Item "Open Vragen", 4, 1
option dbu
Edit "Typ hier je nieuwe vraag:", 10, 0 0 150 10, center
Edit "Antwoord", 11, 0 13 150 10, center
List 12, 0 26 100 42
Button "Categorie toevoegen", 13, 0 60 75 20
Button "Categorie verwijderen", 14, 75 60 75 20
Button "Toevoegen", 15, 0 80 150 20, center
Button "Start", 16, 0 0 150 20, center
List 17, 0 23 100 40, center
Edit "Vraag", 18, 0 55 150 10, center read
Edit "Antwoord", 19, 0 66 150 10, center
Button "Ok", 20, 37 77 75 20, center
Button "Antwoord", 21, 103 23 40 30
Text "Goed:", 22, 5 77 20 10
Text "0", 23, 5 87 20 10
Text "Fout:" 24, 130 77 20 10
Text "0", 25, 130 87 20 10
Button "1", 26, 0 66 37.5 10
Button "2", 27, 37.5 66 37.5 10
Button "3", 28, 75 66 37.5 10
Button "4", 29, 112.5 66 37.5 10
}
on *:dialog:overhoor:sclick:26: {
if ($did == %m11) goed
else fout
}
on *:dialog:overhoor:sclick:27: {
if ($did == %m11) goed
else fout
}
on *:dialog:overhoor:sclick:28: {
if ($did == %m11) goed
else fout
}
on *:dialog:overhoor:sclick:29: {
if ($did == %m11) goed
else fout
}
on *:dialog:overhoor:sclick:21: {
if (%menu == 4) did -ra $dname 19 $readini(overhoor.ini,%cat,$left($read(overhoor.ini,%rand),$calc(%rand2 - 1)))
if (%menu == 3) {
did -r $dname %m12
did -r $dname %m13
did -r $dname %m14
}
}
on *:dialog:overhoor:sclick:20: {
if ($replace($readini(overhoor.ini,%cat,$left($read(overhoor.ini,%rand),$calc(%rand2 - 1))),|,$chr(32)) == $did(overhoor,19)) {
goed
}
else fout
}
alias goed {
inc %goed
inc %totaal
did -ra overhoor 23 %goed $int($calc( 100 / $calc(%totaal / %goed))) $+ %
did -ra overhoor 25 %fout $int($calc( 100 / $calc(%totaal / %fout))) $+ %
next
}
alias fout {
did -ra $dname 18 Helaas, Je had het antwoord fout.
set %replace $left($read(overhoor.ini,%rand),$calc(%rand2 - 1)))
timerOverhoor 1 1 did -ra overhoor 18 %vraag18
inc %fout
inc %totaal
did -ra overhoor 23 %goed $int($calc( 100 / $calc(%totaal / %goed))) $+ %
did -ra overhoor 25 %fout $int($calc( 100 / $calc(%totaal / %fout))) $+ %
}
alias search {
set %x 1
while ($read($1, %x)) {
if ($2 isin $read($1, %x)) {
set %read %x
return $read($1, %x)
break
}
inc %x
}
unset %x
}
alias multiple {
goto a
:a
set %m11 $r(26,29)
goto b
:b
set %m12 $r(26,29)
if (%m12 != %m11) goto c
else goto b
:c
set %m13 $r(26,29)
if (%m13 != %m11) && (%m13 != %m12) goto d
else goto c
:d
set %m14 $r(26,29)
if (%m14 != %m11) && (%m14 != %m12) && (%m14 != %m13) {
did -ra overhoor %m11 %m1
did -ra overhoor %m12 %m2
did -ra overhoor %m13 %m3
did -ra overhoor %m14 %m14
}
else goto d
}
alias mul {
goto een
:een
random
if ($right($read(overhoor.ini,%rand),$calc($len($read(overhoor.ini,%rand)) - %rand2)) != %m1) {
set %m2 $right($read(overhoor.ini,%rand),$calc($len($read(overhoor.ini,%rand)) - %rand2))
:twee
random
if ($right($read(overhoor.ini,%rand),$calc($len($read(overhoor.ini,%rand)) - %rand2)) != %m2) && ($right($read(overhoor.ini,%rand),$calc($len($read(overhoor.ini,%rand)) - %rand2)) != %m1) {
set %m3 $right($read(overhoor.ini,%rand),$calc($len($read(overhoor.ini,%rand)) - %rand2))
:drie
random
if ($right($read(overhoor.ini,%rand),$calc($len($read(overhoor.ini,%rand)) - %rand2)) != %m2) && ($right($read(overhoor.ini,%rand),$calc($len($read(overhoor.ini,%rand)) - %rand2)) != %m1) && ($right($read(overhoor.ini,%rand),$calc($len($read(overhoor.ini,%rand)) - %rand2)) != %m3) {
set %m4 $right($read(overhoor.ini,%rand),$calc($len($read(overhoor.ini,%rand)) - %rand2))
multiple
}
else goto drie
}
else goto twee
}
else goto een
}
on *:Dialog:overhoor:sclick:16:{
unset %goed
unset %fout
unset %totaal
did -ra $dname 23 0
did -ra $dname 25 0
set %cat $did(overhoor,17).seltext
next
}
alias next {
set %vraag1 $search(overhoor.ini, [ $+ %cat $+ ],x)
set %q $calc(%read + 1)
while ($read(overhoor.ini, %q)) {
if (%q == $lines(overhoor.ini)) set %read2 $lines(overhoor.ini) | set %read3 0
if ($left($read(overhoor.ini, %q),1) == [ ) {
set %read3 1
set %read2 %q
break
}
inc %q
}
if (%menu == 3) && ($calc(%read2 - %read) < 5) {
//echo -a 12Je moet minstens 4 vragen hebben om multiple choise te kunnen doen.
halt
}
random
set %vraag18 $replace($left($read(overhoor.ini,%rand),$calc(%rand2 - 1)),|,$chr(32))
did -ra overhoor 18 $replace($left($read(overhoor.ini,%rand),$calc(%rand2 - 1)),|,$chr(32))
if (%menu == 3) {
set %m1 $right($read(overhoor.ini,%rand),$calc($len($read(overhoor.ini,%rand)) - %rand2))
mul
}
}
alias random {
set %rand $r($calc(%read + 1),$calc(%read2 - %read3))
set %rand2 $pos($read(overhoor.ini, %rand),=,1)
}
on *:dialog:overhoor:menu:*:{
hide
if ($did == 2) {
did -v $dname 10
did -v $dname 11
did -v $dname 12
did -v $dname 13
did -v $dname 14
did -v $dname 15
}
else {
did -v $dname 16
did -v $dname 17
did -v $dname 18
did -ra $dname 18 Vraag:
if ($did == 4) {
set %menu 4
did -v $dname 19
did -v $dname 21
}
if ($did == 3) {
set %menu 3
did -ra $dname 18 Vraag:
did -v $dname 26
did -v $dname 27
did -v $dname 28
did -v $dname 29
}
did -v $dname 20
did -v $dname 21
did -v $dname 22
did -v $dname 23
did -v $dname 24
did -v $dname 25
}
}
on *:dialog:overhoor:menu:2:{
hide
did -v $dname 10
did -v $dname 11
did -v $dname 12
did -v $dname 13
did -v $dname 14
did -v $dname 15
}
alias hide {
var %h = 10
while (%h) {
if (%h isnum 10-29) {
did -h overhoor %h
}
else break
inc %h
}
}
alias F4 {
//run overhoor.ini
}
on *:Dialog:overhoor:sclick:15:{
//writeini Overhoor.ini $did(overhoor,12).seltext $did(overhoor,12) $replace($did(overhoor,10),$chr(32),$chr(124)) $replace($did(overhoor,11),$chr(32),$chr(124))
}
on *:dialog:overhoor:sclick:14: {
if ($$?!="Weet je het zeker, alle vragen zullen ook verloren gaan." == $true) {
write -ds $+ $did(overhoor,12).seltext overhoor.txt
remini overhoor.ini $did(overhoor,12).seltext
did -r $dname 12
did -r $dname 17
var %r = 1
while ($read(overhoor.txt, %r)) {
did -a $dname 12 $read(overhoor.txt, %r)
inc %r
}
var %x = 1
while ($read(overhoor.txt, %x)) {
did -a $dname 17 $read(overhoor.txt, %x)
inc %x
}
}
}
on *:Dialog:overhoor:sclick:13:{
//write Overhoor.txt $$?="Welke categorie wil je toevoegen?"
did -r $dname 12
did -r $dname 17
var %r = 1
while ($read(overhoor.txt, %r)) {
did -a $dname 12 $read(overhoor.txt, %r)
inc %r
}
var %x = 1
while ($read(overhoor.txt, %x)) {
did -a $dname 17 $read(overhoor.txt, %x)
inc %x
}
}
on *:dialog:overhoor:init:*:{
var %r = 1
while ($read(overhoor.txt, %r)) {
did -a $dname 12 $read(overhoor.txt, %r)
inc %r
}
var %x = 1
while ($read(overhoor.txt, %x)) {
did -a $dname 17 $read(overhoor.txt, %x)
inc %x
}
hide
}