Version Description
- For every question you can now individually be determined
- Cloze answer type added
- Import / export function added
Download this release
Release Info
Developer | xeno010 |
Plugin | Wp-Pro-Quiz |
Version | 0.6 |
Comparing to | |
See all releases |
Code changes from version 0.5 to 0.6
- css/wpProQuiz_front.css +28 -10
- css/wpProQuiz_front.min.css +1 -1
- js/wpProQuiz_admin.js +101 -0
- js/wpProQuiz_admin.min.js +18 -14
- js/wpProQuiz_front.js +79 -10
- js/wpProQuiz_front.min.js +18 -17
- languages/wp-pro-quiz-de_DE.mo +0 -0
- languages/wp-pro-quiz-de_DE.po +277 -147
- lib/controller/WpProQuiz_Controller_Admin.php +6 -1
- lib/controller/WpProQuiz_Controller_ImportExport.php +75 -0
- lib/controller/WpProQuiz_Controller_Question.php +15 -13
- lib/helper/WpProQuiz_Helper_DbUpgrade.php +22 -1
- lib/helper/WpProQuiz_Helper_Export.php +48 -0
- lib/helper/WpProQuiz_Helper_Import.php +135 -0
- lib/model/WpProQuiz_Model_Mapper.php +10 -0
- lib/model/WpProQuiz_Model_Question.php +11 -0
- lib/model/WpProQuiz_Model_QuestionMapper.php +4 -2
- lib/model/WpProQuiz_Model_Quiz.php +22 -0
- lib/model/WpProQuiz_Model_QuizMapper.php +24 -6
- lib/view/WpProQuiz_View_FrontQuiz.php +28 -7
- lib/view/WpProQuiz_View_Import.php +74 -0
- lib/view/WpProQuiz_View_QuestionEdit.php +22 -0
- lib/view/WpProQuiz_View_QuizEdit.php +22 -1
- lib/view/WpProQuiz_View_QuizOverall.php +55 -1
- readme.txt +10 -2
- wp-pro-quiz.php +2 -2
css/wpProQuiz_front.css
CHANGED
@@ -1,3 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
.wpProQuiz_content {
|
2 |
margin-top: 10px;
|
3 |
margin-bottom: 10px;
|
@@ -69,18 +78,9 @@
|
|
69 |
.wpProQuiz_response span {
|
70 |
font-weight: bold;
|
71 |
}
|
72 |
-
.wpProQuiz_quiz, .wpProQuiz_correct, .wpProQuiz_incorrect, .wpProQuiz_results, .wpProQuiz_time_limit, .wpProQuiz_QuestionButton {
|
73 |
display: none;
|
74 |
}
|
75 |
-
.wpProQuiz_answerCorrect {
|
76 |
-
background: #6DB46D;
|
77 |
-
font-weight: bold;
|
78 |
-
}
|
79 |
-
|
80 |
-
.wpProQuiz_answerIncorrect {
|
81 |
-
background: #FF9191;
|
82 |
-
font-weight: bold;
|
83 |
-
}
|
84 |
.wpProQuiz_sort {
|
85 |
width: 25px;
|
86 |
}
|
@@ -173,4 +173,22 @@
|
|
173 |
}
|
174 |
.wpProQuiz_resultsList > li {
|
175 |
display: none;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
}
|
1 |
+
.wpProQuiz_answerCorrect {
|
2 |
+
background: #6DB46D;
|
3 |
+
font-weight: bold;
|
4 |
+
}
|
5 |
+
|
6 |
+
.wpProQuiz_answerIncorrect {
|
7 |
+
background: #FF9191;
|
8 |
+
font-weight: bold;
|
9 |
+
}
|
10 |
.wpProQuiz_content {
|
11 |
margin-top: 10px;
|
12 |
margin-bottom: 10px;
|
78 |
.wpProQuiz_response span {
|
79 |
font-weight: bold;
|
80 |
}
|
81 |
+
.wpProQuiz_quiz, .wpProQuiz_correct, .wpProQuiz_incorrect, .wpProQuiz_results, .wpProQuiz_time_limit, .wpProQuiz_QuestionButton, .wpProQuiz_clozeCorrect {
|
82 |
display: none;
|
83 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
.wpProQuiz_sort {
|
85 |
width: 25px;
|
86 |
}
|
173 |
}
|
174 |
.wpProQuiz_resultsList > li {
|
175 |
display: none;
|
176 |
+
}
|
177 |
+
.wpProQuiz_points {
|
178 |
+
font-weight: bold;
|
179 |
+
text-align: center;
|
180 |
+
margin-bottom: 20px;
|
181 |
+
}
|
182 |
+
.wpProQuiz_cloze input {
|
183 |
+
background: transparent;
|
184 |
+
border: 0;
|
185 |
+
border-bottom: 1px solid;
|
186 |
+
height: 18px;
|
187 |
+
margin: 0;
|
188 |
+
padding: 0 4px 0 4px;
|
189 |
+
color: black;
|
190 |
+
border-radius: 0;
|
191 |
+
}
|
192 |
+
.wpProQuiz_cloze input:focus {
|
193 |
+
outline: none;
|
194 |
}
|
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],.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 > table{border-collapse:collapse;width:100%;}.wpProQuiz_questionListItem:last-child{padding:3px;margin-bottom:0;}.wpProQuiz_list,wpProQuiz_listItem,.wpProQuiz_questionList,.wpProQuiz_sortStringList,.wpProQuiz_sortStringList,.wpProQuiz_maxtrixSortCriterion,.wpProQuiz_resultsList{list-style:none;padding:0;margin:0;}.wpProQuiz_questionList{margin-bottom:10px;background:#F8FAF5;border:1px solid #C3D1A3;padding:5px;list-style:none;}.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;}.
|
1 |
+
.wpProQuiz_answerCorrect{background:#6DB46D;font-weight:700;}.wpProQuiz_answerIncorrect{background:#FF9191;font-weight:700;}.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 > table{border-collapse:collapse;width:100%;}.wpProQuiz_questionListItem:last-child{padding:3px;margin-bottom:0;}.wpProQuiz_list,wpProQuiz_listItem,.wpProQuiz_questionList,.wpProQuiz_sortStringList,.wpProQuiz_sortStringList,.wpProQuiz_maxtrixSortCriterion,.wpProQuiz_resultsList{list-style:none;padding:0;margin:0;}.wpProQuiz_questionList{margin-bottom:10px;background:#F8FAF5;border:1px solid #C3D1A3;padding:5px;list-style:none;}.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,.wpProQuiz_clozeCorrect{display:none;}.wpProQuiz_sort{width:25px;}.wpProQuiz_results h3{margin-bottom:10px;}.wpProQuiz_sort_correct_answer{font-weight:700;margin-right:5px;display:none;}.wpProQuiz_sortable,.wpProQuiz_sortStringItem{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;}.wpProQuiz_matrixSortString,.wpProQuiz_matrixSortString > h3{margin-bottom:10px;margin-top:0;}.wpProQuiz_matrixSortString{background:#F8FAF5;border:1px solid #C3D1A3;padding:5px;}.wpProQuiz_sortStringList{padding:10px;}.wpProQuiz_sortStringList > li{float:left;margin-left:5px;margin-right:5px;margin-bottom:5px;}.wpProQuiz_sortStringItem{margin:0;}.wpProQuiz_maxtrixSortCriterion{padding:10px;}.wpProQuiz_placehold{background-color:#FFFFC2;padding:5px;height:30px;min-width:50px;}.wpProQuiz_maxtrixSortText{padding:5px;}.wpProQuiz_mextrixTr > td{border:1px solid #D1D1D1;padding:5px;vertical-align:middle;}.wpProQuiz_resultsList > li{display:none;}.wpProQuiz_points{font-weight:700;text-align:center;margin-bottom:20px;}.wpProQuiz_cloze input{background:transparent;border:0;border-bottom:1px solid;height:18px;margin:0;padding:0 4px;color:#000;border-radius:0;}.wpProQuiz_cloze input:focus{outline:none;}
|
js/wpProQuiz_admin.js
CHANGED
@@ -17,6 +17,48 @@ jQuery(document).ready(function($) {
|
|
17 |
};
|
18 |
|
19 |
$.fn.wpProQuiz_quizOverall = function() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
var init = function() {
|
21 |
$('.wpProQuiz_delete').click(function(e) {
|
22 |
var b = confirm(wpProQuizLocalize.delete_msg);
|
@@ -28,6 +70,43 @@ jQuery(document).ready(function($) {
|
|
28 |
|
29 |
return true;
|
30 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
};
|
32 |
|
33 |
init();
|
@@ -66,6 +145,9 @@ jQuery(document).ready(function($) {
|
|
66 |
case 'matrix_sort_answer':
|
67 |
formListener.displayMatrixSortAnswer();
|
68 |
break;
|
|
|
|
|
|
|
69 |
}
|
70 |
});
|
71 |
|
@@ -123,6 +205,10 @@ jQuery(document).ready(function($) {
|
|
123 |
displayMatrixSortAnswer: function() {
|
124 |
$('.matrix_sort_answer').show();
|
125 |
},
|
|
|
|
|
|
|
|
|
126 |
|
127 |
addAnswer: function(obj) {
|
128 |
$(obj).siblings('ul').children().first()
|
@@ -163,11 +249,19 @@ jQuery(document).ready(function($) {
|
|
163 |
var validate = function () {
|
164 |
var question = tinymce.editors.question.getContent();
|
165 |
var type = $('input[name="answerType"]:checked');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
|
167 |
if(isEmpty(question)) {
|
168 |
alert(wpProQuizLocalize.no_question_msg);
|
169 |
return false;
|
170 |
}
|
|
|
171 |
|
172 |
if(type.val() == 'single' || type.val() == 'multiple') {
|
173 |
var findChecked = true;
|
@@ -221,6 +315,13 @@ jQuery(document).ready(function($) {
|
|
221 |
alert(wpProQuizLocalize.no_answer_msg);
|
222 |
return false;
|
223 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
224 |
}
|
225 |
|
226 |
return true;
|
17 |
};
|
18 |
|
19 |
$.fn.wpProQuiz_quizOverall = function() {
|
20 |
+
|
21 |
+
var methods = {
|
22 |
+
changeExport: function(input) {
|
23 |
+
$input = $(input);
|
24 |
+
$export = $('.wpProQuiz_exportList');
|
25 |
+
$ul = $export.find('ul').first();
|
26 |
+
$export.find('li').remove();
|
27 |
+
|
28 |
+
$('input[name="exportItems"]').each(function() {
|
29 |
+
$this = $(this);
|
30 |
+
|
31 |
+
if(this.checked) {
|
32 |
+
var text = $this.parent().parent().find('.wpProQuiz_quizName').text();
|
33 |
+
$('<li>' + text + '</li>').appendTo($ul);
|
34 |
+
}
|
35 |
+
});
|
36 |
+
},
|
37 |
+
|
38 |
+
startExport: function() {
|
39 |
+
$ele = $('input[name="exportItems"]:checked');
|
40 |
+
|
41 |
+
if($ele.length < 1) {
|
42 |
+
alert(wpProQuizLocalize.no_selected_quiz);
|
43 |
+
return false;
|
44 |
+
}
|
45 |
+
|
46 |
+
$hidden = $('#exportHidden');
|
47 |
+
|
48 |
+
$hidden.html('');
|
49 |
+
|
50 |
+
$('input[name="exportItems"]').each(function() {
|
51 |
+
$this = $(this);
|
52 |
+
|
53 |
+
if(this.checked) {
|
54 |
+
$('<input type="hidden" value="'+ this.value +'" name="exportIds[]">').appendTo($hidden);
|
55 |
+
}
|
56 |
+
});
|
57 |
+
|
58 |
+
return true;
|
59 |
+
}
|
60 |
+
};
|
61 |
+
|
62 |
var init = function() {
|
63 |
$('.wpProQuiz_delete').click(function(e) {
|
64 |
var b = confirm(wpProQuizLocalize.delete_msg);
|
70 |
|
71 |
return true;
|
72 |
});
|
73 |
+
|
74 |
+
$('.wpProQuiz_import').click(function(e) {
|
75 |
+
e.preventDefault();
|
76 |
+
$('.wpProQuiz_importList').toggle('fast');
|
77 |
+
|
78 |
+
$('.wpProQuiz_exportList').hide();
|
79 |
+
$('.wpProQuiz_exportCheck').hide();
|
80 |
+
|
81 |
+
});
|
82 |
+
|
83 |
+
$('.wpProQuiz_export').click(function(e) {
|
84 |
+
e.preventDefault();
|
85 |
+
|
86 |
+
$('.wpProQuiz_exportList').toggle('fast');
|
87 |
+
$('.wpProQuiz_exportCheck').toggle('fast');
|
88 |
+
$('.wpProQuiz_importList').hide();
|
89 |
+
});
|
90 |
+
|
91 |
+
$('input[name="exportItems"]').change(function() {
|
92 |
+
methods.changeExport(this);
|
93 |
+
});
|
94 |
+
|
95 |
+
$('input[name="exportItemsAll"]').change(function() {
|
96 |
+
var $input = $('input[name="exportItems"]');
|
97 |
+
if(this.checked)
|
98 |
+
$input.attr('checked', true);
|
99 |
+
else
|
100 |
+
$input.attr('checked', false);
|
101 |
+
|
102 |
+
$input.change();
|
103 |
+
});
|
104 |
+
|
105 |
+
$('#exportStart').click(function(e) {
|
106 |
+
|
107 |
+
if(!methods.startExport())
|
108 |
+
e.preventDefault();
|
109 |
+
});
|
110 |
};
|
111 |
|
112 |
init();
|
145 |
case 'matrix_sort_answer':
|
146 |
formListener.displayMatrixSortAnswer();
|
147 |
break;
|
148 |
+
case 'cloze_answer':
|
149 |
+
formListener.displayClozeAnswer();
|
150 |
+
break;
|
151 |
}
|
152 |
});
|
153 |
|
205 |
displayMatrixSortAnswer: function() {
|
206 |
$('.matrix_sort_answer').show();
|
207 |
},
|
208 |
+
|
209 |
+
displayClozeAnswer: function() {
|
210 |
+
$('.cloze_answer').show();
|
211 |
+
},
|
212 |
|
213 |
addAnswer: function(obj) {
|
214 |
$(obj).siblings('ul').children().first()
|
249 |
var validate = function () {
|
250 |
var question = tinymce.editors.question.getContent();
|
251 |
var type = $('input[name="answerType"]:checked');
|
252 |
+
var $points = $('input[name="points"]');
|
253 |
+
|
254 |
+
if(isNaN($points.val()) || $points.val() < 1) {
|
255 |
+
alert(wpProQuizLocalize.no_nummber_points);
|
256 |
+
$points.focus();
|
257 |
+
return false;
|
258 |
+
}
|
259 |
|
260 |
if(isEmpty(question)) {
|
261 |
alert(wpProQuizLocalize.no_question_msg);
|
262 |
return false;
|
263 |
}
|
264 |
+
|
265 |
|
266 |
if(type.val() == 'single' || type.val() == 'multiple') {
|
267 |
var findChecked = true;
|
315 |
alert(wpProQuizLocalize.no_answer_msg);
|
316 |
return false;
|
317 |
}
|
318 |
+
} else if(type.val() == 'cloze_answer') {
|
319 |
+
var clozeText = tinymce.editors.cloze.getContent();
|
320 |
+
|
321 |
+
if(isEmpty(clozeText)) {
|
322 |
+
alert(wpProQuizLocalize.no_answer_msg);
|
323 |
+
return false;
|
324 |
+
}
|
325 |
}
|
326 |
|
327 |
return true;
|
js/wpProQuiz_admin.min.js
CHANGED
@@ -1,14 +1,18 @@
|
|
1 |
-
jQuery(document).ready(function(a){a.fn.wpProQuiz_preview=function(){var c={openPreview:function(
|
2 |
-
|
3 |
-
|
4 |
-
a("
|
5 |
-
c.
|
6 |
-
|
7 |
-
|
8 |
-
a('input[name="
|
9 |
-
|
10 |
-
a(this).
|
11 |
-
|
12 |
-
|
13 |
-
a
|
14 |
-
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function(a){a.fn.wpProQuiz_preview=function(){var c={openPreview:function(d){window.open(a(d).attr("href"),"wpProQuizPreview","width=900,height=900")}};a(".wpProQuiz_prview").click(function(a){c.openPreview(this);a.preventDefault()})};a.fn.wpProQuiz_quizOverall=function(){var c={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 b=
|
2 |
+
$this.parent().parent().find(".wpProQuiz_quizName").text();a("<li>"+b+"</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(c){c.preventDefault();a(".wpProQuiz_importList").toggle("fast");a(".wpProQuiz_exportList").hide();a(".wpProQuiz_exportCheck").hide()});a(".wpProQuiz_export").click(function(c){c.preventDefault();a(".wpProQuiz_exportList").toggle("fast");a(".wpProQuiz_exportCheck").toggle("fast");a(".wpProQuiz_importList").hide()});a('input[name="exportItems"]').change(function(){c.changeExport(this)});a('input[name="exportItemsAll"]').change(function(){var c=
|
4 |
+
a('input[name="exportItems"]');this.checked?c.attr("checked",!0):c.attr("checked",!1);c.change()});a("#exportStart").click(function(a){c.startExport()||a.preventDefault()})};a.fn.wpProQuiz_questionEdit=function(){var c={setup:function(){a('input[name="answerType"]').click(function(){a(".answer_felder").children().css("display","none");switch(this.value){case "single":c.displaySingle("radio");break;case "multiple":c.displaySingle("checkbox");break;case "free_answer":c.displayFreeAnswer();break;case "sort_answer":c.displaySortAnswer();
|
5 |
+
break;case "matrix_sort_answer":c.displayMatrixSortAnswer();break;case "cloze_answer":c.displayClozeAnswer()}});a(".addAnswer").click(function(){c.addAnswer(this)});a(".deleteAnswer").click(function(){c.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(){c.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(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",
|
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(b){a(b).siblings("ul").children().first().clone().css("display","block").appendTo(a(b).siblings("ul"));c.setValueClassicAnswer();a(".deleteAnswer").click(function(){c.deleteAnswer(this)})},deleteAnswer:function(b){a(b).parent("li").remove();c.setValueClassicAnswer()},setValueClassicAnswer:function(){var b=
|
8 |
+
0;a('input[name="answerJson[classic_answer][correct][]"]').each(function(){this.value=b++});b=0;a('input[name="answerJson[answer_matrix_sort][sort_string_html][]"]').each(function(){this.value=b++});b=0;a('input[name="answerJson[answer_matrix_sort][answer_html][]"]').each(function(){this.value=b++})}},d=function(){var c=tinymce.editors.question.getContent(),d=a('input[name="answerType"]:checked'),f=a('input[name="points"]');if(isNaN(f.val())||1>f.val())return alert(wpProQuizLocalize.no_nummber_points),
|
9 |
+
f.focus(),!1;if(b(c))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),!1}else if("sort_answer"==d.val()){if(e=!1,a('textarea[name="answerJson[answer_sort][answer][]"]').each(function(){e=
|
10 |
+
b(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(b(a(this).val()))e|=0;else{var c=a(this).parent().parent().find('textarea[name="answerJson[answer_matrix_sort][sort_string][]"]');e=b(c.val())?e|0:!0}}),!e)return alert(wpProQuizLocalize.no_answer_msg),!1}else if("cloze_answer"==d.val()&&(c=tinymce.editors.cloze.getContent(),b(c)))return alert(wpProQuizLocalize.no_answer_msg),
|
11 |
+
!1;return!0},b=function(b){b=a.trim(b);return!b||0===b.length};c.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 c={saveSort:function(){var d={action:"wp_pro_quiz_update_sort",sort:c.parseSortArray()},b=(window.location.pathname+window.location.search).replace("admin.php",
|
12 |
+
"admin-ajax.php")+"&action=save_sort";a.post(b,d,function(b){console.debug(b);a("#sortMsg").show(400).delay(1E3).hide(400)})},parseSortArray:function(){var c=[];a("tbody tr").each(function(){c.push(this.id.replace("wpProQuiz_questionId_",""))});return c},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:c.sortUpdate});a(".wpProQuiz_delete").click(function(a){return!confirm(wpProQuizLocalize.delete_msg)?
|
13 |
+
(a.preventDefault(),!1):!0});a("#wpProQuiz_saveSort").click(function(a){a.preventDefault();c.saveSort()});console.debug(a)};a.fn.wpProQuiz_quizEdit=function(){var c={addResult:function(){a("#resultList").children().each(function(){if("none"==a(this).css("display")){var b=a(this),c=b.find('textarea[name="resultTextGrade[text][]"]').attr("id");b.find('input[name="resultTextGrade[prozent][]"]').val("0");b.find('input[name="resultTextGrade[activ][]"]').val("1").keyup();tinymce.editors[c].setContent("");
|
14 |
+
tinyMCE.execCommand("mceRemoveControl",!1,c);b.parent().children(":visible").last().after(b);tinyMCE.execCommand("mceAddControl",!1,c);a(this).show();return!1}})},deleteResult:function(b){a(b).parent().parent().hide();a(b).siblings('input[name="resultTextGrade[activ][]"]').val("0")},changeResult:function(b){b=a(b);if(c.validResultInput(b.val()))return b.siblings(".resultProzent").text(b.val()),b.removeAttr("style"),!0;b.css("background-color","#FF9696");return!1},validResultInput:function(a){if(d(a))return!1;
|
15 |
+
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;if(d(tinymce.editors.text.getContent()))return alert(wpProQuizLocalize.no_quiz_start_msg),!1;if(a("#wpProQuiz_resultGradeEnabled:checked").length){var b=!0;console.debug("hier");a("#resultList").children().each(function(){if(a(this).is(":visible")&&!c.validResultInput(a(this).find('input[name="resultTextGrade[prozent][]"]').val()))return b=
|
16 |
+
!1});if(!b)return alert(wpProQuizLocalize.fail_grade_result),!1}return!0}},d=function(b){b=a.trim(b);return!b||0===b.length};a("#statistics_on").change(function(){this.checked?a("#statistics_ip_lock_tr").show():a("#statistics_ip_lock_tr").hide()});a(".addResult").click(function(){c.addResult()});a(".deleteResult").click(function(){c.deleteResult(this)});a('input[name="resultTextGrade[prozent][]"]').keyup(function(){c.changeResult(this)}).keydown(function(a){13==a.which&&a.preventDefault()});a("#wpProQuiz_resultGradeEnabled").change(function(){this.checked?
|
17 |
+
(a("#resultGrade").show(),a("#resultNormal").hide()):(a("#resultGrade").hide(),a("#resultNormal").show())});a("#wpProQuiz_save").click(function(a){c.validInput()||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();
|
18 |
+
a(".wpProQuiz_questionEdit").length&&a(".wpProQuiz_questionEdit").wpProQuiz_questionEdit();a(".wpProQuiz_questionOverall").length&&a(".wpProQuiz_questionOverall").wpProQuiz_questionOverall()});
|
js/wpProQuiz_front.js
CHANGED
@@ -3,11 +3,13 @@
|
|
3 |
var $element = $(element);
|
4 |
var config = options;
|
5 |
var plugin = this;
|
6 |
-
var
|
7 |
-
var
|
8 |
var intervalId = 0;
|
9 |
var startTime = 0;
|
10 |
var statistics = new Object();
|
|
|
|
|
11 |
|
12 |
plugin.methode = {
|
13 |
startQuiz: function() {
|
@@ -28,6 +30,7 @@
|
|
28 |
plugin.methode.setTimeLimit();
|
29 |
}
|
30 |
|
|
|
31 |
points = 0;
|
32 |
|
33 |
startTime = new Date();
|
@@ -66,6 +69,8 @@
|
|
66 |
$element.find('input[name="question"]').removeAttr('disabled').removeAttr('checked');
|
67 |
$element.find('input[name="question"][type="text"]').removeAttr('value');
|
68 |
$element.find('.wpProQuiz_resultsList').children().hide();
|
|
|
|
|
69 |
|
70 |
plugin.methode.resetMatrix();
|
71 |
},
|
@@ -126,7 +131,14 @@
|
|
126 |
$element.find('.wpProQuiz_questionList').each(function() {
|
127 |
var j = config.json[i];
|
128 |
var ii = 0;
|
129 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
$(this).find('input[name="question"]').each(function() {
|
131 |
switch(j.answer_type) {
|
132 |
case 'single':
|
@@ -252,6 +264,32 @@
|
|
252 |
|
253 |
$question.find('.wpProQuiz_sortStringList, .wpProQuiz_maxtrixSortCriterion').sortable("destroy");
|
254 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
255 |
correct = check;
|
256 |
}
|
257 |
|
@@ -268,7 +306,8 @@
|
|
268 |
|
269 |
if(correct) {
|
270 |
$question.find('.wpProQuiz_correct').show();
|
271 |
-
|
|
|
272 |
} else {
|
273 |
$question.find('.wpProQuiz_incorrect').show();
|
274 |
}
|
@@ -305,14 +344,21 @@
|
|
305 |
showResult: function() {
|
306 |
clearInterval(intervalId);
|
307 |
|
|
|
|
|
308 |
$element.find('.wpProQuiz_time_limit .progress').clearQueue().stop();
|
309 |
-
$element.find('.
|
310 |
-
$element.find('.wpProQuiz_points_prozent').html('(' + Math.round(points / count * 100) + '%)');
|
311 |
$element.find('.wpProQuiz_results').show();
|
312 |
$element.find('.wpProQuiz_time_limit').hide();
|
313 |
plugin.methode.setQuizTime();
|
314 |
|
315 |
-
var
|
|
|
|
|
|
|
|
|
|
|
|
|
316 |
|
317 |
if(index > -1) {
|
318 |
$element.find('.wpProQuiz_resultsList').children().eq(index).show();
|
@@ -394,11 +440,31 @@
|
|
394 |
statistics[$par.data('questionId')].tip = 1;
|
395 |
|
396 |
$tip.toggle('fast');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
397 |
}
|
398 |
};
|
399 |
|
400 |
plugin.init = function() {
|
401 |
-
|
402 |
|
403 |
if(config.resultsGrade == undefined)
|
404 |
config.resultsGrade = [0];
|
@@ -409,9 +475,11 @@
|
|
409 |
|
410 |
li.hide();
|
411 |
|
412 |
-
|
413 |
|
414 |
plugin.methode.setData();
|
|
|
|
|
415 |
|
416 |
$element.find('input[name="startQuiz"]').click(function(e) {
|
417 |
e.preventDefault();
|
@@ -458,7 +526,7 @@
|
|
458 |
|
459 |
plugin.init();
|
460 |
};
|
461 |
-
|
462 |
$.fn.wpProQuizFront = function(options) {
|
463 |
return this.each(function() {
|
464 |
if(undefined == $(this).data('wpProQuizFront')) {
|
@@ -466,4 +534,5 @@
|
|
466 |
}
|
467 |
});
|
468 |
};
|
|
|
469 |
})(jQuery);
|
3 |
var $element = $(element);
|
4 |
var config = options;
|
5 |
var plugin = this;
|
6 |
+
var correctAnswer = 0;
|
7 |
+
var countAnswer = 0;
|
8 |
var intervalId = 0;
|
9 |
var startTime = 0;
|
10 |
var statistics = new Object();
|
11 |
+
var points = 0;
|
12 |
+
var pointsTotal = 0;
|
13 |
|
14 |
plugin.methode = {
|
15 |
startQuiz: function() {
|
30 |
plugin.methode.setTimeLimit();
|
31 |
}
|
32 |
|
33 |
+
correctAnswer = 0;
|
34 |
points = 0;
|
35 |
|
36 |
startTime = new Date();
|
69 |
$element.find('input[name="question"]').removeAttr('disabled').removeAttr('checked');
|
70 |
$element.find('input[name="question"][type="text"]').removeAttr('value');
|
71 |
$element.find('.wpProQuiz_resultsList').children().hide();
|
72 |
+
$element.find('.wpProQuiz_cloze input').removeAttr('disabled').removeAttr('value').css('background-color', '');
|
73 |
+
$element.find('.wpProQuiz_cloze span').hide();
|
74 |
|
75 |
plugin.methode.resetMatrix();
|
76 |
},
|
131 |
$element.find('.wpProQuiz_questionList').each(function() {
|
132 |
var j = config.json[i];
|
133 |
var ii = 0;
|
134 |
+
|
135 |
+
pointsTotal += j.points;
|
136 |
+
|
137 |
+
$(this).parent().parent()
|
138 |
+
.data('type', j.answer_type)
|
139 |
+
.data('questionId', j.id)
|
140 |
+
.data('points', j.points);
|
141 |
+
|
142 |
$(this).find('input[name="question"]').each(function() {
|
143 |
switch(j.answer_type) {
|
144 |
case 'single':
|
264 |
|
265 |
$question.find('.wpProQuiz_sortStringList, .wpProQuiz_maxtrixSortCriterion').sortable("destroy");
|
266 |
|
267 |
+
correct = check;
|
268 |
+
} else if(type == 'cloze_answer') {
|
269 |
+
var check = true;
|
270 |
+
|
271 |
+
$question.find('.wpProQuiz_cloze').each(function() {
|
272 |
+
var $this = $(this);
|
273 |
+
var children = $this.children();
|
274 |
+
var input = children.first();
|
275 |
+
var iText = input.val().toLowerCase();
|
276 |
+
var cloze = children.last().text().toLowerCase();
|
277 |
+
|
278 |
+
cloze = cloze.substr(1, cloze.length-2);
|
279 |
+
|
280 |
+
if($.trim(cloze) == $.trim(iText)) {
|
281 |
+
check &= true;
|
282 |
+
input.css('background-color', '#B0DAB0');
|
283 |
+
} else {
|
284 |
+
check = false;
|
285 |
+
input.css('background-color', '#FFBABA');
|
286 |
+
children.last().show();
|
287 |
+
}
|
288 |
+
|
289 |
+
input.attr('disabled', 'disabled');
|
290 |
+
|
291 |
+
});
|
292 |
+
|
293 |
correct = check;
|
294 |
}
|
295 |
|
306 |
|
307 |
if(correct) {
|
308 |
$question.find('.wpProQuiz_correct').show();
|
309 |
+
correctAnswer++;
|
310 |
+
points += $question.data('points');
|
311 |
} else {
|
312 |
$question.find('.wpProQuiz_incorrect').show();
|
313 |
}
|
344 |
showResult: function() {
|
345 |
clearInterval(intervalId);
|
346 |
|
347 |
+
var $pointsSpan = $element.find('.wpProQuiz_points span');
|
348 |
+
|
349 |
$element.find('.wpProQuiz_time_limit .progress').clearQueue().stop();
|
350 |
+
$element.find('.wpProQuiz_correct_answer').html(correctAnswer);
|
|
|
351 |
$element.find('.wpProQuiz_results').show();
|
352 |
$element.find('.wpProQuiz_time_limit').hide();
|
353 |
plugin.methode.setQuizTime();
|
354 |
|
355 |
+
var pointsProzent = Math.round(points / pointsTotal * 100 * 100) / 100;
|
356 |
+
|
357 |
+
$pointsSpan.eq(0).text(points);
|
358 |
+
$pointsSpan.eq(1).text(pointsTotal);
|
359 |
+
$pointsSpan.eq(2).text(pointsProzent);
|
360 |
+
|
361 |
+
var index = plugin.methode.findResultIndex(pointsProzent);
|
362 |
|
363 |
if(index > -1) {
|
364 |
$element.find('.wpProQuiz_resultsList').children().eq(index).show();
|
440 |
statistics[$par.data('questionId')].tip = 1;
|
441 |
|
442 |
$tip.toggle('fast');
|
443 |
+
},
|
444 |
+
|
445 |
+
setClozeStyle: function() {
|
446 |
+
$element.find('.wpProQuiz_cloze').each(function() {
|
447 |
+
var $this = $(this);
|
448 |
+
var children = $this.children();
|
449 |
+
var input = children.first();
|
450 |
+
var cloze = children.last();
|
451 |
+
var clone = cloze.clone();
|
452 |
+
|
453 |
+
clone.css('visibility', 'hidden');
|
454 |
+
|
455 |
+
$('body').append(clone);
|
456 |
+
|
457 |
+
var width = clone.width();
|
458 |
+
|
459 |
+
clone.remove();
|
460 |
+
|
461 |
+
input.width(width + 10);
|
462 |
+
});
|
463 |
}
|
464 |
};
|
465 |
|
466 |
plugin.init = function() {
|
467 |
+
correctAnswer = 0;
|
468 |
|
469 |
if(config.resultsGrade == undefined)
|
470 |
config.resultsGrade = [0];
|
475 |
|
476 |
li.hide();
|
477 |
|
478 |
+
countAnswer = li.length;
|
479 |
|
480 |
plugin.methode.setData();
|
481 |
+
|
482 |
+
plugin.methode.setClozeStyle();
|
483 |
|
484 |
$element.find('input[name="startQuiz"]').click(function(e) {
|
485 |
e.preventDefault();
|
526 |
|
527 |
plugin.init();
|
528 |
};
|
529 |
+
|
530 |
$.fn.wpProQuizFront = function(options) {
|
531 |
return this.each(function() {
|
532 |
if(undefined == $(this).data('wpProQuizFront')) {
|
534 |
}
|
535 |
});
|
536 |
};
|
537 |
+
|
538 |
})(jQuery);
|
js/wpProQuiz_front.min.js
CHANGED
@@ -1,17 +1,18 @@
|
|
1 |
-
(function(
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
"100%").animate({width:"0%"},1E3*f.timeLimit);h=setInterval(function(){
|
6 |
-
|
7 |
-
c.correct)}});
|
8 |
-
g=this.checked?g&1:g&0):this.checked&&(
|
9 |
-
|
10 |
-
c.children().first().data("correct")==a?(g&=1,
|
11 |
-
|
12 |
-
|
13 |
-
b
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
|
1 |
+
(function(c){c.wpProQuizFront=function(m,f){var b=c(m),e=this,l=0,h=0,n=0,i={},k=0,j=0;e.methode={startQuiz:function(){i={};f.questionRandom&&e.methode.questionRandom();f.answerRandom?e.methode.answerRandom(".wpProQuiz_questionList"):e.methode.answerRandom(b.find(".wpProQuiz_sortable").parent().parent());f.timeLimit&&e.methode.setTimeLimit();k=l=0;n=new Date;f.checkAnswer?b.find('input[name="check"]').show():b.find('input[name="next"]').show();b.find(".wpProQuiz_text").hide();b.find(".wpProQuiz_quiz").show();
|
2 |
+
b.find(".wpProQuiz_listItem").first().fadeIn(200);b.find(".wpProQuiz_sortable").parent().parent().sortable().disableSelection();b.find(".wpProQuiz_sortStringList, .wpProQuiz_maxtrixSortCriterion").sortable({connectWith:".wpProQuiz_maxtrixSortCriterion:not(:has(li)), .wpProQuiz_sortStringList",placeholder:"wpProQuiz_placehold"}).disableSelection()},reStartQuiz:function(){b.find(".wpProQuiz_answerCorrect").removeClass("wpProQuiz_answerCorrect");b.find(".wpProQuiz_answerIncorrect").removeClass("wpProQuiz_answerIncorrect");
|
3 |
+
b.find('.wpProQuiz_text, input[name="tip"]').show();b.find(".wpProQuiz_quiz, .wpProQuiz_results, .wpProQuiz_response, .wpProQuiz_correct, .wpProQuiz_incorrect").hide();b.find(".wpProQuiz_time_limit, .wpProQuiz_time_limit_expired, .wpProQuiz_sort_correct_answer").hide();b.find(".wpProQuiz_quiz").children().first().children().hide();b.find(".wpProQuiz_sortable, .wpProQuiz_sortStringItem").removeAttr("style");b.find('input[name="check"]').hide();b.find('input[name="next"]').hide();b.find('input[name="question"]').removeAttr("disabled").removeAttr("checked");
|
4 |
+
b.find('input[name="question"][type="text"]').removeAttr("value");b.find(".wpProQuiz_resultsList").children().hide();b.find(".wpProQuiz_cloze input").removeAttr("disabled").removeAttr("value").css("background-color","");b.find(".wpProQuiz_cloze span").hide();e.methode.resetMatrix()},resetMatrix:function(){b.find(".wpProQuiz_question").each(function(){var a=c(this),d=a.find(".wpProQuiz_sortStringList");a.find(".wpProQuiz_sortStringItem").each(function(){d.append(c(this))})})},setTimeLimit:function(){var a=
|
5 |
+
b.find(".wpProQuiz_time_limit"),d=a.find("span"),c=f.timeLimit;a.css({width:"100%",display:"block"});d.html(e.methode.parseTime(c));a.find(".progress").css("width","100%").animate({width:"0%"},1E3*f.timeLimit);h=setInterval(function(){d.html(e.methode.parseTime(c--));0>c&&(clearInterval(h),h=0,a.find(".progress").clearQueue().stop(),b.find('input[name="check"]').click().parent().hide(),b.find(".wpProQuiz_time_limit_expired").show(),e.methode.showResult())},1E3)},parseTime:function(a){var d=parseInt(a%
|
6 |
+
60),c=parseInt(a/60%60),a=parseInt(a/3600%24);return(9<a?"":"0")+a+":"+((9<c?"":"0")+c)+":"+((9<d?"":"0")+d)},setQuizTime:function(){var a=((new Date).getTime()-n.getTime())/1E3;b.find(".wpProQuiz_quiz_time span").first().html(e.methode.parseTime(a))},setData:function(){var a=0;b.find(".wpProQuiz_questionList").each(function(){var d=f.json[a],b=0;j+=d.points;c(this).parent().parent().data("type",d.answer_type).data("questionId",d.id).data("points",d.points);c(this).find('input[name="question"]').each(function(){switch(d.answer_type){case "single":case "multiple":0<=
|
7 |
+
c.inArray(this.value,d.correct)?c(this).data("correct","1"):c(this).data("correct","0");break;case "free_answer":c(this).data("correct",d.correct)}});b=0;c(this).find(".wpProQuiz_sortable").each(function(){c(this).data("correct",d.correct[b++])});b=0;c(this).parent().find(".wpProQuiz_sortStringList").children().each(function(){c(this).data("correct",d.correct[b++]);console.debug(c(this))});a++})},checkAnswer:function(a){var d=c(a).parent(),b=!1,e=d.find('input[name="question"]'),f=d.data("type");
|
8 |
+
d.find('input[name="tip"]').hide();if("multiple"==f||"single"==f){var g=!0;e.each(function(){"1"==c(this).data("correct")?(c(this).parent().parent().addClass("wpProQuiz_answerCorrect"),g=this.checked?g&1:g&0):this.checked&&(c(this).parent().parent().addClass("wpProQuiz_answerIncorrect"),g&=0)});b=g}else if("sort_answer"==f){g=!0;d.find(".wpProQuiz_sortable").each(function(){var a=c(this),b=a.parent().index();a.data("correct")==b?(a.parent().addClass("wpProQuiz_answerCorrect"),g&=1):(a.parent().addClass("wpProQuiz_answerIncorrect"),
|
9 |
+
g=!1);a.css({"box-shadow":"0 0",cursor:"auto"})});var h=d.find(".wpProQuiz_sortable").parent().parent(),b=h.children("li");h.sortable("destroy");b.sort(function(a,b){return c(a).children("div").data("correct")>c(b).children("div").data("correct")});c.each(b,function(a,b){h.append(b)});b=g}else if("free_answer"==f)f=c.trim(e.val()).toLowerCase(),0<=c.inArray(f,e.data("correct"))?(b=!0,e.parent().parent().addClass("wpProQuiz_answerCorrect")):e.parent().parent().addClass("wpProQuiz_answerIncorrect");
|
10 |
+
else if("matrix_sort_answer"==f){var g=!0,j=d.find(".wpProQuiz_questionList").children();j.each(function(){var a=c(this).index(),b=c(this).find(".wpProQuiz_maxtrixSortCriterion");b.children().first().data("correct")==a?(g&=1,b.addClass("wpProQuiz_answerCorrect")):(g=!1,b.addClass("wpProQuiz_answerIncorrect"))});d.find(".wpProQuiz_sortStringItem").each(function(){j.eq(c(this).data("correct")).find(".wpProQuiz_maxtrixSortCriterion").append(this)}).css({"box-shadow":"0 0",cursor:"auto"});d.find(".wpProQuiz_sortStringList, .wpProQuiz_maxtrixSortCriterion").sortable("destroy");
|
11 |
+
b=g}else"cloze_answer"==f&&(g=!0,d.find(".wpProQuiz_cloze").each(function(){var a=c(this).children(),b=a.first(),d=b.val().toLowerCase(),e=a.last().text().toLowerCase(),e=e.substr(1,e.length-2);c.trim(e)==c.trim(d)?(g&=1,b.css("background-color","#B0DAB0")):(g=!1,b.css("background-color","#FFBABA"),a.last().show());b.attr("disabled","disabled")}),b=g);c(a).hide();e.attr("disabled","disabled");void 0==i[d.data("questionId")]&&(i[d.data("questionId")]={});i[d.data("questionId")].correct=Number(b);d.find(".wpProQuiz_response").show();
|
12 |
+
b?(d.find(".wpProQuiz_correct").show(),l++,k+=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||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(h);var a=b.find(".wpProQuiz_points span");
|
13 |
+
b.find(".wpProQuiz_time_limit .progress").clearQueue().stop();b.find(".wpProQuiz_correct_answer").html(l);b.find(".wpProQuiz_results").show();b.find(".wpProQuiz_time_limit").hide();e.methode.setQuizTime();var d=Math.round(1E4*(k/j))/100;a.eq(0).text(k);a.eq(1).text(j);a.eq(2).text(d);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];
|
14 |
+
a>=g&&a-g<e&&(e=a-g,c=h)}return c},sendStatistics:function(){f.statisticsOn&&c.ajax({url:f.url,type:"POST",cache:!1,data:{action:"wp_pro_quiz_statistics_save",results:i,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);
|
15 |
+
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())-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==i[$par.data("questionId")]&&(i[$par.data("questionId")]={});i[$par.data("questionId")].tip=
|
16 |
+
1;$tip.toggle("fast")},setClozeStyle:function(){b.find(".wpProQuiz_cloze").each(function(){var a=c(this).children(),b=a.first(),a=a.last().clone();a.css("visibility","hidden");c("body").append(a);var e=a.width();a.remove();b.width(e+10)})}};e.init=function(){l=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();
|
17 |
+
e.methode.startQuiz()});b.find('input[name="check"]').click(function(a){a.preventDefault();e.methode.checkAnswer(this)});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)});
|
18 |
+
b.find('input[name="tip"]').click(function(){e.methode.showTip(this)});c(document).mouseup(function(a){var c=b.find(".wpProQuiz_tipp"),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(m){return this.each(function(){void 0==c(this).data("wpProQuizFront")&&c(this).data("wpProQuizFront",new c.wpProQuizFront(this,m))})}})(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"
|
@@ -42,6 +42,21 @@ msgstr "Quiz-Beschreibung nicht ausgefüllt!"
|
|
42 |
msgid "The percent values in result text are incorrect."
|
43 |
msgstr "Die Prozentwerte im Ergebnistext stimmen nicht."
|
44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
#: lib/controller/WpProQuiz_Controller_Question.php:9
|
46 |
#: lib/controller/WpProQuiz_Controller_Question.php:19
|
47 |
#: lib/controller/WpProQuiz_Controller_Quiz.php:42
|
@@ -96,87 +111,113 @@ msgstr "Quiz erstellen"
|
|
96 |
msgid "Quiz deleted"
|
97 |
msgstr "Quiz gelöscht"
|
98 |
|
99 |
-
#: lib/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
msgid "Start quiz"
|
101 |
msgstr "Quiz starten"
|
102 |
|
103 |
-
#: lib/view/WpProQuiz_View_FrontQuiz.php:
|
104 |
msgid "Results"
|
105 |
msgstr "Ergebnis"
|
106 |
|
107 |
-
#: lib/view/WpProQuiz_View_FrontQuiz.php:
|
108 |
#, php-format
|
109 |
msgid "%s of %s questions answered correctly"
|
110 |
msgstr "%s von %s Frage korrekt beantwortet"
|
111 |
|
112 |
-
#: lib/view/WpProQuiz_View_FrontQuiz.php:
|
|
|
|
|
|
|
|
|
113 |
msgid "Time has elapsed"
|
114 |
msgstr "Zeit ist abgelaufen"
|
115 |
|
116 |
-
#: lib/view/WpProQuiz_View_FrontQuiz.php:
|
117 |
-
msgid "
|
118 |
-
|
|
|
|
|
119 |
|
120 |
-
#: lib/view/WpProQuiz_View_FrontQuiz.php:
|
121 |
msgid "Restart quiz"
|
122 |
msgstr "Quiz erneut starten"
|
123 |
|
124 |
-
#: lib/view/WpProQuiz_View_FrontQuiz.php:
|
125 |
msgid "View question"
|
126 |
msgstr "Frage ansehen"
|
127 |
|
128 |
-
#: lib/view/WpProQuiz_View_FrontQuiz.php:
|
129 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
130 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
131 |
msgid "Time limit"
|
132 |
msgstr "Zeitlimit"
|
133 |
|
134 |
-
#: lib/view/WpProQuiz_View_FrontQuiz.php:
|
135 |
#, php-format
|
136 |
msgid "Question %s of %s"
|
137 |
msgstr "Frage %s von %s"
|
138 |
|
139 |
-
#: lib/view/WpProQuiz_View_FrontQuiz.php:
|
140 |
-
|
|
|
|
|
|
|
|
|
|
|
141 |
#: lib/view/WpProQuiz_View_Statistics.php:19
|
142 |
msgid "Question"
|
143 |
msgstr "Frage"
|
144 |
|
145 |
-
#: lib/view/WpProQuiz_View_FrontQuiz.php:
|
146 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
147 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
148 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
149 |
msgid "Sort elements"
|
150 |
msgstr "Sortierelemente"
|
151 |
|
152 |
-
#: lib/view/WpProQuiz_View_FrontQuiz.php:
|
153 |
#: lib/view/WpProQuiz_View_Statistics.php:21
|
154 |
msgid "Correct"
|
155 |
msgstr "Korrekt"
|
156 |
|
157 |
-
#: lib/view/WpProQuiz_View_FrontQuiz.php:
|
158 |
#: lib/view/WpProQuiz_View_Statistics.php:20
|
159 |
msgid "Incorrect"
|
160 |
msgstr "Inkorrekt"
|
161 |
|
162 |
-
#: lib/view/WpProQuiz_View_FrontQuiz.php:
|
163 |
-
#: lib/view/WpProQuiz_View_FrontQuiz.php:
|
164 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
165 |
msgid "Hint"
|
166 |
msgstr "Tipp"
|
167 |
|
168 |
-
#: lib/view/WpProQuiz_View_FrontQuiz.php:
|
169 |
msgid "Check"
|
170 |
msgstr "Prüfen"
|
171 |
|
172 |
-
#: lib/view/WpProQuiz_View_FrontQuiz.php:
|
173 |
msgid "Back"
|
174 |
msgstr "Zurück"
|
175 |
|
176 |
-
#: lib/view/WpProQuiz_View_FrontQuiz.php:
|
177 |
msgid "Next exercise"
|
178 |
msgstr "Nächste Frage"
|
179 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
#: lib/view/WpProQuiz_View_QuestionEdit.php:13
|
181 |
#: lib/view/WpProQuiz_View_QuestionOverall.php:9
|
182 |
#: lib/view/WpProQuiz_View_QuizEdit.php:8
|
@@ -184,15 +225,41 @@ msgstr "Nächste Frage"
|
|
184 |
msgid "back to overview"
|
185 |
msgstr "zurück zur Übersicht"
|
186 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
187 |
#: lib/view/WpProQuiz_View_QuestionEdit.php:17
|
188 |
msgid "Title"
|
189 |
msgstr "Titel"
|
190 |
|
191 |
#: lib/view/WpProQuiz_View_QuestionEdit.php:17
|
192 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
193 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
194 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
195 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
196 |
msgid "(optional)"
|
197 |
msgstr "(Optional)"
|
198 |
|
@@ -205,17 +272,27 @@ msgstr ""
|
|
205 |
"Titel leer gelassen, wird ein Titel generiert."
|
206 |
|
207 |
#: lib/view/WpProQuiz_View_QuestionEdit.php:26
|
208 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
209 |
#: lib/view/WpProQuiz_View_QuizEdit.php:12
|
210 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
211 |
msgid "(required)"
|
212 |
msgstr "(Pflichtfeld)"
|
213 |
|
214 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
|
|
|
|
|
|
|
|
215 |
msgid "Message with the correct answer"
|
216 |
msgstr "Nachricht bei korrekter Antwort"
|
217 |
|
218 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
219 |
msgid ""
|
220 |
"This text will be visible if answered correctly. It can be used as "
|
221 |
"explanation for complex questions. The message \"Right\" or \"Wrong\" is "
|
@@ -225,15 +302,15 @@ msgstr ""
|
|
225 |
"für komplexe Aufgaben dienen. Die Nachricht \"Richtig\" oder \"Falsch\" wird "
|
226 |
"immer automatisch angezeigt."
|
227 |
|
228 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
229 |
msgid "Same text for correct- and incorrect-message?"
|
230 |
msgstr "Gleicher Text für Korrekt- und Inkorrekt-Nachricht?"
|
231 |
|
232 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
233 |
msgid "Message with the incorrect answer"
|
234 |
msgstr "Nachricht bei inkorrekter Antwort"
|
235 |
|
236 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
237 |
msgid ""
|
238 |
"This text will be visible if answered incorrectly. It can be used as "
|
239 |
"explanation for complex questions. The message \"Right\" or \"Wrong\" is "
|
@@ -243,51 +320,55 @@ msgstr ""
|
|
243 |
"komplexe Aufgaben dienen. Die Nachricht \"Richtig\" oder \"Falsch\" wird "
|
244 |
"immer automatisch angezeigt."
|
245 |
|
246 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
247 |
msgid "Here you can enter solution hint."
|
248 |
msgstr "Hier können Sie einen Lösungstipp hinterlegen."
|
249 |
|
250 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
251 |
msgid "Activate hint for this question?"
|
252 |
msgstr "Tipp für diese Frage aktivieren?"
|
253 |
|
254 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
255 |
msgid "Answer type"
|
256 |
msgstr "Antwort Typ?"
|
257 |
|
258 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
259 |
msgid "Single choice"
|
260 |
msgstr "Single choice"
|
261 |
|
262 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
263 |
msgid "Multiple choice"
|
264 |
msgstr "Multiple choice"
|
265 |
|
266 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
267 |
msgid "\"Free\" choice"
|
268 |
msgstr "\"Free\" choice"
|
269 |
|
270 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
271 |
msgid "\"Sorting\" choice"
|
272 |
msgstr "\"Sorting\" choice"
|
273 |
|
274 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
275 |
msgid "\"Matrix Sorting\" choice"
|
276 |
msgstr "\"Matrix Sorting\" choice"
|
277 |
|
278 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
|
|
|
|
|
|
|
|
279 |
msgid "Answers"
|
280 |
msgstr "Antworten"
|
281 |
|
282 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
283 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
284 |
msgid ""
|
285 |
"correct answers (one per line) (answers will be converted to lower case)"
|
286 |
msgstr ""
|
287 |
"Korrekte Antworten (eine pro Zeile ) (Antworten werden in Kleinbuchstaben "
|
288 |
"umgewandelt)"
|
289 |
|
290 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
291 |
msgid ""
|
292 |
"Please sort the answers in right order with the \"Move\" - Button. The "
|
293 |
"answers will be displayed randomly."
|
@@ -295,59 +376,59 @@ msgstr ""
|
|
295 |
"Bitte Antworten mit dem \"Verschiebe\"-Button in die richtige Reihenfolge "
|
296 |
"bringen. Die Antworten werden später immer zufällig ausgegeben."
|
297 |
|
298 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
299 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
300 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
301 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
302 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
303 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
304 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
305 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
306 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
307 |
msgid "Delete answer"
|
308 |
msgstr "Antwort löschen"
|
309 |
|
310 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
311 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
312 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
313 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
314 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
315 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
316 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
317 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
318 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
319 |
#: lib/view/WpProQuiz_View_QuestionOverall.php:29
|
320 |
msgid "Move"
|
321 |
msgstr "Verschieben"
|
322 |
|
323 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
324 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
325 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
326 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
327 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
328 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
329 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
330 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
331 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
332 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
333 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
334 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
335 |
msgid "Allow HTML"
|
336 |
msgstr "HTML erlauben"
|
337 |
|
338 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
339 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
340 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
341 |
msgid "Add new answer"
|
342 |
msgstr "Neue Antwort hinzufügen"
|
343 |
|
344 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
345 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
346 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
347 |
msgid "correct?"
|
348 |
msgstr "Korrekt?"
|
349 |
|
350 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
351 |
msgid ""
|
352 |
"In this mode, not a list have to be sorted, but elements must be assigned to "
|
353 |
"matching criterion."
|
@@ -355,14 +436,22 @@ msgstr ""
|
|
355 |
"In diesem Modus muss nicht eine Liste sortiert werden, sondern die "
|
356 |
"Sortierelemente müssen zu den passenden Kriterium zugeordnet werden."
|
357 |
|
358 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
359 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
360 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
361 |
msgid "Criterion"
|
362 |
msgstr "Kriterium"
|
363 |
|
364 |
-
#: lib/view/WpProQuiz_View_QuestionEdit.php:
|
365 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
366 |
msgid "Save"
|
367 |
msgstr "Speichern"
|
368 |
|
@@ -371,22 +460,22 @@ msgid "Questions sorted"
|
|
371 |
msgstr "Fragen sortiert"
|
372 |
|
373 |
#: lib/view/WpProQuiz_View_QuestionOverall.php:14
|
374 |
-
#: lib/view/WpProQuiz_View_QuizOverall.php:
|
375 |
msgid "Name"
|
376 |
msgstr "Name"
|
377 |
|
378 |
#: lib/view/WpProQuiz_View_QuestionOverall.php:15
|
379 |
-
#: lib/view/WpProQuiz_View_QuizOverall.php:
|
380 |
msgid "Action"
|
381 |
msgstr "Aktion"
|
382 |
|
383 |
#: lib/view/WpProQuiz_View_QuestionOverall.php:27
|
384 |
-
#: lib/view/WpProQuiz_View_QuizOverall.php:
|
385 |
msgid "Edit"
|
386 |
msgstr "Bearbeiten"
|
387 |
|
388 |
#: lib/view/WpProQuiz_View_QuestionOverall.php:28
|
389 |
-
#: lib/view/WpProQuiz_View_QuizOverall.php:
|
390 |
msgid "Delete"
|
391 |
msgstr "Löschen"
|
392 |
|
@@ -420,28 +509,37 @@ msgstr "Der Titel dient als Quiz Überschrift."
|
|
420 |
|
421 |
#: lib/view/WpProQuiz_View_QuizEdit.php:42
|
422 |
#: lib/view/WpProQuiz_View_QuizEdit.php:47
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
423 |
msgid "Display question randomly"
|
424 |
msgstr "Fragen zufällig ausgeben"
|
425 |
|
426 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
427 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
428 |
msgid "Display answers randomly"
|
429 |
msgstr "Antworten zufällig ausgeben"
|
430 |
|
431 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
432 |
msgid "Seconds"
|
433 |
msgstr "Sekunden"
|
434 |
|
435 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
436 |
msgid "0 = no limit"
|
437 |
msgstr "0 = Kein Limit"
|
438 |
|
439 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
440 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
441 |
msgid "Check -> continue"
|
442 |
msgstr "Prüfen -> Weiter"
|
443 |
|
444 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
445 |
msgid ""
|
446 |
"Show \"right or wrong\" after the question. Otherwise the solutions will be "
|
447 |
"displayed at the end."
|
@@ -449,12 +547,12 @@ msgstr ""
|
|
449 |
"Zeigt \"richtig oder falsch\" nach jeder Frage an. Ansonsten werden die "
|
450 |
"Lösungen erst am Ende angezeigt."
|
451 |
|
452 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
453 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
454 |
msgid "Back button"
|
455 |
msgstr "Zurück Button"
|
456 |
|
457 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
458 |
msgid ""
|
459 |
"Allow to use back button in a question. (Option will be ignored if \"Check -"
|
460 |
"> Continue\" was used)"
|
@@ -462,17 +560,17 @@ msgstr ""
|
|
462 |
"Ermöglicht das Zurückgehen einer Frage. (Option wird ignoriert bei \"Prüfen -"
|
463 |
"> Weiter\")"
|
464 |
|
465 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
466 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
467 |
-
#: lib/view/WpProQuiz_View_QuizOverall.php:
|
468 |
msgid "Statistics"
|
469 |
msgstr "Statistik"
|
470 |
|
471 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
472 |
msgid "activate"
|
473 |
msgstr "Aktivieren"
|
474 |
|
475 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
476 |
msgid ""
|
477 |
"Statistics about right or wrong answers. Statistics will be saved by "
|
478 |
"completed quiz, not after every question. The statistics is only visible "
|
@@ -482,16 +580,16 @@ msgstr ""
|
|
482 |
"vollständigen abschließen des Quiz gespeichert, nicht nach jeder Frage. Die "
|
483 |
"Statistik ist nur über das Adminmenü einsehbar (interne Statistik)"
|
484 |
|
485 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
486 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
487 |
msgid "Statistics IP-lock"
|
488 |
msgstr "Statistik IP-Sperre"
|
489 |
|
490 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
491 |
msgid "in minutes (recommended 1440 minutes = 1 day)"
|
492 |
msgstr "in Minuten (Empfohlen: 1440 Minuten = 1 Tag)"
|
493 |
|
494 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
495 |
msgid ""
|
496 |
"Protect the statistics from spam. Result will only be saved every X minutes "
|
497 |
"from same IP. (0 = deactivated)"
|
@@ -499,19 +597,19 @@ msgstr ""
|
|
499 |
"Schuetz die Statistik vor Spam. Ergebnis wird nur aller X Minuten von der "
|
500 |
"gleichen IP gespeichert. (0 = Deaktiviert)"
|
501 |
|
502 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
503 |
msgid "Quiz description"
|
504 |
msgstr "Quiz Beschreibung"
|
505 |
|
506 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
507 |
msgid "This text will be displayed before start of the quiz."
|
508 |
msgstr "Dieser Text wird vor dem Starten des Quizes angezeigt."
|
509 |
|
510 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
511 |
msgid "Results text"
|
512 |
msgstr "Ergebnis Text"
|
513 |
|
514 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
515 |
msgid ""
|
516 |
"This text will be displayed at the end of the quiz (in results). (this text "
|
517 |
"is optional)"
|
@@ -519,42 +617,47 @@ msgstr ""
|
|
519 |
"Dieser Text wird beim Beenden (im Ergebnis) des Quizes angezeigt (Dieser "
|
520 |
"Text ist optional)"
|
521 |
|
522 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
523 |
msgid "Activate graduation"
|
524 |
msgstr "Abstufungen aktivieren"
|
525 |
|
526 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
527 |
msgid "Hint:"
|
528 |
msgstr "Hinweis:"
|
529 |
|
530 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
531 |
msgid "Maximal 15 levels"
|
532 |
msgstr "Maximal 15 Stufen"
|
533 |
|
534 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
535 |
-
|
536 |
-
|
|
|
|
|
|
|
|
|
|
|
537 |
|
538 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
539 |
msgid "Values can also be mixed up"
|
540 |
msgstr "Werte können auch durcheinander sein"
|
541 |
|
542 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
543 |
msgid "10,15% or 10.15% allowed (max. two digits after the decimal point)"
|
544 |
msgstr "10,15% oder 10.15% erlaubt (maximal 2 Stellen nach dem Komma)"
|
545 |
|
546 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
547 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
548 |
msgid "from:"
|
549 |
msgstr "Ab:"
|
550 |
|
551 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
552 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
553 |
msgid "percent"
|
554 |
msgstr "Prozent"
|
555 |
|
556 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
557 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
558 |
#, php-format
|
559 |
msgid ""
|
560 |
"(Will be displayed, when result-percent is >= <span class=\"resultProzent\">"
|
@@ -563,39 +666,63 @@ msgstr ""
|
|
563 |
"(Wird angezeigt wenn Ergebnis-Prozent >= <span class=\"resultProzent\">%s</"
|
564 |
"span>%% ist)"
|
565 |
|
566 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
567 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
568 |
msgid "Delete graduation"
|
569 |
msgstr "Stufe löschen"
|
570 |
|
571 |
-
#: lib/view/WpProQuiz_View_QuizEdit.php:
|
572 |
msgid "Add graduation"
|
573 |
msgstr "Stufe hinzufügen"
|
574 |
|
575 |
-
#: lib/view/WpProQuiz_View_QuizOverall.php:
|
576 |
msgid "Quiz overview"
|
577 |
msgstr "Quiz Übersicht"
|
578 |
|
579 |
-
#: lib/view/WpProQuiz_View_QuizOverall.php:
|
580 |
msgid "ID"
|
581 |
msgstr "ID"
|
582 |
|
583 |
-
#: lib/view/WpProQuiz_View_QuizOverall.php:
|
584 |
msgid "Shortcode"
|
585 |
msgstr "Shortcode"
|
586 |
|
587 |
-
#: lib/view/WpProQuiz_View_QuizOverall.php:
|
588 |
-
msgid "Questions"
|
589 |
-
msgstr "Fragen"
|
590 |
-
|
591 |
-
#: lib/view/WpProQuiz_View_QuizOverall.php:30
|
592 |
msgid "Preview"
|
593 |
msgstr "Vorschau"
|
594 |
|
595 |
-
#: lib/view/WpProQuiz_View_QuizOverall.php:
|
596 |
msgid "Add quiz"
|
597 |
msgstr "Quiz hinzufügen"
|
598 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
599 |
#: lib/view/WpProQuiz_View_Statistics.php:7
|
600 |
#, php-format
|
601 |
msgid "Quiz: %s - Statistics"
|
@@ -621,6 +748,9 @@ msgstr "Total"
|
|
621 |
msgid "Reset statistics"
|
622 |
msgstr "Statistik zurücksetzen"
|
623 |
|
|
|
|
|
|
|
624 |
#~ msgid "Right"
|
625 |
#~ msgstr "Richtig"
|
626 |
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Wp-Pro-Quiz\n"
|
4 |
+
"POT-Creation-Date: 2012-11-27 12:06+0100\n"
|
5 |
+
"PO-Revision-Date: 2012-11-27 12:06+0100\n"
|
6 |
"Last-Translator: Julius Fischer <julius.f@gmx.net>\n"
|
7 |
"Language-Team: Julius Fischer\n"
|
8 |
"Language: German\n"
|
42 |
msgid "The percent values in result text are incorrect."
|
43 |
msgstr "Die Prozentwerte im Ergebnistext stimmen nicht."
|
44 |
|
45 |
+
#: lib/controller/WpProQuiz_Controller_Admin.php:42
|
46 |
+
msgid "No number in the field \"Points\" or less than 1"
|
47 |
+
msgstr "Keine Zahl im Feld \"Punkte\" oder kleiner 1"
|
48 |
+
|
49 |
+
#: lib/controller/WpProQuiz_Controller_Admin.php:43
|
50 |
+
msgid "No quiz selected"
|
51 |
+
msgstr "Kein Quiz ausgewählt"
|
52 |
+
|
53 |
+
#: lib/controller/WpProQuiz_Controller_ImportExport.php:70
|
54 |
+
#: lib/helper/WpProQuiz_Helper_Import.php:54
|
55 |
+
#: lib/helper/WpProQuiz_Helper_Import.php:63
|
56 |
+
#: lib/helper/WpProQuiz_Helper_Import.php:70
|
57 |
+
msgid "File cannot be processed"
|
58 |
+
msgstr "Datei kann nicht verarbeitet werden"
|
59 |
+
|
60 |
#: lib/controller/WpProQuiz_Controller_Question.php:9
|
61 |
#: lib/controller/WpProQuiz_Controller_Question.php:19
|
62 |
#: lib/controller/WpProQuiz_Controller_Quiz.php:42
|
111 |
msgid "Quiz deleted"
|
112 |
msgstr "Quiz gelöscht"
|
113 |
|
114 |
+
#: lib/helper/WpProQuiz_Helper_Import.php:9
|
115 |
+
msgid "File was not uploaded"
|
116 |
+
msgstr "Datei wurde nicht hochgeladen"
|
117 |
+
|
118 |
+
#: lib/helper/WpProQuiz_Helper_Import.php:40
|
119 |
+
msgid "File have wrong format"
|
120 |
+
msgstr "Datei hat falsches Format"
|
121 |
+
|
122 |
+
#: lib/view/WpProQuiz_View_FrontQuiz.php:68
|
123 |
msgid "Start quiz"
|
124 |
msgstr "Quiz starten"
|
125 |
|
126 |
+
#: lib/view/WpProQuiz_View_FrontQuiz.php:72
|
127 |
msgid "Results"
|
128 |
msgstr "Ergebnis"
|
129 |
|
130 |
+
#: lib/view/WpProQuiz_View_FrontQuiz.php:74
|
131 |
#, php-format
|
132 |
msgid "%s of %s questions answered correctly"
|
133 |
msgstr "%s von %s Frage korrekt beantwortet"
|
134 |
|
135 |
+
#: lib/view/WpProQuiz_View_FrontQuiz.php:77
|
136 |
+
msgid "Your time: <span></span>"
|
137 |
+
msgstr "Ihre Zeit: <span></span>"
|
138 |
+
|
139 |
+
#: lib/view/WpProQuiz_View_FrontQuiz.php:80
|
140 |
msgid "Time has elapsed"
|
141 |
msgstr "Zeit ist abgelaufen"
|
142 |
|
143 |
+
#: lib/view/WpProQuiz_View_FrontQuiz.php:83
|
144 |
+
msgid ""
|
145 |
+
"You have reached <span></span> of <span></span> points, (<span></span>%)"
|
146 |
+
msgstr ""
|
147 |
+
"Sie haben <span></span> von <span></span> Punkten erreicht (<span></span>%)"
|
148 |
|
149 |
+
#: lib/view/WpProQuiz_View_FrontQuiz.php:97
|
150 |
msgid "Restart quiz"
|
151 |
msgstr "Quiz erneut starten"
|
152 |
|
153 |
+
#: lib/view/WpProQuiz_View_FrontQuiz.php:98
|
154 |
msgid "View question"
|
155 |
msgstr "Frage ansehen"
|
156 |
|
157 |
+
#: lib/view/WpProQuiz_View_FrontQuiz.php:102
|
158 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:90
|
159 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:95
|
160 |
msgid "Time limit"
|
161 |
msgstr "Zeitlimit"
|
162 |
|
163 |
+
#: lib/view/WpProQuiz_View_FrontQuiz.php:115
|
164 |
#, php-format
|
165 |
msgid "Question %s of %s"
|
166 |
msgstr "Frage %s von %s"
|
167 |
|
168 |
+
#: lib/view/WpProQuiz_View_FrontQuiz.php:118
|
169 |
+
#, php-format
|
170 |
+
msgid "%d points"
|
171 |
+
msgstr "%d Punkte"
|
172 |
+
|
173 |
+
#: lib/view/WpProQuiz_View_FrontQuiz.php:122
|
174 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:35
|
175 |
#: lib/view/WpProQuiz_View_Statistics.php:19
|
176 |
msgid "Question"
|
177 |
msgstr "Frage"
|
178 |
|
179 |
+
#: lib/view/WpProQuiz_View_FrontQuiz.php:129
|
180 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:235
|
181 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:273
|
182 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:308
|
183 |
msgid "Sort elements"
|
184 |
msgstr "Sortierelemente"
|
185 |
|
186 |
+
#: lib/view/WpProQuiz_View_FrontQuiz.php:208
|
187 |
#: lib/view/WpProQuiz_View_Statistics.php:21
|
188 |
msgid "Correct"
|
189 |
msgstr "Korrekt"
|
190 |
|
191 |
+
#: lib/view/WpProQuiz_View_FrontQuiz.php:216
|
192 |
#: lib/view/WpProQuiz_View_Statistics.php:20
|
193 |
msgid "Incorrect"
|
194 |
msgstr "Inkorrekt"
|
195 |
|
196 |
+
#: lib/view/WpProQuiz_View_FrontQuiz.php:232
|
197 |
+
#: lib/view/WpProQuiz_View_FrontQuiz.php:242
|
198 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:71
|
199 |
msgid "Hint"
|
200 |
msgstr "Tipp"
|
201 |
|
202 |
+
#: lib/view/WpProQuiz_View_FrontQuiz.php:239
|
203 |
msgid "Check"
|
204 |
msgstr "Prüfen"
|
205 |
|
206 |
+
#: lib/view/WpProQuiz_View_FrontQuiz.php:240
|
207 |
msgid "Back"
|
208 |
msgstr "Zurück"
|
209 |
|
210 |
+
#: lib/view/WpProQuiz_View_FrontQuiz.php:244
|
211 |
msgid "Next exercise"
|
212 |
msgstr "Nächste Frage"
|
213 |
|
214 |
+
#: lib/view/WpProQuiz_View_Import.php:21
|
215 |
+
#: lib/view/WpProQuiz_View_QuizOverall.php:65
|
216 |
+
#: lib/view/WpProQuiz_View_QuizOverall.php:80
|
217 |
+
msgid "Import"
|
218 |
+
msgstr "Import"
|
219 |
+
|
220 |
+
#: lib/view/WpProQuiz_View_Import.php:22
|
221 |
#: lib/view/WpProQuiz_View_QuestionEdit.php:13
|
222 |
#: lib/view/WpProQuiz_View_QuestionOverall.php:9
|
223 |
#: lib/view/WpProQuiz_View_QuizEdit.php:8
|
225 |
msgid "back to overview"
|
226 |
msgstr "zurück zur Übersicht"
|
227 |
|
228 |
+
#: lib/view/WpProQuiz_View_Import.php:25
|
229 |
+
msgid "Error"
|
230 |
+
msgstr "Error"
|
231 |
+
|
232 |
+
#: lib/view/WpProQuiz_View_Import.php:32
|
233 |
+
msgid "Successfully"
|
234 |
+
msgstr "Erfolgreich"
|
235 |
+
|
236 |
+
#: lib/view/WpProQuiz_View_Import.php:34
|
237 |
+
msgid "Import completed successfully"
|
238 |
+
msgstr "Import erfolgreich abgeschlossen"
|
239 |
+
|
240 |
+
#: lib/view/WpProQuiz_View_Import.php:43
|
241 |
+
msgid "Quiz name"
|
242 |
+
msgstr "Quiz-Name"
|
243 |
+
|
244 |
+
#: lib/view/WpProQuiz_View_Import.php:44
|
245 |
+
#: lib/view/WpProQuiz_View_QuizOverall.php:53
|
246 |
+
msgid "Questions"
|
247 |
+
msgstr "Fragen"
|
248 |
+
|
249 |
+
#: lib/view/WpProQuiz_View_Import.php:67
|
250 |
+
#: lib/view/WpProQuiz_View_QuizOverall.php:91
|
251 |
+
msgid "Start import"
|
252 |
+
msgstr "Import starten"
|
253 |
+
|
254 |
#: lib/view/WpProQuiz_View_QuestionEdit.php:17
|
255 |
msgid "Title"
|
256 |
msgstr "Titel"
|
257 |
|
258 |
#: lib/view/WpProQuiz_View_QuestionEdit.php:17
|
259 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:43
|
260 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:60
|
261 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:71
|
262 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:196
|
263 |
msgid "(optional)"
|
264 |
msgstr "(Optional)"
|
265 |
|
272 |
"Titel leer gelassen, wird ein Titel generiert."
|
273 |
|
274 |
#: lib/view/WpProQuiz_View_QuestionEdit.php:26
|
275 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:31
|
276 |
+
msgid "Points"
|
277 |
+
msgstr "Punkte"
|
278 |
+
|
279 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:26
|
280 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:35
|
281 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:123
|
282 |
#: lib/view/WpProQuiz_View_QuizEdit.php:12
|
283 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:185
|
284 |
msgid "(required)"
|
285 |
msgstr "(Pflichtfeld)"
|
286 |
|
287 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:29
|
288 |
+
msgid "Points for this question (Standard is 1 point)"
|
289 |
+
msgstr "Punkte für diese Frage (Standard ist 1 Punkt)"
|
290 |
+
|
291 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:43
|
292 |
msgid "Message with the correct answer"
|
293 |
msgstr "Nachricht bei korrekter Antwort"
|
294 |
|
295 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:46
|
296 |
msgid ""
|
297 |
"This text will be visible if answered correctly. It can be used as "
|
298 |
"explanation for complex questions. The message \"Right\" or \"Wrong\" is "
|
302 |
"für komplexe Aufgaben dienen. Die Nachricht \"Richtig\" oder \"Falsch\" wird "
|
303 |
"immer automatisch angezeigt."
|
304 |
|
305 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:50
|
306 |
msgid "Same text for correct- and incorrect-message?"
|
307 |
msgstr "Gleicher Text für Korrekt- und Inkorrekt-Nachricht?"
|
308 |
|
309 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:60
|
310 |
msgid "Message with the incorrect answer"
|
311 |
msgstr "Nachricht bei inkorrekter Antwort"
|
312 |
|
313 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:63
|
314 |
msgid ""
|
315 |
"This text will be visible if answered incorrectly. It can be used as "
|
316 |
"explanation for complex questions. The message \"Right\" or \"Wrong\" is "
|
320 |
"komplexe Aufgaben dienen. Die Nachricht \"Richtig\" oder \"Falsch\" wird "
|
321 |
"immer automatisch angezeigt."
|
322 |
|
323 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:74
|
324 |
msgid "Here you can enter solution hint."
|
325 |
msgstr "Hier können Sie einen Lösungstipp hinterlegen."
|
326 |
|
327 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:78
|
328 |
msgid "Activate hint for this question?"
|
329 |
msgstr "Tipp für diese Frage aktivieren?"
|
330 |
|
331 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:90
|
332 |
msgid "Answer type"
|
333 |
msgstr "Antwort Typ?"
|
334 |
|
335 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:98
|
336 |
msgid "Single choice"
|
337 |
msgstr "Single choice"
|
338 |
|
339 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:102
|
340 |
msgid "Multiple choice"
|
341 |
msgstr "Multiple choice"
|
342 |
|
343 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:106
|
344 |
msgid "\"Free\" choice"
|
345 |
msgstr "\"Free\" choice"
|
346 |
|
347 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:110
|
348 |
msgid "\"Sorting\" choice"
|
349 |
msgstr "\"Sorting\" choice"
|
350 |
|
351 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:114
|
352 |
msgid "\"Matrix Sorting\" choice"
|
353 |
msgstr "\"Matrix Sorting\" choice"
|
354 |
|
355 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:118
|
356 |
+
msgid "Cloze"
|
357 |
+
msgstr "Lückentext"
|
358 |
+
|
359 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:123
|
360 |
msgid "Answers"
|
361 |
msgstr "Antworten"
|
362 |
|
363 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:128
|
364 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:132
|
365 |
msgid ""
|
366 |
"correct answers (one per line) (answers will be converted to lower case)"
|
367 |
msgstr ""
|
368 |
"Korrekte Antworten (eine pro Zeile ) (Antworten werden in Kleinbuchstaben "
|
369 |
"umgewandelt)"
|
370 |
|
371 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:138
|
372 |
msgid ""
|
373 |
"Please sort the answers in right order with the \"Move\" - Button. The "
|
374 |
"answers will be displayed randomly."
|
376 |
"Bitte Antworten mit dem \"Verschiebe\"-Button in die richtige Reihenfolge "
|
377 |
"bringen. Die Antworten werden später immer zufällig ausgegeben."
|
378 |
|
379 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:144
|
380 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:156
|
381 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:166
|
382 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:185
|
383 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:201
|
384 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:215
|
385 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:263
|
386 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:301
|
387 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:336
|
388 |
msgid "Delete answer"
|
389 |
msgstr "Antwort löschen"
|
390 |
|
391 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:145
|
392 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:157
|
393 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:167
|
394 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:186
|
395 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:202
|
396 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:216
|
397 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:262
|
398 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:300
|
399 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:335
|
400 |
#: lib/view/WpProQuiz_View_QuestionOverall.php:29
|
401 |
msgid "Move"
|
402 |
msgstr "Verschieben"
|
403 |
|
404 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:147
|
405 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:159
|
406 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:169
|
407 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:188
|
408 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:204
|
409 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:218
|
410 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:249
|
411 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:255
|
412 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:287
|
413 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:293
|
414 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:322
|
415 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:328
|
416 |
msgid "Allow HTML"
|
417 |
msgstr "HTML erlauben"
|
418 |
|
419 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:175
|
420 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:224
|
421 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:340
|
422 |
msgid "Add new answer"
|
423 |
msgstr "Neue Antwort hinzufügen"
|
424 |
|
425 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:183
|
426 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:199
|
427 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:213
|
428 |
msgid "correct?"
|
429 |
msgstr "Korrekt?"
|
430 |
|
431 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:228
|
432 |
msgid ""
|
433 |
"In this mode, not a list have to be sorted, but elements must be assigned to "
|
434 |
"matching criterion."
|
436 |
"In diesem Modus muss nicht eine Liste sortiert werden, sondern die "
|
437 |
"Sortierelemente müssen zu den passenden Kriterium zugeordnet werden."
|
438 |
|
439 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:234
|
440 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:272
|
441 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:307
|
442 |
msgid "Criterion"
|
443 |
msgstr "Kriterium"
|
444 |
|
445 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:344
|
446 |
+
msgid ""
|
447 |
+
"Enclose the searched words with { } e.g. \"I {play} soccer\". Capital and "
|
448 |
+
"small letters will be ignored."
|
449 |
+
msgstr ""
|
450 |
+
"Umschliessen sie die gesuchten Woerter mit { } z.B. \"Ich {spiele} Fussball"
|
451 |
+
"\". Gross- und Kleinschreibung wird ignoriert."
|
452 |
+
|
453 |
+
#: lib/view/WpProQuiz_View_QuestionEdit.php:353
|
454 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:264
|
455 |
msgid "Save"
|
456 |
msgstr "Speichern"
|
457 |
|
460 |
msgstr "Fragen sortiert"
|
461 |
|
462 |
#: lib/view/WpProQuiz_View_QuestionOverall.php:14
|
463 |
+
#: lib/view/WpProQuiz_View_QuizOverall.php:39
|
464 |
msgid "Name"
|
465 |
msgstr "Name"
|
466 |
|
467 |
#: lib/view/WpProQuiz_View_QuestionOverall.php:15
|
468 |
+
#: lib/view/WpProQuiz_View_QuizOverall.php:40
|
469 |
msgid "Action"
|
470 |
msgstr "Aktion"
|
471 |
|
472 |
#: lib/view/WpProQuiz_View_QuestionOverall.php:27
|
473 |
+
#: lib/view/WpProQuiz_View_QuizOverall.php:54
|
474 |
msgid "Edit"
|
475 |
msgstr "Bearbeiten"
|
476 |
|
477 |
#: lib/view/WpProQuiz_View_QuestionOverall.php:28
|
478 |
+
#: lib/view/WpProQuiz_View_QuizOverall.php:55
|
479 |
msgid "Delete"
|
480 |
msgstr "Löschen"
|
481 |
|
509 |
|
510 |
#: lib/view/WpProQuiz_View_QuizEdit.php:42
|
511 |
#: lib/view/WpProQuiz_View_QuizEdit.php:47
|
512 |
+
msgid "Show points"
|
513 |
+
msgstr "Punkte anzeigen"
|
514 |
+
|
515 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:53
|
516 |
+
msgid "Shows in quiz, how many points are reachable for respective question."
|
517 |
+
msgstr "Zeigt im Quiz an, wieviel Punkte es für die jeweilige Frage gibt."
|
518 |
+
|
519 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:60
|
520 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:65
|
521 |
msgid "Display question randomly"
|
522 |
msgstr "Fragen zufällig ausgeben"
|
523 |
|
524 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:75
|
525 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:80
|
526 |
msgid "Display answers randomly"
|
527 |
msgstr "Antworten zufällig ausgeben"
|
528 |
|
529 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:98
|
530 |
msgid "Seconds"
|
531 |
msgstr "Sekunden"
|
532 |
|
533 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:101
|
534 |
msgid "0 = no limit"
|
535 |
msgstr "0 = Kein Limit"
|
536 |
|
537 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:108
|
538 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:113
|
539 |
msgid "Check -> continue"
|
540 |
msgstr "Prüfen -> Weiter"
|
541 |
|
542 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:119
|
543 |
msgid ""
|
544 |
"Show \"right or wrong\" after the question. Otherwise the solutions will be "
|
545 |
"displayed at the end."
|
547 |
"Zeigt \"richtig oder falsch\" nach jeder Frage an. Ansonsten werden die "
|
548 |
"Lösungen erst am Ende angezeigt."
|
549 |
|
550 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:126
|
551 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:131
|
552 |
msgid "Back button"
|
553 |
msgstr "Zurück Button"
|
554 |
|
555 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:137
|
556 |
msgid ""
|
557 |
"Allow to use back button in a question. (Option will be ignored if \"Check -"
|
558 |
"> Continue\" was used)"
|
560 |
"Ermöglicht das Zurückgehen einer Frage. (Option wird ignoriert bei \"Prüfen -"
|
561 |
"> Weiter\")"
|
562 |
|
563 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:144
|
564 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:149
|
565 |
+
#: lib/view/WpProQuiz_View_QuizOverall.php:57
|
566 |
msgid "Statistics"
|
567 |
msgstr "Statistik"
|
568 |
|
569 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:153
|
570 |
msgid "activate"
|
571 |
msgstr "Aktivieren"
|
572 |
|
573 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:156
|
574 |
msgid ""
|
575 |
"Statistics about right or wrong answers. Statistics will be saved by "
|
576 |
"completed quiz, not after every question. The statistics is only visible "
|
580 |
"vollständigen abschließen des Quiz gespeichert, nicht nach jeder Frage. Die "
|
581 |
"Statistik ist nur über das Adminmenü einsehbar (interne Statistik)"
|
582 |
|
583 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:163
|
584 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:168
|
585 |
msgid "Statistics IP-lock"
|
586 |
msgstr "Statistik IP-Sperre"
|
587 |
|
588 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:172
|
589 |
msgid "in minutes (recommended 1440 minutes = 1 day)"
|
590 |
msgstr "in Minuten (Empfohlen: 1440 Minuten = 1 Tag)"
|
591 |
|
592 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:175
|
593 |
msgid ""
|
594 |
"Protect the statistics from spam. Result will only be saved every X minutes "
|
595 |
"from same IP. (0 = deactivated)"
|
597 |
"Schuetz die Statistik vor Spam. Ergebnis wird nur aller X Minuten von der "
|
598 |
"gleichen IP gespeichert. (0 = Deaktiviert)"
|
599 |
|
600 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:185
|
601 |
msgid "Quiz description"
|
602 |
msgstr "Quiz Beschreibung"
|
603 |
|
604 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:188
|
605 |
msgid "This text will be displayed before start of the quiz."
|
606 |
msgstr "Dieser Text wird vor dem Starten des Quizes angezeigt."
|
607 |
|
608 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:196
|
609 |
msgid "Results text"
|
610 |
msgstr "Ergebnis Text"
|
611 |
|
612 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:199
|
613 |
msgid ""
|
614 |
"This text will be displayed at the end of the quiz (in results). (this text "
|
615 |
"is optional)"
|
617 |
"Dieser Text wird beim Beenden (im Ergebnis) des Quizes angezeigt (Dieser "
|
618 |
"Text ist optional)"
|
619 |
|
620 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:203
|
621 |
msgid "Activate graduation"
|
622 |
msgstr "Abstufungen aktivieren"
|
623 |
|
624 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:209
|
625 |
msgid "Hint:"
|
626 |
msgstr "Hinweis:"
|
627 |
|
628 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:211
|
629 |
msgid "Maximal 15 levels"
|
630 |
msgstr "Maximal 15 Stufen"
|
631 |
|
632 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:213
|
633 |
+
#, php-format
|
634 |
+
msgid ""
|
635 |
+
"Percentages refer to the total score of the quiz. (Current total %d points "
|
636 |
+
"in %d questions."
|
637 |
+
msgstr ""
|
638 |
+
"Prozente beziehen sich auf die Gesamtpunktzahl des Quiz (Aktuell: insgesamt "
|
639 |
+
"%d Punkte bei %d Fragen)"
|
640 |
|
641 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:216
|
642 |
msgid "Values can also be mixed up"
|
643 |
msgstr "Werte können auch durcheinander sein"
|
644 |
|
645 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:217
|
646 |
msgid "10,15% or 10.15% allowed (max. two digits after the decimal point)"
|
647 |
msgstr "10,15% oder 10.15% erlaubt (maximal 2 Stellen nach dem Komma)"
|
648 |
|
649 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:233
|
650 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:244
|
651 |
msgid "from:"
|
652 |
msgstr "Ab:"
|
653 |
|
654 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:233
|
655 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:244
|
656 |
msgid "percent"
|
657 |
msgstr "Prozent"
|
658 |
|
659 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:233
|
660 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:244
|
661 |
#, php-format
|
662 |
msgid ""
|
663 |
"(Will be displayed, when result-percent is >= <span class=\"resultProzent\">"
|
666 |
"(Wird angezeigt wenn Ergebnis-Prozent >= <span class=\"resultProzent\">%s</"
|
667 |
"span>%% ist)"
|
668 |
|
669 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:234
|
670 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:245
|
671 |
msgid "Delete graduation"
|
672 |
msgstr "Stufe löschen"
|
673 |
|
674 |
+
#: lib/view/WpProQuiz_View_QuizEdit.php:252
|
675 |
msgid "Add graduation"
|
676 |
msgstr "Stufe hinzufügen"
|
677 |
|
678 |
+
#: lib/view/WpProQuiz_View_QuizOverall.php:32
|
679 |
msgid "Quiz overview"
|
680 |
msgstr "Quiz Übersicht"
|
681 |
|
682 |
+
#: lib/view/WpProQuiz_View_QuizOverall.php:37
|
683 |
msgid "ID"
|
684 |
msgstr "ID"
|
685 |
|
686 |
+
#: lib/view/WpProQuiz_View_QuizOverall.php:38
|
687 |
msgid "Shortcode"
|
688 |
msgstr "Shortcode"
|
689 |
|
690 |
+
#: lib/view/WpProQuiz_View_QuizOverall.php:56
|
|
|
|
|
|
|
|
|
691 |
msgid "Preview"
|
692 |
msgstr "Vorschau"
|
693 |
|
694 |
+
#: lib/view/WpProQuiz_View_QuizOverall.php:64
|
695 |
msgid "Add quiz"
|
696 |
msgstr "Quiz hinzufügen"
|
697 |
|
698 |
+
#: lib/view/WpProQuiz_View_QuizOverall.php:66
|
699 |
+
#: lib/view/WpProQuiz_View_QuizOverall.php:70
|
700 |
+
msgid "Export"
|
701 |
+
msgstr "Export"
|
702 |
+
|
703 |
+
#: lib/view/WpProQuiz_View_QuizOverall.php:71
|
704 |
+
msgid ""
|
705 |
+
"Choose the respective question, which you would like to export and press on "
|
706 |
+
"\"Start export\""
|
707 |
+
msgstr ""
|
708 |
+
"Wählen Sie oben die entsprechen Quiz aus, die Sie exportieren möchten und "
|
709 |
+
"klicken Sie anschliessen auf \"Export starten\""
|
710 |
+
|
711 |
+
#: lib/view/WpProQuiz_View_QuizOverall.php:75
|
712 |
+
msgid "Start export"
|
713 |
+
msgstr "Export starten"
|
714 |
+
|
715 |
+
#: lib/view/WpProQuiz_View_QuizOverall.php:81
|
716 |
+
msgid "Import only *.wpq files from known and trusted sources."
|
717 |
+
msgstr ""
|
718 |
+
"Importieren sie nur *.wpq Dateien aus bekannten und vertrauenswürdigen "
|
719 |
+
"Quellen."
|
720 |
+
|
721 |
+
#: lib/view/WpProQuiz_View_QuizOverall.php:89
|
722 |
+
#, php-format
|
723 |
+
msgid "Maximal %d MiB"
|
724 |
+
msgstr "Maximal %d MiB"
|
725 |
+
|
726 |
#: lib/view/WpProQuiz_View_Statistics.php:7
|
727 |
#, php-format
|
728 |
msgid "Quiz: %s - Statistics"
|
748 |
msgid "Reset statistics"
|
749 |
msgstr "Statistik zurücksetzen"
|
750 |
|
751 |
+
#~ msgid "One question is one point"
|
752 |
+
#~ msgstr "Eine Frage ist 1 Punkt"
|
753 |
+
|
754 |
#~ msgid "Right"
|
755 |
#~ msgstr "Richtig"
|
756 |
|
lib/controller/WpProQuiz_Controller_Admin.php
CHANGED
@@ -38,7 +38,9 @@ class WpProQuiz_Controller_Admin {
|
|
38 |
'no_correct_msg' => __('Correct answer was not selected!', 'wp-pro-quiz'),
|
39 |
'no_answer_msg' => __('No answer deposited!', 'wp-pro-quiz'),
|
40 |
'no_quiz_start_msg' => __('No quiz description filled!', 'wp-pro-quiz'),
|
41 |
-
'fail_grade_result' => __('The percent values in result text are incorrect.', 'wp-pro-quiz')
|
|
|
|
|
42 |
);
|
43 |
|
44 |
wp_localize_script('wpProQuiz_admin_javascript', 'wpProQuizLocalize', $translation_array);
|
@@ -93,6 +95,9 @@ class WpProQuiz_Controller_Admin {
|
|
93 |
case 'statistics':
|
94 |
$c = new WpProQuiz_Controller_Statistics();
|
95 |
break;
|
|
|
|
|
|
|
96 |
}
|
97 |
|
98 |
if($c !== null) {
|
38 |
'no_correct_msg' => __('Correct answer was not selected!', 'wp-pro-quiz'),
|
39 |
'no_answer_msg' => __('No answer deposited!', 'wp-pro-quiz'),
|
40 |
'no_quiz_start_msg' => __('No quiz description filled!', 'wp-pro-quiz'),
|
41 |
+
'fail_grade_result' => __('The percent values in result text are incorrect.', 'wp-pro-quiz'),
|
42 |
+
'no_nummber_points' => __('No number in the field "Points" or less than 1', 'wp-pro-quiz'),
|
43 |
+
'no_selected_quiz' => __('No quiz selected', 'wp-pro-quiz')
|
44 |
);
|
45 |
|
46 |
wp_localize_script('wpProQuiz_admin_javascript', 'wpProQuizLocalize', $translation_array);
|
95 |
case 'statistics':
|
96 |
$c = new WpProQuiz_Controller_Statistics();
|
97 |
break;
|
98 |
+
case 'importExport':
|
99 |
+
$c = new WpProQuiz_Controller_ImportExport();
|
100 |
+
break;
|
101 |
}
|
102 |
|
103 |
if($c !== null) {
|
lib/controller/WpProQuiz_Controller_ImportExport.php
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class WpProQuiz_Controller_ImportExport extends WpProQuiz_Controller_Controller {
|
3 |
+
|
4 |
+
public function route() {
|
5 |
+
|
6 |
+
@set_time_limit(0);
|
7 |
+
@ini_set('memory_limit', '128M');
|
8 |
+
|
9 |
+
if(!isset($_GET['action']) || $_GET['action'] != 'import' && $_GET['action'] != 'export') {
|
10 |
+
wp_die("Error");
|
11 |
+
}
|
12 |
+
|
13 |
+
if($_GET['action'] == 'export') {
|
14 |
+
$this->handleExport();
|
15 |
+
} else {
|
16 |
+
$this->handleImport();
|
17 |
+
}
|
18 |
+
}
|
19 |
+
|
20 |
+
private function handleExport() {
|
21 |
+
$export = new WpProQuiz_Helper_Export();
|
22 |
+
|
23 |
+
$a = $export->export($this->_post['exportIds']);
|
24 |
+
|
25 |
+
$filename = 'WpProQuiz_export_'.time().'.wpq';
|
26 |
+
|
27 |
+
header('Content-Type: application/octet-stream');
|
28 |
+
header('Content-Disposition: attachment; filename="'.$filename.'"');
|
29 |
+
|
30 |
+
echo $a;
|
31 |
+
|
32 |
+
exit;
|
33 |
+
}
|
34 |
+
|
35 |
+
private function handleImport() {
|
36 |
+
|
37 |
+
$this->view = new WpProQuiz_View_Import();
|
38 |
+
$this->view->error = false;
|
39 |
+
|
40 |
+
$import = new WpProQuiz_Helper_Import();
|
41 |
+
|
42 |
+
if(isset($_FILES, $_FILES['import']) && $_FILES['import']['error'] == 0) {
|
43 |
+
if($import->setImportFileUpload($_FILES['import']) === false) {
|
44 |
+
$this->view->error = $import->getError();
|
45 |
+
} else {
|
46 |
+
$data = $import->getImportData();
|
47 |
+
|
48 |
+
if($data === false) {
|
49 |
+
$this->view->error = $import->getError();
|
50 |
+
}
|
51 |
+
|
52 |
+
$this->view->import = $data;
|
53 |
+
$this->view->importData = $import->getContent();
|
54 |
+
|
55 |
+
unset($data);
|
56 |
+
}
|
57 |
+
} else if(isset($this->_post, $this->_post['importSave'])) {
|
58 |
+
if($import->setImportString($this->_post['importData']) === false) {
|
59 |
+
$this->view->error = $import->getError();
|
60 |
+
} else {
|
61 |
+
$ids = isset($this->_post['importItems']) ? $this->_post['importItems'] : false;
|
62 |
+
|
63 |
+
if($ids !== false && $import->saveImport($ids) === false) {
|
64 |
+
$this->view->error = $import->getError();
|
65 |
+
} else {
|
66 |
+
$this->view->finish = true;
|
67 |
+
}
|
68 |
+
}
|
69 |
+
} else {
|
70 |
+
$this->view->error = __('File cannot be processed', 'wp-pro-quiz');
|
71 |
+
}
|
72 |
+
|
73 |
+
$this->view->show();
|
74 |
+
}
|
75 |
+
}
|
lib/controller/WpProQuiz_Controller_Question.php
CHANGED
@@ -118,31 +118,33 @@ class WpProQuiz_Controller_Question extends WpProQuiz_Controller_Controller {
|
|
118 |
}
|
119 |
|
120 |
public function clearPost($post) {
|
|
|
|
|
121 |
switch($post['answerType']) {
|
|
|
|
|
122 |
case 'single':
|
123 |
case 'multiple':
|
124 |
-
|
125 |
-
unset($post['answerJson']['free_answer']);
|
126 |
-
unset($post['answerJson']['matrix_sort_answer']);
|
127 |
break;
|
128 |
case 'free_answer':
|
129 |
-
|
130 |
-
unset($post['answerJson']['classic_answer']);
|
131 |
-
unset($post['answerJson']['matrix_sort_answer']);
|
132 |
break;
|
133 |
case 'sort_answer':
|
134 |
-
|
135 |
-
unset($post['answerJson']['classic_answer']);
|
136 |
-
unset($post['answerJson']['matrix_sort_answer']);
|
137 |
break;
|
138 |
case 'matrix_sort_answer':
|
139 |
-
|
140 |
-
|
141 |
-
|
|
|
142 |
break;
|
143 |
|
144 |
}
|
145 |
-
|
|
|
|
|
|
|
146 |
$post['answerJson'] = $this->clear($post['answerJson']);
|
147 |
$post['quizId'] = $this->_quizId;
|
148 |
|
118 |
}
|
119 |
|
120 |
public function clearPost($post) {
|
121 |
+
$j = array();
|
122 |
+
|
123 |
switch($post['answerType']) {
|
124 |
+
|
125 |
+
|
126 |
case 'single':
|
127 |
case 'multiple':
|
128 |
+
$j = array('classic_answer' => $post['answerJson']['classic_answer']);
|
|
|
|
|
129 |
break;
|
130 |
case 'free_answer':
|
131 |
+
$j = array('free_answer' => $post['answerJson']['free_answer']);
|
|
|
|
|
132 |
break;
|
133 |
case 'sort_answer':
|
134 |
+
$j = array('answer_sort' => $post['answerJson']['answer_sort']);
|
|
|
|
|
135 |
break;
|
136 |
case 'matrix_sort_answer':
|
137 |
+
$j = array('answer_matrix_sort' => $post['answerJson']['answer_matrix_sort']);
|
138 |
+
break;
|
139 |
+
case 'cloze_answer':
|
140 |
+
$j = array('answer_cloze' => $post['answerJson']['answer_cloze']);
|
141 |
break;
|
142 |
|
143 |
}
|
144 |
+
|
145 |
+
unset($post['answerJson']);
|
146 |
+
|
147 |
+
$post['answerJson'] = $j;
|
148 |
$post['answerJson'] = $this->clear($post['answerJson']);
|
149 |
$post['quizId'] = $this->_quizId;
|
150 |
|
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;
|
@@ -62,6 +62,7 @@ class WpProQuiz_Helper_DbUpgrade {
|
|
62 |
`time_limit` int(11) NOT NULL,
|
63 |
`statistics_on` tinyint(1) NOT NULL,
|
64 |
`statistics_ip_lock` int(10) unsigned NOT NULL,
|
|
|
65 |
PRIMARY KEY (`id`)
|
66 |
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
67 |
|
@@ -73,6 +74,7 @@ class WpProQuiz_Helper_DbUpgrade {
|
|
73 |
`quiz_id` int(11) NOT NULL,
|
74 |
`sort` tinyint(3) unsigned NOT NULL,
|
75 |
`title` varchar(200) NOT NULL,
|
|
|
76 |
`question` text NOT NULL,
|
77 |
`correct_msg` text NOT NULL,
|
78 |
`incorrect_msg` text NOT NULL,
|
@@ -190,4 +192,23 @@ class WpProQuiz_Helper_DbUpgrade {
|
|
190 |
|
191 |
return 6;
|
192 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
193 |
}
|
1 |
<?php
|
2 |
class WpProQuiz_Helper_DbUpgrade {
|
3 |
|
4 |
+
const WPPROQUIZ_DB_VERSION = 7;
|
5 |
|
6 |
private $_wpdb;
|
7 |
private $_prefix;
|
62 |
`time_limit` int(11) NOT NULL,
|
63 |
`statistics_on` tinyint(1) NOT NULL,
|
64 |
`statistics_ip_lock` int(10) unsigned NOT NULL,
|
65 |
+
`show_points` tinyint(1) NOT NULL,
|
66 |
PRIMARY KEY (`id`)
|
67 |
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
68 |
|
74 |
`quiz_id` int(11) NOT NULL,
|
75 |
`sort` tinyint(3) unsigned NOT NULL,
|
76 |
`title` varchar(200) NOT NULL,
|
77 |
+
`points` int(11) NOT NULL,
|
78 |
`question` text NOT NULL,
|
79 |
`correct_msg` text NOT NULL,
|
80 |
`incorrect_msg` text NOT NULL,
|
192 |
|
193 |
return 6;
|
194 |
}
|
195 |
+
|
196 |
+
private function upgradeDbV6() {
|
197 |
+
|
198 |
+
$this->_wpdb->query('
|
199 |
+
ALTER TABLE `'.$this->_wpdb->prefix.'wp_pro_quiz_question`
|
200 |
+
ADD `points` INT NOT NULL AFTER `title`
|
201 |
+
');
|
202 |
+
|
203 |
+
$this->_wpdb->query('
|
204 |
+
UPDATE `'.$this->_wpdb->prefix.'wp_pro_quiz_question` SET `points` = 1
|
205 |
+
');
|
206 |
+
|
207 |
+
$this->_wpdb->query('
|
208 |
+
ALTER TABLE `'.$this->_wpdb->prefix.'wp_pro_quiz_master`
|
209 |
+
ADD `show_points` TINYINT( 1 ) NOT NULL
|
210 |
+
');
|
211 |
+
|
212 |
+
return 7;
|
213 |
+
}
|
214 |
}
|
lib/helper/WpProQuiz_Helper_Export.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class WpProQuiz_Helper_Export {
|
3 |
+
|
4 |
+
const WPPROQUIZ_EXPORT_VERSION = 1;
|
5 |
+
|
6 |
+
public function export($ids) {
|
7 |
+
$export = array();
|
8 |
+
|
9 |
+
$export['version'] = WPPROQUIZ_VERSION;
|
10 |
+
$export['exportVersion'] = WpProQuiz_Helper_Export::WPPROQUIZ_EXPORT_VERSION;
|
11 |
+
$export['date'] = time();
|
12 |
+
|
13 |
+
$v = str_pad(WPPROQUIZ_VERSION, 5, '0', STR_PAD_LEFT);
|
14 |
+
$v .= str_pad(WpProQuiz_Helper_Export::WPPROQUIZ_EXPORT_VERSION, 5, '0', STR_PAD_LEFT);
|
15 |
+
$code = 'WPQ'.$v;
|
16 |
+
|
17 |
+
$export['master'] = $this->getQuizMaster($ids);
|
18 |
+
|
19 |
+
foreach($export['master'] as $master) {
|
20 |
+
$export['question'][$master->getId()] = $this->getQuestion($master->getId());
|
21 |
+
}
|
22 |
+
|
23 |
+
return $code.base64_encode(serialize($export));
|
24 |
+
}
|
25 |
+
|
26 |
+
private function getQuizMaster($ids) {
|
27 |
+
$m = new WpProQuiz_Model_QuizMapper();
|
28 |
+
|
29 |
+
$r = array();
|
30 |
+
|
31 |
+
foreach($ids as $id) {
|
32 |
+
$master = $m->fetch($id);
|
33 |
+
|
34 |
+
if($master->getId() > 0) {
|
35 |
+
$r[] = $master;
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
return $r;
|
40 |
+
}
|
41 |
+
|
42 |
+
public function getQuestion($quizId) {
|
43 |
+
$m = new WpProQuiz_Model_QuestionMapper();
|
44 |
+
|
45 |
+
return $m->fetchAll($quizId);
|
46 |
+
}
|
47 |
+
|
48 |
+
}
|
lib/helper/WpProQuiz_Helper_Import.php
ADDED
@@ -0,0 +1,135 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class WpProQuiz_Helper_Import {
|
3 |
+
|
4 |
+
private $_content = null;
|
5 |
+
private $_error = false;
|
6 |
+
|
7 |
+
public function setImportFileUpload($file) {
|
8 |
+
if(!is_uploaded_file($file['tmp_name'])) {
|
9 |
+
$this->setError(__('File was not uploaded', 'wp-pro-quiz'));
|
10 |
+
return false;
|
11 |
+
}
|
12 |
+
|
13 |
+
$this->_content = file_get_contents($file['tmp_name']);
|
14 |
+
|
15 |
+
return $this->checkCode();
|
16 |
+
}
|
17 |
+
|
18 |
+
public function setImportString($str) {
|
19 |
+
$this->_content = $str;
|
20 |
+
|
21 |
+
return $this->checkCode();
|
22 |
+
}
|
23 |
+
|
24 |
+
private function setError($str) {
|
25 |
+
$this->_error = $str;
|
26 |
+
}
|
27 |
+
|
28 |
+
public function getError() {
|
29 |
+
return $this->_error;
|
30 |
+
}
|
31 |
+
|
32 |
+
private function checkCode() {
|
33 |
+
$code = substr($this->_content, 0, 13);
|
34 |
+
|
35 |
+
$c = substr($code, 0, 3);
|
36 |
+
$v1 = substr($code, 3, 5);
|
37 |
+
$v2 = substr($code, 8, 5);
|
38 |
+
|
39 |
+
if($c !== 'WPQ') {
|
40 |
+
$this->setError(__('File have wrong format', 'wp-pro-quiz'));
|
41 |
+
return false;
|
42 |
+
}
|
43 |
+
|
44 |
+
return true;
|
45 |
+
}
|
46 |
+
|
47 |
+
public function getContent() {
|
48 |
+
return $this->_content;
|
49 |
+
}
|
50 |
+
|
51 |
+
public function getImportData() {
|
52 |
+
|
53 |
+
if($this->_content === null) {
|
54 |
+
$this->setError(__('File cannot be processed', 'wp-pro-quiz'));
|
55 |
+
return false;
|
56 |
+
}
|
57 |
+
|
58 |
+
$data = substr($this->_content, 13);
|
59 |
+
|
60 |
+
$b = base64_decode($data);
|
61 |
+
|
62 |
+
if($b === null) {
|
63 |
+
$this->setError(__('File cannot be processed', 'wp-pro-quiz'));
|
64 |
+
return false;
|
65 |
+
}
|
66 |
+
|
67 |
+
$check = $this->saveUnserialize($b, $o);
|
68 |
+
|
69 |
+
if($check === false || !is_array($o)) {
|
70 |
+
$this->setError(__('File cannot be processed', 'wp-pro-quiz'));
|
71 |
+
return false;
|
72 |
+
}
|
73 |
+
|
74 |
+
unset($b);
|
75 |
+
|
76 |
+
return $o;
|
77 |
+
}
|
78 |
+
|
79 |
+
public function saveImport($ids = false) {
|
80 |
+
$data = $this->getImportData();
|
81 |
+
|
82 |
+
if($data === false) {
|
83 |
+
return false;
|
84 |
+
}
|
85 |
+
|
86 |
+
switch($data['exportVersion']) {
|
87 |
+
case '1':
|
88 |
+
return $this->importDataV1($data, $ids);
|
89 |
+
break;
|
90 |
+
}
|
91 |
+
}
|
92 |
+
|
93 |
+
private function importDataV1($o, $ids = false) {
|
94 |
+
$quizMapper = new WpProQuiz_Model_QuizMapper();
|
95 |
+
$questionMapper = new WpProQuiz_Model_QuestionMapper();
|
96 |
+
|
97 |
+
foreach($o['master'] as $master) {
|
98 |
+
if(get_class($master) !== 'WpProQuiz_Model_Quiz') {
|
99 |
+
continue;
|
100 |
+
}
|
101 |
+
|
102 |
+
$oldId = $master->getId();
|
103 |
+
|
104 |
+
if($ids !== false) {
|
105 |
+
if(!in_array($oldId, $ids)) {
|
106 |
+
continue;
|
107 |
+
}
|
108 |
+
}
|
109 |
+
|
110 |
+
$master->setId(0);
|
111 |
+
|
112 |
+
$quizMapper->save($master);
|
113 |
+
|
114 |
+
foreach($o['question'][$oldId] as $question) {
|
115 |
+
|
116 |
+
if(get_class($question) !== 'WpProQuiz_Model_Question') {
|
117 |
+
continue;
|
118 |
+
}
|
119 |
+
|
120 |
+
$question->setQuizId($master->getId());
|
121 |
+
$question->setId(0);
|
122 |
+
|
123 |
+
$questionMapper->save($question);
|
124 |
+
}
|
125 |
+
}
|
126 |
+
|
127 |
+
return true;
|
128 |
+
}
|
129 |
+
|
130 |
+
private function saveUnserialize($str, &$into) {
|
131 |
+
$into = @unserialize($str);
|
132 |
+
|
133 |
+
return $into !== false || rtrim($str) === serialize(false);
|
134 |
+
}
|
135 |
+
}
|
lib/model/WpProQuiz_Model_Mapper.php
CHANGED
@@ -11,10 +11,20 @@ class WpProQuiz_Model_Mapper {
|
|
11 |
*/
|
12 |
protected $_prefix;
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
function __construct() {
|
15 |
global $wpdb;
|
16 |
|
17 |
$this->_wpdb = $wpdb;
|
18 |
$this->_prefix = $wpdb->prefix.'wp_pro_quiz_';
|
|
|
|
|
|
|
19 |
}
|
20 |
}
|
11 |
*/
|
12 |
protected $_prefix;
|
13 |
|
14 |
+
/**
|
15 |
+
* @var string
|
16 |
+
*/
|
17 |
+
protected $_tableQuestion;
|
18 |
+
protected $_tableMaster;
|
19 |
+
|
20 |
+
|
21 |
function __construct() {
|
22 |
global $wpdb;
|
23 |
|
24 |
$this->_wpdb = $wpdb;
|
25 |
$this->_prefix = $wpdb->prefix.'wp_pro_quiz_';
|
26 |
+
|
27 |
+
$this->_tableQuestion = $this->_prefix.'question';
|
28 |
+
$this->_tableMaster = $this->_prefix.'master';
|
29 |
}
|
30 |
}
|
lib/model/WpProQuiz_Model_Question.php
CHANGED
@@ -15,6 +15,7 @@ class WpProQuiz_Model_Question extends WpProQuiz_Model_Model {
|
|
15 |
protected $_tipEnabled = false;
|
16 |
protected $_tipMsg;
|
17 |
protected $_tipCount;
|
|
|
18 |
|
19 |
public function setId($_id)
|
20 |
{
|
@@ -169,4 +170,14 @@ class WpProQuiz_Model_Question extends WpProQuiz_Model_Model {
|
|
169 |
public function getTipCount() {
|
170 |
return $this->_tipCount;
|
171 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
172 |
}
|
15 |
protected $_tipEnabled = false;
|
16 |
protected $_tipMsg;
|
17 |
protected $_tipCount;
|
18 |
+
protected $_points = 1;
|
19 |
|
20 |
public function setId($_id)
|
21 |
{
|
170 |
public function getTipCount() {
|
171 |
return $this->_tipCount;
|
172 |
}
|
173 |
+
|
174 |
+
public function setPoints($_points)
|
175 |
+
{
|
176 |
+
$this->_points = (int)$_points;
|
177 |
+
return $this;
|
178 |
+
}
|
179 |
+
|
180 |
+
public function getPoints() {
|
181 |
+
return $this->_points;
|
182 |
+
}
|
183 |
}
|
lib/model/WpProQuiz_Model_QuestionMapper.php
CHANGED
@@ -28,6 +28,7 @@ class WpProQuiz_Model_QuestionMapper extends WpProQuiz_Model_Mapper {
|
|
28 |
$this->_table,
|
29 |
array(
|
30 |
'title' => $question->getTitle(),
|
|
|
31 |
'question' => $question->getQuestion(),
|
32 |
'correct_msg' => $question->getCorrectMsg(),
|
33 |
'incorrect_msg' => $question->getIncorrectMsg(),
|
@@ -37,13 +38,14 @@ class WpProQuiz_Model_QuestionMapper extends WpProQuiz_Model_Mapper {
|
|
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(
|
44 |
'quiz_id' => $question->getQuizId(),
|
45 |
'sort' => $this->count($question->getQuizId()),
|
46 |
'title' => $question->getTitle(),
|
|
|
47 |
'question' => $question->getQuestion(),
|
48 |
'correct_msg' => $question->getCorrectMsg(),
|
49 |
'incorrect_msg' => $question->getIncorrectMsg(),
|
@@ -53,7 +55,7 @@ class WpProQuiz_Model_QuestionMapper extends WpProQuiz_Model_Mapper {
|
|
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);
|
28 |
$this->_table,
|
29 |
array(
|
30 |
'title' => $question->getTitle(),
|
31 |
+
'points' => $question->getPoints(),
|
32 |
'question' => $question->getQuestion(),
|
33 |
'correct_msg' => $question->getCorrectMsg(),
|
34 |
'incorrect_msg' => $question->getIncorrectMsg(),
|
38 |
'answer_type' => $question->getAnswerType(),
|
39 |
'answer_json' => json_encode($question->getAnswerJson())),
|
40 |
array('id' => $question->getId()),
|
41 |
+
array('%s', '%d', '%s', '%s', '%s', '%d', '%d', '%s', '%s', '%s'),
|
42 |
array('%d'));
|
43 |
} else {
|
44 |
$id = $this->_wpdb->insert($this->_table, array(
|
45 |
'quiz_id' => $question->getQuizId(),
|
46 |
'sort' => $this->count($question->getQuizId()),
|
47 |
'title' => $question->getTitle(),
|
48 |
+
'points' => $question->getPoints(),
|
49 |
'question' => $question->getQuestion(),
|
50 |
'correct_msg' => $question->getCorrectMsg(),
|
51 |
'incorrect_msg' => $question->getIncorrectMsg(),
|
55 |
'answer_type' => $question->getAnswerType(),
|
56 |
'answer_json' => json_encode($question->getAnswerJson())
|
57 |
),
|
58 |
+
array('%d', '%d', '%s', '%d', '%s', '%s', '%s', '%d', '%d', '%s', '%s', '%s')
|
59 |
);
|
60 |
|
61 |
$question->setId($id);
|
lib/model/WpProQuiz_Model_Quiz.php
CHANGED
@@ -14,6 +14,7 @@ class WpProQuiz_Model_Quiz extends WpProQuiz_Model_Model {
|
|
14 |
protected $_statisticsOn;
|
15 |
protected $_statisticsIpLock;
|
16 |
protected $_resultGradeEnabled = false;
|
|
|
17 |
|
18 |
public function getId() {
|
19 |
return $this->_id;
|
@@ -131,4 +132,25 @@ class WpProQuiz_Model_Quiz extends WpProQuiz_Model_Model {
|
|
131 |
public function isResultGradeEnabled() {
|
132 |
return $this->_resultGradeEnabled;
|
133 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
}
|
14 |
protected $_statisticsOn;
|
15 |
protected $_statisticsIpLock;
|
16 |
protected $_resultGradeEnabled = false;
|
17 |
+
protected $_showPoints = false;
|
18 |
|
19 |
public function getId() {
|
20 |
return $this->_id;
|
132 |
public function isResultGradeEnabled() {
|
133 |
return $this->_resultGradeEnabled;
|
134 |
}
|
135 |
+
|
136 |
+
public function setShowPoints($_showPoints) {
|
137 |
+
$this->_showPoints = (bool)$_showPoints;
|
138 |
+
return $this;
|
139 |
+
}
|
140 |
+
|
141 |
+
public function isShowPoints() {
|
142 |
+
return $this->_showPoints;
|
143 |
+
}
|
144 |
+
|
145 |
+
public function fetchSumQuestionPoints() {
|
146 |
+
$m = new WpProQuiz_Model_QuizMapper();
|
147 |
+
|
148 |
+
return $m->sumQuestionPoints($this->_id);
|
149 |
+
}
|
150 |
+
|
151 |
+
public function fetchCountQuestions() {
|
152 |
+
$m = new WpProQuiz_Model_QuizMapper();
|
153 |
+
|
154 |
+
return $m->countQuestion($this->_id);
|
155 |
+
}
|
156 |
}
|
lib/model/WpProQuiz_Model_QuizMapper.php
CHANGED
@@ -74,21 +74,39 @@ class WpProQuiz_Model_QuizMapper extends WpProQuiz_Model_Mapper
|
|
74 |
'time_limit' => (int)$data->getTimeLimit(),
|
75 |
'statistics_on' => (int)$data->isStatisticsOn(),
|
76 |
'statistics_ip_lock' => (int)$data->getStatisticsIpLock(),
|
77 |
-
'result_grade_enabled' => (int)$data->isResultGradeEnabled()
|
|
|
78 |
);
|
79 |
|
80 |
if($data->getId() != 0) {
|
81 |
-
|
82 |
$set,
|
83 |
array(
|
84 |
'id' => $data->getId()
|
85 |
),
|
86 |
-
array('%s', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d'),
|
87 |
array('%d'));
|
88 |
} else {
|
89 |
-
|
90 |
-
|
91 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
}
|
94 |
}
|
74 |
'time_limit' => (int)$data->getTimeLimit(),
|
75 |
'statistics_on' => (int)$data->isStatisticsOn(),
|
76 |
'statistics_ip_lock' => (int)$data->getStatisticsIpLock(),
|
77 |
+
'result_grade_enabled' => (int)$data->isResultGradeEnabled(),
|
78 |
+
'show_points' => (int)$data->isShowPoints()
|
79 |
);
|
80 |
|
81 |
if($data->getId() != 0) {
|
82 |
+
$result = $this->_wpdb->update($this->_table,
|
83 |
$set,
|
84 |
array(
|
85 |
'id' => $data->getId()
|
86 |
),
|
87 |
+
array('%s', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d'),
|
88 |
array('%d'));
|
89 |
} else {
|
90 |
+
|
91 |
+
$result = $this->_wpdb->insert($this->_table,
|
92 |
+
$set,
|
93 |
+
array('%s', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d'));
|
94 |
+
|
95 |
+
$data->setId($this->_wpdb->insert_id);
|
96 |
+
}
|
97 |
+
|
98 |
+
if($result === false) {
|
99 |
+
return null;
|
100 |
}
|
101 |
+
|
102 |
+
return $data;
|
103 |
+
}
|
104 |
+
|
105 |
+
public function sumQuestionPoints($id) {
|
106 |
+
return $this->_wpdb->get_var($this->_wpdb->prepare("SELECT SUM(points) FROM {$this->_tableQuestion} WHERE quiz_id = %d", $id));
|
107 |
+
}
|
108 |
+
|
109 |
+
public function countQuestion($id) {
|
110 |
+
return $this->_wpdb->get_var($this->_wpdb->prepare("SELECT COUNT(*) FROM {$this->_tableQuestion} WHERE quiz_id = %d", $id));
|
111 |
}
|
112 |
}
|
lib/view/WpProQuiz_View_FrontQuiz.php
CHANGED
@@ -8,6 +8,7 @@ class WpProQuiz_View_FrontQuiz extends WpProQuiz_View_View {
|
|
8 |
$a = array();
|
9 |
$a['answer_type'] = $q->getAnswerType();
|
10 |
$a['id'] = $q->getId();
|
|
|
11 |
$j = $q->getAnswerJson();
|
12 |
|
13 |
switch ($q->getAnswerType()) {
|
@@ -31,7 +32,7 @@ class WpProQuiz_View_FrontQuiz extends WpProQuiz_View_View {
|
|
31 |
|
32 |
$r[] = $a;
|
33 |
}
|
34 |
-
|
35 |
return $r;
|
36 |
}
|
37 |
|
@@ -70,13 +71,16 @@ class WpProQuiz_View_FrontQuiz extends WpProQuiz_View_View {
|
|
70 |
<div class="wpProQuiz_results">
|
71 |
<h3><?php _e('Results', 'wp-pro-quiz'); ?></h3>
|
72 |
<p>
|
73 |
-
<?php printf(__('%s of %s questions answered correctly', 'wp-pro-quiz'), '<span class="
|
|
|
|
|
|
|
74 |
</p>
|
75 |
<p class="wpProQuiz_time_limit_expired">
|
76 |
<?php _e('Time has elapsed', 'wp-pro-quiz'); ?>
|
77 |
</p>
|
78 |
-
<p class="
|
79 |
-
<?php _e('
|
80 |
</p>
|
81 |
<div>
|
82 |
<ul class="wpProQuiz_resultsList">
|
@@ -109,6 +113,11 @@ class WpProQuiz_View_FrontQuiz extends WpProQuiz_View_View {
|
|
109 |
<li class="wpProQuiz_listItem">
|
110 |
<div class="wpProQuiz_question_page">
|
111 |
<?php printf(__('Question %s of %s', 'wp-pro-quiz'), '<span>'.$index.'</span>', '<span>'.$question_count.'</span>'); ?>
|
|
|
|
|
|
|
|
|
|
|
112 |
</div>
|
113 |
<h3><span><?php echo $index; ?></span>. <?php _e('Question', 'wp-pro-quiz'); ?></h3>
|
114 |
<div class="wpProQuiz_question">
|
@@ -176,8 +185,21 @@ class WpProQuiz_View_FrontQuiz extends WpProQuiz_View_View {
|
|
176 |
</tbody>
|
177 |
</table>
|
178 |
</li>
|
179 |
-
|
180 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
</ul>
|
182 |
</div>
|
183 |
<div class="wpProQuiz_response">
|
@@ -242,7 +264,6 @@ jQuery(document).ready(function($) {
|
|
242 |
json: <?php echo $json; ?>
|
243 |
});
|
244 |
});
|
245 |
-
|
246 |
</script>
|
247 |
<?php
|
248 |
}
|
8 |
$a = array();
|
9 |
$a['answer_type'] = $q->getAnswerType();
|
10 |
$a['id'] = $q->getId();
|
11 |
+
$a['points'] = $q->getPoints();
|
12 |
$j = $q->getAnswerJson();
|
13 |
|
14 |
switch ($q->getAnswerType()) {
|
32 |
|
33 |
$r[] = $a;
|
34 |
}
|
35 |
+
|
36 |
return $r;
|
37 |
}
|
38 |
|
71 |
<div class="wpProQuiz_results">
|
72 |
<h3><?php _e('Results', 'wp-pro-quiz'); ?></h3>
|
73 |
<p>
|
74 |
+
<?php printf(__('%s of %s questions answered correctly', 'wp-pro-quiz'), '<span class="wpProQuiz_correct_answer"></span>', '<span>'.$question_count.'</span>'); ?>
|
75 |
+
</p>
|
76 |
+
<p class="wpProQuiz_quiz_time">
|
77 |
+
<?php _e('Your time: <span></span>', 'wp-pro-quiz') ?>
|
78 |
</p>
|
79 |
<p class="wpProQuiz_time_limit_expired">
|
80 |
<?php _e('Time has elapsed', 'wp-pro-quiz'); ?>
|
81 |
</p>
|
82 |
+
<p class="wpProQuiz_points">
|
83 |
+
<?php _e('You have reached <span></span> of <span></span> points, (<span></span>%)', 'wp-pro-quiz') ?>
|
84 |
</p>
|
85 |
<div>
|
86 |
<ul class="wpProQuiz_resultsList">
|
113 |
<li class="wpProQuiz_listItem">
|
114 |
<div class="wpProQuiz_question_page">
|
115 |
<?php printf(__('Question %s of %s', 'wp-pro-quiz'), '<span>'.$index.'</span>', '<span>'.$question_count.'</span>'); ?>
|
116 |
+
|
117 |
+
<?php if($this->quiz->isShowPoints()) { ?>
|
118 |
+
<span style="float:right;"><?php printf(__('%d points', 'wp-pro-quiz'), $question->getPoints()); ?></span>
|
119 |
+
<div style="clear: right;"></div>
|
120 |
+
<?php } ?>
|
121 |
</div>
|
122 |
<h3><span><?php echo $index; ?></span>. <?php _e('Question', 'wp-pro-quiz'); ?></h3>
|
123 |
<div class="wpProQuiz_question">
|
185 |
</tbody>
|
186 |
</table>
|
187 |
</li>
|
188 |
+
<?php } } else if($question->getAnswerType() === 'cloze_answer') { ?>
|
189 |
+
<li class="wpProQuiz_questionListItem">
|
190 |
+
<?php
|
191 |
+
$clozeText = $answerArray['answer_cloze']['text'];
|
192 |
+
|
193 |
+
$clozeText = do_shortcode(apply_filters('comment_text', $clozeText));
|
194 |
+
|
195 |
+
$input = '<span class="wpProQuiz_cloze"><input type="text" value="">';
|
196 |
+
|
197 |
+
$clozeText = preg_replace('#\{(.*?)\}#', $input.' <span class="wpProQuiz_clozeCorrect">(\1)</span></span>', $clozeText);
|
198 |
+
|
199 |
+
echo $clozeText;
|
200 |
+
?>
|
201 |
+
</li>
|
202 |
+
<?php } ?>
|
203 |
</ul>
|
204 |
</div>
|
205 |
<div class="wpProQuiz_response">
|
264 |
json: <?php echo $json; ?>
|
265 |
});
|
266 |
});
|
|
|
267 |
</script>
|
268 |
<?php
|
269 |
}
|
lib/view/WpProQuiz_View_Import.php
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class WpProQuiz_View_Import extends WpProQuiz_View_View {
|
3 |
+
|
4 |
+
public function show() {
|
5 |
+
?>
|
6 |
+
<style>
|
7 |
+
.wpProQuiz_importList {
|
8 |
+
list-style: none;
|
9 |
+
margin: 0;
|
10 |
+
padding: 0;
|
11 |
+
}
|
12 |
+
.wpProQuiz_importList li {
|
13 |
+
float: left;
|
14 |
+
padding: 5px;
|
15 |
+
border: 1px solid #B3B3B3;
|
16 |
+
margin-right: 5px;
|
17 |
+
background-color: #DAECFF;
|
18 |
+
}
|
19 |
+
</style>
|
20 |
+
<div class="wrap wpProQuiz_importOverall">
|
21 |
+
<h2><?php _e('Import', 'wp-pro-quiz'); ?></h2>
|
22 |
+
<p><a class="button-secondary" href="admin.php?page=wpProQuiz"><?php _e('back to overview', 'wp-pro-quiz'); ?></a></p>
|
23 |
+
<?php if($this->error) { ?>
|
24 |
+
<div style="padding: 10px; background-color: rgb(255, 199, 199); margin-top: 20px; border: 1px dotted;">
|
25 |
+
<h3 style="margin-top: 0;"><?php _e('Error', 'wp-pro-quiz'); ?></h3>
|
26 |
+
<div>
|
27 |
+
<?php echo $this->error; ?>
|
28 |
+
</div>
|
29 |
+
</div>
|
30 |
+
<?php } else if($this->finish) { ?>
|
31 |
+
<div style="padding: 10px; background-color: #C7E4FF; margin-top: 20px; border: 1px dotted;">
|
32 |
+
<h3 style="margin-top: 0;"><?php _e('Successfully', 'wp-pro-quiz'); ?></h3>
|
33 |
+
<div>
|
34 |
+
<?php _e('Import completed successfully', 'wp-pro-quiz'); ?>
|
35 |
+
</div>
|
36 |
+
</div>
|
37 |
+
<?php } else { ?>
|
38 |
+
<form method="post">
|
39 |
+
<table class="wp-list-table widefat">
|
40 |
+
<thead>
|
41 |
+
<tr>
|
42 |
+
<th scope="col" width="30px"></th>
|
43 |
+
<th scope="col" width="40%"><?php _e('Quiz name', 'wp-pro-quiz'); ?></th>
|
44 |
+
<th scope="col"><?php _e('Questions', 'wp-pro-quiz'); ?></th>
|
45 |
+
</tr>
|
46 |
+
</thead>
|
47 |
+
<tbody>
|
48 |
+
<?php foreach($this->import['master'] as $master) { ?>
|
49 |
+
<tr>
|
50 |
+
<th>
|
51 |
+
<input type="checkbox" name="importItems[]" value="<?php echo $master->getId(); ?>" checked="checked">
|
52 |
+
</th>
|
53 |
+
<th><?php echo $master->getName(); ?></th>
|
54 |
+
<th>
|
55 |
+
<ul class="wpProQuiz_importList">
|
56 |
+
<?php foreach($this->import['question'][$master->getId()] as $question) { ?>
|
57 |
+
<li><?php echo $question->getTitle(); ?></li>
|
58 |
+
<?php } ?>
|
59 |
+
</ul>
|
60 |
+
<div style="clear: both;"></div>
|
61 |
+
</th>
|
62 |
+
</tr>
|
63 |
+
<?php } ?>
|
64 |
+
</tbody>
|
65 |
+
</table>
|
66 |
+
<input name="importData" value="<?php echo $this->importData; ?>" type="hidden">
|
67 |
+
<input style="margin-top: 20px;" class="button-primary" name="importSave" value="<?php echo __('Start import', 'wp-pro-quiz'); ?>" type="submit">
|
68 |
+
</form>
|
69 |
+
<?php } ?>
|
70 |
+
</div>
|
71 |
+
|
72 |
+
<?php
|
73 |
+
}
|
74 |
+
}
|
lib/view/WpProQuiz_View_QuestionEdit.php
CHANGED
@@ -22,6 +22,15 @@ jQuery(document).ready(function($) {
|
|
22 |
<input name="title" class="regular-text" value="<?php echo $this->question->getTitle(); ?>">
|
23 |
</div>
|
24 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
<div class="postbox">
|
26 |
<h3 class="hndle"><?php _e('Question', 'wp-pro-quiz'); ?> <?php _e('(required)', 'wp-pro-quiz'); ?></h3>
|
27 |
<div class="inside">
|
@@ -104,6 +113,10 @@ jQuery(document).ready(function($) {
|
|
104 |
<input type="radio" name="answerType" value="matrix_sort_answer" <?php echo ($type === 'matrix_sort_answer') ? 'checked="checked"' : ''; ?>>
|
105 |
<?php _e('"Matrix Sorting" choice', 'wp-pro-quiz'); ?>
|
106 |
</label>
|
|
|
|
|
|
|
|
|
107 |
</div>
|
108 |
</div>
|
109 |
<div class="postbox">
|
@@ -326,6 +339,15 @@ jQuery(document).ready(function($) {
|
|
326 |
</ul>
|
327 |
<input type="button" class="button-primary addAnswer" value="<?php _e('Add new answer', 'wp-pro-quiz'); ?>">
|
328 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
329 |
</div>
|
330 |
</div>
|
331 |
<input type="submit" name="submit" id="saveQuestion" class="button-primary" value="<?php _e('Save', 'wp-pro-quiz'); ?>">
|
22 |
<input name="title" class="regular-text" value="<?php echo $this->question->getTitle(); ?>">
|
23 |
</div>
|
24 |
</div>
|
25 |
+
<div class="postbox">
|
26 |
+
<h3 class="hndle"><?php _e('Points', 'wp-pro-quiz'); ?> <?php _e('(required)', 'wp-pro-quiz'); ?></h3>
|
27 |
+
<div class="inside">
|
28 |
+
<p class="description">
|
29 |
+
<?php _e('Points for this question (Standard is 1 point)', 'wp-pro-quiz'); ?>
|
30 |
+
</p>
|
31 |
+
<input name="points" class="small-text" value="<?php echo $this->question->getPoints(); ?>"> <?php _e('Points', 'wp-pro-quiz'); ?>
|
32 |
+
</div>
|
33 |
+
</div>
|
34 |
<div class="postbox">
|
35 |
<h3 class="hndle"><?php _e('Question', 'wp-pro-quiz'); ?> <?php _e('(required)', 'wp-pro-quiz'); ?></h3>
|
36 |
<div class="inside">
|
113 |
<input type="radio" name="answerType" value="matrix_sort_answer" <?php echo ($type === 'matrix_sort_answer') ? 'checked="checked"' : ''; ?>>
|
114 |
<?php _e('"Matrix Sorting" choice', 'wp-pro-quiz'); ?>
|
115 |
</label>
|
116 |
+
<label style="padding-right: 10px;">
|
117 |
+
<input type="radio" name="answerType" value="cloze_answer" <?php echo ($type === 'cloze_answer') ? 'checked="checked"' : ''; ?>>
|
118 |
+
<?php _e('Cloze', 'wp-pro-quiz'); ?>
|
119 |
+
</label>
|
120 |
</div>
|
121 |
</div>
|
122 |
<div class="postbox">
|
339 |
</ul>
|
340 |
<input type="button" class="button-primary addAnswer" value="<?php _e('Add new answer', 'wp-pro-quiz'); ?>">
|
341 |
</div>
|
342 |
+
<div class="cloze_answer">
|
343 |
+
<p class="description">
|
344 |
+
<?php _e('Enclose the searched words with { } e.g. "I {play} soccer". Capital and small letters will be ignored.', 'wp-pro-quiz'); ?>
|
345 |
+
</p>
|
346 |
+
<?php
|
347 |
+
$clozeText = isset($qa['answer_cloze'], $qa['answer_cloze']['text']) ? $qa['answer_cloze']['text'] : '';
|
348 |
+
wp_editor($clozeText, 'cloze', array('textarea_rows' => 10, 'textarea_name' => 'answerJson[answer_cloze][text]'));
|
349 |
+
?>
|
350 |
+
</div>
|
351 |
</div>
|
352 |
</div>
|
353 |
<input type="submit" name="submit" id="saveQuestion" class="button-primary" value="<?php _e('Save', 'wp-pro-quiz'); ?>">
|
lib/view/WpProQuiz_View_QuizEdit.php
CHANGED
@@ -37,6 +37,24 @@ class WpProQuiz_View_QuizEdit extends WpProQuiz_View_View {
|
|
37 |
</fieldset>
|
38 |
</td>
|
39 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
<tr>
|
41 |
<th scope="row">
|
42 |
<?php _e('Display question randomly', 'wp-pro-quiz'); ?>
|
@@ -191,7 +209,10 @@ class WpProQuiz_View_QuizEdit extends WpProQuiz_View_View {
|
|
191 |
<strong><?php _e('Hint:', 'wp-pro-quiz'); ?></strong>
|
192 |
<ul style="list-style-type: square; padding: 5px; margin-left: 20px; margin-top: 0;">
|
193 |
<li><?php _e('Maximal 15 levels', 'wp-pro-quiz'); ?></li>
|
194 |
-
<li
|
|
|
|
|
|
|
195 |
<li><?php _e('Values can also be mixed up', 'wp-pro-quiz'); ?></li>
|
196 |
<li><?php _e('10,15% or 10.15% allowed (max. two digits after the decimal point)', 'wp-pro-quiz'); ?></li>
|
197 |
</ul>
|
37 |
</fieldset>
|
38 |
</td>
|
39 |
</tr>
|
40 |
+
<tr>
|
41 |
+
<th scope="row">
|
42 |
+
<?php _e('Show points', 'wp-pro-quiz'); ?>
|
43 |
+
</th>
|
44 |
+
<td>
|
45 |
+
<fieldset>
|
46 |
+
<legend class="screen-reader-text">
|
47 |
+
<span><?php _e('Show points', 'wp-pro-quiz'); ?></span>
|
48 |
+
</legend>
|
49 |
+
<label for="show_points">
|
50 |
+
<input type="checkbox" id="show_points" value="1" name="showPoints" <?php echo $this->quiz->isShowPoints() ? 'checked="checked"' : '' ?> >
|
51 |
+
</label>
|
52 |
+
<p class="description">
|
53 |
+
<?php _e('Shows in quiz, how many points are reachable for respective question.', 'wp-pro-quiz'); ?>
|
54 |
+
</p>
|
55 |
+
</fieldset>
|
56 |
+
</td>
|
57 |
+
</tr>
|
58 |
<tr>
|
59 |
<th scope="row">
|
60 |
<?php _e('Display question randomly', 'wp-pro-quiz'); ?>
|
209 |
<strong><?php _e('Hint:', 'wp-pro-quiz'); ?></strong>
|
210 |
<ul style="list-style-type: square; padding: 5px; margin-left: 20px; margin-top: 0;">
|
211 |
<li><?php _e('Maximal 15 levels', 'wp-pro-quiz'); ?></li>
|
212 |
+
<li>
|
213 |
+
<?php printf(__('Percentages refer to the total score of the quiz. (Current total %d points in %d questions.', 'wp-pro-quiz'),
|
214 |
+
$this->quiz->fetchSumQuestionPoints(), $this->quiz->fetchCountQuestions()); ?>
|
215 |
+
</li>
|
216 |
<li><?php _e('Values can also be mixed up', 'wp-pro-quiz'); ?></li>
|
217 |
<li><?php _e('10,15% or 10.15% allowed (max. two digits after the decimal point)', 'wp-pro-quiz'); ?></li>
|
218 |
</ul>
|
lib/view/WpProQuiz_View_QuizOverall.php
CHANGED
@@ -4,11 +4,36 @@ class WpProQuiz_View_QuizOverall extends WpProQuiz_View_View {
|
|
4 |
|
5 |
public function show() {
|
6 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
<div class="wrap wpProQuiz_quizOverall">
|
8 |
<h2><?php _e('Quiz overview', 'wp-pro-quiz'); ?></h2>
|
9 |
<table class="wp-list-table widefat">
|
10 |
<thead>
|
11 |
<tr>
|
|
|
12 |
<th scope="col"><?php _e('ID', 'wp-pro-quiz'); ?></th>
|
13 |
<th scope="col"><?php _e('Shortcode', 'wp-pro-quiz'); ?></th>
|
14 |
<th scope="col"><?php _e('Name', 'wp-pro-quiz'); ?></th>
|
@@ -20,9 +45,10 @@ class WpProQuiz_View_QuizOverall extends WpProQuiz_View_View {
|
|
20 |
foreach ($this->quiz as $quiz) {
|
21 |
?>
|
22 |
<tr>
|
|
|
23 |
<th><?php echo $quiz->getId(); ?></th>
|
24 |
<th>[WpProQuiz <?php echo $quiz->getId(); ?>]</th>
|
25 |
-
<th><?php echo $quiz->getName(); ?></th>
|
26 |
<th>
|
27 |
<a class="button-secondary" href="admin.php?page=wpProQuiz&module=question&quiz_id=<?php echo $quiz->getId(); ?>"><?php _e('Questions', 'wp-pro-quiz'); ?></a>
|
28 |
<a class="button-secondary" href="admin.php?page=wpProQuiz&action=edit&id=<?php echo $quiz->getId(); ?>"><?php _e('Edit', 'wp-pro-quiz'); ?></a>
|
@@ -36,7 +62,35 @@ class WpProQuiz_View_QuizOverall extends WpProQuiz_View_View {
|
|
36 |
</table>
|
37 |
<p>
|
38 |
<a class="button-secondary" href="admin.php?page=wpProQuiz&action=add"><?php echo __('Add quiz', 'wp-pro-quiz'); ?></a>
|
|
|
|
|
39 |
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
</div>
|
41 |
|
42 |
<?php
|
4 |
|
5 |
public function show() {
|
6 |
?>
|
7 |
+
<style>
|
8 |
+
.wpProQuiz_exportList ul {
|
9 |
+
list-style: none;
|
10 |
+
margin: 0;
|
11 |
+
padding: 0;
|
12 |
+
}
|
13 |
+
.wpProQuiz_exportList li {
|
14 |
+
float: left;
|
15 |
+
padding: 3px;
|
16 |
+
border: 1px solid #B3B3B3;
|
17 |
+
margin-right: 5px;
|
18 |
+
background-color: #F3F3F3;
|
19 |
+
}
|
20 |
+
.wpProQuiz_exportList, .wpProQuiz_importList {
|
21 |
+
padding: 20px;
|
22 |
+
background-color: rgb(223, 238, 255);
|
23 |
+
border: 1px dotted;
|
24 |
+
margin-top: 10px;
|
25 |
+
display: none;
|
26 |
+
}
|
27 |
+
.wpProQuiz_exportCheck {
|
28 |
+
display: none;
|
29 |
+
}
|
30 |
+
</style>
|
31 |
<div class="wrap wpProQuiz_quizOverall">
|
32 |
<h2><?php _e('Quiz overview', 'wp-pro-quiz'); ?></h2>
|
33 |
<table class="wp-list-table widefat">
|
34 |
<thead>
|
35 |
<tr>
|
36 |
+
<th scope="col" class="wpProQuiz_exportCheck"><input type="checkbox" name="exportItemsAll" value="0"></th>
|
37 |
<th scope="col"><?php _e('ID', 'wp-pro-quiz'); ?></th>
|
38 |
<th scope="col"><?php _e('Shortcode', 'wp-pro-quiz'); ?></th>
|
39 |
<th scope="col"><?php _e('Name', 'wp-pro-quiz'); ?></th>
|
45 |
foreach ($this->quiz as $quiz) {
|
46 |
?>
|
47 |
<tr>
|
48 |
+
<th class="wpProQuiz_exportCheck"><input type="checkbox" name="exportItems" value="<?php echo $quiz->getId(); ?>"></th>
|
49 |
<th><?php echo $quiz->getId(); ?></th>
|
50 |
<th>[WpProQuiz <?php echo $quiz->getId(); ?>]</th>
|
51 |
+
<th class="wpProQuiz_quizName"><?php echo $quiz->getName(); ?></th>
|
52 |
<th>
|
53 |
<a class="button-secondary" href="admin.php?page=wpProQuiz&module=question&quiz_id=<?php echo $quiz->getId(); ?>"><?php _e('Questions', 'wp-pro-quiz'); ?></a>
|
54 |
<a class="button-secondary" href="admin.php?page=wpProQuiz&action=edit&id=<?php echo $quiz->getId(); ?>"><?php _e('Edit', 'wp-pro-quiz'); ?></a>
|
62 |
</table>
|
63 |
<p>
|
64 |
<a class="button-secondary" href="admin.php?page=wpProQuiz&action=add"><?php echo __('Add quiz', 'wp-pro-quiz'); ?></a>
|
65 |
+
<a class="button-secondary wpProQuiz_import" href="#"><?php echo __('Import', 'wp-pro-quiz'); ?></a>
|
66 |
+
<a class="button-secondary wpProQuiz_export" href="#"><?php echo __('Export', 'wp-pro-quiz'); ?></a>
|
67 |
</p>
|
68 |
+
<div class="wpProQuiz_exportList">
|
69 |
+
<form action="admin.php?page=wpProQuiz&module=importExport&action=export&noheader=true" method="POST">
|
70 |
+
<h3 style="margin-top: 0;"><?php _e('Export', 'wp-pro-quiz'); ?></h3>
|
71 |
+
<p><?php echo __('Choose the respective question, which you would like to export and press on "Start export"', 'wp-pro-quiz'); ?></p>
|
72 |
+
<ul></ul>
|
73 |
+
<div style="clear: both; margin-bottom: 15px;"></div>
|
74 |
+
<div id="exportHidden"></div>
|
75 |
+
<input class="button-primary" name="exportStart" id="exportStart" value="<?php echo __('Start export', 'wp-pro-quiz'); ?>" type="submit">
|
76 |
+
</form>
|
77 |
+
</div>
|
78 |
+
<div class="wpProQuiz_importList">
|
79 |
+
<form action="admin.php?page=wpProQuiz&module=importExport&action=import" method="POST" enctype="multipart/form-data">
|
80 |
+
<h3 style="margin-top: 0;"><?php _e('Import', 'wp-pro-quiz'); ?></h3>
|
81 |
+
<p><?php echo __('Import only *.wpq files from known and trusted sources.', 'wp-pro-quiz'); ?></p>
|
82 |
+
<div style="margin-bottom: 10px">
|
83 |
+
<?php
|
84 |
+
$maxUpload = (int)(ini_get('upload_max_filesize'));
|
85 |
+
$maxPost = (int)(ini_get('post_max_size'));
|
86 |
+
$memoryLimit = (int)(ini_get('memory_limit'));
|
87 |
+
$uploadMB = min($maxUpload, $maxPost, $memoryLimit);
|
88 |
+
?>
|
89 |
+
<input type="file" name="import" accept="*application/octet-stream, .wpq" required="required"> <?php printf(__('Maximal %d MiB', 'wp-pro-quiz'), $uploadMB); ?>
|
90 |
+
</div>
|
91 |
+
<input class="button-primary" name="exportStart" id="exportStart" value="<?php echo __('Start import', 'wp-pro-quiz'); ?>" type="submit">
|
92 |
+
</form>
|
93 |
+
</div>
|
94 |
</div>
|
95 |
|
96 |
<?php
|
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 |
|
@@ -19,6 +19,7 @@ A powerful and beautiful quiz plugin for WordPress.
|
|
19 |
* "Sorting" Choice
|
20 |
* "Free" Choice
|
21 |
* "Matrix Sorting" Choice
|
|
|
22 |
* Timelimit
|
23 |
* Random Answer (optional)
|
24 |
* Random Question (optional)
|
@@ -26,10 +27,12 @@ A powerful and beautiful quiz plugin for WordPress.
|
|
26 |
* Multimedia in questions
|
27 |
* Back-Button (optional)
|
28 |
* Correct / incorrect response message for all questions (optional)
|
|
|
29 |
* Result text with gradations (optional)
|
30 |
* Preview-function
|
31 |
* Statistics
|
32 |
* Hints
|
|
|
33 |
* Really nice standard design
|
34 |
* Mighty
|
35 |
|
@@ -79,4 +82,9 @@ http://www.it-gecko.de/wp-pro-quiz-quiz-plugin-fuer-wordpress.html (scroll to "D
|
|
79 |
= 0.5 =
|
80 |
* New choice: "Matrix Sorting" choice
|
81 |
* Result text now can be graduated
|
82 |
-
* CSS Bugfix
|
|
|
|
|
|
|
|
|
|
3 |
Tags: quiz
|
4 |
Requires at least: 3.3
|
5 |
Tested up to: 3.4.2
|
6 |
+
Stable tag: 0.6
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
19 |
* "Sorting" Choice
|
20 |
* "Free" Choice
|
21 |
* "Matrix Sorting" Choice
|
22 |
+
* Cloze function
|
23 |
* Timelimit
|
24 |
* Random Answer (optional)
|
25 |
* Random Question (optional)
|
27 |
* Multimedia in questions
|
28 |
* Back-Button (optional)
|
29 |
* Correct / incorrect response message for all questions (optional)
|
30 |
+
* Different valency for every question (optional)
|
31 |
* Result text with gradations (optional)
|
32 |
* Preview-function
|
33 |
* Statistics
|
34 |
* Hints
|
35 |
+
* Import / Export function
|
36 |
* Really nice standard design
|
37 |
* Mighty
|
38 |
|
82 |
= 0.5 =
|
83 |
* New choice: "Matrix Sorting" choice
|
84 |
* Result text now can be graduated
|
85 |
+
* CSS Bugfix
|
86 |
+
|
87 |
+
= 0.6 =
|
88 |
+
* For every question you can now individually be determined
|
89 |
+
* Cloze answer type added
|
90 |
+
* Import / export function added
|
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.6
|
7 |
Author: Julius Fischer
|
8 |
Author URI: http://www.it-gecko.de
|
9 |
*/
|
10 |
|
11 |
+
define('WPPROQUIZ_VERSION', '0.6');
|
12 |
|
13 |
include_once 'lib/controller/WpProQuiz_Controller_Admin.php';
|
14 |
include_once 'lib/helper/WpProQuiz_Helper_DbUpgrade.php';
|