Forum Replies Created

Viewing 7 replies - 16 through 22 (of 22 total)
  • I have the same problem. Were you able to resolve this?

    Short answer: no

    Enable which demographic questions you want to ask in the options tab (user name, email, phone, business) and then select above that “Would you like to ask for the contact information at the beginning or at the end of the quiz?” select end. Or were you asking about different demographic information?

    cuber617,

    I found a solution. The new certificate addon does not work currently but the old (beta) one that comes included does work. Disable the addon plugin and use the old method.

    You must also enable “Dynamically add class for incorrect/correct answer after user selects answer? (Currently only works on multiple choice)” and set it to yes.

    Hey thebeets111,

    What you want to accomplish is possible in two ways. If your quiz is multiple choice, enable the option “Dynamically add class for incorrect/correct answer after user selects answer” (set it to yes). Then in your CSS add this:

    .qmn_user_correct_answer {
    display: none;
    }

    This should hide any information regarding correct answers. The second way (which is the way I did it because I thought of it first) is opening the plugin editor and select the Quiz and Survey Master plugin. Then select “quiz-master-next/php/template-variables.php” on the list on the right. Scroll down to the function mlw_qmn_variable_question_answers() and replace the entire function with this:

    function mlw_qmn_variable_question_answers($content, $mlw_quiz_array)
    {
    	while (strpos($content, '%QUESTIONS_ANSWERS%') !== false)
    	{
    		global $wpdb;
    		$display = '';
    		$qmn_question_answer_template = $wpdb->get_var( $wpdb->prepare( "SELECT question_answer_template FROM " . $wpdb->prefix . "mlw_quizzes WHERE quiz_id=%d", $mlw_quiz_array['quiz_id'] ) );
    		$qmn_questions_sql = $wpdb->get_results( $wpdb->prepare( "SELECT question_id, question_answer_info FROM " . $wpdb->prefix . "mlw_questions WHERE quiz_id=%d", $mlw_quiz_array['quiz_id'] ) );
    		$qmn_questions = array();
    		foreach($qmn_questions_sql as $question)
    		{
    			$qmn_questions[$question->question_id] = $question->question_answer_info;
    		}
    		foreach ($mlw_quiz_array['question_answers_array'] as $answer)
    		{
    			if ( $answer["correct"] === "correct" ){
    				$user_answer_class = "qmn_user_correct_answer";
    				$question_answer_class = "qmn_question_answer_correct";
    			} else {
    				$user_answer_class = "qmn_user_incorrect_answer";
    				$question_answer_class = "qmn_question_answer_incorrect";
    				$mlw_question_answer_display = htmlspecialchars_decode($qmn_question_answer_template, ENT_QUOTES);
    				$mlw_question_answer_display = str_replace( "%QUESTION%" , htmlspecialchars_decode($answer[0], ENT_QUOTES), $mlw_question_answer_display);
    				$mlw_question_answer_display = str_replace( "%USER_ANSWER%" , "<span class='$user_answer_class'>".htmlspecialchars_decode($answer[1], ENT_QUOTES).'</span>', $mlw_question_answer_display);
    				$mlw_question_answer_display = str_replace( "%CORRECT_ANSWER%" , htmlspecialchars_decode($answer[2], ENT_QUOTES), $mlw_question_answer_display);
    				$mlw_question_answer_display = str_replace( "%USER_COMMENTS%" , $answer[3], $mlw_question_answer_display);
    				$mlw_question_answer_display = str_replace( "%CORRECT_ANSWER_INFO%" , htmlspecialchars_decode($qmn_questions[$answer['id']], ENT_QUOTES), $mlw_question_answer_display);
    			}
    			$display .= "<div class='qmn_question_answer $question_answer_class'>".apply_filters('qmn_variable_question_answers', $mlw_question_answer_display, $mlw_quiz_array).'</div>';
    		}
    		$content = str_replace( "%QUESTIONS_ANSWERS%" , $display, $content);
    	}
    	return $content;
    }

    Enjoy.

    I don’t have a solution, just wanted to say I have the exact same problem. I’m not using separate result pages, just a single one. If I include %CERTIFICATE_LINK% then none of my other variables will display.

Viewing 7 replies - 16 through 22 (of 22 total)