1. Welcome to PHCorner Forums. Take a moment to Sign up and gain unlimited access and extra privileges that guests are not entitled to, such as:

    All that and more! Registration is quick, simple and absolutely free. Join our community today!

HTML, CSS & Javascript Need help on making quiz.

Discussion in 'Coding, Programming' started by Draig, Oct 18, 2016.

  1. Draig

    Draig Addict Established

    Please help sa pag-gawa ng quiz. Newbie kasi sa javascript.
    Ang conditions ay dapat nagra-random ang questions.
    At nase-select ng 10 out of 20 questions.
    Multiple choice ang type ng quiz. Thanks sa tutulong! :)
     
  2. buLad1234

    buLad1234 Forum Veteran Established

    Hope may maka tulong sayo.
     
  3. markrain

    markrain Addict Established

    Google search,

    Tiwala lang sa sarili magagawa mo yan
     
  4. Draig

    Draig Addict Established

    1 Week na ako naghahap pero di ko makumpleto.
     
  5. markrain

    markrain Addict Established

    try lang ng try
     
  6. Draig

    Draig Addict Established

    As if naman hindi naghahanap hanggang ngayon.
    Kaya nga nanghihingi na ng tulong eh.
    At may deadline ito, kaya ako nagpost.
     
  7. markrain

    markrain Addict Established

    Ok ,sana may makatulong sayo
     
  8. Patingin ng nasimulan mo na sir. Paup na rin ng sample questionaires.
     
  9. Onej

    Onej Addict Established

    Pa tingin din ng na simulan mo sir baka m maitulong ako :)
     
  10. May ginawa ako dito sir. Isang function pa siguro tapos na ito. Wala nga lang design. Mahina ako sa css. :) Cellphone ko lang ginawa kaya nakabootstrap.

    Radio button ang ginamit ko sa pag answer. Nasha shuffle na ang answer, random na rin ang questionaires.

    Ilan lang questionaires ko, kaya kuha lang ako ng 5. At iyan na lang ang kulang. :)

    Pero gusto ko muna sanang makita yong ginawa mo sir.
     

    Attached Files:

    You must or Register to view Attachment.
    Last edited: Oct 19, 2016
  11. Path_Finder

    Path_Finder Grasshopper Established

    Madali lang Yan Dodong....

    ==> Gawa ka ng JSON(javascript object notation) lagay mo doon ung mga questions, choices and answers..
    basic exampe...
    {
    "questions":["what do you call a young cat?","how old am i?"],

    "choices":[["puppy","kitten","calf","chick"],["20","15","18","19"]],

    "answers":[""kitten","19"]
    }


    ganyan format.. tas save mo as AnyFileName.json

    ==> eto ang way ko ng pag access sa json.. sa javascript

    var resource = new XMLHttpRequest();
    resource.open("get","AnyFileName.json",false);
    resource.send(null);
    var info = JSON.parse(resource.responseText);



    ==> Para random ang pag'access mo sa questions gamit ka Math.Random()..

    halimbawa e'ddisplay mo na question gamit console..

    var indx = Math.Floor(Math.Random() * info.questions.length) + 1;
    console.log(info.questions[indx]);

    or at the same time gusto mo rin e display ang choices..

    console.log(info.choices[indx]);


    ==> Taz compare mo nalang yung answer ng user sa answers dun sa json kung tama o mali...


    Good Luck...
     
    Last edited: Oct 20, 2016
  12. Draig

    Draig Addict Established

    angelofmercyangelofmercy, OneJ
    Scoring/pag-check ng sagot nalang yung kulang.
    Eto yung code ko
    Spoiler contents only visible to Established Member.

    Path_FinderPath_Finder
    Hindi json kailangan ko, html,css, at javascript lang pwede.

    Please patulong hanggang bukas na lang ito.
     
    Last edited: Oct 21, 2016
  13. sayang paborito ko pa naman si java challenging yung codes..
    halos nakalimutan ko na
     
  14. Naka fix pala sa iyo ang answer sir. Ang ginawa ko kasi, ang tamang sagot laging kasunod ng tanong. Tapos, function para sa shuffle. :) guide mo na lang ito sir.
    Spoiler contents only visible to Established Member.
     
    Last edited: Oct 22, 2016
Tags / Keywords: