QUIZ

  • Hallo

    möchte gerne ein kleines QUIZ machen.
    10 Fragen über Computer,
    hab einen kleinen Teil der funktionen schon.

    Spoiler anzeigen

    #cs ----------------------------------------------------------------------------

    AutoIt Version: 3.2.10.0
    Author: myName

    Script Function:
    Template AutoIt script.

    #ce ----------------------------------------------------------------------------

    ; Script Start - Add your code below here

    #include <GUIConstants.au3>

    #Region ### START Koda GUI section ### Form=C:\Dokumente und Einstellungen\Mike\Desktop\quiz\Form1.kxf
    $Form1 = GUICreate("QUIZ - Mechatronik", 547, 268, 193, 125)
    $Radio1 = GUICtrlCreateRadio("Radio1", 368, 88, 129, 25)
    $Radio2 = GUICtrlCreateRadio("Radio1", 368, 128, 129, 25)
    $Radio3 = GUICtrlCreateRadio("Radio1", 368, 168, 129, 25)
    $Radio4 = GUICtrlCreateRadio("Radio1", 368, 88, 129, 25)
    $Radio5 = GUICtrlCreateRadio("Radio1", 368, 128, 129, 25)
    $Radio6 = GUICtrlCreateRadio("Radio1", 368, 168, 129, 25)
    $Radio7 = GUICtrlCreateRadio("Radio1", 368, 88, 129, 25)
    $Radio8 = GUICtrlCreateRadio("Radio1", 368, 128, 129, 25)
    $Radio9 = GUICtrlCreateRadio("Radio1", 368, 168, 129, 25)
    $Radio10 = GUICtrlCreateRadio("Radio1", 368, 88, 129, 25)
    $Radio11 = GUICtrlCreateRadio("Radio1", 368, 128, 129, 25)
    $Radio12 = GUICtrlCreateRadio("Radio1", 368, 168, 129, 25)
    $Radio13 = GUICtrlCreateRadio("Radio1", 368, 88, 129, 25)
    $Radio14 = GUICtrlCreateRadio("Radio1", 368, 128, 129, 25)
    $Radio15 = GUICtrlCreateRadio("Radio1", 368, 168, 129, 25)
    $Radio16 = GUICtrlCreateRadio("Radio1", 368, 88, 129, 25)
    $Radio17 = GUICtrlCreateRadio("Radio1", 368, 128, 129, 25)
    $Radio18 = GUICtrlCreateRadio("Radio1", 368, 168, 129, 25)
    $Radio19 = GUICtrlCreateRadio("Radio1", 368, 88, 129, 25)
    $Radio20 = GUICtrlCreateRadio("Radio1", 368, 128, 129, 25)
    $Radio21 = GUICtrlCreateRadio("Radio1", 368, 168, 129, 25)
    $Radio22 = GUICtrlCreateRadio("Radio1", 368, 88, 129, 25)
    $Radio23 = GUICtrlCreateRadio("Radio1", 368, 128, 129, 25)
    $Radio24 = GUICtrlCreateRadio("Radio1", 368, 168, 129, 25)
    $Radio25 = GUICtrlCreateRadio("Radio1", 368, 88, 129, 25)
    $Radio26 = GUICtrlCreateRadio("Radio1", 368, 128, 129, 25)
    $Radio27 = GUICtrlCreateRadio("Radio1", 368, 168, 129, 25)
    $Radio28 = GUICtrlCreateRadio("Radio1", 368, 88, 129, 25)
    $Radio29 = GUICtrlCreateRadio("Radio1", 368, 128, 129, 25)
    $Radio30 = GUICtrlCreateRadio("Radio1", 368, 168, 129, 25)
    $Label1 = GUICtrlCreateLabel("Frage1", 16, 32, 284, 25)
    $Label2 = GUICtrlCreateLabel("Frage2", 16, 32, 284, 25)
    GUICtrlSetState(-1,$GUI_Hide)
    $Label3 = GUICtrlCreateLabel("Frage3", 16, 32, 284, 25)
    GUICtrlSetState(-1,$GUI_Hide)
    $Label4 = GUICtrlCreateLabel("Frage4", 16, 32, 284, 25)
    GUICtrlSetState(-1,$GUI_Hide)
    $Label5 = GUICtrlCreateLabel("Frage5", 16, 32, 284, 25)
    GUICtrlSetState(-1,$GUI_Hide)
    $Label6 = GUICtrlCreateLabel("Frage6", 16, 32, 284, 25)
    GUICtrlSetState(-1,$GUI_Hide)
    $Label7 = GUICtrlCreateLabel("Frage7", 16, 32, 284, 25)
    GUICtrlSetState(-1,$GUI_Hide)
    $Label8 = GUICtrlCreateLabel("Frage8", 16, 32, 284, 25)
    GUICtrlSetState(-1,$GUI_Hide)
    $Label9 = GUICtrlCreateLabel("Frage9", 16, 32, 284, 25)
    GUICtrlSetState(-1,$GUI_Hide)
    $Label10 = GUICtrlCreateLabel("Frage10", 16, 32, 284, 25)
    GUICtrlSetState(-1,$GUI_Hide)
    $Button1 = GUICtrlCreateButton("Beenden", 368, 232, 65, 17, 0)
    $Button2 = GUICtrlCreateButton("Weiter", 448, 232, 65, 17, 0)
    $Button3 = GUICtrlCreateButton("Weiter", 448, 232, 65, 17, 0)
    $Button4 = GUICtrlCreateButton("Weiter", 448, 232, 65, 17, 0)
    $Button5 = GUICtrlCreateButton("Weiter", 448, 232, 65, 17, 0)
    $Button6 = GUICtrlCreateButton("Weiter", 448, 232, 65, 17, 0)
    $Button7 = GUICtrlCreateButton("Weiter", 448, 232, 65, 17, 0)
    $Button8 = GUICtrlCreateButton("Weiter", 448, 232, 65, 17, 0)
    $Button9 = GUICtrlCreateButton("Weiter", 448, 232, 65, 17, 0)
    $Button10 = GUICtrlCreateButton("Weiter", 448, 232, 65, 17, 0)
    $Button11 = GUICtrlCreateButton("Weiter", 448, 232, 65, 17, 0)
    $Pic1 = GUICtrlCreatePic("", 16, 88, 305, 161, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    Exit
    Case $Button2
    Case $Button3
    Case $Button4
    Case $Button5
    Case $Button6
    Case $Button7
    Case $Button8
    Case $Button9
    Case $Button10
    Case $Button11
    EndSwitch
    WEnd

    Möchte es so, dass Label die Frage ist und imer 3 Radio buttons zur Auswahl stehen.
    2 Falsch 1 Richtig
    Wenn Falsch angekreutz ist dann in ner Msgbox die richtige Antwort und dann überspringen zur nächsten Frage.
    Zum SChluss ne Auswertung in Prozent und Schulnoten.

    Ginge dass irgendwie ?
    So : If GUICtrlRead($Radio2)=$GUI_CHECKED then

    ;~ MsgBox(0, "Fehler!", "Eine Moderne CPU hat 4 Kerne")
    MsgBox(0, "Richtig!", "Weiter zur nächsten Frage.")
    else
    MsgBox(0, "Fehler!", "Eine Moderne CPU hat 4 Kerne")
    EndIf ?????

    Bräuchte es morgen.

    Wäre Klasse wenn mir da jmd helfen könnte.


    greetings :) mike

    • Offizieller Beitrag

    Hi,

    ich habe die mal die Grundlage gebaut. Du musst nur deine Fragen und Antworten eintragen: (habe ich sogar kommentiert )

    Spoiler anzeigen
    [autoit]

    #include<GUIConstants.au3>
    #include<GuiStatusBar.au3>
    #Region ### START Koda GUI section ### Form=
    Global $GUI = GUICreate("Fragenspiel", 513, 185, 193, 125)
    GUICtrlCreateGroup("Fragen", 5, 10, 500, 140)
    Dim $R[4], $L[4]
    $L[0] = GUICtrlCreateLabel("", 20, 30, 471, 17, $SS_SUNKEN)
    $L[1] = GUICtrlCreateLabel("", 20, 60, 146, 17, $SS_SUNKEN)
    $L[2] = GUICtrlCreateLabel("", 180, 60, 146, 17, $SS_SUNKEN)
    $L[3] = GUICtrlCreateLabel("", 345, 60, 146, 17, $SS_SUNKEN)

    [/autoit] [autoit][/autoit] [autoit]

    GUIStartGroup($GUI)
    $R[1] = GUICtrlCreateRadio("", 70, 90, 48, 17)
    $R[2] = GUICtrlCreateRadio("", 240, 90, 73, 17)
    GUICtrlSetState(-1, $GUI_CHECKED)
    $R[3] = GUICtrlCreateRadio("", 405, 90, 73, 17)
    GUIStartGroup()

    [/autoit] [autoit][/autoit] [autoit]

    Global $start_B = GUICtrlCreateButton("Start", 15, 120, 480, 25, 0)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    Global $aParts[2] = [45]
    Global $SB = _GUICtrlStatusBar_Create($GUI)
    _GUICtrlStatusBar_SetParts($SB, $aParts)
    _GUICtrlStatusBar_SetText($SB, @tab & "0 %")
    _GUICtrlStatusBar_SetText($SB, "Bitte wählen Sie die Antwort und klicken Sie 'Start'", 1)
    GUISetState(@SW_SHOW)
    #EndRegion ### START Koda GUI section ### Form=

    [/autoit] [autoit][/autoit] [autoit]

    ; HIER DIE FRAGEN EINTRAGEN!!!
    Global $fragen_A[10] = [ _
    '1. 2+3', _
    '2. 2+4', _
    '3. 2+5', _
    '4. 2+6', _
    '5. 2+7', _
    '6. 2+8', _
    '7. 2+9', _
    '8. 2+10', _
    '9. 2+11', _
    '10. 2+12']

    ; HIER DIE ANTWORTEN EINTRAGEN!!!
    Global $antworten_A[10][3] = [ _
    ['5', '15', '61' ], _
    ['41', '6', '62' ], _
    ['44', '51', '7' ], _
    ['8', '53', '64' ], _
    ['42', '9', '62' ], _
    ['41', '15', '10' ], _
    ['11', '52', '63' ], _
    ['43', '12', '23' ], _
    ['41', '52', '13' ], _
    ['14', '52', '62' ]]

    [/autoit] [autoit][/autoit] [autoit]

    ; HIER ANGEBEN, WELCHE ANTOWRT DIE RICHTIGE IST (EINS, ZWEI ODER DREI)!!!
    Global $ergbnis_A[10] = [ 1, 2, 3, 1, 2, 3, 1, 2, 3, 1]
    Global $frage = 1, $richtig = 0

    [/autoit] [autoit][/autoit] [autoit]

    _setzeFrage()
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $start_B
    If _check() Then
    _GUICtrlStatusBar_SetText($SB, "RICHTIG!", 1)
    $richtig += 1
    Else
    _GUICtrlStatusBar_SetText($SB, "Falsch!, Richtig ist Antwort : " & $ergbnis_A[$frage - 1], 1)
    EndIf
    _GUICtrlStatusBar_SetText($SB, @TAB & ($richtig * 100 / UBound($fragen_A)) & " %", 0)
    If $frage < UBound($fragen_A) Then
    $frage += 1
    _setzeFrage()
    Else
    GUICtrlSetState($start_B, $GUI_DISABLE)
    Sleep(1000)
    GUIDelete($GUI)
    MsgBox(64, "Info", "Du hast " & ($richtig * 100 / UBound($fragen_A)) & " % richtig!", 10)
    Exit(0)
    EndIf
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _check()
    If GUICtrlRead($R[$ergbnis_A[$frage - 1]]) = $GUI_CHECKED Then Return 1
    Return 0
    EndFunc ;==>_check

    [/autoit] [autoit][/autoit] [autoit]

    Func _setzeFrage()
    GUICtrlSetData($L[0], $fragen_A[$frage - 1])
    GUICtrlSetData($L[1], $antworten_A[$frage - 1 ][0])
    GUICtrlSetData($L[2], $antworten_A[$frage - 1][1])
    GUICtrlSetData($L[3], $antworten_A[$frage - 1][2])
    EndFunc ;==>_setzeFrage

    [/autoit]

    So long,

    Mega

  • Klasse !!! Danke

    Aber, ich habe Bestenfalls 90% auch wenn alle fragen richtig beantworte !

  • Hab keine Note oder so bekommen, wir hatten Tag der Offenen Tür, da wollte ich was zeigen :)
    THX nochmal !

  • würde mir jemand helfen einen counter / countdown einzubauen, damit man sagen könnte, dass man nur eine bestimmte zeit zur verfügung hat um den quiz zu beenden..

    danke und grüsse

  • hallo

    ja also, ich möchte für den ganzen quiz einen zeitlimit haben..

    hab mir schon mehrere skripte angeschaut, aber konnte das problem nicht lösen. ausserdem verstehe ich diese adlibenable nicht ganz. Sollte aber das quiz so schnell wie möglich fertig haben,darum wäre ich froh wenn mich jemand helfen würde. werde es mir dann später näher anschauen.

    gruss

  • Hallo Gianni,

    deine Antwort zeigt mir dass du dir noch nicht einmal die Mühe gemacht hast den anderen Thread zu lesen, da z.B @ChaosKeks auch eine Lösung ohne adlib gepostet hat. Unter Hilfe verstehe ich anscheinend etwas anderes als du. Du solltest dir überlegen mit deinem Programmwunsch in das Forum Jobbörse umzuziehen,

    mfg (Auto)Bert

  • Man AutoBert was hast du für ein problem??

    wenn du denkst, dass ich einer bin der die hilfe, das forum oder google nicht recherchiert bevor er hier postet, dann bist du bei mir falsch. und wenn du schauen würdest, würdest du sehen, dass ich schon mehrere skripte released habe, was heissen soll, dass ich die hilfe benutze --> und wie..

    ich hab geschrieben, dass ich es VERSUCHT habe, allerdings es nicht lösen konnte. somit wäre ich froh, wenn du mir helfen kannst, die lösung oder einen ansatz, zum bereits geposteten skript, zu finden.

    lass es sonst bitte sein (nicht böse gemeint) und dann werde ich halt einfach selber weiter versuchen oder einfach keinen countdown gebrauchen.