function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
viswadaviswada 

set timer for vf page( like online exam)

Hi all,

 

  my senario is like online exam.   I developed one   vf page for displaying  20 questions(records) from question obeject .  i need to   set  timer  for vf page ,  suppose  i am having   20 questions in vf page . i nedd to set 20 min . after twenty 20 min that visual force page  should not appeared  , i can only show the result. How to set the timer for visual force page  ,plz  any on help me

MrTheTylerMrTheTyler

Hello,

 

  You can use your timer to set a boolean field once the time has expired.  You can break your VF page down into 2 different <apex:outputpanel> blocks and selectively render one or the other by using <apex:outputpanel rendered="{!showtest}"> with showtest being a property in your page's controller

 

 

public class pgcontroller{
	public boolean showtest{
		get{
			//code goes here that query's database to see if test time has expired and returns true/false accordingly
		};
		private set;
	}	
}

 

 

 

Kind Regards,

 

 

Tyler Hudson
Contact Us - We Can Help!

Salesforce Superheroes
------------------------------
help@salesforcesuperheroes.com
www.salesforcesuperheroes.com
1-888-407-9578 x123

viswadaviswada

Thanks  for replay,

    

 

     i am in torouble with time,  i don't know how  to calculate time ,   as  you said i can use  output panels,how can   test  if tes has expired time or not,    how to to construct  time