Questionnaire batch

Résolu
kentin5601 Messages postés 3197 Date d'inscription   Statut Membre Dernière intervention   -  
cs-bilou Messages postés 836 Statut Membre -
Bonjour,
J'aimerai créer un questionnaire batch c'est a dire que j'aimerai poser une question et que je puisse repondre avec 4 choix différent. et si je répond faux je fait appelle a un programme.
désoler si vous arriver pas a comprendre se que je veux obtenir. et merci des éventuelle réponse.
Configuration: Windows XP
Firefox 3.0.3

3 réponses

  1. cs-bilou Messages postés 836 Statut Membre 164
     
    Le forum date un peu mais voila j'ai fait un questionnaire bien sur vous pouvez le modifier a votre guise.^^

    @echo off
    title Questionnaire
    set note=5
    
    :question1
     cls
     color 0F
     echo.
     ECHO ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
     echo ºQuestion 1 : Quelle est l'extension des fichiers batch ?º
     ECHO ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
     echo 1 : ".bat"
     echo 2 : ".batch"
     echo 3 : ".dos"
     echo 4 : ".ms-dos"
    
    
    set /p REP1=Votre reponse (chiffre) :
    if "%REP1%"=="1" (goto rep_bon) else goto rep_fausse
    
    
    :question2
     cls
     color 0F
     echo.
     ECHO ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
     echo ºQuestion 2 : Quel est la commande pour supprimer un fichier ?º
     ECHO ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
     echo 1 : "ECHO"
     echo 2 : "CD"
     echo 3 : "DEL"
     echo 4 : "DIR"
     ECHO ****************
    
    set /p REP2=Votre reponse (chiffre) :
    if "%REP2%"=="3" (goto rep_bon) else goto rep_fausse
    
    
    :question3
     cls
     color 0F
     echo.
     ECHO ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
     echo ºQuestion 3 : Quel est la commande pour changer le volume audio ?º
     ECHO ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
     echo 1 : "MODE"
     echo 2 : "VOL"
     echo 3 : "RD"
     echo 4 : "On peut pas"
    
    
    set /p REP3=Votre reponse (chiffre) :
    if "%REP3%"=="4" (goto rep_bon) else goto rep_fausse
    
    
    
    :question4
     cls
     color 0F
     echo.
     ECHO ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
     echo ºQuestion 4 : Quel est la commande pour savoir pour afficher le contenue d'un dossier ?º
     ECHO ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
     echo 1 : "ECHO"
     echo 2 : "DIR"
     echo 3 : "CMD"
     echo 4 : "CLS"
    
    
    set /p REP4=Votre reponse (chiffre) :
    if "%REP4%"=="2" (goto rep_bon) else goto rep_fausse
    
    
    
    :question5
     cls
     color 0F
     echo.
     ECHO ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
     echo ºQuestion 5 : Quel est la commande pour deplacer des fichier ?º
     ECHO ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
     echo 1 : "COPY"
     echo 2 : "MODE"
     echo 3 : "MOVE"
     echo 4 : "DEPLACE"
    
    
    set /p REP5=Votre reponse (chiffre) :
    if "%REP5%"=="2" (goto rep_bon) else goto rep_fausse
    
    
    
    
    :rep_bon
    cls
    color 02
    echo BRAVO, c'est la bonne reponse !!!
    echo Question Suivante.
    pause
    if "%REP1%"=="1" (
    	set REP1=0
    	goto question2
    )
    
    if "%REP2%"=="3" (
    	set REP2=0
    	goto question3
    )
    if "%REP3%"=="4" (
    	set REP3=0
    	goto question4
    )
    
    if "%REP4%"=="2" (
    	set REP4=0
    	goto question5
    )
    
    if "%REP5%"=="2" (
    	set REP5=0
    	goto score
    )
    
    :rep_fausse
    cls
    color 0C
    echo Non c'est pas sa !!
    set /a note=%note%-1
    pause
    if not "%REP1%"=="1" goto question1
    if not "%REP2%"=="3" goto question2
    if not "%REP3%"=="4" goto question3
    if not "%REP4%"=="2" goto question4
    if not "%REP5%"=="2" goto question5
    
    
    :score
    cls
    color 0E
    echo Ton score est de %note%/5
    pause


    Voila J'espère que sa va aider du monde.
    9
  2. Utilisateur anonyme
     
    Slt, essaies se code :

    @echo off
    :start
    title Questionnaire
    @cls
    color 0F
    echo.
    echo Question : Quelle est l'extension des fichiers batch ?
    echo.
    echo 1 = ".bat"
    echo 2 = ".batch"
    echo 3 = ".dos"
    echo 4 = ".ms-dos"
    echo.
    set /p REP=Votre reponse (chiffre) :
    if "%REP%"=="1" goto REP_OK
    goto REP_KO
    
    :REP_OK
    @cls
    color 02
    echo.
    echo BRAVO, c'est la bonne reponse !!!
    echo.
    pause
    exit
    
    :REP_KO
    @cls
    color 0C
    echo.
    echo NON, ce n'est pas la bonne reponse !!!
    echo.
    pause
    call "C:\ton_prog.exe"
    exit


    Après, modifies le programme a ouvrir, les questions, les reponses...

    Si tu as besoin d'aide, demandes^^

    @+
    5
    1. kentin5601 Messages postés 3197 Date d'inscription   Statut Membre Dernière intervention   406
       
      ho génial c'est tout a fait se que je voulais merci encore
      0
  3. cs-bilou Messages postés 836 Statut Membre 164
     
    Toujours moi je me suis tromper dans mon soft A la fin au lieu de:

    if not "%REP1%"=="1" goto question1
    if not "%REP2%"=="3" goto question2
    if not "%REP3%"=="4" goto question3
    if not "%REP4%"=="2" goto question4
    if not "%REP5%"=="2" goto question5


    Il faut mettre :

    if not "%REP1%"=="0" goto question1
    if not "%REP2%"=="0" goto question2
    if not "%REP3%"=="0" goto question3
    if not "%REP4%"=="0" goto question4
    if not "%REP5%"=="0" goto question5


    Et aussi dans la question deux a la place de:

     ECHO ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
     echo ºQuestion 2 : Quel est la commande pour supprimer un fichier ?º
     ECHO ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
    


    il faut mettre :

     ECHO ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
     echo ºQuestion 2 : Quel est la commande pour supprimer un fichier ?º
     ECHO ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ

    1