Wp-Pro-Quiz - Version 0.13

Version Description

  • Bugfix
  • New screenshots
  • A new Touch Library was added for mobile devices
  • Statistics function has been extended
  • Setting page in case of problems added
  • "Copy questions from another Quiz" function added
  • "Execute quiz only once" option added
Download this release

Release Info

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

Code changes from version 0.12 to 0.13

Files changed (42) hide show
  1. css/wpProQuiz_front.css +7 -0
  2. css/wpProQuiz_front.min.css +1 -1
  3. js/jquery.ui.touch-punch.min.js +11 -0
  4. js/wpProQuiz_admin.js +242 -0
  5. js/wpProQuiz_admin.min.js +27 -19
  6. js/wpProQuiz_front.js +78 -25
  7. js/wpProQuiz_front.min.js +20 -19
  8. languages/wp-pro-quiz-ar.mo +0 -0
  9. languages/wp-pro-quiz-ar.po +370 -160
  10. languages/wp-pro-quiz-de_DE.mo +0 -0
  11. languages/wp-pro-quiz-de_DE.po +391 -158
  12. lib/controller/WpProQuiz_Controller_Admin.php +48 -7
  13. lib/controller/WpProQuiz_Controller_Controller.php +5 -0
  14. lib/controller/WpProQuiz_Controller_Front.php +47 -7
  15. lib/controller/WpProQuiz_Controller_GlobalSettings.php +22 -0
  16. lib/controller/WpProQuiz_Controller_Question.php +60 -0
  17. lib/controller/WpProQuiz_Controller_Quiz.php +152 -0
  18. lib/controller/WpProQuiz_Controller_Statistics.php +83 -14
  19. lib/helper/WpProQuiz_Helper_DbUpgrade.php +100 -7
  20. lib/model/WpProQuiz_Model_GlobalSettings.php +34 -0
  21. lib/model/WpProQuiz_Model_GlobalSettingsMapper.php +34 -0
  22. lib/model/WpProQuiz_Model_Lock.php +23 -0
  23. lib/model/WpProQuiz_Model_LockMapper.php +35 -18
  24. lib/model/WpProQuiz_Model_Mapper.php +4 -0
  25. lib/model/WpProQuiz_Model_QuestionMapper.php +33 -13
  26. lib/model/WpProQuiz_Model_Quiz.php +44 -0
  27. lib/model/WpProQuiz_Model_QuizMapper.php +7 -3
  28. lib/model/WpProQuiz_Model_Statistic.php +63 -0
  29. lib/model/WpProQuiz_Model_StatisticMapper.php +107 -0
  30. lib/view/WpProQuiz_View_FrontQuiz.php +9 -3
  31. lib/view/WpProQuiz_View_GobalSettings.php +114 -0
  32. lib/view/WpProQuiz_View_QuestionOverall.php +28 -0
  33. lib/view/WpProQuiz_View_QuizEdit.php +70 -2
  34. lib/view/WpProQuiz_View_QuizOverall.php +5 -2
  35. lib/view/WpProQuiz_View_Statistics.php +85 -50
  36. readme.txt +11 -2
  37. screenshot-10.png +0 -0
  38. screenshot-6.png +0 -0
  39. screenshot-7.png +0 -0
  40. screenshot-8.png +0 -0
  41. uninstall.php +5 -1
  42. wp-pro-quiz.php +2 -2
css/wpProQuiz_front.css CHANGED
@@ -202,4 +202,11 @@
202
  background-image: none !important;
203
  padding: 0 !important;
204
  margin: 0 !important;
 
 
 
 
 
 
 
205
  }
202
  background-image: none !important;
203
  padding: 0 !important;
204
  margin: 0 !important;
205
+ }
206
+ .wpProQuiz_lock {
207
+ border: 1px dotted #FFC3C3 !important;
208
+ background-color: #FFF7F7 !important;
209
+ }
210
+ .wpProQuiz_lock p {
211
+ margin: 20px !important;
212
  }
css/wpProQuiz_front.min.css CHANGED
@@ -1 +1 @@
1
- .wpProQuiz_answerCorrect{background:#6DB46D!important;font-weight:700!important;}.wpProQuiz_answerCorrect label{font-weight:700!important;}.wpProQuiz_answerIncorrect{background:#FF9191!important;font-weight:700!important;}.wpProQuiz_content{margin-top:10px!important;margin-bottom:10px!important;}.wpProQuiz_content h2{margin-bottom:10px!important;}.wpProQuiz_content input[type=button],.wpProQuiz_content input[type=button]:hover{margin:0!important;padding:5px 10px!important;background:#13455B!important;border-radius:11px!important;color:#FFF!important;font-weight:700!important;border:1px solid #13455B!important;box-shadow:1px 1px 1px #333!important;text-shadow:none!important;}.wpProQuiz_question_page{margin-bottom:10px!important;}.wpProQuiz_question_page span{font-weight:700!important;}.wpProQuiz_questionListItem{padding:3px!important;margin-bottom:5px!important;background-image:none!important;margin-left:0!important;list-style:none!important;}.wpProQuiz_questionListItem > table{border-collapse:collapse!important;margin:0!important;padding:0!important;width:100%;}.wpProQuiz_questionListItem:last-child{padding:3px!important;margin-bottom:0!important;}.wpProQuiz_list,.wpProQuiz_listItem,.wpProQuiz_questionList,.wpProQuiz_sortStringList,.wpProQuiz_sortStringList,.wpProQuiz_maxtrixSortCriterion,.wpProQuiz_resultsList{list-style:none!important;padding:0!important;margin:0!important;}.wpProQuiz_questionList{margin-bottom:10px!important;background:#F8FAF5!important;border:1px solid #C3D1A3!important;padding:5px!important;list-style:none!important;}.wpProQuiz_listItem{position:relative!important;}.wpProQuiz_response{background:#F8FAF5!important;border:1px solid #C4C4C4!important;padding:5px!important;margin-bottom:15px!important;box-shadow:1px 1px 2px #AAA!important;}.wpProQuiz_response span{font-weight:700!important;}.wpProQuiz_sort{width:25px!important;}.wpProQuiz_results h3{margin-bottom:10px!important;}.wpProQuiz_sort_correct_answer{font-weight:700!important;margin-right:5px!important;display:none!important;}.wpProQuiz_sortable,.wpProQuiz_sortStringItem{padding:5px!important;border:1px solid #D3D3D3!important;box-shadow:2px 2px 1px #EEE;background-color:#F8FAF5!important;cursor:move;}.wpProQuiz_time_limit .time{font-weight:700!important;margin-top:5px!important;margin-bottom:5px!important;}.wpProQuiz_time_limit .progress{height:10px!important;background-color:blue!important;margin-bottom:5px!important;}.wpProQuiz_time_limit_expired{font-weight:700!important;font-size:15px!important;text-align:center!important;}.wpProQuiz_question_text{margin-bottom:10px!important;}.wpProQuiz_tipp{padding:10px!important;background-color:#DDECFF!important;border:1px dotted #363636!important;border-radius:10px!important;position:absolute!important;bottom:35px!important;left:5px!important;right:5px!important;box-shadow:2px 2px 5px 0 #313131!important;z-index:99999!important;}.wpProQuiz_matrixSortString,.wpProQuiz_matrixSortString > h3{margin-bottom:10px!important;margin-top:0!important;}.wpProQuiz_matrixSortString{background:#F8FAF5!important;border:1px solid #C3D1A3!important;padding:5px!important;}.wpProQuiz_sortStringList{padding:10px!important;}.wpProQuiz_sortStringList > li{float:left!important;margin-left:5px!important;margin-right:5px!important;margin-bottom:5px!important;}.wpProQuiz_sortStringItem{margin:0!important;background-image:none!important;list-style:none!important;}.wpProQuiz_maxtrixSortCriterion{padding:5px!important;}.wpProQuiz_placehold{background-color:#FFFFC2!important;list-style:none!important;background-image:none!important;padding:5px!important;height:30px!important;min-width:50px!important;margin:0!important;}.wpProQuiz_maxtrixSortText{padding:5px!important;}.wpProQuiz_mextrixTr > td{border:1px solid #D1D1D1!important;padding:5px!important;vertical-align:middle!important;}.wpProQuiz_points{font-weight:700!important;text-align:center!important;margin-bottom:20px!important;}.wpProQuiz_cloze input{background:transparent;border:0!important;border-bottom:1px solid!important;height:18px!important;margin:0!important;padding:0 4px!important;color:#000!important;border-radius:0!important;box-shadow:0 0!important;}.wpProQuiz_cloze input:focus{outline:none!important;}.wpProQuiz_questionListItem input,.wpProQuiz_questionListItem label{margin:0!important;font-weight:400;}.wpProQuiz_resultsList > li{background-image:none!important;padding:0!important;margin:0!important;}
1
+ .wpProQuiz_answerCorrect{background:#6DB46D!important;font-weight:700!important;}.wpProQuiz_answerCorrect label{font-weight:700!important;}.wpProQuiz_answerIncorrect{background:#FF9191!important;font-weight:700!important;}.wpProQuiz_content{margin-top:10px!important;margin-bottom:10px!important;}.wpProQuiz_content h2{margin-bottom:10px!important;}.wpProQuiz_content input[type=button],.wpProQuiz_content input[type=button]:hover{margin:0!important;padding:5px 10px!important;background:#13455B!important;border-radius:11px!important;color:#FFF!important;font-weight:700!important;border:1px solid #13455B!important;box-shadow:1px 1px 1px #333!important;text-shadow:none!important;}.wpProQuiz_question_page{margin-bottom:10px!important;}.wpProQuiz_question_page span{font-weight:700!important;}.wpProQuiz_questionListItem{padding:3px!important;margin-bottom:5px!important;background-image:none!important;margin-left:0!important;list-style:none!important;}.wpProQuiz_questionListItem > table{border-collapse:collapse!important;margin:0!important;padding:0!important;width:100%;}.wpProQuiz_questionListItem:last-child{padding:3px!important;margin-bottom:0!important;}.wpProQuiz_list,.wpProQuiz_listItem,.wpProQuiz_questionList,.wpProQuiz_sortStringList,.wpProQuiz_sortStringList,.wpProQuiz_maxtrixSortCriterion,.wpProQuiz_resultsList{list-style:none!important;padding:0!important;margin:0!important;}.wpProQuiz_questionList{margin-bottom:10px!important;background:#F8FAF5!important;border:1px solid #C3D1A3!important;padding:5px!important;list-style:none!important;}.wpProQuiz_listItem{position:relative!important;}.wpProQuiz_response{background:#F8FAF5!important;border:1px solid #C4C4C4!important;padding:5px!important;margin-bottom:15px!important;box-shadow:1px 1px 2px #AAA!important;}.wpProQuiz_response span{font-weight:700!important;}.wpProQuiz_sort{width:25px!important;}.wpProQuiz_results h3{margin-bottom:10px!important;}.wpProQuiz_sort_correct_answer{font-weight:700!important;margin-right:5px!important;display:none!important;}.wpProQuiz_sortable,.wpProQuiz_sortStringItem{padding:5px!important;border:1px solid #D3D3D3!important;box-shadow:2px 2px 1px #EEE;background-color:#F8FAF5!important;cursor:move;}.wpProQuiz_time_limit .time{font-weight:700!important;margin-top:5px!important;margin-bottom:5px!important;}.wpProQuiz_time_limit .progress{height:10px!important;background-color:blue!important;margin-bottom:5px!important;}.wpProQuiz_time_limit_expired{font-weight:700!important;font-size:15px!important;text-align:center!important;}.wpProQuiz_question_text{margin-bottom:10px!important;}.wpProQuiz_tipp{padding:10px!important;background-color:#DDECFF!important;border:1px dotted #363636!important;border-radius:10px!important;position:absolute!important;bottom:35px!important;left:5px!important;right:5px!important;box-shadow:2px 2px 5px 0 #313131!important;z-index:99999!important;}.wpProQuiz_matrixSortString,.wpProQuiz_matrixSortString > h3{margin-bottom:10px!important;margin-top:0!important;}.wpProQuiz_matrixSortString{background:#F8FAF5!important;border:1px solid #C3D1A3!important;padding:5px!important;}.wpProQuiz_sortStringList{padding:10px!important;}.wpProQuiz_sortStringList > li{float:left!important;margin-left:5px!important;margin-right:5px!important;margin-bottom:5px!important;}.wpProQuiz_sortStringItem{margin:0!important;background-image:none!important;list-style:none!important;}.wpProQuiz_maxtrixSortCriterion{padding:5px!important;}.wpProQuiz_placehold{background-color:#FFFFC2!important;list-style:none!important;background-image:none!important;padding:5px!important;height:30px!important;min-width:50px!important;margin:0!important;}.wpProQuiz_maxtrixSortText{padding:5px!important;}.wpProQuiz_mextrixTr > td{border:1px solid #D1D1D1!important;padding:5px!important;vertical-align:middle!important;}.wpProQuiz_points{font-weight:700!important;text-align:center!important;margin-bottom:20px!important;}.wpProQuiz_cloze input{background:transparent;border:0!important;border-bottom:1px solid!important;height:18px!important;margin:0!important;padding:0 4px!important;color:#000!important;border-radius:0!important;box-shadow:0 0!important;}.wpProQuiz_cloze input:focus{outline:none!important;}.wpProQuiz_questionListItem input,.wpProQuiz_questionListItem label{margin:0!important;font-weight:400;}.wpProQuiz_resultsList > li{background-image:none!important;padding:0!important;margin:0!important;}.wpProQuiz_lock{border:1px dotted #FFC3C3!important;background-color:#FFF7F7!important;}.wpProQuiz_lock p{margin:20px!important;}
js/jquery.ui.touch-punch.min.js ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery UI Touch Punch 0.2.2
3
+ *
4
+ * Copyright 2011, Dave Furfero
5
+ * Dual licensed under the MIT or GPL Version 2 licenses.
6
+ *
7
+ * Depends:
8
+ * jquery.ui.widget.js
9
+ * jquery.ui.mouse.js
10
+ */
11
+ (function(b){b.support.touch="ontouchend" in document;if(!b.support.touch){return;}var c=b.ui.mouse.prototype,e=c._mouseInit,a;function d(g,h){if(g.originalEvent.touches.length>1){return;}g.preventDefault();var i=g.originalEvent.changedTouches[0],f=document.createEvent("MouseEvents");f.initMouseEvent(h,true,true,window,1,i.screenX,i.screenY,i.clientX,i.clientY,false,false,false,false,0,null);g.target.dispatchEvent(f);}c._touchStart=function(g){var f=this;if(a||!f._mouseCapture(g.originalEvent.changedTouches[0])){return;}a=true;f._touchMoved=false;d(g,"mouseover");d(g,"mousemove");d(g,"mousedown");};c._touchMove=function(f){if(!a){return;}this._touchMoved=true;d(f,"mousemove");};c._touchEnd=function(f){if(!a){return;}d(f,"mouseup");d(f,"mouseout");if(!this._touchMoved){d(f,"click");}a=false;};c._mouseInit=function(){var f=this;f.element.bind("touchstart",b.proxy(f,"_touchStart")).bind("touchmove",b.proxy(f,"_touchMove")).bind("touchend",b.proxy(f,"_touchEnd"));e.call(f);};})(jQuery);
js/wpProQuiz_admin.js CHANGED
@@ -388,6 +388,50 @@ jQuery(document).ready(function($) {
388
  $('.wpProQuiz_questionOverall tbody').children().each(function() {
389
  $t = $(this).children().first().text($(this).index() + 1);
390
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
391
  }
392
  };
393
 
@@ -409,6 +453,19 @@ jQuery(document).ready(function($) {
409
  e.preventDefault();
410
  methode.saveSort();
411
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
412
  };
413
 
414
  init();
@@ -540,6 +597,18 @@ jQuery(document).ready(function($) {
540
  }
541
 
542
  return true;
 
 
 
 
 
 
 
 
 
 
 
 
543
  }
544
 
545
  };
@@ -589,10 +658,180 @@ jQuery(document).ready(function($) {
589
  e.preventDefault();
590
  });
591
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
592
  $('#statistics_on').change();
593
  $('#wpProQuiz_resultGradeEnabled').change();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
594
  };
595
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
596
  init();
597
  };
598
 
@@ -612,4 +851,7 @@ jQuery(document).ready(function($) {
612
 
613
  if($('.wpProQuiz_questionOverall').length)
614
  $('.wpProQuiz_questionOverall').wpProQuiz_questionOverall();
 
 
 
615
  });
388
  $('.wpProQuiz_questionOverall tbody').children().each(function() {
389
  $t = $(this).children().first().text($(this).index() + 1);
390
  });
391
+ },
392
+
393
+ loadQuestionCopy: function() {
394
+ var list = $('#questionCopySelect');
395
+ var location = window.location.pathname + window.location.search;
396
+ var url = location.replace('admin.php', 'admin-ajax.php') + '&action=load_question';
397
+ var data = {
398
+ action: 'wp_pro_quiz_load_question',
399
+ excludeId: 1
400
+ };
401
+
402
+ list.hide();
403
+ list.empty();
404
+
405
+ $('#loadDataImg').show();
406
+
407
+ $.post(
408
+ url,
409
+ data,
410
+ function(json) {
411
+ $.each(json, function(i, v) {
412
+
413
+ var group = $(document.createElement('optgroup'));
414
+
415
+ group.attr('label', v.name);
416
+
417
+ $.each(v.question, function(qi, qv) {
418
+ $(document.createElement('option'))
419
+ .val(qv.id)
420
+ .text(qv.name)
421
+ .appendTo(group);
422
+
423
+
424
+ });
425
+
426
+ list.append(group);
427
+
428
+ });
429
+
430
+ $('#loadDataImg').hide();
431
+ list.show();
432
+ },
433
+ 'json'
434
+ );
435
  }
436
  };
437
 
453
  e.preventDefault();
454
  methode.saveSort();
455
  });
456
+
457
+ $('#wpProQuiz_questionCopy').click(function(e) {
458
+ var $this = $('.wpProQuiz_questionCopy');
459
+
460
+ if($this.is(':visible')) {
461
+ $this.hide();
462
+ } else {
463
+ $this.show();
464
+ methode.loadQuestionCopy();
465
+ }
466
+
467
+ e.preventDefault();
468
+ });
469
  };
470
 
471
  init();
597
  }
598
 
599
  return true;
600
+ },
601
+
602
+ resetLock: function() {
603
+ var location = window.location.pathname + window.location.search;
604
+ var url = location.replace('admin.php', 'admin-ajax.php');
605
+ url = url.replace('action=edit', 'action=reset_lock');
606
+
607
+ $.post(url, {
608
+ action: 'wp_pro_quiz_reset_lock'
609
+ }, function(data) {
610
+ $('#resetLockMsg').show('fast').delay(2000).hide('fast');
611
+ });
612
  }
613
 
614
  };
658
  e.preventDefault();
659
  });
660
 
661
+ $('input[name="quizRunOnce"]').change(function(e) {
662
+ if(this.checked) {
663
+ $('#wpProQuiz_quiz_run_once_type').show();
664
+ $('input[name="quizRunOnceType"]:checked').change();
665
+ } else {
666
+ $('#wpProQuiz_quiz_run_once_type').hide();
667
+ }
668
+ });
669
+
670
+ $('input[name="quizRunOnceType"]').change(function(e) {
671
+ if(this.checked && (this.value == "1" || this.value == "3")) {
672
+ $('#wpProQuiz_quiz_run_once_cookie').show();
673
+ } else {
674
+ $('#wpProQuiz_quiz_run_once_cookie').hide();
675
+ }
676
+ });
677
+
678
+ $('input[name="resetQuizLock"]').click(function(e) {
679
+ methode.resetLock();
680
+
681
+ return false;
682
+ });
683
+
684
  $('#statistics_on').change();
685
  $('#wpProQuiz_resultGradeEnabled').change();
686
+ $('input[name="quizRunOnce"]').change();
687
+ $('input[name="quizRunOnceType"]:checked').change();
688
+ };
689
+
690
+ init();
691
+ };
692
+
693
+ $.fn.wpProQuiz_statistics = function() {
694
+ var currectTab = 'wpProQuiz_typeAnonymeUser';
695
+
696
+ var methode = {
697
+ loadStatistics: function(userId) {
698
+ var location = window.location.pathname + window.location.search;
699
+ var url = location.replace('admin.php', 'admin-ajax.php') + '&action=load_statistics';
700
+ var data = {
701
+ action: 'wp_pro_quiz_load_statistics',
702
+ userId: userId
703
+ };
704
+
705
+ $('#wpProQuiz_loadData').show();
706
+ $('#wpProQuiz_statistics_content').hide();
707
+
708
+ $.post(
709
+ url,
710
+ data,
711
+ methode.setStatistics,
712
+ 'json'
713
+ );
714
+ },
715
+
716
+ setStatistics: function(json) {
717
+ var $table = $('.wpProQuiz_statistics_table');
718
+ var $tbody = $table.find('tbody');
719
+ var points = 0;
720
+
721
+ var setItem = function(i, j, r) {
722
+ i.find('.wpProQuiz_cCorrect').text(j.cCorrect + ' (' + j.pCorrect + '%)');;
723
+ i.find('.wpProQuiz_cIncorrect').text(j.cIncorrect + ' (' + j.pIncorrect + '%)');;
724
+ i.find('.wpProQuiz_cTip').text(j.cTip);
725
+
726
+ if(r == true) {
727
+ $table.find('.wpProQuiz_cResult').text(
728
+ (Math.round(points / i.find('.wpProQuiz_points').text() * 100 * 100) / 100)
729
+ + "%");
730
+ } else {
731
+ points += j.cCorrect * i.find('.wpProQuiz_points').text();
732
+ }
733
+ };
734
+
735
+ setItem($table, json.clear, false);
736
+
737
+ $.each(json.items, function(i, v) {
738
+ setItem($tbody.find('#wpProQuiz_tr_' + v.id), v, false);
739
+ });
740
+
741
+ setItem($table.find('tfoot'), json.global, true);
742
+
743
+ $('#wpProQuiz_loadData').hide();
744
+ $('#wpProQuiz_statistics_content').show();
745
+ },
746
+
747
+ changeTab: function(id) {
748
+ currectTab = id;
749
+
750
+ if(id == 'wpProQuiz_typeRegisteredUser') {
751
+ methode.loadStatistics($('#userSelect').val());
752
+ } else if( id == 'wpProQuiz_typeAnonymeUser') {
753
+ methode.loadStatistics(0);
754
+ } else {
755
+
756
+ }
757
+ },
758
+
759
+ resetStatistic: function(complete) {
760
+ var userId = (currectTab == 'wpProQuiz_typeRegisteredUser') ? $('#userSelect').val() : 0;
761
+ var location = window.location.pathname + window.location.search;
762
+ var url = location.replace('admin.php', 'admin-ajax.php') + '&action=reset';
763
+ var data = {
764
+ action: 'wp_pro_quiz_statistics',
765
+ userId: userId,
766
+ 'complete': complete
767
+ };
768
+
769
+ $.post(url, data, function(e) {
770
+ methode.changeTab(currectTab);
771
+ });
772
+ }
773
  };
774
 
775
+ var init = function() {
776
+ $('.wpProQuiz_tab').click(function(e) {
777
+ var $this = $(this);
778
+
779
+ if($this.hasClass('button-primary')) {
780
+ return false;
781
+ }
782
+
783
+ if($this.attr('id') == 'wpProQuiz_typeRegisteredUser') {
784
+ $('#wpProQuiz_userBox').show();
785
+ } else {
786
+ $('#wpProQuiz_userBox').hide();
787
+ }
788
+
789
+ $('.wpProQuiz_tab').removeClass('button-primary').addClass('button-secondary');
790
+ $this.removeClass('button-secondary').addClass('button-primary');
791
+
792
+ methode.changeTab($this.attr('id'));
793
+
794
+ return false;
795
+ });
796
+
797
+ $('#userSelect').change(function() {
798
+ methode.changeTab('wpProQuiz_typeRegisteredUser');
799
+ });
800
+
801
+ $('#wpProQuiz_update').click(function() {
802
+ methode.changeTab(currectTab);
803
+
804
+ return false;
805
+ });
806
+
807
+ $('#wpProQuiz_reset').click(function() {
808
+
809
+ var c =confirm(wpProQuizLocalize.reset_statistics_msg);
810
+
811
+ if(c) {
812
+ methode.resetStatistic(false);
813
+ }
814
+
815
+
816
+ return false;
817
+ });
818
+
819
+ $('#wpProQuiz_resetComplete').click(function() {
820
+
821
+ var c =confirm(wpProQuizLocalize.reset_statistics_msg);
822
+
823
+ if(c) {
824
+ methode.resetStatistic(true);
825
+ }
826
+
827
+ return false;
828
+ });
829
+
830
+
831
+
832
+ methode.changeTab('wpProQuiz_typeAnonymeUser');
833
+ };
834
+
835
  init();
836
  };
837
 
851
 
852
  if($('.wpProQuiz_questionOverall').length)
853
  $('.wpProQuiz_questionOverall').wpProQuiz_questionOverall();
854
+
855
+ if($('.wpProQuiz_statistics').length)
856
+ $('.wpProQuiz_statistics').wpProQuiz_statistics();
857
  });
js/wpProQuiz_admin.min.js CHANGED
@@ -1,19 +1,27 @@
1
- jQuery(document).ready(function(a){a.fn.wpProQuiz_preview=function(){var b={openPreview:function(d){window.open(a(d).attr("href"),"wpProQuizPreview","width=900,height=900")}};a(".wpProQuiz_prview").click(function(a){b.openPreview(this);a.preventDefault()})};a.fn.wpProQuiz_quizOverall=function(){var b={changeExport:function(d){$input=a(d);$export=a(".wpProQuiz_exportList");$ul=$export.find("ul").first();$export.find("li").remove();a('input[name="exportItems"]').each(function(){$this=a(this);if(this.checked){var c=
2
- $this.parent().parent().find(".wpProQuiz_quizName").text();a("<li>"+c+"</li>").appendTo($ul)}})},startExport:function(){$ele=a('input[name="exportItems"]:checked');if(1>$ele.length)return alert(wpProQuizLocalize.no_selected_quiz),!1;$hidden=a("#exportHidden");$hidden.html("");a('input[name="exportItems"]').each(function(){$this=a(this);this.checked&&a('<input type="hidden" value="'+this.value+'" name="exportIds[]">').appendTo($hidden)});return!0}};a(".wpProQuiz_delete").click(function(a){return!confirm(wpProQuizLocalize.delete_msg)?
3
- (a.preventDefault(),!1):!0});a(".wpProQuiz_import").click(function(b){b.preventDefault();a(".wpProQuiz_importList").toggle("fast");a(".wpProQuiz_exportList").hide();a(".wpProQuiz_exportCheck").hide()});a(".wpProQuiz_export").click(function(b){b.preventDefault();a(".wpProQuiz_exportList").toggle("fast");a(".wpProQuiz_exportCheck").toggle("fast");a(".wpProQuiz_importList").hide()});a('input[name="exportItems"]').change(function(){b.changeExport(this)});a('input[name="exportItemsAll"]').change(function(){var b=
4
- a('input[name="exportItems"]');this.checked?b.attr("checked",!0):b.attr("checked",!1);b.change()});a("#exportStart").click(function(a){b.startExport()||a.preventDefault()})};a.fn.wpProQuiz_questionEdit=function(){var b={setup:function(){a('input[name="answerType"]').click(function(){a(".answer_felder").children().css("display","none");switch(this.value){case "single":b.displaySingle("radio");break;case "multiple":b.displaySingle("checkbox");break;case "free_answer":b.displayFreeAnswer();break;case "sort_answer":b.displaySortAnswer();
5
- break;case "matrix_sort_answer":b.displayMatrixSortAnswer();break;case "cloze_answer":b.displayClozeAnswer()}});a(".addAnswer").click(function(){b.addAnswer(this)});a(".deleteAnswer").click(function(){b.deleteAnswer(this)});a("#saveQuestion").click(function(){return d()});a(".sort_answer ul, .classic_answer ul, .matrix_sort_answer ul").sortable({handle:".wpProQuiz_move",update:function(){b.setValueClassicAnswer()}});a("#wpProQuiz_correctSameText").change(function(){this.checked?a("#wpProQuiz_incorrectMassageBox").hide():
6
- a("#wpProQuiz_incorrectMassageBox").show()});a("#wpProQuiz_tip").change(function(){this.checked?a("#wpProQuiz_tipBox").show():a("#wpProQuiz_tipBox").hide()})},displaySingle:function(c){a(".classic_answer").find('input[name="answerJson[classic_answer][correct][]"]').each(function(){a("<input type="+c+" />").attr({name:this.name,value:this.value,checked:this.checked}).insertBefore(this)}).remove();a(".classic_answer").css("display","block")},displayFreeAnswer:function(){a(".free_answer").css("display",
7
- "block")},displaySortAnswer:function(){a(".sort_answer").css("display","block")},displayMatrixSortAnswer:function(){a(".matrix_sort_answer").show()},displayClozeAnswer:function(){a(".cloze_answer").show()},addAnswer:function(c){a(c).siblings("ul").children().first().clone().css("display","block").appendTo(a(c).siblings("ul"));b.setValueClassicAnswer();a(".deleteAnswer").click(function(){b.deleteAnswer(this)})},deleteAnswer:function(c){a(c).parent("li").remove();b.setValueClassicAnswer()},setValueClassicAnswer:function(){var c=
8
- 0;a('input[name="answerJson[classic_answer][correct][]"]').each(function(){this.value=c++});c=0;a('input[name="answerJson[answer_matrix_sort][sort_string_html][]"]').each(function(){this.value=c++});c=0;a('input[name="answerJson[answer_matrix_sort][answer_html][]"]').each(function(){this.value=c++})}},d=function(){var b="",d=a('input[name="answerType"]:checked'),f=a('input[name="points"]'),b=void 0!=tinymce.editors.question&&!tinymce.editors.question.isHidden()?tinymce.editors.question.getContent():
9
- a('textarea[name="question"]').val();if(isNaN(f.val())||1>f.val())return alert(wpProQuizLocalize.no_nummber_points),f.focus(),!1;if(c(b))return alert(wpProQuizLocalize.no_question_msg),!1;if("single"==d.val()||"multiple"==d.val()){var e=!0;if(1>a('input[name="answerJson[classic_answer][correct][]"]:checked').each(function(){e=""!=a.trim(a(this).parent().siblings("textarea").val())?e&1:!1}).size())return alert(wpProQuizLocalize.no_correct_msg),!1;if(!e)return alert(wpProQuizLocalize.no_answer_msg),
10
- !1}else if("sort_answer"==d.val()){if(e=!1,a('textarea[name="answerJson[answer_sort][answer][]"]').each(function(){e=c(a(this).val())?e|0:!0}),!e)return alert(wpProQuizLocalize.no_answer_msg),!1}else if("matrix_sort_answer"==d.val()){if(e=!1,a('textarea[name="answerJson[answer_matrix_sort][answer][]"]').each(function(){if(c(a(this).val()))e|=0;else{var b=a(this).parent().parent().find('textarea[name="answerJson[answer_matrix_sort][sort_string][]"]');e=c(b.val())?e|0:!0}}),!e)return alert(wpProQuizLocalize.no_answer_msg),
11
- !1}else if("cloze_answer"==d.val()){if(b="",b=void 0!=tinymce.editors.cloze&&!tinymce.editors.cloze.isHidden()?tinymce.editors.cloze.getContent():a('textarea[name="answerJson[answer_cloze][text]"]').val(),c(b))return alert(wpProQuizLocalize.no_answer_msg),!1}else if("free_answer"==d.val()&&(b=a('textarea[name="answerJson[free_answer][correct]"]').val(),c(b)))return alert(wpProQuizLocalize.no_answer_msg),!1;return!0},c=function(c){c=a.trim(c);return!c||0===c.length};b.setup();1>a('input[name="answerType"][checked="checked"]').size()&&
12
- a('input[name="answerType"][value="single"]').attr({checked:"checked"});a('input[name="answerType"]:checked').click();a("#wpProQuiz_correctSameText").change();a("#wpProQuiz_tip").change()};a.fn.wpProQuiz_questionOverall=function(){var b={saveSort:function(){var d={action:"wp_pro_quiz_update_sort",sort:b.parseSortArray()},c=(window.location.pathname+window.location.search).replace("admin.php","admin-ajax.php")+"&action=save_sort";a.post(c,d,function(){a("#sortMsg").show(400).delay(1E3).hide(400)})},
13
- parseSortArray:function(){var b=[];a("tbody tr").each(function(){b.push(this.id.replace("wpProQuiz_questionId_",""))});return b},sortUpdate:function(){a(".wpProQuiz_questionOverall tbody").children().each(function(){$t=a(this).children().first().text(a(this).index()+1)})}};a(".wp-list-table tbody").sortable({handle:".wpProQuiz_move",update:b.sortUpdate});a(".wpProQuiz_delete").click(function(a){return!confirm(wpProQuizLocalize.delete_msg)?(a.preventDefault(),!1):!0});a("#wpProQuiz_saveSort").click(function(a){a.preventDefault();
14
- b.saveSort()})};a.fn.wpProQuiz_quizEdit=function(){var b={addResult:function(){a("#resultList").children().each(function(){if("none"==a(this).css("display")){var c=a(this),b=c.find('textarea[name="resultTextGrade[text][]"]'),d=b.attr("id"),f=!0;c.find('input[name="resultTextGrade[prozent][]"]').val("0");c.find('input[name="resultTextGrade[activ][]"]').val("1").keyup();void 0!=tinymce.editors[d]&&!tinymce.editors[d].isHidden()&&(f=!1);void 0!=switchEditors&&!f&&(switchEditors.go(d,"toggle"),switchEditors.go(d,
15
- "toggle"));void 0!=tinymce.editors[d]?tinymce.editors[d].setContent(""):b.val("");void 0!=tinymce.editors[d]&&!f&&tinyMCE.execCommand("mceRemoveControl",!1,d);c.parent().children(":visible").last().after(c);void 0!=tinymce.editors[d]&&!f&&tinyMCE.execCommand("mceAddControl",!1,d);a(this).show();void 0!=switchEditors&&!f&&switchEditors.go(d,"toggle");return!1}})},deleteResult:function(c){a(c).parent().parent().hide();a(c).siblings('input[name="resultTextGrade[activ][]"]').val("0")},changeResult:function(c){c=
16
- a(c);if(b.validResultInput(c.val()))return c.siblings(".resultProzent").text(c.val()),c.removeAttr("style"),!0;c.css("background-color","#FF9696");return!1},validResultInput:function(a){if(d(a))return!1;a=a.replace(/\,/,".");return!isNaN(a)&&100>=Number(a)&&0<=Number(a)?null!=a.match(/\./)?3>a.split(".")[1].length:!0:!1},validInput:function(){if(d(a("#wpProQuiz_title").val()))return alert(wpProQuizLocalize.no_title_msg),!1;var c="",c=void 0!=tinymce.editors.text&&!tinymce.editors.text.isHidden()?
17
- tinymce.editors.text.getContent():a('textarea[name="text"]').val();if(d(c))return alert(wpProQuizLocalize.no_quiz_start_msg),!1;if(a("#wpProQuiz_resultGradeEnabled:checked").length){var g=!0;a("#resultList").children().each(function(){if(a(this).is(":visible")&&!b.validResultInput(a(this).find('input[name="resultTextGrade[prozent][]"]').val()))return g=!1});if(!g)return alert(wpProQuizLocalize.fail_grade_result),!1}return!0}},d=function(c){c=a.trim(c);return!c||0===c.length};a("#statistics_on").change(function(){this.checked?
18
- a("#statistics_ip_lock_tr").show():a("#statistics_ip_lock_tr").hide()});a(".addResult").click(function(){b.addResult()});a(".deleteResult").click(function(){b.deleteResult(this)});a('input[name="resultTextGrade[prozent][]"]').keyup(function(){b.changeResult(this)}).keydown(function(a){13==a.which&&a.preventDefault()});a("#wpProQuiz_resultGradeEnabled").change(function(){this.checked?(a("#resultGrade").show(),a("#resultNormal").hide()):(a("#resultGrade").hide(),a("#resultNormal").show())});a("#wpProQuiz_save").click(function(a){b.validInput()||
19
- a.preventDefault()});a("#statistics_on").change();a("#wpProQuiz_resultGradeEnabled").change()};a(".wpProQuiz_quizOverall").length&&a(".wpProQuiz_quizOverall").wpProQuiz_preview();a(".wpProQuiz_quizOverall").length&&a(".wpProQuiz_quizOverall").wpProQuiz_quizOverall();a(".wpProQuiz_quizEdit").length&&a(".wpProQuiz_quizEdit").wpProQuiz_quizEdit();a(".wpProQuiz_questionEdit").length&&a(".wpProQuiz_questionEdit").wpProQuiz_questionEdit();a(".wpProQuiz_questionOverall").length&&a(".wpProQuiz_questionOverall").wpProQuiz_questionOverall()});
 
 
 
 
 
 
 
 
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(d){d.preventDefault();a(".wpProQuiz_importList").toggle("fast");a(".wpProQuiz_exportList").hide();a(".wpProQuiz_exportCheck").hide()});a(".wpProQuiz_export").click(function(d){d.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 d=
4
+ a('input[name="exportItems"]');this.checked?d.attr("checked",!0):d.attr("checked",!1);d.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 d="",c=a('input[name="answerType"]:checked'),f=a('input[name="points"]'),d=void 0!=tinymce.editors.question&&!tinymce.editors.question.isHidden()?tinymce.editors.question.getContent():
9
+ a('textarea[name="question"]').val();if(isNaN(f.val())||1>f.val())return alert(wpProQuizLocalize.no_nummber_points),f.focus(),!1;if(b(d))return alert(wpProQuizLocalize.no_question_msg),!1;if("single"==c.val()||"multiple"==c.val()){var e=!0;if(1>a('input[name="answerJson[classic_answer][correct][]"]:checked').each(function(){e=""!=a.trim(a(this).parent().siblings("textarea").val())?e&1:!1}).size())return alert(wpProQuizLocalize.no_correct_msg),!1;if(!e)return alert(wpProQuizLocalize.no_answer_msg),
10
+ !1}else if("sort_answer"==c.val()){if(e=!1,a('textarea[name="answerJson[answer_sort][answer][]"]').each(function(){e=b(a(this).val())?e|0:!0}),!e)return alert(wpProQuizLocalize.no_answer_msg),!1}else if("matrix_sort_answer"==c.val()){if(e=!1,a('textarea[name="answerJson[answer_matrix_sort][answer][]"]').each(function(){if(b(a(this).val()))e|=0;else{var d=a(this).parent().parent().find('textarea[name="answerJson[answer_matrix_sort][sort_string][]"]');e=b(d.val())?e|0:!0}}),!e)return alert(wpProQuizLocalize.no_answer_msg),
11
+ !1}else if("cloze_answer"==c.val()){if(d="",d=void 0!=tinymce.editors.cloze&&!tinymce.editors.cloze.isHidden()?tinymce.editors.cloze.getContent():a('textarea[name="answerJson[answer_cloze][text]"]').val(),b(d))return alert(wpProQuizLocalize.no_answer_msg),!1}else if("free_answer"==c.val()&&(d=a('textarea[name="answerJson[free_answer][correct]"]').val(),b(d)))return alert(wpProQuizLocalize.no_answer_msg),!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()&&
12
+ a('input[name="answerType"][value="single"]').attr({checked:"checked"});a('input[name="answerType"]:checked').click();a("#wpProQuiz_correctSameText").change();a("#wpProQuiz_tip").change()};a.fn.wpProQuiz_questionOverall=function(){var c={saveSort:function(){var d={action:"wp_pro_quiz_update_sort",sort:c.parseSortArray()},b=(window.location.pathname+window.location.search).replace("admin.php","admin-ajax.php")+"&action=save_sort";a.post(b,d,function(){a("#sortMsg").show(400).delay(1E3).hide(400)})},
13
+ parseSortArray:function(){var d=[];a("tbody tr").each(function(){d.push(this.id.replace("wpProQuiz_questionId_",""))});return d},sortUpdate:function(){a(".wpProQuiz_questionOverall tbody").children().each(function(){$t=a(this).children().first().text(a(this).index()+1)})},loadQuestionCopy:function(){var d=a("#questionCopySelect"),b=(window.location.pathname+window.location.search).replace("admin.php","admin-ajax.php")+"&action=load_question";d.hide();d.empty();a("#loadDataImg").show();a.post(b,{action:"wp_pro_quiz_load_question",
14
+ excludeId:1},function(b){a.each(b,function(b,c){var e=a(document.createElement("optgroup"));e.attr("label",c.name);a.each(c.question,function(b,d){a(document.createElement("option")).val(d.id).text(d.name).appendTo(e)});d.append(e)});a("#loadDataImg").hide();d.show()},"json")}};a(".wp-list-table tbody").sortable({handle:".wpProQuiz_move",update:c.sortUpdate});a(".wpProQuiz_delete").click(function(a){return!confirm(wpProQuizLocalize.delete_msg)?(a.preventDefault(),!1):!0});a("#wpProQuiz_saveSort").click(function(a){a.preventDefault();
15
+ c.saveSort()});a("#wpProQuiz_questionCopy").click(function(d){var b=a(".wpProQuiz_questionCopy");b.is(":visible")?b.hide():(b.show(),c.loadQuestionCopy());d.preventDefault()})};a.fn.wpProQuiz_quizEdit=function(){var c={addResult:function(){a("#resultList").children().each(function(){if("none"==a(this).css("display")){var b=a(this),d=b.find('textarea[name="resultTextGrade[text][]"]'),c=d.attr("id"),f=!0;b.find('input[name="resultTextGrade[prozent][]"]').val("0");b.find('input[name="resultTextGrade[activ][]"]').val("1").keyup();
16
+ void 0!=tinymce.editors[c]&&!tinymce.editors[c].isHidden()&&(f=!1);void 0!=switchEditors&&!f&&(switchEditors.go(c,"toggle"),switchEditors.go(c,"toggle"));void 0!=tinymce.editors[c]?tinymce.editors[c].setContent(""):d.val("");void 0!=tinymce.editors[c]&&!f&&tinyMCE.execCommand("mceRemoveControl",!1,c);b.parent().children(":visible").last().after(b);void 0!=tinymce.editors[c]&&!f&&tinyMCE.execCommand("mceAddControl",!1,c);a(this).show();void 0!=switchEditors&&!f&&switchEditors.go(c,"toggle");return!1}})},
17
+ 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;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),
18
+ !1;var b="",b=void 0!=tinymce.editors.text&&!tinymce.editors.text.isHidden()?tinymce.editors.text.getContent():a('textarea[name="text"]').val();if(d(b))return alert(wpProQuizLocalize.no_quiz_start_msg),!1;if(a("#wpProQuiz_resultGradeEnabled:checked").length){var g=!0;a("#resultList").children().each(function(){if(a(this).is(":visible")&&!c.validResultInput(a(this).find('input[name="resultTextGrade[prozent][]"]').val()))return g=!1});if(!g)return alert(wpProQuizLocalize.fail_grade_result),!1}return!0},
19
+ resetLock:function(){var b=(window.location.pathname+window.location.search).replace("admin.php","admin-ajax.php"),b=b.replace("action=edit","action=reset_lock");a.post(b,{action:"wp_pro_quiz_reset_lock"},function(){a("#resetLockMsg").show("fast").delay(2E3).hide("fast")})}},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)});
20
+ 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?(a("#resultGrade").show(),a("#resultNormal").hide()):(a("#resultGrade").hide(),a("#resultNormal").show())});a("#wpProQuiz_save").click(function(a){c.validInput()||a.preventDefault()});a('input[name="quizRunOnce"]').change(function(){this.checked?(a("#wpProQuiz_quiz_run_once_type").show(),a('input[name="quizRunOnceType"]:checked').change()):
21
+ a("#wpProQuiz_quiz_run_once_type").hide()});a('input[name="quizRunOnceType"]').change(function(){this.checked&&("1"==this.value||"3"==this.value)?a("#wpProQuiz_quiz_run_once_cookie").show():a("#wpProQuiz_quiz_run_once_cookie").hide()});a('input[name="resetQuizLock"]').click(function(){c.resetLock();return!1});a("#statistics_on").change();a("#wpProQuiz_resultGradeEnabled").change();a('input[name="quizRunOnce"]').change();a('input[name="quizRunOnceType"]:checked').change()};a.fn.wpProQuiz_statistics=
22
+ function(){var c="wpProQuiz_typeAnonymeUser",d={loadStatistics:function(b){var c=(window.location.pathname+window.location.search).replace("admin.php","admin-ajax.php")+"&action=load_statistics",b={action:"wp_pro_quiz_load_statistics",userId:b};a("#wpProQuiz_loadData").show();a("#wpProQuiz_statistics_content").hide();a.post(c,b,d.setStatistics,"json")},setStatistics:function(b){var c=a(".wpProQuiz_statistics_table"),d=c.find("tbody"),f=0,e=function(a,b,d){a.find(".wpProQuiz_cCorrect").text(b.cCorrect+
23
+ " ("+b.pCorrect+"%)");a.find(".wpProQuiz_cIncorrect").text(b.cIncorrect+" ("+b.pIncorrect+"%)");a.find(".wpProQuiz_cTip").text(b.cTip);!0==d?c.find(".wpProQuiz_cResult").text(Math.round(1E4*(f/a.find(".wpProQuiz_points").text()))/100+"%"):f+=b.cCorrect*a.find(".wpProQuiz_points").text()};e(c,b.clear,!1);a.each(b.items,function(a,b){e(d.find("#wpProQuiz_tr_"+b.id),b,!1)});e(c.find("tfoot"),b.global,!0);a("#wpProQuiz_loadData").hide();a("#wpProQuiz_statistics_content").show()},changeTab:function(b){c=
24
+ b;"wpProQuiz_typeRegisteredUser"==b?d.loadStatistics(a("#userSelect").val()):"wpProQuiz_typeAnonymeUser"==b&&d.loadStatistics(0)},resetStatistic:function(b){var g="wpProQuiz_typeRegisteredUser"==c?a("#userSelect").val():0,h=(window.location.pathname+window.location.search).replace("admin.php","admin-ajax.php")+"&action=reset";a.post(h,{action:"wp_pro_quiz_statistics",userId:g,complete:b},function(){d.changeTab(c)})}};a(".wpProQuiz_tab").click(function(){var b=a(this);if(b.hasClass("button-primary"))return!1;
25
+ "wpProQuiz_typeRegisteredUser"==b.attr("id")?a("#wpProQuiz_userBox").show():a("#wpProQuiz_userBox").hide();a(".wpProQuiz_tab").removeClass("button-primary").addClass("button-secondary");b.removeClass("button-secondary").addClass("button-primary");d.changeTab(b.attr("id"));return!1});a("#userSelect").change(function(){d.changeTab("wpProQuiz_typeRegisteredUser")});a("#wpProQuiz_update").click(function(){d.changeTab(c);return!1});a("#wpProQuiz_reset").click(function(){confirm(wpProQuizLocalize.reset_statistics_msg)&&
26
+ d.resetStatistic(!1);return!1});a("#wpProQuiz_resetComplete").click(function(){confirm(wpProQuizLocalize.reset_statistics_msg)&&d.resetStatistic(!0);return!1});d.changeTab("wpProQuiz_typeAnonymeUser")};a(".wpProQuiz_quizOverall").length&&a(".wpProQuiz_quizOverall").wpProQuiz_preview();a(".wpProQuiz_quizOverall").length&&a(".wpProQuiz_quizOverall").wpProQuiz_quizOverall();a(".wpProQuiz_quizEdit").length&&a(".wpProQuiz_quizEdit").wpProQuiz_quizEdit();a(".wpProQuiz_questionEdit").length&&a(".wpProQuiz_questionEdit").wpProQuiz_questionEdit();
27
+ a(".wpProQuiz_questionOverall").length&&a(".wpProQuiz_questionOverall").wpProQuiz_questionOverall();a(".wpProQuiz_statistics").length&&a(".wpProQuiz_statistics").wpProQuiz_statistics()});
js/wpProQuiz_front.js CHANGED
@@ -11,9 +11,14 @@
11
  var points = 0;
12
  var pointsTotal = 0;
13
 
 
 
 
 
 
14
  plugin.methode = {
15
- startQuiz: function() {
16
-
17
  statistics = new Object();
18
 
19
  if(config.questionRandom) {
@@ -28,22 +33,36 @@
28
 
29
  plugin.methode.answerRandom('.wpProQuiz_sortStringList');
30
 
31
- if(config.timeLimit) {
32
- plugin.methode.setTimeLimit();
33
- }
34
-
35
  correctAnswer = 0;
36
  points = 0;
37
 
38
- startTime = new Date();
39
-
40
  if(config.checkAnswer) {
41
  $element.find('input[name="check"]').show();
42
  } else {
43
  $element.find('input[name="next"]').show();
44
  }
45
-
 
 
 
 
 
 
 
 
46
  $element.find('.wpProQuiz_text').hide();
 
 
 
 
 
 
 
 
 
 
 
 
47
  $element.find('.wpProQuiz_quiz').show();
48
  $element.find('.wpProQuiz_listItem').first().fadeIn(200);
49
 
@@ -75,6 +94,8 @@
75
  $element.find('.wpProQuiz_cloze span').hide();
76
 
77
  plugin.methode.resetMatrix();
 
 
78
  },
79
 
80
  resetMatrix: function() {
@@ -185,6 +206,10 @@
185
 
186
  $question.find('input[name="tip"]').hide();
187
 
 
 
 
 
188
  if(type == 'multiple' || type == 'single') {
189
  var check = true;
190
 
@@ -227,7 +252,7 @@
227
 
228
  var list = $question.find('.wpProQuiz_sortable').parent().parent();
229
  var items = list.children('li');
230
-
231
  list.sortable("destroy");
232
 
233
  items.sort(function(a, b) {
@@ -325,6 +350,8 @@
325
  }
326
 
327
  $question.find('input[name="next"]').show();
 
 
328
  },
329
 
330
  nextQuestion: function(btn) {
@@ -376,7 +403,18 @@
376
  $element.find('.wpProQuiz_resultsList').children().eq(index).show();
377
  }
378
 
379
- plugin.methode.sendStatistics();
 
 
 
 
 
 
 
 
 
 
 
380
  },
381
 
382
  findResultIndex: function(p) {
@@ -406,19 +444,7 @@
406
 
407
  return str;
408
  },
409
-
410
- sendStatistics: function() {
411
- if(!config.statisticsOn)
412
- return;
413
-
414
- $.ajax({
415
- url: config.url,
416
- type: 'POST',
417
- cache: false,
418
- data: {action: 'wp_pro_quiz_statistics_save', 'results': statistics, 'quizId': config.quizId}
419
- });
420
- },
421
-
422
  reShowQuestion: function() {
423
  $element.find('input[name="next"], input[name="check"], input[name="back"]').hide();
424
  $element.find('.wpProQuiz_quiz').children().first().children().show();
@@ -483,12 +509,39 @@
483
 
484
  input.width(width + 10);
485
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
486
  }
487
  };
488
 
489
  plugin.init = function() {
490
  correctAnswer = 0;
491
 
 
 
 
 
 
492
  if(config.resultsGrade == undefined)
493
  config.resultsGrade = [0];
494
 
@@ -506,7 +559,7 @@
506
 
507
  $element.find('input[name="startQuiz"]').click(function(e) {
508
  e.preventDefault();
509
- plugin.methode.startQuiz();
510
  });
511
 
512
  $element.find('input[name="check"]').click(function(e) {
11
  var points = 0;
12
  var pointsTotal = 0;
13
 
14
+ var isLock = false;
15
+ var locked = false;
16
+ var loadLocked = false;
17
+ var startQuiz = false;
18
+
19
  plugin.methode = {
20
+
21
+ preStartQuiz: function() {
22
  statistics = new Object();
23
 
24
  if(config.questionRandom) {
33
 
34
  plugin.methode.answerRandom('.wpProQuiz_sortStringList');
35
 
 
 
 
 
36
  correctAnswer = 0;
37
  points = 0;
38
 
 
 
39
  if(config.checkAnswer) {
40
  $element.find('input[name="check"]').show();
41
  } else {
42
  $element.find('input[name="next"]').show();
43
  }
44
+
45
+ if(!isLock || !loadLocked) {
46
+ plugin.methode.startQuiz();
47
+ } else {
48
+ startQuiz = true;
49
+ }
50
+ },
51
+
52
+ startQuiz: function() {
53
  $element.find('.wpProQuiz_text').hide();
54
+
55
+ if(locked) {
56
+ $element.find('.wpProQuiz_lock').show();
57
+ return;
58
+ }
59
+
60
+ startTime = new Date();
61
+
62
+ if(config.timeLimit) {
63
+ plugin.methode.setTimeLimit();
64
+ }
65
+
66
  $element.find('.wpProQuiz_quiz').show();
67
  $element.find('.wpProQuiz_listItem').first().fadeIn(200);
68
 
94
  $element.find('.wpProQuiz_cloze span').hide();
95
 
96
  plugin.methode.resetMatrix();
97
+
98
+ $element.find('.wpProQuiz_listItem').data('isChecked', false);
99
  },
100
 
101
  resetMatrix: function() {
206
 
207
  $question.find('input[name="tip"]').hide();
208
 
209
+ if($question.data('isChecked')) {
210
+ return;
211
+ }
212
+
213
  if(type == 'multiple' || type == 'single') {
214
  var check = true;
215
 
252
 
253
  var list = $question.find('.wpProQuiz_sortable').parent().parent();
254
  var items = list.children('li');
255
+
256
  list.sortable("destroy");
257
 
258
  items.sort(function(a, b) {
350
  }
351
 
352
  $question.find('input[name="next"]').show();
353
+
354
+ $question.data('isChecked', true);
355
  },
356
 
357
  nextQuestion: function(btn) {
403
  $element.find('.wpProQuiz_resultsList').children().eq(index).show();
404
  }
405
 
406
+ plugin.methode.sendCompletedQuiz();
407
+ },
408
+
409
+ sendCompletedQuiz: function() {
410
+ if(config.preview)
411
+ return;
412
+
413
+ $.post(config.url, {
414
+ action : 'wp_pro_quiz_completed_quiz',
415
+ 'results' : statistics,
416
+ 'quizId' : config.quizId
417
+ });
418
  },
419
 
420
  findResultIndex: function(p) {
444
 
445
  return str;
446
  },
447
+
 
 
 
 
 
 
 
 
 
 
 
 
448
  reShowQuestion: function() {
449
  $element.find('input[name="next"], input[name="check"], input[name="back"]').hide();
450
  $element.find('.wpProQuiz_quiz').children().first().children().show();
509
 
510
  input.width(width + 10);
511
  });
512
+ },
513
+
514
+ checkLock: function() {
515
+
516
+ loadLocked = true;
517
+
518
+ $.post(config.url, {
519
+ action: 'wp_pro_quiz_check_lock',
520
+ quizId: config.quizId
521
+ }, function(json) {
522
+ locked = json.is;
523
+ loadLocked = false;
524
+
525
+ if(json.pre) {
526
+ $element.find('input[name="restartQuiz"]').hide();
527
+ }
528
+
529
+ if(startQuiz) {
530
+ startQuiz = false;
531
+ plugin.methode.startQuiz();
532
+ }
533
+ }, 'json');
534
  }
535
  };
536
 
537
  plugin.init = function() {
538
  correctAnswer = 0;
539
 
540
+ if(config.lock && !config.preview) {
541
+ isLock = true;
542
+ plugin.methode.checkLock();
543
+ }
544
+
545
  if(config.resultsGrade == undefined)
546
  config.resultsGrade = [0];
547
 
559
 
560
  $element.find('input[name="startQuiz"]').click(function(e) {
561
  e.preventDefault();
562
+ plugin.methode.preStartQuiz();
563
  });
564
 
565
  $element.find('input[name="check"]').click(function(e) {
js/wpProQuiz_front.min.js CHANGED
@@ -1,19 +1,20 @@
1
- (function(c){c.wpProQuizFront=function(n,f){var b=c(n),e=this,m=0,i=0,p=0,j={},l=0,k=0;e.methode={startQuiz:function(){j={};f.questionRandom&&e.methode.questionRandom();f.answerRandom?e.methode.answerRandom(".wpProQuiz_questionList"):e.methode.answerRandom(b.find(".wpProQuiz_sortable").parent().parent());e.methode.answerRandom(".wpProQuiz_sortStringList");f.timeLimit&&e.methode.setTimeLimit();l=m=0;p=new Date;f.checkAnswer?b.find('input[name="check"]').show():b.find('input[name="next"]').show();b.find(".wpProQuiz_text").hide();
2
- b.find(".wpProQuiz_quiz").show();b.find(".wpProQuiz_listItem").first().fadeIn(200);b.find(".wpProQuiz_sortable").parent().parent().sortable().disableSelection();b.find(".wpProQuiz_sortStringList, .wpProQuiz_maxtrixSortCriterion").sortable({connectWith:".wpProQuiz_maxtrixSortCriterion:not(:has(li)), .wpProQuiz_sortStringList",placeholder:"wpProQuiz_placehold"}).disableSelection()},reStartQuiz:function(){b.find(".wpProQuiz_answerCorrect").removeClass("wpProQuiz_answerCorrect");b.find(".wpProQuiz_answerIncorrect").removeClass("wpProQuiz_answerIncorrect");
3
- b.find('.wpProQuiz_text, input[name="tip"]').show();b.find(".wpProQuiz_quiz, .wpProQuiz_results, .wpProQuiz_response, .wpProQuiz_correct, .wpProQuiz_incorrect").hide();b.find(".wpProQuiz_time_limit, .wpProQuiz_time_limit_expired, .wpProQuiz_sort_correct_answer").hide();b.find(".wpProQuiz_quiz").children().first().children().hide();b.find(".wpProQuiz_sortable, .wpProQuiz_sortStringItem").removeAttr("style");b.find('input[name="check"]').hide();b.find('input[name="next"]').hide();b.find(".wpProQuiz_questionInput").removeAttr("disabled").removeAttr("checked");
4
- b.find('input.wpProQuiz_questionInput[type="text"]').removeAttr("value");b.find(".wpProQuiz_resultsList").children().hide();b.find(".wpProQuiz_cloze input").removeAttr("disabled").removeAttr("value").css("background-color","");b.find(".wpProQuiz_cloze span").hide();e.methode.resetMatrix()},resetMatrix:function(){b.find(".wpProQuiz_question").each(function(){var a=c(this),d=a.find(".wpProQuiz_sortStringList");a.find(".wpProQuiz_sortStringItem").each(function(){d.append(c(this))})})},setTimeLimit:function(){var a=
5
- b.find(".wpProQuiz_time_limit"),d=a.find("span"),c=f.timeLimit;a.css({width:"100%",display:"block"});d.html(e.methode.parseTime(c));a.find(".progress").css("width","100%").animate({width:"0%"},1E3*f.timeLimit);i=setInterval(function(){d.html(e.methode.parseTime(c--));0>c&&(clearInterval(i),i=0,a.find(".progress").clearQueue().stop(),b.find('input[name="check"]').click().parent().hide(),b.find(".wpProQuiz_time_limit_expired").show(),e.methode.showResult())},1E3)},parseTime:function(a){var d=parseInt(a%
6
- 60),c=parseInt(a/60%60),a=parseInt(a/3600%24);return(9<a?"":"0")+a+":"+((9<c?"":"0")+c)+":"+((9<d?"":"0")+d)},setQuizTime:function(){var a=((new Date).getTime()-p.getTime())/1E3;b.find(".wpProQuiz_quiz_time span").first().html(e.methode.parseTime(a))},setData:function(){var a=0;b.find(".wpProQuiz_questionList").each(function(){var d=f.json[a],b=0;k+=d.points;c(this).parent().parent().data("type",d.answer_type).data("questionId",d.id).data("points",d.points);c(this).find(".wpProQuiz_questionInput").each(function(){switch(d.answer_type){case "single":case "multiple":0<=
7
- c.inArray(this.value,d.correct)?c(this).data("correct","1"):c(this).data("correct","0");break;case "free_answer":c(this).data("correct",d.correct)}});b=0;c(this).find(".wpProQuiz_sortable").each(function(){c(this).data("correct",d.correct[b++])});b=0;c(this).parent().find(".wpProQuiz_sortStringList").children().each(function(){c(this).data("correct",d.correct[b++])});"matrix_sort_answer"==d.answer_type&&c(this).children().each(function(){c(this).data("correct",c(this).index())});a++})},checkAnswer:function(a){var d=
8
- c(a).parent(),b=!1,f=d.find(".wpProQuiz_questionInput"),h=d.data("type");d.find('input[name="tip"]').hide();if("multiple"==h||"single"==h){var g=!0;f.each(function(){"1"==c(this).data("correct")?(c(this).parent().parent().addClass("wpProQuiz_answerCorrect"),g=this.checked?g&1:g&0):this.checked&&(c(this).parent().parent().addClass("wpProQuiz_answerIncorrect"),g&=0)});b=g}else if("sort_answer"==h){g=!0;d.find(".wpProQuiz_sortable").each(function(){var a=c(this),b=a.parent().index();a.data("correct")==
9
- b?(a.parent().addClass("wpProQuiz_answerCorrect"),g&=1):(a.parent().addClass("wpProQuiz_answerIncorrect"),g=!1);a.css({"box-shadow":"0 0",cursor:"auto"})});var i=d.find(".wpProQuiz_sortable").parent().parent(),b=i.children("li");i.sortable("destroy");b.sort(function(a,b){return c(a).children("div").data("correct")-c(b).children("div").data("correct")});c.each(b,function(a,b){i.append(b)});b=g}else if("free_answer"==h)h=c.trim(f.val()).toLowerCase(),0<=c.inArray(h,f.data("correct"))?(b=!0,f.parent().parent().addClass("wpProQuiz_answerCorrect")):
10
- f.parent().parent().addClass("wpProQuiz_answerIncorrect");else if("matrix_sort_answer"==h){var g=!0,k={};d.find(".wpProQuiz_questionList").children().each(function(){var a=c(this).data("correct"),b=c(this).find(".wpProQuiz_maxtrixSortCriterion");b.children().first().data("correct")==a?(g&=1,b.addClass("wpProQuiz_answerCorrect")):(g=!1,b.addClass("wpProQuiz_answerIncorrect"));k[a]=c(this)});d.find(".wpProQuiz_sortStringItem").each(function(){k[c(this).data("correct")].find(".wpProQuiz_maxtrixSortCriterion").append(this)}).css({"box-shadow":"0 0",
11
- cursor:"auto"});d.find(".wpProQuiz_sortStringList, .wpProQuiz_maxtrixSortCriterion").sortable("destroy");b=g}else"cloze_answer"==h&&(g=!0,d.find(".wpProQuiz_cloze").each(function(){var a=c(this).children(),b=a.first(),d=b.val().toLowerCase(),f=a.last().text().toLowerCase(),f=c.trim(f.substr(1,f.length-2)),f=e.methode.cleanupCurlyQuotes(f),d=e.methode.cleanupCurlyQuotes(c.trim(d));f==d?(g&=1,b.css("background-color","#B0DAB0")):(g=!1,b.css("background-color","#FFBABA"),a.last().show());b.attr("disabled",
12
- "disabled")}),b=g);c(a).hide();f.attr("disabled","disabled");void 0==j[d.data("questionId")]&&(j[d.data("questionId")]={});j[d.data("questionId")].correct=Number(b);d.find(".wpProQuiz_response").show();b?(d.find(".wpProQuiz_correct").show(),m++,l+=d.data("points")):d.find(".wpProQuiz_incorrect").show();d.find('input[name="next"]').show()},nextQuestion:function(a){var a=c(a).parent(),d=a.next();a.hide();d.length?(d.show(),f.backButton&&!f.checkAnswer&&d.find('input[name="back"]').show()):(f.checkAnswer||
13
- b.find('input[name="check"]').click(),e.methode.showResult())},backQuestion:function(a){var a=c(a).parent(),b=a.prev();a.hide();b.show()},showResult:function(){clearInterval(i);var a=b.find(".wpProQuiz_points span");b.find(".wpProQuiz_time_limit .progress").clearQueue().stop();b.find(".wpProQuiz_correct_answer").html(m);b.find(".wpProQuiz_results").show();b.find(".wpProQuiz_time_limit").hide();e.methode.setQuizTime();var d=Math.round(1E4*(l/k))/100;a.eq(0).text(l);a.eq(1).text(k);a.eq(2).text(d);
14
- a=e.methode.findResultIndex(d);-1<a&&b.find(".wpProQuiz_resultsList").children().eq(a).show();e.methode.sendStatistics()},findResultIndex:function(a){for(var b=f.resultsGrade,c=-1,e=999999,h=0;h<b.length;h++){var g=b[h];a>=g&&a-g<e&&(e=a-g,c=h)}return c},cleanupCurlyQuotes:function(a){a=a.replace(/\u2018/,"'");a=a.replace(/\u2019/,"'");a=a.replace(/\u201C/,'"');return a=a.replace(/\u201D/,'"')},sendStatistics:function(){f.statisticsOn&&c.ajax({url:f.url,type:"POST",cache:!1,data:{action:"wp_pro_quiz_statistics_save",
15
- results:j,quizId:f.quizId}})},reShowQuestion:function(){b.find('input[name="next"], input[name="check"], input[name="back"]').hide();b.find(".wpProQuiz_quiz").children().first().children().show()},answerRandom:function(a){b.find(a).each(function(){var a=c(this).children(),a=a.sort(function(){return Math.round(Math.random())-0.5}).slice(0,a.length);c(a).appendTo(a[0].parentNode).show()})},questionRandom:function(){var a=b.find(".wpProQuiz_quiz ol").children(),a=a.sort(function(){return Math.round(Math.random())-
16
- 0.5}).slice(0,a.length);c(a).appendTo(a[0].parentNode);var d=1;c(a).each(function(){c(this).find(".wpProQuiz_question_page span").eq(0).html(d);c(this).find("h3 span").html(d++)})},showTip:function(a){$tip=c(a).siblings(".wpProQuiz_tipp");$par=c(a).parent();void 0==j[$par.data("questionId")]&&(j[$par.data("questionId")]={});j[$par.data("questionId")].tip=1;$tip.toggle("fast")},setClozeStyle:function(){b.find(".wpProQuiz_cloze").each(function(){var a=c(this).children(),b=a.first(),a=a.last().clone();
17
- a.css("visibility","hidden");c("body").append(a);var e=a.width();a.remove();b.width(e+10)})}};e.init=function(){m=0;void 0==f.resultsGrade&&(f.resultsGrade=[0]);b.find(".wpProQuiz_quiz, .wpProQuiz_results").hide();b.find(".wpProQuiz_quiz").children().first().children().hide();e.methode.setData();e.methode.setClozeStyle();b.find('input[name="startQuiz"]').click(function(a){a.preventDefault();e.methode.startQuiz()});b.find('input[name="check"]').click(function(a){a.preventDefault();e.methode.checkAnswer(this)});
18
- b.find('input[name="next"]').click(function(a){a.preventDefault();e.methode.nextQuestion(this)});b.find('input[name="restartQuiz"]').click(function(a){a.preventDefault();e.methode.reStartQuiz()});b.find('input[name="reShowQuestion"]').click(function(a){a.preventDefault();e.methode.reShowQuestion(this)});b.find('input[name="back"]').click(function(){e.methode.backQuestion(this)});b.find('input[name="tip"]').click(function(){e.methode.showTip(this)});c(document).mouseup(function(a){var c=b.find(".wpProQuiz_tipp"),
19
- e=b.find('input[name="tip"]');!c.is(a.target)&&(0==c.has(a.target).length&&!e.is(a.target))&&c.hide("fast")})};e.init()};c.fn.wpProQuizFront=function(n){return this.each(function(){void 0==c(this).data("wpProQuizFront")&&c(this).data("wpProQuizFront",new c.wpProQuizFront(this,n))})}})(jQuery);
 
1
+ (function(c){c.wpProQuizFront=function(n,e){var b=c(n),f=this,m=0,i=0,r=0,j={},l=0,k=0,s=!1,t=!1,p=!1,q=!1;f.methode={preStartQuiz:function(){j={};e.questionRandom&&f.methode.questionRandom();e.answerRandom?f.methode.answerRandom(".wpProQuiz_questionList"):f.methode.answerRandom(b.find(".wpProQuiz_sortable").parent().parent());f.methode.answerRandom(".wpProQuiz_sortStringList");l=m=0;e.checkAnswer?b.find('input[name="check"]').show():b.find('input[name="next"]').show();!s||!p?f.methode.startQuiz():
2
+ q=!0},startQuiz:function(){b.find(".wpProQuiz_text").hide();t?b.find(".wpProQuiz_lock").show():(r=new Date,e.timeLimit&&f.methode.setTimeLimit(),b.find(".wpProQuiz_quiz").show(),b.find(".wpProQuiz_listItem").first().fadeIn(200),b.find(".wpProQuiz_sortable").parent().parent().sortable().disableSelection(),b.find(".wpProQuiz_sortStringList, .wpProQuiz_maxtrixSortCriterion").sortable({connectWith:".wpProQuiz_maxtrixSortCriterion:not(:has(li)), .wpProQuiz_sortStringList",placeholder:"wpProQuiz_placehold"}).disableSelection())},
3
+ reStartQuiz:function(){b.find(".wpProQuiz_answerCorrect").removeClass("wpProQuiz_answerCorrect");b.find(".wpProQuiz_answerIncorrect").removeClass("wpProQuiz_answerIncorrect");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();
4
+ b.find(".wpProQuiz_sortable, .wpProQuiz_sortStringItem").removeAttr("style");b.find('input[name="check"]').hide();b.find('input[name="next"]').hide();b.find(".wpProQuiz_questionInput").removeAttr("disabled").removeAttr("checked");b.find('input.wpProQuiz_questionInput[type="text"]').removeAttr("value");b.find(".wpProQuiz_resultsList").children().hide();b.find(".wpProQuiz_cloze input").removeAttr("disabled").removeAttr("value").css("background-color","");b.find(".wpProQuiz_cloze span").hide();f.methode.resetMatrix();
5
+ b.find(".wpProQuiz_listItem").data("isChecked",!1)},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=b.find(".wpProQuiz_time_limit"),d=a.find("span"),c=e.timeLimit;a.css({width:"100%",display:"block"});d.html(f.methode.parseTime(c));a.find(".progress").css("width","100%").animate({width:"0%"},1E3*e.timeLimit);i=setInterval(function(){d.html(f.methode.parseTime(c--));
6
+ 0>c&&(clearInterval(i),i=0,a.find(".progress").clearQueue().stop(),b.find('input[name="check"]').click().parent().hide(),b.find(".wpProQuiz_time_limit_expired").show(),f.methode.showResult())},1E3)},parseTime:function(a){var d=parseInt(a%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()-r.getTime())/1E3;b.find(".wpProQuiz_quiz_time span").first().html(f.methode.parseTime(a))},setData:function(){var a=
7
+ 0;b.find(".wpProQuiz_questionList").each(function(){var d=e.json[a],b=0;k+=d.points;c(this).parent().parent().data("type",d.answer_type).data("questionId",d.id).data("points",d.points);c(this).find(".wpProQuiz_questionInput").each(function(){switch(d.answer_type){case "single":case "multiple":0<=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",
8
+ d.correct[b++])});b=0;c(this).parent().find(".wpProQuiz_sortStringList").children().each(function(){c(this).data("correct",d.correct[b++])});"matrix_sort_answer"==d.answer_type&&c(this).children().each(function(){c(this).data("correct",c(this).index())});a++})},checkAnswer:function(a){var d=c(a).parent(),b=!1,e=d.find(".wpProQuiz_questionInput"),h=d.data("type");d.find('input[name="tip"]').hide();if(!d.data("isChecked")){if("multiple"==h||"single"==h){var g=!0;e.each(function(){"1"==c(this).data("correct")?
9
+ (c(this).parent().parent().addClass("wpProQuiz_answerCorrect"),g=this.checked?g&1:g&0):this.checked&&(c(this).parent().parent().addClass("wpProQuiz_answerIncorrect"),g&=0)});b=g}else if("sort_answer"==h){g=!0;d.find(".wpProQuiz_sortable").each(function(){var a=c(this),b=a.parent().index();a.data("correct")==b?(a.parent().addClass("wpProQuiz_answerCorrect"),g&=1):(a.parent().addClass("wpProQuiz_answerIncorrect"),g=!1);a.css({"box-shadow":"0 0",cursor:"auto"})});var i=d.find(".wpProQuiz_sortable").parent().parent(),
10
+ b=i.children("li");i.sortable("destroy");b.sort(function(a,b){return c(a).children("div").data("correct")-c(b).children("div").data("correct")});c.each(b,function(a,b){i.append(b)});b=g}else if("free_answer"==h)h=c.trim(e.val()).toLowerCase(),0<=c.inArray(h,e.data("correct"))?(b=!0,e.parent().parent().addClass("wpProQuiz_answerCorrect")):e.parent().parent().addClass("wpProQuiz_answerIncorrect");else if("matrix_sort_answer"==h){var g=!0,k={};d.find(".wpProQuiz_questionList").children().each(function(){var a=
11
+ c(this).data("correct"),b=c(this).find(".wpProQuiz_maxtrixSortCriterion");b.children().first().data("correct")==a?(g&=1,b.addClass("wpProQuiz_answerCorrect")):(g=!1,b.addClass("wpProQuiz_answerIncorrect"));k[a]=c(this)});d.find(".wpProQuiz_sortStringItem").each(function(){k[c(this).data("correct")].find(".wpProQuiz_maxtrixSortCriterion").append(this)}).css({"box-shadow":"0 0",cursor:"auto"});d.find(".wpProQuiz_sortStringList, .wpProQuiz_maxtrixSortCriterion").sortable("destroy");b=g}else"cloze_answer"==
12
+ h&&(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=c.trim(e.substr(1,e.length-2)),e=f.methode.cleanupCurlyQuotes(e),d=f.methode.cleanupCurlyQuotes(c.trim(d));e==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==j[d.data("questionId")]&&(j[d.data("questionId")]={});
13
+ j[d.data("questionId")].correct=Number(b);d.find(".wpProQuiz_response").show();b?(d.find(".wpProQuiz_correct").show(),m++,l+=d.data("points")):d.find(".wpProQuiz_incorrect").show();d.find('input[name="next"]').show();d.data("isChecked",!0)}},nextQuestion:function(a){var a=c(a).parent(),d=a.next();a.hide();d.length?(d.show(),e.backButton&&!e.checkAnswer&&d.find('input[name="back"]').show()):(e.checkAnswer||b.find('input[name="check"]').click(),f.methode.showResult())},backQuestion:function(a){var a=
14
+ c(a).parent(),b=a.prev();a.hide();b.show()},showResult:function(){clearInterval(i);var a=b.find(".wpProQuiz_points span");b.find(".wpProQuiz_time_limit .progress").clearQueue().stop();b.find(".wpProQuiz_correct_answer").html(m);b.find(".wpProQuiz_results").show();b.find(".wpProQuiz_time_limit").hide();f.methode.setQuizTime();var d=Math.round(1E4*(l/k))/100;a.eq(0).text(l);a.eq(1).text(k);a.eq(2).text(d);a=f.methode.findResultIndex(d);-1<a&&b.find(".wpProQuiz_resultsList").children().eq(a).show();
15
+ f.methode.sendCompletedQuiz()},sendCompletedQuiz:function(){e.preview||c.post(e.url,{action:"wp_pro_quiz_completed_quiz",results:j,quizId:e.quizId})},findResultIndex:function(a){for(var b=e.resultsGrade,c=-1,f=999999,h=0;h<b.length;h++){var g=b[h];a>=g&&a-g<f&&(f=a-g,c=h)}return c},cleanupCurlyQuotes:function(a){a=a.replace(/\u2018/,"'");a=a.replace(/\u2019/,"'");a=a.replace(/\u201C/,'"');return a=a.replace(/\u201D/,'"')},reShowQuestion:function(){b.find('input[name="next"], input[name="check"], input[name="back"]').hide();
16
+ b.find(".wpProQuiz_quiz").children().first().children().show()},answerRandom:function(a){b.find(a).each(function(){var a=c(this).children(),a=a.sort(function(){return Math.round(Math.random())-0.5}).slice(0,a.length);c(a).appendTo(a[0].parentNode).show()})},questionRandom:function(){var a=b.find(".wpProQuiz_quiz ol").children(),a=a.sort(function(){return Math.round(Math.random())-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);
17
+ c(this).find("h3 span").html(d++)})},showTip:function(a){$tip=c(a).siblings(".wpProQuiz_tipp");$par=c(a).parent();void 0==j[$par.data("questionId")]&&(j[$par.data("questionId")]={});j[$par.data("questionId")].tip=1;$tip.toggle("fast")},setClozeStyle:function(){b.find(".wpProQuiz_cloze").each(function(){var a=c(this).children(),b=a.first(),a=a.last().clone();a.css("visibility","hidden");c("body").append(a);var e=a.width();a.remove();b.width(e+10)})},checkLock:function(){p=!0;c.post(e.url,{action:"wp_pro_quiz_check_lock",
18
+ quizId:e.quizId},function(a){t=a.is;p=!1;a.pre&&b.find('input[name="restartQuiz"]').hide();q&&(q=!1,f.methode.startQuiz())},"json")}};f.init=function(){m=0;e.lock&&!e.preview&&(s=!0,f.methode.checkLock());void 0==e.resultsGrade&&(e.resultsGrade=[0]);b.find(".wpProQuiz_quiz, .wpProQuiz_results").hide();b.find(".wpProQuiz_quiz").children().first().children().hide();f.methode.setData();f.methode.setClozeStyle();b.find('input[name="startQuiz"]').click(function(a){a.preventDefault();f.methode.preStartQuiz()});
19
+ b.find('input[name="check"]').click(function(a){a.preventDefault();f.methode.checkAnswer(this)});b.find('input[name="next"]').click(function(a){a.preventDefault();f.methode.nextQuestion(this)});b.find('input[name="restartQuiz"]').click(function(a){a.preventDefault();f.methode.reStartQuiz()});b.find('input[name="reShowQuestion"]').click(function(a){a.preventDefault();f.methode.reShowQuestion(this)});b.find('input[name="back"]').click(function(){f.methode.backQuestion(this)});b.find('input[name="tip"]').click(function(){f.methode.showTip(this)});
20
+ 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")})};f.init()};c.fn.wpProQuizFront=function(n){return this.each(function(){void 0==c(this).data("wpProQuizFront")&&c(this).data("wpProQuizFront",new c.wpProQuizFront(this,n))})}})(jQuery);
languages/wp-pro-quiz-ar.mo CHANGED
Binary file
languages/wp-pro-quiz-ar.po CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Wp-Pro-Quiz\n"
4
- "POT-Creation-Date: 2012-12-13 14:11+0100\n"
5
- "PO-Revision-Date: 2012-12-13 14:11+0100\n"
6
  "Last-Translator: Julius Fischer <julius.f@gmx.net>\n"
7
  "Language-Team: abuhassan <sajja2002@hotmail.com>\n"
8
  "Language: Arabic\n"
@@ -14,42 +14,50 @@ msgstr ""
14
  "X-Poedit-Basepath: ..\n"
15
  "X-Poedit-SearchPath-0: .\n"
16
 
17
- #: lib/controller/WpProQuiz_Controller_Admin.php:35
18
  msgid "Do you really want to delete the quiz/question?"
19
  msgstr "هل تريد حقاً ان تحذف هذا الاختبار/السؤال؟"
20
 
21
- #: lib/controller/WpProQuiz_Controller_Admin.php:36
22
  msgid "Title is not filled!"
23
  msgstr "لم يتم تعبئة هذا!"
24
 
25
- #: lib/controller/WpProQuiz_Controller_Admin.php:37
26
  msgid "No question deposited!"
27
  msgstr "لم يتم وضع سؤال!"
28
 
29
- #: lib/controller/WpProQuiz_Controller_Admin.php:38
30
  msgid "Correct answer was not selected!"
31
  msgstr "لم يتم اختيار اجابة صحيحة!"
32
 
33
- #: lib/controller/WpProQuiz_Controller_Admin.php:39
34
  msgid "No answer deposited!"
35
  msgstr "لم يتم وضع اجابة!"
36
 
37
- #: lib/controller/WpProQuiz_Controller_Admin.php:40
38
  msgid "No quiz description filled!"
39
  msgstr "لم يتم تعبئة وصف للاختبار!"
40
 
41
- #: lib/controller/WpProQuiz_Controller_Admin.php:41
42
  msgid "The percent values in result text are incorrect."
43
  msgstr "النسبة المئوية في نص النتائج غير صحيحة."
44
 
45
- #: lib/controller/WpProQuiz_Controller_Admin.php:42
46
  msgid "No number in the field \"Points\" or less than 1"
47
  msgstr "لا يوجد رقم في حقل /\"النقاط/\" أو أقل من 1"
48
 
49
- #: lib/controller/WpProQuiz_Controller_Admin.php:43
50
  msgid "No quiz selected"
51
  msgstr "لم يتم اختيار اختبار"
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
@@ -59,55 +67,59 @@ msgstr "لا يمكن استكمال الملف"
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
63
  msgid "Quiz not found"
64
  msgstr "لم يتم العثور على الاختبار"
65
 
66
- #: lib/controller/WpProQuiz_Controller_Question.php:61
 
 
 
 
67
  msgid "Edit question"
68
  msgstr "تحرير السؤال"
69
 
70
- #: lib/controller/WpProQuiz_Controller_Question.php:65
71
  msgid "Question not found"
72
  msgstr "لم يتم العثور على السؤال"
73
 
74
- #: lib/controller/WpProQuiz_Controller_Question.php:78
75
- #: lib/controller/WpProQuiz_Controller_Question.php:104
76
  #, php-format
77
  msgid "Question: %d"
78
  msgstr "السؤال: %d"
79
 
80
- #: lib/controller/WpProQuiz_Controller_Question.php:82
81
  msgid "Question edited"
82
  msgstr "تم تحرير السؤال"
83
 
84
- #: lib/controller/WpProQuiz_Controller_Question.php:91
85
  msgid "New question"
86
  msgstr "سؤال جديد"
87
 
88
- #: lib/controller/WpProQuiz_Controller_Question.php:109
89
  msgid "Question added"
90
  msgstr "تم اضافة سؤال"
91
 
92
- #: lib/controller/WpProQuiz_Controller_Quiz.php:37
93
  msgid "Edit quiz"
94
  msgstr "تحرير الاختبار"
95
 
96
- #: lib/controller/WpProQuiz_Controller_Quiz.php:57
97
  msgid "Quiz edited"
98
  msgstr "تم تحرير الاختبار"
99
 
100
- #: lib/controller/WpProQuiz_Controller_Quiz.php:66
101
- #: lib/controller/WpProQuiz_Controller_Quiz.php:94
102
  msgid "Quiz title or quiz description are not filled"
103
  msgstr "لم يتم تعبئة عنوان او وصف الاختبار"
104
 
105
- #: lib/controller/WpProQuiz_Controller_Quiz.php:77
106
- #: lib/controller/WpProQuiz_Controller_Quiz.php:88
107
  msgid "Create quiz"
108
  msgstr "انشاء اختبار"
109
 
110
- #: lib/controller/WpProQuiz_Controller_Quiz.php:106
111
  msgid "Quiz deleted"
112
  msgstr "تم حذف الاختبار"
113
 
@@ -123,108 +135,228 @@ msgstr "صيغة الملف خاطئة"
123
  msgid "Start quiz"
124
  msgstr "بدأ الاختبار"
125
 
126
- #: lib/view/WpProQuiz_View_FrontQuiz.php:72
 
 
 
 
 
 
127
  msgid "Results"
128
  msgstr "النتائج"
129
 
130
- #: lib/view/WpProQuiz_View_FrontQuiz.php:74
131
  #, php-format
132
  msgid "%s of %s questions answered correctly"
133
  msgstr "تم اجابة %s من %s اسئلة بشكل صحيح"
134
 
135
- #: lib/view/WpProQuiz_View_FrontQuiz.php:77
136
  msgid "Your time: <span></span>"
137
  msgstr "وقتك: <span></span>"
138
 
139
- #: lib/view/WpProQuiz_View_FrontQuiz.php:80
140
  msgid "Time has elapsed"
141
  msgstr "مضى من الوقت"
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 "لقد وصلت الي <span></span> من <span></span> لنقاط, (<span></span>%)"
147
 
148
- #: lib/view/WpProQuiz_View_FrontQuiz.php:98
149
  msgid "Restart quiz"
150
  msgstr "اعادة الاختبار"
151
 
152
- #: lib/view/WpProQuiz_View_FrontQuiz.php:100
153
- #, fuzzy
154
  msgid "View questions"
155
  msgstr "استعراض الاسئلة"
156
 
157
- #: lib/view/WpProQuiz_View_FrontQuiz.php:105
158
- #: lib/view/WpProQuiz_View_QuizEdit.php:126
159
- #: lib/view/WpProQuiz_View_QuizEdit.php:131
160
  msgid "Time limit"
161
  msgstr "الوقت المحدد"
162
 
163
- #: lib/view/WpProQuiz_View_FrontQuiz.php:118
164
  #, php-format
165
  msgid "Question %s of %s"
166
  msgstr "اسئلة %s من %s "
167
 
168
- #: lib/view/WpProQuiz_View_FrontQuiz.php:121
169
  #, php-format
170
  msgid "%d points"
171
  msgstr "%d درجات"
172
 
173
- #: lib/view/WpProQuiz_View_FrontQuiz.php:125
174
  #: lib/view/WpProQuiz_View_QuestionEdit.php:35
175
- #: lib/view/WpProQuiz_View_Statistics.php:19
176
  msgid "Question"
177
  msgstr "اسئلة"
178
 
179
- #: lib/view/WpProQuiz_View_FrontQuiz.php:132
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 "ترتيب العناصر"
185
 
186
- #: lib/view/WpProQuiz_View_FrontQuiz.php:211
187
- #: lib/view/WpProQuiz_View_Statistics.php:21
188
  msgid "Correct"
189
  msgstr "صحيح"
190
 
191
- #: lib/view/WpProQuiz_View_FrontQuiz.php:219
192
- #: lib/view/WpProQuiz_View_Statistics.php:20
193
  msgid "Incorrect"
194
  msgstr "خطأ"
195
 
196
- #: lib/view/WpProQuiz_View_FrontQuiz.php:235
197
- #: lib/view/WpProQuiz_View_FrontQuiz.php:245
198
  #: lib/view/WpProQuiz_View_QuestionEdit.php:71
199
  msgid "Hint"
200
  msgstr "تلميح"
201
 
202
- #: lib/view/WpProQuiz_View_FrontQuiz.php:242
203
  msgid "Check"
204
  msgstr "التحقق"
205
 
206
- #: lib/view/WpProQuiz_View_FrontQuiz.php:243
207
  msgid "Back"
208
  msgstr "العودة"
209
 
210
- #: lib/view/WpProQuiz_View_FrontQuiz.php:247
211
  msgid "Next exercise"
212
  msgstr "التمرين التالي"
213
 
214
- #: lib/view/WpProQuiz_View_Import.php:21
215
- #: lib/view/WpProQuiz_View_QuizOverall.php:77
216
- #: lib/view/WpProQuiz_View_QuizOverall.php:92
217
- msgid "Import"
218
- msgstr "استيراد"
 
 
 
 
 
 
 
 
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
224
- #: lib/view/WpProQuiz_View_Statistics.php:8
225
  msgid "back to overview"
226
  msgstr "العودة للرئيسية"
227
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
228
  #: lib/view/WpProQuiz_View_Import.php:25
229
  msgid "Error"
230
  msgstr "خطأ"
@@ -242,12 +374,12 @@ msgid "Quiz name"
242
  msgstr "اسم الاختبار"
243
 
244
  #: lib/view/WpProQuiz_View_Import.php:44
245
- #: lib/view/WpProQuiz_View_QuizOverall.php:65
246
  msgid "Questions"
247
  msgstr "اسئلة"
248
 
249
  #: lib/view/WpProQuiz_View_Import.php:67
250
- #: lib/view/WpProQuiz_View_QuizOverall.php:103
251
  msgid "Start import"
252
  msgstr "ابدأ الاستيراد"
253
 
@@ -259,7 +391,7 @@ msgstr "العنوان"
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:232
263
  msgid "(optional)"
264
  msgstr "(اختيار)"
265
 
@@ -273,6 +405,7 @@ msgstr ""
273
 
274
  #: lib/view/WpProQuiz_View_QuestionEdit.php:26
275
  #: lib/view/WpProQuiz_View_QuestionEdit.php:31
 
276
  msgid "Points"
277
  msgstr "درجات"
278
 
@@ -280,7 +413,7 @@ msgstr "درجات"
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:221
284
  msgid "(required)"
285
  msgstr "(مطلوب)"
286
 
@@ -393,7 +526,7 @@ msgstr "حذف الاجابة"
393
  #: lib/view/WpProQuiz_View_QuestionEdit.php:262
394
  #: lib/view/WpProQuiz_View_QuestionEdit.php:300
395
  #: lib/view/WpProQuiz_View_QuestionEdit.php:335
396
- #: lib/view/WpProQuiz_View_QuestionOverall.php:29
397
  msgid "Move"
398
  msgstr "تحريك"
399
 
@@ -446,43 +579,58 @@ msgstr ""
446
  "لاحتوائه مع قاموس رواجا مثل {} \"{} I كرة القدم ألعاب \". يتم تجاهل الحروف "
447
  "الكبيرة والصغيرة."
448
 
449
- #: lib/view/WpProQuiz_View_QuestionEdit.php:353
450
- #: lib/view/WpProQuiz_View_QuizEdit.php:300
451
- msgid "Save"
452
- msgstr "حفظ"
453
-
454
- #: lib/view/WpProQuiz_View_QuestionOverall.php:8
455
  msgid "Questions sorted"
456
  msgstr "ترتيب الاسئلة"
457
 
458
- #: lib/view/WpProQuiz_View_QuestionOverall.php:14
459
- #: lib/view/WpProQuiz_View_QuizOverall.php:51
460
  msgid "Name"
461
  msgstr "الاسم"
462
 
463
- #: lib/view/WpProQuiz_View_QuestionOverall.php:15
464
- #: lib/view/WpProQuiz_View_QuizOverall.php:52
465
  msgid "Action"
466
  msgstr "الحدث"
467
 
468
- #: lib/view/WpProQuiz_View_QuestionOverall.php:27
469
- #: lib/view/WpProQuiz_View_QuizOverall.php:66
470
  msgid "Edit"
471
  msgstr "تحرير"
472
 
473
- #: lib/view/WpProQuiz_View_QuestionOverall.php:28
474
- #: lib/view/WpProQuiz_View_QuizOverall.php:67
475
  msgid "Delete"
476
  msgstr "حذف"
477
 
478
- #: lib/view/WpProQuiz_View_QuestionOverall.php:36
479
  msgid "Add question"
480
  msgstr "اضافة سؤال"
481
 
482
- #: lib/view/WpProQuiz_View_QuestionOverall.php:37
483
  msgid "Save order"
484
  msgstr "حفظ الترتيب"
485
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
486
  #: lib/view/WpProQuiz_View_QuizEdit.php:12
487
  msgid "Quiz title"
488
  msgstr "عنوان الاختبار"
@@ -499,72 +647,72 @@ msgstr "اخفاء عنوان الاختبار"
499
  msgid "Hide title"
500
  msgstr "اخفاء العنوان"
501
 
502
- #: lib/view/WpProQuiz_View_QuizEdit.php:35
503
  msgid "The title serves as quiz heading."
504
  msgstr "العنوان يظهر كعنوانا من اجل الاختبار."
505
 
506
- #: lib/view/WpProQuiz_View_QuizEdit.php:42
507
- #: lib/view/WpProQuiz_View_QuizEdit.php:47
508
  msgid "Hide \"Restart quiz\" button"
509
- msgstr ""
510
 
511
- #: lib/view/WpProQuiz_View_QuizEdit.php:53
512
  msgid "Hide the \"Restart quiz\" button in the Frontend."
513
- msgstr ""
514
 
515
- #: lib/view/WpProQuiz_View_QuizEdit.php:60
516
- #: lib/view/WpProQuiz_View_QuizEdit.php:65
517
  msgid "Hide \"View question\" button"
518
- msgstr ""
519
 
520
- #: lib/view/WpProQuiz_View_QuizEdit.php:71
521
  msgid "Hide the \"View question\" button in the Frontend."
522
- msgstr ""
523
 
524
- #: lib/view/WpProQuiz_View_QuizEdit.php:78
525
- #: lib/view/WpProQuiz_View_QuizEdit.php:83
526
  msgid "Show points"
527
  msgstr "اعرض الدرجات"
528
 
529
- #: lib/view/WpProQuiz_View_QuizEdit.php:89
530
  msgid "Shows in quiz, how many points are reachable for respective question."
531
  msgstr "يظهر في الاختبار، كم عدد نقاط يمكن الوصول للأسئلة المعنية."
532
 
533
- #: lib/view/WpProQuiz_View_QuizEdit.php:96
534
- #: lib/view/WpProQuiz_View_QuizEdit.php:101
535
  msgid "Display question randomly"
536
  msgstr "اعرض الاسئلة عشوائياً"
537
 
538
- #: lib/view/WpProQuiz_View_QuizEdit.php:111
539
  #: lib/view/WpProQuiz_View_QuizEdit.php:116
 
540
  msgid "Display answers randomly"
541
  msgstr "اعرض الاجابات عشوائياً"
542
 
543
- #: lib/view/WpProQuiz_View_QuizEdit.php:134
544
  msgid "Seconds"
545
  msgstr "ثواني"
546
 
547
- #: lib/view/WpProQuiz_View_QuizEdit.php:137
548
  msgid "0 = no limit"
549
  msgstr "0 = بدون وقت محدد"
550
 
551
- #: lib/view/WpProQuiz_View_QuizEdit.php:144
552
- #: lib/view/WpProQuiz_View_QuizEdit.php:149
553
  msgid "Check -> continue"
554
  msgstr "فحص->استكمال"
555
 
556
- #: lib/view/WpProQuiz_View_QuizEdit.php:155
557
  msgid ""
558
  "Show \"right or wrong\" after the question. Otherwise the solutions will be "
559
  "displayed at the end."
560
  msgstr "عرض\"صواب أو خطأ\" بعد السؤال. وإلا يتم عرض الحلول في نهاية المطاف."
561
 
562
- #: lib/view/WpProQuiz_View_QuizEdit.php:162
563
- #: lib/view/WpProQuiz_View_QuizEdit.php:167
564
  msgid "Back button"
565
  msgstr "زر العودة"
566
 
567
- #: lib/view/WpProQuiz_View_QuizEdit.php:173
568
  msgid ""
569
  "Allow to use back button in a question. (Option will be ignored if \"Check -"
570
  "> Continue\" was used)"
@@ -572,17 +720,13 @@ msgstr ""
572
  "السماح لاستخدام زر العودة في سؤال. (سيتم تجاهل الخيار إذا\"تم تأشير زر -> "
573
  "متابعة \" مستخدماً)"
574
 
575
- #: lib/view/WpProQuiz_View_QuizEdit.php:180
576
- #: lib/view/WpProQuiz_View_QuizEdit.php:185
577
- #: lib/view/WpProQuiz_View_QuizOverall.php:69
578
  msgid "Statistics"
579
  msgstr "احصائيات"
580
 
581
- #: lib/view/WpProQuiz_View_QuizEdit.php:189
582
- msgid "activate"
583
- msgstr "تفعيل"
584
-
585
- #: lib/view/WpProQuiz_View_QuizEdit.php:192
586
  msgid ""
587
  "Statistics about right or wrong answers. Statistics will be saved by "
588
  "completed quiz, not after every question. The statistics is only visible "
@@ -592,16 +736,16 @@ msgstr ""
592
  "الاختبار، وليس بعد كل سؤال. الإحصاءات تظهر فقط خلال قائمة الإدارة. "
593
  "(الإحصاءات الداخلية)"
594
 
595
- #: lib/view/WpProQuiz_View_QuizEdit.php:199
596
- #: lib/view/WpProQuiz_View_QuizEdit.php:204
597
  msgid "Statistics IP-lock"
598
  msgstr "احصائيات قفل-اي بي"
599
 
600
- #: lib/view/WpProQuiz_View_QuizEdit.php:208
601
  msgid "in minutes (recommended 1440 minutes = 1 day)"
602
  msgstr "بالدقائق (مستحسن 1440 دقيقة = 1 يوم)"
603
 
604
- #: lib/view/WpProQuiz_View_QuizEdit.php:211
605
  msgid ""
606
  "Protect the statistics from spam. Result will only be saved every X minutes "
607
  "from same IP. (0 = deactivated)"
@@ -609,37 +753,87 @@ msgstr ""
609
  "حماية الإحصاءات من البريد المزعج. النتائج سوف تحفظ كل * دقيقة من نفي الاي "
610
  "بي. (0= غير مفعل)"
611
 
612
- #: lib/view/WpProQuiz_View_QuizEdit.php:221
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
613
  msgid "Quiz description"
614
  msgstr "وصف الاختبار"
615
 
616
- #: lib/view/WpProQuiz_View_QuizEdit.php:224
617
  msgid "This text will be displayed before start of the quiz."
618
  msgstr "سيتم عرض هذا النص قبل بدء الاختبار."
619
 
620
- #: lib/view/WpProQuiz_View_QuizEdit.php:232
621
  msgid "Results text"
622
  msgstr "نص النتائج"
623
 
624
- #: lib/view/WpProQuiz_View_QuizEdit.php:235
625
  msgid ""
626
  "This text will be displayed at the end of the quiz (in results). (this text "
627
  "is optional)"
628
  msgstr "سيتم عرض هذا النص في نهاية الاختبار (في النتائج). (هذا النص اختياري)"
629
 
630
- #: lib/view/WpProQuiz_View_QuizEdit.php:239
631
  msgid "Activate graduation"
632
  msgstr "تفعيل التقييم"
633
 
634
- #: lib/view/WpProQuiz_View_QuizEdit.php:245
635
  msgid "Hint:"
636
  msgstr "تلميح:"
637
 
638
- #: lib/view/WpProQuiz_View_QuizEdit.php:247
639
  msgid "Maximal 15 levels"
640
  msgstr "اقصى حد 15 مستوى"
641
 
642
- #: lib/view/WpProQuiz_View_QuizEdit.php:249
643
  #, php-format
644
  msgid ""
645
  "Percentages refer to the total score of the quiz. (Current total %d points "
@@ -648,26 +842,26 @@ msgstr ""
648
  "النسبة المئوية تشير الي الدرجة الكلية للأختبار.( المجموع الحالي %d درجة في "
649
  "%d سؤال"
650
 
651
- #: lib/view/WpProQuiz_View_QuizEdit.php:252
652
  msgid "Values can also be mixed up"
653
  msgstr "يمكن لخبطة القيم"
654
 
655
- #: lib/view/WpProQuiz_View_QuizEdit.php:253
656
  msgid "10,15% or 10.15% allowed (max. two digits after the decimal point)"
657
  msgstr "10.15% او 10.15% مسموح به (اقصى حد هو رقمين بعد النسبة المئوية)"
658
 
659
- #: lib/view/WpProQuiz_View_QuizEdit.php:269
660
- #: lib/view/WpProQuiz_View_QuizEdit.php:280
661
  msgid "from:"
662
  msgstr "من:"
663
 
664
- #: lib/view/WpProQuiz_View_QuizEdit.php:269
665
- #: lib/view/WpProQuiz_View_QuizEdit.php:280
666
  msgid "percent"
667
  msgstr "النسبة المئوية"
668
 
669
- #: lib/view/WpProQuiz_View_QuizEdit.php:269
670
- #: lib/view/WpProQuiz_View_QuizEdit.php:280
671
  #, php-format
672
  msgid ""
673
  "(Will be displayed, when result-percent is >= <span class=\"resultProzent\">"
@@ -676,12 +870,12 @@ msgstr ""
676
  "(سوف يتم عرضه، عندما تكون نسبة النتيجة>= <span class=\"resultProzent\">%s</"
677
  "span>%%)"
678
 
679
- #: lib/view/WpProQuiz_View_QuizEdit.php:270
680
- #: lib/view/WpProQuiz_View_QuizEdit.php:281
681
  msgid "Delete graduation"
682
  msgstr "حذف التقييم"
683
 
684
- #: lib/view/WpProQuiz_View_QuizEdit.php:288
685
  msgid "Add graduation"
686
  msgstr "اضافة تقييم"
687
 
@@ -697,79 +891,95 @@ msgstr "في حالة وجود مشاكل"
697
  msgid "If quiz doesn't work in front-end, please try following:"
698
  msgstr "إذا الاختبار لا يعمل في الواجهة الأمامية، يرجى تجربة التالي:"
699
 
700
- #: lib/view/WpProQuiz_View_QuizOverall.php:42
701
- msgid ""
702
- "Own themes changes internal order of filters, what causes the problems. "
703
- "With additional shortcode [raw] this is prevented."
704
- msgstr ""
705
- "الثيمات الخاصة تغير النظام الداخلي للمرشحات، مما يسبب المشاكل. مع الرمز "
706
- "القصير إضافية [الخام] يتم منع هذا. MIB"
707
-
708
- #: lib/view/WpProQuiz_View_QuizOverall.php:49
709
  msgid "ID"
710
  msgstr "الرقم"
711
 
712
- #: lib/view/WpProQuiz_View_QuizOverall.php:50
713
  msgid "Shortcode"
714
  msgstr "الكود"
715
 
716
- #: lib/view/WpProQuiz_View_QuizOverall.php:68
717
  msgid "Preview"
718
  msgstr "استعراض"
719
 
720
- #: lib/view/WpProQuiz_View_QuizOverall.php:76
721
  msgid "Add quiz"
722
  msgstr "اضف اختبار"
723
 
724
- #: lib/view/WpProQuiz_View_QuizOverall.php:78
725
- #: lib/view/WpProQuiz_View_QuizOverall.php:82
726
  msgid "Export"
727
  msgstr "تصدير"
728
 
729
- #: lib/view/WpProQuiz_View_QuizOverall.php:83
730
  msgid ""
731
  "Choose the respective question, which you would like to export and press on "
732
  "\"Start export\""
733
  msgstr "اختار سؤال، الذي تود أن تقوم بتصديره و اضغط على \"ابدأ التصدير\""
734
 
735
- #: lib/view/WpProQuiz_View_QuizOverall.php:87
736
  msgid "Start export"
737
  msgstr "ابدأ التصدير"
738
 
739
- #: lib/view/WpProQuiz_View_QuizOverall.php:93
740
  msgid "Import only *.wpq files from known and trusted sources."
741
  msgstr "استورد ملفات *.wpq فقط من مصدر معروف او موثوق به"
742
 
743
- #: lib/view/WpProQuiz_View_QuizOverall.php:101
744
  #, php-format
745
  msgid "Maximal %d MiB"
746
- msgstr ""
747
 
748
- #: lib/view/WpProQuiz_View_Statistics.php:7
749
  #, php-format
750
  msgid "Quiz: %s - Statistics"
751
  msgstr "احصائيات اختبار: %s "
752
 
753
- #: lib/view/WpProQuiz_View_Statistics.php:11
754
  msgid "Stats not enabled"
755
  msgstr "الاحصائيات غير مفعلة"
756
 
757
- #: lib/view/WpProQuiz_View_Statistics.php:12
758
  msgid "Activate statistics"
759
  msgstr "تفعيل الاحصائيات"
760
 
761
- #: lib/view/WpProQuiz_View_Statistics.php:22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
762
  msgid "Hints used"
763
  msgstr "التلميحات مستخدمة"
764
 
765
- #: lib/view/WpProQuiz_View_Statistics.php:59
766
  msgid "Total"
767
  msgstr "المجموع"
768
 
769
- #: lib/view/WpProQuiz_View_Statistics.php:66
770
  msgid "Reset statistics"
771
  msgstr "اعادة ضبط الاحصائيات"
772
 
 
 
 
 
 
 
 
 
773
  #~ msgid "One question is one point"
774
  #~ msgstr "سؤال واحد يعني درجة واحدة"
775
 
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Wp-Pro-Quiz\n"
4
+ "POT-Creation-Date: 2012-12-22 15:43+0100\n"
5
+ "PO-Revision-Date: 2012-12-22 15:43+0100\n"
6
  "Last-Translator: Julius Fischer <julius.f@gmx.net>\n"
7
  "Language-Team: abuhassan <sajja2002@hotmail.com>\n"
8
  "Language: Arabic\n"
14
  "X-Poedit-Basepath: ..\n"
15
  "X-Poedit-SearchPath-0: .\n"
16
 
17
+ #: lib/controller/WpProQuiz_Controller_Admin.php:72
18
  msgid "Do you really want to delete the quiz/question?"
19
  msgstr "هل تريد حقاً ان تحذف هذا الاختبار/السؤال؟"
20
 
21
+ #: lib/controller/WpProQuiz_Controller_Admin.php:73
22
  msgid "Title is not filled!"
23
  msgstr "لم يتم تعبئة هذا!"
24
 
25
+ #: lib/controller/WpProQuiz_Controller_Admin.php:74
26
  msgid "No question deposited!"
27
  msgstr "لم يتم وضع سؤال!"
28
 
29
+ #: lib/controller/WpProQuiz_Controller_Admin.php:75
30
  msgid "Correct answer was not selected!"
31
  msgstr "لم يتم اختيار اجابة صحيحة!"
32
 
33
+ #: lib/controller/WpProQuiz_Controller_Admin.php:76
34
  msgid "No answer deposited!"
35
  msgstr "لم يتم وضع اجابة!"
36
 
37
+ #: lib/controller/WpProQuiz_Controller_Admin.php:77
38
  msgid "No quiz description filled!"
39
  msgstr "لم يتم تعبئة وصف للاختبار!"
40
 
41
+ #: lib/controller/WpProQuiz_Controller_Admin.php:78
42
  msgid "The percent values in result text are incorrect."
43
  msgstr "النسبة المئوية في نص النتائج غير صحيحة."
44
 
45
+ #: lib/controller/WpProQuiz_Controller_Admin.php:79
46
  msgid "No number in the field \"Points\" or less than 1"
47
  msgstr "لا يوجد رقم في حقل /\"النقاط/\" أو أقل من 1"
48
 
49
+ #: lib/controller/WpProQuiz_Controller_Admin.php:80
50
  msgid "No quiz selected"
51
  msgstr "لم يتم اختيار اختبار"
52
 
53
+ #: lib/controller/WpProQuiz_Controller_Admin.php:81
54
+ msgid "Do you really want to reset the statistic?"
55
+ msgstr ""
56
+
57
+ #: lib/controller/WpProQuiz_Controller_GlobalSettings.php:14
58
+ msgid "Settings saved"
59
+ msgstr ""
60
+
61
  #: lib/controller/WpProQuiz_Controller_ImportExport.php:70
62
  #: lib/helper/WpProQuiz_Helper_Import.php:54
63
  #: lib/helper/WpProQuiz_Helper_Import.php:63
67
 
68
  #: lib/controller/WpProQuiz_Controller_Question.php:9
69
  #: lib/controller/WpProQuiz_Controller_Question.php:19
70
+ #: lib/controller/WpProQuiz_Controller_Quiz.php:63
71
  msgid "Quiz not found"
72
  msgstr "لم يتم العثور على الاختبار"
73
 
74
+ #: lib/controller/WpProQuiz_Controller_Question.php:60
75
+ msgid "questions copied"
76
+ msgstr ""
77
+
78
+ #: lib/controller/WpProQuiz_Controller_Question.php:121
79
  msgid "Edit question"
80
  msgstr "تحرير السؤال"
81
 
82
+ #: lib/controller/WpProQuiz_Controller_Question.php:125
83
  msgid "Question not found"
84
  msgstr "لم يتم العثور على السؤال"
85
 
86
+ #: lib/controller/WpProQuiz_Controller_Question.php:138
87
+ #: lib/controller/WpProQuiz_Controller_Question.php:164
88
  #, php-format
89
  msgid "Question: %d"
90
  msgstr "السؤال: %d"
91
 
92
+ #: lib/controller/WpProQuiz_Controller_Question.php:142
93
  msgid "Question edited"
94
  msgstr "تم تحرير السؤال"
95
 
96
+ #: lib/controller/WpProQuiz_Controller_Question.php:151
97
  msgid "New question"
98
  msgstr "سؤال جديد"
99
 
100
+ #: lib/controller/WpProQuiz_Controller_Question.php:169
101
  msgid "Question added"
102
  msgstr "تم اضافة سؤال"
103
 
104
+ #: lib/controller/WpProQuiz_Controller_Quiz.php:58
105
  msgid "Edit quiz"
106
  msgstr "تحرير الاختبار"
107
 
108
+ #: lib/controller/WpProQuiz_Controller_Quiz.php:78
109
  msgid "Quiz edited"
110
  msgstr "تم تحرير الاختبار"
111
 
112
+ #: lib/controller/WpProQuiz_Controller_Quiz.php:87
113
+ #: lib/controller/WpProQuiz_Controller_Quiz.php:115
114
  msgid "Quiz title or quiz description are not filled"
115
  msgstr "لم يتم تعبئة عنوان او وصف الاختبار"
116
 
117
+ #: lib/controller/WpProQuiz_Controller_Quiz.php:98
118
+ #: lib/controller/WpProQuiz_Controller_Quiz.php:109
119
  msgid "Create quiz"
120
  msgstr "انشاء اختبار"
121
 
122
+ #: lib/controller/WpProQuiz_Controller_Quiz.php:135
123
  msgid "Quiz deleted"
124
  msgstr "تم حذف الاختبار"
125
 
135
  msgid "Start quiz"
136
  msgstr "بدأ الاختبار"
137
 
138
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:73
139
+ msgid ""
140
+ "You have already completed the quiz before. Hence you can not start it again."
141
+ msgstr ""
142
+
143
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:77
144
+ #: lib/view/WpProQuiz_View_Statistics.php:58
145
  msgid "Results"
146
  msgstr "النتائج"
147
 
148
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:79
149
  #, php-format
150
  msgid "%s of %s questions answered correctly"
151
  msgstr "تم اجابة %s من %s اسئلة بشكل صحيح"
152
 
153
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:82
154
  msgid "Your time: <span></span>"
155
  msgstr "وقتك: <span></span>"
156
 
157
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:85
158
  msgid "Time has elapsed"
159
  msgstr "مضى من الوقت"
160
 
161
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:88
162
  msgid ""
163
  "You have reached <span></span> of <span></span> points, (<span></span>%)"
164
  msgstr "لقد وصلت الي <span></span> من <span></span> لنقاط, (<span></span>%)"
165
 
166
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:103
167
  msgid "Restart quiz"
168
  msgstr "اعادة الاختبار"
169
 
170
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:105
 
171
  msgid "View questions"
172
  msgstr "استعراض الاسئلة"
173
 
174
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:110
175
+ #: lib/view/WpProQuiz_View_QuizEdit.php:132
176
+ #: lib/view/WpProQuiz_View_QuizEdit.php:137
177
  msgid "Time limit"
178
  msgstr "الوقت المحدد"
179
 
180
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:123
181
  #, php-format
182
  msgid "Question %s of %s"
183
  msgstr "اسئلة %s من %s "
184
 
185
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:126
186
  #, php-format
187
  msgid "%d points"
188
  msgstr "%d درجات"
189
 
190
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:130
191
  #: lib/view/WpProQuiz_View_QuestionEdit.php:35
192
+ #: lib/view/WpProQuiz_View_Statistics.php:53
193
  msgid "Question"
194
  msgstr "اسئلة"
195
 
196
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:137
197
  #: lib/view/WpProQuiz_View_QuestionEdit.php:235
198
  #: lib/view/WpProQuiz_View_QuestionEdit.php:273
199
  #: lib/view/WpProQuiz_View_QuestionEdit.php:308
200
  msgid "Sort elements"
201
  msgstr "ترتيب العناصر"
202
 
203
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:216
204
+ #: lib/view/WpProQuiz_View_Statistics.php:55
205
  msgid "Correct"
206
  msgstr "صحيح"
207
 
208
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:224
209
+ #: lib/view/WpProQuiz_View_Statistics.php:56
210
  msgid "Incorrect"
211
  msgstr "خطأ"
212
 
213
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:240
214
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:250
215
  #: lib/view/WpProQuiz_View_QuestionEdit.php:71
216
  msgid "Hint"
217
  msgstr "تلميح"
218
 
219
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:247
220
  msgid "Check"
221
  msgstr "التحقق"
222
 
223
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:248
224
  msgid "Back"
225
  msgstr "العودة"
226
 
227
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:252
228
  msgid "Next exercise"
229
  msgstr "التمرين التالي"
230
 
231
+ #: lib/view/WpProQuiz_View_GobalSettings.php:7
232
+ msgid "to activate"
233
+ msgstr ""
234
+
235
+ #: lib/view/WpProQuiz_View_GobalSettings.php:9
236
+ msgid "not to activate"
237
+ msgstr ""
238
+
239
+ #: lib/view/WpProQuiz_View_GobalSettings.php:14
240
+ #: lib/view/WpProQuiz_View_GobalSettings.php:25
241
+ #: lib/view/WpProQuiz_View_QuizOverall.php:46
242
+ msgid "Settings in case of problems"
243
+ msgstr ""
244
 
245
+ #: lib/view/WpProQuiz_View_GobalSettings.php:16
246
+ msgid "Please note"
247
+ msgstr ""
248
+
249
+ #: lib/view/WpProQuiz_View_GobalSettings.php:18
250
+ msgid ""
251
+ "These settings should only be set in cases of problems with Wp-Pro-Quiz."
252
+ msgstr ""
253
+
254
+ #: lib/view/WpProQuiz_View_GobalSettings.php:21
255
  #: lib/view/WpProQuiz_View_Import.php:22
256
  #: lib/view/WpProQuiz_View_QuestionEdit.php:13
257
+ #: lib/view/WpProQuiz_View_QuestionOverall.php:18
258
  #: lib/view/WpProQuiz_View_QuizEdit.php:8
259
+ #: lib/view/WpProQuiz_View_Statistics.php:18
260
  msgid "back to overview"
261
  msgstr "العودة للرئيسية"
262
 
263
+ #: lib/view/WpProQuiz_View_GobalSettings.php:31
264
+ #: lib/view/WpProQuiz_View_GobalSettings.php:36
265
+ msgid "Automatically add [raw] shortcode"
266
+ msgstr ""
267
+
268
+ #: lib/view/WpProQuiz_View_GobalSettings.php:40
269
+ #: lib/view/WpProQuiz_View_GobalSettings.php:62
270
+ #: lib/view/WpProQuiz_View_QuizEdit.php:33
271
+ #: lib/view/WpProQuiz_View_QuizEdit.php:52
272
+ #: lib/view/WpProQuiz_View_QuizEdit.php:71
273
+ #: lib/view/WpProQuiz_View_QuizEdit.php:90
274
+ #: lib/view/WpProQuiz_View_QuizEdit.php:109
275
+ #: lib/view/WpProQuiz_View_QuizEdit.php:125
276
+ #: lib/view/WpProQuiz_View_QuizEdit.php:159
277
+ #: lib/view/WpProQuiz_View_QuizEdit.php:178
278
+ #: lib/view/WpProQuiz_View_QuizEdit.php:197
279
+ #: lib/view/WpProQuiz_View_QuizEdit.php:237
280
+ msgid "Activate"
281
+ msgstr ""
282
+
283
+ #: lib/view/WpProQuiz_View_GobalSettings.php:40
284
+ #, php-format
285
+ msgid "It is recommended %s this option on your system."
286
+ msgstr ""
287
+
288
+ #: lib/view/WpProQuiz_View_GobalSettings.php:43
289
+ msgid ""
290
+ "If this option is activated, a [raw] shortcode is automatically set around "
291
+ "WpProQuiz shortcode ( [WpProQuiz X] ) into [raw] [WpProQuiz X] [/raw]"
292
+ msgstr ""
293
+
294
+ #: lib/view/WpProQuiz_View_GobalSettings.php:46
295
+ #: lib/view/WpProQuiz_View_QuizOverall.php:42
296
+ msgid ""
297
+ "Own themes changes internal order of filters, what causes the problems. "
298
+ "With additional shortcode [raw] this is prevented."
299
+ msgstr ""
300
+ "الثيمات الخاصة تغير النظام الداخلي للمرشحات، مما يسبب المشاكل. مع الرمز "
301
+ "القصير إضافية [الخام] يتم منع هذا. MIB"
302
+
303
+ #: lib/view/WpProQuiz_View_GobalSettings.php:53
304
+ #: lib/view/WpProQuiz_View_GobalSettings.php:58
305
+ msgid "Do not load the Javascript-files in the footer"
306
+ msgstr ""
307
+
308
+ #: lib/view/WpProQuiz_View_GobalSettings.php:65
309
+ msgid ""
310
+ "Generally all WpProQuiz-Javascript files are loaded in the footer and only "
311
+ "when they are really needed."
312
+ msgstr ""
313
+
314
+ #: lib/view/WpProQuiz_View_GobalSettings.php:68
315
+ msgid "In very old Wordpress themes this can lead to problems."
316
+ msgstr ""
317
+
318
+ #: lib/view/WpProQuiz_View_GobalSettings.php:71
319
+ msgid ""
320
+ "If you activate this option, all WpProQuiz-Javascript files are loaded in "
321
+ "the header even if they are not needed."
322
+ msgstr ""
323
+
324
+ #: lib/view/WpProQuiz_View_GobalSettings.php:74
325
+ #, php-format
326
+ msgid ""
327
+ "Anyone who wants to learn more about this topic should read through the "
328
+ "following websites %s and %s."
329
+ msgstr ""
330
+
331
+ #: lib/view/WpProQuiz_View_GobalSettings.php:83
332
+ #: lib/view/WpProQuiz_View_GobalSettings.php:88
333
+ msgid "Touch Library"
334
+ msgstr ""
335
+
336
+ #: lib/view/WpProQuiz_View_GobalSettings.php:92
337
+ msgid "Deactivate"
338
+ msgstr ""
339
+
340
+ #: lib/view/WpProQuiz_View_GobalSettings.php:95
341
+ msgid "In Version 0.13 a new Touch Library was added for mobile devices."
342
+ msgstr ""
343
+
344
+ #: lib/view/WpProQuiz_View_GobalSettings.php:98
345
+ msgid "If you have any problems with the Touch Library, please deactivate it."
346
+ msgstr ""
347
+
348
+ #: lib/view/WpProQuiz_View_GobalSettings.php:107
349
+ #: lib/view/WpProQuiz_View_QuestionEdit.php:353
350
+ #: lib/view/WpProQuiz_View_QuizEdit.php:368
351
+ msgid "Save"
352
+ msgstr "حفظ"
353
+
354
+ #: lib/view/WpProQuiz_View_Import.php:21
355
+ #: lib/view/WpProQuiz_View_QuizOverall.php:80
356
+ #: lib/view/WpProQuiz_View_QuizOverall.php:95
357
+ msgid "Import"
358
+ msgstr "استيراد"
359
+
360
  #: lib/view/WpProQuiz_View_Import.php:25
361
  msgid "Error"
362
  msgstr "خطأ"
374
  msgstr "اسم الاختبار"
375
 
376
  #: lib/view/WpProQuiz_View_Import.php:44
377
+ #: lib/view/WpProQuiz_View_QuizOverall.php:68
378
  msgid "Questions"
379
  msgstr "اسئلة"
380
 
381
  #: lib/view/WpProQuiz_View_Import.php:67
382
+ #: lib/view/WpProQuiz_View_QuizOverall.php:106
383
  msgid "Start import"
384
  msgstr "ابدأ الاستيراد"
385
 
391
  #: lib/view/WpProQuiz_View_QuestionEdit.php:43
392
  #: lib/view/WpProQuiz_View_QuestionEdit.php:60
393
  #: lib/view/WpProQuiz_View_QuestionEdit.php:71
394
+ #: lib/view/WpProQuiz_View_QuizEdit.php:300
395
  msgid "(optional)"
396
  msgstr "(اختيار)"
397
 
405
 
406
  #: lib/view/WpProQuiz_View_QuestionEdit.php:26
407
  #: lib/view/WpProQuiz_View_QuestionEdit.php:31
408
+ #: lib/view/WpProQuiz_View_Statistics.php:54
409
  msgid "Points"
410
  msgstr "درجات"
411
 
413
  #: lib/view/WpProQuiz_View_QuestionEdit.php:35
414
  #: lib/view/WpProQuiz_View_QuestionEdit.php:123
415
  #: lib/view/WpProQuiz_View_QuizEdit.php:12
416
+ #: lib/view/WpProQuiz_View_QuizEdit.php:289
417
  msgid "(required)"
418
  msgstr "(مطلوب)"
419
 
526
  #: lib/view/WpProQuiz_View_QuestionEdit.php:262
527
  #: lib/view/WpProQuiz_View_QuestionEdit.php:300
528
  #: lib/view/WpProQuiz_View_QuestionEdit.php:335
529
+ #: lib/view/WpProQuiz_View_QuestionOverall.php:38
530
  msgid "Move"
531
  msgstr "تحريك"
532
 
579
  "لاحتوائه مع قاموس رواجا مثل {} \"{} I كرة القدم ألعاب \". يتم تجاهل الحروف "
580
  "الكبيرة والصغيرة."
581
 
582
+ #: lib/view/WpProQuiz_View_QuestionOverall.php:17
 
 
 
 
 
583
  msgid "Questions sorted"
584
  msgstr "ترتيب الاسئلة"
585
 
586
+ #: lib/view/WpProQuiz_View_QuestionOverall.php:23
587
+ #: lib/view/WpProQuiz_View_QuizOverall.php:54
588
  msgid "Name"
589
  msgstr "الاسم"
590
 
591
+ #: lib/view/WpProQuiz_View_QuestionOverall.php:24
592
+ #: lib/view/WpProQuiz_View_QuizOverall.php:55
593
  msgid "Action"
594
  msgstr "الحدث"
595
 
596
+ #: lib/view/WpProQuiz_View_QuestionOverall.php:36
597
+ #: lib/view/WpProQuiz_View_QuizOverall.php:69
598
  msgid "Edit"
599
  msgstr "تحرير"
600
 
601
+ #: lib/view/WpProQuiz_View_QuestionOverall.php:37
602
+ #: lib/view/WpProQuiz_View_QuizOverall.php:70
603
  msgid "Delete"
604
  msgstr "حذف"
605
 
606
+ #: lib/view/WpProQuiz_View_QuestionOverall.php:45
607
  msgid "Add question"
608
  msgstr "اضافة سؤال"
609
 
610
+ #: lib/view/WpProQuiz_View_QuestionOverall.php:46
611
  msgid "Save order"
612
  msgstr "حفظ الترتيب"
613
 
614
+ #: lib/view/WpProQuiz_View_QuestionOverall.php:47
615
+ #: lib/view/WpProQuiz_View_QuestionOverall.php:51
616
+ msgid "Copy questions from another Quiz"
617
+ msgstr ""
618
+
619
+ #: lib/view/WpProQuiz_View_QuestionOverall.php:52
620
+ msgid ""
621
+ "Here you can copy questions from another quiz into this quiz. (Multiple "
622
+ "selection enabled)"
623
+ msgstr ""
624
+
625
+ #: lib/view/WpProQuiz_View_QuestionOverall.php:56
626
+ #: lib/view/WpProQuiz_View_Statistics.php:45
627
+ msgid "Loading"
628
+ msgstr ""
629
+
630
+ #: lib/view/WpProQuiz_View_QuestionOverall.php:64
631
+ msgid "Copy questions"
632
+ msgstr ""
633
+
634
  #: lib/view/WpProQuiz_View_QuizEdit.php:12
635
  msgid "Quiz title"
636
  msgstr "عنوان الاختبار"
647
  msgid "Hide title"
648
  msgstr "اخفاء العنوان"
649
 
650
+ #: lib/view/WpProQuiz_View_QuizEdit.php:36
651
  msgid "The title serves as quiz heading."
652
  msgstr "العنوان يظهر كعنوانا من اجل الاختبار."
653
 
654
+ #: lib/view/WpProQuiz_View_QuizEdit.php:43
655
+ #: lib/view/WpProQuiz_View_QuizEdit.php:48
656
  msgid "Hide \"Restart quiz\" button"
657
+ msgstr "اخفاء زر\"اعادة الاختبار\""
658
 
659
+ #: lib/view/WpProQuiz_View_QuizEdit.php:55
660
  msgid "Hide the \"Restart quiz\" button in the Frontend."
661
+ msgstr "اخفاء زر \"اعادة الاختبار\" في الواجهة"
662
 
663
+ #: lib/view/WpProQuiz_View_QuizEdit.php:62
664
+ #: lib/view/WpProQuiz_View_QuizEdit.php:67
665
  msgid "Hide \"View question\" button"
666
+ msgstr "اخفاء زر \"عرض السؤال\""
667
 
668
+ #: lib/view/WpProQuiz_View_QuizEdit.php:74
669
  msgid "Hide the \"View question\" button in the Frontend."
670
+ msgstr "اخفاء زر \"عرض السؤال\" في الواجهة"
671
 
672
+ #: lib/view/WpProQuiz_View_QuizEdit.php:81
673
+ #: lib/view/WpProQuiz_View_QuizEdit.php:86
674
  msgid "Show points"
675
  msgstr "اعرض الدرجات"
676
 
677
+ #: lib/view/WpProQuiz_View_QuizEdit.php:93
678
  msgid "Shows in quiz, how many points are reachable for respective question."
679
  msgstr "يظهر في الاختبار، كم عدد نقاط يمكن الوصول للأسئلة المعنية."
680
 
681
+ #: lib/view/WpProQuiz_View_QuizEdit.php:100
682
+ #: lib/view/WpProQuiz_View_QuizEdit.php:105
683
  msgid "Display question randomly"
684
  msgstr "اعرض الاسئلة عشوائياً"
685
 
 
686
  #: lib/view/WpProQuiz_View_QuizEdit.php:116
687
+ #: lib/view/WpProQuiz_View_QuizEdit.php:121
688
  msgid "Display answers randomly"
689
  msgstr "اعرض الاجابات عشوائياً"
690
 
691
+ #: lib/view/WpProQuiz_View_QuizEdit.php:140
692
  msgid "Seconds"
693
  msgstr "ثواني"
694
 
695
+ #: lib/view/WpProQuiz_View_QuizEdit.php:143
696
  msgid "0 = no limit"
697
  msgstr "0 = بدون وقت محدد"
698
 
699
+ #: lib/view/WpProQuiz_View_QuizEdit.php:150
700
+ #: lib/view/WpProQuiz_View_QuizEdit.php:155
701
  msgid "Check -> continue"
702
  msgstr "فحص->استكمال"
703
 
704
+ #: lib/view/WpProQuiz_View_QuizEdit.php:162
705
  msgid ""
706
  "Show \"right or wrong\" after the question. Otherwise the solutions will be "
707
  "displayed at the end."
708
  msgstr "عرض\"صواب أو خطأ\" بعد السؤال. وإلا يتم عرض الحلول في نهاية المطاف."
709
 
710
+ #: lib/view/WpProQuiz_View_QuizEdit.php:169
711
+ #: lib/view/WpProQuiz_View_QuizEdit.php:174
712
  msgid "Back button"
713
  msgstr "زر العودة"
714
 
715
+ #: lib/view/WpProQuiz_View_QuizEdit.php:181
716
  msgid ""
717
  "Allow to use back button in a question. (Option will be ignored if \"Check -"
718
  "> Continue\" was used)"
720
  "السماح لاستخدام زر العودة في سؤال. (سيتم تجاهل الخيار إذا\"تم تأشير زر -> "
721
  "متابعة \" مستخدماً)"
722
 
723
+ #: lib/view/WpProQuiz_View_QuizEdit.php:188
724
+ #: lib/view/WpProQuiz_View_QuizEdit.php:193
725
+ #: lib/view/WpProQuiz_View_QuizOverall.php:72
726
  msgid "Statistics"
727
  msgstr "احصائيات"
728
 
729
+ #: lib/view/WpProQuiz_View_QuizEdit.php:200
 
 
 
 
730
  msgid ""
731
  "Statistics about right or wrong answers. Statistics will be saved by "
732
  "completed quiz, not after every question. The statistics is only visible "
736
  "الاختبار، وليس بعد كل سؤال. الإحصاءات تظهر فقط خلال قائمة الإدارة. "
737
  "(الإحصاءات الداخلية)"
738
 
739
+ #: lib/view/WpProQuiz_View_QuizEdit.php:207
740
+ #: lib/view/WpProQuiz_View_QuizEdit.php:212
741
  msgid "Statistics IP-lock"
742
  msgstr "احصائيات قفل-اي بي"
743
 
744
+ #: lib/view/WpProQuiz_View_QuizEdit.php:216
745
  msgid "in minutes (recommended 1440 minutes = 1 day)"
746
  msgstr "بالدقائق (مستحسن 1440 دقيقة = 1 يوم)"
747
 
748
+ #: lib/view/WpProQuiz_View_QuizEdit.php:219
749
  msgid ""
750
  "Protect the statistics from spam. Result will only be saved every X minutes "
751
  "from same IP. (0 = deactivated)"
753
  "حماية الإحصاءات من البريد المزعج. النتائج سوف تحفظ كل * دقيقة من نفي الاي "
754
  "بي. (0= غير مفعل)"
755
 
756
+ #: lib/view/WpProQuiz_View_QuizEdit.php:226
757
+ #: lib/view/WpProQuiz_View_QuizEdit.php:232
758
+ msgid "Execute quiz only once"
759
+ msgstr ""
760
+
761
+ #: lib/view/WpProQuiz_View_QuizEdit.php:240
762
+ msgid ""
763
+ "If you activate this option, the user can complete the quiz only once. "
764
+ "Afterwards the quiz is blocked for this user."
765
+ msgstr ""
766
+
767
+ #: lib/view/WpProQuiz_View_QuizEdit.php:244
768
+ msgid "This option applies to:"
769
+ msgstr ""
770
+
771
+ #: lib/view/WpProQuiz_View_QuizEdit.php:252
772
+ msgid "all users"
773
+ msgstr ""
774
+
775
+ #: lib/view/WpProQuiz_View_QuizEdit.php:256
776
+ msgid "registered useres only"
777
+ msgstr ""
778
+
779
+ #: lib/view/WpProQuiz_View_QuizEdit.php:260
780
+ msgid "anonymous users only"
781
+ msgstr ""
782
+
783
+ #: lib/view/WpProQuiz_View_QuizEdit.php:266
784
+ msgid "user identification by cookie"
785
+ msgstr ""
786
+
787
+ #: lib/view/WpProQuiz_View_QuizEdit.php:269
788
+ msgid ""
789
+ "If you activate this option, a cookie is set additionally for unregistrated "
790
+ "(anonymous) users. This ensures a longer assignment of the user than the "
791
+ "simple assignment by the IP address."
792
+ msgstr ""
793
+
794
+ #: lib/view/WpProQuiz_View_QuizEdit.php:274
795
+ msgid "Reset the user identification"
796
+ msgstr ""
797
+
798
+ #: lib/view/WpProQuiz_View_QuizEdit.php:275
799
+ msgid "User identification has been reset."
800
+ msgstr ""
801
+
802
+ #: lib/view/WpProQuiz_View_QuizEdit.php:277
803
+ msgid "Resets user identification for all users."
804
+ msgstr ""
805
+
806
+ #: lib/view/WpProQuiz_View_QuizEdit.php:289
807
  msgid "Quiz description"
808
  msgstr "وصف الاختبار"
809
 
810
+ #: lib/view/WpProQuiz_View_QuizEdit.php:292
811
  msgid "This text will be displayed before start of the quiz."
812
  msgstr "سيتم عرض هذا النص قبل بدء الاختبار."
813
 
814
+ #: lib/view/WpProQuiz_View_QuizEdit.php:300
815
  msgid "Results text"
816
  msgstr "نص النتائج"
817
 
818
+ #: lib/view/WpProQuiz_View_QuizEdit.php:303
819
  msgid ""
820
  "This text will be displayed at the end of the quiz (in results). (this text "
821
  "is optional)"
822
  msgstr "سيتم عرض هذا النص في نهاية الاختبار (في النتائج). (هذا النص اختياري)"
823
 
824
+ #: lib/view/WpProQuiz_View_QuizEdit.php:307
825
  msgid "Activate graduation"
826
  msgstr "تفعيل التقييم"
827
 
828
+ #: lib/view/WpProQuiz_View_QuizEdit.php:313
829
  msgid "Hint:"
830
  msgstr "تلميح:"
831
 
832
+ #: lib/view/WpProQuiz_View_QuizEdit.php:315
833
  msgid "Maximal 15 levels"
834
  msgstr "اقصى حد 15 مستوى"
835
 
836
+ #: lib/view/WpProQuiz_View_QuizEdit.php:317
837
  #, php-format
838
  msgid ""
839
  "Percentages refer to the total score of the quiz. (Current total %d points "
842
  "النسبة المئوية تشير الي الدرجة الكلية للأختبار.( المجموع الحالي %d درجة في "
843
  "%d سؤال"
844
 
845
+ #: lib/view/WpProQuiz_View_QuizEdit.php:320
846
  msgid "Values can also be mixed up"
847
  msgstr "يمكن لخبطة القيم"
848
 
849
+ #: lib/view/WpProQuiz_View_QuizEdit.php:321
850
  msgid "10,15% or 10.15% allowed (max. two digits after the decimal point)"
851
  msgstr "10.15% او 10.15% مسموح به (اقصى حد هو رقمين بعد النسبة المئوية)"
852
 
853
+ #: lib/view/WpProQuiz_View_QuizEdit.php:337
854
+ #: lib/view/WpProQuiz_View_QuizEdit.php:348
855
  msgid "from:"
856
  msgstr "من:"
857
 
858
+ #: lib/view/WpProQuiz_View_QuizEdit.php:337
859
+ #: lib/view/WpProQuiz_View_QuizEdit.php:348
860
  msgid "percent"
861
  msgstr "النسبة المئوية"
862
 
863
+ #: lib/view/WpProQuiz_View_QuizEdit.php:337
864
+ #: lib/view/WpProQuiz_View_QuizEdit.php:348
865
  #, php-format
866
  msgid ""
867
  "(Will be displayed, when result-percent is >= <span class=\"resultProzent\">"
870
  "(سوف يتم عرضه، عندما تكون نسبة النتيجة>= <span class=\"resultProzent\">%s</"
871
  "span>%%)"
872
 
873
+ #: lib/view/WpProQuiz_View_QuizEdit.php:338
874
+ #: lib/view/WpProQuiz_View_QuizEdit.php:349
875
  msgid "Delete graduation"
876
  msgstr "حذف التقييم"
877
 
878
+ #: lib/view/WpProQuiz_View_QuizEdit.php:356
879
  msgid "Add graduation"
880
  msgstr "اضافة تقييم"
881
 
891
  msgid "If quiz doesn't work in front-end, please try following:"
892
  msgstr "إذا الاختبار لا يعمل في الواجهة الأمامية، يرجى تجربة التالي:"
893
 
894
+ #: lib/view/WpProQuiz_View_QuizOverall.php:52
 
 
 
 
 
 
 
 
895
  msgid "ID"
896
  msgstr "الرقم"
897
 
898
+ #: lib/view/WpProQuiz_View_QuizOverall.php:53
899
  msgid "Shortcode"
900
  msgstr "الكود"
901
 
902
+ #: lib/view/WpProQuiz_View_QuizOverall.php:71
903
  msgid "Preview"
904
  msgstr "استعراض"
905
 
906
+ #: lib/view/WpProQuiz_View_QuizOverall.php:79
907
  msgid "Add quiz"
908
  msgstr "اضف اختبار"
909
 
910
+ #: lib/view/WpProQuiz_View_QuizOverall.php:81
911
+ #: lib/view/WpProQuiz_View_QuizOverall.php:85
912
  msgid "Export"
913
  msgstr "تصدير"
914
 
915
+ #: lib/view/WpProQuiz_View_QuizOverall.php:86
916
  msgid ""
917
  "Choose the respective question, which you would like to export and press on "
918
  "\"Start export\""
919
  msgstr "اختار سؤال، الذي تود أن تقوم بتصديره و اضغط على \"ابدأ التصدير\""
920
 
921
+ #: lib/view/WpProQuiz_View_QuizOverall.php:90
922
  msgid "Start export"
923
  msgstr "ابدأ التصدير"
924
 
925
+ #: lib/view/WpProQuiz_View_QuizOverall.php:96
926
  msgid "Import only *.wpq files from known and trusted sources."
927
  msgstr "استورد ملفات *.wpq فقط من مصدر معروف او موثوق به"
928
 
929
+ #: lib/view/WpProQuiz_View_QuizOverall.php:104
930
  #, php-format
931
  msgid "Maximal %d MiB"
932
+ msgstr "الحد الاقصى من %d MIB"
933
 
934
+ #: lib/view/WpProQuiz_View_Statistics.php:17
935
  #, php-format
936
  msgid "Quiz: %s - Statistics"
937
  msgstr "احصائيات اختبار: %s "
938
 
939
+ #: lib/view/WpProQuiz_View_Statistics.php:21
940
  msgid "Stats not enabled"
941
  msgstr "الاحصائيات غير مفعلة"
942
 
943
+ #: lib/view/WpProQuiz_View_Statistics.php:22
944
  msgid "Activate statistics"
945
  msgstr "تفعيل الاحصائيات"
946
 
947
+ #: lib/view/WpProQuiz_View_Statistics.php:27
948
+ msgid "Anonymous users"
949
+ msgstr ""
950
+
951
+ #: lib/view/WpProQuiz_View_Statistics.php:28
952
+ msgid "Registered useres"
953
+ msgstr ""
954
+
955
+ #: lib/view/WpProQuiz_View_Statistics.php:29
956
+ msgid "Overview"
957
+ msgstr ""
958
+
959
+ #: lib/view/WpProQuiz_View_Statistics.php:34
960
+ msgid "Please select user name:"
961
+ msgstr ""
962
+
963
+ #: lib/view/WpProQuiz_View_Statistics.php:57
964
  msgid "Hints used"
965
  msgstr "التلميحات مستخدمة"
966
 
967
+ #: lib/view/WpProQuiz_View_Statistics.php:82
968
  msgid "Total"
969
  msgstr "المجموع"
970
 
971
+ #: lib/view/WpProQuiz_View_Statistics.php:94
972
  msgid "Reset statistics"
973
  msgstr "اعادة ضبط الاحصائيات"
974
 
975
+ #: lib/view/WpProQuiz_View_Statistics.php:95
976
+ msgid "Refresh"
977
+ msgstr ""
978
+
979
+ #: lib/view/WpProQuiz_View_Statistics.php:98
980
+ msgid "Reset entire statistic"
981
+ msgstr ""
982
+
983
  #~ msgid "One question is one point"
984
  #~ msgstr "سؤال واحد يعني درجة واحدة"
985
 
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-12-13 17:58+0100\n"
5
- "PO-Revision-Date: 2012-12-13 17:58+0100\n"
6
  "Last-Translator: Julius Fischer <julius.f@gmx.net>\n"
7
  "Language-Team: Julius Fischer\n"
8
  "Language: German\n"
@@ -14,42 +14,50 @@ msgstr ""
14
  "X-Poedit-Basepath: ..\n"
15
  "X-Poedit-SearchPath-0: .\n"
16
 
17
- #: lib/controller/WpProQuiz_Controller_Admin.php:35
18
  msgid "Do you really want to delete the quiz/question?"
19
  msgstr "Wollen Sie das Quiz/Frage wirklich löschen?"
20
 
21
- #: lib/controller/WpProQuiz_Controller_Admin.php:36
22
  msgid "Title is not filled!"
23
  msgstr "Titel wurde nicht ausgefüllt!"
24
 
25
- #: lib/controller/WpProQuiz_Controller_Admin.php:37
26
  msgid "No question deposited!"
27
  msgstr "Keine Frage hinterlegt!"
28
 
29
- #: lib/controller/WpProQuiz_Controller_Admin.php:38
30
  msgid "Correct answer was not selected!"
31
  msgstr "Keine korrekte Antwort markiert!"
32
 
33
- #: lib/controller/WpProQuiz_Controller_Admin.php:39
34
  msgid "No answer deposited!"
35
  msgstr "Keine Antwort hinterlegt!"
36
 
37
- #: lib/controller/WpProQuiz_Controller_Admin.php:40
38
  msgid "No quiz description filled!"
39
  msgstr "Quiz-Beschreibung nicht ausgefüllt!"
40
 
41
- #: lib/controller/WpProQuiz_Controller_Admin.php:41
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
@@ -59,55 +67,59 @@ 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
63
  msgid "Quiz not found"
64
  msgstr "Quiz nicht gefunden"
65
 
66
- #: lib/controller/WpProQuiz_Controller_Question.php:61
 
 
 
 
67
  msgid "Edit question"
68
  msgstr "Frage bearbeiten"
69
 
70
- #: lib/controller/WpProQuiz_Controller_Question.php:65
71
  msgid "Question not found"
72
  msgstr "Frage nicht gefunden"
73
 
74
- #: lib/controller/WpProQuiz_Controller_Question.php:78
75
- #: lib/controller/WpProQuiz_Controller_Question.php:104
76
  #, php-format
77
  msgid "Question: %d"
78
  msgstr "Frage: %d"
79
 
80
- #: lib/controller/WpProQuiz_Controller_Question.php:82
81
  msgid "Question edited"
82
  msgstr "Frage geändert"
83
 
84
- #: lib/controller/WpProQuiz_Controller_Question.php:91
85
  msgid "New question"
86
  msgstr "Neue Frage"
87
 
88
- #: lib/controller/WpProQuiz_Controller_Question.php:109
89
  msgid "Question added"
90
  msgstr "Frage hinzugefügt"
91
 
92
- #: lib/controller/WpProQuiz_Controller_Quiz.php:37
93
  msgid "Edit quiz"
94
  msgstr "Quiz bearbeiten"
95
 
96
- #: lib/controller/WpProQuiz_Controller_Quiz.php:57
97
  msgid "Quiz edited"
98
  msgstr "Quiz bearbeitet"
99
 
100
- #: lib/controller/WpProQuiz_Controller_Quiz.php:66
101
- #: lib/controller/WpProQuiz_Controller_Quiz.php:94
102
  msgid "Quiz title or quiz description are not filled"
103
  msgstr "Quiz Titel oder Quiz Beschreibung nicht ausgefüllt"
104
 
105
- #: lib/controller/WpProQuiz_Controller_Quiz.php:77
106
- #: lib/controller/WpProQuiz_Controller_Quiz.php:88
107
  msgid "Create quiz"
108
  msgstr "Quiz erstellen"
109
 
110
- #: lib/controller/WpProQuiz_Controller_Quiz.php:106
111
  msgid "Quiz deleted"
112
  msgstr "Quiz gelöscht"
113
 
@@ -123,108 +135,245 @@ msgstr "Datei hat falsches Format"
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:98
150
  msgid "Restart quiz"
151
  msgstr "Quiz erneut starten"
152
 
153
- #: lib/view/WpProQuiz_View_FrontQuiz.php:100
154
  msgid "View questions"
155
  msgstr "Fragen ansehen"
156
 
157
- #: lib/view/WpProQuiz_View_FrontQuiz.php:105
158
- #: lib/view/WpProQuiz_View_QuizEdit.php:126
159
- #: lib/view/WpProQuiz_View_QuizEdit.php:131
160
  msgid "Time limit"
161
  msgstr "Zeitlimit"
162
 
163
- #: lib/view/WpProQuiz_View_FrontQuiz.php:118
164
  #, php-format
165
  msgid "Question %s of %s"
166
  msgstr "Frage %s von %s"
167
 
168
- #: lib/view/WpProQuiz_View_FrontQuiz.php:121
169
  #, php-format
170
  msgid "%d points"
171
  msgstr "%d Punkte"
172
 
173
- #: lib/view/WpProQuiz_View_FrontQuiz.php:125
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:132
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:211
187
- #: lib/view/WpProQuiz_View_Statistics.php:21
188
  msgid "Correct"
189
  msgstr "Korrekt"
190
 
191
- #: lib/view/WpProQuiz_View_FrontQuiz.php:219
192
- #: lib/view/WpProQuiz_View_Statistics.php:20
193
  msgid "Incorrect"
194
  msgstr "Inkorrekt"
195
 
196
- #: lib/view/WpProQuiz_View_FrontQuiz.php:235
197
- #: lib/view/WpProQuiz_View_FrontQuiz.php:245
198
  #: lib/view/WpProQuiz_View_QuestionEdit.php:71
199
  msgid "Hint"
200
  msgstr "Tipp"
201
 
202
- #: lib/view/WpProQuiz_View_FrontQuiz.php:242
203
  msgid "Check"
204
  msgstr "Prüfen"
205
 
206
- #: lib/view/WpProQuiz_View_FrontQuiz.php:243
207
  msgid "Back"
208
  msgstr "Zurück"
209
 
210
- #: lib/view/WpProQuiz_View_FrontQuiz.php:247
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:77
216
- #: lib/view/WpProQuiz_View_QuizOverall.php:92
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
224
- #: lib/view/WpProQuiz_View_Statistics.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"
@@ -242,12 +391,12 @@ msgid "Quiz name"
242
  msgstr "Quiz-Name"
243
 
244
  #: lib/view/WpProQuiz_View_Import.php:44
245
- #: lib/view/WpProQuiz_View_QuizOverall.php:65
246
  msgid "Questions"
247
  msgstr "Fragen"
248
 
249
  #: lib/view/WpProQuiz_View_Import.php:67
250
- #: lib/view/WpProQuiz_View_QuizOverall.php:103
251
  msgid "Start import"
252
  msgstr "Import starten"
253
 
@@ -259,7 +408,7 @@ msgstr "Titel"
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:232
263
  msgid "(optional)"
264
  msgstr "(Optional)"
265
 
@@ -273,6 +422,7 @@ msgstr ""
273
 
274
  #: lib/view/WpProQuiz_View_QuestionEdit.php:26
275
  #: lib/view/WpProQuiz_View_QuestionEdit.php:31
 
276
  msgid "Points"
277
  msgstr "Punkte"
278
 
@@ -280,7 +430,7 @@ msgstr "Punkte"
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:221
284
  msgid "(required)"
285
  msgstr "(Pflichtfeld)"
286
 
@@ -397,7 +547,7 @@ msgstr "Antwort löschen"
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
 
@@ -450,43 +600,60 @@ 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:300
455
- msgid "Save"
456
- msgstr "Speichern"
457
-
458
- #: lib/view/WpProQuiz_View_QuestionOverall.php:8
459
  msgid "Questions sorted"
460
  msgstr "Fragen sortiert"
461
 
462
- #: lib/view/WpProQuiz_View_QuestionOverall.php:14
463
- #: lib/view/WpProQuiz_View_QuizOverall.php:51
464
  msgid "Name"
465
  msgstr "Name"
466
 
467
- #: lib/view/WpProQuiz_View_QuestionOverall.php:15
468
- #: lib/view/WpProQuiz_View_QuizOverall.php:52
469
  msgid "Action"
470
  msgstr "Aktion"
471
 
472
- #: lib/view/WpProQuiz_View_QuestionOverall.php:27
473
- #: lib/view/WpProQuiz_View_QuizOverall.php:66
474
  msgid "Edit"
475
  msgstr "Bearbeiten"
476
 
477
- #: lib/view/WpProQuiz_View_QuestionOverall.php:28
478
- #: lib/view/WpProQuiz_View_QuizOverall.php:67
479
  msgid "Delete"
480
  msgstr "Löschen"
481
 
482
- #: lib/view/WpProQuiz_View_QuestionOverall.php:36
483
  msgid "Add question"
484
  msgstr "Frage hinzufügen"
485
 
486
- #: lib/view/WpProQuiz_View_QuestionOverall.php:37
487
  msgid "Save order"
488
  msgstr "Sortierung speichern"
489
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
490
  #: lib/view/WpProQuiz_View_QuizEdit.php:12
491
  msgid "Quiz title"
492
  msgstr "Quiz Titel"
@@ -503,61 +670,61 @@ msgstr "Quiz Titel verstecken"
503
  msgid "Hide title"
504
  msgstr "Titel verstecken"
505
 
506
- #: lib/view/WpProQuiz_View_QuizEdit.php:35
507
  msgid "The title serves as quiz heading."
508
  msgstr "Der Titel dient als Quiz Überschrift."
509
 
510
- #: lib/view/WpProQuiz_View_QuizEdit.php:42
511
- #: lib/view/WpProQuiz_View_QuizEdit.php:47
512
  msgid "Hide \"Restart quiz\" button"
513
  msgstr "Button \"Quiz erneut starten\" verstecken"
514
 
515
- #: lib/view/WpProQuiz_View_QuizEdit.php:53
516
  msgid "Hide the \"Restart quiz\" button in the Frontend."
517
  msgstr "Versteckt den Button \"Quiz erneut starten\" im Frontend."
518
 
519
- #: lib/view/WpProQuiz_View_QuizEdit.php:60
520
- #: lib/view/WpProQuiz_View_QuizEdit.php:65
521
  msgid "Hide \"View question\" button"
522
  msgstr "Button \"Fragen ansehen\" verstecken"
523
 
524
- #: lib/view/WpProQuiz_View_QuizEdit.php:71
525
  msgid "Hide the \"View question\" button in the Frontend."
526
  msgstr "Versteckt den Button \"Fragen ansehen\" im Frontend."
527
 
528
- #: lib/view/WpProQuiz_View_QuizEdit.php:78
529
- #: lib/view/WpProQuiz_View_QuizEdit.php:83
530
  msgid "Show points"
531
  msgstr "Punkte anzeigen"
532
 
533
- #: lib/view/WpProQuiz_View_QuizEdit.php:89
534
  msgid "Shows in quiz, how many points are reachable for respective question."
535
  msgstr "Zeigt im Quiz an, wieviel Punkte es für die jeweilige Frage gibt."
536
 
537
- #: lib/view/WpProQuiz_View_QuizEdit.php:96
538
- #: lib/view/WpProQuiz_View_QuizEdit.php:101
539
  msgid "Display question randomly"
540
  msgstr "Fragen zufällig ausgeben"
541
 
542
- #: lib/view/WpProQuiz_View_QuizEdit.php:111
543
  #: lib/view/WpProQuiz_View_QuizEdit.php:116
 
544
  msgid "Display answers randomly"
545
  msgstr "Antworten zufällig ausgeben"
546
 
547
- #: lib/view/WpProQuiz_View_QuizEdit.php:134
548
  msgid "Seconds"
549
  msgstr "Sekunden"
550
 
551
- #: lib/view/WpProQuiz_View_QuizEdit.php:137
552
  msgid "0 = no limit"
553
  msgstr "0 = Kein Limit"
554
 
555
- #: lib/view/WpProQuiz_View_QuizEdit.php:144
556
- #: lib/view/WpProQuiz_View_QuizEdit.php:149
557
  msgid "Check -> continue"
558
  msgstr "Prüfen -> Weiter"
559
 
560
- #: lib/view/WpProQuiz_View_QuizEdit.php:155
561
  msgid ""
562
  "Show \"right or wrong\" after the question. Otherwise the solutions will be "
563
  "displayed at the end."
@@ -565,12 +732,12 @@ msgstr ""
565
  "Zeigt \"richtig oder falsch\" nach jeder Frage an. Ansonsten werden die "
566
  "Lösungen erst am Ende angezeigt."
567
 
568
- #: lib/view/WpProQuiz_View_QuizEdit.php:162
569
- #: lib/view/WpProQuiz_View_QuizEdit.php:167
570
  msgid "Back button"
571
  msgstr "Zurück Button"
572
 
573
- #: lib/view/WpProQuiz_View_QuizEdit.php:173
574
  msgid ""
575
  "Allow to use back button in a question. (Option will be ignored if \"Check -"
576
  "> Continue\" was used)"
@@ -578,17 +745,13 @@ msgstr ""
578
  "Ermöglicht das Zurückgehen einer Frage. (Option wird ignoriert bei \"Prüfen -"
579
  "> Weiter\")"
580
 
581
- #: lib/view/WpProQuiz_View_QuizEdit.php:180
582
- #: lib/view/WpProQuiz_View_QuizEdit.php:185
583
- #: lib/view/WpProQuiz_View_QuizOverall.php:69
584
  msgid "Statistics"
585
  msgstr "Statistik"
586
 
587
- #: lib/view/WpProQuiz_View_QuizEdit.php:189
588
- msgid "activate"
589
- msgstr "Aktivieren"
590
-
591
- #: lib/view/WpProQuiz_View_QuizEdit.php:192
592
  msgid ""
593
  "Statistics about right or wrong answers. Statistics will be saved by "
594
  "completed quiz, not after every question. The statistics is only visible "
@@ -598,16 +761,16 @@ msgstr ""
598
  "vollständigen abschließen des Quiz gespeichert, nicht nach jeder Frage. Die "
599
  "Statistik ist nur über das Adminmenü einsehbar (interne Statistik)"
600
 
601
- #: lib/view/WpProQuiz_View_QuizEdit.php:199
602
- #: lib/view/WpProQuiz_View_QuizEdit.php:204
603
  msgid "Statistics IP-lock"
604
  msgstr "Statistik IP-Sperre"
605
 
606
- #: lib/view/WpProQuiz_View_QuizEdit.php:208
607
  msgid "in minutes (recommended 1440 minutes = 1 day)"
608
  msgstr "in Minuten (Empfohlen: 1440 Minuten = 1 Tag)"
609
 
610
- #: lib/view/WpProQuiz_View_QuizEdit.php:211
611
  msgid ""
612
  "Protect the statistics from spam. Result will only be saved every X minutes "
613
  "from same IP. (0 = deactivated)"
@@ -615,19 +778,74 @@ msgstr ""
615
  "Schuetz die Statistik vor Spam. Ergebnis wird nur aller X Minuten von der "
616
  "gleichen IP gespeichert. (0 = Deaktiviert)"
617
 
618
- #: lib/view/WpProQuiz_View_QuizEdit.php:221
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
619
  msgid "Quiz description"
620
  msgstr "Quiz Beschreibung"
621
 
622
- #: lib/view/WpProQuiz_View_QuizEdit.php:224
623
  msgid "This text will be displayed before start of the quiz."
624
  msgstr "Dieser Text wird vor dem Starten des Quizes angezeigt."
625
 
626
- #: lib/view/WpProQuiz_View_QuizEdit.php:232
627
  msgid "Results text"
628
  msgstr "Ergebnis Text"
629
 
630
- #: lib/view/WpProQuiz_View_QuizEdit.php:235
631
  msgid ""
632
  "This text will be displayed at the end of the quiz (in results). (this text "
633
  "is optional)"
@@ -635,19 +853,19 @@ msgstr ""
635
  "Dieser Text wird beim Beenden (im Ergebnis) des Quizes angezeigt (Dieser "
636
  "Text ist optional)"
637
 
638
- #: lib/view/WpProQuiz_View_QuizEdit.php:239
639
  msgid "Activate graduation"
640
  msgstr "Abstufungen aktivieren"
641
 
642
- #: lib/view/WpProQuiz_View_QuizEdit.php:245
643
  msgid "Hint:"
644
  msgstr "Hinweis:"
645
 
646
- #: lib/view/WpProQuiz_View_QuizEdit.php:247
647
  msgid "Maximal 15 levels"
648
  msgstr "Maximal 15 Stufen"
649
 
650
- #: lib/view/WpProQuiz_View_QuizEdit.php:249
651
  #, php-format
652
  msgid ""
653
  "Percentages refer to the total score of the quiz. (Current total %d points "
@@ -656,26 +874,26 @@ msgstr ""
656
  "Prozente beziehen sich auf die Gesamtpunktzahl des Quiz (Aktuell: insgesamt "
657
  "%d Punkte bei %d Fragen)"
658
 
659
- #: lib/view/WpProQuiz_View_QuizEdit.php:252
660
  msgid "Values can also be mixed up"
661
  msgstr "Werte können auch durcheinander sein"
662
 
663
- #: lib/view/WpProQuiz_View_QuizEdit.php:253
664
  msgid "10,15% or 10.15% allowed (max. two digits after the decimal point)"
665
  msgstr "10,15% oder 10.15% erlaubt (maximal 2 Stellen nach dem Komma)"
666
 
667
- #: lib/view/WpProQuiz_View_QuizEdit.php:269
668
- #: lib/view/WpProQuiz_View_QuizEdit.php:280
669
  msgid "from:"
670
  msgstr "Ab:"
671
 
672
- #: lib/view/WpProQuiz_View_QuizEdit.php:269
673
- #: lib/view/WpProQuiz_View_QuizEdit.php:280
674
  msgid "percent"
675
  msgstr "Prozent"
676
 
677
- #: lib/view/WpProQuiz_View_QuizEdit.php:269
678
- #: lib/view/WpProQuiz_View_QuizEdit.php:280
679
  #, php-format
680
  msgid ""
681
  "(Will be displayed, when result-percent is >= <span class=\"resultProzent\">"
@@ -684,12 +902,12 @@ msgstr ""
684
  "(Wird angezeigt wenn Ergebnis-Prozent >= <span class=\"resultProzent\">%s</"
685
  "span>%% ist)"
686
 
687
- #: lib/view/WpProQuiz_View_QuizEdit.php:270
688
- #: lib/view/WpProQuiz_View_QuizEdit.php:281
689
  msgid "Delete graduation"
690
  msgstr "Stufe löschen"
691
 
692
- #: lib/view/WpProQuiz_View_QuizEdit.php:288
693
  msgid "Add graduation"
694
  msgstr "Stufe hinzufügen"
695
 
@@ -706,36 +924,28 @@ msgid "If quiz doesn't work in front-end, please try following:"
706
  msgstr ""
707
  "Wenn das Quiz im Front-End nicht funktioniert, versucht bitte folgendes:"
708
 
709
- #: lib/view/WpProQuiz_View_QuizOverall.php:42
710
- msgid ""
711
- "Own themes changes internal order of filters, what causes the problems. "
712
- "With additional shortcode [raw] this is prevented."
713
- msgstr ""
714
- "Einige Themen verändern die interne Reihenfolge der Filter, wodurch es zu "
715
- "Fehlern kommt. Mit dem zusätzlichen Shortcode [raw] wird dies verhindert."
716
-
717
- #: lib/view/WpProQuiz_View_QuizOverall.php:49
718
  msgid "ID"
719
  msgstr "ID"
720
 
721
- #: lib/view/WpProQuiz_View_QuizOverall.php:50
722
  msgid "Shortcode"
723
  msgstr "Shortcode"
724
 
725
- #: lib/view/WpProQuiz_View_QuizOverall.php:68
726
  msgid "Preview"
727
  msgstr "Vorschau"
728
 
729
- #: lib/view/WpProQuiz_View_QuizOverall.php:76
730
  msgid "Add quiz"
731
  msgstr "Quiz hinzufügen"
732
 
733
- #: lib/view/WpProQuiz_View_QuizOverall.php:78
734
- #: lib/view/WpProQuiz_View_QuizOverall.php:82
735
  msgid "Export"
736
  msgstr "Export"
737
 
738
- #: lib/view/WpProQuiz_View_QuizOverall.php:83
739
  msgid ""
740
  "Choose the respective question, which you would like to export and press on "
741
  "\"Start export\""
@@ -743,46 +953,73 @@ msgstr ""
743
  "Wählen Sie oben die entsprechen Quiz aus, die Sie exportieren möchten und "
744
  "klicken Sie anschliessen auf \"Export starten\""
745
 
746
- #: lib/view/WpProQuiz_View_QuizOverall.php:87
747
  msgid "Start export"
748
  msgstr "Export starten"
749
 
750
- #: lib/view/WpProQuiz_View_QuizOverall.php:93
751
  msgid "Import only *.wpq files from known and trusted sources."
752
  msgstr ""
753
  "Importieren sie nur *.wpq Dateien aus bekannten und vertrauenswürdigen "
754
  "Quellen."
755
 
756
- #: lib/view/WpProQuiz_View_QuizOverall.php:101
757
  #, php-format
758
  msgid "Maximal %d MiB"
759
  msgstr "Maximal %d MiB"
760
 
761
- #: lib/view/WpProQuiz_View_Statistics.php:7
762
  #, php-format
763
  msgid "Quiz: %s - Statistics"
764
  msgstr "Quiz: %s - Statistik"
765
 
766
- #: lib/view/WpProQuiz_View_Statistics.php:11
767
  msgid "Stats not enabled"
768
  msgstr "Statistik ist nicht aktiviert"
769
 
770
- #: lib/view/WpProQuiz_View_Statistics.php:12
771
  msgid "Activate statistics"
772
  msgstr "Statistik aktivieren"
773
 
774
- #: lib/view/WpProQuiz_View_Statistics.php:22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
775
  msgid "Hints used"
776
  msgstr "Tipp benutzt"
777
 
778
- #: lib/view/WpProQuiz_View_Statistics.php:59
779
  msgid "Total"
780
  msgstr "Total"
781
 
782
- #: lib/view/WpProQuiz_View_Statistics.php:66
783
  msgid "Reset statistics"
784
  msgstr "Statistik zurücksetzen"
785
 
 
 
 
 
 
 
 
 
 
 
 
786
  #~ msgid "One question is one point"
787
  #~ msgstr "Eine Frage ist 1 Punkt"
788
 
@@ -795,10 +1032,6 @@ msgstr "Statistik zurücksetzen"
795
  #~ msgid "Tip"
796
  #~ msgstr "Tipp"
797
 
798
- #, fuzzy
799
- #~ msgid "Statistics activate"
800
- #~ msgstr "Statistik aktivieren"
801
-
802
  #, fuzzy
803
  #~ msgid "Statistics reset"
804
  #~ msgstr "Statistik zurücksetzen"
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Wp-Pro-Quiz\n"
4
+ "POT-Creation-Date: 2012-12-22 15:42+0100\n"
5
+ "PO-Revision-Date: 2012-12-22 15:43+0100\n"
6
  "Last-Translator: Julius Fischer <julius.f@gmx.net>\n"
7
  "Language-Team: Julius Fischer\n"
8
  "Language: German\n"
14
  "X-Poedit-Basepath: ..\n"
15
  "X-Poedit-SearchPath-0: .\n"
16
 
17
+ #: lib/controller/WpProQuiz_Controller_Admin.php:72
18
  msgid "Do you really want to delete the quiz/question?"
19
  msgstr "Wollen Sie das Quiz/Frage wirklich löschen?"
20
 
21
+ #: lib/controller/WpProQuiz_Controller_Admin.php:73
22
  msgid "Title is not filled!"
23
  msgstr "Titel wurde nicht ausgefüllt!"
24
 
25
+ #: lib/controller/WpProQuiz_Controller_Admin.php:74
26
  msgid "No question deposited!"
27
  msgstr "Keine Frage hinterlegt!"
28
 
29
+ #: lib/controller/WpProQuiz_Controller_Admin.php:75
30
  msgid "Correct answer was not selected!"
31
  msgstr "Keine korrekte Antwort markiert!"
32
 
33
+ #: lib/controller/WpProQuiz_Controller_Admin.php:76
34
  msgid "No answer deposited!"
35
  msgstr "Keine Antwort hinterlegt!"
36
 
37
+ #: lib/controller/WpProQuiz_Controller_Admin.php:77
38
  msgid "No quiz description filled!"
39
  msgstr "Quiz-Beschreibung nicht ausgefüllt!"
40
 
41
+ #: lib/controller/WpProQuiz_Controller_Admin.php:78
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:79
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:80
50
  msgid "No quiz selected"
51
  msgstr "Kein Quiz ausgewählt"
52
 
53
+ #: lib/controller/WpProQuiz_Controller_Admin.php:81
54
+ msgid "Do you really want to reset the statistic?"
55
+ msgstr "Soll die Statistik wirklich zurückgesetzt werden?"
56
+
57
+ #: lib/controller/WpProQuiz_Controller_GlobalSettings.php:14
58
+ msgid "Settings saved"
59
+ msgstr "Einstellungen gespeichert"
60
+
61
  #: lib/controller/WpProQuiz_Controller_ImportExport.php:70
62
  #: lib/helper/WpProQuiz_Helper_Import.php:54
63
  #: lib/helper/WpProQuiz_Helper_Import.php:63
67
 
68
  #: lib/controller/WpProQuiz_Controller_Question.php:9
69
  #: lib/controller/WpProQuiz_Controller_Question.php:19
70
+ #: lib/controller/WpProQuiz_Controller_Quiz.php:63
71
  msgid "Quiz not found"
72
  msgstr "Quiz nicht gefunden"
73
 
74
+ #: lib/controller/WpProQuiz_Controller_Question.php:60
75
+ msgid "questions copied"
76
+ msgstr "Fragen kopiert"
77
+
78
+ #: lib/controller/WpProQuiz_Controller_Question.php:121
79
  msgid "Edit question"
80
  msgstr "Frage bearbeiten"
81
 
82
+ #: lib/controller/WpProQuiz_Controller_Question.php:125
83
  msgid "Question not found"
84
  msgstr "Frage nicht gefunden"
85
 
86
+ #: lib/controller/WpProQuiz_Controller_Question.php:138
87
+ #: lib/controller/WpProQuiz_Controller_Question.php:164
88
  #, php-format
89
  msgid "Question: %d"
90
  msgstr "Frage: %d"
91
 
92
+ #: lib/controller/WpProQuiz_Controller_Question.php:142
93
  msgid "Question edited"
94
  msgstr "Frage geändert"
95
 
96
+ #: lib/controller/WpProQuiz_Controller_Question.php:151
97
  msgid "New question"
98
  msgstr "Neue Frage"
99
 
100
+ #: lib/controller/WpProQuiz_Controller_Question.php:169
101
  msgid "Question added"
102
  msgstr "Frage hinzugefügt"
103
 
104
+ #: lib/controller/WpProQuiz_Controller_Quiz.php:58
105
  msgid "Edit quiz"
106
  msgstr "Quiz bearbeiten"
107
 
108
+ #: lib/controller/WpProQuiz_Controller_Quiz.php:78
109
  msgid "Quiz edited"
110
  msgstr "Quiz bearbeitet"
111
 
112
+ #: lib/controller/WpProQuiz_Controller_Quiz.php:87
113
+ #: lib/controller/WpProQuiz_Controller_Quiz.php:115
114
  msgid "Quiz title or quiz description are not filled"
115
  msgstr "Quiz Titel oder Quiz Beschreibung nicht ausgefüllt"
116
 
117
+ #: lib/controller/WpProQuiz_Controller_Quiz.php:98
118
+ #: lib/controller/WpProQuiz_Controller_Quiz.php:109
119
  msgid "Create quiz"
120
  msgstr "Quiz erstellen"
121
 
122
+ #: lib/controller/WpProQuiz_Controller_Quiz.php:135
123
  msgid "Quiz deleted"
124
  msgstr "Quiz gelöscht"
125
 
135
  msgid "Start quiz"
136
  msgstr "Quiz starten"
137
 
138
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:73
139
+ msgid ""
140
+ "You have already completed the quiz before. Hence you can not start it again."
141
+ msgstr ""
142
+ "Sie haben das Quiz schon einmal absolviert. Daher können sie es nicht erneut "
143
+ "starten."
144
+
145
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:77
146
+ #: lib/view/WpProQuiz_View_Statistics.php:58
147
  msgid "Results"
148
  msgstr "Ergebnis"
149
 
150
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:79
151
  #, php-format
152
  msgid "%s of %s questions answered correctly"
153
  msgstr "%s von %s Frage korrekt beantwortet"
154
 
155
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:82
156
  msgid "Your time: <span></span>"
157
  msgstr "Ihre Zeit: <span></span>"
158
 
159
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:85
160
  msgid "Time has elapsed"
161
  msgstr "Zeit ist abgelaufen"
162
 
163
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:88
164
  msgid ""
165
  "You have reached <span></span> of <span></span> points, (<span></span>%)"
166
  msgstr ""
167
  "Sie haben <span></span> von <span></span> Punkten erreicht (<span></span>%)"
168
 
169
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:103
170
  msgid "Restart quiz"
171
  msgstr "Quiz erneut starten"
172
 
173
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:105
174
  msgid "View questions"
175
  msgstr "Fragen ansehen"
176
 
177
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:110
178
+ #: lib/view/WpProQuiz_View_QuizEdit.php:132
179
+ #: lib/view/WpProQuiz_View_QuizEdit.php:137
180
  msgid "Time limit"
181
  msgstr "Zeitlimit"
182
 
183
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:123
184
  #, php-format
185
  msgid "Question %s of %s"
186
  msgstr "Frage %s von %s"
187
 
188
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:126
189
  #, php-format
190
  msgid "%d points"
191
  msgstr "%d Punkte"
192
 
193
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:130
194
  #: lib/view/WpProQuiz_View_QuestionEdit.php:35
195
+ #: lib/view/WpProQuiz_View_Statistics.php:53
196
  msgid "Question"
197
  msgstr "Frage"
198
 
199
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:137
200
  #: lib/view/WpProQuiz_View_QuestionEdit.php:235
201
  #: lib/view/WpProQuiz_View_QuestionEdit.php:273
202
  #: lib/view/WpProQuiz_View_QuestionEdit.php:308
203
  msgid "Sort elements"
204
  msgstr "Sortierelemente"
205
 
206
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:216
207
+ #: lib/view/WpProQuiz_View_Statistics.php:55
208
  msgid "Correct"
209
  msgstr "Korrekt"
210
 
211
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:224
212
+ #: lib/view/WpProQuiz_View_Statistics.php:56
213
  msgid "Incorrect"
214
  msgstr "Inkorrekt"
215
 
216
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:240
217
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:250
218
  #: lib/view/WpProQuiz_View_QuestionEdit.php:71
219
  msgid "Hint"
220
  msgstr "Tipp"
221
 
222
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:247
223
  msgid "Check"
224
  msgstr "Prüfen"
225
 
226
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:248
227
  msgid "Back"
228
  msgstr "Zurück"
229
 
230
+ #: lib/view/WpProQuiz_View_FrontQuiz.php:252
231
  msgid "Next exercise"
232
  msgstr "Nächste Frage"
233
 
234
+ #: lib/view/WpProQuiz_View_GobalSettings.php:7
235
+ msgid "to activate"
236
+ msgstr "zu aktiveren"
237
+
238
+ #: lib/view/WpProQuiz_View_GobalSettings.php:9
239
+ msgid "not to activate"
240
+ msgstr "nicht zu aktivieren"
241
 
242
+ #: lib/view/WpProQuiz_View_GobalSettings.php:14
243
+ #: lib/view/WpProQuiz_View_GobalSettings.php:25
244
+ #: lib/view/WpProQuiz_View_QuizOverall.php:46
245
+ msgid "Settings in case of problems"
246
+ msgstr "Einstellungen bei Problemen"
247
+
248
+ #: lib/view/WpProQuiz_View_GobalSettings.php:16
249
+ msgid "Please note"
250
+ msgstr "Hinweis"
251
+
252
+ #: lib/view/WpProQuiz_View_GobalSettings.php:18
253
+ msgid ""
254
+ "These settings should only be set in cases of problems with Wp-Pro-Quiz."
255
+ msgstr ""
256
+ "Diese Einstellungen sollten nur gesetzt werden, wenn es Probleme mit Wp-Pro-"
257
+ "Quiz gibt."
258
+
259
+ #: lib/view/WpProQuiz_View_GobalSettings.php:21
260
  #: lib/view/WpProQuiz_View_Import.php:22
261
  #: lib/view/WpProQuiz_View_QuestionEdit.php:13
262
+ #: lib/view/WpProQuiz_View_QuestionOverall.php:18
263
  #: lib/view/WpProQuiz_View_QuizEdit.php:8
264
+ #: lib/view/WpProQuiz_View_Statistics.php:18
265
  msgid "back to overview"
266
  msgstr "zurück zur Übersicht"
267
 
268
+ #: lib/view/WpProQuiz_View_GobalSettings.php:31
269
+ #: lib/view/WpProQuiz_View_GobalSettings.php:36
270
+ msgid "Automatically add [raw] shortcode"
271
+ msgstr "Automatisch [raw] Shortcode hinzufügen"
272
+
273
+ #: lib/view/WpProQuiz_View_GobalSettings.php:40
274
+ #: lib/view/WpProQuiz_View_GobalSettings.php:62
275
+ #: lib/view/WpProQuiz_View_QuizEdit.php:33
276
+ #: lib/view/WpProQuiz_View_QuizEdit.php:52
277
+ #: lib/view/WpProQuiz_View_QuizEdit.php:71
278
+ #: lib/view/WpProQuiz_View_QuizEdit.php:90
279
+ #: lib/view/WpProQuiz_View_QuizEdit.php:109
280
+ #: lib/view/WpProQuiz_View_QuizEdit.php:125
281
+ #: lib/view/WpProQuiz_View_QuizEdit.php:159
282
+ #: lib/view/WpProQuiz_View_QuizEdit.php:178
283
+ #: lib/view/WpProQuiz_View_QuizEdit.php:197
284
+ #: lib/view/WpProQuiz_View_QuizEdit.php:237
285
+ msgid "Activate"
286
+ msgstr "Aktivieren"
287
+
288
+ #: lib/view/WpProQuiz_View_GobalSettings.php:40
289
+ #, php-format
290
+ msgid "It is recommended %s this option on your system."
291
+ msgstr "Es wird auf Ihrem System empfohlen dies %s."
292
+
293
+ #: lib/view/WpProQuiz_View_GobalSettings.php:43
294
+ msgid ""
295
+ "If this option is activated, a [raw] shortcode is automatically set around "
296
+ "WpProQuiz shortcode ( [WpProQuiz X] ) into [raw] [WpProQuiz X] [/raw]"
297
+ msgstr ""
298
+ "Wenn diese Option aktivieren, wird automatisch ein [raw] Shortcode um den "
299
+ "WpProQuiz Shortcode ( [WpProQuiz X] ) gesetzt ( [raw] [WpProQuiz X] [/raw] )."
300
+
301
+ #: lib/view/WpProQuiz_View_GobalSettings.php:46
302
+ #: lib/view/WpProQuiz_View_QuizOverall.php:42
303
+ msgid ""
304
+ "Own themes changes internal order of filters, what causes the problems. "
305
+ "With additional shortcode [raw] this is prevented."
306
+ msgstr ""
307
+ "Einige Themen verändern die interne Reihenfolge der Filter, wodurch es zu "
308
+ "Fehlern kommt. Mit dem zusätzlichen Shortcode [raw] wird dies verhindert."
309
+
310
+ #: lib/view/WpProQuiz_View_GobalSettings.php:53
311
+ #: lib/view/WpProQuiz_View_GobalSettings.php:58
312
+ msgid "Do not load the Javascript-files in the footer"
313
+ msgstr "Javascript-Dateien nicht am Seitenende laden"
314
+
315
+ #: lib/view/WpProQuiz_View_GobalSettings.php:65
316
+ msgid ""
317
+ "Generally all WpProQuiz-Javascript files are loaded in the footer and only "
318
+ "when they are really needed."
319
+ msgstr ""
320
+ "Standardmäßig werden alle WpProQuiz-Javascript-Dateien am Seitenende geladen "
321
+ "und auch nur dann wenn sie wirklich benötigt werden."
322
+
323
+ #: lib/view/WpProQuiz_View_GobalSettings.php:68
324
+ msgid "In very old Wordpress themes this can lead to problems."
325
+ msgstr "Bei sehr alten Wordpress Themes kann dies zu Problemen führen."
326
+
327
+ #: lib/view/WpProQuiz_View_GobalSettings.php:71
328
+ msgid ""
329
+ "If you activate this option, all WpProQuiz-Javascript files are loaded in "
330
+ "the header even if they are not needed."
331
+ msgstr ""
332
+ "Wenn Sie diese Option aktivieren, werden sämtliche WpProQuiz-Javascript-"
333
+ "Dateien im Header geladen, eine Unterscheidung ob die Javascript Dateien "
334
+ "wirklich benötigt werden kann dann nicht mehr getroffen werden."
335
+
336
+ #: lib/view/WpProQuiz_View_GobalSettings.php:74
337
+ #, php-format
338
+ msgid ""
339
+ "Anyone who wants to learn more about this topic should read through the "
340
+ "following websites %s and %s."
341
+ msgstr ""
342
+ "Wer mehr über dieses Thema erfahren möchte, sollte sich folgende Webseiten "
343
+ "durchlesen %s und %s"
344
+
345
+ #: lib/view/WpProQuiz_View_GobalSettings.php:83
346
+ #: lib/view/WpProQuiz_View_GobalSettings.php:88
347
+ msgid "Touch Library"
348
+ msgstr "Touch Library"
349
+
350
+ #: lib/view/WpProQuiz_View_GobalSettings.php:92
351
+ msgid "Deactivate"
352
+ msgstr "Deaktivieren"
353
+
354
+ #: lib/view/WpProQuiz_View_GobalSettings.php:95
355
+ msgid "In Version 0.13 a new Touch Library was added for mobile devices."
356
+ msgstr ""
357
+ "In Version 0.13 wurde eine neue Touch Library für Mobilegeräte hinzugefügt."
358
+
359
+ #: lib/view/WpProQuiz_View_GobalSettings.php:98
360
+ msgid "If you have any problems with the Touch Library, please deactivate it."
361
+ msgstr ""
362
+ "Wenn Sie Probleme mit der Touch Library haben, können Sie dies hier "
363
+ "deaktivieren."
364
+
365
+ #: lib/view/WpProQuiz_View_GobalSettings.php:107
366
+ #: lib/view/WpProQuiz_View_QuestionEdit.php:353
367
+ #: lib/view/WpProQuiz_View_QuizEdit.php:368
368
+ msgid "Save"
369
+ msgstr "Speichern"
370
+
371
+ #: lib/view/WpProQuiz_View_Import.php:21
372
+ #: lib/view/WpProQuiz_View_QuizOverall.php:80
373
+ #: lib/view/WpProQuiz_View_QuizOverall.php:95
374
+ msgid "Import"
375
+ msgstr "Import"
376
+
377
  #: lib/view/WpProQuiz_View_Import.php:25
378
  msgid "Error"
379
  msgstr "Error"
391
  msgstr "Quiz-Name"
392
 
393
  #: lib/view/WpProQuiz_View_Import.php:44
394
+ #: lib/view/WpProQuiz_View_QuizOverall.php:68
395
  msgid "Questions"
396
  msgstr "Fragen"
397
 
398
  #: lib/view/WpProQuiz_View_Import.php:67
399
+ #: lib/view/WpProQuiz_View_QuizOverall.php:106
400
  msgid "Start import"
401
  msgstr "Import starten"
402
 
408
  #: lib/view/WpProQuiz_View_QuestionEdit.php:43
409
  #: lib/view/WpProQuiz_View_QuestionEdit.php:60
410
  #: lib/view/WpProQuiz_View_QuestionEdit.php:71
411
+ #: lib/view/WpProQuiz_View_QuizEdit.php:300
412
  msgid "(optional)"
413
  msgstr "(Optional)"
414
 
422
 
423
  #: lib/view/WpProQuiz_View_QuestionEdit.php:26
424
  #: lib/view/WpProQuiz_View_QuestionEdit.php:31
425
+ #: lib/view/WpProQuiz_View_Statistics.php:54
426
  msgid "Points"
427
  msgstr "Punkte"
428
 
430
  #: lib/view/WpProQuiz_View_QuestionEdit.php:35
431
  #: lib/view/WpProQuiz_View_QuestionEdit.php:123
432
  #: lib/view/WpProQuiz_View_QuizEdit.php:12
433
+ #: lib/view/WpProQuiz_View_QuizEdit.php:289
434
  msgid "(required)"
435
  msgstr "(Pflichtfeld)"
436
 
547
  #: lib/view/WpProQuiz_View_QuestionEdit.php:262
548
  #: lib/view/WpProQuiz_View_QuestionEdit.php:300
549
  #: lib/view/WpProQuiz_View_QuestionEdit.php:335
550
+ #: lib/view/WpProQuiz_View_QuestionOverall.php:38
551
  msgid "Move"
552
  msgstr "Verschieben"
553
 
600
  "Umschliessen sie die gesuchten Woerter mit { } z.B. \"Ich {spiele} Fussball"
601
  "\". Gross- und Kleinschreibung wird ignoriert."
602
 
603
+ #: lib/view/WpProQuiz_View_QuestionOverall.php:17
 
 
 
 
 
604
  msgid "Questions sorted"
605
  msgstr "Fragen sortiert"
606
 
607
+ #: lib/view/WpProQuiz_View_QuestionOverall.php:23
608
+ #: lib/view/WpProQuiz_View_QuizOverall.php:54
609
  msgid "Name"
610
  msgstr "Name"
611
 
612
+ #: lib/view/WpProQuiz_View_QuestionOverall.php:24
613
+ #: lib/view/WpProQuiz_View_QuizOverall.php:55
614
  msgid "Action"
615
  msgstr "Aktion"
616
 
617
+ #: lib/view/WpProQuiz_View_QuestionOverall.php:36
618
+ #: lib/view/WpProQuiz_View_QuizOverall.php:69
619
  msgid "Edit"
620
  msgstr "Bearbeiten"
621
 
622
+ #: lib/view/WpProQuiz_View_QuestionOverall.php:37
623
+ #: lib/view/WpProQuiz_View_QuizOverall.php:70
624
  msgid "Delete"
625
  msgstr "Löschen"
626
 
627
+ #: lib/view/WpProQuiz_View_QuestionOverall.php:45
628
  msgid "Add question"
629
  msgstr "Frage hinzufügen"
630
 
631
+ #: lib/view/WpProQuiz_View_QuestionOverall.php:46
632
  msgid "Save order"
633
  msgstr "Sortierung speichern"
634
 
635
+ #: lib/view/WpProQuiz_View_QuestionOverall.php:47
636
+ #: lib/view/WpProQuiz_View_QuestionOverall.php:51
637
+ msgid "Copy questions from another Quiz"
638
+ msgstr "Fragen aus einem anderen Quiz kopieren."
639
+
640
+ #: lib/view/WpProQuiz_View_QuestionOverall.php:52
641
+ msgid ""
642
+ "Here you can copy questions from another quiz into this quiz. (Multiple "
643
+ "selection enabled)"
644
+ msgstr ""
645
+ "Hier können Sie Fragen aus einem anderen Quiz in dieses Quiz kopieren. "
646
+ "(Mehrfachauswahl aktiviert)"
647
+
648
+ #: lib/view/WpProQuiz_View_QuestionOverall.php:56
649
+ #: lib/view/WpProQuiz_View_Statistics.php:45
650
+ msgid "Loading"
651
+ msgstr "Daten werden geladen"
652
+
653
+ #: lib/view/WpProQuiz_View_QuestionOverall.php:64
654
+ msgid "Copy questions"
655
+ msgstr "Fragen kopieren"
656
+
657
  #: lib/view/WpProQuiz_View_QuizEdit.php:12
658
  msgid "Quiz title"
659
  msgstr "Quiz Titel"
670
  msgid "Hide title"
671
  msgstr "Titel verstecken"
672
 
673
+ #: lib/view/WpProQuiz_View_QuizEdit.php:36
674
  msgid "The title serves as quiz heading."
675
  msgstr "Der Titel dient als Quiz Überschrift."
676
 
677
+ #: lib/view/WpProQuiz_View_QuizEdit.php:43
678
+ #: lib/view/WpProQuiz_View_QuizEdit.php:48
679
  msgid "Hide \"Restart quiz\" button"
680
  msgstr "Button \"Quiz erneut starten\" verstecken"
681
 
682
+ #: lib/view/WpProQuiz_View_QuizEdit.php:55
683
  msgid "Hide the \"Restart quiz\" button in the Frontend."
684
  msgstr "Versteckt den Button \"Quiz erneut starten\" im Frontend."
685
 
686
+ #: lib/view/WpProQuiz_View_QuizEdit.php:62
687
+ #: lib/view/WpProQuiz_View_QuizEdit.php:67
688
  msgid "Hide \"View question\" button"
689
  msgstr "Button \"Fragen ansehen\" verstecken"
690
 
691
+ #: lib/view/WpProQuiz_View_QuizEdit.php:74
692
  msgid "Hide the \"View question\" button in the Frontend."
693
  msgstr "Versteckt den Button \"Fragen ansehen\" im Frontend."
694
 
695
+ #: lib/view/WpProQuiz_View_QuizEdit.php:81
696
+ #: lib/view/WpProQuiz_View_QuizEdit.php:86
697
  msgid "Show points"
698
  msgstr "Punkte anzeigen"
699
 
700
+ #: lib/view/WpProQuiz_View_QuizEdit.php:93
701
  msgid "Shows in quiz, how many points are reachable for respective question."
702
  msgstr "Zeigt im Quiz an, wieviel Punkte es für die jeweilige Frage gibt."
703
 
704
+ #: lib/view/WpProQuiz_View_QuizEdit.php:100
705
+ #: lib/view/WpProQuiz_View_QuizEdit.php:105
706
  msgid "Display question randomly"
707
  msgstr "Fragen zufällig ausgeben"
708
 
 
709
  #: lib/view/WpProQuiz_View_QuizEdit.php:116
710
+ #: lib/view/WpProQuiz_View_QuizEdit.php:121
711
  msgid "Display answers randomly"
712
  msgstr "Antworten zufällig ausgeben"
713
 
714
+ #: lib/view/WpProQuiz_View_QuizEdit.php:140
715
  msgid "Seconds"
716
  msgstr "Sekunden"
717
 
718
+ #: lib/view/WpProQuiz_View_QuizEdit.php:143
719
  msgid "0 = no limit"
720
  msgstr "0 = Kein Limit"
721
 
722
+ #: lib/view/WpProQuiz_View_QuizEdit.php:150
723
+ #: lib/view/WpProQuiz_View_QuizEdit.php:155
724
  msgid "Check -> continue"
725
  msgstr "Prüfen -> Weiter"
726
 
727
+ #: lib/view/WpProQuiz_View_QuizEdit.php:162
728
  msgid ""
729
  "Show \"right or wrong\" after the question. Otherwise the solutions will be "
730
  "displayed at the end."
732
  "Zeigt \"richtig oder falsch\" nach jeder Frage an. Ansonsten werden die "
733
  "Lösungen erst am Ende angezeigt."
734
 
735
+ #: lib/view/WpProQuiz_View_QuizEdit.php:169
736
+ #: lib/view/WpProQuiz_View_QuizEdit.php:174
737
  msgid "Back button"
738
  msgstr "Zurück Button"
739
 
740
+ #: lib/view/WpProQuiz_View_QuizEdit.php:181
741
  msgid ""
742
  "Allow to use back button in a question. (Option will be ignored if \"Check -"
743
  "> Continue\" was used)"
745
  "Ermöglicht das Zurückgehen einer Frage. (Option wird ignoriert bei \"Prüfen -"
746
  "> Weiter\")"
747
 
748
+ #: lib/view/WpProQuiz_View_QuizEdit.php:188
749
+ #: lib/view/WpProQuiz_View_QuizEdit.php:193
750
+ #: lib/view/WpProQuiz_View_QuizOverall.php:72
751
  msgid "Statistics"
752
  msgstr "Statistik"
753
 
754
+ #: lib/view/WpProQuiz_View_QuizEdit.php:200
 
 
 
 
755
  msgid ""
756
  "Statistics about right or wrong answers. Statistics will be saved by "
757
  "completed quiz, not after every question. The statistics is only visible "
761
  "vollständigen abschließen des Quiz gespeichert, nicht nach jeder Frage. Die "
762
  "Statistik ist nur über das Adminmenü einsehbar (interne Statistik)"
763
 
764
+ #: lib/view/WpProQuiz_View_QuizEdit.php:207
765
+ #: lib/view/WpProQuiz_View_QuizEdit.php:212
766
  msgid "Statistics IP-lock"
767
  msgstr "Statistik IP-Sperre"
768
 
769
+ #: lib/view/WpProQuiz_View_QuizEdit.php:216
770
  msgid "in minutes (recommended 1440 minutes = 1 day)"
771
  msgstr "in Minuten (Empfohlen: 1440 Minuten = 1 Tag)"
772
 
773
+ #: lib/view/WpProQuiz_View_QuizEdit.php:219
774
  msgid ""
775
  "Protect the statistics from spam. Result will only be saved every X minutes "
776
  "from same IP. (0 = deactivated)"
778
  "Schuetz die Statistik vor Spam. Ergebnis wird nur aller X Minuten von der "
779
  "gleichen IP gespeichert. (0 = Deaktiviert)"
780
 
781
+ #: lib/view/WpProQuiz_View_QuizEdit.php:226
782
+ #: lib/view/WpProQuiz_View_QuizEdit.php:232
783
+ msgid "Execute quiz only once"
784
+ msgstr "Quiz nur einmal ausführen"
785
+
786
+ #: lib/view/WpProQuiz_View_QuizEdit.php:240
787
+ msgid ""
788
+ "If you activate this option, the user can complete the quiz only once. "
789
+ "Afterwards the quiz is blocked for this user."
790
+ msgstr ""
791
+ "Wenn diese Option aktivieren, kann ein Benutzer das Quiz nur einmal "
792
+ "absolvieren, danach wird das Quiz für diesen Benutzer gesperrt."
793
+
794
+ #: lib/view/WpProQuiz_View_QuizEdit.php:244
795
+ msgid "This option applies to:"
796
+ msgstr "Diese Option gilt für:"
797
+
798
+ #: lib/view/WpProQuiz_View_QuizEdit.php:252
799
+ msgid "all users"
800
+ msgstr "Alle Benutzer"
801
+
802
+ #: lib/view/WpProQuiz_View_QuizEdit.php:256
803
+ msgid "registered useres only"
804
+ msgstr "nur registriere Benutzer"
805
+
806
+ #: lib/view/WpProQuiz_View_QuizEdit.php:260
807
+ msgid "anonymous users only"
808
+ msgstr "nur anonyme Benutzer"
809
+
810
+ #: lib/view/WpProQuiz_View_QuizEdit.php:266
811
+ msgid "user identification by cookie"
812
+ msgstr "Benutzer-Identifikation über Cookie"
813
+
814
+ #: lib/view/WpProQuiz_View_QuizEdit.php:269
815
+ msgid ""
816
+ "If you activate this option, a cookie is set additionally for unregistrated "
817
+ "(anonymous) users. This ensures a longer assignment of the user than the "
818
+ "simple assignment by the IP address."
819
+ msgstr ""
820
+ "Wenn diese Option aktivieren, wird zusätzlich ein Cookie für unregistrierte "
821
+ "Benutzer (anonyme) gesetzt. Dies gewährleistet eine längere Zuordnung des "
822
+ "Benutzers als nur über die IP-Adresse."
823
+
824
+ #: lib/view/WpProQuiz_View_QuizEdit.php:274
825
+ msgid "Reset the user identification"
826
+ msgstr "Benutzer-Identifikation zurücksetzten"
827
+
828
+ #: lib/view/WpProQuiz_View_QuizEdit.php:275
829
+ msgid "User identification has been reset."
830
+ msgstr "Benutzer-Identifikation wurde zurückgesetzt."
831
+
832
+ #: lib/view/WpProQuiz_View_QuizEdit.php:277
833
+ msgid "Resets user identification for all users."
834
+ msgstr "Setzt die Benutzer-Identifikation für alle Benutzer zurück."
835
+
836
+ #: lib/view/WpProQuiz_View_QuizEdit.php:289
837
  msgid "Quiz description"
838
  msgstr "Quiz Beschreibung"
839
 
840
+ #: lib/view/WpProQuiz_View_QuizEdit.php:292
841
  msgid "This text will be displayed before start of the quiz."
842
  msgstr "Dieser Text wird vor dem Starten des Quizes angezeigt."
843
 
844
+ #: lib/view/WpProQuiz_View_QuizEdit.php:300
845
  msgid "Results text"
846
  msgstr "Ergebnis Text"
847
 
848
+ #: lib/view/WpProQuiz_View_QuizEdit.php:303
849
  msgid ""
850
  "This text will be displayed at the end of the quiz (in results). (this text "
851
  "is optional)"
853
  "Dieser Text wird beim Beenden (im Ergebnis) des Quizes angezeigt (Dieser "
854
  "Text ist optional)"
855
 
856
+ #: lib/view/WpProQuiz_View_QuizEdit.php:307
857
  msgid "Activate graduation"
858
  msgstr "Abstufungen aktivieren"
859
 
860
+ #: lib/view/WpProQuiz_View_QuizEdit.php:313
861
  msgid "Hint:"
862
  msgstr "Hinweis:"
863
 
864
+ #: lib/view/WpProQuiz_View_QuizEdit.php:315
865
  msgid "Maximal 15 levels"
866
  msgstr "Maximal 15 Stufen"
867
 
868
+ #: lib/view/WpProQuiz_View_QuizEdit.php:317
869
  #, php-format
870
  msgid ""
871
  "Percentages refer to the total score of the quiz. (Current total %d points "
874
  "Prozente beziehen sich auf die Gesamtpunktzahl des Quiz (Aktuell: insgesamt "
875
  "%d Punkte bei %d Fragen)"
876
 
877
+ #: lib/view/WpProQuiz_View_QuizEdit.php:320
878
  msgid "Values can also be mixed up"
879
  msgstr "Werte können auch durcheinander sein"
880
 
881
+ #: lib/view/WpProQuiz_View_QuizEdit.php:321
882
  msgid "10,15% or 10.15% allowed (max. two digits after the decimal point)"
883
  msgstr "10,15% oder 10.15% erlaubt (maximal 2 Stellen nach dem Komma)"
884
 
885
+ #: lib/view/WpProQuiz_View_QuizEdit.php:337
886
+ #: lib/view/WpProQuiz_View_QuizEdit.php:348
887
  msgid "from:"
888
  msgstr "Ab:"
889
 
890
+ #: lib/view/WpProQuiz_View_QuizEdit.php:337
891
+ #: lib/view/WpProQuiz_View_QuizEdit.php:348
892
  msgid "percent"
893
  msgstr "Prozent"
894
 
895
+ #: lib/view/WpProQuiz_View_QuizEdit.php:337
896
+ #: lib/view/WpProQuiz_View_QuizEdit.php:348
897
  #, php-format
898
  msgid ""
899
  "(Will be displayed, when result-percent is >= <span class=\"resultProzent\">"
902
  "(Wird angezeigt wenn Ergebnis-Prozent >= <span class=\"resultProzent\">%s</"
903
  "span>%% ist)"
904
 
905
+ #: lib/view/WpProQuiz_View_QuizEdit.php:338
906
+ #: lib/view/WpProQuiz_View_QuizEdit.php:349
907
  msgid "Delete graduation"
908
  msgstr "Stufe löschen"
909
 
910
+ #: lib/view/WpProQuiz_View_QuizEdit.php:356
911
  msgid "Add graduation"
912
  msgstr "Stufe hinzufügen"
913
 
924
  msgstr ""
925
  "Wenn das Quiz im Front-End nicht funktioniert, versucht bitte folgendes:"
926
 
927
+ #: lib/view/WpProQuiz_View_QuizOverall.php:52
 
 
 
 
 
 
 
 
928
  msgid "ID"
929
  msgstr "ID"
930
 
931
+ #: lib/view/WpProQuiz_View_QuizOverall.php:53
932
  msgid "Shortcode"
933
  msgstr "Shortcode"
934
 
935
+ #: lib/view/WpProQuiz_View_QuizOverall.php:71
936
  msgid "Preview"
937
  msgstr "Vorschau"
938
 
939
+ #: lib/view/WpProQuiz_View_QuizOverall.php:79
940
  msgid "Add quiz"
941
  msgstr "Quiz hinzufügen"
942
 
943
+ #: lib/view/WpProQuiz_View_QuizOverall.php:81
944
+ #: lib/view/WpProQuiz_View_QuizOverall.php:85
945
  msgid "Export"
946
  msgstr "Export"
947
 
948
+ #: lib/view/WpProQuiz_View_QuizOverall.php:86
949
  msgid ""
950
  "Choose the respective question, which you would like to export and press on "
951
  "\"Start export\""
953
  "Wählen Sie oben die entsprechen Quiz aus, die Sie exportieren möchten und "
954
  "klicken Sie anschliessen auf \"Export starten\""
955
 
956
+ #: lib/view/WpProQuiz_View_QuizOverall.php:90
957
  msgid "Start export"
958
  msgstr "Export starten"
959
 
960
+ #: lib/view/WpProQuiz_View_QuizOverall.php:96
961
  msgid "Import only *.wpq files from known and trusted sources."
962
  msgstr ""
963
  "Importieren sie nur *.wpq Dateien aus bekannten und vertrauenswürdigen "
964
  "Quellen."
965
 
966
+ #: lib/view/WpProQuiz_View_QuizOverall.php:104
967
  #, php-format
968
  msgid "Maximal %d MiB"
969
  msgstr "Maximal %d MiB"
970
 
971
+ #: lib/view/WpProQuiz_View_Statistics.php:17
972
  #, php-format
973
  msgid "Quiz: %s - Statistics"
974
  msgstr "Quiz: %s - Statistik"
975
 
976
+ #: lib/view/WpProQuiz_View_Statistics.php:21
977
  msgid "Stats not enabled"
978
  msgstr "Statistik ist nicht aktiviert"
979
 
980
+ #: lib/view/WpProQuiz_View_Statistics.php:22
981
  msgid "Activate statistics"
982
  msgstr "Statistik aktivieren"
983
 
984
+ #: lib/view/WpProQuiz_View_Statistics.php:27
985
+ msgid "Anonymous users"
986
+ msgstr "anonyme Benutzer"
987
+
988
+ #: lib/view/WpProQuiz_View_Statistics.php:28
989
+ msgid "Registered useres"
990
+ msgstr "registrierte Benutzer"
991
+
992
+ #: lib/view/WpProQuiz_View_Statistics.php:29
993
+ msgid "Overview"
994
+ msgstr "Übersicht"
995
+
996
+ #: lib/view/WpProQuiz_View_Statistics.php:34
997
+ msgid "Please select user name:"
998
+ msgstr "Bitte Benutzername auswählen:"
999
+
1000
+ #: lib/view/WpProQuiz_View_Statistics.php:57
1001
  msgid "Hints used"
1002
  msgstr "Tipp benutzt"
1003
 
1004
+ #: lib/view/WpProQuiz_View_Statistics.php:82
1005
  msgid "Total"
1006
  msgstr "Total"
1007
 
1008
+ #: lib/view/WpProQuiz_View_Statistics.php:94
1009
  msgid "Reset statistics"
1010
  msgstr "Statistik zurücksetzen"
1011
 
1012
+ #: lib/view/WpProQuiz_View_Statistics.php:95
1013
+ msgid "Refresh"
1014
+ msgstr "Aktualisieren"
1015
+
1016
+ #: lib/view/WpProQuiz_View_Statistics.php:98
1017
+ msgid "Reset entire statistic"
1018
+ msgstr "Alle Statistiken zurücksetzten"
1019
+
1020
+ #~ msgid "All"
1021
+ #~ msgstr "Alle"
1022
+
1023
  #~ msgid "One question is one point"
1024
  #~ msgstr "Eine Frage ist 1 Punkt"
1025
 
1032
  #~ msgid "Tip"
1033
  #~ msgstr "Tipp"
1034
 
 
 
 
 
1035
  #, fuzzy
1036
  #~ msgid "Statistics reset"
1037
  #~ msgstr "Statistik zurücksetzen"
lib/controller/WpProQuiz_Controller_Admin.php CHANGED
@@ -11,11 +11,39 @@ class WpProQuiz_Controller_Admin {
11
  $this->_plugin_file = $this->_plugin_dir.'/wp-pro-quiz.php';
12
 
13
  add_action('wp_ajax_wp_pro_quiz_update_sort', array($this, 'updateSort'));
14
- add_action('wp_ajax_wp_pro_quiz_statistics_save', array($this, 'statisticsSave'));
15
- add_action('wp_ajax_nopriv_wp_pro_quiz_statistics_save', array($this, 'statisticsSave'));
 
 
 
 
 
 
 
 
 
 
 
 
16
  add_action('admin_menu', array($this, 'register_page'));
17
  }
18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  public function updateSort() {
20
 
21
  if(!current_user_can('administrator'))
@@ -25,9 +53,18 @@ class WpProQuiz_Controller_Admin {
25
  $c->route();
26
  }
27
 
28
- public function statisticsSave() {
29
- $statistics = new WpProQuiz_Controller_Statistics();
30
- $statistics->save();
 
 
 
 
 
 
 
 
 
31
  }
32
 
33
  private function localizeScript() {
@@ -40,7 +77,8 @@ class WpProQuiz_Controller_Admin {
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);
@@ -98,8 +136,11 @@ class WpProQuiz_Controller_Admin {
98
  case 'importExport':
99
  $c = new WpProQuiz_Controller_ImportExport();
100
  break;
 
 
 
101
  }
102
-
103
  if($c !== null) {
104
  $c->route();
105
  }
11
  $this->_plugin_file = $this->_plugin_dir.'/wp-pro-quiz.php';
12
 
13
  add_action('wp_ajax_wp_pro_quiz_update_sort', array($this, 'updateSort'));
14
+ add_action('wp_ajax_wp_pro_quiz_load_question', array($this, 'updateSort'));
15
+
16
+ add_action('wp_ajax_wp_pro_quiz_load_statistics', array($this, 'loadStatistics'));
17
+ add_action('wp_ajax_wp_pro_quiz_statistics', array($this, 'loadStatistics'));
18
+
19
+ add_action('wp_ajax_wp_pro_quiz_reset_lock', array($this, 'resetLock'));
20
+
21
+
22
+ add_action('wp_ajax_wp_pro_quiz_completed_quiz', array($this, 'completedQuiz'));
23
+ add_action('wp_ajax_nopriv_wp_pro_quiz_completed_quiz', array($this, 'completedQuiz'));
24
+
25
+ add_action('wp_ajax_wp_pro_quiz_check_lock', array($this, 'QuizCheckLock'));
26
+ add_action('wp_ajax_nopriv_wp_pro_quiz_check_lock', array($this, 'QuizCheckLock'));
27
+
28
  add_action('admin_menu', array($this, 'register_page'));
29
  }
30
 
31
+ public function resetLock() {
32
+ if(!current_user_can('administrator'))
33
+ exit;
34
+
35
+ $c = new WpProQuiz_Controller_Quiz();
36
+ $c->route();
37
+ }
38
+
39
+ public function QuizCheckLock() {
40
+ $quizController = new WpProQuiz_Controller_Quiz();
41
+
42
+ echo json_encode($quizController->isLockQuiz($_POST['quizId']));
43
+
44
+ exit;
45
+ }
46
+
47
  public function updateSort() {
48
 
49
  if(!current_user_can('administrator'))
53
  $c->route();
54
  }
55
 
56
+ public function loadStatistics() {
57
+
58
+ if(!current_user_can('administrator'))
59
+ exit;
60
+
61
+ $c = new WpProQuiz_Controller_Statistics();
62
+ $c->route();
63
+ }
64
+
65
+ public function completedQuiz() {
66
+ $quiz = new WpProQuiz_Controller_Quiz();
67
+ $quiz->completedQuiz();
68
  }
69
 
70
  private function localizeScript() {
77
  'no_quiz_start_msg' => __('No quiz description filled!', 'wp-pro-quiz'),
78
  'fail_grade_result' => __('The percent values in result text are incorrect.', 'wp-pro-quiz'),
79
  'no_nummber_points' => __('No number in the field "Points" or less than 1', 'wp-pro-quiz'),
80
+ 'no_selected_quiz' => __('No quiz selected', 'wp-pro-quiz'),
81
+ 'reset_statistics_msg' => __('Do you really want to reset the statistic?', 'wp-pro-quiz')
82
  );
83
 
84
  wp_localize_script('wpProQuiz_admin_javascript', 'wpProQuizLocalize', $translation_array);
136
  case 'importExport':
137
  $c = new WpProQuiz_Controller_ImportExport();
138
  break;
139
+ case 'globalSettings':
140
+ $c = new WpProQuiz_Controller_GlobalSettings();
141
+ break;
142
  }
143
+
144
  if($c !== null) {
145
  $c->route();
146
  }
lib/controller/WpProQuiz_Controller_Controller.php CHANGED
@@ -1,10 +1,15 @@
1
  <?php
2
  class WpProQuiz_Controller_Controller {
3
  protected $_post = null;
 
4
 
5
  public function __construct() {
6
  if($this->_post === null) {
7
  $this->_post = stripslashes_deep($_POST);
8
  }
 
 
 
 
9
  }
10
  }
1
  <?php
2
  class WpProQuiz_Controller_Controller {
3
  protected $_post = null;
4
+ protected $_cookie = null;
5
 
6
  public function __construct() {
7
  if($this->_post === null) {
8
  $this->_post = stripslashes_deep($_POST);
9
  }
10
+
11
+ if($this->_cookie === null && $_COOKIE !== null) {
12
+ $this->_cookie = stripslashes_deep($_COOKIE);
13
+ }
14
  }
15
  }
lib/controller/WpProQuiz_Controller_Front.php CHANGED
@@ -4,12 +4,19 @@ class WpProQuiz_Controller_Front {
4
  private $_plugin_dir;
5
  private $_plugin_file;
6
 
 
 
 
 
 
7
  public function __construct($plugin_dir) {
8
  $this->_plugin_dir = $plugin_dir;
9
  $this->_plugin_file = $this->_plugin_dir.'/wp-pro-quiz.php';
10
 
11
  spl_autoload_register(array($this, 'autoload'));
12
 
 
 
13
  add_action('wp_enqueue_scripts', array($this, 'loadDefaultScripts'));
14
  add_shortcode('WpProQuiz', array($this, 'shortcode'));
15
  }
@@ -23,20 +30,40 @@ class WpProQuiz_Controller_Front {
23
  array(),
24
  WPPROQUIZ_VERSION
25
  );
 
 
 
 
26
  }
27
 
28
- public function shortcode($attr) {
29
- $id = $attr[0];
30
- $content = '';
31
-
32
  wp_enqueue_script(
33
- 'wpProQuiz_front_javascript',
34
  plugins_url('js/wpProQuiz_front.min.js', $this->_plugin_file),
35
  array('jquery-ui-sortable'),
36
  WPPROQUIZ_VERSION,
37
- true
38
  );
39
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  if(is_numeric($id)) {
41
  ob_start();
42
 
@@ -47,6 +74,10 @@ class WpProQuiz_Controller_Front {
47
  ob_end_clean();
48
  }
49
 
 
 
 
 
50
  return $content;
51
  }
52
 
@@ -59,8 +90,11 @@ class WpProQuiz_Controller_Front {
59
  $quiz = $quizMapper->fetch($id);
60
  $question = $questionMapper->fetchAll($id);
61
 
62
- if(empty($quiz) || empty($question))
63
  echo '';
 
 
 
64
 
65
  $view->quiz = $quiz;
66
  $view->question = $question;
@@ -68,6 +102,12 @@ class WpProQuiz_Controller_Front {
68
  $view->show();
69
  }
70
 
 
 
 
 
 
 
71
  public function autoload($class) {
72
  $c = explode("_", $class);
73
 
4
  private $_plugin_dir;
5
  private $_plugin_file;
6
 
7
+ /**
8
+ * @var WpProQuiz_Model_GlobalSettings
9
+ */
10
+ private $_settings = null;
11
+
12
  public function __construct($plugin_dir) {
13
  $this->_plugin_dir = $plugin_dir;
14
  $this->_plugin_file = $this->_plugin_dir.'/wp-pro-quiz.php';
15
 
16
  spl_autoload_register(array($this, 'autoload'));
17
 
18
+ $this->loadSettings();
19
+
20
  add_action('wp_enqueue_scripts', array($this, 'loadDefaultScripts'));
21
  add_shortcode('WpProQuiz', array($this, 'shortcode'));
22
  }
30
  array(),
31
  WPPROQUIZ_VERSION
32
  );
33
+
34
+ if($this->_settings->isJsLoadInHead()) {
35
+ $this->loadJsScripts(false);
36
+ }
37
  }
38
 
39
+ private function loadJsScripts($footer = true) {
 
 
 
40
  wp_enqueue_script(
41
+ 'wpProQuiz_front_javascript',
42
  plugins_url('js/wpProQuiz_front.min.js', $this->_plugin_file),
43
  array('jquery-ui-sortable'),
44
  WPPROQUIZ_VERSION,
45
+ $footer
46
  );
47
 
48
+ if(!$this->_settings->isTouchLibraryDeactivate()) {
49
+ wp_enqueue_script(
50
+ 'jquery-ui-touch-punch',
51
+ plugins_url('js/jquery.ui.touch-punch.min.js', $this->_plugin_file),
52
+ array('jquery-ui-sortable'),
53
+ '0.2.2',
54
+ $footer
55
+ );
56
+ }
57
+ }
58
+
59
+ public function shortcode($attr) {
60
+ $id = $attr[0];
61
+ $content = '';
62
+
63
+ if(!$this->_settings->isJsLoadInHead()) {
64
+ $this->loadJsScripts();
65
+ }
66
+
67
  if(is_numeric($id)) {
68
  ob_start();
69
 
74
  ob_end_clean();
75
  }
76
 
77
+ if($this->_settings->isAddRawShortcode()) {
78
+ return '[raw]'.$content.'[/raw]';
79
+ }
80
+
81
  return $content;
82
  }
83
 
90
  $quiz = $quizMapper->fetch($id);
91
  $question = $questionMapper->fetchAll($id);
92
 
93
+ if(empty($quiz) || empty($question)) {
94
  echo '';
95
+
96
+ return;
97
+ }
98
 
99
  $view->quiz = $quiz;
100
  $view->question = $question;
102
  $view->show();
103
  }
104
 
105
+ private function loadSettings() {
106
+ $mapper = new WpProQuiz_Model_GlobalSettingsMapper();
107
+
108
+ $this->_settings = $mapper->fetchAll();
109
+ }
110
+
111
  public function autoload($class) {
112
  $c = explode("_", $class);
113
 
lib/controller/WpProQuiz_Controller_GlobalSettings.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class WpProQuiz_Controller_GlobalSettings extends WpProQuiz_Controller_Controller {
3
+
4
+ public function route() {
5
+ $this->edit();
6
+ }
7
+
8
+ private function edit() {
9
+ $mapper = new WpProQuiz_Model_GlobalSettingsMapper();
10
+ $view = new WpProQuiz_View_GobalSettings();
11
+
12
+ if(isset($this->_post['submit'])) {
13
+ $mapper->save(new WpProQuiz_Model_GlobalSettings($this->_post));
14
+ WpProQuiz_View_View::admin_notices(__('Settings saved', 'wp-pro-quiz'), 'info');
15
+ }
16
+
17
+ $view->settings = $mapper->fetchAll();
18
+ $view->isRaw = !preg_match('[raw]', apply_filters('the_content', '[raw]a[/raw]'));
19
+
20
+ $view->show();
21
+ }
22
+ }
lib/controller/WpProQuiz_Controller_Question.php CHANGED
@@ -36,7 +36,64 @@ class WpProQuiz_Controller_Question extends WpProQuiz_Controller_Controller {
36
  case 'save_sort':
37
  $this->saveSort($_GET['id']);
38
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  }
 
 
 
 
40
  }
41
 
42
  public function saveSort($quizId) {
@@ -53,6 +110,9 @@ class WpProQuiz_Controller_Question extends WpProQuiz_Controller_Controller {
53
  $mapper = new WpProQuiz_Model_QuestionMapper();
54
  $mapper->delete($id);
55
 
 
 
 
56
  $this->showAction();
57
  }
58
 
36
  case 'save_sort':
37
  $this->saveSort($_GET['id']);
38
  break;
39
+ case 'load_question':
40
+ $this->loadQuestion($_GET['quiz_id']);
41
+ break;
42
+ case 'copy_question':
43
+ $this->copyQuestion($_GET['quiz_id']);
44
+ break;
45
+ }
46
+ }
47
+
48
+ public function copyQuestion($quizId) {
49
+ $m = new WpProQuiz_Model_QuestionMapper();
50
+
51
+ $questions = $m->fetchById($this->_post['copyIds']);
52
+
53
+ foreach($questions as $question) {
54
+ $question->setId(0);
55
+ $question->setQuizId($quizId);
56
+
57
+ $m->save($question);
58
+ }
59
+
60
+ WpProQuiz_View_View::admin_notices(__('questions copied', 'wp-pro-quiz'), 'info');
61
+
62
+ $this->showAction();
63
+ }
64
+
65
+ public function loadQuestion($quizId) {
66
+ $quizMapper = new WpProQuiz_Model_QuizMapper();
67
+ $questionMapper = new WpProQuiz_Model_QuestionMapper();
68
+ $data = array();
69
+
70
+ $quiz = $quizMapper->fetchAll();
71
+
72
+ foreach($quiz as $qz) {
73
+
74
+ if($qz->getId() == $quizId)
75
+ continue;
76
+
77
+ $question = $questionMapper->fetchAll($qz->getId());
78
+ $questionArray = array();
79
+
80
+ foreach($question as $qu) {
81
+ $questionArray[] = array(
82
+ 'name' => $qu->getTitle(),
83
+ 'id' => $qu->getId()
84
+ );
85
+ }
86
+
87
+ $data[] = array(
88
+ 'name' => $qz->getName(),
89
+ 'id' => $qz->getId(),
90
+ 'question' => $questionArray
91
+ );
92
  }
93
+
94
+ echo json_encode($data);
95
+
96
+ exit;
97
  }
98
 
99
  public function saveSort($quizId) {
110
  $mapper = new WpProQuiz_Model_QuestionMapper();
111
  $mapper->delete($id);
112
 
113
+ $sm = new WpProQuiz_Model_StatisticMapper();
114
+ $sm->deleteByQuestionId($id);
115
+
116
  $this->showAction();
117
  }
118
 
lib/controller/WpProQuiz_Controller_Quiz.php CHANGED
@@ -20,7 +20,28 @@ class WpProQuiz_Controller_Quiz extends WpProQuiz_Controller_Controller {
20
  if(isset($_GET['id']))
21
  $this->deleteAction($_GET['id']);
22
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  }
 
 
24
  }
25
 
26
  private function showAction() {
@@ -102,8 +123,17 @@ class WpProQuiz_Controller_Quiz extends WpProQuiz_Controller_Controller {
102
 
103
  private function deleteAction($id) {
104
  $m = new WpProQuiz_Model_QuizMapper();
 
 
 
 
105
  $m->delete($id);
 
 
 
 
106
  WpProQuiz_View_View::admin_notices(__('Quiz deleted', 'wp-pro-quiz'), 'info');
 
107
  $this->showAction();
108
  }
109
 
@@ -122,4 +152,126 @@ class WpProQuiz_Controller_Quiz extends WpProQuiz_Controller_Controller {
122
 
123
  return $result;
124
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  }
20
  if(isset($_GET['id']))
21
  $this->deleteAction($_GET['id']);
22
  break;
23
+ case 'reset_lock':
24
+ $this->resetLock($_GET['id']);
25
+ break;
26
+ }
27
+ }
28
+
29
+ private function resetLock($quizId) {
30
+ $lm = new WpProQuiz_Model_LockMapper();
31
+ $qm = new WpProQuiz_Model_QuizMapper();
32
+
33
+ $q = $qm->fetch($quizId);
34
+
35
+ if($q->getId() > 0) {
36
+
37
+ $q->setQuizRunOnceTime(time());
38
+
39
+ $qm->save($q);
40
+
41
+ $lm->deleteByQuizId($quizId, WpProQuiz_Model_Lock::TYPE_QUIZ);
42
  }
43
+
44
+ exit;
45
  }
46
 
47
  private function showAction() {
123
 
124
  private function deleteAction($id) {
125
  $m = new WpProQuiz_Model_QuizMapper();
126
+ $qm = new WpProQuiz_Model_QuestionMapper();
127
+ $lm = new WpProQuiz_Model_LockMapper();
128
+ $sm = new WpProQuiz_Model_StatisticMapper();
129
+
130
  $m->delete($id);
131
+ $qm->deleteByQuizId($id);
132
+ $lm->deleteByQuizId($id);
133
+ $sm->deleteByQuiz($id);
134
+
135
  WpProQuiz_View_View::admin_notices(__('Quiz deleted', 'wp-pro-quiz'), 'info');
136
+
137
  $this->showAction();
138
  }
139
 
152
 
153
  return $result;
154
  }
155
+
156
+ public function completedQuiz() {
157
+
158
+ $lockMapper = new WpProQuiz_Model_LockMapper();
159
+ $quizMapper = new WpProQuiz_Model_QuizMapper();
160
+
161
+ $quiz = $quizMapper->fetch($this->_post['quizId']);
162
+
163
+ if($quiz === null || $quiz->getId() <= 0) {
164
+ exit;
165
+ }
166
+
167
+ if(!$this->isPreLockQuiz($quiz)) {
168
+
169
+ $statistics = new WpProQuiz_Controller_Statistics();
170
+ $statistics->save();
171
+
172
+ exit;
173
+ }
174
+
175
+ $lockMapper->deleteOldLock(60*60*24*7, $this->_post['quizId'], time(), WpProQuiz_Model_Lock::TYPE_QUIZ, 0);
176
+
177
+ $lockIp = $lockMapper->isLock($this->_post['quizId'], $this->getIp(), get_current_user_id(), WpProQuiz_Model_Lock::TYPE_QUIZ);
178
+ $lockCookie = false;
179
+ $cookieTime = $quiz->getQuizRunOnceTime();
180
+ $cookieJson = null;
181
+
182
+ if(isset($this->_cookie['wpProQuiz_lock']) && get_current_user_id() == 0 && $quiz->isQuizRunOnceCookie()) {
183
+ $cookieJson = json_decode($this->_cookie['wpProQuiz_lock'], true);
184
+
185
+ if($cookieJson !== false) {
186
+ if(isset($cookieJson[$this->_post['quizId']]) && $cookieJson[$this->_post['quizId']] == $cookieTime) {
187
+ $lockCookie = true;
188
+ }
189
+ }
190
+ }
191
+
192
+ if(!$lockIp && !$lockCookie) {
193
+ $statistics = new WpProQuiz_Controller_Statistics();
194
+ $statistics->save();
195
+
196
+ if(get_current_user_id() == 0 && $quiz->isQuizRunOnceCookie()) {
197
+ $cookieData = array();
198
+
199
+ if($cookieJson !== null || $cookieJson !== false) {
200
+ $cookieData = $cookieJson;
201
+ }
202
+
203
+ $cookieData[$this->_post['quizId']] = $quiz->getQuizRunOnceTime();
204
+ $url = parse_url(get_bloginfo( 'url' ));
205
+
206
+ setcookie('wpProQuiz_lock', json_encode($cookieData), time() + 60*60*24*60, empty($url['path']) ? '/' : $url['path']);
207
+ }
208
+
209
+ $lock = new WpProQuiz_Model_Lock();
210
+
211
+ $lock->setUserId(get_current_user_id());
212
+ $lock->setQuizId($this->_post['quizId']);
213
+ $lock->setLockDate(time());
214
+ $lock->setLockIp($this->getIp());
215
+ $lock->setLockType(WpProQuiz_Model_Lock::TYPE_QUIZ);
216
+
217
+ $lockMapper->insert($lock);
218
+ }
219
+
220
+ exit;
221
+ }
222
+
223
+ public function isPreLockQuiz(WpProQuiz_Model_Quiz $quiz) {
224
+ $userId = get_current_user_id();
225
+
226
+ if($quiz->isQuizRunOnce()) {
227
+ switch ($quiz->getQuizRunOnceType()) {
228
+ case WpProQuiz_Model_Quiz::QUIZ_RUN_ONCE_TYPE_ALL:
229
+ return true;
230
+ case WpProQuiz_Model_Quiz::QUIZ_RUN_ONCE_TYPE_ONLY_USER:
231
+ return $userId > 0;
232
+ case WpProQuiz_Model_Quiz::QUIZ_RUN_ONCE_TYPE_ONLY_ANONYM:
233
+ return $userId == 0;
234
+ }
235
+ }
236
+
237
+ return false;
238
+ }
239
+
240
+ public function isLockQuiz($quizId) {
241
+ $lockMapper = new WpProQuiz_Model_LockMapper();
242
+ $quizMapper = new WpProQuiz_Model_QuizMapper();
243
+
244
+ $quiz = $quizMapper->fetch($this->_post['quizId']);
245
+
246
+ if($quiz === null || $quiz->getId() <= 0) {
247
+ return array('is' => true, 'pre' => true);
248
+ }
249
+
250
+ if($this->isPreLockQuiz($quiz)) {
251
+ $lockIp = $lockMapper->isLock($this->_post['quizId'], $this->getIp(), get_current_user_id(), WpProQuiz_Model_Lock::TYPE_QUIZ);
252
+ $lockCookie = false;
253
+ $cookieTime = $quiz->getQuizRunOnceTime();
254
+
255
+ if(isset($this->_cookie['wpProQuiz_lock']) && get_current_user_id() == 0 && $quiz->isQuizRunOnceCookie()) {
256
+ $cookieJson = json_decode($this->_cookie['wpProQuiz_lock'], true);
257
+
258
+ if($cookieJson !== false) {
259
+ if(isset($cookieJson[$this->_post['quizId']]) && $cookieJson[$this->_post['quizId']] == $cookieTime) {
260
+ $lockCookie = true;
261
+ }
262
+ }
263
+ }
264
+
265
+ return array('is' => ($lockIp || $lockCookie), 'pre' => true);
266
+ }
267
+
268
+ return array('is' => false, 'pre' => false);
269
+ }
270
+
271
+ private function getIp() {
272
+ if(get_current_user_id() > 0)
273
+ return '0';
274
+ else
275
+ return filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP);
276
+ }
277
  }
lib/controller/WpProQuiz_Controller_Statistics.php CHANGED
@@ -5,17 +5,66 @@ class WpProQuiz_Controller_Statistics extends WpProQuiz_Controller_Controller {
5
  $action = (isset($_GET['action'])) ? $_GET['action'] : 'show';
6
 
7
  switch ($action) {
 
 
 
8
  case 'reset':
9
  $this->reset($_GET['id']);
 
10
  case 'show':
11
  default:
12
  $this->show($_GET['id']);
13
  }
14
  }
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  private function reset($quizId) {
17
- $questionMapper = new WpProQuiz_Model_QuestionMapper();
18
- $questionMapper->resetStatistics($quizId);
 
 
 
 
 
 
 
19
  }
20
 
21
  private function show($quizId) {
@@ -25,7 +74,20 @@ class WpProQuiz_Controller_Statistics extends WpProQuiz_Controller_Controller {
25
 
26
  $view->quiz = $quizMapper->fetch($quizId);
27
  $view->question = $questionMapper->fetchAll($quizId);
 
 
 
 
28
 
 
 
 
 
 
 
 
 
 
29
  $view->show();
30
  }
31
 
@@ -35,37 +97,44 @@ class WpProQuiz_Controller_Statistics extends WpProQuiz_Controller_Controller {
35
  $lockIp = $this->getIp();
36
 
37
  if($lockIp === false)
38
- exit;
39
 
40
  $quizMapper = new WpProQuiz_Model_QuizMapper();
41
  $quiz = $quizMapper->fetch($quizId);
42
 
43
  if(!$quiz->isStatisticsOn())
44
- exit;
45
 
46
  if($quiz->getStatisticsIpLock() > 0) {
47
  $lockMapper = new WpProQuiz_Model_LockMapper();
 
48
 
49
- $lockMapper->deleteOldLock($quiz, time());
 
50
 
51
- if($lockMapper->isLock($quizId, $lockIp))
52
- exit;
53
 
54
  $lock = new WpProQuiz_Model_Lock();
55
- $lock->setQuizId($quizId)
56
- ->setLockIp($lockIp)
57
- ->setLockDate(time());
 
 
58
 
59
  $lockMapper->insert($lock);
60
  }
61
 
62
- $questionMapper = new WpProQuiz_Model_QuestionMapper();
63
- $questionMapper->updateStatistics($quizId, $array);
64
 
65
- exit;
66
  }
67
 
68
  private function getIp() {
69
- return filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP);
 
 
 
70
  }
71
  }
5
  $action = (isset($_GET['action'])) ? $_GET['action'] : 'show';
6
 
7
  switch ($action) {
8
+ case 'load_statistics':
9
+ $this->loadStatistics($_GET['id']);
10
+ break;
11
  case 'reset':
12
  $this->reset($_GET['id']);
13
+ break;
14
  case 'show':
15
  default:
16
  $this->show($_GET['id']);
17
  }
18
  }
19
 
20
+ private function loadStatistics($quizId) {
21
+ $questionMapper = new WpProQuiz_Model_StatisticMapper();
22
+ $questions = $questionMapper->fetchAll($quizId, $this->_post['userId']);
23
+
24
+ $data = array( 'global' => array('cCorrect' => 0, 'cIncorrect' => 0, 'pCorrect' => 0, 'pIncorrect' => 0, 'cTip' => 0),
25
+ 'items' => array());
26
+
27
+ $data['clear'] = $data['global'];
28
+
29
+ foreach($questions as $question) {
30
+ $sum = $question->getCorrectCount() + $question->getIncorrectCount();
31
+
32
+ $data['global']['cCorrect'] += $question->getCorrectCount();
33
+ $data['global']['cIncorrect'] += $question->getIncorrectCount();
34
+ $data['global']['cTip'] += $question->getHintCount();
35
+
36
+ $data['items'][] = array(
37
+ 'id' => $question->getQuestionId(),
38
+ 'cCorrect' => $question->getCorrectCount(),
39
+ 'cIncorrect' => $question->getIncorrectCount(),
40
+ 'cTip' => $question->getHintCount(),
41
+ 'pCorrect' => round((100 * $question->getCorrectCount() / $sum), 2),
42
+ 'pIncorrect' => round((100 * $question->getIncorrectCount() / $sum), 2),
43
+ );
44
+ }
45
+
46
+ $sum = $data['global']['cCorrect'] + $data['global']['cIncorrect'];
47
+
48
+ if($sum > 0) {
49
+ $data['global']['pCorrect'] = round((100 * $data['global']['cCorrect'] / $sum), 2);
50
+ $data['global']['pIncorrect'] = round((100 * $data['global']['cIncorrect'] / $sum), 2);
51
+ }
52
+
53
+ echo json_encode($data);
54
+
55
+ exit;
56
+ }
57
+
58
  private function reset($quizId) {
59
+ $statisticMapper = new WpProQuiz_Model_StatisticMapper();
60
+
61
+ if(isset($this->_post['complete']) && $this->_post['complete']) {
62
+ $statisticMapper->deleteByQuizId($quizId);
63
+ } else {
64
+ $statisticMapper->delete($quizId, $this->_post['userId']);
65
+ }
66
+
67
+ exit;
68
  }
69
 
70
  private function show($quizId) {
74
 
75
  $view->quiz = $quizMapper->fetch($quizId);
76
  $view->question = $questionMapper->fetchAll($quizId);
77
+
78
+
79
+ $users = get_users();
80
+ $userArray = array();
81
 
82
+ if(isset($users[0]->data)) {
83
+ foreach($users as $user) {
84
+ $userArray[] = $user->data;
85
+ }
86
+ } else {
87
+ $userArray = $users;
88
+ }
89
+
90
+ $view->users = $userArray;
91
  $view->show();
92
  }
93
 
97
  $lockIp = $this->getIp();
98
 
99
  if($lockIp === false)
100
+ return false;
101
 
102
  $quizMapper = new WpProQuiz_Model_QuizMapper();
103
  $quiz = $quizMapper->fetch($quizId);
104
 
105
  if(!$quiz->isStatisticsOn())
106
+ return false;
107
 
108
  if($quiz->getStatisticsIpLock() > 0) {
109
  $lockMapper = new WpProQuiz_Model_LockMapper();
110
+ $lockTime = $quiz->getStatisticsIpLock() * 60;
111
 
112
+
113
+ $lockMapper->deleteOldLock($lockTime, $quiz->getId(), time(), WpProQuiz_Model_Lock::TYPE_STATISTIC);
114
 
115
+ if($lockMapper->isLock($quizId, $lockIp, get_current_user_id(), WpProQuiz_Model_Lock::TYPE_STATISTIC))
116
+ return false;
117
 
118
  $lock = new WpProQuiz_Model_Lock();
119
+ $lock ->setQuizId($quizId)
120
+ ->setLockIp($lockIp)
121
+ ->setUserId(get_current_user_id())
122
+ ->setLockType(WpProQuiz_Model_Lock::TYPE_STATISTIC)
123
+ ->setLockDate(time());
124
 
125
  $lockMapper->insert($lock);
126
  }
127
 
128
+ $questionMapper = new WpProQuiz_Model_StatisticMapper();
129
+ $questionMapper->save($quizId, get_current_user_id(), $array);
130
 
131
+ return true;
132
  }
133
 
134
  private function getIp() {
135
+ if(get_current_user_id() > 0)
136
+ return '0';
137
+ else
138
+ return filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP);
139
  }
140
  }
lib/helper/WpProQuiz_Helper_DbUpgrade.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  class WpProQuiz_Helper_DbUpgrade {
3
 
4
- const WPPROQUIZ_DB_VERSION = 9;
5
 
6
  private $_wpdb;
7
  private $_prefix;
@@ -41,6 +41,7 @@ class WpProQuiz_Helper_DbUpgrade {
41
  $this->_wpdb->query('DROP TABLE IF EXISTS `'.$this->_wpdb->prefix.'wp_pro_quiz_master`');
42
  $this->_wpdb->query('DROP TABLE IF EXISTS `'.$this->_wpdb->prefix.'wp_pro_quiz_question`');
43
  $this->_wpdb->query('DROP TABLE IF EXISTS `'.$this->_wpdb->prefix.'wp_pro_quiz_lock`');
 
44
  }
45
 
46
  private function install() {
@@ -65,9 +66,12 @@ class WpProQuiz_Helper_DbUpgrade {
65
  `statistics_on` tinyint(1) NOT NULL,
66
  `statistics_ip_lock` int(10) unsigned NOT NULL,
67
  `show_points` tinyint(1) NOT NULL,
68
- PRIMARY KEY (`id`)
 
 
 
 
69
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
70
-
71
  ');
72
 
73
  $this->_wpdb->query('
@@ -88,8 +92,8 @@ class WpProQuiz_Helper_DbUpgrade {
88
  `tip_count` int(11) NOT NULL,
89
  `answer_type` varchar(50) NOT NULL,
90
  `answer_json` text NOT NULL,
91
- PRIMARY KEY (`id`),
92
- KEY `quiz_id` (`quiz_id`)
93
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
94
  ');
95
 
@@ -97,8 +101,22 @@ class WpProQuiz_Helper_DbUpgrade {
97
  CREATE TABLE IF NOT EXISTS `'.$this->_wpdb->prefix.'wp_pro_quiz_lock` (
98
  `quiz_id` int(11) NOT NULL,
99
  `lock_ip` varchar(100) NOT NULL,
 
 
100
  `lock_date` int(11) NOT NULL,
101
- PRIMARY KEY (`quiz_id`,`lock_ip`)
 
 
 
 
 
 
 
 
 
 
 
 
102
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
103
  ');
104
  }
@@ -256,11 +274,86 @@ class WpProQuiz_Helper_DbUpgrade {
256
  private function upgradeDbV8() {
257
 
258
  $this->_wpdb->query('
259
- ALTER TABLE `wp_wp_pro_quiz_master`
260
  ADD `btn_restart_quiz_hidden` TINYINT( 1 ) NOT NULL AFTER `title_hidden` ,
261
  ADD `btn_view_question_hidden` TINYINT( 1 ) NOT NULL AFTER `btn_restart_quiz_hidden`
262
  ');
263
 
264
  return 9;
265
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
266
  }
1
  <?php
2
  class WpProQuiz_Helper_DbUpgrade {
3
 
4
+ const WPPROQUIZ_DB_VERSION = 10;
5
 
6
  private $_wpdb;
7
  private $_prefix;
41
  $this->_wpdb->query('DROP TABLE IF EXISTS `'.$this->_wpdb->prefix.'wp_pro_quiz_master`');
42
  $this->_wpdb->query('DROP TABLE IF EXISTS `'.$this->_wpdb->prefix.'wp_pro_quiz_question`');
43
  $this->_wpdb->query('DROP TABLE IF EXISTS `'.$this->_wpdb->prefix.'wp_pro_quiz_lock`');
44
+ $this->_wpdb->query('DROP TABLE IF EXISTS `'.$this->_wpdb->prefix.'wp_pro_quiz_statistic`');
45
  }
46
 
47
  private function install() {
66
  `statistics_on` tinyint(1) NOT NULL,
67
  `statistics_ip_lock` int(10) unsigned NOT NULL,
68
  `show_points` tinyint(1) NOT NULL,
69
+ `quiz_run_once` tinyint(1) NOT NULL,
70
+ `quiz_run_once_type` tinyint(4) NOT NULL,
71
+ `quiz_run_once_cookie` tinyint(1) NOT NULL,
72
+ `quiz_run_once_time` int(10) unsigned NOT NULL,
73
+ PRIMARY KEY (`id`)
74
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
75
  ');
76
 
77
  $this->_wpdb->query('
92
  `tip_count` int(11) NOT NULL,
93
  `answer_type` varchar(50) NOT NULL,
94
  `answer_json` text NOT NULL,
95
+ PRIMARY KEY (`id`),
96
+ KEY `quiz_id` (`quiz_id`)
97
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
98
  ');
99
 
101
  CREATE TABLE IF NOT EXISTS `'.$this->_wpdb->prefix.'wp_pro_quiz_lock` (
102
  `quiz_id` int(11) NOT NULL,
103
  `lock_ip` varchar(100) NOT NULL,
104
+ `user_id` bigint(20) unsigned NOT NULL,
105
+ `lock_type` tinyint(3) unsigned NOT NULL,
106
  `lock_date` int(11) NOT NULL,
107
+ PRIMARY KEY (`quiz_id`,`lock_ip`,`user_id`,`lock_type`)
108
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
109
+ ');
110
+
111
+ $this->_wpdb->query('
112
+ CREATE TABLE IF NOT EXISTS `'.$this->_wpdb->prefix.'wp_pro_quiz_statistic` (
113
+ `quiz_id` int(11) NOT NULL,
114
+ `question_id` int(11) NOT NULL,
115
+ `user_id` bigint(20) unsigned NOT NULL,
116
+ `correct_count` int(10) unsigned NOT NULL,
117
+ `incorrect_count` int(10) unsigned NOT NULL,
118
+ `hint_count` int(10) unsigned NOT NULL,
119
+ PRIMARY KEY (`quiz_id`,`question_id`,`user_id`)
120
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
121
  ');
122
  }
274
  private function upgradeDbV8() {
275
 
276
  $this->_wpdb->query('
277
+ ALTER TABLE `'.$this->_wpdb->prefix.'wp_pro_quiz_master`
278
  ADD `btn_restart_quiz_hidden` TINYINT( 1 ) NOT NULL AFTER `title_hidden` ,
279
  ADD `btn_view_question_hidden` TINYINT( 1 ) NOT NULL AFTER `btn_restart_quiz_hidden`
280
  ');
281
 
282
  return 9;
283
  }
284
+
285
+ private function upgradeFixDbV8() {
286
+ if($this->_wpdb->prefix != 'wp_') {
287
+ $this->_wpdb->query('SELECT * FROM `'.$this->_wpdb->prefix.'wp_pro_quiz_master` LIMIT 0,1');
288
+
289
+ $names = $this->_wpdb->get_col_info('name');
290
+
291
+ if(!in_array('btn_restart_quiz_hidden', $names)) {
292
+ $this->_wpdb->query('
293
+ ALTER TABLE `'.$this->_wpdb->prefix.'wp_pro_quiz_master`
294
+ ADD `btn_restart_quiz_hidden` TINYINT( 1 ) NOT NULL AFTER `title_hidden`
295
+ ');
296
+ }
297
+
298
+ if(!in_array('btn_view_question_hidden', $names)) {
299
+ $this->_wpdb->query('
300
+ ALTER TABLE `'.$this->_wpdb->prefix.'wp_pro_quiz_master`
301
+ ADD `btn_view_question_hidden` TINYINT( 1 ) NOT NULL AFTER `btn_restart_quiz_hidden`
302
+ ');
303
+ }
304
+ }
305
+ }
306
+
307
+ private function upgradeDbV9() {
308
+
309
+ $this->upgradeFixDbV8();
310
+
311
+ $this->_wpdb->query('
312
+ TRUNCATE `'.$this->_wpdb->prefix.'wp_pro_quiz_lock`
313
+ ');
314
+
315
+ $this->_wpdb->query('
316
+ ALTER TABLE `'.$this->_wpdb->prefix.'wp_pro_quiz_lock`
317
+ ADD `user_id` BIGINT UNSIGNED NOT NULL AFTER `lock_ip` ,
318
+ ADD `lock_type` TINYINT UNSIGNED NOT NULL AFTER `user_id`
319
+ ');
320
+
321
+ $this->_wpdb->query('
322
+ ALTER TABLE `'.$this->_wpdb->prefix.'wp_pro_quiz_lock`
323
+ DROP PRIMARY KEY ,
324
+ ADD PRIMARY KEY ( `quiz_id` , `lock_ip` , `user_id` , `lock_type` )
325
+ ');
326
+
327
+ $this->_wpdb->query('
328
+ ALTER TABLE `'.$this->_wpdb->prefix.'wp_pro_quiz_master`
329
+ ADD `quiz_run_once` TINYINT( 1 ) NOT NULL ,
330
+ ADD `quiz_run_once_type` TINYINT NOT NULL ,
331
+ ADD `quiz_run_once_cookie` TINYINT( 1 ) NOT NULL ,
332
+ ADD `quiz_run_once_time` INT UNSIGNED NOT NULL
333
+ ');
334
+
335
+ $this->_wpdb->query('
336
+ CREATE TABLE IF NOT EXISTS `'.$this->_wpdb->prefix.'wp_pro_quiz_statistic` (
337
+ `quiz_id` int(11) NOT NULL,
338
+ `question_id` int(11) NOT NULL,
339
+ `user_id` bigint(20) unsigned NOT NULL,
340
+ `correct_count` int(10) unsigned NOT NULL,
341
+ `incorrect_count` int(10) unsigned NOT NULL,
342
+ `hint_count` int(10) unsigned NOT NULL,
343
+ PRIMARY KEY (`quiz_id`,`question_id`,`user_id`)
344
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
345
+ ');
346
+
347
+ $this->_wpdb->query('
348
+ INSERT INTO `'.$this->_wpdb->prefix.'wp_pro_quiz_statistic` (quiz_id, question_id, user_id, correct_count, incorrect_count, hint_count)
349
+ SELECT
350
+ question.quiz_id, id, 0, question.correct_count, question.incorrect_count, tip_count
351
+ FROM
352
+ `'.$this->_wpdb->prefix.'wp_pro_quiz_question` as question
353
+ WHERE
354
+ question.correct_count > 0 OR question.incorrect_count > 0 OR tip_count > 0
355
+ ');
356
+
357
+ return 10;
358
+ }
359
  }
lib/model/WpProQuiz_Model_GlobalSettings.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class WpProQuiz_Model_GlobalSettings extends WpProQuiz_Model_Model {
3
+
4
+ protected $_addRawShortcode = false;
5
+ protected $_jsLoadInHead = false;
6
+ protected $_touchLibraryDeactivate = false;
7
+
8
+ public function setAddRawShortcode($_addRawShortcode) {
9
+ $this->_addRawShortcode = (bool)$_addRawShortcode;
10
+ return $this;
11
+ }
12
+
13
+ public function isAddRawShortcode() {
14
+ return $this->_addRawShortcode;
15
+ }
16
+
17
+ public function setJsLoadInHead($_jsLoadInHead) {
18
+ $this->_jsLoadInHead = (bool)$_jsLoadInHead;
19
+ return $this;
20
+ }
21
+
22
+ public function isJsLoadInHead() {
23
+ return $this->_jsLoadInHead;
24
+ }
25
+
26
+ public function setTouchLibraryDeactivate($_touchLibraryDeactivate) {
27
+ $this->_touchLibraryDeactivate = (bool)$_touchLibraryDeactivate;
28
+ return $this;
29
+ }
30
+
31
+ public function isTouchLibraryDeactivate() {
32
+ return $this->_touchLibraryDeactivate;
33
+ }
34
+ }
lib/model/WpProQuiz_Model_GlobalSettingsMapper.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class WpProQuiz_Model_GlobalSettingsMapper extends WpProQuiz_Model_Mapper {
3
+
4
+ public function fetchAll() {
5
+ $s = new WpProQuiz_Model_GlobalSettings();
6
+
7
+ $s->setAddRawShortcode(get_option('wpProQuiz_addRawShortcode'))
8
+ ->setJsLoadInHead(get_option('wpProQuiz_jsLoadInHead'))
9
+ ->setTouchLibraryDeactivate(get_option('wpProQuiz_touchLibraryDeactivate'));
10
+
11
+ return $s;
12
+ }
13
+
14
+ public function save(WpProQuiz_Model_GlobalSettings $settings) {
15
+
16
+ if(add_option('wpProQuiz_addRawShortcode', $settings->isAddRawShortcode()) === false) {
17
+ update_option('wpProQuiz_addRawShortcode', $settings->isAddRawShortcode());
18
+ }
19
+
20
+ if(add_option('wpProQuiz_jsLoadInHead', $settings->isJsLoadInHead()) === false) {
21
+ update_option('wpProQuiz_jsLoadInHead', $settings->isJsLoadInHead());
22
+ }
23
+
24
+ if(add_option('wpProQuiz_touchLibraryDeactivate', $settings->isTouchLibraryDeactivate()) === false) {
25
+ update_option('wpProQuiz_touchLibraryDeactivate', $settings->isTouchLibraryDeactivate());
26
+ }
27
+ }
28
+
29
+ public function delete() {
30
+ delete_option('wpProQuiz_addRawShortcode');
31
+ delete_option('wpProQuiz_jsLoadInHead');
32
+ delete_option('wpProQuiz_touchLibraryDeactivate');
33
+ }
34
+ }
lib/model/WpProQuiz_Model_Lock.php CHANGED
@@ -3,6 +3,11 @@ class WpProQuiz_Model_Lock extends WpProQuiz_Model_Model {
3
  protected $_quizId;
4
  protected $_lockIp;
5
  protected $_lockDate;
 
 
 
 
 
6
 
7
  public function setQuizId($_quizId) {
8
  $this->_quizId = $_quizId;
@@ -30,4 +35,22 @@ class WpProQuiz_Model_Lock extends WpProQuiz_Model_Model {
30
  public function getLockDate() {
31
  return $this->_lockDate;
32
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  }
3
  protected $_quizId;
4
  protected $_lockIp;
5
  protected $_lockDate;
6
+ protected $_userId;
7
+ protected $_lockType;
8
+
9
+ const TYPE_STATISTIC = 1;
10
+ const TYPE_QUIZ = 2;
11
 
12
  public function setQuizId($_quizId) {
13
  $this->_quizId = $_quizId;
35
  public function getLockDate() {
36
  return $this->_lockDate;
37
  }
38
+
39
+ public function setUserId($_userId) {
40
+ $this->_userId = (int)$_userId;
41
+ return $this;
42
+ }
43
+
44
+ public function getUserId() {
45
+ return $this->_userId;
46
+ }
47
+
48
+ public function setLockType($_lockType) {
49
+ $this->_lockType = (int)$_lockType;
50
+ return $this;
51
+ }
52
+
53
+ public function getLockType() {
54
+ return $this->_lockType;
55
+ }
56
  }
lib/model/WpProQuiz_Model_LockMapper.php CHANGED
@@ -13,12 +13,15 @@ class WpProQuiz_Model_LockMapper extends WpProQuiz_Model_Mapper {
13
  $this->_wpdb->insert($this->_table, array(
14
  'quiz_id' => $lock->getQuizId(),
15
  'lock_ip' => $lock->getLockIp(),
16
- 'lock_date' => $lock->getLockDate()
 
 
 
17
  ),
18
- array('%d', '%s', '%d'));
19
  }
20
 
21
- public function fetch($quizId, $lockIp) {
22
  $row = $this->_wpdb->get_row(
23
  $this->_wpdb->prepare(
24
  "SELECT
@@ -28,26 +31,23 @@ class WpProQuiz_Model_LockMapper extends WpProQuiz_Model_Mapper {
28
  WHERE
29
  quiz_id = %d
30
  AND
31
- lock_ip = %s",
32
- $quizId, $lockIp)
 
 
33
  );
34
 
35
  if($row === null)
36
  return null;
37
 
38
- $model = new WpProQuiz_Model_Lock();
39
- $model->setQuizId($row->quiz_id)
40
- ->setLockIp($row->lock_id)
41
- ->setLockDate($row->lock_date);
42
-
43
- return $model;
44
  }
45
 
46
- public function isLock($quizId, $lockIp) {
47
  $c = $this->_wpdb->get_var(
48
  $this->_wpdb->prepare(
49
  "SELECT COUNT(*) FROM {$this->_table}
50
- WHERE quiz_id = %d AND lock_ip = %s", $quizId, $lockIp));
51
 
52
  if($c === null || $c == 0)
53
  return false;
@@ -55,18 +55,35 @@ class WpProQuiz_Model_LockMapper extends WpProQuiz_Model_Mapper {
55
  return true;
56
  }
57
 
58
- public function deleteOldLock(WpProQuiz_Model_Quiz $quiz, $time) {
59
- $lockTime = $quiz->getStatisticsIpLock() * 60;
60
 
 
 
 
61
  return $this->_wpdb->query(
62
  $this->_wpdb->prepare(
63
  "DELETE FROM {$this->_table}
64
  WHERE
65
- quiz_id = %d AND (lock_date + %d) < %d",
66
- $quiz->getId(),
67
  $lockTime,
68
- $time
 
69
  )
70
  );
71
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  }
13
  $this->_wpdb->insert($this->_table, array(
14
  'quiz_id' => $lock->getQuizId(),
15
  'lock_ip' => $lock->getLockIp(),
16
+ 'user_id' => $lock->getUserId(),
17
+ 'lock_type' => $lock->getLockType(),
18
+ 'lock_date' => $lock->getLockDate(),
19
+ 'lock_type' => $lock->getLockType()
20
  ),
21
+ array('%d', '%s', '%d', '%d', '%d', '%d'));
22
  }
23
 
24
+ public function fetch($quizId, $lockIp, $userId) {
25
  $row = $this->_wpdb->get_row(
26
  $this->_wpdb->prepare(
27
  "SELECT
31
  WHERE
32
  quiz_id = %d
33
  AND
34
+ lock_ip = %s
35
+ AND
36
+ user_id = %d",
37
+ $quizId, $lockIp, $userId)
38
  );
39
 
40
  if($row === null)
41
  return null;
42
 
43
+ return new WpProQuiz_Model_Lock($row);
 
 
 
 
 
44
  }
45
 
46
+ public function isLock($quizId, $lockIp, $userId, $type) {
47
  $c = $this->_wpdb->get_var(
48
  $this->_wpdb->prepare(
49
  "SELECT COUNT(*) FROM {$this->_table}
50
+ WHERE quiz_id = %d AND lock_ip = %s AND user_id = %d AND lock_type = %d", $quizId, $lockIp, $userId, $type));
51
 
52
  if($c === null || $c == 0)
53
  return false;
55
  return true;
56
  }
57
 
58
+ public function deleteOldLock($lockTime, $quizId, $time, $type, $userId = false) {
59
+ $user = '';
60
 
61
+ if($userId !== false) {
62
+ $user = 'AND user_id = '.((int) $userId);
63
+ }
64
  return $this->_wpdb->query(
65
  $this->_wpdb->prepare(
66
  "DELETE FROM {$this->_table}
67
  WHERE
68
+ quiz_id = %d AND (lock_date + %d) < %d AND lock_type = %d ".$user,
69
+ $quizId,
70
  $lockTime,
71
+ $time,
72
+ $type
73
  )
74
  );
75
  }
76
+
77
+ public function deleteByQuizId($quizId, $type = false) {
78
+
79
+ $where = array('quiz_id' => $quizId);
80
+ $whereP = array('%d');
81
+
82
+ if($type !== false) {
83
+ $where = array('quiz_id' => $quizId, 'lock_type' => $type);
84
+ $whereP = array('%d', '%d');
85
+ }
86
+
87
+ return $this->_wpdb->delete($this->_tableLock, $where, $whereP);
88
+ }
89
  }
lib/model/WpProQuiz_Model_Mapper.php CHANGED
@@ -16,6 +16,8 @@ class WpProQuiz_Model_Mapper {
16
  */
17
  protected $_tableQuestion;
18
  protected $_tableMaster;
 
 
19
 
20
 
21
  function __construct() {
@@ -26,5 +28,7 @@ class WpProQuiz_Model_Mapper {
26
 
27
  $this->_tableQuestion = $this->_prefix.'question';
28
  $this->_tableMaster = $this->_prefix.'master';
 
 
29
  }
30
  }
16
  */
17
  protected $_tableQuestion;
18
  protected $_tableMaster;
19
+ protected $_tableLock;
20
+ protected $_tableStatistic;
21
 
22
 
23
  function __construct() {
28
 
29
  $this->_tableQuestion = $this->_prefix.'question';
30
  $this->_tableMaster = $this->_prefix.'master';
31
+ $this->_tableLock = $this->_prefix.'lock';
32
+ $this->_tableStatistic = $this->_prefix.'statistic';
33
  }
34
  }
lib/model/WpProQuiz_Model_QuestionMapper.php CHANGED
@@ -12,6 +12,10 @@ class WpProQuiz_Model_QuestionMapper extends WpProQuiz_Model_Mapper {
12
  $this->_wpdb->delete($this->_table, array('id' => $id), '%d');
13
  }
14
 
 
 
 
 
15
  public function updateSort($id, $sort) {
16
  $this->_wpdb->update(
17
  $this->_table,
@@ -65,6 +69,7 @@ class WpProQuiz_Model_QuestionMapper extends WpProQuiz_Model_Mapper {
65
  }
66
 
67
  public function fetch($id) {
 
68
  $row = $this->_wpdb->get_row(
69
  $this->_wpdb->prepare(
70
  "SELECT
@@ -80,21 +85,36 @@ class WpProQuiz_Model_QuestionMapper extends WpProQuiz_Model_Mapper {
80
  $row['answer_json'] = json_decode($row['answer_json'], true);
81
 
82
  $model = new WpProQuiz_Model_Question($row);
 
 
 
 
 
83
 
84
- // $model = new WpProQuiz_Model_Question();
85
- // $model ->setId($row->id)
86
- // ->setQuizId($row->quiz_id)
87
- // ->setTitle($row->title)
88
- // ->setQuestion($row->question)
89
- // ->setCorrectMsg($row->correct_msg)
90
- // ->setIncorrectMsg($row->incorrect_msg)
91
- // ->setAnswerType($row->answer_type)
92
- // ->setAnswerJson(json_decode($row->answer_json, true))
93
- // ->setCorrectCount($row->correct_count)
94
- // ->setIncorrectCount($row->incorrect_count)
95
- // ->setSort($row->sort);
96
 
97
- return $model;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  }
99
 
100
  public function fetchAll($quizId) {
12
  $this->_wpdb->delete($this->_table, array('id' => $id), '%d');
13
  }
14
 
15
+ public function deleteByQuizId($id) {
16
+ $this->_wpdb->delete($this->_table, array('quiz_id' => $id), '%d');
17
+ }
18
+
19
  public function updateSort($id, $sort) {
20
  $this->_wpdb->update(
21
  $this->_table,
69
  }
70
 
71
  public function fetch($id) {
72
+
73
  $row = $this->_wpdb->get_row(
74
  $this->_wpdb->prepare(
75
  "SELECT
85
  $row['answer_json'] = json_decode($row['answer_json'], true);
86
 
87
  $model = new WpProQuiz_Model_Question($row);
88
+
89
+ return $model;
90
+ }
91
+
92
+ public function fetchById($id) {
93
 
94
+ $ids = array_map('intval', (array)$id);
95
+ $a = array();
 
 
 
 
 
 
 
 
 
 
96
 
97
+ if(empty($ids))
98
+ return null;
99
+
100
+ $results = $this->_wpdb->get_results(
101
+ "SELECT
102
+ *
103
+ FROM
104
+ ". $this->_table. "
105
+ WHERE
106
+ id IN(".implode(', ', $ids).")",
107
+ ARRAY_A
108
+ );
109
+
110
+ foreach ($results as $row) {
111
+ $row['answer_json'] = json_decode($row['answer_json'], true);
112
+
113
+ $a[] = new WpProQuiz_Model_Question($row);
114
+
115
+ }
116
+
117
+ return is_array($id) ? $a : (isset($a[0]) ? $a[0] : null);
118
  }
119
 
120
  public function fetchAll($quizId) {
lib/model/WpProQuiz_Model_Quiz.php CHANGED
@@ -1,6 +1,10 @@
1
  <?php
2
  class WpProQuiz_Model_Quiz extends WpProQuiz_Model_Model {
3
 
 
 
 
 
4
  protected $_id;
5
  protected $_name;
6
  protected $_text;
@@ -17,6 +21,10 @@ class WpProQuiz_Model_Quiz extends WpProQuiz_Model_Model {
17
  protected $_statisticsIpLock;
18
  protected $_resultGradeEnabled = false;
19
  protected $_showPoints = false;
 
 
 
 
20
 
21
  public function getId() {
22
  return $this->_id;
@@ -173,4 +181,40 @@ class WpProQuiz_Model_Quiz extends WpProQuiz_Model_Model {
173
  public function isBtnViewQuestionHidden() {
174
  return $this->_btnViewQuestionHidden;
175
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
  }
1
  <?php
2
  class WpProQuiz_Model_Quiz extends WpProQuiz_Model_Model {
3
 
4
+ const QUIZ_RUN_ONCE_TYPE_ALL = 1;
5
+ const QUIZ_RUN_ONCE_TYPE_ONLY_USER = 2;
6
+ const QUIZ_RUN_ONCE_TYPE_ONLY_ANONYM = 3;
7
+
8
  protected $_id;
9
  protected $_name;
10
  protected $_text;
21
  protected $_statisticsIpLock;
22
  protected $_resultGradeEnabled = false;
23
  protected $_showPoints = false;
24
+ protected $_quizRunOnce = false;
25
+ protected $_quizRunOnceType = 0;
26
+ protected $_quizRunOnceCookie = false;
27
+ protected $_quizRunOnceTime = 0;
28
 
29
  public function getId() {
30
  return $this->_id;
181
  public function isBtnViewQuestionHidden() {
182
  return $this->_btnViewQuestionHidden;
183
  }
184
+
185
+ public function setQuizRunOnce($_quizRunOnce) {
186
+ $this->_quizRunOnce = (bool)$_quizRunOnce;
187
+ return $this;
188
+ }
189
+
190
+ public function isQuizRunOnce() {
191
+ return $this->_quizRunOnce;
192
+ }
193
+
194
+ public function setQuizRunOnceCookie($_quizRunOnceCookie) {
195
+ $this->_quizRunOnceCookie = (bool)$_quizRunOnceCookie;
196
+ return $this;
197
+ }
198
+
199
+ public function isQuizRunOnceCookie() {
200
+ return $this->_quizRunOnceCookie;
201
+ }
202
+
203
+ public function setQuizRunOnceType($_quizRunOnceType) {
204
+ $this->_quizRunOnceType = (int)$_quizRunOnceType;
205
+ return $this;
206
+ }
207
+
208
+ public function getQuizRunOnceType() {
209
+ return $this->_quizRunOnceType;
210
+ }
211
+
212
+ public function setQuizRunOnceTime($_quizRunOnceTime) {
213
+ $this->_quizRunOnceTime = (int)$_quizRunOnceTime;
214
+ return $this;
215
+ }
216
+
217
+ public function getQuizRunOnceTime() {
218
+ return $this->_quizRunOnceTime;
219
+ }
220
  }
lib/model/WpProQuiz_Model_QuizMapper.php CHANGED
@@ -77,7 +77,11 @@ class WpProQuiz_Model_QuizMapper extends WpProQuiz_Model_Mapper
77
  'statistics_on' => (int)$data->isStatisticsOn(),
78
  'statistics_ip_lock' => (int)$data->getStatisticsIpLock(),
79
  'result_grade_enabled' => (int)$data->isResultGradeEnabled(),
80
- 'show_points' => (int)$data->isShowPoints()
 
 
 
 
81
  );
82
 
83
  if($data->getId() != 0) {
@@ -86,13 +90,13 @@ class WpProQuiz_Model_QuizMapper extends WpProQuiz_Model_Mapper
86
  array(
87
  'id' => $data->getId()
88
  ),
89
- array('%s', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d'),
90
  array('%d'));
91
  } else {
92
 
93
  $result = $this->_wpdb->insert($this->_table,
94
  $set,
95
- array('%s', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d'));
96
 
97
  $data->setId($this->_wpdb->insert_id);
98
  }
77
  'statistics_on' => (int)$data->isStatisticsOn(),
78
  'statistics_ip_lock' => (int)$data->getStatisticsIpLock(),
79
  'result_grade_enabled' => (int)$data->isResultGradeEnabled(),
80
+ 'show_points' => (int)$data->isShowPoints(),
81
+ 'quiz_run_once' => (int)$data->isQuizRunOnce(),
82
+ 'quiz_run_once_type' => $data->getQuizRunOnceType(),
83
+ 'quiz_run_once_cookie' => (int)$data->isQuizRunOnceCookie(),
84
+ 'quiz_run_once_time' => (int)$data->getQuizRunOnceTime()
85
  );
86
 
87
  if($data->getId() != 0) {
90
  array(
91
  'id' => $data->getId()
92
  ),
93
+ array('%s', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d'),
94
  array('%d'));
95
  } else {
96
 
97
  $result = $this->_wpdb->insert($this->_table,
98
  $set,
99
+ array('%s', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d'));
100
 
101
  $data->setId($this->_wpdb->insert_id);
102
  }
lib/model/WpProQuiz_Model_Statistic.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class WpProQuiz_Model_Statistic extends WpProQuiz_Model_Model {
3
+ protected $_quizId;
4
+ protected $_questionId;
5
+ protected $_userId;
6
+ protected $_correctCount;
7
+ protected $_incorrectCount;
8
+ protected $_hintCout;
9
+
10
+ public function setQuizId($_quizId) {
11
+ $this->_quizId = $_quizId;
12
+ return $this;
13
+ }
14
+
15
+ public function getQuizId() {
16
+ return $this->_quizId;
17
+ }
18
+
19
+ public function setQuestionId($_questionId) {
20
+ $this->_questionId = $_questionId;
21
+ return $this;
22
+ }
23
+
24
+ public function getQuestionId() {
25
+ return $this->_questionId;
26
+ }
27
+
28
+ public function setUserId($_userId) {
29
+ $this->_userId = $_userId;
30
+ return $this;
31
+ }
32
+
33
+ public function getUserId() {
34
+ return $this->_userId;
35
+ }
36
+
37
+ public function setCorrectCount($_correctCount) {
38
+ $this->_correctCount = $_correctCount;
39
+ return $this;
40
+ }
41
+
42
+ public function getCorrectCount() {
43
+ return (int)$this->_correctCount;
44
+ }
45
+
46
+ public function setIncorrectCount($_incorrectCount) {
47
+ $this->_incorrectCount = $_incorrectCount;
48
+ return $this;
49
+ }
50
+
51
+ public function getIncorrectCount() {
52
+ return (int)$this->_incorrectCount;
53
+ }
54
+
55
+ public function setHintCount($_hintCout) {
56
+ $this->_hintCout = $_hintCout;
57
+ return $this;
58
+ }
59
+
60
+ public function getHintCount() {
61
+ return (int)$this->_hintCout;
62
+ }
63
+ }
lib/model/WpProQuiz_Model_StatisticMapper.php ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class WpProQuiz_Model_StatisticMapper extends WpProQuiz_Model_Mapper {
3
+
4
+ private $_table;
5
+
6
+ public function __construct() {
7
+ parent::__construct();
8
+
9
+ $this->_table = $this->_prefix.'statistic';
10
+ }
11
+
12
+ public function fetch($quizId, $questionId, $userId) {
13
+
14
+ }
15
+
16
+ public function fetchAll($quizId, $userId) {
17
+ $a = array();
18
+
19
+ $results = $this->_wpdb->get_results(
20
+ $this->_wpdb->prepare(
21
+ 'SELECT
22
+ *
23
+ FROM
24
+ '. $this->_table.'
25
+ WHERE
26
+ quiz_id = %d AND
27
+ user_id = %d', $quizId, $userId),
28
+ ARRAY_A);
29
+
30
+ foreach($results as $row) {
31
+ $a[] = new WpProQuiz_Model_Statistic($row);
32
+ }
33
+
34
+ return $a;
35
+ }
36
+
37
+ public function delete($quizId, $userId) {
38
+ $this->_wpdb->delete($this->_table, array(
39
+ 'quiz_id' => $quizId,
40
+ 'user_id' => $userId
41
+ ), array('%d', '%d'));
42
+ }
43
+
44
+ /**
45
+ * @deprecated
46
+ */
47
+ public function deleteByQuiz($quizId) {
48
+ $this->deleteByQuizId($quizId);
49
+ }
50
+
51
+ public function deleteByQuizId($quizId) {
52
+ return $this->_wpdb->delete($this->_tableStatistic, array('quiz_id' => $quizId), array('%d'));
53
+ }
54
+
55
+ public function deleteByQuestionId($questionId) {
56
+ return $this->_wpdb->delete($this->_tableStatistic, array('question_id' => $questionId), array('%d'));
57
+ }
58
+
59
+ public function save($quizId, $userId, $array) {
60
+ $ids = $this->_wpdb->get_col($this->_wpdb->prepare("SELECT id FROM {$this->_tableQuestion} WHERE quiz_id = %d", $quizId));
61
+
62
+ $ak = array_keys($array);
63
+
64
+ if(array_diff($ids, $ak) !== array_diff($ak, $ids))
65
+ return false;
66
+
67
+ $values = array();
68
+ $globalValue = array(
69
+ 'quiz_id' => $quizId,
70
+ 'question_id' => 0,
71
+ 'user_id' => $userId,
72
+ 'correct_count' => 0,
73
+ 'incorrect_count' => 0,
74
+ 'hint_count' => 0
75
+ );
76
+
77
+ foreach($array as $k => $v) {
78
+
79
+ $value = $globalValue;
80
+
81
+ $value['question_id'] = $k;
82
+
83
+ if(isset($v['tip'])) {
84
+ $value['hint_count'] = 1;
85
+ }
86
+
87
+ if($v['correct']) {
88
+ $value['correct_count'] = 1;
89
+ } else {
90
+ $value['incorrect_count'] = 1;
91
+ }
92
+
93
+ $values[] = '('.implode(', ', $value).')';
94
+ }
95
+
96
+ $this->_wpdb->query(
97
+ 'INSERT INTO
98
+ '.$this->_tableStatistic.' ('.implode(', ', array_keys($globalValue)).')
99
+ VALUES
100
+ '.implode(', ', $values).'
101
+ ON DUPLICATE KEY UPDATE
102
+ correct_count = correct_count + VALUES(correct_count),
103
+ incorrect_count = incorrect_count + VALUES(incorrect_count),
104
+ hint_count = hint_count + VALUES(hint_count)'
105
+ );
106
+ }
107
+ }
lib/view/WpProQuiz_View_FrontQuiz.php CHANGED
@@ -53,7 +53,7 @@ class WpProQuiz_View_FrontQuiz extends WpProQuiz_View_View {
53
  }
54
 
55
  $resultsProzent = json_encode($result['prozent']);
56
-
57
  ?>
58
 
59
  <div class="wpProQuiz_content" id="wpProQuiz_<?php echo $this->quiz->getId(); ?>">
@@ -68,13 +68,18 @@ class WpProQuiz_View_FrontQuiz extends WpProQuiz_View_View {
68
  <input type="button" value="<?php _e('Start quiz', 'wp-pro-quiz'); ?>" name="startQuiz">
69
  </div>
70
  </div>
 
 
 
 
 
71
  <div style="display: none;" 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" style="display: none;">
80
  <?php _e('Time has elapsed', 'wp-pro-quiz'); ?>
@@ -261,7 +266,8 @@ jQuery(document).ready(function($) {
261
  checkAnswer: <?php echo (int)$this->quiz->isCheckAnswer(); ?>,
262
  backButton: <?php echo (int)$this->quiz->isBackButton();?>,
263
  quizId: <?php echo (int)$this->quiz->getId(); ?>,
264
- statisticsOn: <?php echo $preview ? 0 : (int)$this->quiz->isStatisticsOn(); ?>,
 
265
  url: '<?php echo admin_url('admin-ajax.php'); ?>',
266
  resultsGrade: <?php echo $resultsProzent; ?>,
267
  json: <?php echo $json; ?>
53
  }
54
 
55
  $resultsProzent = json_encode($result['prozent']);
56
+
57
  ?>
58
 
59
  <div class="wpProQuiz_content" id="wpProQuiz_<?php echo $this->quiz->getId(); ?>">
68
  <input type="button" value="<?php _e('Start quiz', 'wp-pro-quiz'); ?>" name="startQuiz">
69
  </div>
70
  </div>
71
+ <div style="display: none;" class="wpProQuiz_lock">
72
+ <p style="font-weight: bold;">
73
+ <?php _e('You have already completed the quiz before. Hence you can not start it again.', 'wp-pro-quiz'); ?>
74
+ </p>
75
+ </div>
76
  <div style="display: none;" class="wpProQuiz_results">
77
  <h3><?php _e('Results', 'wp-pro-quiz'); ?></h3>
78
  <p>
79
  <?php printf(__('%s of %s questions answered correctly', 'wp-pro-quiz'), '<span class="wpProQuiz_correct_answer"></span>', '<span>'.$question_count.'</span>'); ?>
80
  </p>
81
  <p class="wpProQuiz_quiz_time">
82
+ <?php _e('Your time: <span></span>', 'wp-pro-quiz'); ?>
83
  </p>
84
  <p class="wpProQuiz_time_limit_expired" style="display: none;">
85
  <?php _e('Time has elapsed', 'wp-pro-quiz'); ?>
266
  checkAnswer: <?php echo (int)$this->quiz->isCheckAnswer(); ?>,
267
  backButton: <?php echo (int)$this->quiz->isBackButton();?>,
268
  quizId: <?php echo (int)$this->quiz->getId(); ?>,
269
+ lock: <?php echo (int)$this->quiz->isQuizRunOnce(); ?>,
270
+ preview: <?php echo ($preview) ? 1 : 0; ?>,
271
  url: '<?php echo admin_url('admin-ajax.php'); ?>',
272
  resultsGrade: <?php echo $resultsProzent; ?>,
273
  json: <?php echo $json; ?>
lib/view/WpProQuiz_View_GobalSettings.php ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class WpProQuiz_View_GobalSettings extends WpProQuiz_View_View {
3
+
4
+ public function show() {
5
+
6
+ if($this->isRaw) {
7
+ $rawSystem = __('to activate', 'wp-pro-quiz');
8
+ } else {
9
+ $rawSystem = __('not to activate', 'wp-pro-quiz');
10
+ }
11
+
12
+ ?>
13
+ <div class="wrap">
14
+ <h2 style="margin-bottom: 10px;"><?php _e('Settings in case of problems', 'wp-pro-quiz'); ?></h2>
15
+ <div class="updated">
16
+ <h3><?php _e('Please note', 'wp-pro-quiz'); ?></h3>
17
+ <p>
18
+ <?php _e('These settings should only be set in cases of problems with Wp-Pro-Quiz.', 'wp-pro-quiz'); ?>
19
+ </p>
20
+ </div>
21
+ <a class="button-secondary" href="admin.php?page=wpProQuiz"><?php _e('back to overview', 'wp-pro-quiz'); ?></a>
22
+ <form method="post">
23
+ <div id="poststuff">
24
+ <div class="postbox">
25
+ <h3 class="hndle"><?php _e('Settings in case of problems', 'wp-pro-quiz'); ?></h3>
26
+ <div class="wrap">
27
+ <table class="form-table">
28
+ <tbody>
29
+ <tr>
30
+ <th scope="row">
31
+ <?php _e('Automatically add [raw] shortcode', 'wp-pro-quiz'); ?>
32
+ </th>
33
+ <td>
34
+ <fieldset>
35
+ <legend class="screen-reader-text">
36
+ <span><?php _e('Automatically add [raw] shortcode', 'wp-pro-quiz'); ?></span>
37
+ </legend>
38
+ <label>
39
+ <input type="checkbox" value="1" name="addRawShortcode" <?php echo $this->settings->isAddRawShortcode() ? 'checked="checked"' : '' ?> >
40
+ <?php _e('Activate', 'wp-pro-quiz'); ?> <span class="description">( <?php printf(__('It is recommended %s this option on your system.', 'wp-pro-quiz'), '<span style=" font-weight: bold;">'.$rawSystem.'</span>'); ?> )</span>
41
+ </label>
42
+ <p class="description">
43
+ <?php _e('If this option is activated, a [raw] shortcode is automatically set around WpProQuiz shortcode ( [WpProQuiz X] ) into [raw] [WpProQuiz X] [/raw]', 'wp-pro-quiz'); ?>
44
+ </p>
45
+ <p class="description">
46
+ <?php _e('Own themes changes internal order of filters, what causes the problems. With additional shortcode [raw] this is prevented.', 'wp-pro-quiz'); ?>
47
+ </p>
48
+ </fieldset>
49
+ </td>
50
+ </tr>
51
+ <tr>
52
+ <th scope="row">
53
+ <?php _e('Do not load the Javascript-files in the footer', 'wp-pro-quiz'); ?>
54
+ </th>
55
+ <td>
56
+ <fieldset>
57
+ <legend class="screen-reader-text">
58
+ <span><?php _e('Do not load the Javascript-files in the footer', 'wp-pro-quiz'); ?></span>
59
+ </legend>
60
+ <label>
61
+ <input type="checkbox" value="1" name="jsLoadInHead" <?php echo $this->settings->isJsLoadInHead() ? 'checked="checked"' : '' ?> >
62
+ <?php _e('Activate', 'wp-pro-quiz'); ?>
63
+ </label>
64
+ <p class="description">
65
+ <?php _e('Generally all WpProQuiz-Javascript files are loaded in the footer and only when they are really needed.', 'wp-pro-quiz'); ?>
66
+ </p>
67
+ <p class="description">
68
+ <?php _e('In very old Wordpress themes this can lead to problems.', 'wp-pro-quiz'); ?>
69
+ </p>
70
+ <p class="description">
71
+ <?php _e('If you activate this option, all WpProQuiz-Javascript files are loaded in the header even if they are not needed.', 'wp-pro-quiz'); ?>
72
+ </p>
73
+ <p class="description">
74
+ <?php printf(__('Anyone who wants to learn more about this topic should read through the following websites %s and %s.', 'wp-pro-quiz'),
75
+ '<a href="http://codex.wordpress.org/Theme_Development#Footer_.28footer.php.29" target="_blank">Theme Development</a>',
76
+ '<a href="http://codex.wordpress.org/Function_Reference/wp_footer" target="_blank">Function Reference/wp footer</a>'); ?>
77
+ </p>
78
+ </fieldset>
79
+ </td>
80
+ </tr>
81
+ <tr>
82
+ <th scope="row">
83
+ <?php _e('Touch Library', 'wp-pro-quiz'); ?>
84
+ </th>
85
+ <td>
86
+ <fieldset>
87
+ <legend class="screen-reader-text">
88
+ <span><?php _e('Touch Library', 'wp-pro-quiz'); ?></span>
89
+ </legend>
90
+ <label>
91
+ <input type="checkbox" value="1" name="touchLibraryDeactivate" <?php echo $this->settings->isTouchLibraryDeactivate() ? 'checked="checked"' : '' ?> >
92
+ <?php _e('Deactivate', 'wp-pro-quiz'); ?>
93
+ </label>
94
+ <p class="description">
95
+ <?php _e('In Version 0.13 a new Touch Library was added for mobile devices.', 'wp-pro-quiz'); ?>
96
+ </p>
97
+ <p class="description">
98
+ <?php _e('If you have any problems with the Touch Library, please deactivate it.', 'wp-pro-quiz'); ?>
99
+ </p>
100
+ </fieldset>
101
+ </td>
102
+ </tr>
103
+ </tbody>
104
+ </table>
105
+ </div>
106
+ </div>
107
+ <input type="submit" name="submit" class="button-primary" id="wpProQuiz_save" value="<?php _e('Save', 'wp-pro-quiz'); ?>">
108
+ </div>
109
+ </form>
110
+ </div>
111
+
112
+ <?php
113
+ }
114
+ }
lib/view/WpProQuiz_View_QuestionOverall.php CHANGED
@@ -3,6 +3,15 @@ class WpProQuiz_View_QuestionOverall extends WpProQuiz_View_View {
3
 
4
  public function show() {
5
  ?>
 
 
 
 
 
 
 
 
 
6
  <div class="wrap wpProQuiz_questionOverall">
7
  <h2>Quiz: <?php echo $this->quiz->getName(); ?></h2>
8
  <div id="sortMsg" class="updated" style="display: none;"><p><strong><?php _e('Questions sorted', 'wp-pro-quiz'); ?></strong></p></div>
@@ -35,7 +44,26 @@ class WpProQuiz_View_QuestionOverall extends WpProQuiz_View_View {
35
  <p>
36
  <a class="button-secondary" href="admin.php?page=wpProQuiz&module=question&action=add&quiz_id=<?php echo $this->quiz->getId(); ?>"><?php _e('Add question', 'wp-pro-quiz'); ?></a>
37
  <a class="button-secondary" href="#" id="wpProQuiz_saveSort"><?php _e('Save order', 'wp-pro-quiz'); ?></a>
 
38
  </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  </div>
40
  <?php
41
  }
3
 
4
  public function show() {
5
  ?>
6
+ <style>
7
+ .wpProQuiz_questionCopy {
8
+ padding: 20px;
9
+ background-color: rgb(223, 238, 255);
10
+ border: 1px dotted;
11
+ margin-top: 10px;
12
+ display: none;
13
+ }
14
+ </style>
15
  <div class="wrap wpProQuiz_questionOverall">
16
  <h2>Quiz: <?php echo $this->quiz->getName(); ?></h2>
17
  <div id="sortMsg" class="updated" style="display: none;"><p><strong><?php _e('Questions sorted', 'wp-pro-quiz'); ?></strong></p></div>
44
  <p>
45
  <a class="button-secondary" href="admin.php?page=wpProQuiz&module=question&action=add&quiz_id=<?php echo $this->quiz->getId(); ?>"><?php _e('Add question', 'wp-pro-quiz'); ?></a>
46
  <a class="button-secondary" href="#" id="wpProQuiz_saveSort"><?php _e('Save order', 'wp-pro-quiz'); ?></a>
47
+ <a class="button-secondary" href="#" id="wpProQuiz_questionCopy"><?php _e('Copy questions from another Quiz', 'wp-pro-quiz'); ?></a>
48
  </p>
49
+ <div class="wpProQuiz_questionCopy">
50
+ <form action="admin.php?page=wpProQuiz&module=question&quiz_id=<?php echo $this->quiz->getId(); ?>&action=copy_question" method="POST">
51
+ <h3 style="margin-top: 0;"><?php _e('Copy questions from another Quiz', 'wp-pro-quiz'); ?></h3>
52
+ <p><?php echo __('Here you can copy questions from another quiz into this quiz. (Multiple selection enabled)', 'wp-pro-quiz'); ?></p>
53
+
54
+ <div style="padding: 20px; display: none;" id="loadDataImg">
55
+ <img alt="load" src="data:image/gif;base64,R0lGODlhEAAQAPYAAP///wAAANTU1JSUlGBgYEBAQERERG5ubqKiotzc3KSkpCQkJCgoKDAwMDY2Nj4+Pmpqarq6uhwcHHJycuzs7O7u7sLCwoqKilBQUF5eXr6+vtDQ0Do6OhYWFoyMjKqqqlxcXHx8fOLi4oaGhg4ODmhoaJycnGZmZra2tkZGRgoKCrCwsJaWlhgYGAYGBujo6PT09Hh4eISEhPb29oKCgqioqPr6+vz8/MDAwMrKyvj4+NbW1q6urvDw8NLS0uTk5N7e3s7OzsbGxry8vODg4NjY2PLy8tra2np6erS0tLKyskxMTFJSUlpaWmJiYkJCQjw8PMTExHZ2djIyMurq6ioqKo6OjlhYWCwsLB4eHqCgoE5OThISEoiIiGRkZDQ0NMjIyMzMzObm5ri4uH5+fpKSkp6enlZWVpCQkEpKSkhISCIiIqamphAQEAwMDKysrAQEBJqamiYmJhQUFDg4OHR0dC4uLggICHBwcCAgIFRUVGxsbICAgAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAEAAQAAAHjYAAgoOEhYUbIykthoUIHCQqLoI2OjeFCgsdJSsvgjcwPTaDAgYSHoY2FBSWAAMLE4wAPT89ggQMEbEzQD+CBQ0UsQA7RYIGDhWxN0E+ggcPFrEUQjuCCAYXsT5DRIIJEBgfhjsrFkaDERkgJhswMwk4CDzdhBohJwcxNB4sPAmMIlCwkOGhRo5gwhIGAgAh+QQJCgAAACwAAAAAEAAQAAAHjIAAgoOEhYU7A1dYDFtdG4YAPBhVC1ktXCRfJoVKT1NIERRUSl4qXIRHBFCbhTKFCgYjkII3g0hLUbMAOjaCBEw9ukZGgidNxLMUFYIXTkGzOmLLAEkQCLNUQMEAPxdSGoYvAkS9gjkyNEkJOjovRWAb04NBJlYsWh9KQ2FUkFQ5SWqsEJIAhq6DAAIBACH5BAkKAAAALAAAAAAQABAAAAeJgACCg4SFhQkKE2kGXiwChgBDB0sGDw4NDGpshTheZ2hRFRVDUmsMCIMiZE48hmgtUBuCYxBmkAAQbV2CLBM+t0puaoIySDC3VC4tgh40M7eFNRdH0IRgZUO3NjqDFB9mv4U6Pc+DRzUfQVQ3NzAULxU2hUBDKENCQTtAL9yGRgkbcvggEq9atUAAIfkECQoAAAAsAAAAABAAEAAAB4+AAIKDhIWFPygeEE4hbEeGADkXBycZZ1tqTkqFQSNIbBtGPUJdD088g1QmMjiGZl9MO4I5ViiQAEgMA4JKLAm3EWtXgmxmOrcUElWCb2zHkFQdcoIWPGK3Sm1LgkcoPrdOKiOCRmA4IpBwDUGDL2A5IjCCN/QAcYUURQIJIlQ9MzZu6aAgRgwFGAFvKRwUCAAh+QQJCgAAACwAAAAAEAAQAAAHjIAAgoOEhYUUYW9lHiYRP4YACStxZRc0SBMyFoVEPAoWQDMzAgolEBqDRjg8O4ZKIBNAgkBjG5AAZVtsgj44VLdCanWCYUI3txUPS7xBx5AVDgazAjC3Q3ZeghUJv5B1cgOCNmI/1YUeWSkCgzNUFDODKydzCwqFNkYwOoIubnQIt244MzDC1q2DggIBACH5BAkKAAAALAAAAAAQABAAAAeJgACCg4SFhTBAOSgrEUEUhgBUQThjSh8IcQo+hRUbYEdUNjoiGlZWQYM2QD4vhkI0ZWKCPQmtkG9SEYJURDOQAD4HaLuyv0ZeB4IVj8ZNJ4IwRje/QkxkgjYz05BdamyDN9uFJg9OR4YEK1RUYzFTT0qGdnduXC1Zchg8kEEjaQsMzpTZ8avgoEAAIfkECQoAAAAsAAAAABAAEAAAB4iAAIKDhIWFNz0/Oz47IjCGADpURAkCQUI4USKFNhUvFTMANxU7KElAhDA9OoZHH0oVgjczrJBRZkGyNpCCRCw8vIUzHmXBhDM0HoIGLsCQAjEmgjIqXrxaBxGCGw5cF4Y8TnybglprLXhjFBUWVnpeOIUIT3lydg4PantDz2UZDwYOIEhgzFggACH5BAkKAAAALAAAAAAQABAAAAeLgACCg4SFhjc6RhUVRjaGgzYzRhRiREQ9hSaGOhRFOxSDQQ0uj1RBPjOCIypOjwAJFkSCSyQrrhRDOYILXFSuNkpjggwtvo86H7YAZ1korkRaEYJlC3WuESxBggJLWHGGFhcIxgBvUHQyUT1GQWwhFxuFKyBPakxNXgceYY9HCDEZTlxA8cOVwUGBAAA7AAAAAAAAAAAA">
56
+ <?php echo __('Loading', 'wp-pro-quiz'); ?>
57
+ </div>
58
+
59
+ <div style="padding: 10px;">
60
+ <select name="copyIds[]" size="15" multiple="multiple" style="min-width: 200px; display: none;" id="questionCopySelect">
61
+ </select>
62
+ </div>
63
+
64
+ <input class="button-primary" name="questionCopy" value="<?php echo __('Copy questions', 'wp-pro-quiz'); ?>" type="submit">
65
+ </form>
66
+ </div>
67
  </div>
68
  <?php
69
  }
lib/view/WpProQuiz_View_QuizEdit.php CHANGED
@@ -30,6 +30,7 @@ class WpProQuiz_View_QuizEdit extends WpProQuiz_View_View {
30
  </legend>
31
  <label for="title_hidden">
32
  <input type="checkbox" id="title_hidden" value="1" name="titleHidden" <?php echo $this->quiz->isTitleHidden() ? 'checked="checked"' : '' ?> >
 
33
  </label>
34
  <p class="description">
35
  <?php _e('The title serves as quiz heading.', 'wp-pro-quiz'); ?>
@@ -48,6 +49,7 @@ class WpProQuiz_View_QuizEdit extends WpProQuiz_View_View {
48
  </legend>
49
  <label for="btn_restart_quiz_hidden">
50
  <input type="checkbox" id="btn_restart_quiz_hidden" value="1" name="btnRestartQuizHidden" <?php echo $this->quiz->isBtnRestartQuizHidden() ? 'checked="checked"' : '' ?> >
 
51
  </label>
52
  <p class="description">
53
  <?php _e('Hide the "Restart quiz" button in the Frontend.', 'wp-pro-quiz'); ?>
@@ -66,6 +68,7 @@ class WpProQuiz_View_QuizEdit extends WpProQuiz_View_View {
66
  </legend>
67
  <label for="btn_view_question_hidden">
68
  <input type="checkbox" id="btn_view_question_hidden" value="1" name="btnViewQuestionHidden" <?php echo $this->quiz->isBtnViewQuestionHidden() ? 'checked="checked"' : '' ?> >
 
69
  </label>
70
  <p class="description">
71
  <?php _e('Hide the "View question" button in the Frontend.', 'wp-pro-quiz'); ?>
@@ -84,6 +87,7 @@ class WpProQuiz_View_QuizEdit extends WpProQuiz_View_View {
84
  </legend>
85
  <label for="show_points">
86
  <input type="checkbox" id="show_points" value="1" name="showPoints" <?php echo $this->quiz->isShowPoints() ? 'checked="checked"' : '' ?> >
 
87
  </label>
88
  <p class="description">
89
  <?php _e('Shows in quiz, how many points are reachable for respective question.', 'wp-pro-quiz'); ?>
@@ -102,6 +106,7 @@ class WpProQuiz_View_QuizEdit extends WpProQuiz_View_View {
102
  </legend>
103
  <label for="question_random">
104
  <input type="checkbox" id="question_random" value="1" name="questionRandom" <?php echo $this->quiz->isQuestionRandom() ? 'checked="checked"' : '' ?> >
 
105
  </label>
106
  </fieldset>
107
  </td>
@@ -117,6 +122,7 @@ class WpProQuiz_View_QuizEdit extends WpProQuiz_View_View {
117
  </legend>
118
  <label for="answer_random">
119
  <input type="checkbox" id="answer_random" value="1" name="answerRandom" <?php echo $this->quiz->isAnswerRandom() ? 'checked="checked"' : '' ?> >
 
120
  </label>
121
  </fieldset>
122
  </td>
@@ -149,7 +155,8 @@ class WpProQuiz_View_QuizEdit extends WpProQuiz_View_View {
149
  <span><?php _e('Check -> continue', 'wp-pro-quiz'); ?></span>
150
  </legend>
151
  <label for="check_next">
152
- <input type="checkbox" id="check_next" value="1" name="checkAnswer" <?php echo $this->quiz->isCheckAnswer() ? 'checked="checked"' : '' ?>>
 
153
  </label>
154
  <p class="description">
155
  <?php _e('Show "right or wrong" after the question. Otherwise the solutions will be displayed at the end.', 'wp-pro-quiz'); ?>
@@ -168,6 +175,7 @@ class WpProQuiz_View_QuizEdit extends WpProQuiz_View_View {
168
  </legend>
169
  <label for="back_button">
170
  <input type="checkbox" id="back_button" value="1" name="backButton" <?php echo $this->quiz->isBackButton() ? 'checked="checked"' : '' ?>>
 
171
  </label>
172
  <p class="description">
173
  <?php _e('Allow to use back button in a question. (Option will be ignored if "Check -> Continue" was used)', 'wp-pro-quiz'); ?>
@@ -186,7 +194,7 @@ class WpProQuiz_View_QuizEdit extends WpProQuiz_View_View {
186
  </legend>
187
  <label for="statistics_on">
188
  <input type="checkbox" id="statistics_on" value="1" name="statisticsOn" <?php echo $this->quiz->isStatisticsOn() ? 'checked="checked"' : '' ?>>
189
- <?php _e('activate', 'wp-pro-quiz'); ?>
190
  </label>
191
  <p class="description">
192
  <?php _e('Statistics about right or wrong answers. Statistics will be saved by completed quiz, not after every question. The statistics is only visible over administration menu. (internal statistics)', 'wp-pro-quiz'); ?>
@@ -213,6 +221,66 @@ class WpProQuiz_View_QuizEdit extends WpProQuiz_View_View {
213
  </fieldset>
214
  </td>
215
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
216
  </tbody>
217
  </table>
218
  </div>
30
  </legend>
31
  <label for="title_hidden">
32
  <input type="checkbox" id="title_hidden" value="1" name="titleHidden" <?php echo $this->quiz->isTitleHidden() ? 'checked="checked"' : '' ?> >
33
+ <?php _e('Activate', 'wp-pro-quiz'); ?>
34
  </label>
35
  <p class="description">
36
  <?php _e('The title serves as quiz heading.', 'wp-pro-quiz'); ?>
49
  </legend>
50
  <label for="btn_restart_quiz_hidden">
51
  <input type="checkbox" id="btn_restart_quiz_hidden" value="1" name="btnRestartQuizHidden" <?php echo $this->quiz->isBtnRestartQuizHidden() ? 'checked="checked"' : '' ?> >
52
+ <?php _e('Activate', 'wp-pro-quiz'); ?>
53
  </label>
54
  <p class="description">
55
  <?php _e('Hide the "Restart quiz" button in the Frontend.', 'wp-pro-quiz'); ?>
68
  </legend>
69
  <label for="btn_view_question_hidden">
70
  <input type="checkbox" id="btn_view_question_hidden" value="1" name="btnViewQuestionHidden" <?php echo $this->quiz->isBtnViewQuestionHidden() ? 'checked="checked"' : '' ?> >
71
+ <?php _e('Activate', 'wp-pro-quiz'); ?>
72
  </label>
73
  <p class="description">
74
  <?php _e('Hide the "View question" button in the Frontend.', 'wp-pro-quiz'); ?>
87
  </legend>
88
  <label for="show_points">
89
  <input type="checkbox" id="show_points" value="1" name="showPoints" <?php echo $this->quiz->isShowPoints() ? 'checked="checked"' : '' ?> >
90
+ <?php _e('Activate', 'wp-pro-quiz'); ?>
91
  </label>
92
  <p class="description">
93
  <?php _e('Shows in quiz, how many points are reachable for respective question.', 'wp-pro-quiz'); ?>
106
  </legend>
107
  <label for="question_random">
108
  <input type="checkbox" id="question_random" value="1" name="questionRandom" <?php echo $this->quiz->isQuestionRandom() ? 'checked="checked"' : '' ?> >
109
+ <?php _e('Activate', 'wp-pro-quiz'); ?>
110
  </label>
111
  </fieldset>
112
  </td>
122
  </legend>
123
  <label for="answer_random">
124
  <input type="checkbox" id="answer_random" value="1" name="answerRandom" <?php echo $this->quiz->isAnswerRandom() ? 'checked="checked"' : '' ?> >
125
+ <?php _e('Activate', 'wp-pro-quiz'); ?>
126
  </label>
127
  </fieldset>
128
  </td>
155
  <span><?php _e('Check -> continue', 'wp-pro-quiz'); ?></span>
156
  </legend>
157
  <label for="check_next">
158
+ <input type="checkbox" id="check_next" value="1" name="checkAnswer" <?php echo $this->quiz->isCheckAnswer() ? 'checked="checked"' : '' ?>>
159
+ <?php _e('Activate', 'wp-pro-quiz'); ?>
160
  </label>
161
  <p class="description">
162
  <?php _e('Show "right or wrong" after the question. Otherwise the solutions will be displayed at the end.', 'wp-pro-quiz'); ?>
175
  </legend>
176
  <label for="back_button">
177
  <input type="checkbox" id="back_button" value="1" name="backButton" <?php echo $this->quiz->isBackButton() ? 'checked="checked"' : '' ?>>
178
+ <?php _e('Activate', 'wp-pro-quiz'); ?>
179
  </label>
180
  <p class="description">
181
  <?php _e('Allow to use back button in a question. (Option will be ignored if "Check -> Continue" was used)', 'wp-pro-quiz'); ?>
194
  </legend>
195
  <label for="statistics_on">
196
  <input type="checkbox" id="statistics_on" value="1" name="statisticsOn" <?php echo $this->quiz->isStatisticsOn() ? 'checked="checked"' : '' ?>>
197
+ <?php _e('Activate', 'wp-pro-quiz'); ?>
198
  </label>
199
  <p class="description">
200
  <?php _e('Statistics about right or wrong answers. Statistics will be saved by completed quiz, not after every question. The statistics is only visible over administration menu. (internal statistics)', 'wp-pro-quiz'); ?>
221
  </fieldset>
222
  </td>
223
  </tr>
224
+ <tr>
225
+ <th scope="row">
226
+ <?php _e('Execute quiz only once', 'wp-pro-quiz'); ?>
227
+ </th>
228
+ <td>
229
+ <fieldset>
230
+
231
+ <legend class="screen-reader-text">
232
+ <span><?php _e('Execute quiz only once', 'wp-pro-quiz'); ?></span>
233
+ </legend>
234
+
235
+ <label>
236
+ <input type="checkbox" value="1" name="quizRunOnce" <?php echo $this->quiz->isQuizRunOnce() ? 'checked="checked"' : '' ?>>
237
+ <?php _e('Activate', 'wp-pro-quiz'); ?>
238
+ </label>
239
+ <p class="description">
240
+ <?php _e('If you activate this option, the user can complete the quiz only once. Afterwards the quiz is blocked for this user.'); ?>
241
+ </p>
242
+
243
+ <div id="wpProQuiz_quiz_run_once_type" style="margin-bottom: 5px; display: none;">
244
+ <?php _e('This option applies to:', 'wp-pro-quiz');
245
+
246
+ $quizRunOnceType = $this->quiz->getQuizRunOnceType();
247
+ $quizRunOnceType = ($quizRunOnceType == 0) ? 1: $quizRunOnceType;
248
+
249
+ ?>
250
+ <label>
251
+ <input name="quizRunOnceType" type="radio" value="1" <?php echo ($quizRunOnceType == 1) ? 'checked="checked"' : ''; ?>>
252
+ <?php _e('all users', 'wp-pro-quiz'); ?>
253
+ </label>
254
+ <label>
255
+ <input name="quizRunOnceType" type="radio" value="2" <?php echo ($quizRunOnceType == 2) ? 'checked="checked"' : ''; ?>>
256
+ <?php _e('registered useres only', 'wp-pro-quiz'); ?>
257
+ </label>
258
+ <label>
259
+ <input name="quizRunOnceType" type="radio" value="3" <?php echo ($quizRunOnceType == 3) ? 'checked="checked"' : ''; ?>>
260
+ <?php _e('anonymous users only', 'wp-pro-quiz'); ?>
261
+ </label>
262
+
263
+ <div id="wpProQuiz_quiz_run_once_cookie" style="margin-top: 10px;">
264
+ <label>
265
+ <input type="checkbox" value="1" name="quizRunOnceCookie" <?php echo $this->quiz->isQuizRunOnceCookie() ? 'checked="checked"' : '' ?>>
266
+ <?php _e('user identification by cookie', 'wp-pro-quiz'); ?>
267
+ </label>
268
+ <p class="description">
269
+ <?php _e('If you activate this option, a cookie is set additionally for unregistrated (anonymous) users. This ensures a longer assignment of the user than the simple assignment by the IP address.'); ?>
270
+ </p>
271
+ </div>
272
+
273
+ <div style="margin-top: 15px;">
274
+ <input class="button-secondary" type="button" name="resetQuizLock" value="<?php _e('Reset the user identification', 'wp-pro-quiz'); ?>">
275
+ <span id="resetLockMsg" style="display:none; background-color: rgb(255, 255, 173); border: 1px solid rgb(143, 143, 143); padding: 4px; margin-left: 5px; "><?php _e('User identification has been reset.'); ?></span>
276
+ <p class="description">
277
+ <?php _e('Resets user identification for all users.'); ?>
278
+ </p>
279
+ </div>
280
+ </div>
281
+ </fieldset>
282
+ </td>
283
+ </tr>
284
  </tbody>
285
  </table>
286
  </div>
lib/view/WpProQuiz_View_QuizOverall.php CHANGED
@@ -30,7 +30,7 @@ class WpProQuiz_View_QuizOverall extends WpProQuiz_View_View {
30
  </style>
31
  <div class="wrap wpProQuiz_quizOverall">
32
  <h2><?php _e('Quiz overview', 'wp-pro-quiz'); ?></h2>
33
- <div class="updated">
34
  <h3><?php _e('In case of problems', 'wp-pro-quiz'); ?></h3>
35
  <p>
36
  <?php _e('If quiz doesn\'t work in front-end, please try following:', 'wp-pro-quiz'); ?>
@@ -42,6 +42,9 @@ class WpProQuiz_View_QuizOverall extends WpProQuiz_View_View {
42
  <?php _e('Own themes changes internal order of filters, what causes the problems. With additional shortcode [raw] this is prevented.', 'wp-pro-quiz'); ?>
43
  </p>
44
  </div>
 
 
 
45
  <table class="wp-list-table widefat">
46
  <thead>
47
  <tr>
@@ -98,7 +101,7 @@ class WpProQuiz_View_QuizOverall extends WpProQuiz_View_View {
98
  $memoryLimit = (int)(ini_get('memory_limit'));
99
  $uploadMB = min($maxUpload, $maxPost, $memoryLimit);
100
  ?>
101
- <input type="file" name="import" accept="*application/octet-stream, .wpq" required="required"> <?php printf(__('Maximal %d MiB', 'wp-pro-quiz'), $uploadMB); ?>
102
  </div>
103
  <input class="button-primary" name="exportStart" id="exportStart" value="<?php echo __('Start import', 'wp-pro-quiz'); ?>" type="submit">
104
  </form>
30
  </style>
31
  <div class="wrap wpProQuiz_quizOverall">
32
  <h2><?php _e('Quiz overview', 'wp-pro-quiz'); ?></h2>
33
+ <div class="updated" style="display: none;">
34
  <h3><?php _e('In case of problems', 'wp-pro-quiz'); ?></h3>
35
  <p>
36
  <?php _e('If quiz doesn\'t work in front-end, please try following:', 'wp-pro-quiz'); ?>
42
  <?php _e('Own themes changes internal order of filters, what causes the problems. With additional shortcode [raw] this is prevented.', 'wp-pro-quiz'); ?>
43
  </p>
44
  </div>
45
+ <div style="margin: 8px 0px;">
46
+ <a class="button-primary" style="font-weight: bold;" href="admin.php?page=wpProQuiz&module=globalSettings"><?php _e('Settings in case of problems', 'wp-pro-quiz'); ?></a>
47
+ </div>
48
  <table class="wp-list-table widefat">
49
  <thead>
50
  <tr>
101
  $memoryLimit = (int)(ini_get('memory_limit'));
102
  $uploadMB = min($maxUpload, $maxPost, $memoryLimit);
103
  ?>
104
+ <input type="file" name="import" accept=".wpq" required="required"> <?php printf(__('Maximal %d MiB', 'wp-pro-quiz'), $uploadMB); ?>
105
  </div>
106
  <input class="button-primary" name="exportStart" id="exportStart" value="<?php echo __('Start import', 'wp-pro-quiz'); ?>" type="submit">
107
  </form>
lib/view/WpProQuiz_View_Statistics.php CHANGED
@@ -3,6 +3,16 @@ class WpProQuiz_View_Statistics extends WpProQuiz_View_View {
3
 
4
  public function show() {
5
  ?>
 
 
 
 
 
 
 
 
 
 
6
  <div class="wrap wpProQuiz_statistics">
7
  <h2><?php printf(__('Quiz: %s - Statistics', 'wp-pro-quiz'), $this->quiz->getName()); ?></h2>
8
  <p><a class="button-secondary" href="admin.php?page=wpProQuiz"><?php _e('back to overview', 'wp-pro-quiz'); ?></a></p>
@@ -12,59 +22,84 @@ class WpProQuiz_View_Statistics extends WpProQuiz_View_View {
12
  <a class="button-secondary" href="admin.php?page=wpProQuiz&action=edit&id=<?php echo $this->quiz->getId(); ?>"><?php _e('Activate statistics', 'wp-pro-quiz'); ?></a>
13
  </p>
14
  <?php return; } ?>
15
- <table class="wp-list-table widefat">
16
- <thead>
17
- <tr>
18
- <th scope="col" style="width: 50px;"></th>
19
- <th scope="col"><?php _e('Question', 'wp-pro-quiz'); ?></th>
20
- <th scope="col" style="width: 100px;"><?php _e('Incorrect', 'wp-pro-quiz'); ?></th>
21
- <th scope="col" style="width: 100px;"><?php _e('Correct', 'wp-pro-quiz'); ?></th>
22
- <th scope="col" style="width: 100px;"><?php _e('Hints used', 'wp-pro-quiz'); ?></th>
23
- </tr>
24
- </thead>
25
- <tbody>
26
- <?php
27
-
28
- $index = 1;
29
- $gCount = 0;
30
- $gIncorrectCount = 0;
31
- $gCorrectCount = 0;
32
- $gTipCount = 0;
 
 
 
 
33
 
34
- foreach($this->question as $question) {
35
- $count = $question->getCorrectCount() + $question->getIncorrectCount();
36
- $p = $count / 100;
37
- $correctP = ($count > 0) ? (100 * $question->getCorrectCount() / $count) : 0;
38
- $incorrectP = ($count > 0) ? (100 * $question->getIncorrectCount() / $count) : 0;
39
- $gCount += $count;
40
- $gIncorrectCount += $question->getIncorrectCount();
41
- $gCorrectCount += $question->getCorrectCount();
42
- $gTipCount += $question->getTipCount();
43
- ?>
44
- <tr>
45
- <th><?php echo $index++; ?></th>
46
- <th><?php echo $question->getTitle(); ?></th>
47
- <th style="color: red;"><?php echo $question->getIncorrectCount().' ('.round($incorrectP, 2).'%)'; ?></th>
48
- <th style="color: green;"><?php echo $question->getCorrectCount().' ('.round($correctP, 2).'%)'; ?></th>
49
- <th><?php echo $question->getTipCount(); ?></th>
50
- </tr>
51
- <?php } ?>
52
- </tbody>
53
- <tfoot>
54
  <?php
55
- $gCorrectP = ($gCount > 0) ? (100 * $gCorrectCount / $gCount) : 0;
56
- $gIncorrectP = ($gCount > 0) ? (100 * $gIncorrectCount / $gCount) : 0;
 
 
57
  ?>
58
- <th></th>
59
- <th><?php _e('Total', 'wp-pro-quiz'); ?></th>
60
- <th style="color: red;"><?php echo $gIncorrectCount.' ('.round($gIncorrectP, 2).'%)'; ?></th>
61
- <th style="color: green;"><?php echo $gCorrectCount.' ('.round($gCorrectP, 2).'%)'; ?></th>
62
- <th><?php echo $gTipCount; ?></th>
63
- </tfoot>
64
- </table>
65
- <p>
66
- <a class="button-secondary" href="admin.php?page=wpProQuiz&module=statistics&action=reset&id=<?php echo $this->quiz->getId(); ?>"><?php _e('Reset statistics', 'wp-pro-quiz'); ?></a>
67
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  </div>
69
 
70
  <?php
3
 
4
  public function show() {
5
  ?>
6
+
7
+ <style>
8
+ .wpProQuiz_blueBox {
9
+ padding: 20px;
10
+ background-color: rgb(223, 238, 255);
11
+ border: 1px dotted;
12
+ margin-top: 10px;
13
+ }
14
+ </style>
15
+
16
  <div class="wrap wpProQuiz_statistics">
17
  <h2><?php printf(__('Quiz: %s - Statistics', 'wp-pro-quiz'), $this->quiz->getName()); ?></h2>
18
  <p><a class="button-secondary" href="admin.php?page=wpProQuiz"><?php _e('back to overview', 'wp-pro-quiz'); ?></a></p>
22
  <a class="button-secondary" href="admin.php?page=wpProQuiz&action=edit&id=<?php echo $this->quiz->getId(); ?>"><?php _e('Activate statistics', 'wp-pro-quiz'); ?></a>
23
  </p>
24
  <?php return; } ?>
25
+
26
+ <div style="padding: 10px 0px;">
27
+ <a class="button-primary wpProQuiz_tab" id="wpProQuiz_typeAnonymeUser" href="#"><?php _e('Anonymous users', 'wp-pro-quiz'); ?></a>
28
+ <a class="button-secondary wpProQuiz_tab" id="wpProQuiz_typeRegisteredUser" href="#"><?php _e('Registered useres', 'wp-pro-quiz'); ?></a>
29
+ <a class="button-secondary wpProQuiz_tab" id="wpProQuiz_typeOverview" style="display: none;" href="#"><?php _e('Overview', 'wp-pro-quiz'); ?></a>
30
+ </div>
31
+
32
+ <div class="wpProQuiz_blueBox" id="wpProQuiz_userBox" style="margin-bottom: 20px; display: none;">
33
+ <span>
34
+ <?php _e('Please select user name:', 'wp-pro-quiz'); ?>
35
+ <select name="userSelect" id="userSelect">
36
+ <?php foreach($this->users as $user) {
37
+ echo '<option value="', $user->ID, '">', $user->user_nicename, ' (', $user->display_name, ')</option>';
38
+ } ?>
39
+ </select>
40
+ </span>
41
+ </div>
42
+
43
+ <div id="wpProQuiz_loadData" class="wpProQuiz_blueBox" style="background-color: #F8F5A8;">
44
+ <img alt="load" src="data:image/gif;base64,R0lGODlhEAAQAPYAAP///wAAANTU1JSUlGBgYEBAQERERG5ubqKiotzc3KSkpCQkJCgoKDAwMDY2Nj4+Pmpqarq6uhwcHHJycuzs7O7u7sLCwoqKilBQUF5eXr6+vtDQ0Do6OhYWFoyMjKqqqlxcXHx8fOLi4oaGhg4ODmhoaJycnGZmZra2tkZGRgoKCrCwsJaWlhgYGAYGBujo6PT09Hh4eISEhPb29oKCgqioqPr6+vz8/MDAwMrKyvj4+NbW1q6urvDw8NLS0uTk5N7e3s7OzsbGxry8vODg4NjY2PLy8tra2np6erS0tLKyskxMTFJSUlpaWmJiYkJCQjw8PMTExHZ2djIyMurq6ioqKo6OjlhYWCwsLB4eHqCgoE5OThISEoiIiGRkZDQ0NMjIyMzMzObm5ri4uH5+fpKSkp6enlZWVpCQkEpKSkhISCIiIqamphAQEAwMDKysrAQEBJqamiYmJhQUFDg4OHR0dC4uLggICHBwcCAgIFRUVGxsbICAgAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAEAAQAAAHjYAAgoOEhYUbIykthoUIHCQqLoI2OjeFCgsdJSsvgjcwPTaDAgYSHoY2FBSWAAMLE4wAPT89ggQMEbEzQD+CBQ0UsQA7RYIGDhWxN0E+ggcPFrEUQjuCCAYXsT5DRIIJEBgfhjsrFkaDERkgJhswMwk4CDzdhBohJwcxNB4sPAmMIlCwkOGhRo5gwhIGAgAh+QQJCgAAACwAAAAAEAAQAAAHjIAAgoOEhYU7A1dYDFtdG4YAPBhVC1ktXCRfJoVKT1NIERRUSl4qXIRHBFCbhTKFCgYjkII3g0hLUbMAOjaCBEw9ukZGgidNxLMUFYIXTkGzOmLLAEkQCLNUQMEAPxdSGoYvAkS9gjkyNEkJOjovRWAb04NBJlYsWh9KQ2FUkFQ5SWqsEJIAhq6DAAIBACH5BAkKAAAALAAAAAAQABAAAAeJgACCg4SFhQkKE2kGXiwChgBDB0sGDw4NDGpshTheZ2hRFRVDUmsMCIMiZE48hmgtUBuCYxBmkAAQbV2CLBM+t0puaoIySDC3VC4tgh40M7eFNRdH0IRgZUO3NjqDFB9mv4U6Pc+DRzUfQVQ3NzAULxU2hUBDKENCQTtAL9yGRgkbcvggEq9atUAAIfkECQoAAAAsAAAAABAAEAAAB4+AAIKDhIWFPygeEE4hbEeGADkXBycZZ1tqTkqFQSNIbBtGPUJdD088g1QmMjiGZl9MO4I5ViiQAEgMA4JKLAm3EWtXgmxmOrcUElWCb2zHkFQdcoIWPGK3Sm1LgkcoPrdOKiOCRmA4IpBwDUGDL2A5IjCCN/QAcYUURQIJIlQ9MzZu6aAgRgwFGAFvKRwUCAAh+QQJCgAAACwAAAAAEAAQAAAHjIAAgoOEhYUUYW9lHiYRP4YACStxZRc0SBMyFoVEPAoWQDMzAgolEBqDRjg8O4ZKIBNAgkBjG5AAZVtsgj44VLdCanWCYUI3txUPS7xBx5AVDgazAjC3Q3ZeghUJv5B1cgOCNmI/1YUeWSkCgzNUFDODKydzCwqFNkYwOoIubnQIt244MzDC1q2DggIBACH5BAkKAAAALAAAAAAQABAAAAeJgACCg4SFhTBAOSgrEUEUhgBUQThjSh8IcQo+hRUbYEdUNjoiGlZWQYM2QD4vhkI0ZWKCPQmtkG9SEYJURDOQAD4HaLuyv0ZeB4IVj8ZNJ4IwRje/QkxkgjYz05BdamyDN9uFJg9OR4YEK1RUYzFTT0qGdnduXC1Zchg8kEEjaQsMzpTZ8avgoEAAIfkECQoAAAAsAAAAABAAEAAAB4iAAIKDhIWFNz0/Oz47IjCGADpURAkCQUI4USKFNhUvFTMANxU7KElAhDA9OoZHH0oVgjczrJBRZkGyNpCCRCw8vIUzHmXBhDM0HoIGLsCQAjEmgjIqXrxaBxGCGw5cF4Y8TnybglprLXhjFBUWVnpeOIUIT3lydg4PantDz2UZDwYOIEhgzFggACH5BAkKAAAALAAAAAAQABAAAAeLgACCg4SFhjc6RhUVRjaGgzYzRhRiREQ9hSaGOhRFOxSDQQ0uj1RBPjOCIypOjwAJFkSCSyQrrhRDOYILXFSuNkpjggwtvo86H7YAZ1korkRaEYJlC3WuESxBggJLWHGGFhcIxgBvUHQyUT1GQWwhFxuFKyBPakxNXgceYY9HCDEZTlxA8cOVwUGBAAA7AAAAAAAAAAAA">
45
+ <?php echo __('Loading', 'wp-pro-quiz'); ?>
46
+ </div>
47
 
48
+ <div id="wpProQuiz_statistics_content" style="display: none;">
49
+ <table class="wp-list-table widefat wpProQuiz_statistics_table">
50
+ <thead>
51
+ <tr>
52
+ <th scope="col" style="width: 50px;"></th>
53
+ <th scope="col"><?php _e('Question', 'wp-pro-quiz'); ?></th>
54
+ <th scope="col" style="width: 100px;"><?php _e('Points', 'wp-pro-quiz'); ?></th>
55
+ <th scope="col" style="width: 100px;"><?php _e('Correct', 'wp-pro-quiz'); ?></th>
56
+ <th scope="col" style="width: 100px;"><?php _e('Incorrect', 'wp-pro-quiz'); ?></th>
57
+ <th scope="col" style="width: 100px;"><?php _e('Hints used', 'wp-pro-quiz'); ?></th>
58
+ <th scope="col" style="width: 60px;"><?php _e('Results', 'wp-pro-quiz'); ?></th>
59
+ </tr>
60
+ </thead>
61
+ <tbody>
 
 
 
 
 
 
62
  <?php
63
+ $index = 1;
64
+ $gPoints = 0;
65
+ foreach($this->question as $question) {
66
+ $gPoints += $question->getPoints();
67
  ?>
68
+ <tr id="wpProQuiz_tr_<?php echo $question->getId(); ?>">
69
+ <th><?php echo $index++; ?></th>
70
+ <th><?php echo $question->getTitle(); ?></th>
71
+ <th class="wpProQuiz_points"><?php echo $question->getPoints(); ?></th>
72
+ <th class="wpProQuiz_cCorrect" style="color: green;"></th>
73
+ <th class="wpProQuiz_cIncorrect" style="color: red;"></th>
74
+ <th class="wpProQuiz_cTip"></th>
75
+ <th></th>
76
+ </tr>
77
+ <?php } ?>
78
+ </tbody>
79
+ <tfoot>
80
+ <tr>
81
+ <th></th>
82
+ <th><?php _e('Total', 'wp-pro-quiz'); ?></th>
83
+ <th class="wpProQuiz_points"><?php echo $gPoints; ?></th>
84
+ <th class="wpProQuiz_cCorrect" style="color: green;"></th>
85
+ <th class="wpProQuiz_cIncorrect" style="color: red;"></th>
86
+ <th class="wpProQuiz_cTip"></th>
87
+ <th class="wpProQuiz_cResult" style="font-weight: bold;"></th>
88
+ </tr>
89
+ </tfoot>
90
+ </table>
91
+
92
+ <div style="margin-top: 10px;">
93
+ <div style="float: left;">
94
+ <a class="button-secondary" href="#" id="wpProQuiz_reset"><?php _e('Reset statistics', 'wp-pro-quiz'); ?></a>
95
+ <a class="button-secondary" href="#" id="wpProQuiz_update"><?php _e('Refresh', 'wp-pro-quiz'); ?></a>
96
+ </div>
97
+ <div style="float: right;">
98
+ <a class="button-secondary" href="#" id="wpProQuiz_resetComplete"><?php _e('Reset entire statistic', 'wp-pro-quiz'); ?></a>
99
+ </div>
100
+ <div style="clear: both;"></div>
101
+ </div>
102
+ </div>
103
  </div>
104
 
105
  <?php
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: xeno010
3
  Tags: quiz, test, answer, question, learning
4
  Requires at least: 3.3
5
  Tested up to: 3.5
6
- Stable tag: 0.12
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -131,4 +131,13 @@ Own themes changes internal order of filters, what causes the problems. With ad
131
  * Translation for Arabic have been added (Thanks Abuhassan)
132
  * added hide "restart quiz" button option
133
  * added hide "view question" button option
134
- * Bugfix in sorting choice with IE & Safari
 
 
 
 
 
 
 
 
 
3
  Tags: quiz, test, answer, question, learning
4
  Requires at least: 3.3
5
  Tested up to: 3.5
6
+ Stable tag: 0.13
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
131
  * Translation for Arabic have been added (Thanks Abuhassan)
132
  * added hide "restart quiz" button option
133
  * added hide "view question" button option
134
+ * Bugfix in sorting choice with IE & Safari
135
+
136
+ = 0.13 =
137
+ * Bugfix
138
+ * New screenshots
139
+ * A new Touch Library was added for mobile devices
140
+ * Statistics function has been extended
141
+ * Setting page in case of problems added
142
+ * "Copy questions from another Quiz" function added
143
+ * "Execute quiz only once" option added
screenshot-10.png CHANGED
Binary file
screenshot-6.png CHANGED
Binary file
screenshot-7.png CHANGED
Binary file
screenshot-8.png CHANGED
Binary file
uninstall.php CHANGED
@@ -4,8 +4,12 @@ if(!defined('WP_UNINSTALL_PLUGIN'))
4
  exit();
5
 
6
  include_once 'lib/helper/WpProQuiz_Helper_DbUpgrade.php';
 
7
 
8
  $db = new WpProQuiz_Helper_DbUpgrade();
9
  $db->delete();
10
 
11
- delete_option('wpProQuiz_dbVersion');
 
 
 
4
  exit();
5
 
6
  include_once 'lib/helper/WpProQuiz_Helper_DbUpgrade.php';
7
+ include_once 'lib/model/WpProQuiz_Model_GlobalSettingsMapper.php';
8
 
9
  $db = new WpProQuiz_Helper_DbUpgrade();
10
  $db->delete();
11
 
12
+ delete_option('wpProQuiz_dbVersion');
13
+
14
+ $settings = new WpProQuiz_Model_GlobalSettingsMapper();
15
+ $settings->delete();
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.12
7
  Author: Julius Fischer
8
  Author URI: http://www.it-gecko.de
9
  */
10
 
11
- define('WPPROQUIZ_VERSION', '0.12');
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.13
7
  Author: Julius Fischer
8
  Author URI: http://www.it-gecko.de
9
  */
10
 
11
+ define('WPPROQUIZ_VERSION', '0.13');
12
 
13
  include_once 'lib/controller/WpProQuiz_Controller_Admin.php';
14
  include_once 'lib/helper/WpProQuiz_Helper_DbUpgrade.php';