Forum Replies Created

Viewing 9 replies - 16 through 24 (of 24 total)
  • @saraharnstein Glad we could assist.

    Have a nice day ??

    Hi @muratcelebi,

    The added attribute for lazy loading does not seem right. It should be loading="lazy" instead of data-lazyloaded="1".

    I hope that helps.

    Have a nice day ??

    Hi @lyvyu,

    I have just checked your site and I am able to add details absolutely fine. Here is a screenshot for reference -> https://share.getcloudapp.com/KouwqO99.

    So is this issue fixed or I am missing something?

    Have a nice day ??

    Hi @fyrakins,

    I tried to take a look at your site. However, seems it is under maintenance right now. So, unfortunately, can not suggest anything ATM.

    Have a nice day ??

    Hi @saraharnstein,

    @sean777 is right. I have also checked your site and can see the Skimlinks reference added in an Elementor widget. I’d recommend you to remove this particular widget that’s added in your footer. You will be good to go then.

    Have a nice day ??

    I am having a bit same issue with same hosting providers. Anyone got solution? need help..!!!!

    Here is link to my issue details.

    What i have figured out so far is
    $_SESSION['wpsqt'][$quizName]['sections']
    this session variable doesnt get updated next time, even at first time. Can you please tell me where they are doing this stuff? It seems tricky.

    hmm, well I have not changed plugin code. I have just added my own to some pages which shouldnt break plugin functionliaty.
    Here is code for FinishQuiz function.

    global $wpdb;
    
    		$quizName = $_SESSION['wpsqt']['current_id'];
    
    		if ( $_SESSION['wpsqt'][$quizName]['details']['use_wp'] == 'yes'){
    			$objUser = wp_get_current_user();
    			$_SESSION['wpsqt'][$quizName]['person']['name'] = $objUser->user_login;
    			$_SESSION['wpsqt'][$quizName]['person']['email'] = $objUser->user_email;
    		} 
    
    		$personName = (isset($_SESSION['wpsqt'][$quizName]['person']['name'])) ? $_SESSION['wpsqt'][$quizName]['person']['name'] :  'Anonymous';
    		$timeTaken = microtime(true) - $_SESSION['wpsqt'][$quizName]['start_time'];
    
    		$totalPoints = 0;
    		$correctAnswers = 0;
    		$canAutoMark = true;
    
    		foreach ( $_SESSION['wpsqt'][$quizName]['sections'] as $quizSection ){
    			if ( $this->_type != "quiz" || ( isset($quizSection['can_automark']) && $quizSection['can_automark'] == false) ){
    				$canAutoMark = false;
    					break;
    			}
    
    			foreach ( $quizSection['questions'] as $question ){
    				$totalPoints += $question['points'];
    			}
    
    			if ( !isset($quizSection['stats']) ) {
    				continue;
    			}
    
    			if ( isset($quizSection['stats']['correct']) ){
    				$correctAnswers += $quizSection['stats']['correct'];
    			}
    
    		}
    
    		if ( $canAutoMark === true ){
    			$_SESSION['wpsqt']['current_score'] = $correctAnswers." correct out of ".$totalPoints;
    		} else {
    			$_SESSION['wpsqt']['current_score'] = "quiz can't be auto marked";
    		}
    
    		if ( $correctAnswers !== 0 ){
    			$percentRight = ( $correctAnswers / $totalPoints ) * 100;
    		} else {
    			$percentRight = 0;
    		}
    
    		if ( !isset($_SESSION['wpsqt'][$quizName]['details']['store_results']) ||  $_SESSION['wpsqt'][$quizName]['details']['store_results'] !== "no" ){
    			$wpdb->query(
    				$wpdb->prepare("INSERT INTO <code>&quot;.WPSQT_TABLE_RESULTS.&quot;</code> (timetaken,person,sections,item_id,person_name,ipaddress,score,total,percentage)
    								VALUES (%d,%s,%s,%d,%s,%s,%d,%d,%d)",
    								   array($timeTaken,
    							   		 serialize($_SESSION['wpsqt'][$quizName]['person']),
    							   		 serialize($_SESSION['wpsqt'][$quizName]['sections']),
    							   		 $_SESSION['wpsqt'][$quizName]['details']['id'],
    							   		 $personName,$_SERVER['REMOTE_ADDR'],$correctAnswers,$totalPoints,$percentRight ) )
    					);
    
    			$_SESSION['wpsqt']['result_id'] = $wpdb->insert_id;
    		} else {
    			$_SESSION['wpsqt']['result_id'] = null;
    		}
    		$emailAddress = get_option('wpsqt_contact_email');
    
    		if ( $_SESSION['wpsqt'][$quizName]['details']['notificaton_type'] == 'instant' ){
    			$emailTrue = true;
    		} elseif ( $_SESSION['wpsqt'][$quizName]['details']['notificaton_type'] == 'instant-100'
    					&& $percentRight == 100 ) {
    			$emailTrue = true;
    		} elseif ( $_SESSION['wpsqt'][$quizName]['details']['notificaton_type'] == 'instant-75'
    					 && $percentRight > 75 ){
    			$emailTrue = true;
    		} elseif ( $_SESSION['wpsqt'][$quizName]['details']['notificaton_type'] == 'instant-50'
    					&& $percentRight > 50 ){
    			$emailTrue = true;
    		} elseif ( $_SESSION['wpsqt'][$quizName]['details']['send_user'] == 'yes' ) {
    			$emailTrue = true;
    		}
    
    		if ( isset($emailTrue) ){
    			Wpsqt_Mail::sendMail();
    		}
    
    		require_once Wpsqt_Core::pageView('site/'.$this->_type.'/finished.php');
    		if ( $this->_type == "survey" ){
    			$this->_cacheSurveys();
    		}
    
    		/* Custome code */
    		global $current_user;
         	get_currentuserinfo();
    
    		$quizId = $_SESSION['wpsqt'][$quizName]['details']['id'];
    		$resultId = $_SESSION['wpsqt']['result_id'];
    		$user_id = $current_user->ID;
    		$query = "INSERT INTO <code>user_quizes</code> (
    		<code>id</code> ,
    		<code>user_id</code> ,
    		<code>quiz_id</code> ,
    		<code>result_id</code>
    		)
    		VALUES (
    		NULL , $user_id ,$quizId, '$resultId'
    		);";
    		$wpdb->query($query);
    		/* Custom Code */
    
    		unset($_SESSION['wpsqt']['result_id']);
    	}

    The onnly other other change which i have made is i am posting form through AJAX by serializing fields.
    And here is my code for this purpose.

    var formData = jQuery("#form").serialize();
    
    		jQuery.ajax({
    		type: "POST",
    		url: "  <?php echo esc_url($_SERVER["REQUEST_URI"]); ?>",
    		data: formData,
    		success: function(msg){
    		}
    		});

    Can you please figure out what could be wrong?

    Same is happening with me. But let me tell you there is no issue with my review page. because i have seen in database “wp_wpsqt_all_results” table. It is saving same survey question with new answers.
    I have also posted this issue on WPQST.
    Here is my post
    ==================================================
    Hi, can you please help me?
    I am using your plugin with my custom code.
    I have added surveys and quizes to pages and i am showing those pages in Pop-ups and submitting forms through ajax.
    Now problem is that sometime it works fine but sometime question display fine but result that is been stored in database is a mixture of some old survery/quiz. Like if i have first form with 10 fields and another form with just one field.
    Now when i submit second form.
    Result that is being stored in database table “wp_wpsqt_all_results” is like this.
    “Questions of first form and answers of second form.” which is very strange.
    Can you please help me to sort it out? I am in very critical situation!
    Thanks
    ==================================================

Viewing 9 replies - 16 through 24 (of 24 total)