Version Description
- added hint support
- bug in sort choice were fixed
- mistranslations were fixed
Download this release
Release Info
Developer | xeno010 |
Plugin | Wp-Pro-Quiz |
Version | 0.4 |
Comparing to | |
See all releases |
Code changes from version 0.3 to 0.4
- css/wpProQuiz_front.css +18 -1
- css/wpProQuiz_front.min.css +1 -1
- js/wpProQuiz_admin.js +8 -0
- js/wpProQuiz_admin.min.js +8 -8
- js/wpProQuiz_front.js +39 -6
- js/wpProQuiz_front.min.js +12 -11
- languages/wp-pro-quiz-de_DE.mo +0 -0
- languages/wp-pro-quiz-de_DE.po +79 -56
- lib/helper/WpProQuiz_Helper_DbUpgrade.php +16 -1
- lib/model/WpProQuiz_Model_Question.php +33 -0
- lib/model/WpProQuiz_Model_QuestionMapper.php +32 -8
- lib/view/WpProQuiz_View_FrontQuiz.php +18 -7
- lib/view/WpProQuiz_View_QuestionEdit.php +21 -2
- lib/view/WpProQuiz_View_Statistics.php +5 -0
- readme.txt +11 -5
- wp-pro-quiz.php +2 -2
css/wpProQuiz_front.css
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
margin-bottom: 10px;
|
8 |
}
|
9 |
|
10 |
-
.wpProQuiz_content input[type="button"] {
|
11 |
margin: 0;
|
12 |
padding: 5px 10px;
|
13 |
background: #13455B;
|
@@ -16,6 +16,7 @@
|
|
16 |
font-weight: bold;
|
17 |
border: 1px solid #13455B;
|
18 |
box-shadow: 1px 1px 1px #333;
|
|
|
19 |
}
|
20 |
|
21 |
.wpProQuiz_question_page {
|
@@ -48,6 +49,9 @@
|
|
48 |
padding: 0;
|
49 |
margin: 0;
|
50 |
}
|
|
|
|
|
|
|
51 |
.wpProQuiz_response {
|
52 |
display: none;
|
53 |
background: #F8FAF5;
|
@@ -110,4 +114,17 @@
|
|
110 |
}
|
111 |
.wpProQuiz_question_text {
|
112 |
margin-bottom: 10px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
}
|
7 |
margin-bottom: 10px;
|
8 |
}
|
9 |
|
10 |
+
.wpProQuiz_content input[type="button"], .wpProQuiz_content input[type="button"]:hover {
|
11 |
margin: 0;
|
12 |
padding: 5px 10px;
|
13 |
background: #13455B;
|
16 |
font-weight: bold;
|
17 |
border: 1px solid #13455B;
|
18 |
box-shadow: 1px 1px 1px #333;
|
19 |
+
text-shadow: none;
|
20 |
}
|
21 |
|
22 |
.wpProQuiz_question_page {
|
49 |
padding: 0;
|
50 |
margin: 0;
|
51 |
}
|
52 |
+
.wpProQuiz_listItem {
|
53 |
+
position: relative;
|
54 |
+
}
|
55 |
.wpProQuiz_response {
|
56 |
display: none;
|
57 |
background: #F8FAF5;
|
114 |
}
|
115 |
.wpProQuiz_question_text {
|
116 |
margin-bottom: 10px;
|
117 |
+
}
|
118 |
+
.wpProQuiz_tipp {
|
119 |
+
padding: 10px;
|
120 |
+
background-color: #DDECFF;
|
121 |
+
border: 1px dotted #363636;
|
122 |
+
border-radius: 10px;
|
123 |
+
position: absolute;
|
124 |
+
bottom: 35px;
|
125 |
+
left: 5px;
|
126 |
+
right: 5px;
|
127 |
+
box-shadow: 2px 2px 5px 0px #313131;
|
128 |
+
z-index: 99999;
|
129 |
+
display: none;
|
130 |
}
|
css/wpProQuiz_front.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.wpProQuiz_content{margin-top:10px;margin-bottom:10px;}.wpProQuiz_content h2{margin-bottom:10px;}.wpProQuiz_content input[type=button]{margin:0;padding:5px 10px;background:#13455B;border-radius:11px;color:#FFF;font-weight:700;border:1px solid #13455B;box-shadow:1px 1px 1px #333;}.wpProQuiz_question_page{margin-bottom:10px;}.wpProQuiz_question_page span{font-weight:700;}.wpProQuiz_questionListItem{padding:3px;margin-bottom:5px;}.wpProQuiz_questionListItem:last-child{padding:3px;margin-bottom:0;}.wpProQuiz_questionList{margin-bottom:10px;background:#F8FAF5;border:1px solid #C3D1A3;padding:5px;list-style:none;}.wpProQuiz_list,wpProQuiz_listItem{list-style:none;padding:0;margin:0;}.wpProQuiz_response{display:none;background:#F8FAF5;border:1px solid #C4C4C4;padding:5px;margin-bottom:15px;box-shadow:1px 1px 2px #AAA;}.wpProQuiz_response span{font-weight:700;}.wpProQuiz_quiz,.wpProQuiz_correct,.wpProQuiz_incorrect,.wpProQuiz_results,.wpProQuiz_time_limit,.wpProQuiz_QuestionButton{display:none;}.wpProQuiz_answerCorrect{background:#6DB46D;font-weight:700;}.wpProQuiz_answerIncorrect{background:#FF9191;font-weight:700;}.wpProQuiz_sort{width:25px;}.wpProQuiz_results h3{margin-bottom:10px;}.wpProQuiz_sort_correct_answer{font-weight:700;margin-right:5px;display:none;}.wpProQuiz_sortable{padding:5px;border:1px solid #D3D3D3;box-shadow:2px 2px 1px #EEE;background-color:#F8FAF5;cursor:move;}.wpProQuiz_time_limit .time{font-weight:700;margin-top:5px;margin-bottom:5px;}.wpProQuiz_time_limit .progress{height:10px;width:46%;background-color:blue;margin-bottom:5px;}.wpProQuiz_time_limit_expired{display:none;font-weight:700;font-size:15px;text-align:center;}.wpProQuiz_question_text{margin-bottom:10px;}
|
1 |
+
.wpProQuiz_content{margin-top:10px;margin-bottom:10px;}.wpProQuiz_content h2{margin-bottom:10px;}.wpProQuiz_content input[type=button],.wpProQuiz_content input[type=button]:hover{margin:0;padding:5px 10px;background:#13455B;border-radius:11px;color:#FFF;font-weight:700;border:1px solid #13455B;box-shadow:1px 1px 1px #333;text-shadow:none;}.wpProQuiz_question_page{margin-bottom:10px;}.wpProQuiz_question_page span{font-weight:700;}.wpProQuiz_questionListItem{padding:3px;margin-bottom:5px;}.wpProQuiz_questionListItem:last-child{padding:3px;margin-bottom:0;}.wpProQuiz_questionList{margin-bottom:10px;background:#F8FAF5;border:1px solid #C3D1A3;padding:5px;list-style:none;}.wpProQuiz_list,wpProQuiz_listItem{list-style:none;padding:0;margin:0;}.wpProQuiz_listItem{position:relative;}.wpProQuiz_response{display:none;background:#F8FAF5;border:1px solid #C4C4C4;padding:5px;margin-bottom:15px;box-shadow:1px 1px 2px #AAA;}.wpProQuiz_response span{font-weight:700;}.wpProQuiz_quiz,.wpProQuiz_correct,.wpProQuiz_incorrect,.wpProQuiz_results,.wpProQuiz_time_limit,.wpProQuiz_QuestionButton{display:none;}.wpProQuiz_answerCorrect{background:#6DB46D;font-weight:700;}.wpProQuiz_answerIncorrect{background:#FF9191;font-weight:700;}.wpProQuiz_sort{width:25px;}.wpProQuiz_results h3{margin-bottom:10px;}.wpProQuiz_sort_correct_answer{font-weight:700;margin-right:5px;display:none;}.wpProQuiz_sortable{padding:5px;border:1px solid #D3D3D3;box-shadow:2px 2px 1px #EEE;background-color:#F8FAF5;cursor:move;}.wpProQuiz_time_limit .time{font-weight:700;margin-top:5px;margin-bottom:5px;}.wpProQuiz_time_limit .progress{height:10px;width:46%;background-color:blue;margin-bottom:5px;}.wpProQuiz_time_limit_expired{display:none;font-weight:700;font-size:15px;text-align:center;}.wpProQuiz_question_text{margin-bottom:10px;}.wpProQuiz_tipp{padding:10px;background-color:#DDECFF;border:1px dotted #363636;border-radius:10px;position:absolute;bottom:35px;left:5px;right:5px;box-shadow:2px 2px 5px 0 #313131;z-index:99999;display:none;}
|
js/wpProQuiz_admin.js
CHANGED
@@ -25,6 +25,7 @@ jQuery(document).ready(function($) {
|
|
25 |
|
26 |
$('input[name="answerType"]:checked').click();
|
27 |
$('#wpProQuiz_correctSameText').change();
|
|
|
28 |
};
|
29 |
|
30 |
var formListener = {
|
@@ -74,6 +75,13 @@ jQuery(document).ready(function($) {
|
|
74 |
$('#wpProQuiz_incorrectMassageBox').show();
|
75 |
});
|
76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
},
|
78 |
|
79 |
displaySingle: function(type) {
|
25 |
|
26 |
$('input[name="answerType"]:checked').click();
|
27 |
$('#wpProQuiz_correctSameText').change();
|
28 |
+
$('#wpProQuiz_tip').change();
|
29 |
};
|
30 |
|
31 |
var formListener = {
|
75 |
$('#wpProQuiz_incorrectMassageBox').show();
|
76 |
});
|
77 |
|
78 |
+
$('#wpProQuiz_tip').change(function(e) {
|
79 |
+
if(this.checked)
|
80 |
+
$('#wpProQuiz_tipBox').show();
|
81 |
+
else
|
82 |
+
$('#wpProQuiz_tipBox').hide();
|
83 |
+
});
|
84 |
+
|
85 |
},
|
86 |
|
87 |
displaySingle: function(type) {
|
js/wpProQuiz_admin.min.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
jQuery(document).ready(function(a){a.fn.wpProQuiz_preview=function(){var b={openPreview:function(b){window.open(a(b).attr("href"),"wpProQuizPreview","width=900,height=900")}};a(".wpProQuiz_prview").click(function(a){b.openPreview(this);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");
|
2 |
-
break;case "free_answer":b.displayFreeAnswer();break;case "sort_answer":b.displaySortAnswer()}});a(".addAnswer").click(function(){b.addAnswer(this)});a(".deleteAnswer").click(function(){b.deleteAnswer(this)});a("#saveQuestion").click(function(){return c()});a(".sort_answer ul, .classic_answer ul").sortable({handle:".wpProQuiz_move",update:function(){b.setValueClassicAnswer()}});a("#wpProQuiz_correctSameText").change(function(){this.checked?a("#wpProQuiz_incorrectMassageBox").hide():a("#wpProQuiz_incorrectMassageBox").show()})
|
3 |
-
displaySingle:function(b){a(".classic_answer").find('input[name="answerJson[classic_answer][correct][]"]').each(function(){a("<input type="+b+" />").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","block")},displaySortAnswer:function(){a(".sort_answer").css("display",
|
4 |
-
"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(){i=0;a('input[name="answerJson[classic_answer][correct][]"]').each(function(){this.value=i++})}},c=function(){var b=tinymce.editors.question.getContent(),c=a('input[name="answerType"]:checked');
|
5 |
-
if("single"==c.val()||"multiple"==c.val()){var d=!0;if(1>a('input[name="answerJson[classic_answer][correct][]"]:checked').each(function(){d=""!=a.trim(a(this).parent().siblings("textarea").val())?d&1:!1}).size())return alert(wpProQuizLocalize.no_correct_msg),!1;if(!d)return alert(wpProQuizLocalize.no_answer_msg),!1}else if("sort_answer"==c.val()&&(d=!1,a('textarea[name="answerJson[answer_sort][answer][]"]').each(function(){var b=
|
6 |
-
|
7 |
-
a("#sortMsg").show(400).delay(1E3).hide(400)})},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",
|
8 |
-
!1):!0});a("#wpProQuiz_saveSort").click(function(a){a.preventDefault();b.saveSort()});console.debug(a)};a.fn.wpProQuiz_quizEdit=function(){a("#statistics_on").change(function(){this.checked?a("#statistics_ip_lock_tr").show():a("#statistics_ip_lock_tr").hide()});a("#statistics_on").change()};a(".wpProQuiz_quizOverall").length&&a(".wpProQuiz_quizOverall").wpProQuiz_preview();
|
9 |
-
a(".wpProQuiz_questionOverall").length&&a(".wpProQuiz_questionOverall").wpProQuiz_questionOverall()});
|
1 |
jQuery(document).ready(function(a){a.fn.wpProQuiz_preview=function(){var b={openPreview:function(b){window.open(a(b).attr("href"),"wpProQuizPreview","width=900,height=900")}};a(".wpProQuiz_prview").click(function(a){b.openPreview(this);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");
|
2 |
+
break;case "free_answer":b.displayFreeAnswer();break;case "sort_answer":b.displaySortAnswer()}});a(".addAnswer").click(function(){b.addAnswer(this)});a(".deleteAnswer").click(function(){b.deleteAnswer(this)});a("#saveQuestion").click(function(){return c()});a(".sort_answer ul, .classic_answer ul").sortable({handle:".wpProQuiz_move",update:function(){b.setValueClassicAnswer()}});a("#wpProQuiz_correctSameText").change(function(){this.checked?a("#wpProQuiz_incorrectMassageBox").hide():a("#wpProQuiz_incorrectMassageBox").show()});
|
3 |
+
a("#wpProQuiz_tip").change(function(){this.checked?a("#wpProQuiz_tipBox").show():a("#wpProQuiz_tipBox").hide()})},displaySingle:function(b){a(".classic_answer").find('input[name="answerJson[classic_answer][correct][]"]').each(function(){a("<input type="+b+" />").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","block")},displaySortAnswer:function(){a(".sort_answer").css("display",
|
4 |
+
"block")},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(){i=0;a('input[name="answerJson[classic_answer][correct][]"]').each(function(){this.value=i++})}},c=function(){var b=tinymce.editors.question.getContent(),c=a('input[name="answerType"]:checked');
|
5 |
+
if(!b||0===b.length)return alert(wpProQuizLocalize.no_question_msg),!1;if("single"==c.val()||"multiple"==c.val()){var d=!0;if(1>a('input[name="answerJson[classic_answer][correct][]"]:checked').each(function(){d=""!=a.trim(a(this).parent().siblings("textarea").val())?d&1:!1}).size())return alert(wpProQuizLocalize.no_correct_msg),!1;if(!d)return alert(wpProQuizLocalize.no_answer_msg),!1}else if("sort_answer"==c.val()&&(d=!1,a('textarea[name="answerJson[answer_sort][answer][]"]').each(function(){var b=
|
6 |
+
a(this).val();d=!b||0===b.length?d|0:!0}),!d))return alert(wpProQuizLocalize.no_answer_msg),!1;return!0};b.setup();1>a('input[name="answerType"][checked="checked"]').size()&&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 c={action:"wp_pro_quiz_update_sort",sort:b.parseSortArray()},e=(window.location.pathname+
|
7 |
+
window.location.search).replace("admin.php","admin-ajax.php")+"&action=save_sort";a.post(e,c,function(b){console.debug(b);a("#sortMsg").show(400).delay(1E3).hide(400)})},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",
|
8 |
+
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();b.saveSort()});console.debug(a)};a.fn.wpProQuiz_quizEdit=function(){a("#statistics_on").change(function(){this.checked?a("#statistics_ip_lock_tr").show():a("#statistics_ip_lock_tr").hide()});a("#statistics_on").change()};a(".wpProQuiz_quizOverall").length&&a(".wpProQuiz_quizOverall").wpProQuiz_preview();
|
9 |
+
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
@@ -7,12 +7,12 @@
|
|
7 |
var count = 0;
|
8 |
var intervalId = 0;
|
9 |
var startTime = 0;
|
10 |
-
var
|
11 |
|
12 |
plugin.methode = {
|
13 |
startQuiz: function() {
|
14 |
|
15 |
-
|
16 |
|
17 |
if(config.questionRandom) {
|
18 |
plugin.methode.questionRandom();
|
@@ -49,7 +49,7 @@
|
|
49 |
$element.find('.wpProQuiz_answerCorrect').removeClass('wpProQuiz_answerCorrect');
|
50 |
$element.find('.wpProQuiz_answerIncorrect').removeClass('wpProQuiz_answerIncorrect');
|
51 |
|
52 |
-
$element.find('.wpProQuiz_text').show();
|
53 |
$element.find('.wpProQuiz_quiz, .wpProQuiz_results, .wpProQuiz_response, .wpProQuiz_correct, .wpProQuiz_incorrect')
|
54 |
.hide();
|
55 |
$element.find('.wpProQuiz_time_limit, .wpProQuiz_time_limit_expired, .wpProQuiz_sort_correct_answer')
|
@@ -138,6 +138,8 @@
|
|
138 |
var checked = $question.find('input[name="question"]');
|
139 |
var type = $question.data('type');
|
140 |
|
|
|
|
|
141 |
if(type == 'multiple' || type == 'single') {
|
142 |
var check = true;
|
143 |
|
@@ -175,13 +177,14 @@
|
|
175 |
check = false;
|
176 |
}
|
177 |
|
178 |
-
$div.parent().parent().sortable("destroy");
|
179 |
$div.css({'box-shadow': '0 0', 'cursor': 'auto'});
|
180 |
});
|
181 |
|
182 |
var list = $question.find('.wpProQuiz_sortable').parent().parent();
|
183 |
var items = list.children('li');
|
184 |
|
|
|
|
|
185 |
items.sort(function(a, b) {
|
186 |
return $(a).children('div').data('correct') > $(b).children('div').data('correct');
|
187 |
});
|
@@ -204,7 +207,11 @@
|
|
204 |
$(btn).hide();
|
205 |
checked.attr('disabled', 'disabled');
|
206 |
|
207 |
-
|
|
|
|
|
|
|
|
|
208 |
|
209 |
$question.find('.wpProQuiz_response').show();
|
210 |
|
@@ -264,7 +271,7 @@
|
|
264 |
url: config.url,
|
265 |
type: 'POST',
|
266 |
cache: false,
|
267 |
-
data: {action: 'wp_pro_quiz_statistics_save', 'results':
|
268 |
});
|
269 |
},
|
270 |
|
@@ -299,6 +306,19 @@
|
|
299 |
$(this).find('.wpProQuiz_question_page span').eq(0).html(i);
|
300 |
$(this).find('h3 span').html(i++);
|
301 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
302 |
}
|
303 |
};
|
304 |
|
@@ -343,6 +363,19 @@
|
|
343 |
$element.find('input[name="back"]').click(function(e) {
|
344 |
plugin.methode.backQuestion(this);
|
345 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
346 |
};
|
347 |
|
348 |
plugin.init();
|
7 |
var count = 0;
|
8 |
var intervalId = 0;
|
9 |
var startTime = 0;
|
10 |
+
var statistics = new Object();
|
11 |
|
12 |
plugin.methode = {
|
13 |
startQuiz: function() {
|
14 |
|
15 |
+
statistics = new Object();
|
16 |
|
17 |
if(config.questionRandom) {
|
18 |
plugin.methode.questionRandom();
|
49 |
$element.find('.wpProQuiz_answerCorrect').removeClass('wpProQuiz_answerCorrect');
|
50 |
$element.find('.wpProQuiz_answerIncorrect').removeClass('wpProQuiz_answerIncorrect');
|
51 |
|
52 |
+
$element.find('.wpProQuiz_text, input[name="tip"]').show();
|
53 |
$element.find('.wpProQuiz_quiz, .wpProQuiz_results, .wpProQuiz_response, .wpProQuiz_correct, .wpProQuiz_incorrect')
|
54 |
.hide();
|
55 |
$element.find('.wpProQuiz_time_limit, .wpProQuiz_time_limit_expired, .wpProQuiz_sort_correct_answer')
|
138 |
var checked = $question.find('input[name="question"]');
|
139 |
var type = $question.data('type');
|
140 |
|
141 |
+
$question.find('input[name="tip"]').hide();
|
142 |
+
|
143 |
if(type == 'multiple' || type == 'single') {
|
144 |
var check = true;
|
145 |
|
177 |
check = false;
|
178 |
}
|
179 |
|
|
|
180 |
$div.css({'box-shadow': '0 0', 'cursor': 'auto'});
|
181 |
});
|
182 |
|
183 |
var list = $question.find('.wpProQuiz_sortable').parent().parent();
|
184 |
var items = list.children('li');
|
185 |
|
186 |
+
list.sortable("destroy");
|
187 |
+
|
188 |
items.sort(function(a, b) {
|
189 |
return $(a).children('div').data('correct') > $(b).children('div').data('correct');
|
190 |
});
|
207 |
$(btn).hide();
|
208 |
checked.attr('disabled', 'disabled');
|
209 |
|
210 |
+
if(statistics[$question.data('questionId')] == undefined) {
|
211 |
+
statistics[$question.data('questionId')] = new Object();
|
212 |
+
}
|
213 |
+
|
214 |
+
statistics[$question.data('questionId')].correct = Number(correct);
|
215 |
|
216 |
$question.find('.wpProQuiz_response').show();
|
217 |
|
271 |
url: config.url,
|
272 |
type: 'POST',
|
273 |
cache: false,
|
274 |
+
data: {action: 'wp_pro_quiz_statistics_save', 'results': statistics, 'quizId': config.quizId}
|
275 |
});
|
276 |
},
|
277 |
|
306 |
$(this).find('.wpProQuiz_question_page span').eq(0).html(i);
|
307 |
$(this).find('h3 span').html(i++);
|
308 |
});
|
309 |
+
},
|
310 |
+
|
311 |
+
showTip: function(e) {
|
312 |
+
$tip = $(e).siblings('.wpProQuiz_tipp');
|
313 |
+
$par = $(e).parent();
|
314 |
+
|
315 |
+
if(statistics[$par.data('questionId')] == undefined) {
|
316 |
+
statistics[$par.data('questionId')] = new Object();
|
317 |
+
}
|
318 |
+
|
319 |
+
statistics[$par.data('questionId')].tip = 1;
|
320 |
+
|
321 |
+
$tip.toggle('fast');
|
322 |
}
|
323 |
};
|
324 |
|
363 |
$element.find('input[name="back"]').click(function(e) {
|
364 |
plugin.methode.backQuestion(this);
|
365 |
});
|
366 |
+
|
367 |
+
$element.find('input[name="tip"]').click(function(e) {
|
368 |
+
plugin.methode.showTip(this);
|
369 |
+
});
|
370 |
+
|
371 |
+
$(document).mouseup(function(e) {
|
372 |
+
|
373 |
+
var $tip = $element.find('.wpProQuiz_tipp');
|
374 |
+
var $btn = $element.find('input[name="tip"]');
|
375 |
+
|
376 |
+
if(!$tip.is(e.target) && $tip.has(e.target).length == 0 && !$btn.is(e.target))
|
377 |
+
$tip.hide('fast');
|
378 |
+
});
|
379 |
};
|
380 |
|
381 |
plugin.init();
|
js/wpProQuiz_front.min.js
CHANGED
@@ -1,13 +1,14 @@
|
|
1 |
-
(function(b){b.wpProQuizFront=function(
|
2 |
-
a.find(".wpProQuiz_listItem").first().fadeIn(200);a.find(".wpProQuiz_sortable").parent().parent().sortable().disableSelection()},reStartQuiz:function(){a.find(".wpProQuiz_answerCorrect").removeClass("wpProQuiz_answerCorrect");a.find(".wpProQuiz_answerIncorrect").removeClass("wpProQuiz_answerIncorrect");a.find(
|
3 |
a.find(".wpProQuiz_quiz").children().first().children().hide();a.find(".wpProQuiz_sortable").removeAttr("style");a.find('input[name="check"]').hide();a.find('input[name="next"]').hide();a.find('input[name="question"]').removeAttr("disabled").removeAttr("checked");a.find('input[name="question"][type="text"]').removeAttr("value")},setTimeLimit:function(){var f=a.find(".wpProQuiz_time_limit"),d=f.find("span"),b=e.timeLimit;f.css({width:"100%",display:"block"});d.html(c.methode.parseTime(b));f.find(".progress").css("width",
|
4 |
"100%").animate({width:"0%"},1E3*e.timeLimit);h=setInterval(function(){d.html(c.methode.parseTime(b--));0>b&&(clearInterval(h),h=0,f.find(".progress").clearQueue().stop(),a.find('input[name="check"]').click().parent().hide(),a.find(".wpProQuiz_time_limit_expired").show(),c.methode.showResult())},1E3)},parseTime:function(a){var d=parseInt(a%60),b=parseInt(a/60%60),a=parseInt(a/3600%24);return(9<a?"":"0")+a+":"+((9<b?"":"0")+b)+":"+((9<d?"":"0")+d)},setQuizTime:function(){var b=((new Date).getTime()-
|
5 |
-
n.getTime())/1E3;a.find(".wpProQuiz_quiz_time span").first().html(c.methode.parseTime(b))},setData:function(){var f=0;a.find(".wpProQuiz_questionList").each(function(){var
|
6 |
-
|
7 |
-
|
8 |
-
d){h.append(d)});c=g}else"free_answer"==
|
9 |
-
d=f.next();f.hide();d.length?(d.show(),e.backButton&&!e.checkAnswer&&d.find('input[name="back"]').show()):(e.checkAnswer||a.find('input[name="check"]').click(),c.methode.showResult())},backQuestion:function(a){var a=b(a).parent(),d=a.prev();a.hide();d.show()},showResult:function(){clearInterval(h);a.find(".wpProQuiz_time_limit .progress").clearQueue().stop();a.find(".wpProQuiz_points").html(
|
10 |
-
a.find(".wpProQuiz_time_limit").hide();c.methode.setQuizTime();c.methode.sendStatistics()},sendStatistics:function(){e.statisticsOn&&b.ajax({url:e.url,type:"POST",cache:!1,data:{action:"wp_pro_quiz_statistics_save",results:
|
11 |
-
0.5}).slice(0,a.length);b(a).appendTo(a[0].parentNode).show()})},questionRandom:function(){var c=a.find(".wpProQuiz_quiz ol").children(),c=c.sort(function(){return Math.round(Math.random())-0.5}).slice(0,c.length);b(c).appendTo(c[0].parentNode);var d=1;b(c).each(function(){b(this).find(".wpProQuiz_question_page span").eq(0).html(d);b(this).find("h3 span").html(d++)})}
|
12 |
-
b
|
13 |
-
c.methode.
|
|
1 |
+
(function(b){b.wpProQuizFront=function(l,e){var a=b(l),c=this,k=0,m=0,h=0,n=0,i={};c.methode={startQuiz:function(){i={};e.questionRandom&&c.methode.questionRandom();e.answerRandom?c.methode.answerRandom(".wpProQuiz_questionList"):c.methode.answerRandom(a.find(".wpProQuiz_sortable").parent().parent());e.timeLimit&&c.methode.setTimeLimit();k=0;n=new Date;e.checkAnswer?a.find('input[name="check"]').show():a.find('input[name="next"]').show();a.find(".wpProQuiz_text").hide();a.find(".wpProQuiz_quiz").show();
|
2 |
+
a.find(".wpProQuiz_listItem").first().fadeIn(200);a.find(".wpProQuiz_sortable").parent().parent().sortable().disableSelection()},reStartQuiz:function(){a.find(".wpProQuiz_answerCorrect").removeClass("wpProQuiz_answerCorrect");a.find(".wpProQuiz_answerIncorrect").removeClass("wpProQuiz_answerIncorrect");a.find('.wpProQuiz_text, input[name="tip"]').show();a.find(".wpProQuiz_quiz, .wpProQuiz_results, .wpProQuiz_response, .wpProQuiz_correct, .wpProQuiz_incorrect").hide();a.find(".wpProQuiz_time_limit, .wpProQuiz_time_limit_expired, .wpProQuiz_sort_correct_answer").hide();
|
3 |
a.find(".wpProQuiz_quiz").children().first().children().hide();a.find(".wpProQuiz_sortable").removeAttr("style");a.find('input[name="check"]').hide();a.find('input[name="next"]').hide();a.find('input[name="question"]').removeAttr("disabled").removeAttr("checked");a.find('input[name="question"][type="text"]').removeAttr("value")},setTimeLimit:function(){var f=a.find(".wpProQuiz_time_limit"),d=f.find("span"),b=e.timeLimit;f.css({width:"100%",display:"block"});d.html(c.methode.parseTime(b));f.find(".progress").css("width",
|
4 |
"100%").animate({width:"0%"},1E3*e.timeLimit);h=setInterval(function(){d.html(c.methode.parseTime(b--));0>b&&(clearInterval(h),h=0,f.find(".progress").clearQueue().stop(),a.find('input[name="check"]').click().parent().hide(),a.find(".wpProQuiz_time_limit_expired").show(),c.methode.showResult())},1E3)},parseTime:function(a){var d=parseInt(a%60),b=parseInt(a/60%60),a=parseInt(a/3600%24);return(9<a?"":"0")+a+":"+((9<b?"":"0")+b)+":"+((9<d?"":"0")+d)},setQuizTime:function(){var b=((new Date).getTime()-
|
5 |
+
n.getTime())/1E3;a.find(".wpProQuiz_quiz_time span").first().html(c.methode.parseTime(b))},setData:function(){var f=0;a.find(".wpProQuiz_questionList").each(function(){var d=e.json[f],a=0;b(this).parent().parent().data("type",d.answer_type).data("questionId",d.id);b(this).find('input[name="question"]').each(function(){switch(d.answer_type){case "single":case "multiple":0<=b.inArray(this.value,d.correct)?b(this).data("correct","1"):b(this).data("correct","0");break;case "free_answer":b(this).data("correct",
|
6 |
+
d.correct)}});b(this).find(".wpProQuiz_sortable").each(function(){b(this).data("correct",d.correct[a++])});f++})},checkAnswer:function(a){var d=b(a).parent(),c=!1,e=d.find('input[name="question"]'),j=d.data("type");d.find('input[name="tip"]').hide();if("multiple"==j||"single"==j){var g=!0;e.each(function(){"1"==b(this).data("correct")?(b(this).parent().parent().addClass("wpProQuiz_answerCorrect"),g=this.checked?g&1:g&0):this.checked&&(b(this).parent().parent().addClass("wpProQuiz_answerIncorrect"),
|
7 |
+
g&=0)});c=g}else if("sort_answer"==j){g=!0;d.find(".wpProQuiz_sortable").each(function(){var a=b(this),d=a.parent().index();a.data("correct")==d?(a.parent().addClass("wpProQuiz_answerCorrect"),g&=1):(a.parent().addClass("wpProQuiz_answerIncorrect"),g=!1);a.css({"box-shadow":"0 0",cursor:"auto"})});var h=d.find(".wpProQuiz_sortable").parent().parent(),c=h.children("li");h.sortable("destroy");c.sort(function(a,d){return b(a).children("div").data("correct")>b(d).children("div").data("correct")});b.each(c,
|
8 |
+
function(a,d){h.append(d)});c=g}else"free_answer"==j&&(j=b.trim(e.val()).toLowerCase(),0<=b.inArray(j,e.data("correct"))?(c=!0,e.parent().parent().addClass("wpProQuiz_answerCorrect")):e.parent().parent().addClass("wpProQuiz_answerIncorrect"));b(a).hide();e.attr("disabled","disabled");void 0==i[d.data("questionId")]&&(i[d.data("questionId")]={});i[d.data("questionId")].correct=Number(c);d.find(".wpProQuiz_response").show();c?(d.find(".wpProQuiz_correct").show(),k++):d.find(".wpProQuiz_incorrect").show();
|
9 |
+
d.find('input[name="next"]').show()},nextQuestion:function(f){var f=b(f).parent(),d=f.next();f.hide();d.length?(d.show(),e.backButton&&!e.checkAnswer&&d.find('input[name="back"]').show()):(e.checkAnswer||a.find('input[name="check"]').click(),c.methode.showResult())},backQuestion:function(a){var a=b(a).parent(),d=a.prev();a.hide();d.show()},showResult:function(){clearInterval(h);a.find(".wpProQuiz_time_limit .progress").clearQueue().stop();a.find(".wpProQuiz_points").html(k);a.find(".wpProQuiz_points_prozent").html("("+
|
10 |
+
Math.round(100*(k/m))+"%)");a.find(".wpProQuiz_results").show();a.find(".wpProQuiz_time_limit").hide();c.methode.setQuizTime();c.methode.sendStatistics()},sendStatistics:function(){e.statisticsOn&&b.ajax({url:e.url,type:"POST",cache:!1,data:{action:"wp_pro_quiz_statistics_save",results:i,quizId:e.quizId}})},reShowQuestion:function(){a.find('input[name="next"], input[name="check"], input[name="back"]').hide();a.find(".wpProQuiz_quiz").children().first().children().show()},answerRandom:function(c){a.find(c).each(function(){var a=
|
11 |
+
b(this).children(),a=a.sort(function(){return Math.round(Math.random())-0.5}).slice(0,a.length);b(a).appendTo(a[0].parentNode).show()})},questionRandom:function(){var c=a.find(".wpProQuiz_quiz ol").children(),c=c.sort(function(){return Math.round(Math.random())-0.5}).slice(0,c.length);b(c).appendTo(c[0].parentNode);var d=1;b(c).each(function(){b(this).find(".wpProQuiz_question_page span").eq(0).html(d);b(this).find("h3 span").html(d++)})},showTip:function(a){$tip=b(a).siblings(".wpProQuiz_tipp");
|
12 |
+
$par=b(a).parent();void 0==i[$par.data("questionId")]&&(i[$par.data("questionId")]={});i[$par.data("questionId")].tip=1;$tip.toggle("fast")}};c.init=function(){k=0;a.find(".wpProQuiz_quiz, .wpProQuiz_results").hide();var e=a.find(".wpProQuiz_quiz").children().first().children();e.hide();m=e.length;c.methode.setData();a.find('input[name="startQuiz"]').click(function(a){a.preventDefault();c.methode.startQuiz()});a.find('input[name="check"]').click(function(a){a.preventDefault();c.methode.checkAnswer(this)});
|
13 |
+
a.find('input[name="next"]').click(function(a){a.preventDefault();c.methode.nextQuestion(this)});a.find('input[name="restartQuiz"]').click(function(a){a.preventDefault();c.methode.reStartQuiz()});a.find('input[name="reShowQuestion"]').click(function(a){a.preventDefault();c.methode.reShowQuestion(this)});a.find('input[name="back"]').click(function(){c.methode.backQuestion(this)});a.find('input[name="tip"]').click(function(){c.methode.showTip(this)});b(document).mouseup(function(b){var c=a.find(".wpProQuiz_tipp"),
|
14 |
+
e=a.find('input[name="tip"]');!c.is(b.target)&&(0==c.has(b.target).length&&!e.is(b.target))&&c.hide("fast")})};c.init()};b.fn.wpProQuizFront=function(l){return this.each(function(){void 0==b(this).data("wpProQuizFront")&&b(this).data("wpProQuizFront",new b.wpProQuizFront(this,l))})}})(jQuery);
|
languages/wp-pro-quiz-de_DE.mo
CHANGED
Binary file
|
languages/wp-pro-quiz-de_DE.po
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Wp-Pro-Quiz\n"
|
4 |
-
"POT-Creation-Date: 2012-11-
|
5 |
-
"PO-Revision-Date: 2012-11-
|
6 |
"Last-Translator: Julius Fischer <julius.f@gmx.net>\n"
|
7 |
"Language-Team: Julius Fischer\n"
|
8 |
"Language: German\n"
|
@@ -14,23 +14,23 @@ msgstr ""
|
|
14 |
"X-Poedit-Basepath: ..\n"
|
15 |
"X-Poedit-SearchPath-0: .\n"
|
16 |
|
17 |
-
#: lib/controller/WpProQuiz_Controller_Admin.php:
|
18 |
msgid "Do you really want to delete the quiz/question?"
|
19 |
msgstr "Wollen Sie das Quiz/Frage wirklich löschen?"
|
20 |
|
21 |
-
#: lib/controller/WpProQuiz_Controller_Admin.php:
|
22 |
msgid "Title is not filled!"
|
23 |
msgstr "Titel wurde nicht ausgefüllt!"
|
24 |
|
25 |
-
#: lib/controller/WpProQuiz_Controller_Admin.php:
|
26 |
msgid "No question deposited!"
|
27 |
msgstr "Keine Frage hinterlegt!"
|
28 |
|
29 |
-
#: lib/controller/WpProQuiz_Controller_Admin.php:
|
30 |
msgid "Correct answer was not selected!"
|
31 |
msgstr "Keine korrekte Antwort markiert!"
|
32 |
|
33 |
-
#: lib/controller/WpProQuiz_Controller_Admin.php:
|
34 |
msgid "No answer deposited!"
|
35 |
msgstr "Keine Antwort hinterlegt!"
|
36 |
|
@@ -98,7 +98,7 @@ msgstr "Ergebnis"
|
|
98 |
|
99 |
#: lib/view/WpProQuiz_View_FrontQuiz.php:58
|
100 |
#, php-format
|
101 |
-
msgid "%s
|
102 |
msgstr "%s von %s Frage korrekt beantwortet"
|
103 |
|
104 |
#: lib/view/WpProQuiz_View_FrontQuiz.php:61
|
@@ -125,7 +125,7 @@ msgstr "Zeitlimit"
|
|
125 |
|
126 |
#: lib/view/WpProQuiz_View_FrontQuiz.php:87
|
127 |
#, php-format
|
128 |
-
msgid "Question %s
|
129 |
msgstr "Frage %s von %s"
|
130 |
|
131 |
#: lib/view/WpProQuiz_View_FrontQuiz.php:89
|
@@ -135,22 +135,30 @@ msgid "Question"
|
|
135 |
msgstr "Frage"
|
136 |
|
137 |
#: lib/view/WpProQuiz_View_FrontQuiz.php:133
|
138 |
-
|
139 |
-
|
|
|
140 |
|
141 |
#: lib/view/WpProQuiz_View_FrontQuiz.php:141
|
142 |
-
|
143 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
|
145 |
-
#: lib/view/WpProQuiz_View_FrontQuiz.php:
|
146 |
msgid "Check"
|
147 |
msgstr "Prüfen"
|
148 |
|
149 |
-
#: lib/view/WpProQuiz_View_FrontQuiz.php:
|
150 |
msgid "Back"
|
151 |
msgstr "Zurück"
|
152 |
|
153 |
-
#: lib/view/WpProQuiz_View_FrontQuiz.php:
|
154 |
msgid "Next exercise"
|
155 |
msgstr "Nächste Frage"
|
156 |
|
@@ -168,6 +176,7 @@ msgstr "Titel"
|
|
168 |
#: lib/view/WpProQuiz_View_QuestionEdit.php:17
|
169 |
#: lib/view/WpProQuiz_View_QuestionEdit.php:34
|
170 |
#: lib/view/WpProQuiz_View_QuestionEdit.php:51
|
|
|
171 |
#: lib/view/WpProQuiz_View_QuizEdit.php:178
|
172 |
msgid "(optional)"
|
173 |
msgstr "(Optional)"
|
@@ -181,7 +190,7 @@ msgstr ""
|
|
181 |
"Titel leer gelassen, wird ein Titel generiert."
|
182 |
|
183 |
#: lib/view/WpProQuiz_View_QuestionEdit.php:26
|
184 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
185 |
#: lib/view/WpProQuiz_View_QuizEdit.php:12
|
186 |
#: lib/view/WpProQuiz_View_QuizEdit.php:167
|
187 |
msgid "(required)"
|
@@ -219,38 +228,47 @@ msgstr ""
|
|
219 |
"komplexe Aufgaben dienen. Die Nachricht \"Richtig\" oder \"Falsch\" wird "
|
220 |
"immer automatisch angezeigt."
|
221 |
|
222 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
223 |
msgid "Answer type"
|
224 |
msgstr "Antwort Typ?"
|
225 |
|
226 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
227 |
msgid "Single choice"
|
228 |
msgstr "Single choice"
|
229 |
|
230 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
231 |
msgid "Multiple choice"
|
232 |
msgstr "Multiple choice"
|
233 |
|
234 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
235 |
msgid "\"Free\" choice"
|
236 |
msgstr "\"Free\" choice"
|
237 |
|
238 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
239 |
msgid "\"Sorting\" choice"
|
240 |
msgstr "\"Sorting\" choice"
|
241 |
|
242 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
243 |
msgid "Answers"
|
244 |
msgstr "Antworten"
|
245 |
|
246 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
|
|
247 |
msgid ""
|
248 |
-
"
|
249 |
msgstr ""
|
250 |
"Korrekte Antworten (eine pro Zeile ) (Antworten werden in Kleinbuchstaben "
|
251 |
"umgewandelt)"
|
252 |
|
253 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
254 |
msgid ""
|
255 |
"Please sort the answers in right order with the \"Move\" - Button. The "
|
256 |
"answers will be displayed randomly."
|
@@ -258,46 +276,46 @@ msgstr ""
|
|
258 |
"Bitte Antworten mit dem \"Verschiebe\"-Button in die richtige Reihenfolge "
|
259 |
"bringen. Die Antworten werden später immer zufällig ausgegeben."
|
260 |
|
261 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
262 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
263 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:130
|
264 |
#: lib/view/WpProQuiz_View_QuestionEdit.php:149
|
265 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
266 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
|
|
267 |
msgid "Delete answer"
|
268 |
msgstr "Antwort löschen"
|
269 |
|
270 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
271 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
272 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:131
|
273 |
#: lib/view/WpProQuiz_View_QuestionEdit.php:150
|
274 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
275 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
|
|
276 |
#: lib/view/WpProQuiz_View_QuestionOverall.php:29
|
277 |
msgid "Move"
|
278 |
msgstr "Verschieben"
|
279 |
|
280 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
281 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
282 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:133
|
283 |
#: lib/view/WpProQuiz_View_QuestionEdit.php:152
|
284 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
285 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
|
|
286 |
msgid "Allow HTML"
|
287 |
msgstr "HTML erlauben"
|
288 |
|
289 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
290 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
291 |
msgid "Add new answer"
|
292 |
msgstr "Neue Antwort hinzufügen"
|
293 |
|
294 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
295 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
296 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
297 |
msgid "correct?"
|
298 |
msgstr "Korrekt?"
|
299 |
|
300 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
301 |
#: lib/view/WpProQuiz_View_QuizEdit.php:188
|
302 |
msgid "Save"
|
303 |
msgstr "Speichern"
|
@@ -492,22 +510,27 @@ msgstr "Statistik ist nicht aktiviert"
|
|
492 |
msgid "Activate statistics"
|
493 |
msgstr "Statistik aktivieren"
|
494 |
|
495 |
-
#: lib/view/WpProQuiz_View_Statistics.php:
|
496 |
-
msgid "
|
497 |
-
msgstr "
|
498 |
|
499 |
-
#: lib/view/WpProQuiz_View_Statistics.php:
|
500 |
-
msgid "Correct"
|
501 |
-
msgstr "Korrekt"
|
502 |
-
|
503 |
-
#: lib/view/WpProQuiz_View_Statistics.php:55
|
504 |
msgid "Total"
|
505 |
msgstr "Total"
|
506 |
|
507 |
-
#: lib/view/WpProQuiz_View_Statistics.php:
|
508 |
msgid "Reset statistics"
|
509 |
msgstr "Statistik zurücksetzen"
|
510 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
511 |
#~ msgid "Delete question"
|
512 |
#~ msgstr "Frage löschen"
|
513 |
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Wp-Pro-Quiz\n"
|
4 |
+
"POT-Creation-Date: 2012-11-20 20:52+0100\n"
|
5 |
+
"PO-Revision-Date: 2012-11-20 20:52+0100\n"
|
6 |
"Last-Translator: Julius Fischer <julius.f@gmx.net>\n"
|
7 |
"Language-Team: Julius Fischer\n"
|
8 |
"Language: German\n"
|
14 |
"X-Poedit-Basepath: ..\n"
|
15 |
"X-Poedit-SearchPath-0: .\n"
|
16 |
|
17 |
+
#: lib/controller/WpProQuiz_Controller_Admin.php:35
|
18 |
msgid "Do you really want to delete the quiz/question?"
|
19 |
msgstr "Wollen Sie das Quiz/Frage wirklich löschen?"
|
20 |
|
21 |
+
#: lib/controller/WpProQuiz_Controller_Admin.php:36
|
22 |
msgid "Title is not filled!"
|
23 |
msgstr "Titel wurde nicht ausgefüllt!"
|
24 |
|
25 |
+
#: lib/controller/WpProQuiz_Controller_Admin.php:37
|
26 |
msgid "No question deposited!"
|
27 |
msgstr "Keine Frage hinterlegt!"
|
28 |
|
29 |
+
#: lib/controller/WpProQuiz_Controller_Admin.php:38
|
30 |
msgid "Correct answer was not selected!"
|
31 |
msgstr "Keine korrekte Antwort markiert!"
|
32 |
|
33 |
+
#: lib/controller/WpProQuiz_Controller_Admin.php:39
|
34 |
msgid "No answer deposited!"
|
35 |
msgstr "Keine Antwort hinterlegt!"
|
36 |
|
98 |
|
99 |
#: lib/view/WpProQuiz_View_FrontQuiz.php:58
|
100 |
#, php-format
|
101 |
+
msgid "%s of %s questions answered correctly"
|
102 |
msgstr "%s von %s Frage korrekt beantwortet"
|
103 |
|
104 |
#: lib/view/WpProQuiz_View_FrontQuiz.php:61
|
125 |
|
126 |
#: lib/view/WpProQuiz_View_FrontQuiz.php:87
|
127 |
#, php-format
|
128 |
+
msgid "Question %s of %s"
|
129 |
msgstr "Frage %s von %s"
|
130 |
|
131 |
#: lib/view/WpProQuiz_View_FrontQuiz.php:89
|
135 |
msgstr "Frage"
|
136 |
|
137 |
#: lib/view/WpProQuiz_View_FrontQuiz.php:133
|
138 |
+
#: lib/view/WpProQuiz_View_Statistics.php:21
|
139 |
+
msgid "Correct"
|
140 |
+
msgstr "Korrekt"
|
141 |
|
142 |
#: lib/view/WpProQuiz_View_FrontQuiz.php:141
|
143 |
+
#: lib/view/WpProQuiz_View_Statistics.php:20
|
144 |
+
msgid "Incorrect"
|
145 |
+
msgstr "Inkorrekt"
|
146 |
+
|
147 |
+
#: lib/view/WpProQuiz_View_FrontQuiz.php:157
|
148 |
+
#: lib/view/WpProQuiz_View_FrontQuiz.php:167
|
149 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:62
|
150 |
+
msgid "Hint"
|
151 |
+
msgstr "Tipp"
|
152 |
|
153 |
+
#: lib/view/WpProQuiz_View_FrontQuiz.php:164
|
154 |
msgid "Check"
|
155 |
msgstr "Prüfen"
|
156 |
|
157 |
+
#: lib/view/WpProQuiz_View_FrontQuiz.php:165
|
158 |
msgid "Back"
|
159 |
msgstr "Zurück"
|
160 |
|
161 |
+
#: lib/view/WpProQuiz_View_FrontQuiz.php:169
|
162 |
msgid "Next exercise"
|
163 |
msgstr "Nächste Frage"
|
164 |
|
176 |
#: lib/view/WpProQuiz_View_QuestionEdit.php:17
|
177 |
#: lib/view/WpProQuiz_View_QuestionEdit.php:34
|
178 |
#: lib/view/WpProQuiz_View_QuestionEdit.php:51
|
179 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:62
|
180 |
#: lib/view/WpProQuiz_View_QuizEdit.php:178
|
181 |
msgid "(optional)"
|
182 |
msgstr "(Optional)"
|
190 |
"Titel leer gelassen, wird ein Titel generiert."
|
191 |
|
192 |
#: lib/view/WpProQuiz_View_QuestionEdit.php:26
|
193 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:106
|
194 |
#: lib/view/WpProQuiz_View_QuizEdit.php:12
|
195 |
#: lib/view/WpProQuiz_View_QuizEdit.php:167
|
196 |
msgid "(required)"
|
228 |
"komplexe Aufgaben dienen. Die Nachricht \"Richtig\" oder \"Falsch\" wird "
|
229 |
"immer automatisch angezeigt."
|
230 |
|
231 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:65
|
232 |
+
msgid "Here you can enter solution hint."
|
233 |
+
msgstr "Hier können Sie einen Lösungstipp hinterlegen."
|
234 |
+
|
235 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:69
|
236 |
+
msgid "Activate hint for this question?"
|
237 |
+
msgstr "Tipp für diese Frage aktivieren?"
|
238 |
+
|
239 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:81
|
240 |
msgid "Answer type"
|
241 |
msgstr "Antwort Typ?"
|
242 |
|
243 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:89
|
244 |
msgid "Single choice"
|
245 |
msgstr "Single choice"
|
246 |
|
247 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:93
|
248 |
msgid "Multiple choice"
|
249 |
msgstr "Multiple choice"
|
250 |
|
251 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:97
|
252 |
msgid "\"Free\" choice"
|
253 |
msgstr "\"Free\" choice"
|
254 |
|
255 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:101
|
256 |
msgid "\"Sorting\" choice"
|
257 |
msgstr "\"Sorting\" choice"
|
258 |
|
259 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:106
|
260 |
msgid "Answers"
|
261 |
msgstr "Antworten"
|
262 |
|
263 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:111
|
264 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:115
|
265 |
msgid ""
|
266 |
+
"correct answers (one per line) (answers will be converted to lower case)"
|
267 |
msgstr ""
|
268 |
"Korrekte Antworten (eine pro Zeile ) (Antworten werden in Kleinbuchstaben "
|
269 |
"umgewandelt)"
|
270 |
|
271 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:121
|
272 |
msgid ""
|
273 |
"Please sort the answers in right order with the \"Move\" - Button. The "
|
274 |
"answers will be displayed randomly."
|
276 |
"Bitte Antworten mit dem \"Verschiebe\"-Button in die richtige Reihenfolge "
|
277 |
"bringen. Die Antworten werden später immer zufällig ausgegeben."
|
278 |
|
279 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:127
|
280 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:139
|
|
|
281 |
#: lib/view/WpProQuiz_View_QuestionEdit.php:149
|
282 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:168
|
283 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:184
|
284 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:198
|
285 |
msgid "Delete answer"
|
286 |
msgstr "Antwort löschen"
|
287 |
|
288 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:128
|
289 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:140
|
|
|
290 |
#: lib/view/WpProQuiz_View_QuestionEdit.php:150
|
291 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:169
|
292 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:185
|
293 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:199
|
294 |
#: lib/view/WpProQuiz_View_QuestionOverall.php:29
|
295 |
msgid "Move"
|
296 |
msgstr "Verschieben"
|
297 |
|
298 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:130
|
299 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:142
|
|
|
300 |
#: lib/view/WpProQuiz_View_QuestionEdit.php:152
|
301 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:171
|
302 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:187
|
303 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:201
|
304 |
msgid "Allow HTML"
|
305 |
msgstr "HTML erlauben"
|
306 |
|
307 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:158
|
308 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:207
|
309 |
msgid "Add new answer"
|
310 |
msgstr "Neue Antwort hinzufügen"
|
311 |
|
312 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:166
|
313 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:182
|
314 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:196
|
315 |
msgid "correct?"
|
316 |
msgstr "Korrekt?"
|
317 |
|
318 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:211
|
319 |
#: lib/view/WpProQuiz_View_QuizEdit.php:188
|
320 |
msgid "Save"
|
321 |
msgstr "Speichern"
|
510 |
msgid "Activate statistics"
|
511 |
msgstr "Statistik aktivieren"
|
512 |
|
513 |
+
#: lib/view/WpProQuiz_View_Statistics.php:22
|
514 |
+
msgid "Hints used"
|
515 |
+
msgstr "Tipp benutzt"
|
516 |
|
517 |
+
#: lib/view/WpProQuiz_View_Statistics.php:59
|
|
|
|
|
|
|
|
|
518 |
msgid "Total"
|
519 |
msgstr "Total"
|
520 |
|
521 |
+
#: lib/view/WpProQuiz_View_Statistics.php:66
|
522 |
msgid "Reset statistics"
|
523 |
msgstr "Statistik zurücksetzen"
|
524 |
|
525 |
+
#~ msgid "Right"
|
526 |
+
#~ msgstr "Richtig"
|
527 |
+
|
528 |
+
#~ msgid "Wrong"
|
529 |
+
#~ msgstr "Falsch"
|
530 |
+
|
531 |
+
#~ msgid "Tip"
|
532 |
+
#~ msgstr "Tipp"
|
533 |
+
|
534 |
#~ msgid "Delete question"
|
535 |
#~ msgstr "Frage löschen"
|
536 |
|
lib/helper/WpProQuiz_Helper_DbUpgrade.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
class WpProQuiz_Helper_DbUpgrade {
|
3 |
|
4 |
-
const WPPROQUIZ_DB_VERSION =
|
5 |
|
6 |
private $_wpdb;
|
7 |
private $_prefix;
|
@@ -78,6 +78,9 @@ class WpProQuiz_Helper_DbUpgrade {
|
|
78 |
`correct_same_text` tinyint(1) NOT NULL,
|
79 |
`correct_count` int(10) unsigned NOT NULL,
|
80 |
`incorrect_count` int(10) unsigned NOT NULL,
|
|
|
|
|
|
|
81 |
`answer_type` varchar(50) NOT NULL,
|
82 |
`answer_json` text NOT NULL,
|
83 |
PRIMARY KEY (`id`),
|
@@ -142,4 +145,16 @@ class WpProQuiz_Helper_DbUpgrade {
|
|
142 |
|
143 |
return 4;
|
144 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
}
|
1 |
<?php
|
2 |
class WpProQuiz_Helper_DbUpgrade {
|
3 |
|
4 |
+
const WPPROQUIZ_DB_VERSION = 5;
|
5 |
|
6 |
private $_wpdb;
|
7 |
private $_prefix;
|
78 |
`correct_same_text` tinyint(1) NOT NULL,
|
79 |
`correct_count` int(10) unsigned NOT NULL,
|
80 |
`incorrect_count` int(10) unsigned NOT NULL,
|
81 |
+
`tip_enabled` tinyint(1) NOT NULL,
|
82 |
+
`tip_msg` text NOT NULL,
|
83 |
+
`tip_count` int(11) NOT NULL,
|
84 |
`answer_type` varchar(50) NOT NULL,
|
85 |
`answer_json` text NOT NULL,
|
86 |
PRIMARY KEY (`id`),
|
145 |
|
146 |
return 4;
|
147 |
}
|
148 |
+
|
149 |
+
private function upgradeDbV4() {
|
150 |
+
|
151 |
+
$this->_wpdb->query('
|
152 |
+
ALTER TABLE `wp_wp_pro_quiz_question`
|
153 |
+
ADD `tip_enabled` TINYINT( 1 ) NOT NULL AFTER `incorrect_count` ,
|
154 |
+
ADD `tip_msg` TEXT NOT NULL AFTER `tip_enabled` ,
|
155 |
+
ADD `tip_count` INT NOT NULL AFTER `tip_msg`
|
156 |
+
');
|
157 |
+
|
158 |
+
return 5;
|
159 |
+
}
|
160 |
}
|
lib/model/WpProQuiz_Model_Question.php
CHANGED
@@ -12,6 +12,9 @@ class WpProQuiz_Model_Question extends WpProQuiz_Model_Model {
|
|
12 |
protected $_correctCount;
|
13 |
protected $_incorrectCount;
|
14 |
protected $_correctSameText = false;
|
|
|
|
|
|
|
15 |
|
16 |
public function setId($_id)
|
17 |
{
|
@@ -136,4 +139,34 @@ class WpProQuiz_Model_Question extends WpProQuiz_Model_Model {
|
|
136 |
public function isCorrectSameText() {
|
137 |
return $this->_correctSameText;
|
138 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
}
|
12 |
protected $_correctCount;
|
13 |
protected $_incorrectCount;
|
14 |
protected $_correctSameText = false;
|
15 |
+
protected $_tipEnabled = false;
|
16 |
+
protected $_tipMsg;
|
17 |
+
protected $_tipCount;
|
18 |
|
19 |
public function setId($_id)
|
20 |
{
|
139 |
public function isCorrectSameText() {
|
140 |
return $this->_correctSameText;
|
141 |
}
|
142 |
+
|
143 |
+
public function setTipEnabled($_tipEnabled)
|
144 |
+
{
|
145 |
+
$this->_tipEnabled = (bool)$_tipEnabled;
|
146 |
+
return $this;
|
147 |
+
}
|
148 |
+
|
149 |
+
public function isTipEnabled() {
|
150 |
+
return $this->_tipEnabled;
|
151 |
+
}
|
152 |
+
|
153 |
+
public function setTipMsg($_tipMsg)
|
154 |
+
{
|
155 |
+
$this->_tipMsg = $_tipMsg;
|
156 |
+
return $this;
|
157 |
+
}
|
158 |
+
|
159 |
+
public function getTipMsg() {
|
160 |
+
return $this->_tipMsg;
|
161 |
+
}
|
162 |
+
|
163 |
+
public function setTipCount($_tipCount)
|
164 |
+
{
|
165 |
+
$this->_tipCount = (int)$_tipCount;
|
166 |
+
return $this;
|
167 |
+
}
|
168 |
+
|
169 |
+
public function getTipCount() {
|
170 |
+
return $this->_tipCount;
|
171 |
+
}
|
172 |
}
|
lib/model/WpProQuiz_Model_QuestionMapper.php
CHANGED
@@ -32,10 +32,12 @@ class WpProQuiz_Model_QuestionMapper extends WpProQuiz_Model_Mapper {
|
|
32 |
'correct_msg' => $question->getCorrectMsg(),
|
33 |
'incorrect_msg' => $question->getIncorrectMsg(),
|
34 |
'correct_same_text' => (int)$question->isCorrectSameText(),
|
|
|
|
|
35 |
'answer_type' => $question->getAnswerType(),
|
36 |
'answer_json' => json_encode($question->getAnswerJson())),
|
37 |
array('id' => $question->getId()),
|
38 |
-
array('%s', '%s', '%s', '%s', '%d', '%s', '%s'),
|
39 |
array('%d'));
|
40 |
} else {
|
41 |
$id = $this->_wpdb->insert($this->_table, array(
|
@@ -46,10 +48,12 @@ class WpProQuiz_Model_QuestionMapper extends WpProQuiz_Model_Mapper {
|
|
46 |
'correct_msg' => $question->getCorrectMsg(),
|
47 |
'incorrect_msg' => $question->getIncorrectMsg(),
|
48 |
'correct_same_text' => (int)$question->isCorrectSameText(),
|
|
|
|
|
49 |
'answer_type' => $question->getAnswerType(),
|
50 |
'answer_json' => json_encode($question->getAnswerJson())
|
51 |
),
|
52 |
-
array('%d', '%d', '%s', '%s', '%s', '%s', '%d', '%s', '%s')
|
53 |
);
|
54 |
|
55 |
$question->setId($id);
|
@@ -141,13 +145,28 @@ class WpProQuiz_Model_QuestionMapper extends WpProQuiz_Model_Mapper {
|
|
141 |
public function updateStatistics($quizId, $array) {
|
142 |
$ids = $this->_wpdb->get_col($this->_wpdb->prepare("SELECT id FROM {$this->_table} WHERE quiz_id = %d", $quizId));
|
143 |
|
144 |
-
$
|
145 |
|
146 |
-
if(array_diff($ids, $
|
147 |
return false;
|
148 |
|
149 |
-
$correctIds =
|
150 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
|
152 |
if(!empty($correctIds)) {
|
153 |
$this->_wpdb->query("UPDATE {$this->_table} SET correct_count = correct_count + 1 WHERE id IN({$correctIds})");
|
@@ -157,16 +176,21 @@ class WpProQuiz_Model_QuestionMapper extends WpProQuiz_Model_Mapper {
|
|
157 |
$this->_wpdb->query("UPDATE {$this->_table} SET incorrect_count = incorrect_count + 1 WHERE id IN({$incorrectIds})");
|
158 |
}
|
159 |
|
|
|
|
|
|
|
|
|
160 |
return true;
|
161 |
}
|
162 |
|
163 |
public function resetStatistics($quizId) {
|
164 |
return $this->_wpdb->update($this->_table,
|
165 |
array( 'incorrect_count' => 0,
|
166 |
-
'correct_count' => 0
|
|
|
167 |
),
|
168 |
array( 'quiz_id' => $quizId),
|
169 |
-
array( '%d', '%d'),
|
170 |
array( '%d'));
|
171 |
}
|
172 |
}
|
32 |
'correct_msg' => $question->getCorrectMsg(),
|
33 |
'incorrect_msg' => $question->getIncorrectMsg(),
|
34 |
'correct_same_text' => (int)$question->isCorrectSameText(),
|
35 |
+
'tip_enabled' => (int)$question->isTipEnabled(),
|
36 |
+
'tip_msg' => $question->getTipMsg(),
|
37 |
'answer_type' => $question->getAnswerType(),
|
38 |
'answer_json' => json_encode($question->getAnswerJson())),
|
39 |
array('id' => $question->getId()),
|
40 |
+
array('%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s', '%s'),
|
41 |
array('%d'));
|
42 |
} else {
|
43 |
$id = $this->_wpdb->insert($this->_table, array(
|
48 |
'correct_msg' => $question->getCorrectMsg(),
|
49 |
'incorrect_msg' => $question->getIncorrectMsg(),
|
50 |
'correct_same_text' => (int)$question->isCorrectSameText(),
|
51 |
+
'tip_enabled' => (int)$question->isTipEnabled(),
|
52 |
+
'tip_msg' => $question->getTipMsg(),
|
53 |
'answer_type' => $question->getAnswerType(),
|
54 |
'answer_json' => json_encode($question->getAnswerJson())
|
55 |
),
|
56 |
+
array('%d', '%d', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s', '%s')
|
57 |
);
|
58 |
|
59 |
$question->setId($id);
|
145 |
public function updateStatistics($quizId, $array) {
|
146 |
$ids = $this->_wpdb->get_col($this->_wpdb->prepare("SELECT id FROM {$this->_table} WHERE quiz_id = %d", $quizId));
|
147 |
|
148 |
+
$ak = array_keys($array);
|
149 |
|
150 |
+
if(array_diff($ids, $ak) !== array_diff($ak, $ids))
|
151 |
return false;
|
152 |
|
153 |
+
$correctIds = $incorrectIds = $tipIds = array();
|
154 |
+
|
155 |
+
foreach($array as $k => $v) {
|
156 |
+
if(isset($v['tip'])) {
|
157 |
+
$tipIds[] = $k;
|
158 |
+
}
|
159 |
+
|
160 |
+
if($v['correct']) {
|
161 |
+
$correctIds[] = $k;
|
162 |
+
} else {
|
163 |
+
$incorrectIds[] = $k;
|
164 |
+
}
|
165 |
+
}
|
166 |
+
|
167 |
+
$correctIds = implode(', ', $correctIds);
|
168 |
+
$incorrectIds = implode(', ', $incorrectIds);
|
169 |
+
$tipIds = implode(', ', $tipIds);
|
170 |
|
171 |
if(!empty($correctIds)) {
|
172 |
$this->_wpdb->query("UPDATE {$this->_table} SET correct_count = correct_count + 1 WHERE id IN({$correctIds})");
|
176 |
$this->_wpdb->query("UPDATE {$this->_table} SET incorrect_count = incorrect_count + 1 WHERE id IN({$incorrectIds})");
|
177 |
}
|
178 |
|
179 |
+
if(!empty($tipIds)) {
|
180 |
+
$this->_wpdb->query("UPDATE {$this->_table} SET tip_count = tip_count + 1 WHERE id IN({$tipIds})");
|
181 |
+
}
|
182 |
+
|
183 |
return true;
|
184 |
}
|
185 |
|
186 |
public function resetStatistics($quizId) {
|
187 |
return $this->_wpdb->update($this->_table,
|
188 |
array( 'incorrect_count' => 0,
|
189 |
+
'correct_count' => 0,
|
190 |
+
'tip_count' => 0
|
191 |
),
|
192 |
array( 'quiz_id' => $quizId),
|
193 |
+
array( '%d', '%d', '%d'),
|
194 |
array( '%d'));
|
195 |
}
|
196 |
}
|
lib/view/WpProQuiz_View_FrontQuiz.php
CHANGED
@@ -33,7 +33,7 @@ class WpProQuiz_View_FrontQuiz extends WpProQuiz_View_View {
|
|
33 |
}
|
34 |
|
35 |
public function show($preview = false) {
|
36 |
-
|
37 |
$question_count = count($this->question);
|
38 |
|
39 |
$json = json_encode($this->parseJson($this->question));
|
@@ -55,7 +55,7 @@ class WpProQuiz_View_FrontQuiz extends WpProQuiz_View_View {
|
|
55 |
<div class="wpProQuiz_results">
|
56 |
<h3><?php _e('Results', 'wp-pro-quiz'); ?></h3>
|
57 |
<p>
|
58 |
-
<?php printf(__('%s
|
59 |
</p>
|
60 |
<p class="wpProQuiz_time_limit_expired">
|
61 |
<?php _e('Time has elapsed', 'wp-pro-quiz'); ?>
|
@@ -84,7 +84,7 @@ class WpProQuiz_View_FrontQuiz extends WpProQuiz_View_View {
|
|
84 |
?>
|
85 |
<li class="wpProQuiz_listItem">
|
86 |
<div class="wpProQuiz_question_page">
|
87 |
-
<?php printf(__('Question %s
|
88 |
</div>
|
89 |
<h3><span><?php echo $index; ?></span>. <?php _e('Question', 'wp-pro-quiz'); ?></h3>
|
90 |
<div class="wpProQuiz_question">
|
@@ -130,7 +130,7 @@ class WpProQuiz_View_FrontQuiz extends WpProQuiz_View_View {
|
|
130 |
<div class="wpProQuiz_response">
|
131 |
<div class="wpProQuiz_correct">
|
132 |
<span>
|
133 |
-
<?php _e('
|
134 |
</span>
|
135 |
<p>
|
136 |
<?php echo do_shortcode(apply_filters('comment_text', $question->getCorrectMsg())); ?>
|
@@ -138,7 +138,7 @@ class WpProQuiz_View_FrontQuiz extends WpProQuiz_View_View {
|
|
138 |
</div>
|
139 |
<div class="wpProQuiz_incorrect">
|
140 |
<span>
|
141 |
-
<?php _e('
|
142 |
</span>
|
143 |
<p>
|
144 |
<?php
|
@@ -153,8 +153,19 @@ class WpProQuiz_View_FrontQuiz extends WpProQuiz_View_View {
|
|
153 |
</p>
|
154 |
</div>
|
155 |
</div>
|
156 |
-
<
|
157 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
<input type="button" name="next" value="<?php _e('Next exercise', 'wp-pro-quiz'); ?>" class="wpProQuiz_QuestionButton" style="float: right;" >
|
159 |
<div style="clear: both;"></div>
|
160 |
</li>
|
33 |
}
|
34 |
|
35 |
public function show($preview = false) {
|
36 |
+
|
37 |
$question_count = count($this->question);
|
38 |
|
39 |
$json = json_encode($this->parseJson($this->question));
|
55 |
<div class="wpProQuiz_results">
|
56 |
<h3><?php _e('Results', 'wp-pro-quiz'); ?></h3>
|
57 |
<p>
|
58 |
+
<?php printf(__('%s of %s questions answered correctly', 'wp-pro-quiz'), '<span class="wpProQuiz_points"></span>', '<span>'.$question_count.'</span>'); ?> <span class="wpProQuiz_points_prozent">(0%)</span>
|
59 |
</p>
|
60 |
<p class="wpProQuiz_time_limit_expired">
|
61 |
<?php _e('Time has elapsed', 'wp-pro-quiz'); ?>
|
84 |
?>
|
85 |
<li class="wpProQuiz_listItem">
|
86 |
<div class="wpProQuiz_question_page">
|
87 |
+
<?php printf(__('Question %s of %s', 'wp-pro-quiz'), '<span>'.$index.'</span>', '<span>'.$question_count.'</span>'); ?>
|
88 |
</div>
|
89 |
<h3><span><?php echo $index; ?></span>. <?php _e('Question', 'wp-pro-quiz'); ?></h3>
|
90 |
<div class="wpProQuiz_question">
|
130 |
<div class="wpProQuiz_response">
|
131 |
<div class="wpProQuiz_correct">
|
132 |
<span>
|
133 |
+
<?php _e('Correct', 'wp-pro-quiz'); ?>
|
134 |
</span>
|
135 |
<p>
|
136 |
<?php echo do_shortcode(apply_filters('comment_text', $question->getCorrectMsg())); ?>
|
138 |
</div>
|
139 |
<div class="wpProQuiz_incorrect">
|
140 |
<span>
|
141 |
+
<?php _e('Incorrect', 'wp-pro-quiz'); ?>
|
142 |
</span>
|
143 |
<p>
|
144 |
<?php
|
153 |
</p>
|
154 |
</div>
|
155 |
</div>
|
156 |
+
<div class="wpProQuiz_tipp">
|
157 |
+
<h3><?php _e('Hint', 'wp-pro-quiz'); ?></h3>
|
158 |
+
<?php
|
159 |
+
if($question->isTipEnabled()) {
|
160 |
+
echo do_shortcode(apply_filters('comment_text', $question->getTipMsg()));
|
161 |
+
}
|
162 |
+
?>
|
163 |
+
</div>
|
164 |
+
<input type="button" name="check" value="<?php _e('Check', 'wp-pro-quiz'); ?>" class="wpProQuiz_QuestionButton" style="float: left; margin-right: 10px;">
|
165 |
+
<input type="button" name="back" value="<?php _e('Back', 'wp-pro-quiz'); ?>" class="wpProQuiz_QuestionButton" style="float: left; margin-right: 10px;">
|
166 |
+
<?php if($question->isTipEnabled()) { ?>
|
167 |
+
<input type="button" name="tip" value="<?php _e('Hint', 'wp-pro-quiz'); ?>" class="wpProQuiz_QuestionButton wpProQuiz_TipButton" style="float: left; display: inline-block;">
|
168 |
+
<?php } ?>
|
169 |
<input type="button" name="next" value="<?php _e('Next exercise', 'wp-pro-quiz'); ?>" class="wpProQuiz_QuestionButton" style="float: right;" >
|
170 |
<div style="clear: both;"></div>
|
171 |
</li>
|
lib/view/WpProQuiz_View_QuestionEdit.php
CHANGED
@@ -58,6 +58,25 @@ jQuery(document).ready(function($) {
|
|
58 |
?>
|
59 |
</div>
|
60 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
<div class="postbox">
|
62 |
<h3 class="hndle"><?php _e('Answer type', 'wp-pro-quiz'); ?></h3>
|
63 |
<div class="inside">
|
@@ -89,11 +108,11 @@ jQuery(document).ready(function($) {
|
|
89 |
<div class="free_answer">
|
90 |
<?php if($type === 'free_answer') { ?>
|
91 |
<p style="border-bottom:1px dotted #ccc;">
|
92 |
-
<textarea placeholder="
|
93 |
</p>
|
94 |
<?php } else { ?>
|
95 |
<p style="border-bottom:1px dotted #ccc;">
|
96 |
-
<textarea placeholder="<?php _e('
|
97 |
</p>
|
98 |
<?php } ?>
|
99 |
</div>
|
58 |
?>
|
59 |
</div>
|
60 |
</div>
|
61 |
+
<div class="postbox">
|
62 |
+
<h3 class="hndle"><?php _e('Hint', 'wp-pro-quiz'); ?> <?php _e('(optional)', 'wp-pro-quiz'); ?></h3>
|
63 |
+
<div class="inside">
|
64 |
+
<p class="description">
|
65 |
+
<?php _e('Here you can enter solution hint.', 'wp-pro-quiz'); ?>
|
66 |
+
</p>
|
67 |
+
<div style="padding-top: 10px; padding-bottom: 10px;">
|
68 |
+
<label for="wpProQuiz_tip">
|
69 |
+
<?php _e('Activate hint for this question?', 'wp-pro-quiz'); ?>
|
70 |
+
<input type="checkbox" name="tipEnabled" id="wpProQuiz_tip" value="1" <?php echo $this->question->isTipEnabled() ? 'checked="checked"' : '' ?>>
|
71 |
+
</label>
|
72 |
+
</div>
|
73 |
+
<div id="wpProQuiz_tipBox">
|
74 |
+
<?php
|
75 |
+
wp_editor($this->question->getTipMsg(), 'tipMsg', array('textarea_rows' => 3));
|
76 |
+
?>
|
77 |
+
</div>
|
78 |
+
</div>
|
79 |
+
</div>
|
80 |
<div class="postbox">
|
81 |
<h3 class="hndle"><?php _e('Answer type', 'wp-pro-quiz'); ?></h3>
|
82 |
<div class="inside">
|
108 |
<div class="free_answer">
|
109 |
<?php if($type === 'free_answer') { ?>
|
110 |
<p style="border-bottom:1px dotted #ccc;">
|
111 |
+
<textarea placeholder="<?php _e('correct answers (one per line) (answers will be converted to lower case)', 'wp-pro-quiz'); ?>" rows="6" cols="100" class="large-text" name="answerJson[free_answer][correct]"><?php echo $qa['free_answer']['correct']; ?></textarea>
|
112 |
</p>
|
113 |
<?php } else { ?>
|
114 |
<p style="border-bottom:1px dotted #ccc;">
|
115 |
+
<textarea placeholder="<?php _e('correct answers (one per line) (answers will be converted to lower case)', 'wp-pro-quiz'); ?>" rows="6" cols="100" class="large-text" name="answerJson[free_answer][correct]"></textarea>
|
116 |
</p>
|
117 |
<?php } ?>
|
118 |
</div>
|
lib/view/WpProQuiz_View_Statistics.php
CHANGED
@@ -19,6 +19,7 @@ class WpProQuiz_View_Statistics extends WpProQuiz_View_View {
|
|
19 |
<th scope="col"><?php _e('Question', 'wp-pro-quiz'); ?></th>
|
20 |
<th scope="col" style="width: 100px;"><?php _e('Incorrect', 'wp-pro-quiz'); ?></th>
|
21 |
<th scope="col" style="width: 100px;"><?php _e('Correct', 'wp-pro-quiz'); ?></th>
|
|
|
22 |
</tr>
|
23 |
</thead>
|
24 |
<tbody>
|
@@ -28,6 +29,7 @@ class WpProQuiz_View_Statistics extends WpProQuiz_View_View {
|
|
28 |
$gCount = 0;
|
29 |
$gIncorrectCount = 0;
|
30 |
$gCorrectCount = 0;
|
|
|
31 |
|
32 |
foreach($this->question as $question) {
|
33 |
$count = $question->getCorrectCount() + $question->getIncorrectCount();
|
@@ -37,12 +39,14 @@ class WpProQuiz_View_Statistics extends WpProQuiz_View_View {
|
|
37 |
$gCount += $count;
|
38 |
$gIncorrectCount += $question->getIncorrectCount();
|
39 |
$gCorrectCount += $question->getCorrectCount();
|
|
|
40 |
?>
|
41 |
<tr>
|
42 |
<th><?php echo $index++; ?></th>
|
43 |
<th><?php echo $question->getTitle(); ?></th>
|
44 |
<th style="color: red;"><?php echo $question->getIncorrectCount().' ('.round($incorrectP, 2).'%)'; ?></th>
|
45 |
<th style="color: green;"><?php echo $question->getCorrectCount().' ('.round($correctP, 2).'%)'; ?></th>
|
|
|
46 |
</tr>
|
47 |
<?php } ?>
|
48 |
</tbody>
|
@@ -55,6 +59,7 @@ class WpProQuiz_View_Statistics extends WpProQuiz_View_View {
|
|
55 |
<th><?php _e('Total', 'wp-pro-quiz'); ?></th>
|
56 |
<th style="color: red;"><?php echo $gIncorrectCount.' ('.round($gIncorrectP, 2).'%)'; ?></th>
|
57 |
<th style="color: green;"><?php echo $gCorrectCount.' ('.round($gCorrectP, 2).'%)'; ?></th>
|
|
|
58 |
</tfoot>
|
59 |
</table>
|
60 |
<p>
|
19 |
<th scope="col"><?php _e('Question', 'wp-pro-quiz'); ?></th>
|
20 |
<th scope="col" style="width: 100px;"><?php _e('Incorrect', 'wp-pro-quiz'); ?></th>
|
21 |
<th scope="col" style="width: 100px;"><?php _e('Correct', 'wp-pro-quiz'); ?></th>
|
22 |
+
<th scope="col" style="width: 100px;"><?php _e('Hints used', 'wp-pro-quiz'); ?></th>
|
23 |
</tr>
|
24 |
</thead>
|
25 |
<tbody>
|
29 |
$gCount = 0;
|
30 |
$gIncorrectCount = 0;
|
31 |
$gCorrectCount = 0;
|
32 |
+
$gTipCount = 0;
|
33 |
|
34 |
foreach($this->question as $question) {
|
35 |
$count = $question->getCorrectCount() + $question->getIncorrectCount();
|
39 |
$gCount += $count;
|
40 |
$gIncorrectCount += $question->getIncorrectCount();
|
41 |
$gCorrectCount += $question->getCorrectCount();
|
42 |
+
$gTipCount += $question->getTipCount();
|
43 |
?>
|
44 |
<tr>
|
45 |
<th><?php echo $index++; ?></th>
|
46 |
<th><?php echo $question->getTitle(); ?></th>
|
47 |
<th style="color: red;"><?php echo $question->getIncorrectCount().' ('.round($incorrectP, 2).'%)'; ?></th>
|
48 |
<th style="color: green;"><?php echo $question->getCorrectCount().' ('.round($correctP, 2).'%)'; ?></th>
|
49 |
+
<th><?php echo $question->getTipCount(); ?></th>
|
50 |
</tr>
|
51 |
<?php } ?>
|
52 |
</tbody>
|
59 |
<th><?php _e('Total', 'wp-pro-quiz'); ?></th>
|
60 |
<th style="color: red;"><?php echo $gIncorrectCount.' ('.round($gIncorrectP, 2).'%)'; ?></th>
|
61 |
<th style="color: green;"><?php echo $gCorrectCount.' ('.round($gCorrectP, 2).'%)'; ?></th>
|
62 |
+
<th><?php echo $gTipCount; ?></th>
|
63 |
</tfoot>
|
64 |
</table>
|
65 |
<p>
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: xeno010
|
|
3 |
Tags: quiz
|
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 |
|
@@ -26,9 +26,10 @@ A powerful and beautiful quiz plugin for WordPress.
|
|
26 |
* Back-Button (optional)
|
27 |
* Correct / incorrect response message for all questions (optional)
|
28 |
* Preview-function
|
29 |
-
*
|
30 |
-
*
|
31 |
-
*
|
|
|
32 |
|
33 |
= Translations =
|
34 |
* English (Thanks Alexander M.)
|
@@ -66,4 +67,9 @@ http://www.it-gecko.de/wp-pro-quiz-quiz-plugin-fuer-wordpress.html (scroll to "D
|
|
66 |
* small changes
|
67 |
|
68 |
= 0.3 =
|
69 |
-
* added version number for js and css
|
|
|
|
|
|
|
|
|
|
3 |
Tags: quiz
|
4 |
Requires at least: 3.3
|
5 |
Tested up to: 3.4.2
|
6 |
+
Stable tag: 0.4
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
26 |
* Back-Button (optional)
|
27 |
* Correct / incorrect response message for all questions (optional)
|
28 |
* Preview-function
|
29 |
+
* Statistics
|
30 |
+
* Hints
|
31 |
+
* Really nice standard design
|
32 |
+
* Mighty
|
33 |
|
34 |
= Translations =
|
35 |
* English (Thanks Alexander M.)
|
67 |
* small changes
|
68 |
|
69 |
= 0.3 =
|
70 |
+
* added version number for js and css
|
71 |
+
|
72 |
+
= 0.4 =
|
73 |
+
* added hint support
|
74 |
+
* bug in sort choice were fixed
|
75 |
+
* mistranslations were fixed
|
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.4
|
7 |
Author: Julius Fischer
|
8 |
Author URI: http://www.it-gecko.de
|
9 |
*/
|
10 |
|
11 |
+
define('WPPROQUIZ_VERSION', '0.4');
|
12 |
|
13 |
include_once 'lib/controller/WpProQuiz_Controller_Admin.php';
|
14 |
include_once 'lib/helper/WpProQuiz_Helper_DbUpgrade.php';
|