Hello,
I am new to web development and I am trying to develop on-line exam practice website. I need to display a question for a particular duration of time and after that next question should be displayed and so on. Can any one please help me how to achieve this.
Thanks & Regards,
Samir
how to display the text for a particular duration of time
Moderator: General Moderators
-
samir_gambler
- Forum Newbie
- Posts: 19
- Joined: Wed Mar 31, 2010 9:03 am
Re: how to display the text for a particular duration of tim
first use AJAX and then using javascript setInterval() function you can change the question in some time interval
-
priyankagound
- Forum Commoner
- Posts: 27
- Joined: Thu Sep 19, 2013 2:53 am
Re: how to display the text for a particular duration of tim
You will want to modify your WordPress theme so that the changes can be site-wide.
Log in to your WordPress installation.
Navigate to Appearance > Editor
In the Templates section, go to header.php
At the very beginning of header.php, insert your code :
<?php
$date = time();
$contestStart = strtotime('2012-02-03 00:00:00');
if ($date < $contestStart) {
?>
<html>
Insert your whole splash page here.
</html>
<?php
exit;
}
?>
//The normal template code should be below here.
Don't forget to click the "Update File" button on WordPress when you're done; and like the others said, make sure that your specified time is synced with whatever timezone the server is in.
Log in to your WordPress installation.
Navigate to Appearance > Editor
In the Templates section, go to header.php
At the very beginning of header.php, insert your code :
<?php
$date = time();
$contestStart = strtotime('2012-02-03 00:00:00');
if ($date < $contestStart) {
?>
<html>
Insert your whole splash page here.
</html>
<?php
exit;
}
?>
//The normal template code should be below here.
Don't forget to click the "Update File" button on WordPress when you're done; and like the others said, make sure that your specified time is synced with whatever timezone the server is in.
-
priyankagound
- Forum Commoner
- Posts: 27
- Joined: Thu Sep 19, 2013 2:53 am
Re: how to display the text for a particular duration of tim
Try out this.
if you need to display the link between 11:45pm and 11:59pm on Sunday, you could do something simpler:
For example:
if ($d == 'Sunday' && $h == 23 && $m >= 45 && $m <= 59) {
$ucrTimeToggle = 'radio-online';
} else {
$ucrTimeToggle = 'radio-offline';
}
if you need to display the link between 11:45pm and 11:59pm on Sunday, you could do something simpler:
For example:
if ($d == 'Sunday' && $h == 23 && $m >= 45 && $m <= 59) {
$ucrTimeToggle = 'radio-online';
} else {
$ucrTimeToggle = 'radio-offline';
}