Skip to content

Commit

Permalink
Merge pull request #751 from fpcorso/release/6.1.2
Browse files Browse the repository at this point in the history
Release 6.1.2
  • Loading branch information
Frank Corso authored Jan 7, 2019
2 parents 2720833 + 7f3b57a commit 445b706
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 29 deletions.
13 changes: 13 additions & 0 deletions css/qsm-admin-question.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
.question-controls {
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
}

@media screen and (min-width:700px) {
.question-controls {
flex-direction: row;
}
}

.page {
width: 100%;
background-color: #0d97d8;
Expand Down
4 changes: 2 additions & 2 deletions js/qsm-admin-contact.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ var QSMContact;
},
saved : function( response ) {
if ( response.status ) {
QSMContact.displayAlert( '<strong>Success</strong> Your rules have been saved!', 'success' );
QSMContact.displayAlert( '<strong>Success</strong> Your contact fields have been saved!', 'success' );
} else {
QSMContact.displayAlert( '<strong>Error</strong> There was an error encountered when saving your rules. Please try again.', 'error' );
QSMContact.displayAlert( '<strong>Error</strong> There was an error encountered when saving your contact fields. Please try again.', 'error' );
}
},
displayAlert: function( message, type ) {
Expand Down
27 changes: 25 additions & 2 deletions js/qsm-admin-question.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,26 @@ var QSMQuestion;
questions: null,
questionCollection: null,
categories: [],
/**
* Counts the total number of questions and then updates #total-questions span.
*/
countTotal: function() {
var total = 0;

// Cycles through each page.
_.each( jQuery( '.page' ), function( page ) {

// If page is empty, continue to the next.
if( 0 == jQuery( page ).children( '.question' ).length ) {
return;
}
// Cycle through each question and add to our total.
_.each( jQuery( page ).children( '.question' ), function( question ){
total += 1;
});
});
$( '#total-questions' ).text( total );
},
openQuestionBank: function( pageID ) {
QSMQuestion.loadQuestionBank();
$( '#add-question-bank-page' ).val( pageID );
Expand Down Expand Up @@ -113,6 +133,7 @@ var QSMQuestion;
} else {
QSMQuestion.questions.each( QSMQuestion.addQuestionToPage );
}
QSMQuestion.countTotal();
},
savePages: function() {
QSMQuestion.displayAlert( 'Saving pages and questions...', 'info' );
Expand Down Expand Up @@ -164,6 +185,7 @@ var QSMQuestion;
QSMQuestion.displayAlert( 'Question created!', 'success' );
QSMQuestion.addQuestionToPage( model );
QSMQuestion.openEditPopup( model.id );
QSMQuestion.countTotal();
},
addQuestionToPage: function( model ) {
var page = model.get( 'page' ) + 1;
Expand Down Expand Up @@ -330,8 +352,8 @@ var QSMQuestion;
var settings = {
mediaButtons: true,
tinymce: {
forced_root_block : '',
toolbar1: 'formatselect,bold,italic,bullist,numlist,link,blockquote,alignleft,aligncenter,alignright,strikethrough,hr,forecolor,pastetext,removeformat,codeformat,undo,redo'
forced_root_block : '',
toolbar1: 'formatselect,bold,italic,bullist,numlist,blockquote,alignleft,aligncenter,alignright,link,strikethrough,hr,forecolor,pastetext,removeformat,codeformat,charmap,undo,redo'
},
quicktags: true,
};
Expand Down Expand Up @@ -372,6 +394,7 @@ var QSMQuestion;
$( '.questions' ).on( 'click', '.delete-question-button', function( event ) {
event.preventDefault();
$( this ).parents( '.question' ).remove();
QSMQuestion.countTotal();
});
$( '.questions' ).on( 'click', '.delete-page-button', function( event ) {
event.preventDefault();
Expand Down
6 changes: 3 additions & 3 deletions mlw_quizmaster2.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
/**
* Plugin Name: Quiz And Survey Master
* Description: Easily and quickly add quizzes and surveys to your website.
* Version: 6.1.1
* Version: 6.1.2
* Author: Frank Corso
* Author URI: https://www.quizandsurveymaster.com/
* Plugin URI: https://www.quizandsurveymaster.com/
* Text Domain: quiz-master-next
*
* @author Frank Corso
* @version 6.1.1
* @version 6.1.2
* @package QSM
*/

Expand All @@ -33,7 +33,7 @@ class MLWQuizMasterNext {
* @var string
* @since 4.0.0
*/
public $version = '6.1.1';
public $version = '6.1.2';

/**
* QSM Alert Manager Object
Expand Down
5 changes: 1 addition & 4 deletions php/admin/about-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@ function mlw_generate_about_page() {
</div>
<div class="qsm-tab-content tab-2" style="display: none;">
<h2>Changelog</h2>
<?php QSM_Changelog_Generator::get_changelog_list( 'fpcorso/quiz_master_next', 55 ); ?>
<?php QSM_Changelog_Generator::get_changelog_list( 'fpcorso/quiz_master_next', 54 ); ?>
<?php QSM_Changelog_Generator::get_changelog_list( 'fpcorso/quiz_master_next', 53 ); ?>
<?php QSM_Changelog_Generator::get_changelog_list( 'fpcorso/quiz_master_next', 36 ); ?>
<?php QSM_Changelog_Generator::get_changelog_list( 'fpcorso/quiz_master_next', 57 ); ?>
</div>
<div class="qsm-tab-content tab-3" style="display:none;">
<h2>GitHub Contributors</h2>
Expand Down
38 changes: 23 additions & 15 deletions php/admin/options-page-questions-tab.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<?php
/**
* This file handles the "Questions" tab when editing a quiz/survey
*
* @package QSM
*/

if ( ! defined( 'ABSPATH' ) ) exit;

if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Adds the settings for questions tab to the Quiz Settings page.
*
Expand All @@ -15,7 +18,7 @@ function qsm_settings_questions_tab() {
global $mlwQuizMasterNext;
$mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs( __( 'Questions', 'quiz-master-next' ), 'qsm_options_questions_tab_content' );
}
add_action( "plugins_loaded", 'qsm_settings_questions_tab', 5 );
add_action( 'plugins_loaded', 'qsm_settings_questions_tab', 5 );


/**
Expand All @@ -31,17 +34,17 @@ function qsm_options_questions_tab_content() {
$quiz_id = intval( $_GET['quiz_id'] );

$json_data = array(
'quizID' => $quiz_id,
'answerText' => __( 'Answer', 'quiz-master-next' ),
'nonce' => wp_create_nonce( 'wp_rest' ),
'pages' => $mlwQuizMasterNext->pluginHelper->get_quiz_setting( 'pages', array() ),
'quizID' => $quiz_id,
'answerText' => __( 'Answer', 'quiz-master-next' ),
'nonce' => wp_create_nonce( 'wp_rest' ),
'pages' => $mlwQuizMasterNext->pluginHelper->get_quiz_setting( 'pages', array() ),
);

// Scripts and styles.
wp_enqueue_script( 'micromodal_script', plugins_url( '../../js/micromodal.min.js', __FILE__ ) );
wp_enqueue_script( 'qsm_admin_question_js', plugins_url( '../../js/qsm-admin-question.js', __FILE__ ), array( 'backbone', 'underscore', 'jquery-ui-sortable', 'wp-util', 'micromodal_script' ), $mlwQuizMasterNext->version, true );
wp_localize_script( 'qsm_admin_question_js', 'qsmQuestionSettings', $json_data );
wp_enqueue_style( 'qsm_admin_question_css', plugins_url( '../../css/qsm-admin-question.css', __FILE__ ), array(), $mlwQuizMasterNext->version );
wp_enqueue_style( 'qsm_admin_question_css', plugins_url( '../../css/qsm-admin-question.css', __FILE__ ), array(), $mlwQuizMasterNext->version );
wp_enqueue_script( 'math_jax', '//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' );
wp_enqueue_editor();
wp_enqueue_media();
Expand Down Expand Up @@ -78,13 +81,18 @@ function qsm_options_questions_tab_content() {
<h3>Questions</h3>
<p>Use this tab to create and modify the different pages of your quiz or survey as well as the questions on each page. Click "Create New Page" to get started! Need more information? Check out the <a href="https://docs.quizandsurveymaster.com/article/19-creating-pages-and-questions" target="_blank">documentation for this tab!</a></p>
<div class="questions-messages"></div>
<a href="#" class="new-page-button button">Create New Page</a>
<a href="#" class="save-page-button button-primary">Save Questions and Pages</a>
<p class="search-box">
<label class="screen-reader-text" for="question_search">Search Questions:</label>
<input type="search" id="question_search" name="question_search" value="">
<a href="#" class="button">Search Questions</a>
</p>
<div class="question-controls">
<div>
<button class="new-page-button button">Create New Page</button>
<button class="save-page-button button-primary">Save Questions and Pages</button>
</div>
<span>Total Questions: <span id="total-questions"></span></span>
<p class="search-box">
<label class="screen-reader-text" for="question_search">Search Questions:</label>
<input type="search" id="question_search" name="question_search" value="">
<a href="#" class="button">Search Questions</a>
</p>
</div>
<div class="questions"></div>

<!-- Popup for question bank -->
Expand Down
2 changes: 1 addition & 1 deletion php/admin/quizzes-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ function qsm_generate_quizzes_surveys_page() {
<script type="text/template" id="tmpl-no-quiz">
<h2><?php _e( 'You do not have any quizzes or surveys. Click "Add New" to get started.', 'quiz-master-next' ); ?></h2>
<h2>Is this your first time using this plugin? Check out our <a href="https://docs.quizandsurveymaster.com" target="_blank">Documentation</a> or watch our Getting Started Video below</h2>
<iframe width="560" height="315" src="https://www.youtube.com/embed/n8xfNk490Wg" frameborder="0" allowfullscreen></iframe>
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/coE5W_WB-48" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</script>

<script type="text/template" id="tmpl-quiz-row">
Expand Down
2 changes: 1 addition & 1 deletion php/classes/class-qsm-changelog-generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public static function get_changelog( $repo, $milestone ) {
$milestone_url = "https://api.github.com/repos/$repo/milestones/$milestone";
$milestone_data = QSM_Changelog_Generator::api_call( $milestone_url );

if ( $milestone_data ) {
if ( $milestone_data && isset( $milestone_data['title'] ) ) {
$milestone_array = array(
'title' => $milestone_data["title"],
'description' => $milestone_data["description"],
Expand Down
7 changes: 6 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: quiz, survey, lead, test, score, exam, questionnaire, question
Requires at least: 4.9
Tested up to: 5.0.2
Requires PHP: 5.4
Stable tag: 6.1.1
Stable tag: 6.1.2
License: GPLv2
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -111,6 +111,11 @@ This is usually a theme conflict. You can [checkout out our common conflict solu

== Changelog ==

= 6.1.2 (January 7, 2019) =
* Closed User Request: Add special character selector to question editor ([Issue #750](https://github.com/fpcorso/quiz_master_next/issues/750))
* Closed User Request: Add total questions and total pages to Questions tab ([Issue #749](https://github.com/fpcorso/quiz_master_next/issues/749))
* Updated getting started video

= 6.1.1 (December 28, 2018) =
* Fixes issue causing broken quizzes on sites using older versions of WordPress

Expand Down

0 comments on commit 445b706

Please sign in to comment.