Muhammad Muhaimin
Forum Replies Created
-
Forum: Plugins
In reply to: [Wp-Pro-Quiz] Refresh while test, and the timer restartsit’s a bit complicated.
especially, if you have never edit a plugin.firstly, I use jQuery Cookie, so download it.
then follow these steps:
1. navigate to
/wp-content/plugins/wp-pro-quiz
.2. place
jquery.cookie.js
injs
folder.3. edit
wp-pro-quiz.php
define('WPPROQUIZ_DEV', false);
to
define('WPPROQUIZ_DEV', true);
4. edit
/lib/controller/WpProQuiz_Controller_Front.php
if($quiz) { wp_enqueue_script( 'wpProQuiz_front_javascript', plugins_url('js/wpProQuiz_front'.(WPPROQUIZ_DEV ? '' : '.min').'.js', WPPROQUIZ_FILE), array('jquery-ui-sortable'), WPPROQUIZ_VERSION, $footer ); wp_localize_script('wpProQuiz_front_javascript', 'WpProQuizGlobal', array( 'ajaxurl' => admin_url('admin-ajax.php'), 'loadData' => __('Loading', 'wp-pro-quiz'), 'questionNotSolved' => __('You must answer this question.', 'wp-pro-quiz'), 'questionsNotSolved' => __('You must answer all questions before you can completed the quiz.', 'wp-pro-quiz'), 'fieldsNotFilled' => __('All fields have to be filled.', 'wp-pro-quiz') )); }
to
if($quiz) { wp_enqueue_script( 'wpProQuiz_front_javascript', plugins_url('js/wpProQuiz_front'.(WPPROQUIZ_DEV ? '' : '.min').'.js', WPPROQUIZ_FILE), array('jquery-ui-sortable'), WPPROQUIZ_VERSION, $footer ); wp_localize_script('wpProQuiz_front_javascript', 'WpProQuizGlobal', array( 'ajaxurl' => admin_url('admin-ajax.php'), 'loadData' => __('Loading', 'wp-pro-quiz'), 'questionNotSolved' => __('You must answer this question.', 'wp-pro-quiz'), 'questionsNotSolved' => __('You must answer all questions before you can completed the quiz.', 'wp-pro-quiz'), 'fieldsNotFilled' => __('All fields have to be filled.', 'wp-pro-quiz'), 'userId' => get_current_user_id() )); wp_enqueue_script( 'jquery-cookie', plugins_url('js/jquery.cookie.js', WPPROQUIZ_FILE), array('jquery-ui-sortable'), '1.4.0', $footer ); }
5. edit
js/wpProQuiz_front.js
.var timelimit = (function() { var _counter = config.timelimit; var _intervalId = 0; var instance = {}; instance.stop = function() { if(_counter) { window.clearInterval(_intervalId); globalElements.timelimit.hide(); } }; instance.start = function() { if(!_counter) return; var x = _counter * 1000; var $timeText = globalElements.timelimit.find('span').text(plugin.methode.parseTime(_counter)); var $timeDiv = globalElements.timelimit.find('.wpProQuiz_progress'); globalElements.timelimit.show(); var beforeTime = +new Date(); _intervalId = window.setInterval(function() { var diff = (+new Date() - beforeTime); var elapsedTime = x - diff; if(diff >= 500) { $timeText.text(plugin.methode.parseTime(Math.ceil(elapsedTime / 1000))); } $timeDiv.css('width', (elapsedTime / x * 100) + '%'); if(elapsedTime <= 0) { instance.stop(); plugin.methode.finishQuiz(true); } }, 16); }; return instance; })();
to
var timelimit = (function() { var _counter = config.timelimit; var _intervalId = 0; var instance = {}; // set cookie for different users and different quizzes var timer_cookie = 'wpq-time-limit-' + WpProQuizGlobal.userId + '-' + config.quizId; instance.stop = function() { if(_counter) { $.removeCookie(timer_cookie); window.clearInterval(_intervalId); globalElements.timelimit.hide(); } }; instance.start = function() { if(!_counter) return; $.cookie.raw = true; var full = _counter * 1000; var tick = $.cookie(timer_cookie); var limit = tick ? tick : _counter; var x = limit * 1000; var $timeText = globalElements.timelimit.find('span').text(plugin.methode.parseTime(limit)); var $timeDiv = globalElements.timelimit.find('.wpProQuiz_progress'); globalElements.timelimit.show(); var beforeTime = +new Date(); _intervalId = window.setInterval(function() { var diff = (+new Date() - beforeTime); var remainingTime = x - diff; if(diff >= 500) { tick = remainingTime / 1000; $timeText.text(plugin.methode.parseTime(Math.ceil(tick))); $.cookie(timer_cookie, tick); } $timeDiv.css('width', (remainingTime / full * 100) + '%'); if(remainingTime <= 0) { instance.stop(); plugin.methode.finishQuiz(true); } }, 16); }; return instance; })();
Forum: Plugins
In reply to: [Wp-Pro-Quiz] Refresh while test, and the timer restartsyay_!
I’ve successfully save the timer to cookies.Forum: Plugins
In reply to: [Wp-Pro-Quiz] Page refreshyay_!
I’ve successfully save the timer to cookies.Forum: Plugins
In reply to: [Wp-Pro-Quiz] Refresh while test, and the timer restartsyeah_ I don’t like it too.
maybe we can set some cookie variables for the timer.
I’ll try to find it.Forum: Plugins
In reply to: [Wp-Pro-Quiz] Embeding Youtube videos in questionshey_ I can do that!
just copy the embed code (iframe) to the question field.hope this helps_
yeah_ me too!
Forum: Plugins
In reply to: [Wp-Pro-Quiz] Vertical quiz-summary navigationI’ve just found it!
I have to add this CSS property:.wpProQuiz_reviewQuestion li { clear: none; }
Forum: Plugins
In reply to: [Wp-Pro-Quiz] Page refreshyeah_ I don’t want the quiz to start over too when I refresh page.
how does they look in your browser?
this is my front page:
https://widyagama.ac.id/informatika/and this is my bbPress Group Directory:
https://widyagama.ac.id/informatika/komunitas/grup/I connect my laptop to the internet through another network, without clearing my browser cache, and the share buttons are displayed now.
hmm_ what a weird problem.
it’s here:
https://widyagama.ac.id/informatika/Forum: Plugins
In reply to: [Sweet Captcha] "Omit captcha for registered users" has a minor bugNot yet.
Every time I update Sweet Captcha, I still have to change:
ommit
to:
omitForum: Plugins
In reply to: [Sweet Captcha] "sweetcaptcha_contact_form" conflicts with other plugin(s)Not yet.
The error message still appear.Forum: Plugins
In reply to: [Sweet Captcha] "Omit captcha for registered users" has a minor bugyes, I think so.