LearnPress – WordPress LMS Plugin - Version 3.0.8

Version Description

~ Improved: get css class name for items for performance ~ Improved: check item is blocked for performance ~ Improved: upgrade database feature ~ Fixed: warning message when searching posts in frontend ~ Fixed: show 2 comments form in lesson page ~ Fixed: content of lesson does not show if set post-format to video ~ Fixed: some warning when getting question class with an array of post-type ~ Fixed: mysql error when updating item's grade with value is null

Download this release

Release Info

Developer tunnhn
Plugin Icon 128x128 LearnPress – WordPress LMS Plugin
Version 3.0.8
Comparing to
See all releases

Code changes from version 3.0.7 to 3.0.8

Files changed (136) hide show
  1. assets/css/admin/admin.css +58 -41
  2. assets/css/learnpress.css +117 -83
  3. assets/js/admin/admin.js +9 -3
  4. assets/js/admin/course-editor.js +2 -1
  5. assets/js/admin/quiz-editor.js +10 -8
  6. assets/js/admin/update.js +1 -1
  7. assets/js/frontend/course.js +4 -1
  8. assets/js/frontend/profile.js +1 -1
  9. assets/js/frontend/quiz.js +19 -4
  10. assets/scss/_mixin.scss +41 -1
  11. assets/scss/admin/_admin-editor.scss +7 -46
  12. assets/scss/admin/_admin-tools.scss +9 -1
  13. assets/scss/admin/_general.scss +1 -1
  14. assets/scss/admin/_question-editor.scss +1 -2
  15. assets/scss/admin/_quiz-editor.scss +0 -9
  16. assets/scss/admin/admin.scss +12 -0
  17. assets/scss/frontend/_curriculum.scss +0 -87
  18. assets/scss/frontend/_quiz.scss +142 -25
  19. inc/abstract-settings.php +10 -0
  20. inc/abstracts/abstract-background-process.php +14 -4
  21. inc/admin/class-lp-admin-dashboard.php +2 -2
  22. inc/admin/class-lp-admin-menu.php +0 -2
  23. inc/admin/class-lp-admin.php +4 -0
  24. inc/admin/class-lp-reset-data.php +31 -6
  25. inc/admin/class-lp-updater.php +85 -25
  26. inc/admin/editor/class-lp-admin-editor.php +2 -0
  27. inc/admin/helpers/class-lp-plugins-helper.php +6 -6
  28. inc/admin/lp-admin-functions.php +29 -12
  29. inc/admin/meta-box/fields/course-permalink.php +33 -25
  30. inc/admin/meta-box/fields/email-content.php +6 -7
  31. inc/admin/meta-box/fields/list-emails.php +0 -1
  32. inc/admin/settings/abstract-settings-page.php +1 -0
  33. inc/admin/settings/class-lp-settings-courses.php +23 -23
  34. inc/admin/settings/class-lp-settings-emails.php +11 -0
  35. inc/admin/views/course/curriculum.php +1 -1
  36. inc/admin/views/course/editor.php +2 -2
  37. inc/admin/views/course/modal-choose-items.php +1 -1
  38. inc/admin/views/course/new-section-item.php +2 -2
  39. inc/admin/views/course/section-item.php +10 -13
  40. inc/admin/views/course/section.php +18 -3
  41. inc/admin/views/dashboard/plugin-status/html-results.php +1 -1
  42. inc/admin/views/meta-boxes/order/child-order.php +41 -0
  43. inc/admin/views/meta-boxes/order/details.php +8 -5
  44. inc/admin/views/question/option.php +7 -1
  45. inc/admin/views/quiz/editor.php +1 -1
  46. inc/admin/views/quiz/question-actions.php +31 -12
  47. inc/admin/views/quiz/question-answer-option.php +1 -1
  48. inc/admin/views/quiz/question-answer.php +2 -2
  49. inc/admin/views/quiz/question-settings.php +2 -2
  50. inc/admin/views/tools/course/html-course.php +23 -11
  51. inc/admin/views/tools/course/html-user-item.php +5 -5
  52. inc/admin/views/tools/course/html-user.php +51 -15
  53. inc/admin/views/updates/html-updated-latest-message.php +17 -0
  54. inc/admin/views/updates/html-updating-message.php +51 -0
  55. inc/background-process/class-lp-background-clear-temp-users.php +3 -1
  56. inc/background-process/class-lp-background-emailer.php +4 -1
  57. inc/background-process/class-lp-background-global.php +8 -3
  58. inc/background-process/class-lp-background-installer.php +41 -3
  59. inc/background-process/class-lp-background-query-items.php +5 -2
  60. inc/background-process/class-lp-background-schedule-items.php +58 -40
  61. inc/class-lp-ajax.php +2 -3
  62. inc/class-lp-checkout.php +5 -0
  63. inc/class-lp-debug.php +76 -4
  64. inc/class-lp-emails.php +57 -19
  65. inc/class-lp-forms-handler.php +1 -1
  66. inc/class-lp-install.php +25 -10
  67. inc/class-lp-market-products.php +40 -0
  68. inc/class-lp-page-controller.php +3 -6
  69. inc/class-lp-query.php +1 -0
  70. inc/class-lp-request-handler.php +35 -18
  71. inc/class-lp-schedules.php +7 -9
  72. inc/class-lp-session-handler.php +12 -2
  73. inc/course/abstract-course.php +15 -2
  74. inc/course/class-lp-course-item.php +220 -117
  75. inc/course/lp-course-functions.php +16 -3
  76. inc/curds/class-lp-order-curd.php +96 -95
  77. inc/curds/class-lp-question-curd.php +1 -1
  78. inc/curds/class-lp-quiz-curd.php +5 -5
  79. inc/curds/class-lp-user-curd.php +104 -5
  80. inc/curds/class-lp-user-item-curd.php +2 -1
  81. inc/custom-post-types/abstract.php +78 -12
  82. inc/custom-post-types/course.php +3 -3
  83. inc/custom-post-types/lesson.php +18 -1
  84. inc/custom-post-types/order.php +24 -5
  85. inc/custom-post-types/question.php +18 -4
  86. inc/custom-post-types/quiz.php +20 -18
  87. inc/emails/_bk/class-lp-email-finished-course-admin.php +0 -199
  88. inc/emails/_bk/class-lp-email-finished-course-instructor.php +0 -201
  89. inc/emails/_bk/class-lp-email-finished-course-user.php +0 -201
  90. inc/emails/class-lp-email-new-order-admin.php +10 -3
  91. inc/emails/class-lp-email.php +30 -16
  92. inc/emails/types/class-lp-email-type-enrolled-course.php +40 -0
  93. inc/lesson/class-lp-lesson.php +1 -0
  94. inc/lesson/lp-lesson-functions.php +7 -3
  95. inc/lp-constants.php +7 -2
  96. inc/lp-core-functions.php +88 -28
  97. inc/lp-template-functions.php +68 -46
  98. inc/lp-template-hooks.php +5 -1
  99. inc/order/lp-order-functions.php +1 -1
  100. inc/question/class-lp-question-answers.php +15 -5
  101. inc/question/class-lp-question-true-or-false.php +8 -6
  102. inc/question/class-lp-question.php +10 -4
  103. inc/quiz/class-lp-quiz-factory.php +28 -8
  104. inc/quiz/class-lp-quiz.php +43 -7
  105. inc/quiz/lp-quiz-functions.php +19 -17
  106. inc/updates/learnpress-update-3.0.0.php +295 -199
  107. inc/updates/learnpress-update-3.0.4.php +11 -24
  108. inc/updates/learnpress-update-3.0.8.php +29 -0
  109. inc/updates/learnpress-update-base.php +121 -0
  110. inc/user-item/class-lp-user-item-course.php +43 -3
  111. inc/user-item/class-lp-user-item-quiz.php +26 -9
  112. inc/user-item/class-lp-user-item.php +13 -7
  113. inc/user/abstract-lp-user.php +169 -463
  114. inc/user/class-lp-profile.php +13 -1
  115. inc/user/class-lp-user-factory.php +16 -13
  116. inc/user/lp-user-functions.php +80 -58
  117. languages/learnpress.pot +778 -737
  118. learnpress.php +94 -15
  119. readme.txt +11 -2
  120. templates/checkout/order-received.php +29 -2
  121. templates/content-question/multi-choice/answer-options.php +1 -0
  122. templates/content-quiz/buttons/check.php +0 -1
  123. templates/content-quiz/buttons/nav.php +7 -3
  124. templates/content-quiz/history.php +1 -1
  125. templates/content-quiz/progress.php +5 -7
  126. templates/content-quiz/question-numbers.php +9 -12
  127. templates/emails/email-footer.php +3 -1
  128. templates/emails/email-header.php +5 -2
  129. templates/global/blank-comments.php +4 -0
  130. templates/{content-lesson → global}/block-content.php +5 -3
  131. templates/global/comments.php +0 -0
  132. templates/global/scripts.php +1 -1
  133. templates/profile/tabs/quizzes.php +3 -6
  134. templates/single-course/content-item.php +10 -5
  135. templates/single-course/content-protected.php +11 -2
  136. templates/single-course/status.php +1 -1
assets/css/admin/admin.css CHANGED
@@ -1,6 +1,30 @@
1
  /**
2
  * Mixin
3
  */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  /**
5
  * Styles for displaying list of table
6
  */
@@ -494,7 +518,7 @@
494
  .learn-press-payments th, .learn-press-payments td,
495
  .learn-press-emails th,
496
  .learn-press-emails td {
497
- padding: 8px 10px; }
498
  .learn-press-payments .order,
499
  .learn-press-emails .order {
500
  width: 30px;
@@ -1801,30 +1825,6 @@
1801
  /**
1802
  * General style for admin editor.
1803
  */
1804
- @-webkit-keyframes rotating4 /* Safari and Chrome */ {
1805
- from {
1806
- -webkit-transform: rotate(0deg);
1807
- -o-transform: rotate(0deg);
1808
- transform: rotate(0deg); }
1809
- to {
1810
- -webkit-transform: rotate(360deg);
1811
- -o-transform: rotate(360deg);
1812
- transform: rotate(360deg); } }
1813
-
1814
- @keyframes rotating4 {
1815
- from {
1816
- -ms-transform: rotate(0deg);
1817
- -moz-transform: rotate(0deg);
1818
- -webkit-transform: rotate(0deg);
1819
- -o-transform: rotate(0deg);
1820
- transform: rotate(0deg); }
1821
- to {
1822
- -ms-transform: rotate(360deg);
1823
- -moz-transform: rotate(360deg);
1824
- -webkit-transform: rotate(360deg);
1825
- -o-transform: rotate(360deg);
1826
- transform: rotate(360deg); } }
1827
-
1828
  .lp-admin-editor {
1829
  background-color: #fff;
1830
  border: 1px solid #ddd;
@@ -2011,7 +2011,8 @@
2011
  border-collapse: collapse; }
2012
  #admin-editor-lp_course .lp-course-curriculum .section-list-items ul {
2013
  margin: 0;
2014
- min-height: 5px; }
 
2015
  #admin-editor-lp_course .lp-course-curriculum .section-list-items .section-item {
2016
  border: 1px solid #eee;
2017
  position: relative;
@@ -2233,7 +2234,6 @@
2233
  line-height: 44px;
2234
  font-size: 12px; }
2235
  .section-item-counts span {
2236
- font-weight: bold;
2237
  color: #999; }
2238
 
2239
  /**
@@ -2293,7 +2293,6 @@
2293
  #admin-editor-lp_quiz .lp-box-data-content .lp-list-questions .table-row > .order {
2294
  flex: 0 0 30px;
2295
  text-align: right;
2296
- font-weight: bold;
2297
  font-size: 15px;
2298
  padding: 12px 0; }
2299
  #admin-editor-lp_quiz .lp-box-data-content .lp-list-questions .table-row > .order:after {
@@ -2354,8 +2353,7 @@
2354
  height: 42px; }
2355
  #admin-editor-lp_quiz .lp-box-data-content .lp-list-questions .main .question-settings .quiz-question-data table.lp-list-options tbody tr {
2356
  background: #fff;
2357
- border: 1px solid #DDD;
2358
- position: relative; }
2359
  #admin-editor-lp_quiz .lp-box-data-content .lp-list-questions .main .question-settings .quiz-question-data table.lp-list-options tbody tr:nth-child(2n) {
2360
  background: #f4fcff; }
2361
  #admin-editor-lp_quiz .lp-box-data-content .lp-list-questions .main .question-settings .quiz-question-data table.lp-list-options tbody tr td {
@@ -2365,10 +2363,7 @@
2365
  border: none; }
2366
  #admin-editor-lp_quiz .lp-box-data-content .lp-list-questions .main .question-settings .quiz-question-data table.lp-list-options tbody tr td.sort {
2367
  cursor: url("../../images/openhand.cur") 7 5, default;
2368
- width: 12px;
2369
- position: relative; }
2370
- #admin-editor-lp_quiz .lp-box-data-content .lp-list-questions .main .question-settings .quiz-question-data table.lp-list-options tbody tr td.order {
2371
- font-weight: bold; }
2372
  #admin-editor-lp_quiz .lp-box-data-content .lp-list-questions .main .question-settings .quiz-question-data table.lp-list-options tbody tr td.answer-text {
2373
  padding-left: 5px; }
2374
  #admin-editor-lp_quiz .lp-box-data-content .lp-list-questions .main .question-settings .quiz-question-data table.lp-list-options tbody tr td.answer-correct {
@@ -2630,7 +2625,7 @@
2630
  #admin-editor-lp_quiz .lp-box-data-content .question-button-actions {
2631
  text-align: left; }
2632
 
2633
- /**
2634
  * Question admin editor.
2635
  */
2636
  #admin-editor-lp_question {
@@ -2715,8 +2710,7 @@
2715
  #admin-editor-lp_question .lp-box-data-content table.list-question-answers .order {
2716
  text-align: right;
2717
  padding: 0;
2718
- width: 30px;
2719
- font-weight: bold; }
2720
  #admin-editor-lp_question .lp-box-data-content table.list-question-answers .answer-correct {
2721
  width: 65px;
2722
  text-align: center; }
@@ -2956,10 +2950,8 @@
2956
  #lp-modal-choose-items .lp-choose-items .footer {
2957
  padding: 20px; }
2958
 
2959
- body.moving {
2960
  cursor: url("../../images/closedhand.cur") 7 5, default !important; }
2961
- body.moving .section-item .drag {
2962
- cursor: url("../../images/closedhand.cur") 7 5, default !important; }
2963
 
2964
  @media screen and (max-width: 900px) {
2965
  #admin-editor-lp_quiz .lp-box-data-content .lp-list-questions .question-settings.table-row {
@@ -2985,9 +2977,21 @@ body.moving {
2985
  #learn-press-reset-course-users input[type="text"],
2986
  #learn-press-reset-user-courses input[type="text"],
2987
  #learn-press-reset-user-item input[type="text"] {
2988
- min-width: 200px;
2989
  height: 28px;
2990
  margin-left: 0; }
 
 
 
 
 
 
 
 
 
 
 
 
2991
 
2992
  .learn-press-tip {
2993
  display: none;
@@ -3092,6 +3096,19 @@ body.moving {
3092
 
3093
  .lp-notice-update-database {
3094
  border-left-color: #FF0000; }
 
 
 
 
 
 
 
 
 
 
 
 
 
3095
 
3096
  #adminmenu .update-plugins.lp-plugins-count {
3097
  padding: 0 5px; }
1
  /**
2
  * Mixin
3
  */
4
+ @-webkit-keyframes rotating4 /* Safari and Chrome */ {
5
+ from {
6
+ -webkit-transform: rotate(0deg);
7
+ -o-transform: rotate(0deg);
8
+ transform: rotate(0deg); }
9
+ to {
10
+ -webkit-transform: rotate(360deg);
11
+ -o-transform: rotate(360deg);
12
+ transform: rotate(360deg); } }
13
+
14
+ @keyframes rotating4 {
15
+ from {
16
+ -ms-transform: rotate(0deg);
17
+ -moz-transform: rotate(0deg);
18
+ -webkit-transform: rotate(0deg);
19
+ -o-transform: rotate(0deg);
20
+ transform: rotate(0deg); }
21
+ to {
22
+ -ms-transform: rotate(360deg);
23
+ -moz-transform: rotate(360deg);
24
+ -webkit-transform: rotate(360deg);
25
+ -o-transform: rotate(360deg);
26
+ transform: rotate(360deg); } }
27
+
28
  /**
29
  * Styles for displaying list of table
30
  */
518
  .learn-press-payments th, .learn-press-payments td,
519
  .learn-press-emails th,
520
  .learn-press-emails td {
521
+ padding: 10px; }
522
  .learn-press-payments .order,
523
  .learn-press-emails .order {
524
  width: 30px;
1825
  /**
1826
  * General style for admin editor.
1827
  */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1828
  .lp-admin-editor {
1829
  background-color: #fff;
1830
  border: 1px solid #ddd;
2011
  border-collapse: collapse; }
2012
  #admin-editor-lp_course .lp-course-curriculum .section-list-items ul {
2013
  margin: 0;
2014
+ min-height: 5px;
2015
+ position: relative; }
2016
  #admin-editor-lp_course .lp-course-curriculum .section-list-items .section-item {
2017
  border: 1px solid #eee;
2018
  position: relative;
2234
  line-height: 44px;
2235
  font-size: 12px; }
2236
  .section-item-counts span {
 
2237
  color: #999; }
2238
 
2239
  /**
2293
  #admin-editor-lp_quiz .lp-box-data-content .lp-list-questions .table-row > .order {
2294
  flex: 0 0 30px;
2295
  text-align: right;
 
2296
  font-size: 15px;
2297
  padding: 12px 0; }
2298
  #admin-editor-lp_quiz .lp-box-data-content .lp-list-questions .table-row > .order:after {
2353
  height: 42px; }
2354
  #admin-editor-lp_quiz .lp-box-data-content .lp-list-questions .main .question-settings .quiz-question-data table.lp-list-options tbody tr {
2355
  background: #fff;
2356
+ border: 1px solid #DDD; }
 
2357
  #admin-editor-lp_quiz .lp-box-data-content .lp-list-questions .main .question-settings .quiz-question-data table.lp-list-options tbody tr:nth-child(2n) {
2358
  background: #f4fcff; }
2359
  #admin-editor-lp_quiz .lp-box-data-content .lp-list-questions .main .question-settings .quiz-question-data table.lp-list-options tbody tr td {
2363
  border: none; }
2364
  #admin-editor-lp_quiz .lp-box-data-content .lp-list-questions .main .question-settings .quiz-question-data table.lp-list-options tbody tr td.sort {
2365
  cursor: url("../../images/openhand.cur") 7 5, default;
2366
+ width: 12px; }
 
 
 
2367
  #admin-editor-lp_quiz .lp-box-data-content .lp-list-questions .main .question-settings .quiz-question-data table.lp-list-options tbody tr td.answer-text {
2368
  padding-left: 5px; }
2369
  #admin-editor-lp_quiz .lp-box-data-content .lp-list-questions .main .question-settings .quiz-question-data table.lp-list-options tbody tr td.answer-correct {
2625
  #admin-editor-lp_quiz .lp-box-data-content .question-button-actions {
2626
  text-align: left; }
2627
 
2628
+ /**.section-item-counts span
2629
  * Question admin editor.
2630
  */
2631
  #admin-editor-lp_question {
2710
  #admin-editor-lp_question .lp-box-data-content table.list-question-answers .order {
2711
  text-align: right;
2712
  padding: 0;
2713
+ width: 30px; }
 
2714
  #admin-editor-lp_question .lp-box-data-content table.list-question-answers .answer-correct {
2715
  width: 65px;
2716
  text-align: center; }
2950
  #lp-modal-choose-items .lp-choose-items .footer {
2951
  padding: 20px; }
2952
 
2953
+ body.lp-item-moving {
2954
  cursor: url("../../images/closedhand.cur") 7 5, default !important; }
 
 
2955
 
2956
  @media screen and (max-width: 900px) {
2957
  #admin-editor-lp_quiz .lp-box-data-content .lp-list-questions .question-settings.table-row {
2977
  #learn-press-reset-course-users input[type="text"],
2978
  #learn-press-reset-user-courses input[type="text"],
2979
  #learn-press-reset-user-item input[type="text"] {
2980
+ min-width: 300px;
2981
  height: 28px;
2982
  margin-left: 0; }
2983
+ #learn-press-reset-course-users .action-reset.dashicons-trash,
2984
+ #learn-press-reset-user-courses .action-reset.dashicons-trash,
2985
+ #learn-press-reset-user-item .action-reset.dashicons-trash {
2986
+ color: #FF0000; }
2987
+ #learn-press-reset-course-users .action-reset.dashicons-update,
2988
+ #learn-press-reset-user-courses .action-reset.dashicons-update,
2989
+ #learn-press-reset-user-item .action-reset.dashicons-update {
2990
+ -webkit-animation: rotating4 2s linear infinite;
2991
+ -moz-animation: rotating4 2s linear infinite;
2992
+ -ms-animation: rotating4 2s linear infinite;
2993
+ -o-animation: rotating4 2s linear infinite;
2994
+ animation: rotating4 2s linear infinite; }
2995
 
2996
  .learn-press-tip {
2997
  display: none;
3096
 
3097
  .lp-notice-update-database {
3098
  border-left-color: #FF0000; }
3099
+ .lp-notice-update-database.do-updating:before {
3100
+ display: inline-block;
3101
+ content: "\f463";
3102
+ font-family: dashicons;
3103
+ font-size: 20px;
3104
+ float: left;
3105
+ margin: 9px 5px 0 -5px;
3106
+ color: #2773aa;
3107
+ -webkit-animation: rotating4 2s linear infinite;
3108
+ -moz-animation: rotating4 2s linear infinite;
3109
+ -ms-animation: rotating4 2s linear infinite;
3110
+ -o-animation: rotating4 2s linear infinite;
3111
+ animation: rotating4 2s linear infinite; }
3112
 
3113
  #adminmenu .update-plugins.lp-plugins-count {
3114
  padding: 0 5px; }
assets/css/learnpress.css CHANGED
@@ -1,6 +1,30 @@
1
  /**
2
  * Mixin
3
  */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  @keyframes lp-rotating {
5
  from {
6
  transform: rotate(0deg);
@@ -1011,60 +1035,6 @@ body .lp-quiz-buttons .form-button-finish-course {
1011
  .scroll-wrapper:hover .scroll-element.scroll-y.scroll-scrolly_visible {
1012
  opacity: 0.7; }
1013
 
1014
- .question-numbers {
1015
- list-style: none;
1016
- text-align: center; }
1017
- .question-numbers li {
1018
- display: inline-block; }
1019
- .question-numbers li a {
1020
- display: block;
1021
- padding: 8px;
1022
- background: #F5F5F5;
1023
- line-height: 1;
1024
- color: #999;
1025
- border: 1px solid #DDD;
1026
- font-size: 12px;
1027
- min-width: 20px;
1028
- box-shadow: none; }
1029
- .question-numbers li a span {
1030
- vertical-align: middle; }
1031
- .question-numbers li a:hover {
1032
- background: #00adff;
1033
- color: #FFF;
1034
- border: 1px solid #3880a2; }
1035
- .question-numbers li.current a {
1036
- background: #00adff;
1037
- color: #FFF !important;
1038
- border-color: #3880a2; }
1039
- .question-numbers li.answered a:after {
1040
- font-family: fontawesome;
1041
- font-size: 8px;
1042
- vertical-align: middle;
1043
- margin-left: 3px; }
1044
- .question-numbers li.answered.answered-wrong a {
1045
- color: #FF0000; }
1046
- .question-numbers li.answered.answered-true a {
1047
- color: #00adff; }
1048
- .question-numbers li.answered.answered-true.current a {
1049
- color: #FFF; }
1050
-
1051
- .quiz-intro {
1052
- list-style: none;
1053
- margin: 0 0 20px;
1054
- padding: 0;
1055
- display: table; }
1056
- .quiz-intro li {
1057
- margin: 0;
1058
- display: table-row; }
1059
- .quiz-intro li label, .quiz-intro li span {
1060
- display: table-cell; }
1061
- .quiz-intro li label {
1062
- font-weight: bold;
1063
- padding: 0 20px 10px 0px;
1064
- line-height: 1; }
1065
- .quiz-intro li span {
1066
- text-align: left; }
1067
-
1068
  .course-remaining-time .lp-label.label-enrolled {
1069
  font-size: inherit; }
1070
 
@@ -1432,35 +1402,7 @@ body .lp-quiz-buttons .form-button-finish-course {
1432
  .answer-options .answer-option.answered-wrong input[type="radio"]:before, .answer-options .answer-option.answered-wrong input[type="radio"]:after,
1433
  .answer-options .answer-option.answered-wrong input[type="checkbox"]:before,
1434
  .answer-options .answer-option.answered-wrong input[type="checkbox"]:after {
1435
- position: absolute;
1436
- background: #FF0000;
1437
- border: none;
1438
- content: '';
1439
- display: inline-block;
1440
- left: 50%;
1441
- top: 50%;
1442
- -webkit-border-radius: 2px;
1443
- -moz-border-radius: 2px;
1444
- border-radius: 2px;
1445
- -webkit-transform: rotate(-45deg);
1446
- -moz-transform: rotate(-45deg);
1447
- -ms-transform: rotate(-45deg);
1448
- -o-transform: rotate(-45deg);
1449
- transform: rotate(-45deg); }
1450
- .answer-options .answer-option.answered-wrong input[type="radio"]:before,
1451
- .answer-options .answer-option.answered-wrong input[type="checkbox"]:before {
1452
- width: 2px;
1453
- height: 18px;
1454
- margin-top: -9px;
1455
- margin-left: -1px; }
1456
- .answer-options .answer-option.answered-wrong input[type="radio"]:after,
1457
- .answer-options .answer-option.answered-wrong input[type="checkbox"]:after {
1458
- width: 18px;
1459
- height: 2px;
1460
- margin-top: -1px;
1461
- margin-left: -9px;
1462
- border: none;
1463
- opacity: 1; }
1464
  .answer-options .answer-option.answered-wrong input[type="radio"]:checked ~ .option-title:before,
1465
  .answer-options .answer-option.answered-wrong input[type="checkbox"]:checked ~ .option-title:before {
1466
  background: #FF0000; }
@@ -1509,6 +1451,74 @@ button[data-counter] {
1509
  .quiz-result .result-statistic .result-statistic-field p {
1510
  text-align: right; }
1511
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1512
  .question-explanation-content,
1513
  .question-hint-content {
1514
  margin-bottom: 20px;
@@ -1704,6 +1714,30 @@ body.lp-preview #course-item-content-header {
1704
  /**
1705
  * Mixin
1706
  */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1707
  #popup_container {
1708
  opacity: 0;
1709
  transform: scale(0.5); }
1
  /**
2
  * Mixin
3
  */
4
+ @-webkit-keyframes rotating4 /* Safari and Chrome */ {
5
+ from {
6
+ -webkit-transform: rotate(0deg);
7
+ -o-transform: rotate(0deg);
8
+ transform: rotate(0deg); }
9
+ to {
10
+ -webkit-transform: rotate(360deg);
11
+ -o-transform: rotate(360deg);
12
+ transform: rotate(360deg); } }
13
+
14
+ @keyframes rotating4 {
15
+ from {
16
+ -ms-transform: rotate(0deg);
17
+ -moz-transform: rotate(0deg);
18
+ -webkit-transform: rotate(0deg);
19
+ -o-transform: rotate(0deg);
20
+ transform: rotate(0deg); }
21
+ to {
22
+ -ms-transform: rotate(360deg);
23
+ -moz-transform: rotate(360deg);
24
+ -webkit-transform: rotate(360deg);
25
+ -o-transform: rotate(360deg);
26
+ transform: rotate(360deg); } }
27
+
28
  @keyframes lp-rotating {
29
  from {
30
  transform: rotate(0deg);
1035
  .scroll-wrapper:hover .scroll-element.scroll-y.scroll-scrolly_visible {
1036
  opacity: 0.7; }
1037
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1038
  .course-remaining-time .lp-label.label-enrolled {
1039
  font-size: inherit; }
1040
 
1402
  .answer-options .answer-option.answered-wrong input[type="radio"]:before, .answer-options .answer-option.answered-wrong input[type="radio"]:after,
1403
  .answer-options .answer-option.answered-wrong input[type="checkbox"]:before,
1404
  .answer-options .answer-option.answered-wrong input[type="checkbox"]:after {
1405
+ border-color: #FF0000; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1406
  .answer-options .answer-option.answered-wrong input[type="radio"]:checked ~ .option-title:before,
1407
  .answer-options .answer-option.answered-wrong input[type="checkbox"]:checked ~ .option-title:before {
1408
  background: #FF0000; }
1451
  .quiz-result .result-statistic .result-statistic-field p {
1452
  text-align: right; }
1453
 
1454
+ .question-numbers {
1455
+ list-style: none;
1456
+ text-align: center; }
1457
+ .question-numbers li {
1458
+ display: inline-block;
1459
+ position: relative;
1460
+ margin-bottom: 3px; }
1461
+ .question-numbers li a {
1462
+ display: block;
1463
+ padding: 8px;
1464
+ background: #F5F5F5;
1465
+ line-height: 1;
1466
+ color: #999;
1467
+ border: 1px solid #DDD;
1468
+ font-size: 12px;
1469
+ min-width: 20px;
1470
+ box-shadow: none; }
1471
+ .question-numbers li a span {
1472
+ vertical-align: middle; }
1473
+ .question-numbers li a:hover {
1474
+ background: #00adff;
1475
+ color: #FFF;
1476
+ border: 1px solid #3880a2; }
1477
+ .question-numbers li.current a {
1478
+ background: #00adff;
1479
+ color: #FFF !important;
1480
+ border-color: #3880a2; }
1481
+ .question-numbers li.current.skipped:after {
1482
+ background: #FFF; }
1483
+ .question-numbers li.answered a:after {
1484
+ font-family: fontawesome;
1485
+ font-size: 8px;
1486
+ vertical-align: middle;
1487
+ margin-left: 3px; }
1488
+ .question-numbers li.answered.answered-wrong a {
1489
+ color: #FF0000; }
1490
+ .question-numbers li.answered.answered-true a {
1491
+ color: #00adff; }
1492
+ .question-numbers li.answered.answered-true.current a {
1493
+ color: #FFF; }
1494
+ .question-numbers li.skipped:after {
1495
+ content: '';
1496
+ background: #AAA;
1497
+ width: 10px;
1498
+ height: 4px;
1499
+ position: absolute;
1500
+ border-radius: 2px;
1501
+ left: 50%;
1502
+ margin-left: -5px;
1503
+ bottom: 3px; }
1504
+
1505
+ .quiz-intro {
1506
+ list-style: none;
1507
+ margin: 0 0 20px;
1508
+ padding: 0;
1509
+ display: table; }
1510
+ .quiz-intro li {
1511
+ margin: 0;
1512
+ display: table-row; }
1513
+ .quiz-intro li label, .quiz-intro li span {
1514
+ display: table-cell; }
1515
+ .quiz-intro li label {
1516
+ font-weight: bold;
1517
+ padding: 0 20px 10px 0px;
1518
+ line-height: 1; }
1519
+ .quiz-intro li span {
1520
+ text-align: left; }
1521
+
1522
  .question-explanation-content,
1523
  .question-hint-content {
1524
  margin-bottom: 20px;
1714
  /**
1715
  * Mixin
1716
  */
1717
+ @-webkit-keyframes rotating4 /* Safari and Chrome */ {
1718
+ from {
1719
+ -webkit-transform: rotate(0deg);
1720
+ -o-transform: rotate(0deg);
1721
+ transform: rotate(0deg); }
1722
+ to {
1723
+ -webkit-transform: rotate(360deg);
1724
+ -o-transform: rotate(360deg);
1725
+ transform: rotate(360deg); } }
1726
+
1727
+ @keyframes rotating4 {
1728
+ from {
1729
+ -ms-transform: rotate(0deg);
1730
+ -moz-transform: rotate(0deg);
1731
+ -webkit-transform: rotate(0deg);
1732
+ -o-transform: rotate(0deg);
1733
+ transform: rotate(0deg); }
1734
+ to {
1735
+ -ms-transform: rotate(360deg);
1736
+ -moz-transform: rotate(360deg);
1737
+ -webkit-transform: rotate(360deg);
1738
+ -o-transform: rotate(360deg);
1739
+ transform: rotate(360deg); } }
1740
+
1741
  #popup_container {
1742
  opacity: 0;
1743
  transform: scale(0.5); }
assets/js/admin/admin.js CHANGED
@@ -379,7 +379,6 @@
379
  }
380
 
381
 
382
-
383
  var $doc = $(document);
384
 
385
  function _ready() {
@@ -403,8 +402,15 @@
403
  .on('click', '.lp-upgrade-notice .close-notice', hideUpgradeMessage)
404
  .on('click', '.plugin-action-buttons a', pluginActions)
405
  .on('click', '.learn-press-filter-template', _callbackFilterTemplates)
406
- .on('click', '.lp-duplicate-row-action .lp-duplicate-post', _duplicatePost);
407
-
 
 
 
 
 
 
 
408
  LP_Admin.init();
409
  }
410
 
379
  }
380
 
381
 
 
382
  var $doc = $(document);
383
 
384
  function _ready() {
402
  .on('click', '.lp-upgrade-notice .close-notice', hideUpgradeMessage)
403
  .on('click', '.plugin-action-buttons a', pluginActions)
404
  .on('click', '.learn-press-filter-template', _callbackFilterTemplates)
405
+ .on('click', '.lp-duplicate-row-action .lp-duplicate-post', _duplicatePost)
406
+ .on('mousedown', '.lp-sortable-handle', function (e) {
407
+ $('html, body').addClass('lp-item-moving');
408
+ $(e.target).closest('.lp-sortable-handle').css('cursor', 'inherit');
409
+ })
410
+ .on('mouseup', function (e) {
411
+ $('html, body').removeClass('lp-item-moving');
412
+ $('.lp-sortable-handle').css('cursor', '');
413
+ })
414
  LP_Admin.init();
415
  }
416
 
assets/js/admin/course-editor.js CHANGED
@@ -15,7 +15,7 @@
15
  };
16
  })(window);
17
 
18
- jQuery(function () {
19
 
20
 
21
  /**
@@ -857,6 +857,7 @@ jQuery(function () {
857
  */
858
  (function ($, Vue, $store) {
859
  $(document).ready(function () {
 
860
  window.LP_Course_Editor = new Vue({
861
  el: '#admin-editor-lp_course',
862
  template: '<lp-course-editor></lp-course-editor>'
15
  };
16
  })(window);
17
 
18
+ jQuery(function ($) {
19
 
20
 
21
  /**
857
  */
858
  (function ($, Vue, $store) {
859
  $(document).ready(function () {
860
+ console.log($('#admin-editor-lp_course'))
861
  window.LP_Course_Editor = new Vue({
862
  el: '#admin-editor-lp_course',
863
  template: '<lp-course-editor></lp-course-editor>'
assets/js/admin/quiz-editor.js CHANGED
@@ -324,7 +324,7 @@ var LP_List_Quiz_Questions_Store = (function (Vue, helpers, data, $) {
324
  var found = false;
325
  if (question.temp_id) {
326
  for (var i = 0, n = state.questions.length; i < n; i++) {
327
- if (state.questions[i].id == question.temp_id) {
328
  Vue.set(state.questions, i, question);
329
  found = true;
330
  break;
@@ -332,13 +332,13 @@ var LP_List_Quiz_Questions_Store = (function (Vue, helpers, data, $) {
332
  }
333
  }
334
  if (!found) {
335
- state.questions.push(question);
336
- }
 
 
 
337
 
338
- var _last_child = $('.lp-list-questions .main > div:last-child');
339
- if (_last_child.length) {
340
- var _offset = _last_child.offset().top;
341
- $('html,body').animate({scrollTop: _offset});
342
  }
343
  },
344
  'CHANGE_QUESTION_TYPE': function (state, data) {
@@ -745,7 +745,9 @@ var LP_List_Quiz_Questions_Store = (function (Vue, helpers, data, $) {
745
  context.commit('ADD_QUESTION_ANSWER', {question_id: question_id, answer: answer});
746
  context.commit('UPDATE_QUESTION_SUCCESS', question_id);
747
 
748
- data.success && setTimeout(function(){data.success.apply(data.context, [answer]);}, 300);
 
 
749
  }
750
  },
751
  function (error) {
324
  var found = false;
325
  if (question.temp_id) {
326
  for (var i = 0, n = state.questions.length; i < n; i++) {
327
+ if (state.questions[i].id === question.temp_id) {
328
  Vue.set(state.questions, i, question);
329
  found = true;
330
  break;
332
  }
333
  }
334
  if (!found) {
335
+ var _last_child = $('.lp-list-questions .main > div:last-child');
336
+ if (_last_child.length) {
337
+ var _offset = _last_child.offset().top;
338
+ $('html,body').animate({scrollTop: _offset});
339
+ }
340
 
341
+ state.questions.push(question);
 
 
 
342
  }
343
  },
344
  'CHANGE_QUESTION_TYPE': function (state, data) {
745
  context.commit('ADD_QUESTION_ANSWER', {question_id: question_id, answer: answer});
746
  context.commit('UPDATE_QUESTION_SUCCESS', question_id);
747
 
748
+ data.success && setTimeout(function () {
749
+ data.success.apply(data.context, [answer]);
750
+ }, 300);
751
  }
752
  },
753
  function (error) {
assets/js/admin/update.js CHANGED
@@ -33,7 +33,7 @@
33
  context: context
34
  },
35
  success: function (res) {
36
- var $msg = $('<div class="notice notice-success"><p>' + $(res).find('#message-success').text() + '</p></div>');
37
  if (context == 'message') {
38
  $btn.closest('.notice').replaceWith($msg);
39
  } else {
33
  context: context
34
  },
35
  success: function (res) {
36
+ var $msg = $(res);
37
  if (context == 'message') {
38
  $btn.closest('.notice').replaceWith($msg);
39
  } else {
assets/js/frontend/course.js CHANGED
@@ -467,6 +467,10 @@
467
  setTimeout(function () {
468
  var $cs = $body.find('.curriculum-sections').parent();
469
  $cs.scrollTo($cs.find('.course-item.current'), 100);
 
 
 
 
470
  }, 300);
471
 
472
  $body.css('opacity', 1);
@@ -492,7 +496,6 @@
492
  return $.isArray(args) ? args[0] : undefined;
493
  },
494
  confirmHandle = function (e) {
495
-
496
  try {
497
  var $form = $(this),
498
  message = $form.data('confirm'),
467
  setTimeout(function () {
468
  var $cs = $body.find('.curriculum-sections').parent();
469
  $cs.scrollTo($cs.find('.course-item.current'), 100);
470
+
471
+ if (window.location.hash) {
472
+ $('.content-item-scrollable:last').scrollTo($(window.location.hash));
473
+ }
474
  }, 300);
475
 
476
  $body.css('opacity', 1);
496
  return $.isArray(args) ? args[0] : undefined;
497
  },
498
  confirmHandle = function (e) {
 
499
  try {
500
  var $form = $(this),
501
  message = $form.data('confirm'),
assets/js/frontend/profile.js CHANGED
@@ -358,4 +358,4 @@
358
  }
359
 
360
 
361
- })(jQuery);
358
  }
359
 
360
 
361
+ })(jQuery);
assets/js/frontend/quiz.js CHANGED
@@ -63,9 +63,9 @@
63
  }
64
 
65
  if (overtime) {
66
- // Disable confirm message
67
- $('form.complete-quiz').off('submit.learn-press-confirm');
68
- callbackEvents.callEvent('finish');
69
  return;
70
  }
71
  thisSettings.remainingTime--;
@@ -88,6 +88,9 @@
88
  callbackEvents.callEvent('tick', [newVal]);
89
  if (newVal <= 0) {
90
  stopCountdown();
 
 
 
91
  callbackEvents.callEvent('finish');
92
  }
93
  }
@@ -103,6 +106,16 @@
103
  $('form.complete-quiz').submit();
104
  }
105
 
 
 
 
 
 
 
 
 
 
 
106
  function init() {
107
  if (thisSettings.onTick) {
108
  self.on('tick', thisSettings.onTick);
@@ -111,6 +124,8 @@
111
  if (thisSettings.onFinish) {
112
  self.on('finish', thisSettings.onFinish);
113
  }
 
 
114
  initCountdown();
115
  timeCountdown();
116
  }
@@ -119,7 +134,7 @@
119
  this.on = callbackEvents.on;
120
  this.off = callbackEvents.off;
121
 
122
- if(thisSettings.totalTime > 0) {
123
  this.on('tick.showTime', showTime);
124
  this.on('finish.submit', submit);
125
  }
63
  }
64
 
65
  if (overtime) {
66
+ // console.log('Overtime')
67
+ // return;
68
+ //
69
  return;
70
  }
71
  thisSettings.remainingTime--;
88
  callbackEvents.callEvent('tick', [newVal]);
89
  if (newVal <= 0) {
90
  stopCountdown();
91
+
92
+ // Disable confirm message
93
+ $('form.complete-quiz').off('submit.learn-press-confirm');
94
  callbackEvents.callEvent('finish');
95
  }
96
  }
106
  $('form.complete-quiz').submit();
107
  }
108
 
109
+ function beforeSubmit() {
110
+ var $form = $(this),
111
+ $input = $form.find('input[name="nav-type"]'),
112
+ navType = $form[0].className.match(/(prev|next|skip)-question/);
113
+
114
+ if (!$input.length) {
115
+ $input = $('<input type="hidden" name="nav-type" />').val(navType[0]).appendTo($form);
116
+ }
117
+ }
118
+
119
  function init() {
120
  if (thisSettings.onTick) {
121
  self.on('tick', thisSettings.onTick);
124
  if (thisSettings.onFinish) {
125
  self.on('finish', thisSettings.onFinish);
126
  }
127
+
128
+ $(document).on('submit', '.next-question, .prev-question, .skip-question', beforeSubmit);
129
  initCountdown();
130
  timeCountdown();
131
  }
134
  this.on = callbackEvents.on;
135
  this.off = callbackEvents.off;
136
 
137
+ if (thisSettings.totalTime > 0) {
138
  this.on('tick.showTime', showTime);
139
  this.on('finish.submit', submit);
140
  }
assets/scss/_mixin.scss CHANGED
@@ -103,4 +103,44 @@
103
  &::placeholder{
104
  color: $color;
105
  }
106
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  &::placeholder{
104
  color: $color;
105
  }
106
+ }
107
+
108
+
109
+ @-webkit-keyframes rotating4 /* Safari and Chrome */
110
+ {
111
+ from {
112
+ -webkit-transform: rotate(0deg);
113
+ -o-transform: rotate(0deg);
114
+ transform: rotate(0deg);
115
+ }
116
+ to {
117
+ -webkit-transform: rotate(360deg);
118
+ -o-transform: rotate(360deg);
119
+ transform: rotate(360deg);
120
+ }
121
+ }
122
+
123
+ @keyframes rotating4 {
124
+ from {
125
+ -ms-transform: rotate(0deg);
126
+ -moz-transform: rotate(0deg);
127
+ -webkit-transform: rotate(0deg);
128
+ -o-transform: rotate(0deg);
129
+ transform: rotate(0deg);
130
+ }
131
+ to {
132
+ -ms-transform: rotate(360deg);
133
+ -moz-transform: rotate(360deg);
134
+ -webkit-transform: rotate(360deg);
135
+ -o-transform: rotate(360deg);
136
+ transform: rotate(360deg);
137
+ }
138
+ }
139
+
140
+ @mixin rotating4($args: rotating4 2s linear infinite) {
141
+ -webkit-animation: $args;
142
+ -moz-animation: $args;
143
+ -ms-animation: $args;
144
+ -o-animation: $args;
145
+ animation: $args;
146
+ }
assets/scss/admin/_admin-editor.scss CHANGED
@@ -2,45 +2,6 @@
2
  * General style for admin editor.
3
  */
4
 
5
- @-webkit-keyframes rotating4 /* Safari and Chrome */
6
- {
7
- from {
8
- -webkit-transform: rotate(0deg);
9
- -o-transform: rotate(0deg);
10
- transform: rotate(0deg);
11
- }
12
- to {
13
- -webkit-transform: rotate(360deg);
14
- -o-transform: rotate(360deg);
15
- transform: rotate(360deg);
16
- }
17
- }
18
-
19
- @keyframes rotating4 {
20
- from {
21
- -ms-transform: rotate(0deg);
22
- -moz-transform: rotate(0deg);
23
- -webkit-transform: rotate(0deg);
24
- -o-transform: rotate(0deg);
25
- transform: rotate(0deg);
26
- }
27
- to {
28
- -ms-transform: rotate(360deg);
29
- -moz-transform: rotate(360deg);
30
- -webkit-transform: rotate(360deg);
31
- -o-transform: rotate(360deg);
32
- transform: rotate(360deg);
33
- }
34
- }
35
-
36
- @mixin rotating4($args: rotating4 2s linear infinite) {
37
- -webkit-animation: $args;
38
- -moz-animation: $args;
39
- -ms-animation: $args;
40
- -o-animation: $args;
41
- animation: $args;
42
- }
43
-
44
  .lp-admin-editor {
45
  background-color: #fff;
46
  border: 1px solid #ddd;
@@ -319,6 +280,7 @@
319
  ul {
320
  margin: 0;
321
  min-height: 5px;
 
322
  }
323
 
324
  &.no-item {
@@ -671,7 +633,6 @@
671
  line-height: 44px;
672
  font-size: 12px;
673
  span {
674
- font-weight: bold;
675
  color: #999;
676
  }
677
  }
@@ -906,13 +867,13 @@
906
  }
907
 
908
  body {
909
- &.moving {
910
  cursor: url("../../images/closedhand.cur") 7 5, default !important;
911
- .section-item {
912
- .drag {
913
- cursor: url("../../images/closedhand.cur") 7 5, default !important;
914
- }
915
- }
916
  }
917
  }
918
 
2
  * General style for admin editor.
3
  */
4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  .lp-admin-editor {
6
  background-color: #fff;
7
  border: 1px solid #ddd;
280
  ul {
281
  margin: 0;
282
  min-height: 5px;
283
+ position: relative;
284
  }
285
 
286
  &.no-item {
633
  line-height: 44px;
634
  font-size: 12px;
635
  span {
 
636
  color: #999;
637
  }
638
  }
867
  }
868
 
869
  body {
870
+ &.lp-item-moving {
871
  cursor: url("../../images/closedhand.cur") 7 5, default !important;
872
+ //.section-item {
873
+ // .drag {
874
+ // cursor: url("../../images/closedhand.cur") 7 5, default !important;
875
+ // }
876
+ //}
877
  }
878
  }
879
 
assets/scss/admin/_admin-tools.scss CHANGED
@@ -10,8 +10,16 @@
10
  margin: 0;
11
  }
12
  input[type="text"] {
13
- min-width: 200px;
14
  height: 28px;
15
  margin-left: 0;
16
  }
 
 
 
 
 
 
 
 
17
  }
10
  margin: 0;
11
  }
12
  input[type="text"] {
13
+ min-width: 300px;
14
  height: 28px;
15
  margin-left: 0;
16
  }
17
+ .action-reset {
18
+ &.dashicons-trash {
19
+ color: #FF0000;
20
+ }
21
+ &.dashicons-update {
22
+ @include rotating4();
23
+ }
24
+ }
25
  }
assets/scss/admin/_general.scss CHANGED
@@ -174,7 +174,7 @@
174
  width: 100%;
175
  font-size: 14px;
176
  th, td {
177
- padding: 8px 10px;
178
  }
179
  .order {
180
  width: 30px;
174
  width: 100%;
175
  font-size: 14px;
176
  th, td {
177
+ padding: 10px;
178
  }
179
  .order {
180
  width: 30px;
assets/scss/admin/_question-editor.scss CHANGED
@@ -1,4 +1,4 @@
1
- /**
2
  * Question admin editor.
3
  */
4
  #admin-editor-lp_question {
@@ -110,7 +110,6 @@
110
  text-align: right;
111
  padding: 0;
112
  width: 30px;
113
- font-weight: bold;
114
  }
115
  .answer-correct {
116
  width: 65px;
1
+ /**.section-item-counts span
2
  * Question admin editor.
3
  */
4
  #admin-editor-lp_question {
110
  text-align: right;
111
  padding: 0;
112
  width: 30px;
 
113
  }
114
  .answer-correct {
115
  width: 65px;
assets/scss/admin/_quiz-editor.scss CHANGED
@@ -72,7 +72,6 @@
72
  & > .order {
73
  flex: 0 0 30px;
74
  text-align: right;
75
- font-weight: bold;
76
  font-size: 15px;
77
  padding: 12px 0;
78
  &:after {
@@ -176,7 +175,6 @@
176
  tr {
177
  background: #fff;
178
  border: 1px solid #DDD;
179
- position: relative;
180
  &:nth-child(2n) {
181
  background: #f4fcff;
182
  }
@@ -188,15 +186,8 @@
188
  &.sort {
189
  cursor: url("../../images/openhand.cur") 7 5, default;
190
  width: 12px;
191
- position: relative;
192
 
193
  }
194
- &.order {
195
- font-weight: bold;
196
- &:after {
197
- //content: '.';
198
- }
199
- }
200
  &.answer-text {
201
  padding-left: 5px;
202
  }
72
  & > .order {
73
  flex: 0 0 30px;
74
  text-align: right;
 
75
  font-size: 15px;
76
  padding: 12px 0;
77
  &:after {
175
  tr {
176
  background: #fff;
177
  border: 1px solid #DDD;
 
178
  &:nth-child(2n) {
179
  background: #f4fcff;
180
  }
186
  &.sort {
187
  cursor: url("../../images/openhand.cur") 7 5, default;
188
  width: 12px;
 
189
 
190
  }
 
 
 
 
 
 
191
  &.answer-text {
192
  padding-left: 5px;
193
  }
assets/scss/admin/admin.scss CHANGED
@@ -50,6 +50,18 @@
50
 
51
  .lp-notice-update-database {
52
  border-left-color: #FF0000;
 
 
 
 
 
 
 
 
 
 
 
 
53
  }
54
 
55
  #adminmenu {
50
 
51
  .lp-notice-update-database {
52
  border-left-color: #FF0000;
53
+ &.do-updating {
54
+ &:before {
55
+ display: inline-block;
56
+ content: "\f463";
57
+ font-family: dashicons;
58
+ font-size: 20px;
59
+ float: left;
60
+ margin: 9px 5px 0 -5px;
61
+ color: #2773aa;
62
+ @include rotating4();
63
+ }
64
+ }
65
  }
66
 
67
  #adminmenu {
assets/scss/frontend/_curriculum.scss CHANGED
@@ -617,93 +617,6 @@ body {
617
  }
618
  }
619
 
620
- .question-numbers {
621
- list-style: none;
622
- text-align: center;
623
- li {
624
- display: inline-block;
625
- a {
626
- display: block;
627
- padding: 8px;
628
- background: #F5F5F5;
629
- line-height: 1;
630
- color: #999;
631
- border: 1px solid #DDD;
632
- font-size: 12px;
633
- min-width: 20px;
634
- box-shadow: none;
635
- span {
636
- vertical-align: middle;
637
- }
638
- &:hover {
639
- background: #00adff;
640
- color: #FFF;
641
- border: 1px solid #3880a2;
642
- }
643
- }
644
- &.current {
645
- a {
646
- background: #00adff;
647
- color: #FFF !important;
648
- border-color: #3880a2;
649
- }
650
- }
651
- &.answered {
652
- a {
653
- &:after {
654
- font-family: fontawesome;
655
- font-size: 8px;
656
- vertical-align: middle;
657
- margin-left: 3px;
658
- }
659
- }
660
- &.answered-wrong {
661
- a {
662
- color: #FF0000;
663
- &:after {
664
- //content: "\f05e";
665
- }
666
- }
667
- }
668
- &.answered-true {
669
- a {
670
- color: #00adff;
671
- &:after {
672
- //content: "\f00c";
673
- }
674
- }
675
- &.current {
676
- a {
677
- color: #FFF;
678
- }
679
- }
680
- }
681
- }
682
- }
683
- }
684
-
685
- .quiz-intro {
686
- list-style: none;
687
- margin: 0 0 20px;
688
- padding: 0;
689
- display: table;
690
- li {
691
- margin: 0;
692
- display: table-row;
693
- label, span {
694
- display: table-cell;
695
- }
696
- label {
697
- font-weight: bold;
698
- padding: 0 20px 10px 0px;
699
- line-height: 1;
700
- }
701
- span {
702
- text-align: left;
703
- }
704
- }
705
- }
706
-
707
  .course-remaining-time {
708
  .lp-label {
709
  &.label-enrolled {
617
  }
618
  }
619
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
620
  .course-remaining-time {
621
  .lp-label {
622
  &.label-enrolled {
assets/scss/frontend/_quiz.scss CHANGED
@@ -155,12 +155,15 @@
155
  border-radius: 50%;
156
  }
157
  }
 
158
  .option-title {
159
  margin: 0;
160
  }
 
161
  &:hover {
162
  background: #e1f5ff;
163
  }
 
164
  &.answer-correct {
165
  background: #e1f5ff;
166
  input[type="radio"]:checked,
@@ -189,33 +192,40 @@
189
  input[type="checkbox"] {
190
  &:before,
191
  &:after {
192
- position: absolute;
193
- background: #FF0000;
194
- border: none;
195
- content: '';
196
- display: inline-block;
197
- left: 50%;
198
- top: 50%;
199
- @include border-radius(2px);
200
- @include transform(rotate(-45deg));
201
- }
202
-
203
- &:before {
204
- width: 2px;
205
- height: 18px;
206
- margin-top: -9px;
207
- margin-left: -1px;
208
- }
209
-
210
- &:after {
211
- width: 18px;
212
- height: 2px;
213
- margin-top: -1px;
214
- margin-left: -9px;
215
- border: none;
216
- opacity: 1;
217
  }
218
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
219
 
220
  input[type="radio"]:checked,
221
  input[type="checkbox"]:checked {
@@ -318,6 +328,113 @@ button[data-counter] {
318
  }
319
  }
320
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
321
  .question-explanation-content,
322
  .question-hint-content {
323
  margin-bottom: 20px;
155
  border-radius: 50%;
156
  }
157
  }
158
+
159
  .option-title {
160
  margin: 0;
161
  }
162
+
163
  &:hover {
164
  background: #e1f5ff;
165
  }
166
+
167
  &.answer-correct {
168
  background: #e1f5ff;
169
  input[type="radio"]:checked,
192
  input[type="checkbox"] {
193
  &:before,
194
  &:after {
195
+ border-color: #FF0000;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
196
  }
197
  }
198
+ //input[type="radio"],
199
+ //input[type="checkbox"] {
200
+ // &:before,
201
+ // &:after {
202
+ // position: absolute;
203
+ // _background: #FF0000;
204
+ // border: none;
205
+ // content: '';
206
+ // display: inline-block;
207
+ // left: 50%;
208
+ // top: 50%;
209
+ // @include border-radius(2px);
210
+ // @include transform(rotate(-45deg));
211
+ // }
212
+ //
213
+ // &:before {
214
+ // width: 2px;
215
+ // height: 18px;
216
+ // margin-top: -9px;
217
+ // margin-left: -1px;
218
+ // }
219
+ //
220
+ // &:after {
221
+ // width: 18px;
222
+ // height: 2px;
223
+ // margin-top: -1px;
224
+ // margin-left: -9px;
225
+ // border: none;
226
+ // opacity: 1;
227
+ // }
228
+ //}
229
 
230
  input[type="radio"]:checked,
231
  input[type="checkbox"]:checked {
328
  }
329
  }
330
 
331
+ .question-numbers {
332
+ list-style: none;
333
+ text-align: center;
334
+ li {
335
+ display: inline-block;
336
+ position: relative;
337
+ margin-bottom: 3px;
338
+ a {
339
+ display: block;
340
+ padding: 8px;
341
+ background: #F5F5F5;
342
+ line-height: 1;
343
+ color: #999;
344
+ border: 1px solid #DDD;
345
+ font-size: 12px;
346
+ min-width: 20px;
347
+ box-shadow: none;
348
+ span {
349
+ vertical-align: middle;
350
+ }
351
+ &:hover {
352
+ background: #00adff;
353
+ color: #FFF;
354
+ border: 1px solid #3880a2;
355
+ }
356
+ }
357
+ &.current {
358
+ a {
359
+ background: #00adff;
360
+ color: #FFF !important;
361
+ border-color: #3880a2;
362
+ }
363
+ &.skipped {
364
+ &:after {
365
+ background: #FFF;
366
+ }
367
+ }
368
+ }
369
+ &.answered {
370
+ a {
371
+ &:after {
372
+ font-family: fontawesome;
373
+ font-size: 8px;
374
+ vertical-align: middle;
375
+ margin-left: 3px;
376
+ }
377
+ }
378
+ &.answered-wrong {
379
+ a {
380
+ color: #FF0000;
381
+ &:after {
382
+ //content: "\f05e";
383
+ }
384
+ }
385
+ }
386
+ &.answered-true {
387
+ a {
388
+ color: #00adff;
389
+ &:after {
390
+ //content: "\f00c";
391
+ }
392
+ }
393
+ &.current {
394
+ a {
395
+ color: #FFF;
396
+ }
397
+ }
398
+ }
399
+ }
400
+ &.skipped {
401
+ &:after {
402
+ content: '';
403
+ background: #AAA;
404
+ width: 10px;
405
+ height: 4px;
406
+ position: absolute;
407
+ border-radius: 2px;
408
+ left: 50%;
409
+ margin-left: -5px;
410
+ bottom: 3px;
411
+ }
412
+ }
413
+ }
414
+ }
415
+
416
+ .quiz-intro {
417
+ list-style: none;
418
+ margin: 0 0 20px;
419
+ padding: 0;
420
+ display: table;
421
+ li {
422
+ margin: 0;
423
+ display: table-row;
424
+ label, span {
425
+ display: table-cell;
426
+ }
427
+ label {
428
+ font-weight: bold;
429
+ padding: 0 20px 10px 0px;
430
+ line-height: 1;
431
+ }
432
+ span {
433
+ text-align: left;
434
+ }
435
+ }
436
+ }
437
+
438
  .question-explanation-content,
439
  .question-hint-content {
440
  margin-bottom: 20px;
inc/abstract-settings.php CHANGED
@@ -10,6 +10,16 @@ abstract class LP_Abstract_Settings {
10
  */
11
  public function __construct() {
12
  // TODO: init anything here
 
 
 
 
 
 
 
 
 
 
13
  }
14
 
15
  /**
10
  */
11
  public function __construct() {
12
  // TODO: init anything here
13
+ add_filter( 'learn-press/update-settings/redirect', array( $this, '_do_save' ) );
14
+ }
15
+
16
+ public function _do_save($url) {
17
+ $this->save();
18
+ return $url;
19
+ }
20
+
21
+ public function save() {
22
+ // This function should be overwritten from it's child
23
  }
24
 
25
  /**
inc/abstracts/abstract-background-process.php CHANGED
@@ -41,8 +41,13 @@ if ( ! class_exists( 'LP_Abstract_Background_Process' ) ) {
41
  */
42
  public function __construct() {
43
  parent::__construct();
44
-
45
- add_action( 'shutdown', array( $this, 'dispatch_queue' ) );
 
 
 
 
 
46
  }
47
 
48
  /**
@@ -72,10 +77,9 @@ if ( ! class_exists( 'LP_Abstract_Background_Process' ) ) {
72
  /**
73
  * @param mixed $data
74
  *
75
- * @return $this
76
  */
77
  public function push_to_queue( $data ) {
78
-
79
  // Check to preventing loop
80
  if ( $this->safe ) {
81
  if ( learn_press_is_ajax() || ! empty( $_REQUEST['action'] ) ) {
@@ -96,6 +100,12 @@ if ( ! class_exists( 'LP_Abstract_Background_Process' ) ) {
96
  }
97
 
98
  protected function task( $item ) {
 
 
 
 
 
 
99
  }
100
 
101
  /**
41
  */
42
  public function __construct() {
43
  parent::__construct();
44
+ /**
45
+ * Priority is important that will fix issue with WC cart doesnt remove
46
+ * after completing checkout and get order details
47
+ *
48
+ * @since 3.0.8
49
+ */
50
+ add_action( 'shutdown', array( $this, 'dispatch_queue' ), 1000 );
51
  }
52
 
53
  /**
77
  /**
78
  * @param mixed $data
79
  *
80
+ * @return mixed
81
  */
82
  public function push_to_queue( $data ) {
 
83
  // Check to preventing loop
84
  if ( $this->safe ) {
85
  if ( learn_press_is_ajax() || ! empty( $_REQUEST['action'] ) ) {
100
  }
101
 
102
  protected function task( $item ) {
103
+ ob_start();
104
+ print_r( $item );
105
+ print_r( $_REQUEST );
106
+ $msg = ob_get_clean();
107
+ LP_Debug::instance()->add( $msg, 'background-process-task', false, true );
108
+ return false;
109
  }
110
 
111
  /**
inc/admin/class-lp-admin-dashboard.php CHANGED
@@ -100,7 +100,7 @@ if ( ! class_exists( 'LP_Admin_Dashboard' ) ) {
100
  if ( $orders ) {
101
  foreach ( $orders as $order ) {
102
  $order = learn_press_get_order( $order->ID );
103
- $total = $total + floatval($order->order_total);
104
  }
105
  }
106
 
@@ -193,7 +193,7 @@ if ( ! class_exists( 'LP_Admin_Dashboard' ) ) {
193
  */
194
  public function plugin_status() {
195
  $plugin_data = $this->_get_data();
196
- if ( ! $plugin_data ) {
197
  learn_press_admin_view( 'dashboard/plugin-status/html-no-data' );
198
  } else {
199
  learn_press_admin_view( 'dashboard/plugin-status/html-results', array( 'plugin_data' => $plugin_data ) );
100
  if ( $orders ) {
101
  foreach ( $orders as $order ) {
102
  $order = learn_press_get_order( $order->ID );
103
+ $total = $total + floatval( $order->order_total );
104
  }
105
  }
106
 
193
  */
194
  public function plugin_status() {
195
  $plugin_data = $this->_get_data();
196
+ if ( ! $plugin_data || is_wp_error( $plugin_data ) ) {
197
  learn_press_admin_view( 'dashboard/plugin-status/html-no-data' );
198
  } else {
199
  learn_press_admin_view( 'dashboard/plugin-status/html-results', array( 'plugin_data' => $plugin_data ) );
inc/admin/class-lp-admin-menu.php CHANGED
@@ -137,8 +137,6 @@ class LP_Admin_Menu {
137
  }
138
 
139
  $addons = LP_Admin::instance()->get_addons();
140
-
141
- add_submenu_page( 'plugins.php', '', __( 'LearnPress', 'learnpress' ), 'manage_options', 'plugins.php?s=learnpress' );
142
  }
143
 
144
  /**
137
  }
138
 
139
  $addons = LP_Admin::instance()->get_addons();
 
 
140
  }
141
 
142
  /**
inc/admin/class-lp-admin.php CHANGED
@@ -474,6 +474,10 @@ if ( ! class_exists( 'LP_Admin' ) ) {
474
  }
475
  echo '<div class="updated notice">' . __( 'User has accepted to become a teacher.', 'learnpress' ) . '</div>';
476
  }
 
 
 
 
477
  }
478
 
479
  /**
474
  }
475
  echo '<div class="updated notice">' . __( 'User has accepted to become a teacher.', 'learnpress' ) . '</div>';
476
  }
477
+
478
+ if ( LP()->session->get( 'do-update-learnpress' ) ) {
479
+ learn_press_admin_view( 'updates/html-updated-latest-message' );
480
+ }
481
  }
482
 
483
  /**
inc/admin/class-lp-reset-data.php CHANGED
@@ -37,10 +37,13 @@ class LP_Reset_Data {
37
  if ( ! is_numeric( $user_id ) ) {
38
  if ( $user = get_user_by( 'email', $user_id ) ) {
39
  $user_id = $user->ID;
 
 
40
  }
41
  }
42
  global $wpdb;
43
 
 
44
  $query = $wpdb->prepare( "
45
  SELECT user_item_id
46
  FROM {$wpdb->learnpress_user_items}
@@ -48,6 +51,12 @@ class LP_Reset_Data {
48
  ", $user_id, $item_id );
49
 
50
  if ( $user_item_ids = $wpdb->get_col( $query ) ) {
 
 
 
 
 
 
51
 
52
  $format = array_fill( 0, sizeof( $user_item_ids ), '%d' );
53
  $query = $wpdb->prepare( "
@@ -65,13 +74,31 @@ class LP_Reset_Data {
65
 
66
  $wpdb->query( $query );
67
 
68
- echo __( 'Data deleted', 'learnpress' );
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  } else {
70
  echo __( 'No data found', 'learnpress' );
71
  }
 
72
  die();
73
  }
74
 
 
 
 
 
75
  public static function search_courses() {
76
  global $wpdb;
77
 
@@ -190,7 +217,6 @@ class LP_Reset_Data {
190
  $course_id = LP_Request::get_int( 'course_id' );
191
 
192
  global $wpdb;
193
-
194
  if ( $course_id ) {
195
 
196
  self::reset_course_users( $course_id, $user_id );
@@ -220,7 +246,6 @@ class LP_Reset_Data {
220
  $wpdb->query( $query );
221
  }
222
  }
223
-
224
  die();
225
  }
226
 
@@ -231,7 +256,7 @@ class LP_Reset_Data {
231
  return false;
232
  }
233
 
234
- LP_Debug::startTransaction();
235
 
236
  try {
237
  // Delete course items
@@ -249,7 +274,7 @@ class LP_Reset_Data {
249
  self::delete_user_items_by_id( $user_item_ids );
250
  }
251
  catch ( Exception $ex ) {
252
- LP_Debug::rollbackTransaction();
253
  }
254
 
255
  $removed = false;
@@ -257,7 +282,7 @@ class LP_Reset_Data {
257
  $removed = $course_id;
258
  }
259
 
260
- LP_Debug::commitTransaction();
261
 
262
  return $removed;
263
  }
37
  if ( ! is_numeric( $user_id ) ) {
38
  if ( $user = get_user_by( 'email', $user_id ) ) {
39
  $user_id = $user->ID;
40
+ } elseif ( $user = get_user_by( 'login', $user_id ) ) {
41
+ $user_id = $user->ID;
42
  }
43
  }
44
  global $wpdb;
45
 
46
+ //LP_Debug::startTransaction();
47
  $query = $wpdb->prepare( "
48
  SELECT user_item_id
49
  FROM {$wpdb->learnpress_user_items}
51
  ", $user_id, $item_id );
52
 
53
  if ( $user_item_ids = $wpdb->get_col( $query ) ) {
54
+ $query = "
55
+ SELECT DISTINCT parent_id AS parent, item_id
56
+ FROM {$wpdb->learnpress_user_items}
57
+ WHERE user_item_id IN(" . join( ',', $user_item_ids ) . ")
58
+ ";
59
+ $parents = $wpdb->get_results( $query );
60
 
61
  $format = array_fill( 0, sizeof( $user_item_ids ), '%d' );
62
  $query = $wpdb->prepare( "
74
 
75
  $wpdb->query( $query );
76
 
77
+ if ( $parents ) {
78
+ foreach ( $parents as $parent ) {
79
+ if ( $retaken_items = learn_press_get_user_item_meta( $parent->parent, '_retaken_items', true ) ) {
80
+ if ( !isset( $retaken_items[ $parent->item_id ] ) ) {
81
+ continue;
82
+ }
83
+
84
+ unset( $retaken_items[ $parent->item_id ] );
85
+ learn_press_update_user_item_meta( $parent->parent, '_retaken_items', $retaken_items );
86
+ }
87
+ }
88
+ }
89
+
90
+ echo __( 'Item progress deleted', 'learnpress' );
91
  } else {
92
  echo __( 'No data found', 'learnpress' );
93
  }
94
+ //LP_Debug::rollbackTransaction();
95
  die();
96
  }
97
 
98
+ public static function remove_item_data() {
99
+
100
+ }
101
+
102
  public static function search_courses() {
103
  global $wpdb;
104
 
217
  $course_id = LP_Request::get_int( 'course_id' );
218
 
219
  global $wpdb;
 
220
  if ( $course_id ) {
221
 
222
  self::reset_course_users( $course_id, $user_id );
246
  $wpdb->query( $query );
247
  }
248
  }
 
249
  die();
250
  }
251
 
256
  return false;
257
  }
258
 
259
+ //LP_Debug::startTransaction();
260
 
261
  try {
262
  // Delete course items
274
  self::delete_user_items_by_id( $user_item_ids );
275
  }
276
  catch ( Exception $ex ) {
277
+ //LP_Debug::rollbackTransaction();
278
  }
279
 
280
  $removed = false;
282
  $removed = $course_id;
283
  }
284
 
285
+ //LP_Debug::commitTransaction();
286
 
287
  return $removed;
288
  }
inc/admin/class-lp-updater.php CHANGED
@@ -25,47 +25,91 @@ class LP_Updater {
25
  add_action( 'admin_menu', array( $this, 'admin_menu' ) );
26
  add_action( 'admin_init', array( $this, 'update_form' ) );
27
  add_action( 'admin_init', array( $this, 'do_update' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  }
29
 
30
  public function do_update() {
 
 
 
 
 
31
  if ( 'yes' !== LP_Request::get_string( 'do-update-learnpress' ) ) {
32
- return;
33
  }
34
- echo '<div>';
35
- //ob_start();
 
 
 
 
 
 
 
 
 
 
 
36
  try {
37
- LP_Debug::startTransaction();
 
 
38
  foreach ( $this->get_update_files() as $version => $file ) {
39
- $file = LP_PLUGIN_PATH . '/inc/updates/' . $file;
40
 
41
- include_once $file;
 
 
42
 
43
- echo sprin