Wp-Pro-Quiz - Version 0.27

Version Description

  • Statistics function has been completely overworked.
    • All answers from users are stored now.
    • Edit, delete or add questions has no effect on existing results.
  • Statistics function can also be actived with the option "Show only specific number of questions" now.
  • The "Show only specific number of questions" option now works with cache plugins.
  • added custom fields
  • Quiz mode "Questions below eachother" can now be divided into pages.
  • Quiz: added option "Sort questions by category" - Sort questions by category.
  • Quiz: added option "Display category" - Category is displayed in the questions.
  • Repair Database - Added button in the global settings
  • Improved matrix-sorting question type by allowing sort elements to be dragged into any criterion having the same text as the correct answer. (For example, if there are 6 unique sort elements and only 2 unique criterion, then dragging a sort element into any criterion with the same correct name will validate as correct.)
    • Thanks Grant K Norwood (grantnorwood)
  • Added ability to set the table column width for matrix sorting criteria in order to allow longer criteria text. The option is displayed only when matrix sorting is selected as the answer type.
    • Thanks Grant K Norwood (grantnorwood)
Download this release

Release Info

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

Code changes from version 0.26 to 0.27

css/wpProQuiz_front.css CHANGED
@@ -213,11 +213,11 @@
213
  margin: 0 !important;
214
  list-style-type: none !important;
215
  }
216
- .wpProQuiz_lock, .wpProQuiz_prerequisite {
217
  border: 1px dotted #FFC3C3 !important;
218
  background-color: #FFF7F7 !important;
219
  }
220
- .wpProQuiz_lock p, .wpProQuiz_prerequisite p {
221
  margin: 20px !important;
222
  font-weight: bold !important;
223
  }
@@ -319,7 +319,7 @@
319
  background-color: #F8FAF5;
320
  position: relative;
321
  }
322
- .wpProQuiz_checkPage > div {
323
  border: 1px solid #C3D1A3;
324
  background-color: #F8FAF5;
325
  }
@@ -435,4 +435,39 @@ span.wpProQuiz_catPercent {
435
  padding-left: 5px !important;
436
  color: #000 !important;
437
  right: 0 !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
438
  }
213
  margin: 0 !important;
214
  list-style-type: none !important;
215
  }
216
+ .wpProQuiz_lock, .wpProQuiz_prerequisite, .wpProQuiz_startOnlyRegisteredUser, .wpProQuiz_loadQuiz {
217
  border: 1px dotted #FFC3C3 !important;
218
  background-color: #FFF7F7 !important;
219
  }
220
+ .wpProQuiz_lock p, .wpProQuiz_prerequisite p, .wpProQuiz_startOnlyRegisteredUser p, .wpProQuiz_loadQuiz p {
221
  margin: 20px !important;
222
  font-weight: bold !important;
223
  }
319
  background-color: #F8FAF5;
320
  position: relative;
321
  }
322
+ .wpProQuiz_box {
323
  border: 1px solid #C3D1A3;
324
  background-color: #F8FAF5;
325
  }
435
  padding-left: 5px !important;
436
  color: #000 !important;
437
  right: 0 !important;
438
+ }
439
+ .wpProQuiz_forms {
440
+ margin: 20px 0 20px 0 !important;
441
+ }
442
+ .wpProQuiz_required {
443
+ color: #F00 !important;
444
+ font-weight: bold !important;
445
+ }
446
+ .wpProQuiz_invalidate {
447
+ border: 1px solid #FFCFCF !important;
448
+ background: #FFEBE8 !important;
449
+ padding: 4px !important;
450
+ margin: 4px 0 4px 0 !important;
451
+ display: none;
452
+ }
453
+
454
+ .wpProQuiz_forms table {
455
+ width: auto !important;
456
+ border-collapse: separate !important;
457
+ border-spacing: 2px !important;
458
+ }
459
+ .wpProQuiz_forms td {
460
+ vertical-align: top !important;
461
+ padding: 0 0 8px 0 !important;
462
+ margin: 0 !important;
463
+ border: 0 !important;
464
+ background: none !important;
465
+ }
466
+ .wpProQuiz_forms input, .wpProQuiz_forms textarea, .wpProQuiz_forms label, .wpProQuiz_forms select {
467
+ margin: 0 !important;
468
+ float: none !important;
469
+ display: inline !important;
470
+ }
471
+ .wpProQuiz_forms select {
472
+ width: auto !important;
473
  }
css/wpProQuiz_front.min.css CHANGED
@@ -1 +1 @@
1
- .wpProQuiz_answerCorrect{background:#6db46d!important;font-weight:bold!important}.wpProQuiz_answerCorrect label{font-weight:bold!important}.wpProQuiz_answerIncorrect{background:#ff9191!important;font-weight:bold!important}.wpProQuiz_content{margin-top:10px!important;margin-bottom:10px!important}.wpProQuiz_content h2{margin-bottom:10px!important}*+html .wpProQuiz_button,*+html .wpProQuiz_button:hover{padding:3px 0!important}.wpProQuiz_button,.wpProQuiz_button:hover{margin:0!important;padding:5px 10px!important;background:#13455b!important;border-radius:11px!important;color:white!important;font-weight:bold!important;border:1px solid #13455b!important;box-shadow:1px 1px 1px #333!important;text-shadow:none!important;filter:none!important;float:none}.wpProQuiz_question_page{margin-bottom:10px!important}.wpProQuiz_question_page span{font-weight:bold!important}.wpProQuiz_questionListItem:last-child,.wpProQuiz_questionListItemLastChildIE{padding:3px!important;margin-bottom:0!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_list,.wpProQuiz_listItem,.wpProQuiz_questionList,.wpProQuiz_sortStringList,.wpProQuiz_sortStringList,.wpProQuiz_maxtrixSortCriterion,.wpProQuiz_resultsList,.wpProQuiz_catOverview ol{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:bold!important}.wpProQuiz_sort{width:25px!important}.wpProQuiz_results h3{margin-bottom:10px!important}.wpProQuiz_sort_correct_answer{font-weight:bold!important;margin-right:5px!important;display:none!important}.wpProQuiz_sortable,.wpProQuiz_sortStringItem{padding:5px!important;border:1px solid lightGrey!important;box-shadow:2px 2px 1px #EEE;background-color:#f8faf5!important;cursor:move}.wpProQuiz_time_limit .time{font-weight:bold!important;margin-top:5px!important;margin-bottom:5px!important}.wpProQuiz_time_limit .wpProQuiz_progress{height:10px!important;background-color:blue!important;margin-bottom:5px!important}.wpProQuiz_time_limit_expired{font-weight:bold!important;font-size:15px!important;text-align:center!important}.wpProQuiz_question_text{margin-bottom:10px!important}.wpProQuiz_tipp>div{padding:10px!important;background-color:#ddecff!important;border:1px dotted #363636!important;border-radius:10px!important;position:absolute!important;bottom:5px!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:bold!important;text-align:center!important;margin-bottom:20px!important}.wpProQuiz_cloze input[type="text"]{background:transparent;border:0!important;border-bottom:1px solid!important;height:18px!important;margin:0!important;padding:0 4px 0 4px!important;color:black!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:normal;display:inline}.wpProQuiz_questionListItem input{float:none!important;display:inline!important}.wpProQuiz_resultsList>li{background-image:none!important;padding:0!important;margin:0!important;list-style-type:none!important}.wpProQuiz_lock,.wpProQuiz_prerequisite{border:1px dotted #ffc3c3!important;background-color:#fff7f7!important}.wpProQuiz_lock p,.wpProQuiz_prerequisite p{margin:20px!important;font-weight:bold!important}.wpProQuiz_toplistTable{width:100%!important;border:1px solid #c3d1a3!important;border-collapse:collapse!important;margin:0!important}.wpProQuiz_toplistTable caption{caption-side:top!important;text-align:right!important;padding-bottom:2px!important;color:gray!important;margin:0!important;font-size:11px!important}.wpProQuiz_toplistTable thead tr{background:#9bbb59!important;padding:5px!important;color:white!important;font-weight:bold!important}.wpProQuiz_toplistTable tbody td:FIRST-CHILD{font-weight:bold!important}.wpProQuiz_toplistTable td,.wpProQuiz_toplistTable th{padding:5px!important;text-align:center!important;border:0!important}.wpProQuiz_toplistTable th{background:#9bbb59!important}.wpProQuiz_toplistTrOdd{background-color:#ebf1de!important}.wpProQuiz_addToplist{margin-top:10px!important;background-color:#f5faea!important;padding:10px!important;border:1px solid #c3d1a3!important}.wpProQuiz_addToplistMessage{border:1px solid #a0a0a0!important;background-color:#fcffb3!important;margin-bottom:5px!important;border-radius:5px!important;padding:5px!important;font-weight:bold!important;color:dimGray!important}.wpProQuiz_resultTable{margin:15px auto!important;width:400px!important;border:1px solid #c4c4c4!important;padding:15px!important;font-weight:bold!important}.wpProQuiz_resultTable table{width:100%!important;border-collapse:collapse!important;margin:0!important;border:0!important}.wpProQuiz_resultName{width:100px!important;border-right:1px solid #868686!important;padding:10px 0!important;border-bottom:0!important;border-top:0!important;border-left:0!important}.wpProQuiz_resultValue{padding:0!important;border:0!important}.wpProQuiz_resultValue div{color:black!important;text-align:right!important;box-shadow:1px 1px 3px 1px #c4c4c4!important;display:inline-block!important;height:18px!important;zoom:1!important;*display:inline!important;margin-right:3px!important;vertical-align:middle!important}.wpProQuiz_addBox label{display:inline!important}.wpProQuiz_addBox input[type="text"]{margin:0!important}.wpProQuiz_reviewQuestion{max-height:100px;overflow:hidden;border:1px solid #c3d1a3;background-color:#f8faf5;position:relative}.wpProQuiz_checkPage>div{border:1px solid #c3d1a3;background-color:#f8faf5}.wpProQuiz_checkPage h3{margin:10px 0 10px 0}.wpProQuiz_reviewQuestion ol,.wpProQuiz_checkPage ol{list-style-type:none!important;margin:0!important;padding:5px 12px 0 5px!important;zoom:1!important;position:relative!important}.wpProQuiz_reviewQuestion ol:after{content:".";display:block;height:0;clear:both;visibility:hidden}.wpProQuiz_reviewQuestionTarget{font-weight:bold;border-color:#7db1d3!important;box-shadow:0 0 2px 1px #c4c4c4}.wpProQuiz_reviewQuestion li,.wpProQuiz_checkPage li{float:left!important;margin:0 5px 5px 0!important;border:1px solid #cfcfcf;padding:5px 0 5px 0!important;width:30px!important;text-align:center!important;background-color:white;cursor:pointer!important;list-style-type:none!important}.wpProQuiz_reviewQuestion div{position:absolute;right:0;background-color:#b8b8b8;top:0;height:20px;width:10px;border:0;border-radius:10px;cursor:move}.wpProQuiz_reviewLegend{padding:5px!important;margin-bottom:8px!important}.wpProQuiz_reviewLegend ol{list-style-type:none!important;padding:0!important;margin:0!important}.wpProQuiz_reviewLegend li{float:left!important;padding-right:5px!important;list-style-type:none!important;margin:0!important}.wpProQuiz_reviewColor{height:10px!important;width:10px!important;display:inline-block!important;margin-right:2px!important}.wpProQuiz_button2{border:1px solid #dadada!important;background:whiteSmoke!important;color:#303030!important;border-radius:4px!important;padding:3px 5px!important;box-shadow:1px 1px 1px #a7a7a7!important;text-shadow:none!important;filter:none!important;margin:0!important;font-weight:normal!important}.wpProQuiz_button2:hover{background:#ebebeb!important}.wpProQuiz_reviewDiv{margin:20px 0 20px 0!important}.wpProQuiz_header{margin:0!important}.wpProQuiz_catOverview{margin-top:10px;margin-bottom:20px}.wpProQuiz_catOverview li{list-style:none!important;padding:0!important;clear:left!important;border-bottom:1px dashed #aaa;height:1.05em!important;margin:10px 0 0 0!important;position:relative!important}.wpProQuiz_catOverview span{background:#fff!important;padding:0 3px 0 0!important;float:left!important;position:absolute!important;text-decoration:none!important}span.wpProQuiz_catPercent{font-weight:bold!important;padding-left:5px!important;color:#000!important;right:0!important}
1
+ .wpProQuiz_answerCorrect{background:#6db46d !important;font-weight:bold !important}.wpProQuiz_answerCorrect label{font-weight:bold !important}.wpProQuiz_answerIncorrect{background:#ff9191 !important;font-weight:bold !important}.wpProQuiz_content{margin-top:10px !important;margin-bottom:10px !important}.wpProQuiz_content h2{margin-bottom:10px !important}*+html .wpProQuiz_button,*+html .wpProQuiz_button:hover{padding:3px 0 !important}.wpProQuiz_button,.wpProQuiz_button:hover{margin:0 !important;padding:5px 10px !important;background:#13455b !important;border-radius:11px !important;color:white !important;font-weight:bold !important;border:1px solid #13455b !important;box-shadow:1px 1px 1px #333 !important;text-shadow:none !important;filter:none !important;float:none}.wpProQuiz_question_page{margin-bottom:10px !important}.wpProQuiz_question_page span{font-weight:bold !important}.wpProQuiz_questionListItem:last-child,.wpProQuiz_questionListItemLastChildIE{padding:3px !important;margin-bottom:0 !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_list,.wpProQuiz_listItem,.wpProQuiz_questionList,.wpProQuiz_sortStringList,.wpProQuiz_sortStringList,.wpProQuiz_maxtrixSortCriterion,.wpProQuiz_resultsList,.wpProQuiz_catOverview ol{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:bold !important}.wpProQuiz_sort{width:25px !important}.wpProQuiz_results h3{margin-bottom:10px !important}.wpProQuiz_sort_correct_answer{font-weight:bold !important;margin-right:5px !important;display:none !important}.wpProQuiz_sortable,.wpProQuiz_sortStringItem{padding:5px !important;border:1px solid lightGrey !important;box-shadow:2px 2px 1px #EEE;background-color:#f8faf5 !important;cursor:move}.wpProQuiz_time_limit .time{font-weight:bold !important;margin-top:5px !important;margin-bottom:5px !important}.wpProQuiz_time_limit .wpProQuiz_progress{height:10px !important;background-color:blue !important;margin-bottom:5px !important}.wpProQuiz_time_limit_expired{font-weight:bold !important;font-size:15px !important;text-align:center !important}.wpProQuiz_question_text{margin-bottom:10px !important}.wpProQuiz_tipp>div{padding:10px !important;background-color:#ddecff !important;border:1px dotted #363636 !important;border-radius:10px !important;position:absolute !important;bottom:5px !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:bold !important;text-align:center !important;margin-bottom:20px !important}.wpProQuiz_cloze input[type="text"]{background:transparent;border:0 !important;border-bottom:1px solid !important;height:18px !important;margin:0 !important;padding:0 4px 0 4px !important;color:black !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:normal;display:inline}.wpProQuiz_questionListItem input{float:none !important;display:inline !important}.wpProQuiz_resultsList>li{background-image:none !important;padding:0 !important;margin:0 !important;list-style-type:none !important}.wpProQuiz_lock,.wpProQuiz_prerequisite,.wpProQuiz_startOnlyRegisteredUser,.wpProQuiz_loadQuiz{border:1px dotted #ffc3c3 !important;background-color:#fff7f7 !important}.wpProQuiz_lock p,.wpProQuiz_prerequisite p,.wpProQuiz_startOnlyRegisteredUser p,.wpProQuiz_loadQuiz p{margin:20px !important;font-weight:bold !important}.wpProQuiz_toplistTable{width:100% !important;border:1px solid #c3d1a3 !important;border-collapse:collapse !important;margin:0 !important}.wpProQuiz_toplistTable caption{caption-side:top !important;text-align:right !important;padding-bottom:2px !important;color:gray !important;margin:0 !important;font-size:11px !important}.wpProQuiz_toplistTable thead tr{background:#9bbb59 !important;padding:5px !important;color:white !important;font-weight:bold !important}.wpProQuiz_toplistTable tbody td:first-child{font-weight:bold !important}.wpProQuiz_toplistTable td,.wpProQuiz_toplistTable th{padding:5px !important;text-align:center !important;border:0 !important}.wpProQuiz_toplistTable th{background:#9bbb59 !important}.wpProQuiz_toplistTrOdd{background-color:#ebf1de !important}.wpProQuiz_addToplist{margin-top:10px !important;background-color:#f5faea !important;padding:10px !important;border:1px solid #c3d1a3 !important}.wpProQuiz_addToplistMessage{border:1px solid #a0a0a0 !important;background-color:#fcffb3 !important;margin-bottom:5px !important;border-radius:5px !important;padding:5px !important;font-weight:bold !important;color:dimGray !important}.wpProQuiz_resultTable{margin:15px auto !important;width:400px !important;border:1px solid #c4c4c4 !important;padding:15px !important;font-weight:bold !important}.wpProQuiz_resultTable table{width:100% !important;border-collapse:collapse !important;margin:0 !important;border:0 !important}.wpProQuiz_resultName{width:100px !important;border-right:1px solid #868686 !important;padding:10px 0 !important;border-bottom:0 !important;border-top:0 !important;border-left:0 !important}.wpProQuiz_resultValue{padding:0 !important;border:0 !important}.wpProQuiz_resultValue div{color:black !important;text-align:right !important;box-shadow:1px 1px 3px 1px #c4c4c4 !important;display:inline-block !important;height:18px !important;zoom:1 !important;*display:inline !important;margin-right:3px !important;vertical-align:middle !important}.wpProQuiz_addBox label{display:inline !important}.wpProQuiz_addBox input[type="text"]{margin:0 !important}.wpProQuiz_reviewQuestion{max-height:100px;overflow:hidden;border:1px solid #c3d1a3;background-color:#f8faf5;position:relative}.wpProQuiz_box{border:1px solid #c3d1a3;background-color:#f8faf5}.wpProQuiz_checkPage h3{margin:10px 0 10px 0}.wpProQuiz_reviewQuestion ol,.wpProQuiz_checkPage ol{list-style-type:none !important;margin:0 !important;padding:5px 12px 0 5px !important;zoom:1 !important;position:relative !important}.wpProQuiz_reviewQuestion ol:after{content:".";display:block;height:0;clear:both;visibility:hidden}.wpProQuiz_reviewQuestionTarget{font-weight:bold;border-color:#7db1d3 !important;box-shadow:0 0 2px 1px #c4c4c4}.wpProQuiz_reviewQuestion li,.wpProQuiz_checkPage li{float:left !important;margin:0 5px 5px 0 !important;border:1px solid #cfcfcf;padding:5px 0 5px 0 !important;width:30px !important;text-align:center !important;background-color:white;cursor:pointer !important;list-style-type:none !important}.wpProQuiz_reviewQuestion div{position:absolute;right:0;background-color:#b8b8b8;top:0;height:20px;width:10px;border:0;border-radius:10px;cursor:move}.wpProQuiz_reviewLegend{padding:5px !important;margin-bottom:8px !important}.wpProQuiz_reviewLegend ol{list-style-type:none !important;padding:0 !important;margin:0 !important}.wpProQuiz_reviewLegend li{float:left !important;padding-right:5px !important;list-style-type:none !important;margin:0 !important}.wpProQuiz_reviewColor{height:10px !important;width:10px !important;display:inline-block !important;margin-right:2px !important}.wpProQuiz_button2{border:1px solid #dadada !important;background:whiteSmoke !important;color:#303030 !important;border-radius:4px !important;padding:3px 5px !important;box-shadow:1px 1px 1px #a7a7a7 !important;text-shadow:none !important;filter:none !important;margin:0 !important;font-weight:normal !important}.wpProQuiz_button2:hover{background:#ebebeb !important}.wpProQuiz_reviewDiv{margin:20px 0 20px 0 !important}.wpProQuiz_header{margin:0 !important}.wpProQuiz_catOverview{margin-top:10px;margin-bottom:20px}.wpProQuiz_catOverview li{list-style:none !important;padding:0 !important;clear:left !important;border-bottom:1px dashed #aaa;height:1.05em !important;margin:10px 0 0 0 !important;position:relative !important}.wpProQuiz_catOverview span{background:#fff !important;padding:0 3px 0 0 !important;float:left !important;position:absolute !important;text-decoration:none !important}span.wpProQuiz_catPercent{font-weight:bold !important;padding-left:5px !important;color:#000 !important;right:0 !important}.wpProQuiz_forms{margin:20px 0 20px 0 !important}.wpProQuiz_required{color:#F00 !important;font-weight:bold !important}.wpProQuiz_invalidate{border:1px solid #ffcfcf !important;background:#ffebe8 !important;padding:4px !important;margin:4px 0 4px 0 !important;display:none}.wpProQuiz_forms table{width:auto !important;border-collapse:separate !important;border-spacing:2px !important}.wpProQuiz_forms td{vertical-align:top !important;padding:0 0 8px 0 !important;margin:0 !important;border:0 !important;background:none !important}.wpProQuiz_forms input,.wpProQuiz_forms textarea,.wpProQuiz_forms label,.wpProQuiz_forms select{margin:0 !important;float:none !important;display:inline !important}.wpProQuiz_forms select{width:auto !important}
img/customFieldsEnd1.png ADDED
Binary file
img/customFieldsEnd2.png ADDED
Binary file
img/customFieldsFront.png ADDED
Binary file
img/showCategory.png ADDED
Binary file
js/wpProQuiz_admin.js CHANGED
@@ -700,6 +700,19 @@ jQuery(document).ready(function($) {
700
  }, function(data) {
701
  $('#resetLockMsg').show('fast').delay(2000).hide('fast');
702
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
703
  }
704
 
705
  };
@@ -747,10 +760,36 @@ jQuery(document).ready(function($) {
747
  $('#wpProQuiz_save').click(function(e) {
748
  if(!methode.validInput())
749
  e.preventDefault();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
750
 
 
751
  $('select[name="prerequisiteList[]"] option').attr('selected', 'selected');
752
  });
753
 
 
 
 
 
 
 
 
 
 
 
754
  $('input[name="quizRunOnce"]').change(function(e) {
755
  if(this.checked) {
756
  $('#wpProQuiz_quiz_run_once_type').show();
@@ -794,10 +833,10 @@ jQuery(document).ready(function($) {
794
 
795
  $('input[name="showMaxQuestion"]').change(function() {
796
  if(this.checked) {
797
- $('input[name="statisticsOn"]').removeAttr('checked').attr('disabled', 'disabled').change();
798
  $('#wpProQuiz_showMaxBox').show();
799
  } else {
800
- $('input[name="statisticsOn"]').removeAttr('disabled');
801
  $('#wpProQuiz_showMaxBox').hide();
802
  }
803
  });
@@ -848,6 +887,51 @@ jQuery(document).ready(function($) {
848
  $('input[name="quizRunOnce"]').change();
849
  $('input[name="quizRunOnceType"]:checked').change();
850
  $('input[name="showMaxQuestion"]').change();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
851
  };
852
 
853
  init();
@@ -979,6 +1063,10 @@ jQuery(document).ready(function($) {
979
  );
980
  },
981
 
 
 
 
 
982
  changeTab: function(id) {
983
  currectTab = id;
984
 
@@ -986,6 +1074,8 @@ jQuery(document).ready(function($) {
986
  methode.loadStatistics($('#userSelect').val());
987
  } else if( id == 'wpProQuiz_typeAnonymeUser') {
988
  methode.loadStatistics(0);
 
 
989
  } else {
990
  methode.loadOverview();
991
  }
@@ -1490,6 +1580,57 @@ jQuery(document).ready(function($) {
1490
  changeTimeFormat: function(inputName, $select) {
1491
  if($select.val() != "0")
1492
  $('input[name="' + inputName + '"]').val($select.val());
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1493
  }
1494
  };
1495
 
@@ -1565,6 +1706,40 @@ jQuery(document).ready(function($) {
1565
  }
1566
 
1567
  }).change();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1568
  };
1569
 
1570
  init();
@@ -1977,6 +2152,29 @@ jQuery(document).ready(function($) {
1977
 
1978
  return false;
1979
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1980
  };
1981
 
1982
  var init = function() {
@@ -2054,10 +2252,74 @@ jQuery(document).ready(function($) {
2054
  $testSelect.append($option);
2055
  });
2056
 
 
 
2057
  methode.toggleLoadBox(true);
2058
  });
2059
  },
2060
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2061
  setStatisticData: function($o, v) {
2062
  $o.find('.wpProQuiz_cCorrect').text(v.correct);
2063
  $o.find('.wpProQuiz_cIncorrect').text(v.incorrect);
@@ -2065,6 +2327,7 @@ jQuery(document).ready(function($) {
2065
  $o.find('.wpProQuiz_cPoints').text(v.points);
2066
  $o.find('.wpProQuiz_cResult').text(v.result);
2067
  $o.find('.wpProQuiz_cTime').text(v.questionTime);
 
2068
  },
2069
 
2070
  toggleLoadBox: function(show) {
@@ -2178,9 +2441,105 @@ jQuery(document).ready(function($) {
2178
  refresh: function() {
2179
  if(currentTab == 'users') {
2180
  methode.loadUsersStatistic();
 
 
2181
  } else {
2182
  methode.loadStatisticOverview(true);
2183
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2184
  }
2185
  };
2186
 
@@ -2217,6 +2576,10 @@ jQuery(document).ready(function($) {
2217
  currentTab = 'users';
2218
  $('#wpProQuiz_tabUsers').show();
2219
  methode.loadUsersStatistic();
 
 
 
 
2220
  } else {
2221
  currentTab = 'overview';
2222
  $('#wpProQuiz_tabOverview').show();
@@ -2253,9 +2616,331 @@ jQuery(document).ready(function($) {
2253
  methode.checkNavBar();
2254
  });
2255
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2256
  methode.loadUsersStatistic();
2257
  };
2258
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2259
  init();
2260
  }
2261
  };
@@ -2271,6 +2956,8 @@ jQuery(document).ready(function($) {
2271
  m = module.gobalSettings;
2272
  } else if($('.wpProQuiz_statistics').length) {
2273
  m = module.statistic;
 
 
2274
  }
2275
 
2276
  m();
@@ -2298,4 +2985,84 @@ jQuery(document).ready(function($) {
2298
  }
2299
 
2300
  WpProQuiz_Admin();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2301
  });
700
  }, function(data) {
701
  $('#resetLockMsg').show('fast').delay(2000).hide('fast');
702
  });
703
+ },
704
+
705
+ generateFormIds: function() {
706
+ var index = 0;
707
+
708
+ $('#form_table tbody > tr').each(function() {
709
+ $(this).find('[name^="form[]"]').each(function() {
710
+ var newname = $(this).attr('name').substr(6);
711
+ $(this).attr('name', 'form[' + index + ']' + newname);
712
+ });
713
+
714
+ ++index;
715
+ });
716
  }
717
 
718
  };
760
  $('#wpProQuiz_save').click(function(e) {
761
  if(!methode.validInput())
762
  e.preventDefault();
763
+ else
764
+ methode.generateFormIds();
765
+
766
+ $('select[name="prerequisiteList[]"] option').attr('selected', 'selected');
767
+ });
768
+
769
+ $('input[name="template"]').click(function(e) {
770
+ if($('select[name="templateSaveList"]').val() == '0') {
771
+ if(isEmpty($('input[name="templateName"]').val())) {
772
+ alert(wpProQuizLocalize.temploate_no_name);
773
+
774
+ e.preventDefault();
775
+ return false;
776
+ }
777
+ }
778
 
779
+ methode.generateFormIds();
780
  $('select[name="prerequisiteList[]"] option').attr('selected', 'selected');
781
  });
782
 
783
+ $('select[name="templateSaveList"]').change(function() {
784
+ var $templateName = $('input[name="templateName"]');
785
+
786
+ if($(this).val() == '0') {
787
+ $templateName.show();
788
+ } else {
789
+ $templateName.hide();
790
+ }
791
+ }).change();
792
+
793
  $('input[name="quizRunOnce"]').change(function(e) {
794
  if(this.checked) {
795
  $('#wpProQuiz_quiz_run_once_type').show();
833
 
834
  $('input[name="showMaxQuestion"]').change(function() {
835
  if(this.checked) {
836
+ // $('input[name="statisticsOn"]').removeAttr('checked').attr('disabled', 'disabled').change();
837
  $('#wpProQuiz_showMaxBox').show();
838
  } else {
839
+ // $('input[name="statisticsOn"]').removeAttr('disabled');
840
  $('#wpProQuiz_showMaxBox').hide();
841
  }
842
  });
887
  $('input[name="quizRunOnce"]').change();
888
  $('input[name="quizRunOnceType"]:checked').change();
889
  $('input[name="showMaxQuestion"]').change();
890
+
891
+ $('#form_add').click(function() {
892
+ $('#form_table tbody > tr:eq(0)').clone(true).appendTo('#form_table tbody').show();
893
+ });
894
+
895
+ $('input[name="form_delete"]').click(function() {
896
+ var con = $(this).parents('tr');
897
+
898
+ if(con.find('input[name="form[][form_id]"]').val() != "0") {
899
+ con.find('input[name="form[][form_delete]"]').val(1);
900
+ con.hide();
901
+ } else {
902
+ con.remove();
903
+ }
904
+ });
905
+
906
+ $('#form_table tbody').sortable({ handle: '.form_move', update: methode.sortUpdate });
907
+ $('.form_move').click(function() {
908
+ return false;
909
+ });
910
+
911
+ $('select[name="form[][type]"]').change(function() {
912
+ switch (Number($(this).val())) {
913
+ case 7:
914
+ case 8:
915
+ $(this).siblings('.editDropDown').show();
916
+ break;
917
+ default:
918
+ $(this).siblings('.editDropDown, .dropDownEditBox').hide();
919
+ break;
920
+ }
921
+
922
+ }).change();
923
+
924
+ $('.editDropDown').click(function() {
925
+ $('.dropDownEditBox').not(
926
+ $(this).siblings('.dropDownEditBox').toggle())
927
+ .hide();
928
+
929
+ return false;
930
+ });
931
+
932
+ $('.dropDownEditBox input').click(function() {
933
+ $(this).parent().hide();
934
+ });
935
  };
936
 
937
  init();
1063
  );
1064
  },
1065
 
1066
+ loadFormOverview: function() {
1067
+ $('#wpProQuiz_tabFormOverview').show();
1068
+ },
1069
+
1070
  changeTab: function(id) {
1071
  currectTab = id;
1072
 
1074
  methode.loadStatistics($('#userSelect').val());
1075
  } else if( id == 'wpProQuiz_typeAnonymeUser') {
1076
  methode.loadStatistics(0);
1077
+ } else if(id == 'wpProQuiz_typeForm') {
1078
+ methode.loadFormOverview();
1079
  } else {
1080
  methode.loadOverview();
1081
  }
1580
  changeTimeFormat: function(inputName, $select) {
1581
  if($select.val() != "0")
1582
  $('input[name="' + inputName + '"]').val($select.val());
1583
+ },
1584
+
1585
+ templateDelete: function(id, type) {
1586
+ var data = {
1587
+ templateId: id,
1588
+ type: type
1589
+ };
1590
+
1591
+ global.ajaxPost('templateDelete', data, function(json) {
1592
+ if(json.err) {
1593
+
1594
+ return;
1595
+ }
1596
+
1597
+ if(!type) {
1598
+ $('select[name="templateQuiz"] option[value="'+id+'"]').remove();
1599
+ $('select[name="templateQuiz"]').change();
1600
+ } else {
1601
+ $('select[name="templateQuestion"] option[value="'+id+'"]').remove();
1602
+ $('select[name="templateQuestion"]').change();
1603
+ }
1604
+ });
1605
+ },
1606
+
1607
+ templateEdit: function(id, name, type) {
1608
+
1609
+ if(global.isEmpty(name)) {
1610
+ alert(wpProQuizLocalize.category_no_name);
1611
+ return;
1612
+ }
1613
+
1614
+ var data = {
1615
+ templateId: id,
1616
+ name: $.trim(name),
1617
+ type: type
1618
+ };
1619
+
1620
+ global.ajaxPost('templateEdit', data, function(json) {
1621
+ if(json.err) {
1622
+
1623
+ return;
1624
+ }
1625
+
1626
+ if(!type) {
1627
+ $('select[name="templateQuiz"] option[value="'+id+'"]').text(data.name);
1628
+ $('select[name="templateQuiz"]').change();
1629
+ } else {
1630
+ $('select[name="templateQuestion"] option[value="'+id+'"]').text(data.name);
1631
+ $('select[name="templateQuestion"]').change();
1632
+ }
1633
+ });
1634
  }
1635
  };
1636
 
1706
  }
1707
 
1708
  }).change();
1709
+
1710
+ $('select[name="templateQuiz"]').change(function() {
1711
+ $('input[name="templateQuizEditText"]').val($(this).find(':selected').text());
1712
+ }).change();
1713
+
1714
+ $('select[name="templateQuestion"]').change(function() {
1715
+ $('input[name="templateQuestionEditText"]').val($(this).find(':selected').text());
1716
+ }).change();
1717
+
1718
+ $('input[name="templateQuizDelete"]').click(function() {
1719
+ var id = $('select[name="templateQuiz"] option:selected').val();
1720
+
1721
+ methode.templateDelete(id, 0);
1722
+ });
1723
+
1724
+ $('input[name="templateQuestionDelete"]').click(function() {
1725
+ var id = $('select[name="templateQuestion"] option:selected').val();
1726
+
1727
+ methode.templateDelete(id, 1);
1728
+ });
1729
+
1730
+ $('input[name="templateQuizEdit"]').click(function() {
1731
+ var id = $('select[name="templateQuiz"] option:selected').val();
1732
+ var text = $('input[name="templateQuizEditText"]').val();
1733
+
1734
+ methode.templateEdit(id, text, 0);
1735
+ });
1736
+
1737
+ $('input[name="templateQuestionEdit"]').click(function() {
1738
+ var id = $('select[name="templateQuestion"] option:selected').val();
1739
+ var text = $('input[name="templateQuestionEditText"]').val();
1740
+
1741
+ methode.templateEdit(id, text, 1);
1742
+ });
1743
  };
1744
 
1745
  init();
2152
 
2153
  return false;
2154
  });
2155
+
2156
+ $('input[name="template"]').click(function(e) {
2157
+ if($('select[name="templateSaveList"]').val() == '0') {
2158
+ if(global.isEmpty($('input[name="templateName"]').val())) {
2159
+ alert(wpProQuizLocalize.temploate_no_name);
2160
+
2161
+ e.preventDefault();
2162
+ return false;
2163
+ }
2164
+ }
2165
+
2166
+ methode.generateArrayIndex();
2167
+ });
2168
+
2169
+ $('select[name="templateSaveList"]').change(function() {
2170
+ var $templateName = $('input[name="templateName"]');
2171
+
2172
+ if($(this).val() == '0') {
2173
+ $templateName.show();
2174
+ } else {
2175
+ $templateName.hide();
2176
+ }
2177
+ }).change();
2178
  };
2179
 
2180
  var init = function() {
2252
  $testSelect.append($option);
2253
  });
2254
 
2255
+ methode.parseFormData(json.formData);
2256
+
2257
  methode.toggleLoadBox(true);
2258
  });
2259
  },
2260
 
2261
+ loadUsersStatistic_: function(userId, testId) {
2262
+
2263
+ var data = {
2264
+ userId: userId,
2265
+ quizId: quizId,
2266
+ testId: testId
2267
+ };
2268
+
2269
+ methode.toggleLoadBox(false);
2270
+
2271
+ global.ajaxPost('statisticLoad', data, function(json) {
2272
+ $.each(json.question, function() {
2273
+ var $tr = $('#wpProQuiz_tr_' + this.questionId);
2274
+
2275
+ methode.setStatisticData($tr, this);
2276
+ });
2277
+
2278
+ $.each(json.category, function(i, v) {
2279
+ var $tr = $('#wpProQuiz_ctr_' + i);
2280
+
2281
+ methode.setStatisticData($tr, v);
2282
+ });
2283
+
2284
+ $('#testSelect option:gt(0)').remove();
2285
+ var $testSelect = $('#testSelect');
2286
+
2287
+ $.each(json.tests, function() {
2288
+ var $option = $(document.createElement('option'));
2289
+
2290
+ $option.val(this.id);
2291
+ $option.text(this.date);
2292
+
2293
+ if(json.testId == this.id)
2294
+ $option.attr('selected', true);
2295
+
2296
+ $testSelect.append($option);
2297
+ });
2298
+
2299
+ methode.parseFormData(json.formData);
2300
+
2301
+ $('#userSelect').val(userId);
2302
+ $('#testSelect').val(testId);
2303
+
2304
+ methode.toggleLoadBox(true);
2305
+ });
2306
+ },
2307
+
2308
+ parseFormData: function(data) {
2309
+ var $formBox = $('#wpProQuiz_form_box');
2310
+
2311
+ if(data == null) {
2312
+ $formBox.hide();
2313
+ return;
2314
+ }
2315
+
2316
+ $.each(data, function(i, v) {
2317
+ $('#form_id_' + i).text(v);
2318
+ });
2319
+
2320
+ $formBox.show();
2321
+ },
2322
+
2323
  setStatisticData: function($o, v) {
2324
  $o.find('.wpProQuiz_cCorrect').text(v.correct);
2325
  $o.find('.wpProQuiz_cIncorrect').text(v.incorrect);
2327
  $o.find('.wpProQuiz_cPoints').text(v.points);
2328
  $o.find('.wpProQuiz_cResult').text(v.result);
2329
  $o.find('.wpProQuiz_cTime').text(v.questionTime);
2330
+ $o.find('.wpProQuiz_cCreateTime').text(v.date);
2331
  },
2332
 
2333
  toggleLoadBox: function(show) {
2441
  refresh: function() {
2442
  if(currentTab == 'users') {
2443
  methode.loadUsersStatistic();
2444
+ } else if(currentTab == 'formOverview') {
2445
+ methode.loadFormsOverview(true);
2446
  } else {
2447
  methode.loadStatisticOverview(true);
2448
  }
2449
+ },
2450
+
2451
+ loadFormsOverview: function(nav) {
2452
+ var data = {
2453
+ quizId: quizId,
2454
+ pageLimit: $('#wpProQuiz_fromPageLimit').val(),
2455
+ onlyUser: $('#wpProQuiz_formUser').val(),
2456
+ page: $('#wpProQuiz_formCurrentPage').val(),
2457
+ nav: Number(nav)
2458
+ };
2459
+
2460
+ methode.toggleLoadBox(false);
2461
+
2462
+ global.ajaxPost('statisticLoadFormOverview', data, function(json) {
2463
+ var $body = $('#wpProQuiz_statistics_form_data');
2464
+ var $tr = $body.children();
2465
+ var $c = $tr.first().clone();
2466
+
2467
+ $tr.slice(1).remove();
2468
+
2469
+ $.each(json.items, function() {
2470
+ var clone = $c.clone();
2471
+
2472
+ methode.setStatisticData(clone, this);
2473
+
2474
+ clone.find('a').text(this.userName).data('userId', this.userId).data('testId', this.testId).click(function() {
2475
+ methode.switchTabOnLoad('users');
2476
+ methode.loadUsersStatistic_($(this).data('userId'), $(this).data('testId'));
2477
+
2478
+ return false;
2479
+ });
2480
+
2481
+ clone.show().appendTo($body);
2482
+ });
2483
+
2484
+ $c.remove();
2485
+
2486
+ methode.toggleLoadBox(true);
2487
+
2488
+ if(json.page != undefined)
2489
+ methode.handleFormNav(json.page);
2490
+ });
2491
+ },
2492
+
2493
+ handleFormNav: function(nav) {
2494
+ var $p = $('#wpProQuiz_formCurrentPage').empty();
2495
+
2496
+ for(var i = 1; i <= nav; i++) {
2497
+ $(document.createElement('option'))
2498
+ .val(i)
2499
+ .text(i)
2500
+ .appendTo($p);
2501
+ }
2502
+
2503
+ methode.checkFormNavBar();
2504
+ },
2505
+
2506
+ checkFormNavBar: function() {
2507
+ var n = $('#wpProQuiz_formCurrentPage').val();
2508
+
2509
+
2510
+ if(n == 1) {
2511
+ $('#wpProQuiz_formPageLeft').hide();
2512
+ } else {
2513
+ $('#wpProQuiz_formPageLeft').show();
2514
+ }
2515
+
2516
+ if(n ==$('#wpProQuiz_formCurrentPage').children().length) {
2517
+ $('#wpProQuiz_formPageRight').hide();
2518
+ } else {
2519
+ $('#wpProQuiz_formPageRight').show();
2520
+ }
2521
+ },
2522
+
2523
+ switchTabOnLoad: function(name) {
2524
+ $('.wpProQuiz_tab').removeClass('button-primary').addClass('button-secondary');
2525
+ $('.wpProQuiz_tabContent').hide();
2526
+
2527
+ var $this = $('#wpProQuiz_typeOverview');
2528
+
2529
+ if(name == 'users') {
2530
+ currentTab = 'users';
2531
+ $('#wpProQuiz_tabUsers').show();
2532
+ $this = $('#wpProQuiz_typeUser');
2533
+ } else if(name == 'formOverview') {
2534
+ currentTab = 'formOverview';
2535
+ $('#wpProQuiz_tabFormOverview').show();
2536
+ $this = $('#wpProQuiz_typeForm');
2537
+ } else {
2538
+ currentTab = 'overview';
2539
+ $('#wpProQuiz_tabOverview').show();
2540
+ }
2541
+
2542
+ $this.removeClass('button-secondary').addClass('button-primary');
2543
  }
2544
  };
2545
 
2576
  currentTab = 'users';
2577
  $('#wpProQuiz_tabUsers').show();
2578
  methode.loadUsersStatistic();
2579
+ } else if($this.attr('id') == 'wpProQuiz_typeForm') {
2580
+ currentTab = 'formOverview';
2581
+ $('#wpProQuiz_tabFormOverview').show();
2582
+ methode.loadFormsOverview(true);
2583
  } else {
2584
  currentTab = 'overview';
2585
  $('#wpProQuiz_tabOverview').show();
2616
  methode.checkNavBar();
2617
  });
2618
 
2619
+ $('#wpProQuiz_formUser, #wpProQuiz_fromPageLimit').change(function() {
2620
+ $('#wpProQuiz_formCurrentPage').val(1);
2621
+ methode.loadFormsOverview(true);
2622
+ });
2623
+
2624
+ $('#wpProQuiz_formPageLeft').click(function() {
2625
+ $('#wpProQuiz_formCurrentPage').val(Number(elements.currentPage.val()) - 1);
2626
+ methode.loadFormsOverview(false);
2627
+ methode.checkFormNavBar();
2628
+ });
2629
+
2630
+ $('#wpProQuiz_formPageRight').click(function() {
2631
+ $('#wpProQuiz_formCurrentPage').val(Number(elements.currentPage.val()) + 1);
2632
+ methode.loadFormsOverview(false);
2633
+ methode.checkFormNavBar();
2634
+ });
2635
+
2636
+ $('#wpProQuiz_formCurrentPage').change(function() {
2637
+ methode.loadFormsOverview(false);
2638
+ methode.checkFormNavBar();
2639
+ });
2640
+
2641
  methode.loadUsersStatistic();
2642
  };
2643
 
2644
+ init();
2645
+ },
2646
+
2647
+ statisticNew: function() {
2648
+ var quizId = $('#quizId').val();
2649
+ var historyNavigator = null;
2650
+ var overviewNavigator = null;
2651
+
2652
+ var historyFilter = {
2653
+ data: {
2654
+ quizId: quizId,
2655
+ users: -1,
2656
+ pageLimit: 100,
2657
+ dateFrom: 0,
2658
+ dateTo: 0,
2659
+ generateNav: 0
2660
+ },
2661
+
2662
+ changeFilter: function() {
2663
+ var getTime = function(p) {
2664
+ var date = p.datepicker('getDate');
2665
+
2666
+ return date === null ? 0 : date.getTime() / 1000;
2667
+ };
2668
+
2669
+ $.extend(this.data, {
2670
+ users: $('#wpProQuiz_historyUser').val(),
2671
+ pageLimit: $('#wpProQuiz_historyPageLimit').val(),
2672
+ dateFrom: getTime($('#datepickerFrom')),
2673
+ dateTo: getTime($('#datepickerTo')),
2674
+ generateNav: 1
2675
+ });
2676
+
2677
+ return this.data;
2678
+ }
2679
+ };
2680
+
2681
+ var overviewFilter = {
2682
+ data: {
2683
+ pageLimit: 100,
2684
+ onlyCompleted: 0,
2685
+ generateNav: 0,
2686
+ quizId: quizId
2687
+ },
2688
+
2689
+ changeFilter: function() {
2690
+ $.extend(this.data, {
2691
+ pageLimit: $('#wpProQuiz_overviewPageLimit').val(),
2692
+ onlyCompleted: Number($('#wpProQuiz_overviewOnlyCompleted').is(':checked')),
2693
+ generateNav: 1
2694
+ });
2695
+ }
2696
+ };
2697
+
2698
+ var deleteMethode = {
2699
+ deleteUserStatistic: function(refId, userId) {
2700
+ if(!confirm(wpProQuizLocalize.reset_statistics_msg))
2701
+ return false;
2702
+
2703
+ var data = {
2704
+ refId: refId,
2705
+ userId: userId,
2706
+ quizId: quizId,
2707
+ type: 0
2708
+ };
2709
+
2710
+ global.ajaxPost('statisticResetNew', data, function() {
2711
+ $('#wpProQuiz_user_overlay').hide();
2712
+
2713
+ historyFilter.changeFilter();
2714
+ methode.loadHistoryAjax();
2715
+
2716
+ overviewFilter.changeFilter();
2717
+ methode.loadOverviewAjax();
2718
+
2719
+ });
2720
+ },
2721
+
2722
+ deleteAll: function() {
2723
+ if(!confirm(wpProQuizLocalize.reset_statistics_msg))
2724
+ return false;
2725
+
2726
+ var data = {
2727
+ quizId: quizId,
2728
+ type: 1
2729
+ };
2730
+
2731
+ global.ajaxPost('statisticResetNew', data, function() {
2732
+ historyFilter.changeFilter();
2733
+ methode.loadHistoryAjax();
2734
+
2735
+ overviewFilter.changeFilter();
2736
+ methode.loadOverviewAjax();
2737
+ });
2738
+ }
2739
+ };
2740
+
2741
+ var methode = {
2742
+ loadHistoryAjax: function() {
2743
+
2744
+ var data = $.extend({
2745
+ page: historyFilter.data.generateNav ? 1 : historyNavigator.getCurrentPage()
2746
+ }, historyFilter.data);
2747
+
2748
+ methode.loadBox(true);
2749
+ var content = $('#wpProQuiz_historyLoadContext').hide();
2750
+
2751
+ global.ajaxPost('statisticLoadHistory', data, function(json) {
2752
+ content.html(json.html).show();
2753
+
2754
+ if(json.navi)
2755
+ historyNavigator.setNumPage(json.navi);
2756
+
2757
+ historyFilter.data.generateNav = 0;
2758
+
2759
+ content.find('.user_statistic').click(function() {
2760
+ methode.loadUserAjax(0, $(this).data('ref_id'), false);
2761
+
2762
+ return false;
2763
+ });
2764
+
2765
+ content.find('.wpProQuiz_delete').click(function() {
2766
+ deleteMethode.deleteUserStatistic($(this).parents('tr').find('.user_statistic').data('ref_id'), 0);
2767
+
2768
+ return false;
2769
+ });
2770
+
2771
+ methode.loadBox(false);
2772
+ });
2773
+
2774
+ },
2775
+
2776
+ loadUserAjax: function(userId, refId, avg) {
2777
+ $('#wpProQuiz_user_overlay, #wpProQuiz_loadUserData').show();
2778
+
2779
+ var content = $('#wpProQuiz_user_content').hide();
2780
+
2781
+ var data = {
2782
+ quizId: quizId,
2783
+ userId: userId,
2784
+ refId: refId,
2785
+ avg: Number(avg)
2786
+ };
2787
+
2788
+ global.ajaxPost('statisticLoadUser', data, function(json) {
2789
+ content.html(json.html);
2790
+
2791
+ content.find('.wpProQuiz_update').click(function() {
2792
+ methode.loadUserAjax(userId, refId, avg);
2793
+
2794
+ return false;
2795
+ });
2796
+
2797
+ content.find('#wpProQuiz_resetUserStatistic').click(function() {
2798
+ deleteMethode.deleteUserStatistic(refId, userId);
2799
+ });
2800
+
2801
+ content.find('.statistic_data').click(function() {
2802
+ $(this).parents('tr').next().toggle('fast');
2803
+
2804
+ return false;
2805
+ });
2806
+
2807
+ $('#wpProQuiz_loadUserData').hide();
2808
+ content.show();
2809
+ });
2810
+
2811
+ },
2812
+
2813
+ loadBox: function(show, contain) {
2814
+ if(show)
2815
+ $('#wpProQuiz_loadDataHistory').show();
2816
+ else
2817
+ $('#wpProQuiz_loadDataHistory').hide();
2818
+
2819
+ },
2820
+
2821
+ loadOverviewAjax: function() {
2822
+ var data = $.extend({
2823
+ page: overviewFilter.data.generateNav ? 1 : overviewNavigator.getCurrentPage()
2824
+ }, overviewFilter.data);
2825
+
2826
+ $('#wpProQuiz_loadDataOverview').show();
2827
+
2828
+ var content = $('#wpProQuiz_overviewLoadContext').hide();
2829
+
2830
+ global.ajaxPost('statisticLoadOverviewNew', data, function(json) {
2831
+ content.html(json.html).show();
2832
+
2833
+ if(json.navi)
2834
+ overviewNavigator.setNumPage(json.navi);
2835
+
2836
+ overviewFilter.data.generateNav = 0;
2837
+
2838
+ content.find('.user_statistic').click(function() {
2839
+ methode.loadUserAjax($(this).data('user_id'), 0, true);
2840
+
2841
+ return false;
2842
+ });
2843
+
2844
+ content.find('.wpProQuiz_delete').click(function() {
2845
+ deleteMethode.deleteUserStatistic(0, $(this).parents('tr').find('.user_statistic').data('user_id'));
2846
+
2847
+ return false;
2848
+ });
2849
+
2850
+ $('#wpProQuiz_loadDataOverview').hide();
2851
+ });
2852
+ }
2853
+ };
2854
+
2855
+
2856
+ var init = function() {
2857
+ historyNavigator = new Navigator($('#historyNavigation'), {
2858
+ onChange: function() {
2859
+ methode.loadHistoryAjax();
2860
+ }
2861
+ });
2862
+
2863
+ overviewNavigator = new Navigator($('#overviewNavigation'), {
2864
+ onChange: function() {
2865
+ methode.loadOverviewAjax();
2866
+ }
2867
+ });
2868
+
2869
+ $('#datepickerFrom').datepicker({
2870
+ closeText: wpProQuizLocalize.closeText,
2871
+ currentText: wpProQuizLocalize.currentText,
2872
+ monthNames: wpProQuizLocalize.monthNames,
2873
+ monthNamesShort: wpProQuizLocalize.monthNamesShort,
2874
+ dayNames: wpProQuizLocalize.dayNames,
2875
+ dayNamesShort: wpProQuizLocalize.dayNamesShort,
2876
+ dayNamesMin: wpProQuizLocalize.dayNamesMin,
2877
+ dateFormat: wpProQuizLocalize.dateFormat,
2878
+ firstDay: wpProQuizLocalize.firstDay,
2879
+
2880
+ changeMonth: true,
2881
+ onClose: function(selectedDate) {
2882
+ $('#datepickerTo').datepicker('option', 'minDate', selectedDate);
2883
+ }
2884
+ });
2885
+
2886
+ $('#datepickerTo').datepicker({
2887
+ closeText: wpProQuizLocalize.closeText,
2888
+ currentText: wpProQuizLocalize.currentText,
2889
+ monthNames: wpProQuizLocalize.monthNames,
2890
+ monthNamesShort: wpProQuizLocalize.monthNamesShort,
2891
+ dayNames: wpProQuizLocalize.dayNames,
2892
+ dayNamesShort: wpProQuizLocalize.dayNamesShort,
2893
+ dayNamesMin: wpProQuizLocalize.dayNamesMin,
2894
+ dateFormat: wpProQuizLocalize.dateFormat,
2895
+ firstDay: wpProQuizLocalize.firstDay,
2896
+
2897
+ changeMonth: true,
2898
+ onClose: function(selectedDate) {
2899
+ $('#datepickerFrom').datepicker('option', 'maxDate', selectedDate);
2900
+ }
2901
+ });
2902
+
2903
+ $('#filter').click(function() {
2904
+ historyFilter.changeFilter();
2905
+ methode.loadHistoryAjax();
2906
+ });
2907
+
2908
+ $('#wpProQuiz_overlay_close').click(function() {
2909
+ $('#wpProQuiz_user_overlay').hide();
2910
+ });
2911
+
2912
+ $('#wpProQuiz_tabHistory .wpProQuiz_update').click(function() {
2913
+ historyFilter.changeFilter();
2914
+ methode.loadHistoryAjax();
2915
+
2916
+ return false;
2917
+ });
2918
+
2919
+ $('#wpProQuiz_tabOverview .wpProQuiz_update').click(function() {
2920
+ overviewFilter.changeFilter();
2921
+ methode.loadOverviewAjax();
2922
+
2923
+ return false;
2924
+ });
2925
+
2926
+ $('.wpProQuiz_resetComplete').click(function() {
2927
+ deleteMethode.deleteAll();
2928
+
2929
+ return false;
2930
+ });
2931
+
2932
+ $('#overviewFilter').click(function() {
2933
+ overviewFilter.changeFilter();
2934
+ methode.loadOverviewAjax();
2935
+ });
2936
+
2937
+ historyFilter.changeFilter();
2938
+ methode.loadHistoryAjax();
2939
+
2940
+ overviewFilter.changeFilter();
2941
+ methode.loadOverviewAjax();
2942
+ };
2943
+
2944
  init();
2945
  }
2946
  };
2956
  m = module.gobalSettings;
2957
  } else if($('.wpProQuiz_statistics').length) {
2958
  m = module.statistic;
2959
+ } else if($('.wpProQuiz_statisticsNew').length) {
2960
+ m = module.statisticNew;
2961
  }
2962
 
2963
  m();
2985
  }
2986
 
2987
  WpProQuiz_Admin();
2988
+
2989
+ function Navigator(obj, option) {
2990
+ var defaultOption = {
2991
+ onChange: null
2992
+ };
2993
+
2994
+ var elements = {
2995
+ contain: null,
2996
+ pageLeft: null,
2997
+ pageRight: null,
2998
+ currentPage: null
2999
+ };
3000
+
3001
+ var checkNavBar = function() {
3002
+ var num = elements.currentPage.children().length;
3003
+ var cur = Number(elements.currentPage.val());
3004
+
3005
+ elements.pageLeft.hide();
3006
+ elements.pageRight.hide();
3007
+
3008
+ if(cur > 1)
3009
+ elements.pageLeft.show();
3010
+
3011
+ if((cur + 1) <= num)
3012
+ elements.pageRight.show();
3013
+ };
3014
+
3015
+ var init = function() {
3016
+ $.extend(elements, {
3017
+ contain: obj,
3018
+ pageLeft: obj.find('.navigationLeft'),
3019
+ pageRight: obj.find('.navigationRight'),
3020
+ currentPage: obj.find('.navigationCurrentPage')
3021
+ });
3022
+
3023
+ $.extend(defaultOption, option);
3024
+
3025
+ elements.pageLeft.click(function() {
3026
+ elements.currentPage.val(Number(elements.currentPage.val()) - 1);
3027
+ checkNavBar();
3028
+
3029
+ if(defaultOption.onChange)
3030
+ defaultOption.onChange(elements.currentPage.val());
3031
+ });
3032
+
3033
+ elements.pageRight.click(function() {
3034
+ elements.currentPage.val(Number(elements.currentPage.val()) + 1);
3035
+ checkNavBar();
3036
+
3037
+ if(defaultOption.onChange)
3038
+ defaultOption.onChange(elements.currentPage.val());
3039
+ });
3040
+
3041
+ elements.currentPage.change(function() {
3042
+ checkNavBar();
3043
+
3044
+ if(defaultOption.onChange)
3045
+ defaultOption.onChange(elements.currentPage.val());
3046
+ });
3047
+ };
3048
+
3049
+ this.getCurrentPage = function() {
3050
+ return elements.currentPage.val();
3051
+ }
3052
+
3053
+ this.setNumPage = function(num) {
3054
+ elements.currentPage.empty();
3055
+
3056
+ for(var i = 1; i <= num; i++) {
3057
+ $(document.createElement('option'))
3058
+ .val(i)
3059
+ .text(i)
3060
+ .appendTo(elements.currentPage);
3061
+ }
3062
+
3063
+ checkNavBar();
3064
+ }
3065
+
3066
+ init();
3067
+ }
3068
  });
js/wpProQuiz_admin.min.js CHANGED
@@ -1,59 +1,83 @@
1
- jQuery(document).ready(function(a){a.fn.wpProQuiz_preview=function(){var b={openPreview:function(b){window.open(a(b).attr("href"),"wpProQuizPreview","width=900,height=900")}};a(".wpProQuiz_prview").click(function(a){b.openPreview(this);a.preventDefault()})};a.fn.wpProQuiz_quizOverall=function(){var b={changeExport:function(b){$input=a(b);$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 d=
2
- $this.parent().parent().find(".wpProQuiz_quizName a:eq(0)").text();a("<li>"+d+"</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_questionOverall=function(){var b={saveSort:function(){var h={action:"wp_pro_quiz_update_sort",sort:b.parseSortArray()},d=(window.location.pathname+window.location.search).replace("admin.php","admin-ajax.php")+"&action=save_sort";a.post(d,h,function(){a("#sortMsg").show(400).delay(1E3).hide(400)})},parseSortArray:function(){var b=
5
- [];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)})},loadQuestionCopy:function(){var b=a("#questionCopySelect"),d=(window.location.pathname+window.location.search).replace("admin.php","admin-ajax.php")+"&action=load_question";b.hide();b.empty();a("#loadDataImg").show();a.post(d,{action:"wp_pro_quiz_load_question",
6
- excludeId:1},function(d){a.each(d,function(d,c){var g=a(document.createElement("optgroup"));g.attr("label",c.name);a.each(c.question,function(c,d){a(document.createElement("option")).val(d.id).text(d.name).appendTo(g)});b.append(g)});a("#loadDataImg").hide();b.show()},"json")}};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();
7
- b.saveSort()});a("#wpProQuiz_questionCopy").click(function(h){var d=a(".wpProQuiz_questionCopy");d.is(":visible")?d.hide():(d.show(),b.loadQuestionCopy());h.preventDefault()})};a.fn.wpProQuiz_quizEdit=function(){var b={addResult:function(){a("#resultList").children().each(function(){if("none"==a(this).css("display")){var d=a(this),b=d.find('textarea[name="resultTextGrade[text][]"]'),e=b.attr("id"),c=!0;d.find('input[name="resultTextGrade[prozent][]"]').val("0");d.find('input[name="resultTextGrade[activ][]"]').val("1").keyup();
8
- void 0!=tinymce.editors[e]&&!tinymce.editors[e].isHidden()&&(c=!1);void 0!=switchEditors&&!c&&(switchEditors.go(e,"toggle"),switchEditors.go(e,"toggle"));void 0!=tinymce.editors[e]?tinymce.editors[e].setContent(""):b.val("");void 0!=tinymce.editors[e]&&!c&&tinyMCE.execCommand("mceRemoveControl",!1,e);d.parent().children(":visible").last().after(d);void 0!=tinymce.editors[e]&&!c&&tinyMCE.execCommand("mceAddControl",!1,e);a(this).show();void 0!=switchEditors&&!c&&switchEditors.go(e,"toggle");return!1}})},
9
- deleteResult:function(d){a(d).parent().parent().hide();a(d).siblings('input[name="resultTextGrade[activ][]"]').val("0")},changeResult:function(d){d=a(d);if(b.validResultInput(d.val()))return d.siblings(".resultProzent").text(d.val()),d.removeAttr("style"),!0;d.css("background-color","#FF9696");return!1},validResultInput:function(a){if(h(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(h(a("#wpProQuiz_title").val()))return alert(wpProQuizLocalize.no_title_msg),
10
- !1;var d="",d=void 0!=tinymce.editors.text&&!tinymce.editors.text.isHidden()?tinymce.editors.text.getContent():a('textarea[name="text"]').val();if(h(d))return alert(wpProQuizLocalize.no_quiz_start_msg),!1;if(a("#wpProQuiz_resultGradeEnabled:checked").length){var f=!0;a("#resultList").children().each(function(){if(a(this).is(":visible")&&!b.validResultInput(a(this).find('input[name="resultTextGrade[prozent][]"]').val()))return f=!1});if(!f)return alert(wpProQuizLocalize.fail_grade_result),!1}return!0},
11
- 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")})}},h=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(){b.addResult()});a(".deleteResult").click(function(){b.deleteResult(this)});
12
- 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(d){b.validInput()||d.preventDefault();a('select[name="prerequisiteList[]"] option').attr("selected","selected")});a('input[name="quizRunOnce"]').change(function(){this.checked?
13
- (a("#wpProQuiz_quiz_run_once_type").show(),a('input[name="quizRunOnceType"]:checked').change()):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(){b.resetLock();return!1});a(".wpProQuiz_demoBox a").mouseover(function(b){var f=a(this),e=a(document).width(),f=f.siblings().outerWidth(!0);
14
- b.pageX+f>e&&(b=e-(b.pageX+f+30),a(this).next().css("left",b+"px"));a(this).next().show()}).mouseout(function(){a(this).next().hide()}).click(function(){return!1});a('input[name="showMaxQuestion"]').change(function(){this.checked?(a('input[name="statisticsOn"]').removeAttr("checked").attr("disabled","disabled").change(),a("#wpProQuiz_showMaxBox").show()):(a('input[name="statisticsOn"]').removeAttr("disabled"),a("#wpProQuiz_showMaxBox").hide())});a("#btnPrerequisiteAdd").click(function(){a('select[name="quizList"] option:selected').removeAttr("selected").appendTo('select[name="prerequisiteList[]"]')});
 
 
 
15
  a("#btnPrerequisiteDelete").click(function(){a('select[name="prerequisiteList[]"] option:selected').removeAttr("selected").appendTo('select[name="quizList"]')});a('input[name="prerequisite"]').change(function(){this.checked?a("#prerequisiteBox").show():a("#prerequisiteBox").hide()}).change();a('input[name="toplistDataAddMultiple"]').change(function(){this.checked?a("#toplistDataAddBlockBox").show():a("#toplistDataAddBlockBox").hide()}).change();a('input[name="toplistActivated"]').change(function(){this.checked?
16
- a("#toplistBox > tr:gt(0)").show():a("#toplistBox > tr:gt(0)").hide()}).change();a('input[name="showReviewQuestion"]').change(function(){this.checked?a(".wpProQuiz_reviewQuestionOptions").show():a(".wpProQuiz_reviewQuestionOptions").hide()}).change();a("#statistics_on").change();a("#wpProQuiz_resultGradeEnabled").change();a('input[name="quizRunOnce"]').change();a('input[name="quizRunOnceType"]:checked').change();a('input[name="showMaxQuestion"]').change()};a.fn.wpProQuiz_statistics=function(){var b=
17
- "wpProQuiz_typeAnonymeUser",h=!0,d={loadStatistics:function(b){var e=(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, #wpProQuiz_statistics_overview").hide();a.post(e,b,d.setStatistics,"json")},setStatistics:function(d){var e=a(".wpProQuiz_statistics_table"),c=e.find("tbody");if("wpProQuiz_typeOverview"!=b){var g=function(a,
18
- b,c){a.find(".wpProQuiz_cCorrect").text(b.cCorrect+" ("+b.pCorrect+"%)");a.find(".wpProQuiz_cIncorrect").text(b.cIncorrect+" ("+b.pIncorrect+"%)");a.find(".wpProQuiz_cTip").text(b.cTip);a.find(".wpProQuiz_cPoints").text(b.cPoints);!0==c&&e.find(".wpProQuiz_cResult").text(b.result+"%")};g(e,d.clear,!1);a.each(d.items,function(a,b){g(c.find("#wpProQuiz_tr_"+b.id),b,!1)});g(e.find("tfoot"),d.global,!0);a("#wpProQuiz_loadData").hide();a("#wpProQuiz_statistics_content, .wpProQuiz_statistics_table").show()}},
19
- loadOverview:function(){a(".wpProQuiz_statistics_table, #wpProQuiz_statistics_content, #wpProQuiz_statistics_overview").hide();a("#wpProQuiz_loadData").show();var f=(window.location.pathname+window.location.search).replace("admin.php","admin-ajax.php")+"&action=load_statistics",e={action:"wp_pro_quiz_load_statistics",overview:!0,pageLimit:a("#wpProQuiz_pageLimit").val(),onlyCompleted:Number(a("#wpProQuiz_onlyCompleted").is(":checked")),page:a("#wpProQuiz_currentPage").val(),generatePageNav:Number(h)};
20
- a.post(f,e,function(c){a("#wpProQuiz_statistics_overview_data").empty();if("wpProQuiz_typeOverview"==b){var g=a('<tr><th><a href="#">---</a></th><th class="wpProQuiz_points">---</th><th class="wpProQuiz_cCorrect" style="color: green;">---</th><th class="wpProQuiz_cIncorrect" style="color: red;">---</th><th class="wpProQuiz_cTip">---</th><th class="wpProQuiz_cResult" style="font-weight: bold;">---</th></tr>');a.each(c.items,function(b,c){var d=g.clone();d.find("a").text(c.userName).data("userId",c.userId).click(function(){a("#userSelect").val(a(this).data("userId"));
21
- a("#wpProQuiz_typeRegisteredUser").click();return!1});c.completed?(d.find(".wpProQuiz_points").text(c.cPoints),d.find(".wpProQuiz_cCorrect").text(c.cCorrect+" ("+c.pCorrect+"%)"),d.find(".wpProQuiz_cIncorrect").text(c.cIncorrect+" ("+c.pIncorrect+"%)"),d.find(".wpProQuiz_cTip").text(c.cTip),d.find(".wpProQuiz_cResult").text(c.result+"%")):d.find("th").removeAttr("style");a("#wpProQuiz_statistics_overview_data").append(d)});void 0!=c.page&&(d.setPageNav(c.page),h=!1);a("#wpProQuiz_loadData").hide();
22
- a("#wpProQuiz_statistics_overview").show()}},"json")},changeTab:function(f){b=f;"wpProQuiz_typeRegisteredUser"==f?d.loadStatistics(a("#userSelect").val()):"wpProQuiz_typeAnonymeUser"==f?d.loadStatistics(0):d.loadOverview()},resetStatistic:function(f){var e="wpProQuiz_typeRegisteredUser"==b?a("#userSelect").val():0,c=(window.location.pathname+window.location.search).replace("admin.php","admin-ajax.php")+"&action=reset";a.post(c,{action:"wp_pro_quiz_statistics",userId:e,complete:f},function(){d.changeTab(b)})},
23
- setPageNav:function(b){b=Math.ceil(b/a("#wpProQuiz_pageLimit").val());a("#wpProQuiz_currentPage").empty();for(var d=1;d<=b;d++)a(document.createElement("option")).val(d).text(d).appendTo(a("#wpProQuiz_currentPage"));a("#wpProQuiz_pageLeft, #wpProQuiz_pageRight").hide();1<a("#wpProQuiz_currentPage option").length&&a("#wpProQuiz_pageRight").show()}};a(".wpProQuiz_tab").click(function(){var b=a(this);if(b.hasClass("button-primary"))return!1;"wpProQuiz_typeRegisteredUser"==b.attr("id")?a("#wpProQuiz_userBox").show():
24
- 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(b);return!1});a("#wpProQuiz_reset").click(function(){confirm(wpProQuizLocalize.reset_statistics_msg)&&d.resetStatistic(!1);return!1});a(".wpProQuiz_resetComplete").click(function(){confirm(wpProQuizLocalize.reset_statistics_msg)&&
25
- d.resetStatistic(!0);return!1});a("#wpProQuiz_pageLimit, #wpProQuiz_onlyCompleted").change(function(){a("#wpProQuiz_currentPage").val(0);h=!0;d.changeTab(b);return!1});a("#wpProQuiz_currentPage").change(function(){a("#wpProQuiz_pageLeft, #wpProQuiz_pageRight").hide();1!=a("#wpProQuiz_currentPage option").length&&(a("#wpProQuiz_currentPage option:first-child:selected").length?a("#wpProQuiz_pageRight").show():a("#wpProQuiz_currentPage option:last-child:selected").length?a("#wpProQuiz_pageLeft").show():
26
- a("#wpProQuiz_pageLeft, #wpProQuiz_pageRight").show());d.changeTab(b)});a("#wpProQuiz_pageRight").click(function(){a("#wpProQuiz_currentPage option:selected").next().attr("selected","selected");a("#wpProQuiz_currentPage").change();return!1});a("#wpProQuiz_pageLeft").click(function(){a("#wpProQuiz_currentPage option:selected").prev().attr("selected","selected");a("#wpProQuiz_currentPage").change();return!1});d.changeTab("wpProQuiz_typeAnonymeUser")};a.fn.wpProQuiz_toplist=function(){var b=a("#wpProQuiz_sorting"),
27
- h=a("#wpProQuiz_pageLimit"),d=a("#wpProQuiz_currentPage"),f=a("#wpProQuiz_loadData"),e=a("#wpProQuiz_pageLeft"),c=a("#wpProQuiz_pageRight"),g=a("#wpProQuiz_toplistTable tbody"),p=a("#wpProQuiz_toplistTable tbody tr:eq(0)").clone(),l=a("#wpProQuiz_content"),i={loadData:function(c){var k=(window.location.pathname+window.location.search).replace("admin.php","admin-ajax.php")+"&action=load_toplist",m=this,n={action:"wp_pro_quiz_load_toplist",sort:b.val(),limit:h.val(),page:d.val()};void 0!=c&&a.extend(n,
28
- c);f.show();l.hide();a.post(k,n,function(a){m.handleDataRequest(a.data);void 0!=a.nav&&m.handleNav(a.nav);f.hide();l.show()},"json")},handleNav:function(b){d.empty();for(var c=1;c<=b.pages;c++)a(document.createElement("option")).val(c).text(c).appendTo(d);this.checkNav()},handleDataRequest:function(b){var c=this;g.empty();a.each(b,function(a,b){var c=p.clone().children();c.eq(0).children().val(b.id);c.eq(1).find("strong").text(b.name);c.eq(1).find(".inline_editUsername").val(b.name);c.eq(2).find(".wpProQuiz_email").text(b.email);
29
- c.eq(2).find("input").val(b.email);c.eq(3).text(b.type);c.eq(4).text(b.date);c.eq(5).text(b.points);c.eq(6).text(b.result);c.parent().show().appendTo(g)});b.length||a(document.createElement("td")).attr("colspan","7").text(wpProQuizLocalize.no_data_available).css({"font-weight":"bold","text-align":"center",padding:"5px"}).appendTo(document.createElement("tr")).appendTo(g);a(".wpProQuiz_delete").click(function(){if(confirm(wpProQuizLocalize.confirm_delete_entry)){var b=Array(a(this).closest("tr").find('input[name="checkedData[]"]').val());
30
- c.loadData({a:"delete",toplistIds:b})}return!1});a(".wpProQuiz_edit").click(function(){var b=a(this).closest("tr");b.find(".row-actions").hide();b.find(".inline-edit").show();b.find(".wpProQuiz_username, .wpProQuiz_email").hide();b.find(".inline_editUsername, .inline_editEmail").show();return!1});a(".inline_editSave").click(function(){var b=a(this).closest("tr"),d=b.find(".inline_editUsername").val(),g=b.find(".inline_editEmail").val();if(c.isEmpty(d)||c.isEmpty(g))return alert(wpProQuizLocalize.not_all_fields_completed),
31
- !1;c.loadData({a:"edit",toplistId:b.find('input[name="checkedData[]"]').val(),name:d,email:g});return!1});a(".inline_editCancel").click(function(){var b=a(this).closest("tr");b.find(".row-actions").show();b.find(".inline-edit").hide();b.find(".wpProQuiz_username, .wpProQuiz_email").show();b.find(".inline_editUsername, .inline_editEmail").hide();b.find(".inline_editUsername").val(b.find(".wpProQuiz_username").text());b.find(".inline_editEmail").val(b.find(".wpProQuiz_email").text());return!1})},checkNav:function(){var a=
32
- d.val();1==a?e.hide():e.show();a==d.children().length?c.hide():c.show()},isEmpty:function(b){b=a.trim(b);return!b||0===b.length}};b.change(function(){i.loadData()});h.change(function(){i.loadData({nav:1})});d.change(function(){i.checkNav();i.loadData()});e.click(function(){d.val(Number(d.val())-1);i.checkNav();i.loadData()});c.click(function(){d.val(Number(d.val())+1);i.checkNav();i.loadData()});a("#wpProQuiz_deleteAll").click(function(){i.loadData({a:"deleteAll"})});a("#wpProQuiz_action").click(function(){var b=
33
- a("#wpProQuiz_actionName").val();if("0"!=b){var c=a('input[name="checkedData[]"]:checked').map(function(){return a(this).val()}).get();i.loadData({a:b,toplistIds:c})}});a("#wpProQuiz_checkedAll").change(function(){this.checked?a('input[name="checkedData[]"]').attr("checked","checked"):a('input[name="checkedData[]"]').removeAttr("checked","checked")});i.loadData({nav:1})};a(".wpProQuiz_quizOverall").length&&a(".wpProQuiz_quizOverall").wpProQuiz_preview();a(".wpProQuiz_quizOverall").length&&a(".wpProQuiz_quizOverall").wpProQuiz_quizOverall();
34
- a(".wpProQuiz_quizEdit").length&&a(".wpProQuiz_quizEdit").wpProQuiz_quizEdit();a(".wpProQuiz_questionOverall").length&&a(".wpProQuiz_questionOverall").wpProQuiz_questionOverall();a(".wpProQuiz_toplist").length&&a(".wpProQuiz_toplist").wpProQuiz_toplist();(function(){var b=this,b={displayChecked:function(a,b,d,e){a=d?!a.checked:a.checked;e?a?b.attr("disabled","disabled"):b.removeAttr("disabled"):a?b.show():b.hide()},isEmpty:function(b){b=a.trim(b);return!b||0===b.length},isNumber:function(c){c=a.trim(c);
35
- return!b.isEmpty(c)&&!isNaN(c)},getMceContent:function(b){var d=tinymce.editors[b];return void 0!=d&&!d.isHidden()?d.getContent():a("#"+b).val()},ajaxPost:function(b,d,e){a.post(ajaxurl,{action:"wp_pro_quiz_admin_ajax",func:b,data:d},e,"json")}},h=function(){var c={categoryDelete:function(c){b.ajaxPost("categoryDelete",{categoryId:c},function(b){b.err||(a('select[name="category"] option[value="'+c+'"]').remove(),a('select[name="category"]').change())})},categoryEdit:function(c,d){var e={categoryId:c,
36
- categoryName:a.trim(d)};b.isEmpty(d)?alert(wpProQuizLocalize.category_no_name):b.ajaxPost("categoryEdit",e,function(b){b.err||(a('select[name="category"] option[value="'+c+'"]').text(e.categoryName),a('select[name="category"]').change())})},changeTimeFormat:function(b,c){"0"!=c.val()&&a('input[name="'+b+'"]').val(c.val())}};a('select[name="category"]').change(function(){a('input[name="categoryEditText"]').val(a(this).find(":selected").text())}).change();a('input[name="categoryDelete"]').click(function(){var b=
37
- a('select[name="category"] option:selected').val();c.categoryDelete(b)});a('input[name="categoryEdit"]').click(function(){var b=a('select[name="category"] option:selected').val(),d=a('input[name="categoryEditText"]').val();c.categoryEdit(b,d)});a("#statistic_time_format_select").change(function(){c.changeTimeFormat("statisticTimeFormat",a(this))});a(document).bind("changeTab",function(b){a("#problemInfo").hide("fast");switch(b.tabId){case "#problemContent":a("#problemInfo").show("fast")}});a('input[name="email[html]"]').change(function(){if(void 0==
38
- switchEditors)return!1;this.checked?switchEditors.go("adminEmailEditor","tmce"):switchEditors.go("adminEmailEditor","html")}).change();a('input[name="userEmail[html]"]').change(function(){if(void 0==switchEditors)return!1;this.checked?switchEditors.go("userEmailEditor","tmce"):switchEditors.go("userEmailEditor","html")}).change()},d=function(){var c=this,d=a.noop(),e=a(".answer_felder > div"),f=a('input[name="answerPointsActivated"]'),i=a('input[name="points"]'),c={generateArrayIndex:function(){var b=
39
- a('input[name="answerType"]:checked').val(),b="single"==b||"multiple"==b?"classic_answer":b;a(".answerList").each(function(){var c=a(this).parent().attr("class");a(this).children().each(function(d){a(this).find('[name^="answerData"]').each(function(){var a=this.name,e=a.search(/\](\[\w+\])+$/),g=b==c?d:"none";0<e&&(this.name="answerData["+g+a.substring(e,a.length))})})})},globalValidate:function(){if(b.isEmpty(b.getMceContent("question")))return alert(wpProQuizLocalize.no_question_msg),!1;if(f.is(":checked")){if("free_answer"==
40
- a('input[name="answerType"]:checked').val())return alert(wpProQuizLocalize.dif_points),!1}else{var c=i.val();if(!b.isNumber(c)||1>c)return alert(wpProQuizLocalize.no_nummber_points),!1}return!1===d()?!1:!0},answerRemove:function(){var b=a(this).parent();if(2>b.parent().children().length)return!1;b.remove();return!1},addCategory:function(){var c=a.trim(a('input[name="categoryAdd"]').val());b.isEmpty(c)||b.ajaxPost("categoryAdd",{categoryName:c},function(b){b.err?a("#categoryMsgBox").text(b.err).show("fast").delay(2E3).hide("fast"):
41
- (b=a(document.createElement("option")).val(b.categoryId).text(b.categoryName).attr("selected","selected"),a('select[name="category"]').append(b).change())})},addMediaClick:function(){if("function"!=typeof tb_show)return!1;var b=a(this).closest("li"),c=b.find('input[name="answerData[][html]"]:eq(0)'),d=b.find(".wpProQuiz_text:eq(0)");window.org_send_to_editor=window.send_to_editor;var e=tb_remove;window.send_to_editor=function(b){b=a("img",b)[0].outerHTML;d.val(d.val()+b);c.attr("checked",!0);tb_remove();
42
- window.send_to_editor=window.org_send_to_editor};window.tb_remove=function(){window.send_to_editor=window.org_send_to_editor;tb_remove=e;tb_remove()};tb_show("","media-upload.php?type=image&TB_iframe=true")}},h={classic_answer:function(){var c=0,d=0,e=0;a(".classic_answer .answerList").children().each(function(){var g=a(this);b.isEmpty(g.find('textarea[name="answerData[][answer]"]').val())||(c++,g.find('input[name="answerData[][correct]"]:checked').length&&d++,g=g.find('input[name="answerData[][points]"]').val(),
43
- b.isNumber(g)&&0<=g&&e++)});return!c?(alert(wpProQuizLocalize.no_answer_msg),!1):!d&&(!a('input[name="disableCorrect"]').is(":checked")||!a('input[name="answerPointsDiffModusActivated"]').is(":checked")||!(a('input[name="answerPointsActivated"]').is(":checked")&&"single"==a('input[name="answerType"]:checked').val()))?(alert(wpProQuizLocalize.no_correct_msg),!1):e!=c&&f.is(":checked")?(alert(wpProQuizLocalize.no_nummber_points_new),!1):!0},free_answer:function(){return b.isEmpty(a('.free_answer textarea[name="answerData[][answer]"]').val())?
44
- (alert(wpProQuizLocalize.no_answer_msg),!1):!0},cloze_answer:function(){return b.isEmpty(b.getMceContent("cloze"))?(alert(wpProQuizLocalize.no_answer_msg),!1):!0},sort_answer:function(){var c=0,d=0;a(".sort_answer .answerList").children().each(function(){var e=a(this);b.isEmpty(e.find('textarea[name="answerData[][answer]"]').val())||(c++,e=e.find('input[name="answerData[][points]"]').val(),b.isNumber(e)&&0<=e&&d++)});return!c?(alert(wpProQuizLocalize.no_answer_msg),!1):d!=c&&f.is(":checked")?(alert(wpProQuizLocalize.no_nummber_points_new),
45
- !1):!0},matrix_sort_answer:function(){var c=0,d=0,e=!0,g=0;a(".matrix_sort_answer .answerList").children().each(function(){var f=a(this),h=f.find('input[name="answerData[][points]"]').val();b.isEmpty(f.find('textarea[name="answerData[][answer]"]').val())?b.isEmpty(f.find('textarea[name="answerData[][sort_string]"]').val())||(g++,b.isNumber(h)&&0<=h&&d++):(c++,g++,b.isEmpty(f.find('textarea[name="answerData[][sort_string]"]').val())&&(e=!1),b.isNumber(h)&&0<=h&&d++)});return!c?(alert(wpProQuizLocalize.no_answer_msg),
46
- !1):!e?(alert(wpProQuizLocalize.no_sort_element_criterion),!1):d!=g&&f.is(":checked")?(alert(wpProQuizLocalize.no_nummber_points_new),!1):!0},assessment_answer:function(){return b.isEmpty(b.getMceContent("assessment"))?(alert(wpProQuizLocalize.no_answer_msg),!1):!0}};e.hide();a("#wpProQuiz_tip").change(function(){b.displayChecked(this,a("#wpProQuiz_tipBox"))}).change();a("#wpProQuiz_correctSameText").change(function(){b.displayChecked(this,a("#wpProQuiz_incorrectMassageBox"),!0)}).change();a('input[name="answerType"]').click(function(){e.hide();
47
- var b=this.value;"single"==b?(a("#singleChoiceOptions").show(),a('input[name="disableCorrect"]').change()):(a("#singleChoiceOptions").hide(),a(".classic_answer .wpProQuiz_classCorrect").parent().parent().show());if("single"==b||"multiple"==b){var c="single"==b?"radio":"checkbox",b="classic_answer";a(".wpProQuiz_classCorrect").each(function(){a("<input type="+c+" />").attr({name:this.name,value:this.value,checked:this.checked}).addClass("wpProQuiz_classCorrect wpProQuiz_checkbox").insertBefore(this)}).remove()}d=
48
- void 0!=h[b]?h[b]:a.noop();a("."+b).show()});a('input[name="answerType"]:checked').click();a(".deleteAnswer").click(c.answerRemove);a(".addAnswer").click(function(){var b=a(this).siblings("ul"),d=b.find("li:eq(0)").clone();d.find(".wpProQuiz_checkbox").removeAttr("checked");d.find(".wpProQuiz_text").val("");d.find(".wpProQuiz_points").val(1);d.find(".deleteAnswer").click(c.answerRemove);d.find(".addMedia").click(c.addMediaClick);d.appendTo(b);return!1});a(".sort_answer ul, .classic_answer ul, .matrix_sort_answer ul").sortable({handle:".wpProQuiz_move"});
49
- a("#saveQuestion").click(function(){if(!c.globalValidate())return!1;c.generateArrayIndex();return!0});a(f).change(function(){b.displayChecked(this,a(".wpProQuiz_answerPoints"));b.displayChecked(this,a("#wpProQuiz_showPointsBox"));b.displayChecked(this,i,!1,!0);b.displayChecked(this,a('input[name="answerPointsDiffModusActivated"]'),!0,!0);this.checked?(a('input[name="answerPointsDiffModusActivated"]').change(),a('input[name="disableCorrect"]').change()):(a(".classic_answer .wpProQuiz_classCorrect").parent().parent().show(),
50
- a('input[name="disableCorrect"]').attr("disabled","disabled"))}).change();a('select[name="category"]').change(function(){var b=a(this),c=a("#categoryAddBox").hide();"-1"==b.val()&&c.show()}).change();a("#categoryAddBtn").click(function(){c.addCategory()});a(".addMedia").click(c.addMediaClick);a('input[name="answerPointsDiffModusActivated"]').change(function(){b.displayChecked(this,a('input[name="disableCorrect"]'),!0,!0);this.checked?a('input[name="disableCorrect"]').change():a(".classic_answer .wpProQuiz_classCorrect").parent().parent().show()}).change();
51
- a('input[name="disableCorrect"]').change(function(){b.displayChecked(this,a(".classic_answer .wpProQuiz_classCorrect").parent().parent(),!0)}).change();a("#clickPointDia").click(function(){a(".pointDia").toggle("fast");return!1})},f=function(){var c=this,d=a("#quizId").val(),e="users",f=a("#wpProQuiz_currentPage"),h=a("#wpProQuiz_pageLeft"),j=a("#wpProQuiz_pageRight"),k=a("#testSelect"),c={loadStatistic:function(a){b.ajaxPost("statisticLoad",{userId:a},function(){})},loadUsersStatistic:function(){var e=
52
- {userId:a("#userSelect").val(),quizId:d,testId:a("#testSelect").val()};c.toggleLoadBox(!1);b.ajaxPost("statisticLoad",e,function(b){a.each(b.question,function(){var b=a("#wpProQuiz_tr_"+this.questionId);c.setStatisticData(b,this)});a.each(b.category,function(b,d){var e=a("#wpProQuiz_ctr_"+b);c.setStatisticData(e,d)});a("#testSelect option:gt(0)").remove();var d=a("#testSelect");a.each(b.tests,function(){var c=a(document.createElement("option"));c.val(this.id);c.text(this.date);b.testId==this.id&&
53
- c.attr("selected",!0);d.append(c)});c.toggleLoadBox(!0)})},setStatisticData:function(a,b){a.find(".wpProQuiz_cCorrect").text(b.correct);a.find(".wpProQuiz_cIncorrect").text(b.incorrect);a.find(".wpProQuiz_cTip").text(b.hint);a.find(".wpProQuiz_cPoints").text(b.points);a.find(".wpProQuiz_cResult").text(b.result);a.find(".wpProQuiz_cTime").text(b.questionTime)},toggleLoadBox:function(b){var c=a("#wpProQuiz_loadData"),d=a("#wpProQuiz_content");b?(c.hide(),d.show()):(d.hide(),c.show())},reset:function(e){var f=
54
- a("#userSelect").val();confirm(wpProQuizLocalize.reset_statistics_msg)&&(e={quizId:d,userId:f,testId:k.val(),type:e},c.toggleLoadBox(!1),b.ajaxPost("statisticReset",e,function(){c.loadUsersStatistic()}))},loadStatisticOverview:function(e){e={quizId:d,pageLimit:a("#wpProQuiz_pageLimit").val(),onlyCompleted:Number(a("#wpProQuiz_onlyCompleted").is(":checked")),page:f.val(),nav:Number(e)};c.toggleLoadBox(!1);b.ajaxPost("statisticLoadOverview",e,function(b){var d=a("#wpProQuiz_statistics_overview_data"),
55
- e=d.children(),f=e.first().clone();e.slice(1).remove();a.each(b.items,function(){var b=f.clone();c.setStatisticData(b,this);b.find("a").text(this.userName).data("userId",this.userId).click(function(){a("#userSelect").val(a(this).data("userId"));a("#wpProQuiz_typeUser").click();return!1});b.show().appendTo(d)});f.remove();c.toggleLoadBox(!0);void 0!=b.page&&c.handleNav(b.page)})},handleNav:function(b){for(var d=a("#wpProQuiz_currentPage").empty(),e=1;e<=b;e++)a(document.createElement("option")).val(e).text(e).appendTo(d);
56
- c.checkNavBar()},checkNavBar:function(){var a=f.val();1==a?h.hide():h.show();a==f.children().length?j.hide():j.show()},refresh:function(){"users"==e?c.loadUsersStatistic():c.loadStatisticOverview(!0)}};a("#userSelect, #testSelect").change(function(){c.loadUsersStatistic()});a(".wpProQuiz_update").click(function(){c.refresh()});a("#wpProQuiz_reset").click(function(){c.reset(0)});a("#wpProQuiz_resetUser").click(function(){c.reset(1)});a(".wpProQuiz_resetComplete").click(function(){c.reset(2)});a(".wpProQuiz_tab").click(function(){var b=
57
- a(this);a(".wpProQuiz_tab").removeClass("button-primary").addClass("button-secondary");b.removeClass("button-secondary").addClass("button-primary");a(".wpProQuiz_tabContent").hide();"wpProQuiz_typeUser"==b.attr("id")?(e="users",a("#wpProQuiz_tabUsers").show(),c.loadUsersStatistic()):(e="overview",a("#wpProQuiz_tabOverview").show(),c.loadStatisticOverview(!0));return!1});a("#wpProQuiz_onlyCompleted").change(function(){f.val(1);c.loadStatisticOverview(!0)});a("#wpProQuiz_pageLimit").change(function(){f.val(1);
58
- c.loadStatisticOverview(!0)});h.click(function(){f.val(Number(f.val())-1);c.loadStatisticOverview(!1);c.checkNavBar()});j.click(function(){f.val(Number(f.val())+1);c.loadStatisticOverview(!1);c.checkNavBar()});f.change(function(){c.loadStatisticOverview(!1);c.checkNavBar()});c.loadUsersStatistic()};a(".wpProQuiz_tab_wrapper a").click(function(){var b=a(this),d=b.data("tab"),e=b.siblings(".button-primary").removeClass("button-primary").addClass("button-secondary");b.removeClass("button-secondary").addClass("button-primary");
59
- a(e.data("tab")).hide("fast");a(d).show("fast");a(document).trigger({type:"changeTab",tabId:d});return!1});var e=a.noop;a(".wpProQuiz_questionEdit").length?e=d:a(".wpProQuiz_globalSettings").length?e=h:a(".wpProQuiz_statistics").length&&(e=f);e();a(".wpProQuiz_demoImgBox a").mouseover(function(b){var d=a(this),e=a(document).width(),d=d.siblings().outerWidth(!0);b.pageX+d>e&&(b=e-(b.pageX+d+30),a(this).next().css("left",b+"px"));a(this).next().show()}).mouseout(function(){a(this).next().hide()}).click(function(){return!1})})()});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function(a){function r(b,h){var c={onChange:null},d={contain:null,pageLeft:null,pageRight:null,currentPage:null},e=function(){var a=d.currentPage.children().length,f=Number(d.currentPage.val());d.pageLeft.hide();d.pageRight.hide();1<f&&d.pageLeft.show();f+1<=a&&d.pageRight.show()};this.getCurrentPage=function(){return d.currentPage.val()};this.setNumPage=function(c){d.currentPage.empty();for(var f=1;f<=c;f++)a(document.createElement("option")).val(f).text(f).appendTo(d.currentPage);
2
+ e()};(function(){a.extend(d,{contain:b,pageLeft:b.find(".navigationLeft"),pageRight:b.find(".navigationRight"),currentPage:b.find(".navigationCurrentPage")});a.extend(c,h);d.pageLeft.click(function(){d.currentPage.val(Number(d.currentPage.val())-1);e();if(c.onChange)c.onChange(d.currentPage.val())});d.pageRight.click(function(){d.currentPage.val(Number(d.currentPage.val())+1);e();if(c.onChange)c.onChange(d.currentPage.val())});d.currentPage.change(function(){e();if(c.onChange)c.onChange(d.currentPage.val())})})()}
3
+ a.fn.wpProQuiz_preview=function(){var b={openPreview:function(b){window.open(a(b).attr("href"),"wpProQuizPreview","width=900,height=900")}};(function(){a(".wpProQuiz_prview").click(function(a){b.openPreview(this);a.preventDefault()})})()};a.fn.wpProQuiz_quizOverall=function(){var b={changeExport:function(b){$input=a(b);$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=$this.parent().parent().find(".wpProQuiz_quizName a:eq(0)").text();
4
+ 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}};(function(){a(".wpProQuiz_delete").click(function(a){return confirm(wpProQuizLocalize.delete_msg)?!0:(a.preventDefault(),
5
+ !1)});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=a('input[name="exportItems"]');
6
+ this.checked?b.attr("checked",!0):b.attr("checked",!1);b.change()});a("#exportStart").click(function(a){b.startExport()||a.preventDefault()})})()};a.fn.wpProQuiz_questionOverall=function(){var b={saveSort:function(){var h={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,h,function(c){a("#sortMsg").show(400).delay(1E3).hide(400)})},parseSortArray:function(){var b=[];a("tbody tr").each(function(){b.push(this.id.replace("wpProQuiz_questionId_",
7
+ ""))});return b},sortUpdate:function(b,c){a(".wpProQuiz_questionOverall tbody").children().each(function(){$t=a(this).children().first().text(a(this).index()+1)})},loadQuestionCopy:function(){var b=a("#questionCopySelect"),c=(window.location.pathname+window.location.search).replace("admin.php","admin-ajax.php")+"&action=load_question";b.hide();b.empty();a("#loadDataImg").show();a.post(c,{action:"wp_pro_quiz_load_question",excludeId:1},function(c){a.each(c,function(c,d){var f=a(document.createElement("optgroup"));
8
+ f.attr("label",d.name);a.each(d.question,function(c,b){a(document.createElement("option")).val(b.id).text(b.name).appendTo(f)});b.append(f)});a("#loadDataImg").hide();b.show()},"json")}};(function(){a(".wp-list-table tbody").sortable({handle:".wpProQuiz_move",update:b.sortUpdate});a(".wpProQuiz_delete").click(function(a){return confirm(wpProQuizLocalize.delete_msg)?!0:(a.preventDefault(),!1)});a("#wpProQuiz_saveSort").click(function(a){a.preventDefault();b.saveSort()});a("#wpProQuiz_questionCopy").click(function(h){var c=
9
+ a(".wpProQuiz_questionCopy");c.is(":visible")?c.hide():(c.show(),b.loadQuestionCopy());h.preventDefault()})})()};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][]"]'),e=b.attr("id"),h=!0;c.find('input[name="resultTextGrade[prozent][]"]').val("0");c.find('input[name="resultTextGrade[activ][]"]').val("1").keyup();void 0==tinymce.editors[e]||tinymce.editors[e].isHidden()||
10
+ (h=!1);void 0==switchEditors||h||(switchEditors.go(e,"toggle"),switchEditors.go(e,"toggle"));void 0!=tinymce.editors[e]?tinymce.editors[e].setContent(""):b.val("");void 0==tinymce.editors[e]||h||tinyMCE.execCommand("mceRemoveControl",!1,e);c.parent().children(":visible").last().after(c);void 0==tinymce.editors[e]||h||tinyMCE.execCommand("mceAddControl",!1,e);a(this).show();void 0==switchEditors||h||switchEditors.go(e,"toggle");return!1}})},deleteResult:function(c){a(c).parent().parent().hide();a(c).siblings('input[name="resultTextGrade[activ][]"]').val("0")},
11
+ changeResult:function(c){c=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(h(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(h(a("#wpProQuiz_title").val()))return alert(wpProQuizLocalize.no_title_msg),!1;var c="",c=void 0==tinymce.editors.text||tinymce.editors.text.isHidden()?
12
+ a('textarea[name="text"]').val():tinymce.editors.text.getContent();if(h(c))return alert(wpProQuizLocalize.no_quiz_start_msg),!1;if(a("#wpProQuiz_resultGradeEnabled:checked").length){var d=!0;a("#resultList").children().each(function(){if(a(this).is(":visible")&&!b.validResultInput(a(this).find('input[name="resultTextGrade[prozent][]"]').val()))return d=!1});if(!d)return alert(wpProQuizLocalize.fail_grade_result),!1}return!0},resetLock:function(){var b=(window.location.pathname+window.location.search).replace("admin.php",
13
+ "admin-ajax.php"),b=b.replace("action=edit","action=reset_lock");a.post(b,{action:"wp_pro_quiz_reset_lock"},function(b){a("#resetLockMsg").show("fast").delay(2E3).hide("fast")})},generateFormIds:function(){var b=0;a("#form_table tbody > tr").each(function(){a(this).find('[name^="form[]"]').each(function(){var d=a(this).attr("name").substr(6);a(this).attr("name","form["+b+"]"+d)});++b})}},h=function(b){b=a.trim(b);return!b||0===b.length};(function(){a("#statistics_on").change(function(){this.checked?
14
+ a("#statistics_ip_lock_tr").show():a("#statistics_ip_lock_tr").hide()});a(".addResult").click(function(){b.addResult()});a(".deleteResult").click(function(a){b.deleteResult(this)});a('input[name="resultTextGrade[prozent][]"]').keyup(function(a){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(c){b.validInput()?
15
+ b.generateFormIds():c.preventDefault();a('select[name="prerequisiteList[]"] option').attr("selected","selected")});a('input[name="template"]').click(function(c){if("0"==a('select[name="templateSaveList"]').val()&&h(a('input[name="templateName"]').val()))return alert(wpProQuizLocalize.temploate_no_name),c.preventDefault(),!1;b.generateFormIds();a('select[name="prerequisiteList[]"] option').attr("selected","selected")});a('select[name="templateSaveList"]').change(function(){var b=a('input[name="templateName"]');
16
+ "0"==a(this).val()?b.show():b.hide()}).change();a('input[name="quizRunOnce"]').change(function(b){this.checked?(a("#wpProQuiz_quiz_run_once_type").show(),a('input[name="quizRunOnceType"]:checked').change()):a("#wpProQuiz_quiz_run_once_type").hide()});a('input[name="quizRunOnceType"]').change(function(b){!this.checked||"1"!=this.value&&"3"!=this.value?a("#wpProQuiz_quiz_run_once_cookie").hide():a("#wpProQuiz_quiz_run_once_cookie").show()});a('input[name="resetQuizLock"]').click(function(a){b.resetLock();
17
+ return!1});a(".wpProQuiz_demoBox a").mouseover(function(b){var d=a(this),e=a(document).width(),d=d.siblings().outerWidth(!0);b.pageX+d>e&&(b=e-(b.pageX+d+30),a(this).next().css("left",b+"px"));a(this).next().show()}).mouseout(function(){a(this).next().hide()}).click(function(){return!1});a('input[name="showMaxQuestion"]').change(function(){this.checked?a("#wpProQuiz_showMaxBox").show():a("#wpProQuiz_showMaxBox").hide()});a("#btnPrerequisiteAdd").click(function(){a('select[name="quizList"] option:selected').removeAttr("selected").appendTo('select[name="prerequisiteList[]"]')});
18
  a("#btnPrerequisiteDelete").click(function(){a('select[name="prerequisiteList[]"] option:selected').removeAttr("selected").appendTo('select[name="quizList"]')});a('input[name="prerequisite"]').change(function(){this.checked?a("#prerequisiteBox").show():a("#prerequisiteBox").hide()}).change();a('input[name="toplistDataAddMultiple"]').change(function(){this.checked?a("#toplistDataAddBlockBox").show():a("#toplistDataAddBlockBox").hide()}).change();a('input[name="toplistActivated"]').change(function(){this.checked?
19
+ a("#toplistBox > tr:gt(0)").show():a("#toplistBox > tr:gt(0)").hide()}).change();a('input[name="showReviewQuestion"]').change(function(){this.checked?a(".wpProQuiz_reviewQuestionOptions").show():a(".wpProQuiz_reviewQuestionOptions").hide()}).change();a("#statistics_on").change();a("#wpProQuiz_resultGradeEnabled").change();a('input[name="quizRunOnce"]').change();a('input[name="quizRunOnceType"]:checked').change();a('input[name="showMaxQuestion"]').change();a("#form_add").click(function(){a("#form_table tbody > tr:eq(0)").clone(!0).appendTo("#form_table tbody").show()});
20
+ a('input[name="form_delete"]').click(function(){var b=a(this).parents("tr");"0"!=b.find('input[name="form[][form_id]"]').val()?(b.find('input[name="form[][form_delete]"]').val(1),b.hide()):b.remove()});a("#form_table tbody").sortable({handle:".form_move",update:b.sortUpdate});a(".form_move").click(function(){return!1});a('select[name="form[][type]"]').change(function(){switch(Number(a(this).val())){case 7:case 8:a(this).siblings(".editDropDown").show();break;default:a(this).siblings(".editDropDown, .dropDownEditBox").hide()}}).change();
21
+ a(".editDropDown").click(function(){a(".dropDownEditBox").not(a(this).siblings(".dropDownEditBox").toggle()).hide();return!1});a(".dropDownEditBox input").click(function(){a(this).parent().hide()})})()};a.fn.wpProQuiz_statistics=function(){var b="wpProQuiz_typeAnonymeUser",h=!0,c={loadStatistics:function(b){var e=(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();
22
+ a("#wpProQuiz_statistics_content, #wpProQuiz_statistics_overview").hide();a.post(e,b,c.setStatistics,"json")},setStatistics:function(c){var e=a(".wpProQuiz_statistics_table"),h=e.find("tbody");if("wpProQuiz_typeOverview"!=b){var f=function(a,b,f){a.find(".wpProQuiz_cCorrect").text(b.cCorrect+" ("+b.pCorrect+"%)");a.find(".wpProQuiz_cIncorrect").text(b.cIncorrect+" ("+b.pIncorrect+"%)");a.find(".wpProQuiz_cTip").text(b.cTip);a.find(".wpProQuiz_cPoints").text(b.cPoints);!0==f&&e.find(".wpProQuiz_cResult").text(b.result+
23
+ "%")};f(e,c.clear,!1);a.each(c.items,function(a,b){f(h.find("#wpProQuiz_tr_"+b.id),b,!1)});f(e.find("tfoot"),c.global,!0);a("#wpProQuiz_loadData").hide();a("#wpProQuiz_statistics_content, .wpProQuiz_statistics_table").show()}},loadOverview:function(){a(".wpProQuiz_statistics_table, #wpProQuiz_statistics_content, #wpProQuiz_statistics_overview").hide();a("#wpProQuiz_loadData").show();var d=(window.location.pathname+window.location.search).replace("admin.php","admin-ajax.php")+"&action=load_statistics",
24
+ e={action:"wp_pro_quiz_load_statistics",overview:!0,pageLimit:a("#wpProQuiz_pageLimit").val(),onlyCompleted:Number(a("#wpProQuiz_onlyCompleted").is(":checked")),page:a("#wpProQuiz_currentPage").val(),generatePageNav:Number(h)};a.post(d,e,function(d){a("#wpProQuiz_statistics_overview_data").empty();if("wpProQuiz_typeOverview"==b){var f=a('<tr><th><a href="#">---</a></th><th class="wpProQuiz_points">---</th><th class="wpProQuiz_cCorrect" style="color: green;">---</th><th class="wpProQuiz_cIncorrect" style="color: red;">---</th><th class="wpProQuiz_cTip">---</th><th class="wpProQuiz_cResult" style="font-weight: bold;">---</th></tr>');
25
+ a.each(d.items,function(b,c){var d=f.clone();d.find("a").text(c.userName).data("userId",c.userId).click(function(){a("#userSelect").val(a(this).data("userId"));a("#wpProQuiz_typeRegisteredUser").click();return!1});c.completed?(d.find(".wpProQuiz_points").text(c.cPoints),d.find(".wpProQuiz_cCorrect").text(c.cCorrect+" ("+c.pCorrect+"%)"),d.find(".wpProQuiz_cIncorrect").text(c.cIncorrect+" ("+c.pIncorrect+"%)"),d.find(".wpProQuiz_cTip").text(c.cTip),d.find(".wpProQuiz_cResult").text(c.result+"%")):
26
+ d.find("th").removeAttr("style");a("#wpProQuiz_statistics_overview_data").append(d)});void 0!=d.page&&(c.setPageNav(d.page),h=!1);a("#wpProQuiz_loadData").hide();a("#wpProQuiz_statistics_overview").show()}},"json")},loadFormOverview:function(){a("#wpProQuiz_tabFormOverview").show()},changeTab:function(d){b=d;"wpProQuiz_typeRegisteredUser"==d?c.loadStatistics(a("#userSelect").val()):"wpProQuiz_typeAnonymeUser"==d?c.loadStatistics(0):"wpProQuiz_typeForm"==d?c.loadFormOverview():c.loadOverview()},resetStatistic:function(d){var e=
27
+ "wpProQuiz_typeRegisteredUser"==b?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:e,complete:d},function(a){c.changeTab(b)})},setPageNav:function(b){b=Math.ceil(b/a("#wpProQuiz_pageLimit").val());a("#wpProQuiz_currentPage").empty();for(var c=1;c<=b;c++)a(document.createElement("option")).val(c).text(c).appendTo(a("#wpProQuiz_currentPage"));a("#wpProQuiz_pageLeft, #wpProQuiz_pageRight").hide();
28
+ 1<a("#wpProQuiz_currentPage option").length&&a("#wpProQuiz_pageRight").show()}};(function(){a(".wpProQuiz_tab").click(function(b){b=a(this);if(b.hasClass("button-primary"))return!1;"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");c.changeTab(b.attr("id"));return!1});a("#userSelect").change(function(){c.changeTab("wpProQuiz_typeRegisteredUser")});
29
+ a(".wpProQuiz_update").click(function(){c.changeTab(b);return!1});a("#wpProQuiz_reset").click(function(){confirm(wpProQuizLocalize.reset_statistics_msg)&&c.resetStatistic(!1);return!1});a(".wpProQuiz_resetComplete").click(function(){confirm(wpProQuizLocalize.reset_statistics_msg)&&c.resetStatistic(!0);return!1});a("#wpProQuiz_pageLimit, #wpProQuiz_onlyCompleted").change(function(){a("#wpProQuiz_currentPage").val(0);h=!0;c.changeTab(b);return!1});a("#wpProQuiz_currentPage").change(function(){a("#wpProQuiz_pageLeft, #wpProQuiz_pageRight").hide();
30
+ 1!=a("#wpProQuiz_currentPage option").length&&(a("#wpProQuiz_currentPage option:first-child:selected").length?a("#wpProQuiz_pageRight").show():a("#wpProQuiz_currentPage option:last-child:selected").length?a("#wpProQuiz_pageLeft").show():a("#wpProQuiz_pageLeft, #wpProQuiz_pageRight").show());c.changeTab(b)});a("#wpProQuiz_pageRight").click(function(){a("#wpProQuiz_currentPage option:selected").next().attr("selected","selected");a("#wpProQuiz_currentPage").change();return!1});a("#wpProQuiz_pageLeft").click(function(){a("#wpProQuiz_currentPage option:selected").prev().attr("selected",
31
+ "selected");a("#wpProQuiz_currentPage").change();return!1});c.changeTab("wpProQuiz_typeAnonymeUser")})()};a.fn.wpProQuiz_toplist=function(){var b=a("#wpProQuiz_sorting"),h=a("#wpProQuiz_pageLimit"),c=a("#wpProQuiz_currentPage"),d=a("#wpProQuiz_loadData"),e=a("#wpProQuiz_pageLeft"),p=a("#wpProQuiz_pageRight"),f=a("#wpProQuiz_toplistTable tbody"),q=a("#wpProQuiz_toplistTable tbody tr:eq(0)").clone(),s=a("#wpProQuiz_content"),g={loadData:function(f){var q=(window.location.pathname+window.location.search).replace("admin.php",
32
+ "admin-ajax.php")+"&action=load_toplist",k=this,n={action:"wp_pro_quiz_load_toplist",sort:b.val(),limit:h.val(),page:c.val()};void 0!=f&&a.extend(n,f);d.show();s.hide();a.post(q,n,function(a){k.handleDataRequest(a.data);void 0!=a.nav&&k.handleNav(a.nav);d.hide();s.show()},"json")},handleNav:function(b){c.empty();for(var f=1;f<=b.pages;f++)a(document.createElement("option")).val(f).text(f).appendTo(c);this.checkNav()},handleDataRequest:function(b){var c=this;f.empty();a.each(b,function(a,b){var c=
33
+ q.clone().children();c.eq(0).children().val(b.id);c.eq(1).find("strong").text(b.name);c.eq(1).find(".inline_editUsername").val(b.name);c.eq(2).find(".wpProQuiz_email").text(b.email);c.eq(2).find("input").val(b.email);c.eq(3).text(b.type);c.eq(4).text(b.date);c.eq(5).text(b.points);c.eq(6).text(b.result);c.parent().show().appendTo(f)});b.length||a(document.createElement("td")).attr("colspan","7").text(wpProQuizLocalize.no_data_available).css({"font-weight":"bold","text-align":"center",padding:"5px"}).appendTo(document.createElement("tr")).appendTo(f);
34
+ a(".wpProQuiz_delete").click(function(){if(confirm(wpProQuizLocalize.confirm_delete_entry)){var b=Array(a(this).closest("tr").find('input[name="checkedData[]"]').val());c.loadData({a:"delete",toplistIds:b})}return!1});a(".wpProQuiz_edit").click(function(){var b=a(this).closest("tr");b.find(".row-actions").hide();b.find(".inline-edit").show();b.find(".wpProQuiz_username, .wpProQuiz_email").hide();b.find(".inline_editUsername, .inline_editEmail").show();return!1});a(".inline_editSave").click(function(){var b=
35
+ a(this).closest("tr"),f=b.find(".inline_editUsername").val(),t=b.find(".inline_editEmail").val();if(c.isEmpty(f)||c.isEmpty(t))return alert(wpProQuizLocalize.not_all_fields_completed),!1;c.loadData({a:"edit",toplistId:b.find('input[name="checkedData[]"]').val(),name:f,email:t});return!1});a(".inline_editCancel").click(function(){var b=a(this).closest("tr");b.find(".row-actions").show();b.find(".inline-edit").hide();b.find(".wpProQuiz_username, .wpProQuiz_email").show();b.find(".inline_editUsername, .inline_editEmail").hide();
36
+ b.find(".inline_editUsername").val(b.find(".wpProQuiz_username").text());b.find(".inline_editEmail").val(b.find(".wpProQuiz_email").text());return!1})},checkNav:function(){var a=c.val();1==a?e.hide():e.show();a==c.children().length?p.hide():p.show()},isEmpty:function(b){b=a.trim(b);return!b||0===b.length}};(function(){b.change(function(){g.loadData()});h.change(function(){g.loadData({nav:1})});c.change(function(){g.checkNav();g.loadData()});e.click(function(){c.val(Number(c.val())-1);g.checkNav();
37
+ g.loadData()});p.click(function(){c.val(Number(c.val())+1);g.checkNav();g.loadData()});a("#wpProQuiz_deleteAll").click(function(){g.loadData({a:"deleteAll"})});a("#wpProQuiz_action").click(function(){var b=a("#wpProQuiz_actionName").val();if("0"!=b){var f=a('input[name="checkedData[]"]:checked').map(function(){return a(this).val()}).get();g.loadData({a:b,toplistIds:f})}});a("#wpProQuiz_checkedAll").change(function(){this.checked?a('input[name="checkedData[]"]').attr("checked","checked"):a('input[name="checkedData[]"]').removeAttr("checked",
38
+ "checked")});g.loadData({nav:1})})()};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_questionOverall").length&&a(".wpProQuiz_questionOverall").wpProQuiz_questionOverall();a(".wpProQuiz_toplist").length&&a(".wpProQuiz_toplist").wpProQuiz_toplist();(function(){var b=this,b={displayChecked:function(a,
39
+ b,c,d){a=c?!a.checked:a.checked;d?a?b.attr("disabled","disabled"):b.removeAttr("disabled"):a?b.show():b.hide()},isEmpty:function(b){b=a.trim(b);return!b||0===b.length},isNumber:function(f){f=a.trim(f);return!b.isEmpty(f)&&!isNaN(f)},getMceContent:function(b){var c=tinymce.editors[b];return void 0==c||c.isHidden()?a("#"+b).val():c.getContent()},ajaxPost:function(b,c,d){a.post(ajaxurl,{action:"wp_pro_quiz_admin_ajax",func:b,data:c},d,"json")}},h=function(){a(".wpProQuiz_tab_wrapper a").click(function(){var b=
40
+ a(this),c=b.data("tab"),d=b.siblings(".button-primary").removeClass("button-primary").addClass("button-secondary");b.removeClass("button-secondary").addClass("button-primary");a(d.data("tab")).hide("fast");a(c).show("fast");a(document).trigger({type:"changeTab",tabId:c});return!1})},c=function(){var c={categoryDelete:function(c){b.ajaxPost("categoryDelete",{categoryId:c},function(b){b.err||(a('select[name="category"] option[value="'+c+'"]').remove(),a('select[name="category"]').change())})},categoryEdit:function(c,
41
+ f){var d={categoryId:c,categoryName:a.trim(f)};b.isEmpty(f)?alert(wpProQuizLocalize.category_no_name):b.ajaxPost("categoryEdit",d,function(b){b.err||(a('select[name="category"] option[value="'+c+'"]').text(d.categoryName),a('select[name="category"]').change())})},changeTimeFormat:function(b,c){"0"!=c.val()&&a('input[name="'+b+'"]').val(c.val())},templateDelete:function(c,f){b.ajaxPost("templateDelete",{templateId:c,type:f},function(b){b.err||(f?(a('select[name="templateQuestion"] option[value="'+
42
+ c+'"]').remove(),a('select[name="templateQuestion"]').change()):(a('select[name="templateQuiz"] option[value="'+c+'"]').remove(),a('select[name="templateQuiz"]').change()))})},templateEdit:function(c,f,d){if(b.isEmpty(f))alert(wpProQuizLocalize.category_no_name);else{var e={templateId:c,name:a.trim(f),type:d};b.ajaxPost("templateEdit",e,function(b){b.err||(d?(a('select[name="templateQuestion"] option[value="'+c+'"]').text(e.name),a('select[name="templateQuestion"]').change()):(a('select[name="templateQuiz"] option[value="'+
43
+ c+'"]').text(e.name),a('select[name="templateQuiz"]').change()))})}}};(function(){a('select[name="category"]').change(function(){a('input[name="categoryEditText"]').val(a(this).find(":selected").text())}).change();a('input[name="categoryDelete"]').click(function(){var b=a('select[name="category"] option:selected').val();c.categoryDelete(b)});a('input[name="categoryEdit"]').click(function(){var b=a('select[name="category"] option:selected').val(),d=a('input[name="categoryEditText"]').val();c.categoryEdit(b,
44
+ d)});a("#statistic_time_format_select").change(function(){c.changeTimeFormat("statisticTimeFormat",a(this))});a(document).bind("changeTab",function(b){a("#problemInfo").hide("fast");switch(b.tabId){case "#problemContent":a("#problemInfo").show("fast")}});a('input[name="email[html]"]').change(function(){if(void 0==switchEditors)return!1;this.checked?switchEditors.go("adminEmailEditor","tmce"):switchEditors.go("adminEmailEditor","html")}).change();a('input[name="userEmail[html]"]').change(function(){if(void 0==
45
+ switchEditors)return!1;this.checked?switchEditors.go("userEmailEditor","tmce"):switchEditors.go("userEmailEditor","html")}).change();a('select[name="templateQuiz"]').change(function(){a('input[name="templateQuizEditText"]').val(a(this).find(":selected").text())}).change();a('select[name="templateQuestion"]').change(function(){a('input[name="templateQuestionEditText"]').val(a(this).find(":selected").text())}).change();a('input[name="templateQuizDelete"]').click(function(){var b=a('select[name="templateQuiz"] option:selected').val();
46
+ c.templateDelete(b,0)});a('input[name="templateQuestionDelete"]').click(function(){var b=a('select[name="templateQuestion"] option:selected').val();c.templateDelete(b,1)});a('input[name="templateQuizEdit"]').click(function(){var b=a('select[name="templateQuiz"] option:selected').val(),d=a('input[name="templateQuizEditText"]').val();c.templateEdit(b,d,0)});a('input[name="templateQuestionEdit"]').click(function(){var b=a('select[name="templateQuestion"] option:selected').val(),d=a('input[name="templateQuestionEditText"]').val();
47
+ c.templateEdit(b,d,1)})})()},d=function(){var c=this,d=a.noop(),e=a(".answer_felder > div"),g=a('input[name="answerPointsActivated"]'),h=a('input[name="points"]'),c={generateArrayIndex:function(){var b=a('input[name="answerType"]:checked').val(),b="single"==b||"multiple"==b?"classic_answer":b;a(".answerList").each(function(){var c=a(this).parent().attr("class");a(this).children().each(function(f,d){a(this).find('[name^="answerData"]').each(function(){var a=this.name,d=a.search(/\](\[\w+\])+$/),l=
48
+ b==c?f:"none";0<d&&(this.name="answerData["+l+a.substring(d,a.length))})})})},globalValidate:function(){if(b.isEmpty(b.getMceContent("question")))return alert(wpProQuizLocalize.no_question_msg),!1;if(!g.is(":checked")){var c=h.val();if(!b.isNumber(c)||1>c)return alert(wpProQuizLocalize.no_nummber_points),!1}else if("free_answer"==a('input[name="answerType"]:checked').val())return alert(wpProQuizLocalize.dif_points),!1;return!1===d()?!1:!0},answerRemove:function(){var b=a(this).parent();if(2>b.parent().children().length)return!1;
49
+ b.remove();return!1},addCategory:function(){var c=a.trim(a('input[name="categoryAdd"]').val());b.isEmpty(c)||b.ajaxPost("categoryAdd",{categoryName:c},function(b){b.err?a("#categoryMsgBox").text(b.err).show("fast").delay(2E3).hide("fast"):(b=a(document.createElement("option")).val(b.categoryId).text(b.categoryName).attr("selected","selected"),a('select[name="category"]').append(b).change())})},addMediaClick:function(){if("function"!=typeof tb_show)return!1;var b=a(this).closest("li"),c=b.find('input[name="answerData[][html]"]:eq(0)'),
50
+ f=b.find(".wpProQuiz_text:eq(0)");window.org_send_to_editor=window.send_to_editor;var d=tb_remove;window.send_to_editor=function(b){b=a("img",b)[0].outerHTML;f.val(f.val()+b);c.attr("checked",!0);tb_remove();window.send_to_editor=window.org_send_to_editor};window.tb_remove=function(){window.send_to_editor=window.org_send_to_editor;tb_remove=d;tb_remove()};tb_show("","media-upload.php?type=image&TB_iframe=true")}},m={classic_answer:function(){var c=0,f=0,d=0;a(".classic_answer .answerList").children().each(function(){var l=
51
+ a(this);b.isEmpty(l.find('textarea[name="answerData[][answer]"]').val())||(c++,l.find('input[name="answerData[][correct]"]:checked').length&&f++,l=l.find('input[name="answerData[][points]"]').val(),b.isNumber(l)&&0<=l&&d++)});return c?f||a('input[name="disableCorrect"]').is(":checked")&&a('input[name="answerPointsDiffModusActivated"]').is(":checked")&&a('input[name="answerPointsActivated"]').is(":checked")&&"single"==a('input[name="answerType"]:checked').val()?d!=c&&g.is(":checked")?(alert(wpProQuizLocalize.no_nummber_points_new),
52
+ !1):!0:(alert(wpProQuizLocalize.no_correct_msg),!1):(alert(wpProQuizLocalize.no_answer_msg),!1)},free_answer:function(){return b.isEmpty(a('.free_answer textarea[name="answerData[][answer]"]').val())?(alert(wpProQuizLocalize.no_answer_msg),!1):!0},cloze_answer:function(){return b.isEmpty(b.getMceContent("cloze"))?(alert(wpProQuizLocalize.no_answer_msg),!1):!0},sort_answer:function(){var c=0,f=0;a(".sort_answer .answerList").children().each(function(){var d=a(this);b.isEmpty(d.find('textarea[name="answerData[][answer]"]').val())||
53
+ (c++,d=d.find('input[name="answerData[][points]"]').val(),b.isNumber(d)&&0<=d&&f++)});return c?f!=c&&g.is(":checked")?(alert(wpProQuizLocalize.no_nummber_points_new),!1):!0:(alert(wpProQuizLocalize.no_answer_msg),!1)},matrix_sort_answer:function(){var c=0,f=0,d=!0,l=0;a(".matrix_sort_answer .answerList").children().each(function(){var e=a(this),g=e.find('input[name="answerData[][points]"]').val();b.isEmpty(e.find('textarea[name="answerData[][answer]"]').val())?b.isEmpty(e.find('textarea[name="answerData[][sort_string]"]').val())||
54
+ (l++,b.isNumber(g)&&0<=g&&f++):(c++,l++,b.isEmpty(e.find('textarea[name="answerData[][sort_string]"]').val())&&(d=!1),b.isNumber(g)&&0<=g&&f++)});return c?d?f!=l&&g.is(":checked")?(alert(wpProQuizLocalize.no_nummber_points_new),!1):!0:(alert(wpProQuizLocalize.no_sort_element_criterion),!1):(alert(wpProQuizLocalize.no_answer_msg),!1)},assessment_answer:function(){return b.isEmpty(b.getMceContent("assessment"))?(alert(wpProQuizLocalize.no_answer_msg),!1):!0}};e.hide();(function(){a("#wpProQuiz_tip").change(function(){b.displayChecked(this,
55
+ a("#wpProQuiz_tipBox"))}).change();a("#wpProQuiz_correctSameText").change(function(){b.displayChecked(this,a("#wpProQuiz_incorrectMassageBox"),!0)}).change();a('input[name="answerType"]').click(function(){e.hide();var b=this.value;"single"==b?(a("#singleChoiceOptions").show(),a('input[name="disableCorrect"]').change()):(a("#singleChoiceOptions").hide(),a(".classic_answer .wpProQuiz_classCorrect").parent().parent().show());if("single"==b||"multiple"==b){var c="single"==b?"radio":"checkbox",b="classic_answer";
56
+ a(".wpProQuiz_classCorrect").each(function(){a("<input type="+c+" />").attr({name:this.name,value:this.value,checked:this.checked}).addClass("wpProQuiz_classCorrect wpProQuiz_checkbox").insertBefore(this)}).remove()}d=void 0!=m[b]?m[b]:a.noop();a("."+b).show()});a('input[name="answerType"]:checked').click();a(".deleteAnswer").click(c.answerRemove);a(".addAnswer").click(function(){var b=a(this).siblings("ul"),d=b.find("li:eq(0)").clone();d.find(".wpProQuiz_checkbox").removeAttr("checked");d.find(".wpProQuiz_text").val("");
57
+ d.find(".wpProQuiz_points").val(1);d.find(".deleteAnswer").click(c.answerRemove);d.find(".addMedia").click(c.addMediaClick);d.appendTo(b);return!1});a(".sort_answer ul, .classic_answer ul, .matrix_sort_answer ul").sortable({handle:".wpProQuiz_move"});a("#saveQuestion").click(function(){if(!c.globalValidate())return!1;c.generateArrayIndex();return!0});a(g).change(function(){b.displayChecked(this,a(".wpProQuiz_answerPoints"));b.displayChecked(this,a("#wpProQuiz_showPointsBox"));b.displayChecked(this,
58
+ h,!1,!0);b.displayChecked(this,a('input[name="answerPointsDiffModusActivated"]'),!0,!0);this.checked?(a('input[name="answerPointsDiffModusActivated"]').change(),a('input[name="disableCorrect"]').change()):(a(".classic_answer .wpProQuiz_classCorrect").parent().parent().show(),a('input[name="disableCorrect"]').attr("disabled","disabled"))}).change();a('select[name="category"]').change(function(){var b=a(this),c=a("#categoryAddBox").hide();"-1"==b.val()&&c.show()}).change();a("#categoryAddBtn").click(function(){c.addCategory()});
59
+ a(".addMedia").click(c.addMediaClick);a('input[name="answerPointsDiffModusActivated"]').change(function(){b.displayChecked(this,a('input[name="disableCorrect"]'),!0,!0);this.checked?a('input[name="disableCorrect"]').change():a(".classic_answer .wpProQuiz_classCorrect").parent().parent().show()}).change();a('input[name="disableCorrect"]').change(function(){b.displayChecked(this,a(".classic_answer .wpProQuiz_classCorrect").parent().parent(),!0)}).change();a("#clickPointDia").click(function(){a(".pointDia").toggle("fast");
60
+ return!1});a('input[name="template"]').click(function(d){if("0"==a('select[name="templateSaveList"]').val()&&b.isEmpty(a('input[name="templateName"]').val()))return alert(wpProQuizLocalize.temploate_no_name),d.preventDefault(),!1;c.generateArrayIndex()});a('select[name="templateSaveList"]').change(function(){var b=a('input[name="templateName"]');"0"==a(this).val()?b.show():b.hide()}).change()})()},e=function(){var c=this,d=a("#quizId").val(),e="users",g=a("#wpProQuiz_currentPage"),h=a("#wpProQuiz_pageLeft"),
61
+ m=a("#wpProQuiz_pageRight"),k=a("#testSelect"),c={loadStatistic:function(a,c){b.ajaxPost("statisticLoad",{userId:a},function(a){})},loadUsersStatistic:function(){var n={userId:a("#userSelect").val(),quizId:d,testId:a("#testSelect").val()};c.toggleLoadBox(!1);b.ajaxPost("statisticLoad",n,function(b){a.each(b.question,function(){var b=a("#wpProQuiz_tr_"+this.questionId);c.setStatisticData(b,this)});a.each(b.category,function(b,d){var n=a("#wpProQuiz_ctr_"+b);c.setStatisticData(n,d)});a("#testSelect option:gt(0)").remove();
62
+ var d=a("#testSelect");a.each(b.tests,function(){var c=a(document.createElement("option"));c.val(this.id);c.text(this.date);b.testId==this.id&&c.attr("selected",!0);d.append(c)});c.parseFormData(b.formData);c.toggleLoadBox(!0)})},loadUsersStatistic_:function(n,e){var g={userId:n,quizId:d,testId:e};c.toggleLoadBox(!1);b.ajaxPost("statisticLoad",g,function(b){a.each(b.question,function(){var b=a("#wpProQuiz_tr_"+this.questionId);c.setStatisticData(b,this)});a.each(b.category,function(b,d){var n=a("#wpProQuiz_ctr_"+
63
+ b);c.setStatisticData(n,d)});a("#testSelect option:gt(0)").remove();var d=a("#testSelect");a.each(b.tests,function(){var c=a(document.createElement("option"));c.val(this.id);c.text(this.date);b.testId==this.id&&c.attr("selected",!0);d.append(c)});c.parseFormData(b.formData);a("#userSelect").val(n);a("#testSelect").val(e);c.toggleLoadBox(!0)})},parseFormData:function(b){var c=a("#wpProQuiz_form_box");null==b?c.hide():(a.each(b,function(b,c){a("#form_id_"+b).text(c)}),c.show())},setStatisticData:function(a,
64
+ b){a.find(".wpProQuiz_cCorrect").text(b.correct);a.find(".wpProQuiz_cIncorrect").text(b.incorrect);a.find(".wpProQuiz_cTip").text(b.hint);a.find(".wpProQuiz_cPoints").text(b.points);a.find(".wpProQuiz_cResult").text(b.result);a.find(".wpProQuiz_cTime").text(b.questionTime);a.find(".wpProQuiz_cCreateTime").text(b.date)},toggleLoadBox:function(b){var c=a("#wpProQuiz_loadData"),d=a("#wpProQuiz_content");b?(c.hide(),d.show()):(d.hide(),c.show())},reset:function(e){var g=a("#userSelect").val();confirm(wpProQuizLocalize.reset_statistics_msg)&&
65
+ (e={quizId:d,userId:g,testId:k.val(),type:e},c.toggleLoadBox(!1),b.ajaxPost("statisticReset",e,function(){c.loadUsersStatistic()}))},loadStatisticOverview:function(e){e={quizId:d,pageLimit:a("#wpProQuiz_pageLimit").val(),onlyCompleted:Number(a("#wpProQuiz_onlyCompleted").is(":checked")),page:g.val(),nav:Number(e)};c.toggleLoadBox(!1);b.ajaxPost("statisticLoadOverview",e,function(b){var d=a("#wpProQuiz_statistics_overview_data"),e=d.children(),g=e.first().clone();e.slice(1).remove();a.each(b.items,
66
+ function(){var b=g.clone();c.setStatisticData(b,this);b.find("a").text(this.userName).data("userId",this.userId).click(function(){a("#userSelect").val(a(this).data("userId"));a("#wpProQuiz_typeUser").click();return!1});b.show().appendTo(d)});g.remove();c.toggleLoadBox(!0);void 0!=b.page&&c.handleNav(b.page)})},handleNav:function(b){for(var d=a("#wpProQuiz_currentPage").empty(),e=1;e<=b;e++)a(document.createElement("option")).val(e).text(e).appendTo(d);c.checkNavBar()},checkNavBar:function(){var a=
67
+ g.val();1==a?h.hide():h.show();a==g.children().length?m.hide():m.show()},refresh:function(){"users"==e?c.loadUsersStatistic():"formOverview"==e?c.loadFormsOverview(!0):c.loadStatisticOverview(!0)},loadFormsOverview:function(e){e={quizId:d,pageLimit:a("#wpProQuiz_fromPageLimit").val(),onlyUser:a("#wpProQuiz_formUser").val(),page:a("#wpProQuiz_formCurrentPage").val(),nav:Number(e)};c.toggleLoadBox(!1);b.ajaxPost("statisticLoadFormOverview",e,function(b){var d=a("#wpProQuiz_statistics_form_data"),e=
68
+ d.children(),g=e.first().clone();e.slice(1).remove();a.each(b.items,function(){var b=g.clone();c.setStatisticData(b,this);b.find("a").text(this.userName).data("userId",this.userId).data("testId",this.testId).click(function(){c.switchTabOnLoad("users");c.loadUsersStatistic_(a(this).data("userId"),a(this).data("testId"));return!1});b.show().appendTo(d)});g.remove();c.toggleLoadBox(!0);void 0!=b.page&&c.handleFormNav(b.page)})},handleFormNav:function(b){for(var d=a("#wpProQuiz_formCurrentPage").empty(),
69
+ e=1;e<=b;e++)a(document.createElement("option")).val(e).text(e).appendTo(d);c.checkFormNavBar()},checkFormNavBar:function(){var b=a("#wpProQuiz_formCurrentPage").val();1==b?a("#wpProQuiz_formPageLeft").hide():a("#wpProQuiz_formPageLeft").show();b==a("#wpProQuiz_formCurrentPage").children().length?a("#wpProQuiz_formPageRight").hide():a("#wpProQuiz_formPageRight").show()},switchTabOnLoad:function(b){a(".wpProQuiz_tab").removeClass("button-primary").addClass("button-secondary");a(".wpProQuiz_tabContent").hide();
70
+ var c=a("#wpProQuiz_typeOverview");"users"==b?(e="users",a("#wpProQuiz_tabUsers").show(),c=a("#wpProQuiz_typeUser")):"formOverview"==b?(e="formOverview",a("#wpProQuiz_tabFormOverview").show(),c=a("#wpProQuiz_typeForm")):(e="overview",a("#wpProQuiz_tabOverview").show());c.removeClass("button-secondary").addClass("button-primary")}};(function(){a("#userSelect, #testSelect").change(function(){c.loadUsersStatistic()});a(".wpProQuiz_update").click(function(){c.refresh()});a("#wpProQuiz_reset").click(function(){c.reset(0)});
71
+ a("#wpProQuiz_resetUser").click(function(){c.reset(1)});a(".wpProQuiz_resetComplete").click(function(){c.reset(2)});a(".wpProQuiz_tab").click(function(){var b=a(this);a(".wpProQuiz_tab").removeClass("button-primary").addClass("button-secondary");b.removeClass("button-secondary").addClass("button-primary");a(".wpProQuiz_tabContent").hide();"wpProQuiz_typeUser"==b.attr("id")?(e="users",a("#wpProQuiz_tabUsers").show(),c.loadUsersStatistic()):"wpProQuiz_typeForm"==b.attr("id")?(e="formOverview",a("#wpProQuiz_tabFormOverview").show(),
72
+ c.loadFormsOverview(!0)):(e="overview",a("#wpProQuiz_tabOverview").show(),c.loadStatisticOverview(!0));return!1});a("#wpProQuiz_onlyCompleted").change(function(){g.val(1);c.loadStatisticOverview(!0)});a("#wpProQuiz_pageLimit").change(function(){g.val(1);c.loadStatisticOverview(!0)});h.click(function(){g.val(Number(g.val())-1);c.loadStatisticOverview(!1);c.checkNavBar()});m.click(function(){g.val(Number(g.val())+1);c.loadStatisticOverview(!1);c.checkNavBar()});g.change(function(){c.loadStatisticOverview(!1);
73
+ c.checkNavBar()});a("#wpProQuiz_formUser, #wpProQuiz_fromPageLimit").change(function(){a("#wpProQuiz_formCurrentPage").val(1);c.loadFormsOverview(!0)});a("#wpProQuiz_formPageLeft").click(function(){a("#wpProQuiz_formCurrentPage").val(Number(g.val())-1);c.loadFormsOverview(!1);c.checkFormNavBar()});a("#wpProQuiz_formPageRight").click(function(){a("#wpProQuiz_formCurrentPage").val(Number(g.val())+1);c.loadFormsOverview(!1);c.checkFormNavBar()});a("#wpProQuiz_formCurrentPage").change(function(){c.loadFormsOverview(!1);
74
+ c.checkFormNavBar()});c.loadUsersStatistic()})()},p=function(){var c=a("#quizId").val(),d=null,e=null,g={data:{quizId:c,users:-1,pageLimit:100,dateFrom:0,dateTo:0,generateNav:0},changeFilter:function(){var b=function(a){a=a.datepicker("getDate");return null===a?0:a.getTime()/1E3};a.extend(this.data,{users:a("#wpProQuiz_historyUser").val(),pageLimit:a("#wpProQuiz_historyPageLimit").val(),dateFrom:b(a("#datepickerFrom")),dateTo:b(a("#datepickerTo")),generateNav:1});return this.data}},h={data:{pageLimit:100,
75
+ onlyCompleted:0,generateNav:0,quizId:c},changeFilter:function(){a.extend(this.data,{pageLimit:a("#wpProQuiz_overviewPageLimit").val(),onlyCompleted:Number(a("#wpProQuiz_overviewOnlyCompleted").is(":checked")),generateNav:1})}},m={deleteUserStatistic:function(d,e){if(!confirm(wpProQuizLocalize.reset_statistics_msg))return!1;b.ajaxPost("statisticResetNew",{refId:d,userId:e,quizId:c,type:0},function(){a("#wpProQuiz_user_overlay").hide();g.changeFilter();k.loadHistoryAjax();h.changeFilter();k.loadOverviewAjax()})},
76
+ deleteAll:function(){if(!confirm(wpProQuizLocalize.reset_statistics_msg))return!1;b.ajaxPost("statisticResetNew",{quizId:c,type:1},function(){g.changeFilter();k.loadHistoryAjax();h.changeFilter();k.loadOverviewAjax()})}},k={loadHistoryAjax:function(){var c=a.extend({page:g.data.generateNav?1:d.getCurrentPage()},g.data);k.loadBox(!0);var e=a("#wpProQuiz_historyLoadContext").hide();b.ajaxPost("statisticLoadHistory",c,function(b){e.html(b.html).show();b.navi&&d.setNumPage(b.navi);g.data.generateNav=
77
+ 0;e.find(".user_statistic").click(function(){k.loadUserAjax(0,a(this).data("ref_id"),!1);return!1});e.find(".wpProQuiz_delete").click(function(){m.deleteUserStatistic(a(this).parents("tr").find(".user_statistic").data("ref_id"),0);return!1});k.loadBox(!1)})},loadUserAjax:function(d,e,g){a("#wpProQuiz_user_overlay, #wpProQuiz_loadUserData").show();var h=a("#wpProQuiz_user_content").hide();b.ajaxPost("statisticLoadUser",{quizId:c,userId:d,refId:e,avg:Number(g)},function(b){h.html(b.html);h.find(".wpProQuiz_update").click(function(){k.loadUserAjax(d,
78
+ e,g);return!1});h.find("#wpProQuiz_resetUserStatistic").click(function(){m.deleteUserStatistic(e,d)});h.find(".statistic_data").click(function(){a(this).parents("tr").next().toggle("fast");return!1});a("#wpProQuiz_loadUserData").hide();h.show()})},loadBox:function(b,c){b?a("#wpProQuiz_loadDataHistory").show():a("#wpProQuiz_loadDataHistory").hide()},loadOverviewAjax:function(){var c=a.extend({page:h.data.generateNav?1:e.getCurrentPage()},h.data);a("#wpProQuiz_loadDataOverview").show();var d=a("#wpProQuiz_overviewLoadContext").hide();
79
+ b.ajaxPost("statisticLoadOverviewNew",c,function(b){d.html(b.html).show();b.navi&&e.setNumPage(b.navi);h.data.generateNav=0;d.find(".user_statistic").click(function(){k.loadUserAjax(a(this).data("user_id"),0,!0);return!1});d.find(".wpProQuiz_delete").click(function(){m.deleteUserStatistic(0,a(this).parents("tr").find(".user_statistic").data("user_id"));return!1});a("#wpProQuiz_loadDataOverview").hide()})}};(function(){d=new r(a("#historyNavigation"),{onChange:function(){k.loadHistoryAjax()}});e=new r(a("#overviewNavigation"),
80
+ {onChange:function(){k.loadOverviewAjax()}});a("#datepickerFrom").datepicker({closeText:wpProQuizLocalize.closeText,currentText:wpProQuizLocalize.currentText,monthNames:wpProQuizLocalize.monthNames,monthNamesShort:wpProQuizLocalize.monthNamesShort,dayNames:wpProQuizLocalize.dayNames,dayNamesShort:wpProQuizLocalize.dayNamesShort,dayNamesMin:wpProQuizLocalize.dayNamesMin,dateFormat:wpProQuizLocalize.dateFormat,firstDay:wpProQuizLocalize.firstDay,changeMonth:!0,onClose:function(b){a("#datepickerTo").datepicker("option",
81
+ "minDate",b)}});a("#datepickerTo").datepicker({closeText:wpProQuizLocalize.closeText,currentText:wpProQuizLocalize.currentText,monthNames:wpProQuizLocalize.monthNames,monthNamesShort:wpProQuizLocalize.monthNamesShort,dayNames:wpProQuizLocalize.dayNames,dayNamesShort:wpProQuizLocalize.dayNamesShort,dayNamesMin:wpProQuizLocalize.dayNamesMin,dateFormat:wpProQuizLocalize.dateFormat,firstDay:wpProQuizLocalize.firstDay,changeMonth:!0,onClose:function(b){a("#datepickerFrom").datepicker("option","maxDate",
82
+ b)}});a("#filter").click(function(){g.changeFilter();k.loadHistoryAjax()});a("#wpProQuiz_overlay_close").click(function(){a("#wpProQuiz_user_overlay").hide()});a("#wpProQuiz_tabHistory .wpProQuiz_update").click(function(){g.changeFilter();k.loadHistoryAjax();return!1});a("#wpProQuiz_tabOverview .wpProQuiz_update").click(function(){h.changeFilter();k.loadOverviewAjax();return!1});a(".wpProQuiz_resetComplete").click(function(){m.deleteAll();return!1});a("#overviewFilter").click(function(){h.changeFilter();
83
+ k.loadOverviewAjax()});g.changeFilter();k.loadHistoryAjax();h.changeFilter();k.loadOverviewAjax()})()};(function(){h();var b=a.noop;a(".wpProQuiz_questionEdit").length?b=d:a(".wpProQuiz_globalSettings").length?b=c:a(".wpProQuiz_statistics").length?b=e:a(".wpProQuiz_statisticsNew").length&&(b=p);b();a(".wpProQuiz_demoImgBox a").mouseover(function(b){var c=a(this),d=a(document).width(),c=c.siblings().outerWidth(!0);b.pageX+c>d&&(b=d-(b.pageX+c+30),a(this).next().css("left",b+"px"));a(this).next().show()}).mouseout(function(){a(this).next().hide()}).click(function(){return!1})})()})()});
js/wpProQuiz_front.js CHANGED
@@ -14,6 +14,7 @@
14
  var quizSolved = [];
15
  var lastButtonValue = "";
16
  var inViewQuestions = false;
 
17
 
18
  var bitOptions = {
19
  randomAnswer: 0,
@@ -28,21 +29,27 @@
28
  reviewQustion: 0,
29
  autoStart: 0,
30
  forcingQuestionSolve: 0,
31
- hideQuestionPositionOverview: 0
 
 
 
32
  };
33
 
34
  var quizStatus = {
35
  isQuizStart: 0,
36
  isLocked: 0,
37
  loadLock: 0,
38
- isPrerequisite: 0
 
39
  };
40
 
41
  var globalNames = {
42
- check: 'input[name="check"]',
43
- next: 'input[name="next"]',
44
- questionList: '.wpProQuiz_questionList',
45
- skip: 'input[name="skip"]'
 
 
46
  };
47
 
48
  var globalElements = {
@@ -62,6 +69,11 @@
62
  isUser: 0
63
  };
64
 
 
 
 
 
 
65
  /**
66
  * @memberOf timelimit
67
  */
@@ -364,6 +376,7 @@
364
  var correct = true;
365
  var points = 0;
366
  var isDiffPoints = $.isArray(data.points);
 
367
 
368
  var func = {
369
  singleMulti: function() {
@@ -419,6 +432,8 @@
419
  $items.each(function(i, v) {
420
  var $this = $(this);
421
 
 
 
422
  if(i == $this.data('pos')) {
423
  plugin.methode.marker($this, true);
424
 
@@ -445,6 +460,7 @@
445
  matrix_sort_answer: function() {
446
  var $items = $questionList.children();
447
  var matrix = new Array();
 
448
 
449
  $items.each(function() {
450
  var $this = $(this);
@@ -452,7 +468,11 @@
452
  var $stringUl = $this.find('.wpProQuiz_maxtrixSortCriterion');
453
  var $stringItem = $stringUl.children();
454
 
455
- if(i == $stringItem.data('pos')) {
 
 
 
 
456
  plugin.methode.marker($stringUl, true);
457
 
458
  if(isDiffPoints) {
@@ -538,9 +558,226 @@
538
  points = data.points;
539
  }
540
 
541
- return {c: correct, p: points};
542
  };
543