Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
1.4k views
in Plugins by

Hello everyone

i hope you all are doing well 

i need your help in quiz plugin which is showing an error of time to me,

whenever i go to my score page i got the following error, i have tested carefully & attempted two questions on different time but time is only showing 1 second ago in all quiz question attempted. after 10 minutes it still shows 1 second ago. 

Dear Kai  i need your help because you are the developer.

thanks

 

by
please help me out
by
Please Kai help me out
by
Is there anybody to help me.

1 Answer

+1 vote
by
Check your database:

1. "db_time" in qa_options

2. "timestamp" in table quizx_gameplay

From both the time ago is calculated.

See quizx-page-userstats.php lines:

$qtime = qa_opt('db_time')-strtotime($row['timestamp']);

$qcreated = qa_lang_html_sub('main/x_ago', qa_html(qa_time_to_string($qtime)));
by
Dear

I already checked this

quizx-page-userstats.php lines:

$qtime = qa_opt('db_time')-strtotime($row['timestamp']);

$qcreated = qa_lang_html_sub('main/x_ago', qa_html(qa_time_to_string($qtime)));

&

"timestamp" in table quizx_gameplay in database is fine.

but

there is no  "db_time" in qa_options in database

&

"quizx_stamps" table is empty in database.

Help me out
by
My bad, "db_time" is not in table "qa_options" but coming from the file system: /app/options.php - So do within the code above: var_dump($row['timestamp']); var_dump(qa_opt('db_time')); to see what the values are.
by
please can you explain how to rectify this problem ?
by
how to use this code & where exactly?

 var_dump($row['timestamp']); var_dump(qa_opt('db_time'));
by
it will be better if you send me a fresh copy of this plugin to this email address  

sajan12it13@yahoo.com
by
I am pretty sure now that this is a timezone issue. Can you set date_default_timezone_set('Europe/Berlin'); (take your right timezone: http://php.net/manual/en/timezones.php ) as a line into the script?
...