Skip to content

Commit

Permalink
Merge pull request #43 from fpcorso/3.5.1
Browse files Browse the repository at this point in the history
Version 3.5.1
  • Loading branch information
fpcorso committed Nov 25, 2014
2 parents 4559c62 + 38a0e80 commit 3fb9d6b
Show file tree
Hide file tree
Showing 10 changed files with 189 additions and 53 deletions.
Binary file modified assets/screenshot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/screenshot-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/screenshot-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 14 additions & 17 deletions includes/mlw_qmn_credits.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,21 @@ function mlw_qmn_setTab(tab) {
<div class="mlw_qmn_icon_wrap">Version <?php echo $mlw_quiz_version; ?></div>
<h2 class="nav-tab-wrapper">
<a href="javascript:mlw_qmn_setTab(1);" id="mlw_qmn_tab_1" class="nav-tab nav-tab-active">
What&#8217;s New In 3.4</a>
What&#8217;s New In 3.5</a>
<a href="javascript:mlw_qmn_setTab(2);" id="mlw_qmn_tab_2" class="nav-tab">
Changelog For <?php echo $mlw_quiz_version; ?> </a>
<a href="javascript:mlw_qmn_setTab(3);" id="mlw_qmn_tab_3" class="nav-tab">
Requested Features</a>
</h2>
<div id="mlw_quiz_what_new">
<h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Preview Mode</h2>
<p style="text-align: center;">You can now preview your quiz while in the admin side by going to the new Preview tab on the Quiz Settings page!</p>
<h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Require Users To Be Logged In</h2>
<p style="text-align: center;">You can now require users to be logged in to access your quiz. Set this up from the options tab. You can customize the text it shows to non-logged in users on the Text tab.</p>
<br />
<h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Design Changes</h2>
<p style="text-align: center;">This version made several design changes to various pages as we continue to redesign our plugin. We also made many design changes in our code!</p>
<h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Limit Total Entries</h2>
<p style="text-align: center;">You can now limit the amount of total entries to your quiz. For example, you could say only 10 people can complete the survey. Edit this setting from the options tab. You can customize the text it shows once it reaches the limit on the text tab.</p>
<br />
<h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">LaTeX/Tex Support For Mathematics</h2>
<p style="text-align: center;">You can now use LaTex/Tex to show mathematic symbols and formulas such as square root, fractions, exponents, and more. You can place your math in any question, answer, or text on the quiz! For help with LaTeX, <a href="http://www.andy-roberts.net/writing/latex/mathematics_1">check out this tutorial</a>.</p>
<br />
<h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">We Are On GitHub Now</h2>
<p style="text-align: center;">We have had several users ask for this so we thought we would try it out. We now love github! Be sure to <a href="https://github.com/fpcorso/quiz_master_next/">make suggestions or contribute</a>.</p>
Expand All @@ -109,16 +112,13 @@ function mlw_qmn_setTab(tab) {
<p style="text-align: center;">We have several new premium add-ons in our WordPress Store: MailPoet Integration (subscribes users to your MailPoet list), MailChimp Integration (subscribes users to your Mailchimp list), Export Results (exports your quiz results), Extra Shortcodes (gives you extra shortcodes to use), User Dashboard (allow users to see the results from all the quizzes they have taken), and Advertisement Be Gone (gets rid of blue-border ads). Visit our <a href="http://mylocalwebstop.com/shop/">WordPress Store</a> for details! </p>
</div>
<div id="mlw_quiz_changelog" style="display: none;">
<h3><?php echo $mlw_quiz_version; ?> (November 20, 2014)</h3>
<h3><?php echo $mlw_quiz_version; ?> (November 22, 2014)</h3>
<ul>
<li>* Added Preview Mode (Beta)</li>
<li>* Several Design Changes To Quizzes Page</li>
<li>* Minor Design Changes To Quiz Settings Page</li>
<li>* Added Completion Time To Quiz Results Page</li>
<li>* Added Time Taken To Quiz Result Details Page</li>
<li>* Created New Hook On Quiz Settings Page</li>
<li>* Broke Apart Quiz Settings Backend Into Smaller Functions That Hook Into New Hook</li>
<li>* Created New Backend Alert Manager Class To Replace Archaic Old Error System</li>
<li>* Added The Ability To Require Users To Be Logged In To Access Quiz</li>
<li>* Added Ability To Limit Total Amount Of Entries</li>
<li>* Added Ability To Show Mathematic Formulas Using Tex Or LaTex</li>
<li>* Set Up Parameters For Action 'mlw_qmn_load_results_page' To Pass Results Id And Quiz Settings</li>
<li>* Minor Design Change To Quizzes Page</li>
</ul>
</div>
<div id="mlw_quiz_requested" style="display: none;">
Expand All @@ -130,7 +130,6 @@ function mlw_qmn_setTab(tab) {
<ul>
<li>Importing Questions</li>
<li>Stats For Each Quiz</li>
<li>Force Login/Register Option</li>
<li>Categories</li>
<li>More Social Media Integration</li>
<li>Show Question Amount On Pagination</li>
Expand All @@ -139,11 +138,9 @@ function mlw_qmn_setTab(tab) {
<li>Progress Bar For Timer</li>
<li>Ability To Redirect User Instead Of Showing Results Page</li>
<li>Multi-Delete Option For Quiz Results</li>
<li>Spam Prevention</li>
<li>Graphical Click Aware Questions</li>
<li>Results Bar Graph For Users Taking Polls</li>
<li>Head To Head Comparison Questions</li>
<li>Enhanced Leaderboard</li>
<li>Different Social Media Sharing Text For Different Social Media</li>
<li>Ability To Highlight Incorrect Answers</li>
<li>Set Default Question Type</li>
Expand Down
33 changes: 31 additions & 2 deletions includes/mlw_quiz.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ function mlw_quiz_shortcode($atts)
break;
}

//Check if user is required to be checked in
if ( $mlw_quiz_options->require_log_in == 1 && !is_user_logged_in() )
{
$mlw_message = htmlspecialchars_decode($mlw_quiz_options->require_log_in_text, ENT_QUOTES);
$mlw_message = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message);
$mlw_message = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message);
$mlw_display = $mlw_message;
$mlw_display .= wp_login_form( array('echo' => false) );
return $mlw_display;
$mlw_qmn_isAllowed = false;
}

//Check to see if there is limit on the amount of tries
if ( $mlw_quiz_options->total_user_tries != 0 && is_user_logged_in() )
{
Expand Down Expand Up @@ -105,6 +117,9 @@ function mlw_quiz_shortcode($atts)
wp_enqueue_script( 'jquery-ui-tooltip' );
wp_enqueue_script( 'jquery-ui-tabs' );
?>
<script type="text/javascript"
src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<!-- css -->
<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.css" rel="stylesheet" />
<script type="text/javascript">
Expand Down Expand Up @@ -165,6 +180,20 @@ function mlw_quiz_shortcode($atts)
//Display Quiz
if (!isset($_POST["complete_quiz"]) && $mlw_quiz_options->quiz_name != "" && $mlw_qmn_isAllowed)
{
//Check if total entries are limited
if ( $mlw_quiz_options->limit_total_entries != 0 )
{
$mlw_qmn_entries_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(quiz_id) FROM ".$wpdb->prefix."mlw_results WHERE deleted='0' AND quiz_id=%d", $mlw_quiz_id ) );
if ($mlw_qmn_entries_count >= $mlw_quiz_options->limit_total_entries)
{
$mlw_message = htmlspecialchars_decode($mlw_quiz_options->limit_total_entries_text, ENT_QUOTES);
$mlw_message = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message);
$mlw_message = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message);
$mlw_display = $mlw_message;
return $mlw_display;
$mlw_qmn_isAllowed = false;
}
}
$mlw_qmn_total_questions = 0;
//Calculate number of pages if pagination is turned on
if ($mlw_quiz_options->pagination != 0)
Expand Down Expand Up @@ -1415,7 +1444,7 @@ function mlw_qmn_share(network, mlw_qmn_social_text, mlw_qmn_title)
$results = $wpdb->query( $wpdb->prepare( "INSERT INTO " . $table_name . " (result_id, quiz_id, quiz_name, quiz_system, point_score, correct_score, correct, total, name, business, email, phone, user, time_taken, time_taken_real, quiz_results, deleted) VALUES (NULL, %d, '%s', %d, %d, %d, %d, %d, '%s', '%s', '%s', '%s', %d, '%s', '%s', '%s', 0)", $mlw_quiz_id, $mlw_quiz_options->quiz_name, $mlw_quiz_options->system, $mlw_points, $mlw_total_score, $mlw_correct, $mlw_total_questions, $mlw_user_name, $mlw_user_comp, $mlw_user_email, $mlw_user_phone, get_current_user_id(), date("h:i:s A m/d/Y"), date("Y-m-d H:i:s"), $mlw_quiz_results) );

//Integration Action
do_action('mlw_qmn_load_results_page');
do_action('mlw_qmn_load_results_page', $wpdb->insert_id, $mlw_quiz_options->quiz_settings);
}
else
{
Expand Down Expand Up @@ -1566,4 +1595,4 @@ function mlw_qmn_set_html_content_type() {

return 'text/html';
}
?>
?>
76 changes: 49 additions & 27 deletions includes/mlw_quiz_admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,9 @@ function mlw_generate_quiz_admin()
?>
<!-- css -->
<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.css" rel="stylesheet" />
<script type="text/javascript"
src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<!-- jquery scripts -->
<?php
wp_enqueue_script( 'jquery' );
Expand All @@ -377,9 +380,6 @@ function mlw_generate_quiz_admin()
var $j = jQuery.noConflict();
// increase the default animation speed to exaggerate the effect
$j.fx.speeds._default = 1000;
$j(function() {
$j("#prev_page, #next_page").button();
});
$j(function() {
$j('#new_quiz_dialog').dialog({
autoOpen: false,
Expand Down Expand Up @@ -476,9 +476,51 @@ function duplicateQuiz(id, quizName){
<div class="wrap">
<div class='mlw_quiz_options'>
<h2>Quizzes<a id="new_quiz_button" href="javascript:();" class="add-new-h2">Add New</a></h2>
<?php $mlwQmnAlertManager->showAlerts(); ?>
<div class="tablenav top">
<div class="tablenav-pages">
<span class="displaying-num"><?php echo $mlw_qmn_quiz_count; ?> quizzes</span>
<span class="pagination-links">
<?php
$mlw_qmn_previous_page = 0;
$mlw_current_page = $mlw_qmn_quiz_page+1;
$mlw_total_pages = ceil($mlw_qmn_quiz_count/$mlw_qmn_table_limit);
if( $mlw_qmn_quiz_page > 0 )
{
$mlw_qmn_previous_page = $mlw_qmn_quiz_page - 2;
echo "<a class=\"prev-page\" title=\"Go to the previous page\" href=\"?page=mlw_quiz_admin&&mlw_quiz_page=$mlw_qmn_previous_page\"><</a>";
echo "<span class=\"paging-input\">$mlw_current_page of $mlw_total_pages</span>";
if( $mlw_qmn_quiz_left > $mlw_qmn_table_limit )
{
echo "<a class=\"next-page\" title=\"Go to the next page\" href=\"?page=mlw_quiz_admin&&mlw_quiz_page=$mlw_qmn_quiz_page\">></a>";
}
else
{
echo "<a class=\"next-page disabled\" title=\"Go to the next page\" href=\"?page=mlw_quiz_admin&&mlw_quiz_page=$mlw_qmn_quiz_page\">></a>";
}
}
else if( $mlw_qmn_quiz_page == 0 )
{
if( $mlw_qmn_quiz_left > $mlw_qmn_table_limit )
{
echo "<a class=\"prev-page disabled\" title=\"Go to the previous page\" href=\"?page=mlw_quiz_admin&&mlw_quiz_page=$mlw_qmn_previous_page\"><</a>";
echo "<span class=\"paging-input\">$mlw_current_page of $mlw_total_pages</span>";
echo "<a class=\"next-page\" title=\"Go to the next page\" href=\"?page=mlw_quiz_admin&&mlw_quiz_page=$mlw_qmn_quiz_page\">></a>";
}
}
else if( $mlw_qmn_quiz_left < $mlw_qmn_table_limit )
{
$mlw_qmn_previous_page = $mlw_qmn_quiz_page - 2;
echo "<a class=\"prev-page\" title=\"Go to the previous page\" href=\"?page=mlw_quiz_admin&&mlw_quiz_page=$mlw_qmn_previous_page\"><</a>";
echo "<span class=\"paging-input\">$mlw_current_page of $mlw_total_pages</span>";
echo "<a class=\"next-page disabled\" title=\"Go to the next page\" href=\"?page=mlw_quiz_admin&&mlw_quiz_page=$mlw_qmn_quiz_page\">></a>";
}
?>
</span>
<br class="clear">
</div>
</div>
<?php
$mlwQmnAlertManager->showAlerts();

$quotes_list = "";
$display = "";
$alternate = "";
Expand All @@ -497,27 +539,7 @@ function duplicateQuiz(id, quizName){
$quotes_list .= "</tr>";
}

if( $mlw_qmn_quiz_page > 0 )
{
$mlw_qmn_previous_page = $mlw_qmn_quiz_page - 2;
$display .= "<a id=\"prev_page\" href=\"?page=mlw_quiz_admin&&mlw_quiz_page=$mlw_qmn_previous_page\">Previous 10 Quizzes</a>";
if( $mlw_qmn_quiz_left > $mlw_qmn_table_limit )
{
$display .= "<a id=\"next_page\" href=\"?page=mlw_quiz_admin&&mlw_quiz_page=$mlw_qmn_quiz_page\">Next 10 Quizzes</a>";
}
}
else if( $mlw_qmn_quiz_page == 0 )
{
if( $mlw_qmn_quiz_left > $mlw_qmn_table_limit )
{
$display .= "<a id=\"next_page\" href=\"?page=mlw_quiz_admin&&mlw_quiz_page=$mlw_qmn_quiz_page\">Next 10 Quizzes</a>";
}
}
else if( $mlw_qmn_quiz_left < $mlw_qmn_table_limit )
{
$mlw_qmn_previous_page = $mlw_qmn_quiz_page - 2;
$display .= "<a id=\"prev_page\" href=\"?page=mlw_quiz_admin&&mlw_quiz_page=$mlw_qmn_previous_page\">Previous 10 Quizzes</a>";
}


$display .= "<br />";

Expand Down Expand Up @@ -623,4 +645,4 @@ function duplicateQuiz(id, quizName){
</div>
<?php
}
?>
?>
Loading

0 comments on commit 3fb9d6b

Please sign in to comment.