Désoler je me suis planter dans le copier coller voici la source complete (Attention c le bordel dans ma source )
Code : Tout sélectionner
InitSound(); on initialise l'environnement son
;-----------Message d'introduction----------------------
Intro1$ = "Bienvenue sur QCM ."
Intro2$ = "Cliquer sur le boutton QUESTION SUIVANTE pour commencer le test."
;-----------Fin Message d'introduction------------------
;-----------Début des Questions-------------------------
Question1$ = "1 "
Rep1a$ = "Réponse A "
Rep1b$ = "Réponse B "
Rep1c$ = "Réponse C "
Rep1d$ = "Réponse D "
Question2$ = "2"
Rep2a$ = "Réponse A "
Rep2b$ = "Réponse B "
Rep2C$ = "Réponse C "
Rep2D$ = "Réponse D "
Question3$ = "3 "
Rep3a$ = "Réponse A "
Rep3b$ = "Réponse B "
Rep3c$ = "Réponse C "
Rep3d$ = "Réponse D "
Question4$ = "4 "
Rep4a$ = "Réponse A "
Rep4b$ = "Réponse B "
Rep4c$ = "Réponse C "
Rep4c$ = "Réponse D "
RepV$ = "Réponse juste."
RepF$ = "Réponse fausse."
;-----------Fin des Questions---------------------------
;- Window Constants
;
Enumeration
#Window_1
EndEnumeration
;- MenuBar Constants
;
Enumeration
#MenuBar_2
EndEnumeration
Enumeration
#MENU_4
#MENU_5
EndEnumeration
;- Gadget Constants
;
Enumeration
#Image_0
#ProgressBar_0
#Frame3D_0
#Editor_0
#Frame3D_1
#CheckBox_0
#CheckBox_1
#CheckBox_2
#CheckBox_3
#Frame3D_2
#Editor_1
#Button_0
#Frame3D_3
#String_0
#Text_0
#Button_2
#String_1
#ListIcon_0
#Button_3
#Image_2
#Text_1
#Text_2
#Editor_3
#Button_4
#ProgressBar_1
#SOn
EndEnumeration
;- StatusBar Constants
;
Enumeration
#StatusBar_0
EndEnumeration
;- Fonts
Global FontID1
FontID1 = LoadFont(1, "Georgia", 8)
Global FontID2
FontID2 = LoadFont(2, "Georgia", 10)
Global FontID3
FontID3 = LoadFont(3, "Georgia", 12, #PB_Font_Bold)
Global FontID4
FontID4 = LoadFont(4, "Georgia", 12, #PB_Font_Underline)
Global FontID5
FontID5 = LoadFont(5, "Georgia", 24)
;- Image Plugins
UseJPEGImageDecoder()
;- Image Globals
Global Image0
Global Image1
Global Th
;- Catch Images
Image0 = CatchImage(0, ?Image0)
Image1 = CatchImage(1, ?Image1)
;- Images
DataSection
Image0:
IncludeBinary "D:\Divers\Sources Logiciel InfoProject\QCM\logo.bmp"
Image1:
IncludeBinary "D:\Divers\Sources Logiciel InfoProject\QCM\sst.jpg"
EndDataSection
Procedure Laps(Param)
Repeat
SetGadgetState(#ProgressBar_1,GetGadgetState(#ProgressBar_1)+1)
Delay(100)
If LoadSound(#Son, "c:\WINDOWS\system32\oobe\images\clickerx.wav") ; on va chercher le son
PlaySound(#Son , 0); on joue le son
EndIf
If GetGadgetState(#ProgressBar_1)=500
MessageRequester("Questionaire","Temps écoulé")
SetGadgetState(#ProgressBar_1,0)
SetGadgetText(#Button_0,"Question Suivante" )
PauseThread(Th)
EndIf
ForEver
EndProcedure
Procedure Open_Window_1()
If OpenWindow(#Window_1, 871, 293, 563, 456, "QCM.", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_TitleBar | #PB_Window_BorderLess | #PB_Window_ScreenCentered | #PB_Window_WindowCentered )
If CreateMenu(#MenuBar_2, WindowID(#Window_1))
MenuTitle("Fichier")
MenuItem(#MENU_4, "Quitter")
EndIf
If CreateStatusBar(#StatusBar_0, WindowID(#Window_1))
AddStatusBarField(50)
StatusBarText(#StatusBar_0,0," Points :",#PB_StatusBar_Raised)
AddStatusBarField(50)
AddStatusBarField(900)
EndIf
If CreateGadgetList(WindowID(#Window_1))
Frame3DGadget(#Frame3D_0, 5, 5, 550, 180, "Question :")
SetGadgetFont(#Frame3D_0, FontID1)
EditorGadget(#Editor_0, 15, 25, 530, 145 ,#PB_Editor_ReadOnly)
Frame3DGadget(#Frame3D_1, 5, 195, 550, 70, "Réponse :")
SetGadgetFont(#Frame3D_1, FontID1)
CheckBoxGadget(#CheckBox_0, 25, 225, 90, 15, "Réponse A", #PB_CheckBox_Right | #PB_CheckBox_Center)
SetGadgetFont(#CheckBox_0, FontID2)
CheckBoxGadget(#CheckBox_1, 160, 225, 85, 15, "Réponse B", #PB_CheckBox_Right | #PB_CheckBox_Center)
SetGadgetFont(#CheckBox_1, FontID2)
CheckBoxGadget(#CheckBox_2, 300, 225, 85, 15, "Réponse C", #PB_CheckBox_Right | #PB_CheckBox_Center)
SetGadgetFont(#CheckBox_2, FontID2)
CheckBoxGadget(#CheckBox_3, 450, 225, 85, 15, "Réponse D", #PB_CheckBox_Right | #PB_CheckBox_Center)
SetGadgetFont(#CheckBox_3, FontID2)
Frame3DGadget(#Frame3D_2, 5, 290, 550, 110, "Correction :")
SetGadgetFont(#Frame3D_2, FontID1)
EditorGadget(#Editor_1, 10, 310, 540, 80 ,#PB_Editor_ReadOnly)
ButtonGadget(#Button_0, 440, 270, 115, 20, "Lancer le QCM")
SetGadgetFont(#Button_0, FontID1)
ProgressBarGadget(#ProgressBar_1, 102, 418, 460, 18, 0, 500)
EndIf
EndIf
EndProcedure
Open_Window_1()
AddGadgetItem(#Editor_0, 0,Intro1$)
AddGadgetItem(#Editor_0, 1,Intro2$)
Th = CreateThread(@Laps(),0)
PauseThread(Th)
Repeat ; Start of the event loop
Event = WaitWindowEvent() ; This line waits until an event is received from Windows
WindowID = EventWindow() ; The Window where the event is generated, can be used in the gadget procedures
GadgetID = EventGadget() ; Is it a gadget event?
EventType = EventType() ; The event type
;You can place code here, and use the result as parameters for the procedures
If Event = #PB_Event_Menu
MenuID = EventMenu()
If MenuID = #MENU_4
Debug "GadgetID: #MENU_4"
End
EndIf
EndIf
If Event = #PB_Event_Gadget
If GadgetID = #Image_0
ElseIf GadgetID = #ProgressBar_0
ElseIf GadgetID = #Editor_0
ElseIf GadgetID = #CheckBox_0
ElseIf GadgetID = #CheckBox_1
ElseIf GadgetID = #CheckBox_2
ElseIf GadgetID = #CheckBox_3
ElseIf GadgetID = #Editor_1
ElseIf GadgetID = #Button_0
If GetGadgetText(#Button_0)<>"Valider"
SetGadgetText(#Button_0,"Valider" )
ResumeThread(Th)
n+1
ClearGadgetItemList(#Editor_0)
AddGadgetItem(#Editor_0,0,Question1$)
AddGadgetItem(#Editor_0,1,Rep1a$)
AddGadgetItem(#Editor_0,2,Rep1b$)
AddGadgetItem(#Editor_0,3,Rep1c$)
AddGadgetItem(#Editor_0,4,Rep1d$)
Else
If GetGadgetState(#ProgressBar_1)=500
ResumeThread(Th)
Else
PauseThread(Th)
SetGadgetText(#Button_0,"Détail Réponse" )
SetGadgetState(#ProgressBar_1,0)
SetGadgetText(#Button_0,"Question Suivante" )
If GetGadgetState(#CheckBox_2)
AddGadgetItem(#Editor_1,0,RepV$)
Else
AddGadgetItem(#Editor_1,0,RepF$)
EndIf
If GetGadgetText(#Button_0)<>"Valider"
SetGadgetText(#Button_0,"Valider" )
ResumeThread(Th)
n+1
ClearGadgetItemList(#Editor_0)
AddGadgetItem(#Editor_0,0,Question2$)
AddGadgetItem(#Editor_0,1,Rep2a$)
AddGadgetItem(#Editor_0,2,Rep2b$)
AddGadgetItem(#Editor_0,3,Rep2c$)
AddGadgetItem(#Editor_0,4,Rep2d$)
Else
If GetGadgetState(#ProgressBar_1)=500
ResumeThread(Th)
Else
PauseThread(Th)
SetGadgetText(#Button_0,"Détail Réponse" )
SetGadgetState(#ProgressBar_1,0)
SetGadgetText(#Button_0,"Question Suivante" )
If GetGadgetState(#CheckBox_2)
AddGadgetItem(#Editor_1,0,RepV$)
Else
AddGadgetItem(#Editor_1,0,RepF$)
EndIf
If GetGadgetText(#Button_0)<>"Valider"
SetGadgetText(#Button_0,"Valider" )
ResumeThread(Th)
n+1
ClearGadgetItemList(#Editor_0)
AddGadgetItem(#Editor_0,0,Question3$)
AddGadgetItem(#Editor_0,1,Rep3a$)
AddGadgetItem(#Editor_0,2,Rep3b$)
AddGadgetItem(#Editor_0,3,Rep3c$)
AddGadgetItem(#Editor_0,4,Rep3d$)
Else
If GetGadgetState(#ProgressBar_1)=500
ResumeThread(Th)
Else
PauseThread(Th)
SetGadgetText(#Button_0,"Détail Réponse" )
SetGadgetState(#ProgressBar_1,0)
SetGadgetText(#Button_0,"Question Suivante" )
If GetGadgetState(#CheckBox_2)
AddGadgetItem(#Editor_1,0,RepV$)
Else
AddGadgetItem(#Editor_1,0,RepF$)
EndIf
EndIf
EndIf
EndIf
EndIf
EndIf
EndIf
ElseIf GadgetID = #String_0
ElseIf GadgetID = #Button_2
ElseIf GadgetID = #String_1
ElseIf GadgetID = #ListIcon_0
ElseIf GadgetID = #Button_3
ElseIf GadgetID = #Image_2
ElseIf GadgetID = #Editor_3
ElseIf GadgetID = #Button_4
EndIf
EndIf
Until Event = #PB_Event_CloseWindow ; End of the event loop
End
;