Wp-Pro-Quiz - Version 0.9

Version Description

  • Bugfix in the frontend (Single choice)
Download this release

Release Info

Developer xeno010
Plugin Icon 128x128 Wp-Pro-Quiz
Version 0.9
Comparing to
See all releases

Code changes from version 0.8 to 0.9

js/wpProQuiz_front.js CHANGED
@@ -66,8 +66,8 @@
66
  $element.find('.wpProQuiz_sortable, .wpProQuiz_sortStringItem').removeAttr('style');
67
  $element.find('input[name="check"]').hide();
68
  $element.find('input[name="next"]').hide();
69
- $element.find('input[name="question"]').removeAttr('disabled').removeAttr('checked');
70
- $element.find('input[name="question"][type="text"]').removeAttr('value');
71
  $element.find('.wpProQuiz_resultsList').children().hide();
72
  $element.find('.wpProQuiz_cloze input').removeAttr('disabled').removeAttr('value').css('background-color', '');
73
  $element.find('.wpProQuiz_cloze span').hide();
@@ -139,7 +139,7 @@
139
  .data('questionId', j.id)
140
  .data('points', j.points);
141
 
142
- $(this).find('input[name="question"]').each(function() {
143
  switch(j.answer_type) {
144
  case 'single':
145
  case 'multiple':
@@ -173,7 +173,7 @@
173
  checkAnswer: function(btn) {
174
  var $question = $(btn).parent();
175
  var correct = false;
176
- var checked = $question.find('input[name="question"]');
177
  var type = $question.data('type');
178
 
179
  $question.find('input[name="tip"]').hide();
66
  $element.find('.wpProQuiz_sortable, .wpProQuiz_sortStringItem').removeAttr('style');
67
  $element.find('input[name="check"]').hide();
68
  $element.find('input[name="next"]').hide();
69
+ $element.find('.wpProQuiz_questionInput').removeAttr('disabled').removeAttr('checked');
70
+ $element.find('input.wpProQuiz_questionInput[type="text"]').removeAttr('value');
71
  $element.find('.wpProQuiz_resultsList').children().hide();
72
  $element.find('.wpProQuiz_cloze input').removeAttr('disabled').removeAttr('value').css('background-color', '');
73
  $element.find('.wpProQuiz_cloze span').hide();
139
  .data('questionId', j.id)
140
  .data('points', j.points);
141
 
142
+ $(this).find('.wpProQuiz_questionInput').each(function() {
143
  switch(j.answer_type) {
144
  case 'single':
145
  case 'multiple':
173
  checkAnswer: function(btn) {
174
  var $question = $(btn).parent();
175
  var correct = false;
176
+ var checked = $question.find('.wpProQuiz_questionInput');
177
  var type = $question.data('type');
178
 
179
  $question.find('input[name="tip"]').hide();
js/wpProQuiz_front.min.js CHANGED
@@ -1,10 +1,10 @@
1
  (function(c){c.wpProQuizFront=function(m,f){var b=c(m),e=this,l=0,h=0,n=0,i={},k=0,j=0;e.methode={startQuiz:function(){i={};f.questionRandom&&e.methode.questionRandom();f.answerRandom?e.methode.answerRandom(".wpProQuiz_questionList"):e.methode.answerRandom(b.find(".wpProQuiz_sortable").parent().parent());f.timeLimit&&e.methode.setTimeLimit();k=l=0;n=new Date;f.checkAnswer?b.find('input[name="check"]').show():b.find('input[name="next"]').show();b.find(".wpProQuiz_text").hide();b.find(".wpProQuiz_quiz").show();
2
  b.find(".wpProQuiz_listItem").first().fadeIn(200);b.find(".wpProQuiz_sortable").parent().parent().sortable().disableSelection();b.find(".wpProQuiz_sortStringList, .wpProQuiz_maxtrixSortCriterion").sortable({connectWith:".wpProQuiz_maxtrixSortCriterion:not(:has(li)), .wpProQuiz_sortStringList",placeholder:"wpProQuiz_placehold"}).disableSelection()},reStartQuiz:function(){b.find(".wpProQuiz_answerCorrect").removeClass("wpProQuiz_answerCorrect");b.find(".wpProQuiz_answerIncorrect").removeClass("wpProQuiz_answerIncorrect");
3
- b.find('.wpProQuiz_text, input[name="tip"]').show();b.find(".wpProQuiz_quiz, .wpProQuiz_results, .wpProQuiz_response, .wpProQuiz_correct, .wpProQuiz_incorrect").hide();b.find(".wpProQuiz_time_limit, .wpProQuiz_time_limit_expired, .wpProQuiz_sort_correct_answer").hide();b.find(".wpProQuiz_quiz").children().first().children().hide();b.find(".wpProQuiz_sortable, .wpProQuiz_sortStringItem").removeAttr("style");b.find('input[name="check"]').hide();b.find('input[name="next"]').hide();b.find('input[name="question"]').removeAttr("disabled").removeAttr("checked");
4
- b.find('input[name="question"][type="text"]').removeAttr("value");b.find(".wpProQuiz_resultsList").children().hide();b.find(".wpProQuiz_cloze input").removeAttr("disabled").removeAttr("value").css("background-color","");b.find(".wpProQuiz_cloze span").hide();e.methode.resetMatrix()},resetMatrix:function(){b.find(".wpProQuiz_question").each(function(){var a=c(this),d=a.find(".wpProQuiz_sortStringList");a.find(".wpProQuiz_sortStringItem").each(function(){d.append(c(this))})})},setTimeLimit:function(){var a=
5
  b.find(".wpProQuiz_time_limit"),d=a.find("span"),c=f.timeLimit;a.css({width:"100%",display:"block"});d.html(e.methode.parseTime(c));a.find(".progress").css("width","100%").animate({width:"0%"},1E3*f.timeLimit);h=setInterval(function(){d.html(e.methode.parseTime(c--));0>c&&(clearInterval(h),h=0,a.find(".progress").clearQueue().stop(),b.find('input[name="check"]').click().parent().hide(),b.find(".wpProQuiz_time_limit_expired").show(),e.methode.showResult())},1E3)},parseTime:function(a){var d=parseInt(a%
6
- 60),c=parseInt(a/60%60),a=parseInt(a/3600%24);return(9<a?"":"0")+a+":"+((9<c?"":"0")+c)+":"+((9<d?"":"0")+d)},setQuizTime:function(){var a=((new Date).getTime()-n.getTime())/1E3;b.find(".wpProQuiz_quiz_time span").first().html(e.methode.parseTime(a))},setData:function(){var a=0;b.find(".wpProQuiz_questionList").each(function(){var d=f.json[a],b=0;j+=d.points;c(this).parent().parent().data("type",d.answer_type).data("questionId",d.id).data("points",d.points);c(this).find('input[name="question"]').each(function(){switch(d.answer_type){case "single":case "multiple":0<=
7
- c.inArray(this.value,d.correct)?c(this).data("correct","1"):c(this).data("correct","0");break;case "free_answer":c(this).data("correct",d.correct)}});b=0;c(this).find(".wpProQuiz_sortable").each(function(){c(this).data("correct",d.correct[b++])});b=0;c(this).parent().find(".wpProQuiz_sortStringList").children().each(function(){c(this).data("correct",d.correct[b++]);console.debug(c(this))});a++})},checkAnswer:function(a){var d=c(a).parent(),b=!1,e=d.find('input[name="question"]'),f=d.data("type");
8
  d.find('input[name="tip"]').hide();if("multiple"==f||"single"==f){var g=!0;e.each(function(){"1"==c(this).data("correct")?(c(this).parent().parent().addClass("wpProQuiz_answerCorrect"),g=this.checked?g&1:g&0):this.checked&&(c(this).parent().parent().addClass("wpProQuiz_answerIncorrect"),g&=0)});b=g}else if("sort_answer"==f){g=!0;d.find(".wpProQuiz_sortable").each(function(){var a=c(this),b=a.parent().index();a.data("correct")==b?(a.parent().addClass("wpProQuiz_answerCorrect"),g&=1):(a.parent().addClass("wpProQuiz_answerIncorrect"),
9
  g=!1);a.css({"box-shadow":"0 0",cursor:"auto"})});var h=d.find(".wpProQuiz_sortable").parent().parent(),b=h.children("li");h.sortable("destroy");b.sort(function(a,b){return c(a).children("div").data("correct")>c(b).children("div").data("correct")});c.each(b,function(a,b){h.append(b)});b=g}else if("free_answer"==f)f=c.trim(e.val()).toLowerCase(),0<=c.inArray(f,e.data("correct"))?(b=!0,e.parent().parent().addClass("wpProQuiz_answerCorrect")):e.parent().parent().addClass("wpProQuiz_answerIncorrect");
10
  else if("matrix_sort_answer"==f){var g=!0,j=d.find(".wpProQuiz_questionList").children();j.each(function(){var a=c(this).index(),b=c(this).find(".wpProQuiz_maxtrixSortCriterion");b.children().first().data("correct")==a?(g&=1,b.addClass("wpProQuiz_answerCorrect")):(g=!1,b.addClass("wpProQuiz_answerIncorrect"))});d.find(".wpProQuiz_sortStringItem").each(function(){j.eq(c(this).data("correct")).find(".wpProQuiz_maxtrixSortCriterion").append(this)}).css({"box-shadow":"0 0",cursor:"auto"});d.find(".wpProQuiz_sortStringList, .wpProQuiz_maxtrixSortCriterion").sortable("destroy");
1
  (function(c){c.wpProQuizFront=function(m,f){var b=c(m),e=this,l=0,h=0,n=0,i={},k=0,j=0;e.methode={startQuiz:function(){i={};f.questionRandom&&e.methode.questionRandom();f.answerRandom?e.methode.answerRandom(".wpProQuiz_questionList"):e.methode.answerRandom(b.find(".wpProQuiz_sortable").parent().parent());f.timeLimit&&e.methode.setTimeLimit();k=l=0;n=new Date;f.checkAnswer?b.find('input[name="check"]').show():b.find('input[name="next"]').show();b.find(".wpProQuiz_text").hide();b.find(".wpProQuiz_quiz").show();
2
  b.find(".wpProQuiz_listItem").first().fadeIn(200);b.find(".wpProQuiz_sortable").parent().parent().sortable().disableSelection();b.find(".wpProQuiz_sortStringList, .wpProQuiz_maxtrixSortCriterion").sortable({connectWith:".wpProQuiz_maxtrixSortCriterion:not(:has(li)), .wpProQuiz_sortStringList",placeholder:"wpProQuiz_placehold"}).disableSelection()},reStartQuiz:function(){b.find(".wpProQuiz_answerCorrect").removeClass("wpProQuiz_answerCorrect");b.find(".wpProQuiz_answerIncorrect").removeClass("wpProQuiz_answerIncorrect");
3
+ b.find('.wpProQuiz_text, input[name="tip"]').show();b.find(".wpProQuiz_quiz, .wpProQuiz_results, .wpProQuiz_response, .wpProQuiz_correct, .wpProQuiz_incorrect").hide();b.find(".wpProQuiz_time_limit, .wpProQuiz_time_limit_expired, .wpProQuiz_sort_correct_answer").hide();b.find(".wpProQuiz_quiz").children().first().children().hide();b.find(".wpProQuiz_sortable, .wpProQuiz_sortStringItem").removeAttr("style");b.find('input[name="check"]').hide();b.find('input[name="next"]').hide();b.find(".wpProQuiz_questionInput").removeAttr("disabled").removeAttr("checked");
4
+ b.find('input.wpProQuiz_questionInput[type="text"]').removeAttr("value");b.find(".wpProQuiz_resultsList").children().hide();b.find(".wpProQuiz_cloze input").removeAttr("disabled").removeAttr("value").css("background-color","");b.find(".wpProQuiz_cloze span").hide();e.methode.resetMatrix()},resetMatrix:function(){b.find(".wpProQuiz_question").each(function(){var a=c(this),d=a.find(".wpProQuiz_sortStringList");a.find(".wpProQuiz_sortStringItem").each(function(){d.append(c(this))})})},setTimeLimit:function(){var a=
5
  b.find(".wpProQuiz_time_limit"),d=a.find("span"),c=f.timeLimit;a.css({width:"100%",display:"block"});d.html(e.methode.parseTime(c));a.find(".progress").css("width","100%").animate({width:"0%"},1E3*f.timeLimit);h=setInterval(function(){d.html(e.methode.parseTime(c--));0>c&&(clearInterval(h),h=0,a.find(".progress").clearQueue().stop(),b.find('input[name="check"]').click().parent().hide(),b.find(".wpProQuiz_time_limit_expired").show(),e.methode.showResult())},1E3)},parseTime:function(a){var d=parseInt(a%
6
+ 60),c=parseInt(a/60%60),a=parseInt(a/3600%24);return(9<a?"":"0")+a+":"+((9<c?"":"0")+c)+":"+((9<d?"":"0")+d)},setQuizTime:function(){var a=((new Date).getTime()-n.getTime())/1E3;b.find(".wpProQuiz_quiz_time span").first().html(e.methode.parseTime(a))},setData:function(){var a=0;b.find(".wpProQuiz_questionList").each(function(){var d=f.json[a],b=0;j+=d.points;c(this).parent().parent().data("type",d.answer_type).data("questionId",d.id).data("points",d.points);c(this).find(".wpProQuiz_questionInput").each(function(){switch(d.answer_type){case "single":case "multiple":0<=
7
+ c.inArray(this.value,d.correct)?c(this).data("correct","1"):c(this).data("correct","0");break;case "free_answer":c(this).data("correct",d.correct)}});b=0;c(this).find(".wpProQuiz_sortable").each(function(){c(this).data("correct",d.correct[b++])});b=0;c(this).parent().find(".wpProQuiz_sortStringList").children().each(function(){c(this).data("correct",d.correct[b++]);console.debug(c(this))});a++})},checkAnswer:function(a){var d=c(a).parent(),b=!1,e=d.find(".wpProQuiz_questionInput"),f=d.data("type");
8
  d.find('input[name="tip"]').hide();if("multiple"==f||"single"==f){var g=!0;e.each(function(){"1"==c(this).data("correct")?(c(this).parent().parent().addClass("wpProQuiz_answerCorrect"),g=this.checked?g&1:g&0):this.checked&&(c(this).parent().parent().addClass("wpProQuiz_answerIncorrect"),g&=0)});b=g}else if("sort_answer"==f){g=!0;d.find(".wpProQuiz_sortable").each(function(){var a=c(this),b=a.parent().index();a.data("correct")==b?(a.parent().addClass("wpProQuiz_answerCorrect"),g&=1):(a.parent().addClass("wpProQuiz_answerIncorrect"),
9
  g=!1);a.css({"box-shadow":"0 0",cursor:"auto"})});var h=d.find(".wpProQuiz_sortable").parent().parent(),b=h.children("li");h.sortable("destroy");b.sort(function(a,b){return c(a).children("div").data("correct")>c(b).children("div").data("correct")});c.each(b,function(a,b){h.append(b)});b=g}else if("free_answer"==f)f=c.trim(e.val()).toLowerCase(),0<=c.inArray(f,e.data("correct"))?(b=!0,e.parent().parent().addClass("wpProQuiz_answerCorrect")):e.parent().parent().addClass("wpProQuiz_answerIncorrect");
10
  else if("matrix_sort_answer"==f){var g=!0,j=d.find(".wpProQuiz_questionList").children();j.each(function(){var a=c(this).index(),b=c(this).find(".wpProQuiz_maxtrixSortCriterion");b.children().first().data("correct")==a?(g&=1,b.addClass("wpProQuiz_answerCorrect")):(g=!1,b.addClass("wpProQuiz_answerIncorrect"))});d.find(".wpProQuiz_sortStringItem").each(function(){j.eq(c(this).data("correct")).find(".wpProQuiz_maxtrixSortCriterion").append(this)}).css({"box-shadow":"0 0",cursor:"auto"});d.find(".wpProQuiz_sortStringList, .wpProQuiz_maxtrixSortCriterion").sortable("destroy");
lib/view/WpProQuiz_View_FrontQuiz.php CHANGED
@@ -147,7 +147,7 @@ class WpProQuiz_View_FrontQuiz extends WpProQuiz_View_View {
147
 
148
  <li class="wpProQuiz_questionListItem">
149
  <label>
150
- <input type="<?php echo $question->getAnswerType() === 'single' ? 'radio' : 'checkbox' ?>" name="question" value="<?php echo $answer_index; ?>"> <?php echo $answer_text; ?>
151
  </label>
152
  </li>
153
 
@@ -165,7 +165,7 @@ class WpProQuiz_View_FrontQuiz extends WpProQuiz_View_View {
165
  ?>
166
  <li class="wpProQuiz_questionListItem">
167
  <label>
168
- <input type="text" name="question" style="width: 300px;">
169
  </label>
170
  </li>
171
  <?php } else if($question->getAnswerType() === 'matrix_sort_answer') {
147
 
148
  <li class="wpProQuiz_questionListItem">
149
  <label>
150
+ <input class="wpProQuiz_questionInput" type="<?php echo $question->getAnswerType() === 'single' ? 'radio' : 'checkbox' ?>" name="question_<?php echo $this->quiz->getId(); ?>_<?php echo $question->getId(); ?>" value="<?php echo $answer_index; ?>"> <?php echo $answer_text; ?>
151
  </label>
152
  </li>
153
 
165
  ?>
166
  <li class="wpProQuiz_questionListItem">
167
  <label>
168
+ <input class="wpProQuiz_questionInput" type="text" name="question_<?php echo $this->quiz->getId(); ?>_<?php echo $question->getId(); ?>" style="width: 300px;">
169
  </label>
170
  </li>
171
  <?php } else if($question->getAnswerType() === 'matrix_sort_answer') {
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: xeno010
3
  Tags: quiz, test, answer, question, learning
4
  Requires at least: 3.3
5
  Tested up to: 3.4.2
6
- Stable tag: 0.8
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -109,4 +109,7 @@ Own themes changes internal order of filters, what causes the problems. With ad
109
  * CSS: !important added to all CSS-properties
110
 
111
  = 0.8 =
112
- * Bugfix im Frontend und Backend
 
 
 
3
  Tags: quiz, test, answer, question, learning
4
  Requires at least: 3.3
5
  Tested up to: 3.4.2
6
+ Stable tag: 0.9
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
109
  * CSS: !important added to all CSS-properties
110
 
111
  = 0.8 =
112
+ * Bugfix in the frontend and backend
113
+
114
+ = 0.9 =
115
+ * Bugfix in the frontend (Single choice)
wp-pro-quiz.php CHANGED
@@ -3,12 +3,12 @@
3
  Plugin Name: WP-Pro-Quiz
4
  Plugin URI: http://wordpress.org/extend/plugins/wp-pro-quiz
5
  Description: A powerful and beautiful quiz plugin for WordPress.
6
- Version: 0.8
7
  Author: Julius Fischer
8
  Author URI: http://www.it-gecko.de
9
  */
10
 
11
- define('WPPROQUIZ_VERSION', '0.8');
12
 
13
  include_once 'lib/controller/WpProQuiz_Controller_Admin.php';
14
  include_once 'lib/helper/WpProQuiz_Helper_DbUpgrade.php';
3
  Plugin Name: WP-Pro-Quiz
4
  Plugin URI: http://wordpress.org/extend/plugins/wp-pro-quiz
5
  Description: A powerful and beautiful quiz plugin for WordPress.
6
+ Version: 0.9
7
  Author: Julius Fischer
8
  Author URI: http://www.it-gecko.de
9
  */
10
 
11
+ define('WPPROQUIZ_VERSION', '0.9');
12
 
13
  include_once 'lib/controller/WpProQuiz_Controller_Admin.php';
14
  include_once 'lib/helper/WpProQuiz_Helper_DbUpgrade.php';