Version Description
- Bugfix in javascript-code
- "Sort elements" are always randomly arranged
- Bugfix in CSS for different themes
Download this release
Release Info
Developer | xeno010 |
Plugin | Wp-Pro-Quiz |
Version | 0.11 |
Comparing to | |
See all releases |
Code changes from version 0.10 to 0.11
- css/wpProQuiz_front.css +13 -1
- css/wpProQuiz_front.min.css +1 -1
- js/wpProQuiz_admin.js +1 -4
- js/wpProQuiz_admin.min.js +19 -20
- js/wpProQuiz_front.js +2 -1
- js/wpProQuiz_front.min.js +17 -17
- lib/controller/WpProQuiz_Controller_Front.php +1 -1
- readme.txt +7 -2
- wp-pro-quiz.php +2 -2
css/wpProQuiz_front.css
CHANGED
@@ -42,6 +42,9 @@
|
|
42 |
.wpProQuiz_questionListItem {
|
43 |
padding: 3px !important;
|
44 |
margin-bottom: 5px !important;
|
|
|
|
|
|
|
45 |
}
|
46 |
|
47 |
.wpProQuiz_questionListItem > table{
|
@@ -149,12 +152,16 @@
|
|
149 |
}
|
150 |
.wpProQuiz_sortStringItem {
|
151 |
margin: 0 !important;
|
|
|
|
|
152 |
}
|
153 |
.wpProQuiz_maxtrixSortCriterion {
|
154 |
-
padding:
|
155 |
}
|
156 |
.wpProQuiz_placehold {
|
157 |
background-color: #FFFFC2 !important;
|
|
|
|
|
158 |
padding: 5px !important;
|
159 |
height: 30px !important;
|
160 |
min-width: 50px !important;
|
@@ -189,4 +196,9 @@
|
|
189 |
.wpProQuiz_questionListItem input, .wpProQuiz_questionListItem label {
|
190 |
margin: 0 !important;
|
191 |
font-weight: normal;
|
|
|
|
|
|
|
|
|
|
|
192 |
}
|
42 |
.wpProQuiz_questionListItem {
|
43 |
padding: 3px !important;
|
44 |
margin-bottom: 5px !important;
|
45 |
+
background-image: none !important;
|
46 |
+
margin-left: 0 !important;
|
47 |
+
list-style: none !important;
|
48 |
}
|
49 |
|
50 |
.wpProQuiz_questionListItem > table{
|
152 |
}
|
153 |
.wpProQuiz_sortStringItem {
|
154 |
margin: 0 !important;
|
155 |
+
background-image: none !important;
|
156 |
+
list-style: none !important;
|
157 |
}
|
158 |
.wpProQuiz_maxtrixSortCriterion {
|
159 |
+
padding: 5px !important;
|
160 |
}
|
161 |
.wpProQuiz_placehold {
|
162 |
background-color: #FFFFC2 !important;
|
163 |
+
list-style: none !important;
|
164 |
+
background-image: none !important;
|
165 |
padding: 5px !important;
|
166 |
height: 30px !important;
|
167 |
min-width: 50px !important;
|
196 |
.wpProQuiz_questionListItem input, .wpProQuiz_questionListItem label {
|
197 |
margin: 0 !important;
|
198 |
font-weight: normal;
|
199 |
+
}
|
200 |
+
.wpProQuiz_resultsList > li {
|
201 |
+
background-image: none !important;
|
202 |
+
padding: 0 !important;
|
203 |
+
margin: 0 !important;
|
204 |
}
|
css/wpProQuiz_front.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.wpProQuiz_answerCorrect{background:#6DB46D!important;font-weight:700!important;}.wpProQuiz_answerCorrect label{font-weight:700!important;}.wpProQuiz_answerIncorrect{background:#FF9191!important;font-weight:700!important;}.wpProQuiz_content{margin-top:10px!important;margin-bottom:10px!important;}.wpProQuiz_content h2{margin-bottom:10px!important;}.wpProQuiz_content input[type=button],.wpProQuiz_content input[type=button]:hover{margin:0!important;padding:5px 10px!important;background:#13455B!important;border-radius:11px!important;color:#FFF!important;font-weight:700!important;border:1px solid #13455B!important;box-shadow:1px 1px 1px #333!important;text-shadow:none!important;}.wpProQuiz_question_page{margin-bottom:10px!important;}.wpProQuiz_question_page span{font-weight:700!important;}.wpProQuiz_questionListItem{padding:3px!important;margin-bottom:5px!important;}.wpProQuiz_questionListItem > table{border-collapse:collapse!important;margin:0!important;padding:0!important;width:100%;}.wpProQuiz_questionListItem:last-child{padding:3px!important;margin-bottom:0!important;}.wpProQuiz_list,.wpProQuiz_listItem,.wpProQuiz_questionList,.wpProQuiz_sortStringList,.wpProQuiz_sortStringList,.wpProQuiz_maxtrixSortCriterion,.wpProQuiz_resultsList{list-style:none!important;padding:0!important;margin:0!important;}.wpProQuiz_questionList{margin-bottom:10px!important;background:#F8FAF5!important;border:1px solid #C3D1A3!important;padding:5px!important;list-style:none!important;}.wpProQuiz_listItem{position:relative!important;}.wpProQuiz_response{background:#F8FAF5!important;border:1px solid #C4C4C4!important;padding:5px!important;margin-bottom:15px!important;box-shadow:1px 1px 2px #AAA!important;}.wpProQuiz_response span{font-weight:700!important;}.wpProQuiz_sort{width:25px!important;}.wpProQuiz_results h3{margin-bottom:10px!important;}.wpProQuiz_sort_correct_answer{font-weight:700!important;margin-right:5px!important;display:none!important;}.wpProQuiz_sortable,.wpProQuiz_sortStringItem{padding:5px!important;border:1px solid #D3D3D3!important;box-shadow:2px 2px 1px #EEE;background-color:#F8FAF5!important;cursor:move;}.wpProQuiz_time_limit .time{font-weight:700!important;margin-top:5px!important;margin-bottom:5px!important;}.wpProQuiz_time_limit .progress{height:10px!important;background-color:blue!important;margin-bottom:5px!important;}.wpProQuiz_time_limit_expired{font-weight:700!important;font-size:15px!important;text-align:center!important;}.wpProQuiz_question_text{margin-bottom:10px!important;}.wpProQuiz_tipp{padding:10px!important;background-color:#DDECFF!important;border:1px dotted #363636!important;border-radius:10px!important;position:absolute!important;bottom:35px!important;left:5px!important;right:5px!important;box-shadow:2px 2px 5px 0 #313131!important;z-index:99999!important;}.wpProQuiz_matrixSortString,.wpProQuiz_matrixSortString > h3{margin-bottom:10px!important;margin-top:0!important;}.wpProQuiz_matrixSortString{background:#F8FAF5!important;border:1px solid #C3D1A3!important;padding:5px!important;}.wpProQuiz_sortStringList{padding:10px!important;}.wpProQuiz_sortStringList > li{float:left!important;margin-left:5px!important;margin-right:5px!important;margin-bottom:5px!important;}.wpProQuiz_sortStringItem{margin:0!important;}.wpProQuiz_maxtrixSortCriterion{padding:
|
1 |
+
.wpProQuiz_answerCorrect{background:#6DB46D!important;font-weight:700!important;}.wpProQuiz_answerCorrect label{font-weight:700!important;}.wpProQuiz_answerIncorrect{background:#FF9191!important;font-weight:700!important;}.wpProQuiz_content{margin-top:10px!important;margin-bottom:10px!important;}.wpProQuiz_content h2{margin-bottom:10px!important;}.wpProQuiz_content input[type=button],.wpProQuiz_content input[type=button]:hover{margin:0!important;padding:5px 10px!important;background:#13455B!important;border-radius:11px!important;color:#FFF!important;font-weight:700!important;border:1px solid #13455B!important;box-shadow:1px 1px 1px #333!important;text-shadow:none!important;}.wpProQuiz_question_page{margin-bottom:10px!important;}.wpProQuiz_question_page span{font-weight:700!important;}.wpProQuiz_questionListItem{padding:3px!important;margin-bottom:5px!important;background-image:none!important;margin-left:0!important;list-style:none!important;}.wpProQuiz_questionListItem > table{border-collapse:collapse!important;margin:0!important;padding:0!important;width:100%;}.wpProQuiz_questionListItem:last-child{padding:3px!important;margin-bottom:0!important;}.wpProQuiz_list,.wpProQuiz_listItem,.wpProQuiz_questionList,.wpProQuiz_sortStringList,.wpProQuiz_sortStringList,.wpProQuiz_maxtrixSortCriterion,.wpProQuiz_resultsList{list-style:none!important;padding:0!important;margin:0!important;}.wpProQuiz_questionList{margin-bottom:10px!important;background:#F8FAF5!important;border:1px solid #C3D1A3!important;padding:5px!important;list-style:none!important;}.wpProQuiz_listItem{position:relative!important;}.wpProQuiz_response{background:#F8FAF5!important;border:1px solid #C4C4C4!important;padding:5px!important;margin-bottom:15px!important;box-shadow:1px 1px 2px #AAA!important;}.wpProQuiz_response span{font-weight:700!important;}.wpProQuiz_sort{width:25px!important;}.wpProQuiz_results h3{margin-bottom:10px!important;}.wpProQuiz_sort_correct_answer{font-weight:700!important;margin-right:5px!important;display:none!important;}.wpProQuiz_sortable,.wpProQuiz_sortStringItem{padding:5px!important;border:1px solid #D3D3D3!important;box-shadow:2px 2px 1px #EEE;background-color:#F8FAF5!important;cursor:move;}.wpProQuiz_time_limit .time{font-weight:700!important;margin-top:5px!important;margin-bottom:5px!important;}.wpProQuiz_time_limit .progress{height:10px!important;background-color:blue!important;margin-bottom:5px!important;}.wpProQuiz_time_limit_expired{font-weight:700!important;font-size:15px!important;text-align:center!important;}.wpProQuiz_question_text{margin-bottom:10px!important;}.wpProQuiz_tipp{padding:10px!important;background-color:#DDECFF!important;border:1px dotted #363636!important;border-radius:10px!important;position:absolute!important;bottom:35px!important;left:5px!important;right:5px!important;box-shadow:2px 2px 5px 0 #313131!important;z-index:99999!important;}.wpProQuiz_matrixSortString,.wpProQuiz_matrixSortString > h3{margin-bottom:10px!important;margin-top:0!important;}.wpProQuiz_matrixSortString{background:#F8FAF5!important;border:1px solid #C3D1A3!important;padding:5px!important;}.wpProQuiz_sortStringList{padding:10px!important;}.wpProQuiz_sortStringList > li{float:left!important;margin-left:5px!important;margin-right:5px!important;margin-bottom:5px!important;}.wpProQuiz_sortStringItem{margin:0!important;background-image:none!important;list-style:none!important;}.wpProQuiz_maxtrixSortCriterion{padding:5px!important;}.wpProQuiz_placehold{background-color:#FFFFC2!important;list-style:none!important;background-image:none!important;padding:5px!important;height:30px!important;min-width:50px!important;}.wpProQuiz_maxtrixSortText{padding:5px!important;}.wpProQuiz_mextrixTr > td{border:1px solid #D1D1D1!important;padding:5px!important;vertical-align:middle!important;}.wpProQuiz_points{font-weight:700!important;text-align:center!important;margin-bottom:20px!important;}.wpProQuiz_cloze input{background:transparent;border:0!important;border-bottom:1px solid!important;height:18px!important;margin:0!important;padding:0 4px!important;color:#000!important;border-radius:0!important;box-shadow:0 0!important;}.wpProQuiz_cloze input:focus{outline:none!important;}.wpProQuiz_questionListItem input,.wpProQuiz_questionListItem label{margin:0!important;font-weight:400;}.wpProQuiz_resultsList > li{background-image:none!important;padding:0!important;margin:0!important;}
|
js/wpProQuiz_admin.js
CHANGED
@@ -370,7 +370,6 @@ jQuery(document).ready(function($) {
|
|
370 |
var url = location.replace('admin.php', 'admin-ajax.php') + '&action=save_sort';
|
371 |
|
372 |
$.post(url, data, function(response) {
|
373 |
-
console.debug(response);
|
374 |
$('#sortMsg').show(400).delay(1000).hide(400);
|
375 |
});
|
376 |
},
|
@@ -410,8 +409,6 @@ jQuery(document).ready(function($) {
|
|
410 |
e.preventDefault();
|
411 |
methode.saveSort();
|
412 |
});
|
413 |
-
|
414 |
-
console.debug($);
|
415 |
};
|
416 |
|
417 |
init();
|
@@ -526,7 +523,7 @@ jQuery(document).ready(function($) {
|
|
526 |
|
527 |
if($('#wpProQuiz_resultGradeEnabled:checked').length) {
|
528 |
var rCheck = true;
|
529 |
-
|
530 |
$('#resultList').children().each(function() {
|
531 |
if($(this).is(':visible')) {
|
532 |
if(!methode.validResultInput($(this).find('input[name="resultTextGrade[prozent][]"]').val())) {
|
370 |
var url = location.replace('admin.php', 'admin-ajax.php') + '&action=save_sort';
|
371 |
|
372 |
$.post(url, data, function(response) {
|
|
|
373 |
$('#sortMsg').show(400).delay(1000).hide(400);
|
374 |
});
|
375 |
},
|
409 |
e.preventDefault();
|
410 |
methode.saveSort();
|
411 |
});
|
|
|
|
|
412 |
};
|
413 |
|
414 |
init();
|
523 |
|
524 |
if($('#wpProQuiz_resultGradeEnabled:checked').length) {
|
525 |
var rCheck = true;
|
526 |
+
|
527 |
$('#resultList').children().each(function() {
|
528 |
if($(this).is(':visible')) {
|
529 |
if(!methode.validResultInput($(this).find('input[name="resultTextGrade[prozent][]"]').val())) {
|
js/wpProQuiz_admin.min.js
CHANGED
@@ -1,20 +1,19 @@
|
|
1 |
-
jQuery(document).ready(function(a){a.fn.wpProQuiz_preview=function(){var
|
2 |
-
$this.parent().parent().find(".wpProQuiz_quizName").text();a("<li>"+
|
3 |
-
(a.preventDefault(),!1):!0});a(".wpProQuiz_import").click(function(
|
4 |
-
a('input[name="exportItems"]');this.checked?
|
5 |
-
break;case "matrix_sort_answer":
|
6 |
-
a("#wpProQuiz_incorrectMassageBox").show()});a("#wpProQuiz_tip").change(function(){this.checked?a("#wpProQuiz_tipBox").show():a("#wpProQuiz_tipBox").hide()})},displaySingle:function(
|
7 |
-
"block")},displaySortAnswer:function(){a(".sort_answer").css("display","block")},displayMatrixSortAnswer:function(){a(".matrix_sort_answer").show()},displayClozeAnswer:function(){a(".cloze_answer").show()},addAnswer:function(
|
8 |
-
0;a('input[name="answerJson[classic_answer][correct][]"]').each(function(){this.value=
|
9 |
-
a('textarea[name="question"]').val();if(isNaN(f.val())||1>f.val())return alert(wpProQuizLocalize.no_nummber_points),f.focus(),!1;if(b
|
10 |
-
!1}else if("sort_answer"==d.val()){if(e=!1,a('textarea[name="answerJson[answer_sort][answer][]"]').each(function(){e=
|
11 |
-
!1}else if("cloze_answer"==d.val()){if(
|
12 |
-
a('input[name="answerType"][value="single"]').attr({checked:"checked"});a('input[name="answerType"]:checked').click();a("#wpProQuiz_correctSameText").change();a("#wpProQuiz_tip").change()};a.fn.wpProQuiz_questionOverall=function(){var
|
13 |
-
parseSortArray:function(){var
|
14 |
-
|
15 |
-
"toggle")
|
16 |
-
|
17 |
-
tinymce.editors.text.getContent():a('textarea[name="text"]').val();if(d(
|
18 |
-
a("#
|
19 |
-
a
|
20 |
-
a(".wpProQuiz_questionOverall").length&&a(".wpProQuiz_questionOverall").wpProQuiz_questionOverall()});
|
1 |
+
jQuery(document).ready(function(a){a.fn.wpProQuiz_preview=function(){var b={openPreview:function(d){window.open(a(d).attr("href"),"wpProQuizPreview","width=900,height=900")}};a(".wpProQuiz_prview").click(function(a){b.openPreview(this);a.preventDefault()})};a.fn.wpProQuiz_quizOverall=function(){var b={changeExport:function(d){$input=a(d);$export=a(".wpProQuiz_exportList");$ul=$export.find("ul").first();$export.find("li").remove();a('input[name="exportItems"]').each(function(){$this=a(this);if(this.checked){var c=
|
2 |
+
$this.parent().parent().find(".wpProQuiz_quizName").text();a("<li>"+c+"</li>").appendTo($ul)}})},startExport:function(){$ele=a('input[name="exportItems"]:checked');if(1>$ele.length)return alert(wpProQuizLocalize.no_selected_quiz),!1;$hidden=a("#exportHidden");$hidden.html("");a('input[name="exportItems"]').each(function(){$this=a(this);this.checked&&a('<input type="hidden" value="'+this.value+'" name="exportIds[]">').appendTo($hidden)});return!0}};a(".wpProQuiz_delete").click(function(a){return!confirm(wpProQuizLocalize.delete_msg)?
|
3 |
+
(a.preventDefault(),!1):!0});a(".wpProQuiz_import").click(function(b){b.preventDefault();a(".wpProQuiz_importList").toggle("fast");a(".wpProQuiz_exportList").hide();a(".wpProQuiz_exportCheck").hide()});a(".wpProQuiz_export").click(function(b){b.preventDefault();a(".wpProQuiz_exportList").toggle("fast");a(".wpProQuiz_exportCheck").toggle("fast");a(".wpProQuiz_importList").hide()});a('input[name="exportItems"]').change(function(){b.changeExport(this)});a('input[name="exportItemsAll"]').change(function(){var b=
|
4 |
+
a('input[name="exportItems"]');this.checked?b.attr("checked",!0):b.attr("checked",!1);b.change()});a("#exportStart").click(function(a){b.startExport()||a.preventDefault()})};a.fn.wpProQuiz_questionEdit=function(){var b={setup:function(){a('input[name="answerType"]').click(function(){a(".answer_felder").children().css("display","none");switch(this.value){case "single":b.displaySingle("radio");break;case "multiple":b.displaySingle("checkbox");break;case "free_answer":b.displayFreeAnswer();break;case "sort_answer":b.displaySortAnswer();
|
5 |
+
break;case "matrix_sort_answer":b.displayMatrixSortAnswer();break;case "cloze_answer":b.displayClozeAnswer()}});a(".addAnswer").click(function(){b.addAnswer(this)});a(".deleteAnswer").click(function(){b.deleteAnswer(this)});a("#saveQuestion").click(function(){return d()});a(".sort_answer ul, .classic_answer ul, .matrix_sort_answer ul").sortable({handle:".wpProQuiz_move",update:function(){b.setValueClassicAnswer()}});a("#wpProQuiz_correctSameText").change(function(){this.checked?a("#wpProQuiz_incorrectMassageBox").hide():
|
6 |
+
a("#wpProQuiz_incorrectMassageBox").show()});a("#wpProQuiz_tip").change(function(){this.checked?a("#wpProQuiz_tipBox").show():a("#wpProQuiz_tipBox").hide()})},displaySingle:function(c){a(".classic_answer").find('input[name="answerJson[classic_answer][correct][]"]').each(function(){a("<input type="+c+" />").attr({name:this.name,value:this.value,checked:this.checked}).insertBefore(this)}).remove();a(".classic_answer").css("display","block")},displayFreeAnswer:function(){a(".free_answer").css("display",
|
7 |
+
"block")},displaySortAnswer:function(){a(".sort_answer").css("display","block")},displayMatrixSortAnswer:function(){a(".matrix_sort_answer").show()},displayClozeAnswer:function(){a(".cloze_answer").show()},addAnswer:function(c){a(c).siblings("ul").children().first().clone().css("display","block").appendTo(a(c).siblings("ul"));b.setValueClassicAnswer();a(".deleteAnswer").click(function(){b.deleteAnswer(this)})},deleteAnswer:function(c){a(c).parent("li").remove();b.setValueClassicAnswer()},setValueClassicAnswer:function(){var c=
|
8 |
+
0;a('input[name="answerJson[classic_answer][correct][]"]').each(function(){this.value=c++});c=0;a('input[name="answerJson[answer_matrix_sort][sort_string_html][]"]').each(function(){this.value=c++});c=0;a('input[name="answerJson[answer_matrix_sort][answer_html][]"]').each(function(){this.value=c++})}},d=function(){var b="",d=a('input[name="answerType"]:checked'),f=a('input[name="points"]'),b=void 0!=tinymce.editors.question&&!tinymce.editors.question.isHidden()?tinymce.editors.question.getContent():
|
9 |
+
a('textarea[name="question"]').val();if(isNaN(f.val())||1>f.val())return alert(wpProQuizLocalize.no_nummber_points),f.focus(),!1;if(c(b))return alert(wpProQuizLocalize.no_question_msg),!1;if("single"==d.val()||"multiple"==d.val()){var e=!0;if(1>a('input[name="answerJson[classic_answer][correct][]"]:checked').each(function(){e=""!=a.trim(a(this).parent().siblings("textarea").val())?e&1:!1}).size())return alert(wpProQuizLocalize.no_correct_msg),!1;if(!e)return alert(wpProQuizLocalize.no_answer_msg),
|
10 |
+
!1}else if("sort_answer"==d.val()){if(e=!1,a('textarea[name="answerJson[answer_sort][answer][]"]').each(function(){e=c(a(this).val())?e|0:!0}),!e)return alert(wpProQuizLocalize.no_answer_msg),!1}else if("matrix_sort_answer"==d.val()){if(e=!1,a('textarea[name="answerJson[answer_matrix_sort][answer][]"]').each(function(){if(c(a(this).val()))e|=0;else{var b=a(this).parent().parent().find('textarea[name="answerJson[answer_matrix_sort][sort_string][]"]');e=c(b.val())?e|0:!0}}),!e)return alert(wpProQuizLocalize.no_answer_msg),
|
11 |
+
!1}else if("cloze_answer"==d.val()){if(b="",b=void 0!=tinymce.editors.cloze&&!tinymce.editors.cloze.isHidden()?tinymce.editors.cloze.getContent():a('textarea[name="answerJson[answer_cloze][text]"]').val(),c(b))return alert(wpProQuizLocalize.no_answer_msg),!1}else if("free_answer"==d.val()&&(b=a('textarea[name="answerJson[free_answer][correct]"]').val(),c(b)))return alert(wpProQuizLocalize.no_answer_msg),!1;return!0},c=function(c){c=a.trim(c);return!c||0===c.length};b.setup();1>a('input[name="answerType"][checked="checked"]').size()&&
|
12 |
+
a('input[name="answerType"][value="single"]').attr({checked:"checked"});a('input[name="answerType"]:checked').click();a("#wpProQuiz_correctSameText").change();a("#wpProQuiz_tip").change()};a.fn.wpProQuiz_questionOverall=function(){var b={saveSort:function(){var d={action:"wp_pro_quiz_update_sort",sort:b.parseSortArray()},c=(window.location.pathname+window.location.search).replace("admin.php","admin-ajax.php")+"&action=save_sort";a.post(c,d,function(){a("#sortMsg").show(400).delay(1E3).hide(400)})},
|
13 |
+
parseSortArray:function(){var b=[];a("tbody tr").each(function(){b.push(this.id.replace("wpProQuiz_questionId_",""))});return b},sortUpdate:function(){a(".wpProQuiz_questionOverall tbody").children().each(function(){$t=a(this).children().first().text(a(this).index()+1)})}};a(".wp-list-table tbody").sortable({handle:".wpProQuiz_move",update:b.sortUpdate});a(".wpProQuiz_delete").click(function(a){return!confirm(wpProQuizLocalize.delete_msg)?(a.preventDefault(),!1):!0});a("#wpProQuiz_saveSort").click(function(a){a.preventDefault();
|
14 |
+
b.saveSort()})};a.fn.wpProQuiz_quizEdit=function(){var b={addResult:function(){a("#resultList").children().each(function(){if("none"==a(this).css("display")){var c=a(this),b=c.find('textarea[name="resultTextGrade[text][]"]'),d=b.attr("id"),f=!0;c.find('input[name="resultTextGrade[prozent][]"]').val("0");c.find('input[name="resultTextGrade[activ][]"]').val("1").keyup();void 0!=tinymce.editors[d]&&!tinymce.editors[d].isHidden()&&(f=!1);void 0!=switchEditors&&!f&&(switchEditors.go(d,"toggle"),switchEditors.go(d,
|
15 |
+
"toggle"));void 0!=tinymce.editors[d]?tinymce.editors[d].setContent(""):b.val("");void 0!=tinymce.editors[d]&&!f&&tinyMCE.execCommand("mceRemoveControl",!1,d);c.parent().children(":visible").last().after(c);void 0!=tinymce.editors[d]&&!f&&tinyMCE.execCommand("mceAddControl",!1,d);a(this).show();void 0!=switchEditors&&!f&&switchEditors.go(d,"toggle");return!1}})},deleteResult:function(c){a(c).parent().parent().hide();a(c).siblings('input[name="resultTextGrade[activ][]"]').val("0")},changeResult:function(c){c=
|
16 |
+
a(c);if(b.validResultInput(c.val()))return c.siblings(".resultProzent").text(c.val()),c.removeAttr("style"),!0;c.css("background-color","#FF9696");return!1},validResultInput:function(a){if(d(a))return!1;a=a.replace(/\,/,".");return!isNaN(a)&&100>=Number(a)&&0<=Number(a)?null!=a.match(/\./)?3>a.split(".")[1].length:!0:!1},validInput:function(){if(d(a("#wpProQuiz_title").val()))return alert(wpProQuizLocalize.no_title_msg),!1;var c="",c=void 0!=tinymce.editors.text&&!tinymce.editors.text.isHidden()?
|
17 |
+
tinymce.editors.text.getContent():a('textarea[name="text"]').val();if(d(c))return alert(wpProQuizLocalize.no_quiz_start_msg),!1;if(a("#wpProQuiz_resultGradeEnabled:checked").length){var g=!0;a("#resultList").children().each(function(){if(a(this).is(":visible")&&!b.validResultInput(a(this).find('input[name="resultTextGrade[prozent][]"]').val()))return g=!1});if(!g)return alert(wpProQuizLocalize.fail_grade_result),!1}return!0}},d=function(c){c=a.trim(c);return!c||0===c.length};a("#statistics_on").change(function(){this.checked?
|
18 |
+
a("#statistics_ip_lock_tr").show():a("#statistics_ip_lock_tr").hide()});a(".addResult").click(function(){b.addResult()});a(".deleteResult").click(function(){b.deleteResult(this)});a('input[name="resultTextGrade[prozent][]"]').keyup(function(){b.changeResult(this)}).keydown(function(a){13==a.which&&a.preventDefault()});a("#wpProQuiz_resultGradeEnabled").change(function(){this.checked?(a("#resultGrade").show(),a("#resultNormal").hide()):(a("#resultGrade").hide(),a("#resultNormal").show())});a("#wpProQuiz_save").click(function(a){b.validInput()||
|
19 |
+
a.preventDefault()});a("#statistics_on").change();a("#wpProQuiz_resultGradeEnabled").change()};a(".wpProQuiz_quizOverall").length&&a(".wpProQuiz_quizOverall").wpProQuiz_preview();a(".wpProQuiz_quizOverall").length&&a(".wpProQuiz_quizOverall").wpProQuiz_quizOverall();a(".wpProQuiz_quizEdit").length&&a(".wpProQuiz_quizEdit").wpProQuiz_quizEdit();a(".wpProQuiz_questionEdit").length&&a(".wpProQuiz_questionEdit").wpProQuiz_questionEdit();a(".wpProQuiz_questionOverall").length&&a(".wpProQuiz_questionOverall").wpProQuiz_questionOverall()});
|
|
js/wpProQuiz_front.js
CHANGED
@@ -26,6 +26,8 @@
|
|
26 |
plugin.methode.answerRandom($element.find('.wpProQuiz_sortable').parent().parent());
|
27 |
}
|
28 |
|
|
|
|
|
29 |
if(config.timeLimit) {
|
30 |
plugin.methode.setTimeLimit();
|
31 |
}
|
@@ -163,7 +165,6 @@
|
|
163 |
ii = 0;
|
164 |
$(this).parent().find('.wpProQuiz_sortStringList').children().each(function() {
|
165 |
$(this).data('correct', j.correct[ii++]);
|
166 |
-
console.debug($(this));
|
167 |
});
|
168 |
|
169 |
if(j.answer_type == 'matrix_sort_answer') {
|
26 |
plugin.methode.answerRandom($element.find('.wpProQuiz_sortable').parent().parent());
|
27 |
}
|
28 |
|
29 |
+
plugin.methode.answerRandom('.wpProQuiz_sortStringList');
|
30 |
+
|
31 |
if(config.timeLimit) {
|
32 |
plugin.methode.setTimeLimit();
|
33 |
}
|
165 |
ii = 0;
|
166 |
$(this).parent().find('.wpProQuiz_sortStringList').children().each(function() {
|
167 |
$(this).data('correct', j.correct[ii++]);
|
|
|
168 |
});
|
169 |
|
170 |
if(j.answer_type == 'matrix_sort_answer') {
|
js/wpProQuiz_front.min.js
CHANGED
@@ -1,19 +1,19 @@
|
|
1 |
-
(function(c){c.wpProQuizFront=function(n,
|
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();
|
5 |
-
b.find(".wpProQuiz_time_limit"),d=a.find("span"),c=
|
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()-p.getTime())/1E3;b.find(".wpProQuiz_quiz_time span").first().html(
|
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++])
|
8 |
-
|
9 |
-
b
|
10 |
-
|
11 |
-
cursor:"auto"});d.find(".wpProQuiz_sortStringList, .wpProQuiz_maxtrixSortCriterion").sortable("destroy");b=g}else"cloze_answer"==h&&(g=!0,d.find(".wpProQuiz_cloze").each(function(){var a=c(this).children(),b=a.first(),d=b.val().toLowerCase(),
|
12 |
-
"disabled")}),b=g);c(a).hide();
|
13 |
-
b.find('input[name="check"]').click(),
|
14 |
-
a=
|
15 |
-
results:j,quizId:
|
16 |
0.5}).slice(0,a.length);c(a).appendTo(a[0].parentNode);var d=1;c(a).each(function(){c(this).find(".wpProQuiz_question_page span").eq(0).html(d);c(this).find("h3 span").html(d++)})},showTip:function(a){$tip=c(a).siblings(".wpProQuiz_tipp");$par=c(a).parent();void 0==j[$par.data("questionId")]&&(j[$par.data("questionId")]={});j[$par.data("questionId")].tip=1;$tip.toggle("fast")},setClozeStyle:function(){b.find(".wpProQuiz_cloze").each(function(){var a=c(this).children(),b=a.first(),a=a.last().clone();
|
17 |
-
a.css("visibility","hidden");c("body").append(a);var e=a.width();a.remove();b.width(e+10)})}};
|
18 |
-
b.find('input[name="next"]').click(function(a){a.preventDefault();
|
19 |
-
e=b.find('input[name="tip"]');!c.is(a.target)&&(0==c.has(a.target).length&&!e.is(a.target))&&c.hide("fast")})};
|
1 |
+
(function(c){c.wpProQuizFront=function(n,f){var b=c(n),e=this,m=0,i=0,p=0,j={},l=0,k=0;e.methode={startQuiz:function(){j={};f.questionRandom&&e.methode.questionRandom();f.answerRandom?e.methode.answerRandom(".wpProQuiz_questionList"):e.methode.answerRandom(b.find(".wpProQuiz_sortable").parent().parent());e.methode.answerRandom(".wpProQuiz_sortStringList");f.timeLimit&&e.methode.setTimeLimit();l=m=0;p=new Date;f.checkAnswer?b.find('input[name="check"]').show():b.find('input[name="next"]').show();b.find(".wpProQuiz_text").hide();
|
2 |
+
b.find(".wpProQuiz_quiz").show();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);i=setInterval(function(){d.html(e.methode.parseTime(c--));0>c&&(clearInterval(i),i=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()-p.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;k+=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++])});"matrix_sort_answer"==d.answer_type&&c(this).children().each(function(){c(this).data("correct",c(this).index())});a++})},checkAnswer:function(a){var d=
|
8 |
+
c(a).parent(),b=!1,f=d.find(".wpProQuiz_questionInput"),h=d.data("type");d.find('input[name="tip"]').hide();if("multiple"==h||"single"==h){var g=!0;f.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"==h){g=!0;d.find(".wpProQuiz_sortable").each(function(){var a=c(this),b=a.parent().index();a.data("correct")==
|
9 |
+
b?(a.parent().addClass("wpProQuiz_answerCorrect"),g&=1):(a.parent().addClass("wpProQuiz_answerIncorrect"),g=!1);a.css({"box-shadow":"0 0",cursor:"auto"})});var i=d.find(".wpProQuiz_sortable").parent().parent(),b=i.children("li");i.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){i.append(b)});b=g}else if("free_answer"==h)h=c.trim(f.val()).toLowerCase(),0<=c.inArray(h,f.data("correct"))?(b=!0,f.parent().parent().addClass("wpProQuiz_answerCorrect")):
|
10 |
+
f.parent().parent().addClass("wpProQuiz_answerIncorrect");else if("matrix_sort_answer"==h){var g=!0,k={};d.find(".wpProQuiz_questionList").children().each(function(){var a=c(this).data("correct"),b=c(this).find(".wpProQuiz_maxtrixSortCriterion");b.children().first().data("correct")==a?(g&=1,b.addClass("wpProQuiz_answerCorrect")):(g=!1,b.addClass("wpProQuiz_answerIncorrect"));k[a]=c(this)});d.find(".wpProQuiz_sortStringItem").each(function(){k[c(this).data("correct")].find(".wpProQuiz_maxtrixSortCriterion").append(this)}).css({"box-shadow":"0 0",
|
11 |
+
cursor:"auto"});d.find(".wpProQuiz_sortStringList, .wpProQuiz_maxtrixSortCriterion").sortable("destroy");b=g}else"cloze_answer"==h&&(g=!0,d.find(".wpProQuiz_cloze").each(function(){var a=c(this).children(),b=a.first(),d=b.val().toLowerCase(),f=a.last().text().toLowerCase(),f=c.trim(f.substr(1,f.length-2)),f=e.methode.cleanupCurlyQuotes(f),d=e.methode.cleanupCurlyQuotes(c.trim(d));f==d?(g&=1,b.css("background-color","#B0DAB0")):(g=!1,b.css("background-color","#FFBABA"),a.last().show());b.attr("disabled",
|
12 |
+
"disabled")}),b=g);c(a).hide();f.attr("disabled","disabled");void 0==j[d.data("questionId")]&&(j[d.data("questionId")]={});j[d.data("questionId")].correct=Number(b);d.find(".wpProQuiz_response").show();b?(d.find(".wpProQuiz_correct").show(),m++,l+=d.data("points")):d.find(".wpProQuiz_incorrect").show();d.find('input[name="next"]').show()},nextQuestion:function(a){var a=c(a).parent(),d=a.next();a.hide();d.length?(d.show(),f.backButton&&!f.checkAnswer&&d.find('input[name="back"]').show()):(f.checkAnswer||
|
13 |
+
b.find('input[name="check"]').click(),e.methode.showResult())},backQuestion:function(a){var a=c(a).parent(),b=a.prev();a.hide();b.show()},showResult:function(){clearInterval(i);var a=b.find(".wpProQuiz_points span");b.find(".wpProQuiz_time_limit .progress").clearQueue().stop();b.find(".wpProQuiz_correct_answer").html(m);b.find(".wpProQuiz_results").show();b.find(".wpProQuiz_time_limit").hide();e.methode.setQuizTime();var d=Math.round(1E4*(l/k))/100;a.eq(0).text(l);a.eq(1).text(k);a.eq(2).text(d);
|
14 |
+
a=e.methode.findResultIndex(d);-1<a&&b.find(".wpProQuiz_resultsList").children().eq(a).show();e.methode.sendStatistics()},findResultIndex:function(a){for(var b=f.resultsGrade,c=-1,e=999999,h=0;h<b.length;h++){var g=b[h];a>=g&&a-g<e&&(e=a-g,c=h)}return c},cleanupCurlyQuotes:function(a){a=a.replace(/\u2018/,"'");a=a.replace(/\u2019/,"'");a=a.replace(/\u201C/,'"');return a=a.replace(/\u201D/,'"')},sendStatistics:function(){f.statisticsOn&&c.ajax({url:f.url,type:"POST",cache:!1,data:{action:"wp_pro_quiz_statistics_save",
|
15 |
+
results:j,quizId:f.quizId}})},reShowQuestion:function(){b.find('input[name="next"], input[name="check"], input[name="back"]').hide();b.find(".wpProQuiz_quiz").children().first().children().show()},answerRandom:function(a){b.find(a).each(function(){var a=c(this).children(),a=a.sort(function(){return Math.round(Math.random())-0.5}).slice(0,a.length);c(a).appendTo(a[0].parentNode).show()})},questionRandom:function(){var a=b.find(".wpProQuiz_quiz ol").children(),a=a.sort(function(){return Math.round(Math.random())-
|
16 |
0.5}).slice(0,a.length);c(a).appendTo(a[0].parentNode);var d=1;c(a).each(function(){c(this).find(".wpProQuiz_question_page span").eq(0).html(d);c(this).find("h3 span").html(d++)})},showTip:function(a){$tip=c(a).siblings(".wpProQuiz_tipp");$par=c(a).parent();void 0==j[$par.data("questionId")]&&(j[$par.data("questionId")]={});j[$par.data("questionId")].tip=1;$tip.toggle("fast")},setClozeStyle:function(){b.find(".wpProQuiz_cloze").each(function(){var a=c(this).children(),b=a.first(),a=a.last().clone();
|
17 |
+
a.css("visibility","hidden");c("body").append(a);var e=a.width();a.remove();b.width(e+10)})}};e.init=function(){m=0;void 0==f.resultsGrade&&(f.resultsGrade=[0]);b.find(".wpProQuiz_quiz, .wpProQuiz_results").hide();b.find(".wpProQuiz_quiz").children().first().children().hide();e.methode.setData();e.methode.setClozeStyle();b.find('input[name="startQuiz"]').click(function(a){a.preventDefault();e.methode.startQuiz()});b.find('input[name="check"]').click(function(a){a.preventDefault();e.methode.checkAnswer(this)});
|
18 |
+
b.find('input[name="next"]').click(function(a){a.preventDefault();e.methode.nextQuestion(this)});b.find('input[name="restartQuiz"]').click(function(a){a.preventDefault();e.methode.reStartQuiz()});b.find('input[name="reShowQuestion"]').click(function(a){a.preventDefault();e.methode.reShowQuestion(this)});b.find('input[name="back"]').click(function(){e.methode.backQuestion(this)});b.find('input[name="tip"]').click(function(){e.methode.showTip(this)});c(document).mouseup(function(a){var c=b.find(".wpProQuiz_tipp"),
|
19 |
+
e=b.find('input[name="tip"]');!c.is(a.target)&&(0==c.has(a.target).length&&!e.is(a.target))&&c.hide("fast")})};e.init()};c.fn.wpProQuizFront=function(n){return this.each(function(){void 0==c(this).data("wpProQuizFront")&&c(this).data("wpProQuizFront",new c.wpProQuizFront(this,n))})}})(jQuery);
|
lib/controller/WpProQuiz_Controller_Front.php
CHANGED
@@ -46,7 +46,7 @@ class WpProQuiz_Controller_Front {
|
|
46 |
|
47 |
ob_end_clean();
|
48 |
}
|
49 |
-
|
50 |
return $content;
|
51 |
}
|
52 |
|
46 |
|
47 |
ob_end_clean();
|
48 |
}
|
49 |
+
|
50 |
return $content;
|
51 |
}
|
52 |
|
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.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -118,4 +118,9 @@ Own themes changes internal order of filters, what causes the problems. With ad
|
|
118 |
* Bugfix: "Matrix Sorting" in connection with "Random answer"
|
119 |
* Bugfix: Database in connection with UTF-8
|
120 |
* Bugfix in cloze
|
121 |
-
* Bugfix in the 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.11
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
118 |
* Bugfix: "Matrix Sorting" in connection with "Random answer"
|
119 |
* Bugfix: Database in connection with UTF-8
|
120 |
* Bugfix in cloze
|
121 |
+
* Bugfix in the backend
|
122 |
+
|
123 |
+
= 0.11 =
|
124 |
+
* Bugfix in javascript-code
|
125 |
+
* "Sort elements" are always randomly arranged
|
126 |
+
* Bugfix in CSS for different themes
|
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.
|
7 |
Author: Julius Fischer
|
8 |
Author URI: http://www.it-gecko.de
|
9 |
*/
|
10 |
|
11 |
-
define('WPPROQUIZ_VERSION', '0.
|
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.11
|
7 |
Author: Julius Fischer
|
8 |
Author URI: http://www.it-gecko.de
|
9 |
*/
|
10 |
|
11 |
+
define('WPPROQUIZ_VERSION', '0.11');
|
12 |
|
13 |
include_once 'lib/controller/WpProQuiz_Controller_Admin.php';
|
14 |
include_once 'lib/helper/WpProQuiz_Helper_DbUpgrade.php';
|