Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1

    Default Online Scholarship Exam : PHP


    guyz i need help sa concept unsaon randomize amo question sa php guyz..we have a database na naay table na nag contain sa tanang quenstions...dayun we want na random ang pagawas niya sa page...heres the screen shot of what we want to be displayed


  2. #2
    The server is good enough to store the amount of SESSION as an array data, as a list of QUESTION IDs(from database), in random order but not repeating.

    Strict error trapping should be applied when it comes to USER negligence pressing back/forward/history buttons of the browser.
    Last edited by dodie; 03-12-2010 at 11:04 PM.

  3. #3
    Quote Originally Posted by dodie View Post
    The server is good enough to store the amount of SESSION as an array data, as a list of QUESTION IDs(from database), in random order but not repeating.

    Strict error trapping should be applied when it comes to USER negligence pressing back/forward/history buttons of the browser.
    tnx for replying sir dodie.....amount of session? pls elaborate more sir.....

  4. #4
    dili madala ug shuffle brod?
    very simple example:
    $myques = array("How old?","Where you live?","Your course?");//your list of questions
    $keys = array_keys($myques);
    shuffle($keys);
    foreach ($keys as $key)
    {
    echo $myques[$key];
    echo "<br/>";
    }

  5. #5
    Quote Originally Posted by ondoy View Post
    dili madala ug shuffle brod?
    very simple example:
    $myques = array("How old?","Where you live?","Your course?");//your list of questions
    $keys = array_keys($myques);
    shuffle($keys);
    foreach ($keys as $key)
    {
    echo $myques[$key];
    echo "<br/>";
    }
    i like this idea...first time hearing about shuffle..hehe..tnx bro

  6. #6
    Quote Originally Posted by Deathnote View Post
    i like this idea...first time hearing about shuffle..hehe..tnx bro
    ay but theres one problem lang bro...how will the system filter kung unsa na ang na display niya..i mean the test is spread to more than 1 page...so.....

  7. #7
    you can put d shuffled array(id's) in a session

  8. #8
    Quote Originally Posted by ondoy View Post
    you can put d shuffled array(id's) in a session
    bro unsay session?...mao sad ang gi ingon ni sir dodie but never encountered the term b4

  9. #9
    Quote Originally Posted by Deathnote View Post
    bro unsay session?...mao sad ang gi ingon ni sir dodie but never encountered the term b4
    Session is use to store or preserve informations can be used in subsequent access to you web application. For example user authentication, once the user is successfully authenticated, his info is stored in the session so that he will never have to login again with in the lifespan of the session unless he logout. You should know about sessions and cookies...

  10. #10
    To keep the story short, the following are the BASIC FOUNDATIONS for your program.

    read this please.

    LINKS:
    PHP: session_start - Manual

    PHP: session_destroy - Manual

    PHP: Arrays - Manual

    PHP: mysql_fetch_assoc - Manual


    I meant SESSION as an array data, containing only ID's.. which you can monitor with your program by itself.. and also to consume only tiny amount of space in the server's SESSIONs hidden storage.

    You store the ARRAY data as part of the SESSION. With this, you have the complete control of the user and error trappings, whereever and whenever the user is messing with the browser buttons, forward/back/REFRESH.

    You need a FLAG data or marker to monitor the user which question he/she is now. You need to practise more, CODE MANAGEMENT is hard when you are a new learner with PHP. You must create your own PROGRAMMING CONVENTIONS and variable namings to keep your program , Programmer friendly.

    WARNING:
    Don't ever load the entire words, strings, phrases of questionairs and choices into the SESSION, it is equivalent to SUICIDE
    I warned you. hahahahaha

    APACHE server settings is limited to small amount of space for each user protocol. Too keep your development fast and safe, use XAMPP in your computer, develop it locally. ht t p://localhost/
    Last edited by dodie; 03-16-2010 at 08:51 AM.

  11.    Advertisement

Page 1 of 2 12 LastLast

Similar Threads

 
  1. yp4sc? online exam?
    By cobarde in forum Campus Talk
    Replies: 2
    Last Post: 09-11-2014, 07:34 AM
  2. php job exam
    By theKidFrankie in forum Career Center
    Replies: 0
    Last Post: 02-19-2011, 09:07 PM
  3. Want To Buy: Luna online gold for php
    By gOdz in forum Everything Else...
    Replies: 0
    Last Post: 11-01-2009, 11:17 PM
  4. PHP certification exam
    By roxangui in forum Websites & Multimedia
    Replies: 0
    Last Post: 08-19-2009, 02:28 PM
  5. how to launch web page [php] online?
    By hybrid_X in forum Websites & Multimedia
    Replies: 0
    Last Post: 04-14-2006, 05:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top