LearnPress – WordPress LMS Plugin - Version 1.0.8

Version Description

  • Fixed "Password protected content" feature
  • Fixed get quiz mark with questions mark is empty
  • Fixed certificate display incorrect end date (addon)
  • Fixed user profile link loop redirect in some cases
  • Fixed user can not finish lesson
  • Fixed add existing item problem with single/double quote in title
  • Fixed message finish course duration does not show
Download this release

Release Info

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

Code changes from version 0.9.20 to 1.0.8

Files changed (120) hide show
  1. README.md +136 -0
  2. assets/css/_icons.css +42 -0
  3. assets/css/_icons.less +47 -0
  4. assets/css/_learnpress.css +1047 -0
  5. assets/css/admin/admin.css +1468 -0
  6. assets/css/admin/meta-box-course.css +794 -0
  7. assets/css/admin/meta-box-order.css +149 -0
  8. assets/css/admin/meta-box-question.css +65 -0
  9. assets/css/global-style.css +115 -0
  10. assets/css/icons.css +36 -0
  11. assets/css/learnpress-0.9.x.css +476 -0
  12. assets/css/learnpress-admin-compat.css +0 -191
  13. assets/css/learnpress-admin.css +0 -702
  14. assets/css/learnpress.bak.css +899 -0
  15. assets/css/learnpress.bak.less +1153 -0
  16. assets/css/learnpress.css +1096 -294
  17. assets/css/learnpress.less +536 -0
  18. assets/css/owlcarousel/owl.carousel.css +71 -0
  19. assets/css/shortcode-style/learnpress-archive-course.css +0 -26
  20. assets/eduma/custom-script.js +309 -0
  21. assets/eduma/custom-style.css +7 -0
  22. assets/fonts/Sumana-Regular.ttf +0 -0
  23. assets/fonts/icomoon.eot +0 -0
  24. assets/fonts/icomoon.svg +19 -0
  25. assets/fonts/icomoon.ttf +0 -0
  26. assets/fonts/icomoon.woff +0 -0
  27. assets/fonts/icomoon.zip +0 -0
  28. assets/fonts/icomoon/Read Me.txt +7 -0
  29. assets/fonts/icomoon/demo-files/demo.css +152 -0
  30. assets/fonts/icomoon/demo-files/demo.js +30 -0
  31. assets/fonts/icomoon/demo-files/demo.min.js +1 -0
  32. assets/fonts/icomoon/demo.html +183 -0
  33. assets/fonts/icomoon/fonts/icomoon.eot +0 -0
  34. assets/fonts/icomoon/fonts/icomoon.svg +19 -0
  35. assets/fonts/icomoon/fonts/icomoon.ttf +0 -0
  36. assets/fonts/icomoon/fonts/icomoon.woff +0 -0
  37. assets/fonts/icomoon/selection.json +312 -0
  38. assets/fonts/icomoon/style.css +54 -0
  39. assets/fonts/icon.eot +0 -0
  40. assets/fonts/icon.svg +14 -0
  41. assets/fonts/icon.ttf +0 -0
  42. assets/fonts/icon.woff +0 -0
  43. assets/fonts/icons.eot +0 -0
  44. assets/fonts/icons.svg +17 -0
  45. assets/fonts/icons.ttf +0 -0
  46. assets/fonts/icons.woff +0 -0
  47. assets/images/animation.gif +0 -0
  48. assets/images/grippy_large.png +0 -0
  49. assets/images/multiple-choice.png +0 -0
  50. assets/images/placeholder-300x300.jpg +0 -0
  51. assets/images/placeholder-400x250.jpg +0 -0
  52. assets/images/placeholder-800x450.jpg +0 -0
  53. assets/images/placeholder.jpg +0 -0
  54. assets/images/question.png +0 -0
  55. assets/images/single-choice.png +0 -0
  56. assets/images/stripe.png +0 -0
  57. assets/images/true-false.png +0 -0
  58. assets/js/admin/admin.js +824 -0
  59. assets/js/admin/meta-box-course.js +1326 -0
  60. assets/js/admin/meta-box-order.js +184 -0
  61. assets/js/admin/meta-box-question.js +422 -0
  62. assets/js/admin/meta-box-quiz.js +268 -0
  63. assets/js/admin/modal-search-items.js +163 -0
  64. assets/js/admin/question.min.js +21 -0
  65. assets/js/admin/settings.js +128 -0
  66. assets/js/admin/statistic.js +192 -0
  67. assets/js/custom.chart.js +0 -32
  68. assets/js/frontend/add-to-cart.js +24 -0
  69. assets/js/frontend/become-teacher.js +35 -0
  70. assets/js/frontend/checkout.js +123 -0
  71. assets/js/frontend/course-lesson.js +210 -0
  72. assets/js/frontend/course-quiz.js +46 -0
  73. assets/js/frontend/course-quiz.min.js +1 -0
  74. assets/js/frontend/enroll.js +65 -0
  75. assets/js/frontend/learnpress.js +73 -0
  76. assets/js/frontend/shortcodes.js +106 -0
  77. assets/js/frontend/single-course.js +220 -0
  78. assets/js/frontend/single-course.min.js +1 -0
  79. assets/js/frontend/single-course.v2.js +245 -0
  80. assets/js/frontend/single-quiz.js +731 -0
  81. assets/js/frontend/single-quiz.min.js +1 -0
  82. assets/js/global.js +753 -22
  83. assets/js/global.min.js +38 -0
  84. assets/js/jquery.block-ui.js +0 -26
  85. assets/js/jquery.caret.js +79 -0
  86. assets/js/learnpress-admin.js +0 -655
  87. assets/js/learnpress-embed-button.js +0 -22
  88. assets/js/learnpress.js +94 -54
  89. assets/js/learnpress.min.js +0 -534
  90. assets/js/owlcarousel/owl.carousel.min.js +47 -0
  91. assets/js/pointer.js +0 -17
  92. assets/js/single-quiz.js +0 -476
  93. assets/js/toastr.js +0 -415
  94. changelog.md +114 -0
  95. dummy-data/dummy-data.xml +1453 -0
  96. dummy-data/learnpress-how-to-use-learnpress.xml +1126 -826
  97. inc/abstracts/abstract-lp-assets.php +262 -0
  98. inc/abstracts/abstract-lp-course.php +0 -155
  99. inc/abstracts/abstract-lp-user.php +0 -298
  100. inc/abstracts/abstract-lpr-question-type.php +0 -577
  101. inc/admin/class-lp-admin-ajax.php +963 -0
  102. inc/admin/class-lp-admin-assets.php +55 -0
  103. inc/admin/class-lp-admin-menu.php +124 -0
  104. inc/admin/class-lp-admin-notice.php +87 -0
  105. inc/admin/class-lp-admin-settings.php +204 -0
  106. inc/admin/class-lp-admin.php +87 -0
  107. inc/admin/class-lp-email.php +100 -0
  108. inc/admin/class-lp-plugin-install-list-table.php +489 -0
  109. inc/admin/class-lp-profile.php +139 -0
  110. inc/admin/class-lp-upgrader.php +176 -0
  111. inc/admin/class-lpr-plugin-install-list-table.php +0 -421
  112. inc/admin/class-lpr-upgrader.php +0 -176
  113. inc/admin/class.lpr-admin-ajax.php +0 -311
  114. inc/admin/class.lpr-admin-assets.php +0 -146
  115. inc/admin/class.lpr-admin-settings.php +0 -196
  116. inc/admin/class.lpr-admin.php +0 -83
  117. inc/admin/class.lpr-email.php +0 -100
  118. inc/admin/class.lpr-profile.php +0 -154
  119. inc/admin/lp-admin-functions.php +1292 -0
  120. inc/admin/lpr-admin-functions.php +0 -362
README.md ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [![Stories in Ready](https://badge.waffle.io/LearnPress/LearnPress.svg?label=ready&title=Ready)](http://waffle.io/LearnPress/LearnPress)
2
+
3
+ <a href="http://thimpress.com/learnpress" target="_blank">LearnPress</a> is a comprehensive WordPress LMS Plugin for WordPress. This WordPress LMS Plugin can be used to easily create & sell courses online. Each course curriculum can be made with lessons & quizzes which can be managed with easy-to-use user interface, we really made it for lazy people.
4
+
5
+ [youtube https://www.youtube.com/watch?v=rRWPl5-Hb4k&hd=1&&cc_load_policy=1]
6
+
7
+ **LearnPress LMS Plugin works with your theme**
8
+ We create LearnPress LMS Plugin to work with any WordPress themes.
9
+
10
+ Here are some WordPress Themes designed to work with LearnPress: [Education WordPress Theme](http://themeforest.net/item/education-wordpress-theme-education-wp/14058034 "Education WordPress Theme") and [LMS WordPress theme](http://themeforest.net/item/lms-wordpress-theme-elearning-wp/11797847 "LMS WordPress Theme"). More will coming soon.
11
+
12
+
13
+ **LearnPress Support WordPress Multisites**
14
+
15
+ **LearnPress features**
16
+ *Create course*
17
+ LearnPress LMS Plugin provide an excellent user interface to create a course with options you need. You can find it easy to make a full curriculum layout as well as edit and maintain it.
18
+ You can also export course and import to other website which also using LearnPress. We will provide the feature allow you to import course from other WordPress LMS plugins soon.
19
+
20
+ *Manage course*
21
+ With the course you've created, you can share it, manage it, watch statistic about number of student, its trend, etc.
22
+
23
+ *Sell course*
24
+ LearnPress is free but it still allow you to sell courses you create with support many billing method such as paypal, woocommerce, stripe, etc.
25
+
26
+ *Communicate with your students*
27
+ With BuddyPress support, LearnPress will help you to communicate with your student or instructor via WordPress forum. Learning is not only on your own. Study, make friends and have fun.
28
+
29
+ *LearnPress provide a bunch of add-on*
30
+ Add-on is used to providing extra features for LearnPress and you can also write it.
31
+
32
+ <a href="http://docs.thimpress.com/learnpress" target="_blank">LearnPress WordPress LMS Plugin Documentation</a>
33
+
34
+ **LearnPress is free and always will be**
35
+ Education should be free and we want you to bring it to as many people as you can. Therefore, we create LearnPress as a tool for you to create course and share it. We'll continue developing it as long as we can and make it better and better.
36
+
37
+ **LearnPress is actively developed**
38
+ We are developing and improving LearnPress day by day and bringing new features to you cos we want LearnPress to become the best WordPress plugin in LMS.
39
+
40
+ **Free add-ons for LearnPress WordPress LMS Plugin:**
41
+
42
+ - [LearnPress Wishlist](https://wordpress.org/plugins/learnpress-wishlist) - add courses to a wishlist for students.
43
+ - [LearnPress Course Review](https://wordpress.org/plugins/learnpress-course-review) - review course for enrolled students.
44
+ - [LearnPress Import/Export](https://wordpress.org/plugins/learnpress-import-export) - export or import course or courses out-of-box.
45
+ - [LearnPress Prerequisites Courses](https://wordpress.org/plugins/learnpress-prerequisites-courses) - require student to pass some courses in order to enroll other course.
46
+ - [LearnPress bbPress Integration](https://wordpress.org/plugins/learnpress-bbpress) - add bbPress Forum support for LearnPress WordPress LMS Plugin.
47
+ - [LearnPress BuddyPress Integration](https://wordpress.org/plugins/learnpress-buddypress) - add BuddyPress support for LearnPress WordPress LMS Plugin.
48
+
49
+ **Premium add-ons for LearnPress WordPress LMS Plugin:**
50
+
51
+ - [Certificates add-on for LearnPress](http://thimpress.com/shop/certificates-add-on-for-learnpress/) - adding drag & drop certificates builder as well as selecting designed certificate for each LMS course, your student will get particular certificate when they finished a course.
52
+ - [Co-instructors add-on for LearnPress](http://thimpress.com/shop/co-instructors-add-on-for-learnpress/) - multiple instructors support for each LMS course.
53
+ - [Collections add-on for LearnPress](http://thimpress.com/shop/collections-add-on-for-learnpress/) - making LMS courses collection by selecting number of courses, this is helpful if you want to combine multiple LMS courses into a collection for a group of skills.
54
+ - [Stripe Payment method for LearnPress](http://thimpress.com/shop/stripe-add-on-for-learnpress/) - Stripe payment method for LearnPress WordPress LMS Plugin.
55
+ - [WooCommerce add-on for LearnPress](http://thimpress.com/shop/woocommerce-add-on-for-learnpress/) - using WooCommerce as payment gateway for LearnPrss WordPress LMS Plugin.
56
+
57
+ **WordPress LMS Plugin - LearnPress ROADMAP:**
58
+
59
+ - Payment Method support (first priority)
60
+ - Authorize.net
61
+ - Google Checkout
62
+ - Amazon Payments
63
+ - Dwolla
64
+ - Braintree
65
+ - Samurai by FeeFighters
66
+ - WePay
67
+ - 2Checkout
68
+ - Assignment
69
+ - Gradebook
70
+ - Paid MemberShip Pro
71
+ - Events
72
+ - myCRED integration
73
+ - Share Grade
74
+ - BadgeOS
75
+ - Content Drip
76
+ - Manually reset quiz for retake
77
+ - Create quiz from randoms questions in question bank
78
+ - Attachment restriction for lesson
79
+ - Mathjax support
80
+ - Presentation support (maybe support SlideShare)
81
+ - Show enrolled user
82
+ - Student ranks
83
+ - REST API for mobile app
84
+ - No distraction mode (when doing quiz)
85
+ - Report/feedback about a question/quiz/lesson
86
+ - Commission for payment method
87
+ - Instructor's note
88
+ - Private message from Admin to teacher
89
+ - Group payment
90
+ - Announcement (come up with email)
91
+
92
+ Any suggestions for this WordPress LMS Plugin? Send us <a href="http://thimpress.com/learnpress-suggestion/" target="_blank">here.</a>
93
+
94
+
95
+ ##Installation
96
+
97
+ **From your WordPress dashboard**
98
+ 1. Visit 'Plugin > Add new'.
99
+ 2. Search for 'LearnPress'.
100
+ 3. Activate LearnPress from your Plugins page.
101
+
102
+ **From WordPress.org**
103
+ 1. Search, select and download LearnPress.
104
+ 2. Activate the plugin through the 'Plugins' menu in WordPress Dashboard.
105
+
106
+ ##Frequently Asked Questions
107
+
108
+ **What is LearnPress ?**
109
+ LearnPress is a plugin to create a LMS website, to spread out course, or sell course.
110
+
111
+ **Where can I find LearnPress documentation and user guides?**
112
+ If you want to use LearnPress to build a Learning Management Website, please refer to our user guides in <a href="http://docs.thimpress.com/learnpress/" target="_blank">LearnPress official site.</a>
113
+ And if you want to extending or theming LearnPress, see our <a href="https://github.com/LearnPress/LearnPress/wiki">Wiki</a>
114
+
115
+ **Where can I get support or talk to other users?**
116
+ If you get troubles when using LearnPress you can ask for help on the LearnPres Support Forum
117
+
118
+ For help with premium add-ons, use our helpdesk.
119
+
120
+ **Where can I ask for new features or suggest ideas or themes for LearnPress?**
121
+ You can send us your ideas through form <a href="http://thimpress.com/learnpress-suggestion/" target="_blank">here.</a>here
122
+
123
+ **Where can I report bugs or contribute to the project?**
124
+ You can also report bugs on LearnPress Support Forum or LearnPress <a href="https://github.com/LearnPress/LearnPress/issues" target="_blank">Github Repository</a>.
125
+
126
+ **Where can I find the REST API documentation?**
127
+ We will provide documentation about LearnPress REST API really soon.
128
+
129
+ **LearnPress is great, can I contribute to it?**
130
+ Yes, you can and we appreciate it. Join in our <a href="https://github.com/LearnPress/LearnPress" target="_blank">Github Repository</a>.
131
+
132
+ **LearnPress Translation project**
133
+ https://www.transifex.com/projects/p/learnpress/
134
+
135
+ **Other note**
136
+ <a href="http://docs.thimpress.com/learnpress" target="_blank">Documentation</a> is available in ThimPress site.
assets/css/_icons.css ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @font-face {
2
+ font-family: 'lp-icons';
3
+ src: url('fonts/icons.eot?6gvjr0');
4
+ src: url('fonts/icons.eot?6gvjr0#iefix') format('embedded-opentype'), url('fonts/icons.ttf?6gvjr0') format('truetype'), url('fonts/icons.woff?6gvjr0') format('woff'), url('fonts/icons.svg?6gvjr0#icons') format('svg');
5
+ font-weight: normal;
6
+ font-style: normal;
7
+ }
8
+ [class^="lp-icon-"],
9
+ [class*=" lp-icon-"] {
10
+ /* use !important to prevent issues with browser extensions that change fonts */
11
+ font-family: 'lp-icons' !important;
12
+ speak: none;
13
+ font-style: normal;
14
+ font-weight: normal;
15
+ font-variant: normal;
16
+ text-transform: none;
17
+ line-height: 1;
18
+ /* Better Font Rendering =========== */
19
+ -webkit-font-smoothing: antialiased;
20
+ -moz-osx-font-smoothing: grayscale;
21
+ }
22
+ .lp-icon-file-text:before {
23
+ content: "\e926";
24
+ }
25
+ .icon-file-picture:before {
26
+ content: "\e927";
27
+ }
28
+ .icon-file-music:before {
29
+ content: "\e928";
30
+ }
31
+ .icon-file-video:before {
32
+ content: "\e92a";
33
+ }
34
+ .icon-file-zip:before {
35
+ content: "\e92b";
36
+ }
37
+ .icon-paste:before {
38
+ content: "\e92d";
39
+ }
40
+ .icon-alarm:before {
41
+ content: "\e950";
42
+ }
assets/css/_icons.less ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @font-face {
2
+ font-family: 'lp-icons';
3
+ src: url('fonts/icons.eot?6gvjr0');
4
+ src: url('fonts/icons.eot?6gvjr0#iefix') format('embedded-opentype'),
5
+ url('fonts/icons.ttf?6gvjr0') format('truetype'),
6
+ url('fonts/icons.woff?6gvjr0') format('woff'),
7
+ url('fonts/icons.svg?6gvjr0#icons') format('svg');
8
+ font-weight: normal;
9
+ font-style: normal;
10
+ }
11
+
12
+ [class^="lp-icon-"], [class*=" lp-icon-"] {
13
+ /* use !important to prevent issues with browser extensions that change fonts */
14
+ font-family: 'lp-icons' !important;
15
+ speak: none;
16
+ font-style: normal;
17
+ font-weight: normal;
18
+ font-variant: normal;
19
+ text-transform: none;
20
+ line-height: 1;
21
+
22
+ /* Better Font Rendering =========== */
23
+ -webkit-font-smoothing: antialiased;
24
+ -moz-osx-font-smoothing: grayscale;
25
+ }
26
+
27
+ .lp-icon-file-text:before {
28
+ content: "\e926";
29
+ }
30
+ .icon-file-picture:before {
31
+ content: "\e927";
32
+ }
33
+ .icon-file-music:before {
34
+ content: "\e928";
35
+ }
36
+ .icon-file-video:before {
37
+ content: "\e92a";
38
+ }
39
+ .icon-file-zip:before {
40
+ content: "\e92b";
41
+ }
42
+ .icon-paste:before {
43
+ content: "\e92d";
44
+ }
45
+ .icon-alarm:before {
46
+ content: "\e950";
47
+ }
assets/css/_learnpress.css ADDED
@@ -0,0 +1,1047 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .clearfix:after {
2
+ display: block;
3
+ content: '';
4
+ clear: both;
5
+ }
6
+
7
+ .column-lp_course .row-actions,
8
+ .column-lp_quiz .row-actions {
9
+ display: inline-block;
10
+ margin-left: 10px;
11
+ }
12
+
13
+ .column-lp_course .row-actions a,
14
+ .column-lp_quiz .row-actions a {
15
+ color: #999;
16
+ }
17
+
18
+ /**/
19
+ /* message box */
20
+ #learn-press-message-box-block {
21
+ position: fixed;
22
+ top: 0;
23
+ left: 0;
24
+ right: 0;
25
+ bottom: 0;
26
+ background-color: #000;
27
+ z-index: 99999;
28
+ opacity: 0.8;
29
+ }
30
+
31
+ #learn-press-message-box-window {
32
+ position: fixed;
33
+ top: 0;
34
+ bottom: 0;
35
+ left: 0;
36
+ right: 0;
37
+ z-index: 100000;
38
+ color: #FFF;
39
+ text-align: center;
40
+ }
41
+
42
+ #message-box-wrap {
43
+ margin: 0 auto;
44
+ /* text-align: center; */
45
+ display: inline-block;
46
+ text-align: left;
47
+ max-width: 70%;
48
+ }
49
+
50
+ .message-box-title {
51
+ color: #FFF;
52
+ margin: 0 0 40px 0;
53
+ font-size: 34px;
54
+ }
55
+
56
+ .message-box-content {
57
+ font-size: 16px;
58
+ line-height: 1.5;
59
+ }
60
+
61
+ .message-box-animation {
62
+ background-image: url("../images/animation.gif");
63
+ width: 220px;
64
+ height: 20px;
65
+ margin: 20px 0 0;
66
+ }
67
+
68
+ .message-box-buttons {
69
+ margin: 20px 0 0;
70
+ border-top: 1px solid #929292;
71
+ padding-top: 20px;
72
+ }
73
+
74
+ .message-box-button {
75
+ margin-right: 10px !important;
76
+ background-color: #FFFFFF;
77
+ color: #999;
78
+ }
79
+
80
+ .message-box-button:hover {
81
+ background-color: #F5F5F5;
82
+ }
83
+
84
+ .lp-label {
85
+ display: inline-block;
86
+ padding: 3px 8px;
87
+ line-height: 1;
88
+ font-size: 65%;
89
+ vertical-align: baseline;
90
+ color: #FFF;
91
+ border-radius: 4px;
92
+ }
93
+
94
+ .lp-label-quiz {
95
+ background-color: #53658C;
96
+ }
97
+
98
+ .lp-label-preview {
99
+ background-color: #5cb85c;
100
+ }
101
+
102
+ .lp-label-viewing {
103
+ background-color: #39afff;
104
+ }
105
+
106
+ .lp-label-lesson {
107
+ background-color: #337ab7;
108
+ }
109
+
110
+ .lp-label-final {
111
+ background-color: #FF6161;
112
+ }
113
+
114
+ .lp-label-completed {
115
+ background-color: #39C7CE;
116
+ }
117
+
118
+ .lp-label-format {
119
+ background-color: #ccc416;
120
+ }
121
+
122
+ .lp-label-format-aside {
123
+ background-color: #ccc416;
124
+ }
125
+
126
+ .lp-label-format-image {
127
+ background-color: #ccc416;
128
+ }
129
+
130
+ .lp-label-format-video {
131
+ background-color: #ccc416;
132
+ }
133
+
134
+ .lp-label-format-quote {
135
+ background-color: #ccc416;
136
+ }
137
+
138
+ .lp-label-format-link {
139
+ background-color: #ccc416;
140
+ }
141
+
142
+ .lp-label-format-gallery {
143
+ background-color: #ccc416;
144
+ }
145
+
146
+ .lp-label-format-status {
147
+ background-color: #ccc416;
148
+ }
149
+
150
+ .lp-label-format-audio {
151
+ background-color: #ccc416;
152
+ }
153
+
154
+ .lp-label-format-chat {
155
+ background-color: #ccc416;
156
+ }
157
+
158
+ .course-item .lp-label-completed,
159
+ .course-item .lp-label-viewing {
160
+ display: none;
161
+ }
162
+
163
+ .course-item.item-completed .lp-label-completed,
164
+ .course-item.item-current .lp-label-viewing {
165
+ display: inline-block;
166
+ }
167
+
168
+ .course-meta > * {
169
+ display: inline-block;
170
+ font-style: italic;
171
+ font-size: smaller;
172
+ }
173
+
174
+ .course-meta > *:after {
175
+ content: ' | ';
176
+ font-style: italic;
177
+ }
178
+
179
+ .course-meta > *:last-child:after {
180
+ display: none;
181
+ }
182
+ /**/
183
+ .learnpress {
184
+
185
+ }
186
+
187
+ .learnpress ul,
188
+ .learnpress li {
189
+ list-style: none;
190
+ }
191
+
192
+ .learnpress h3 {
193
+ font-size: 2.7rem;
194
+ line-height: 1.1852;
195
+ margin-top: 2.3704em;
196
+ margin-bottom: 1.1852em;
197
+ }
198
+
199
+ .learnpress .learnpress-content {
200
+ z-index: 100;
201
+ position: relative;
202
+ }
203
+
204
+ .learnpress .twentyfifteen .learnpress-content {
205
+ padding-left: 7.6923%;
206
+ padding-right: 7.6923%;
207
+ padding-top: 7.6923%;
208
+ margin-bottom: 7.6923%;
209
+ background: #fff;
210
+ box-shadow: 0 0 1px rgba(0, 0, 0, .15);
211
+ }
212
+
213
+ .learn-press-checkout-payment {
214
+
215
+ }
216
+
217
+ .payment-method-form {
218
+ display: none;
219
+ }
220
+
221
+ .learn-press-user-form {
222
+ float: left;
223
+ width: 50%;
224
+ box-sizing: border-box;
225
+ padding: 0 10px;
226
+ }
227
+
228
+ .learn-press-user-form .form-heading {
229
+ }
230
+
231
+ .learn-press-user-form .form-subheading {
232
+
233
+ }
234
+
235
+ .learn-press-user-form .form-content {
236
+
237
+ }
238
+
239
+ .learn-press-user-form .form-fields {
240
+
241
+ }
242
+
243
+ #learn-press-checkout-user-form {
244
+ margin: 0 -10px;
245
+ }
246
+
247
+ /* archive */
248
+ .learnpress .twentyfifteen .page-title {
249
+ margin: 0 0 30px 0;
250
+ }
251
+
252
+ .course-introduce {
253
+ margin: 20px 0 0 0;
254
+ }
255
+
256
+ .course-introduce .more-link {
257
+
258
+ }
259
+
260
+ .course-title,
261
+ .course-title h3 {
262
+ font-size: 18px;
263
+ }
264
+
265
+ .archive .lp_course {
266
+ }
267
+
268
+ /* pagination */
269
+ .learn-press-pagination {
270
+ text-align: center;
271
+ }
272
+
273
+ .learn-press-pagination ul > li {
274
+ display: inline-block;
275
+ }
276
+
277
+ .learn-press-pagination ul > li a,
278
+ .learn-press-pagination ul > li span {
279
+ display: inline-block;
280
+ padding: 0 10px;
281
+ border: 1px solid #DDD;
282
+ background-color: #F5F5F5;
283
+ }
284
+
285
+ .learn-press-pagination ul > li a {
286
+ background-color: #FFF;
287
+ }
288
+
289
+ .learn-press-breadcrumb {
290
+ margin: 0 0 20px 0;
291
+ }
292
+
293
+ /* course lesson nav */
294
+ .course-item-nav {
295
+ border-top: 1px dashed #DDD;
296
+ overflow: hidden;
297
+ margin: 20px 0;
298
+ padding-top: 10px;
299
+ }
300
+
301
+ .course-item-nav .course-item-prev > *,
302
+ .course-item-nav .course-item-next > * {
303
+ display: block;
304
+ }
305
+
306
+ .course-item-nav > div > span {
307
+ font-size: 70%;
308
+ text-transform: uppercase;
309
+ font-weight: bold;
310
+ }
311
+
312
+ .course-item-nav .course-item-prev {
313
+ float: left;
314
+ text-align: left;
315
+ }
316
+
317
+ .course-item-nav .course-item-next {
318
+ float: right;
319
+ text-align: right;
320
+ }
321
+
322
+ /* curriculum */
323
+ .section-header {
324
+ margin: 0 0 0 0;
325
+ padding: 10px 15px;
326
+ background-color: #EEE;
327
+ }
328
+
329
+ .section-header p {
330
+ display: inline-block;
331
+ font-weight: normal;
332
+ font-style: italic;
333
+ color: #999;
334
+ font-size: smaller;
335
+ margin: 0;
336
+ }
337
+
338
+ #learn-press-course-curriculum .section {
339
+ margin: 0 0 1px 0;
340
+ list-style: none;
341
+ }
342
+
343
+ #learn-press-course-curriculum .section-content {
344
+ margin: 0;
345
+ background-color: #F5F5F5;
346
+ }
347
+
348
+ #learn-press-course-curriculum .section .course-item {
349
+ margin: 0 0 0;
350
+ list-style: none;
351
+ padding: 10px 15px;
352
+ border-top: 1px solid #FFF;
353
+ }
354
+
355
+ #learn-press-course-curriculum .section .course-item-meta {
356
+ display: block;
357
+ float: right;
358
+ line-height: 1;
359
+ margin: 3px 0;
360
+ }
361
+
362
+ #learn-press-course-curriculum .section .course-item.section-empty {
363
+ background-color: #F5F5F5;
364
+ }
365
+
366
+ #learn-press-course-curriculum .section .course-item.section-empty .learn-press-message {
367
+ margin: 0;
368
+ }
369
+
370
+ /* QUIZ */
371
+ .single-quiz {
372
+
373
+ }
374
+
375
+ .single-quiz .quiz-summary-left {
376
+ float: left;
377
+ width: 100%;
378
+ padding-right: 320px;
379
+ }
380
+
381
+ .single-quiz .quiz-sidebar {
382
+ float: right;
383
+ width: 300px;
384
+ margin-left: -300px;
385
+ border: 2px solid #DDD;
386
+ padding: 20px;
387
+ }
388
+
389
+ .single-quiz.quiz-completed .quiz-questions-list .learn-press-question-title {
390
+ display: none;
391
+ }
392
+
393
+ .quiz-questions-list .current {
394
+ font-weight: bold;
395
+ }
396
+
397
+ .quiz-questions-list .current a:after {
398
+ display: inline-block;
399
+ background-color: #0066cc;
400
+ /* padding: 0px 8px; */
401
+ color: #FFF;
402
+ font-size: 70%;
403
+ border-radius: 50%;
404
+ content: '?';
405
+ /* margin-left: 10px; */
406
+ width: 20px;
407
+ height: 20px;
408
+ line-height: 20px;
409
+ text-align: center;
410
+ vertical-align: middle;
411
+ }
412
+
413
+ .quiz-countdown {
414
+ text-align: center;
415
+ }
416
+
417
+ .quiz-countdown #quiz-countdown-value {
418
+ font-size: 40px;
419
+ line-height: 1;
420
+ }
421
+
422
+ .quiz-countdown .quiz-countdown-label {
423
+ font-size: smaller;
424
+ font-style: italic;
425
+ color: #999;
426
+ }
427
+
428
+ .quiz-buttons {
429
+ text-align: center;
430
+ }
431
+
432
+ .quiz-result {
433
+ width: 100%;
434
+ }
435
+
436
+ .quiz-result .quiz-result-mark {
437
+ float: left;
438
+ width: 150px;
439
+ height: 150px;
440
+ background-color: #F5F5F5;
441
+ border-radius: 50%;
442
+ text-align: center;
443
+ box-sizing: border-box;
444
+ padding-top: 30px;
445
+ line-height: 1;
446
+
447
+ }
448
+
449
+ .quiz-result .quiz-result-mark .quiz-mark {
450
+ font-size: 60px;
451
+ display: block;
452
+ }
453
+
454
+ .quiz-result .quiz-result-mark .quiz-mark small {
455
+ font-size: 20px;
456
+ }
457
+
458
+ .quiz-result .quiz-result-summary {
459
+ float: left;
460
+ margin-left: 30px;
461
+ }
462
+
463
+ .quiz-result .quiz-result-summary .quiz-result-field {
464
+ margin: 0;
465
+ font-size: 14px;
466
+ }
467
+
468
+ .quiz-result .quiz-result-summary .quiz-result-field > label {
469
+ width: 100px;
470
+ display: inline-block;
471
+ }
472
+
473
+ .quiz-result .quiz-result-summary .quiz-result-field.correct {
474
+ color: #0066cc;
475
+ }
476
+
477
+ .quiz-result .quiz-result-summary .quiz-result-field.wrong {
478
+ color: #BC0B0B;
479
+ }
480
+
481
+ .quiz-result .quiz-result-summary .quiz-result-field.empty {
482
+ color: #869791;
483
+ }
484
+
485
+ .quiz-history {
486
+ font-size: 80%;
487
+ }
488
+
489
+ .quiz-history td {
490
+ padding: 10px;
491
+ }
492
+
493
+ .quiz-history-actions {
494
+ margin: 0;
495
+ }
496
+
497
+ /* profile */
498
+ #learn-press-user-profile {
499
+ overflow: hidden;
500
+ }
501
+
502
+ .learn-press-user-profile .user-info {
503
+ margin: 0 0 20px;
504
+ }
505
+
506
+ .learn-press-user-profile .user-basic-info {
507
+
508
+ }
509
+
510
+ .learn-press-user-profile .learn-press-tabs {
511
+ list-style: none;
512
+ margin: 0 0 20px;
513
+ padding-left: 5px;
514
+ border-bottom: 1px solid #DDD;
515
+ }
516
+
517
+ .learn-press-user-profile .learn-press-tabs > li {
518
+ float: left;
519
+ }
520
+
521
+ .learn-press-user-profile .learn-press-tabs > li > a {
522
+ box-shadow: none;
523
+ outline: none;
524
+ display: block;
525
+ border: none;
526
+ padding: 5px 10px;
527
+ }
528
+
529
+ .learn-press-user-profile .learn-press-tabs > li.current a {
530
+ background-color: #FFF;
531
+ border: 1px solid #DDD;
532
+ border-bottom-color: transparent;
533
+ z-index: 10;
534
+ margin-bottom: -1px;
535
+ }
536
+
537
+ .learn-press-tabs-wrapper {
538
+ margin: 0 0 20px;
539
+ }
540
+
541
+ .learn-press-user-profile .learn-press-tabs-wrapper > .learn-press-tab {
542
+ /*padding: 0;
543
+ float: left;
544
+ width: 100%;
545
+ margin-right: -100%;
546
+ visibility: hidden;*/
547
+ }
548
+
549
+ .learn-press-user-profile .entry-tab-inner {
550
+ }
551
+
552
+ .learn-press-user-profile .learn-press-tabs-wrapper {
553
+ /*float: left;
554
+ width: 100%;
555
+ padding-left: 170px;*/
556
+ }
557
+
558
+ .learn-press-user-profile .profile-content-left {
559
+ float: left;
560
+ margin-left: -100%;
561
+ margin-bottom: -100000px;
562
+ padding-bottom: 100000px;
563
+ background-color: #F5F5F5;
564
+ }
565
+
566
+ .profile-courses {
567
+ list-style: none;
568
+ }
569
+
570
+ .profile-courses > li {
571
+
572
+ }
573
+
574
+ .profile-courses > li > a {
575
+ }
576
+
577
+ .profile-courses-heading {
578
+ margin: 0 0 10px !important;
579
+ }
580
+
581
+ .learn-press-subtabs {
582
+ }
583
+
584
+ .learn-press-subtabs > li {
585
+ display: inline-block;
586
+ margin-right: 10px;
587
+ }
588
+
589
+ .learn-press-subtabs > li.current {
590
+ font-weight: bold;
591
+ }
592
+
593
+ .learn-press-subtab-content {
594
+ display: none;
595
+ }
596
+
597
+ .learn-press-subtab-content.current {
598
+ display: block;
599
+ }
600
+
601
+ .hide-if-js {
602
+ display: none;
603
+ }
604
+
605
+ /**/
606
+ .purchase-course .view-cart-button {
607
+
608
+ }
609
+
610
+ .learn-press-cart-table td,
611
+ .learn-press-cart-table th {
612
+ vertical-align: top;
613
+ }
614
+
615
+ .learn-press-cart-table .course-remove {
616
+ width: 40px;
617
+ }
618
+
619
+ .learn-press-cart-table .course-thumbnail {
620
+ width: 20%;
621
+ }
622
+
623
+ .learn-press-cart-table .course-price,
624
+ .learn-press-cart-table .course-total {
625
+ width: 15%;
626
+ }
627
+
628
+ /* notices */
629
+ .learn-press-notice,
630
+ .learn-press-message,
631
+ .learn-press-error {
632
+ list-style: none;
633
+ margin: 0 0 20px 0;
634
+ background-color: #F5F5F5;
635
+ padding: 8px 15px;
636
+ border-left: 5px solid;
637
+ }
638
+
639
+ .learn-press-notice {
640
+ border-color: #1e85be;
641
+ }
642
+
643
+ .learn-press-message {
644
+ border-color: #8fae1b;
645
+ }
646
+
647
+ .learn-press-error {
648
+ border-color: #b81c23;
649
+ }
650
+
651
+ .open-hand {
652
+ cursor: url("../../assets/images/openhand.cur") 7 5, default !important;
653
+ }
654
+
655
+ a .archive-course:hover {
656
+ cursor: pointer;
657
+ }
658
+
659
+ .archive-course {
660
+ border: 1px solid black;
661
+ display: table;
662
+ margin-bottom: 10px;
663
+ width: 100%;
664
+ }
665
+
666
+ .course-cover {
667
+ display: table-cell;
668
+ height: 100px;
669
+ width: 100px;
670
+ }
671
+
672
+ .course-detail {
673
+ display: table-cell;
674
+ vertical-align: top;
675
+ padding-left: 10px;
676
+ }
677
+
678
+ .course-title {
679
+ font-weight: bold;
680
+ }
681
+
682
+ .lp-button-dropdown {
683
+ padding-right: 28px !important;
684
+ position: relative;
685
+ z-index: 99998;
686
+ }
687
+
688
+ .lp-course-progress {
689
+ margin-right: 50px;
690
+ }
691
+
692
+ .lp-course-progress:after {
693
+ display: block;
694
+ content: '';
695
+ clear: both;
696
+ }
697
+
698
+ .lp-course-progress .lp-course-progress-heading {
699
+ margin: 0 0 40px 0;
700
+ }
701
+
702
+ .lp-course-progress .lp-progress-bar {
703
+ height: 20px;
704
+ background: #F5F5F5;
705
+ position: relative;
706
+ /* margin-right: 80px; */
707
+ float: left;
708
+ width: 100%;
709
+ margin-bottom: 50px;
710
+ -webkit-border-radius: 5px;
711
+ -moz-border-radius: 5px;
712
+ border-radius: 5px;
713
+ }
714
+
715
+ .lp-course-progress .lp-progress-value {
716
+ height: 20px;
717
+ background: #DDD;
718
+ position: absolute;
719
+ left: 0;
720
+ -webkit-transition: width 0.25s;
721
+ -moz-transition: width 0.25s;
722
+ -ms-transition: width 0.25s;
723
+ -o-transition: width 0.25s;
724
+ transition: width 0.25s;
725
+ -webkit-border-radius: 5px;
726
+ -moz-border-radius: 5px;
727
+ border-radius: 5px;;
728
+ }
729
+
730
+ .lp-course-progress .lp-progress-value > span,
731
+ .lp-course-progress .lp-passing-conditional span {
732
+ display: inline-block;
733
+ padding: 5px 10px;
734
+ font-size: small;
735
+ background: #DDD;
736
+ position: absolute;
737
+ right: 0;
738
+ top: -35px;
739
+ line-height: 1;
740
+ white-space: nowrap;
741
+ width: 50px;
742
+ text-align: center;
743
+ margin-right: -25px;
744
+ -webkit-border-radius: 3px;
745
+ -moz-border-radius: 3px;
746
+ border-radius: 3px;
747
+ }
748
+
749
+ .lp-course-progress .lp-progress-value > span:after,
750
+ .lp-course-progress .lp-passing-conditional span:after {
751
+ content: '';
752
+ display: block;
753
+ border: 6px solid #DDD;
754
+ position: absolute;
755
+ border-color: transparent;
756
+ border-top-color: #DDD;
757
+ bottom: -12px;
758
+ left: 50%;
759
+ margin-left: -6px;
760
+ }
761
+
762
+ .lp-course-progress .lp-passing-conditional span {
763
+ top: 30px;
764
+ margin-left: -25px;
765
+ }
766
+
767
+ .lp-course-progress .lp-passing-conditional span:after {
768
+ border-bottom-color: #DDD;
769
+ top: -12px;
770
+ left: 50%;
771
+ border-top-color: transparent;
772
+ bottom: auto;
773
+ }
774
+
775
+ .lp-course-progress .lp-progress-value.left > span {
776
+ left: 100%;
777
+ right: auto;
778
+ }
779
+
780
+ .lp-course-progress .lp-progress-value.left > span:after {
781
+ bottom: -4px;
782
+ transform: rotate(225deg);
783
+ left: -10px;
784
+ right: auto;
785
+ }
786
+
787
+ .lp-course-progress.passed .lp-progress-value {
788
+ background: #83D0FF;
789
+ -webkit-border-radius: 5px;
790
+ -moz-border-radius: 5px;
791
+ border-radius: 5px;
792
+ }
793
+
794
+ .lp-course-progress.passed .lp-progress-value > span {
795
+ background: #83D0FF;
796
+ }
797
+
798
+ .lp-course-progress.passed .lp-progress-value > span:after {
799
+ border-top-color: #83D0FF;
800
+ }
801
+
802
+ .lp-course-progress .lp-progress-total {
803
+ width: 50px;
804
+ float: right;
805
+ margin-right: -50px;
806
+ height: 20px;
807
+ font-size: small;
808
+ text-align: right;
809
+ line-height: 20px;
810
+ }
811
+
812
+ .lp-course-progress .lp-passing-conditional {
813
+ position: absolute;
814
+ height: 20px;
815
+ width: 1px;
816
+ background-color: #FF0000;
817
+ }
818
+
819
+ .lp-course-progress .lp-passing-conditional.right span {
820
+ right: 0;
821
+ }
822
+
823
+ .lp-course-progress .lp-passing-conditional.right span:after {
824
+ left: auto;
825
+ right: -10px;
826
+ border-left-color: transparent;
827
+ border-bottom-color: #DDD;
828
+ }
829
+
830
+ .quiz-questions-list .question-title {
831
+ font-weight: normal;
832
+ }
833
+
834
+ .question-results .question-title:after {
835
+ content: '';
836
+ display: inline-block;
837
+ font-family: dashicons;
838
+ vertical-align: middle;
839
+ font-size: 20px;
840
+ }
841
+
842
+ .question-results.correct .question-title:after {
843
+ content: "\f147";
844
+ }
845
+
846
+ .question-results.incorrect .question-title:after {
847
+ content: "\f335";
848
+ }
849
+
850
+ .question-results.skipped {
851
+ }
852
+
853
+ .complete-lesson-button.completed {
854
+
855
+ }
856
+
857
+ .learn-press-question-wrap {
858
+
859
+ }
860
+
861
+ .learn-press-question-wrap.checked li.answer-true {
862
+ background: #C4EBFF;
863
+ }
864
+
865
+ .learn-press-question-wrap.checked li.user-answer-false {
866
+ color: #FF0000;
867
+ }
868
+
869
+ /* jAlerts */
870
+ #popup_container {
871
+ background: #FFF;
872
+ }
873
+
874
+ #popup_title {
875
+ padding: 10px 20px;
876
+ background: #18B6C7;
877
+ color: #FFF;
878
+ }
879
+
880
+ #popup_content {
881
+ padding: 20px;
882
+ }
883
+
884
+ #popup_message {
885
+ margin-bottom: 20px;
886
+ }
887
+
888
+ .question-explanation-content,
889
+ .question-hint-content {
890
+ border: 1px solid #DDD;
891
+ padding: 20px;
892
+ background: #DDD;
893
+ margin-bottom: 20px;
894
+ }
895
+
896
+ .question-explanation-content:before,
897
+ .question-hint-content:before {
898
+ content: attr(data-title);
899
+ display: block;
900
+ font-weight: bold;
901
+ }
902
+
903
+ .button-fade {
904
+ opacity: 0.5;
905
+ }
906
+
907
+ .button-fade:hover {
908
+ opacity: 1;
909
+ }
910
+
911
+ #learn-press-content-item {
912
+ margin-bottom: 20px;
913
+ background: #ffffff;
914
+ border: 1px solid #DDD;
915
+ padding: 20px;
916
+ display: none;
917
+ }
918
+
919
+ #learn-press-content-item .course-lesson-heading {
920
+ margin-top: 0;
921
+ }
922
+ #learn-press-content-item.loading {
923
+ height: 50px;
924
+ overflow: hidden;
925
+ position: relative;
926
+ }
927
+
928
+ #learn-press-content-item.loading:before,
929
+ #learn-press-content-item.loading:after {
930
+ position: absolute;
931
+ top: 0;
932
+ left: 0;
933
+ right: 0;
934
+ bottom: 0;
935
+ z-index: 10;
936
+ background: #FFF;
937
+ content: '';
938
+ }
939
+
940
+ #learn-press-content-item.loading:after {
941
+ background: url("../images/ajax-loader.gif") center no-repeat;
942
+ }
943
+
944
+ #learn-press-course-lesson {
945
+ }
946
+
947
+ .quiz-question-nav-buttons {
948
+ margin: 10px 0;
949
+ }
950
+
951
+ @-ms-viewport {
952
+ width: device-width;
953
+ }
954
+
955
+ @viewport {
956
+ width: device-width;
957
+ }
958
+
959
+ /**
960
+ * Mobile Large 620px
961
+ */
962
+ @media screen and (min-width: 38.75em) {
963
+ .twentyfifteen .learnpress-content {
964
+ margin-right: 7.6923%;
965
+ margin-left: 7.6923%;
966
+ margin-top: 8.3333%;
967
+ }
968
+ }
969
+
970
+ @media screen and (max-width: 38.75em) {
971
+ .single-quiz .quiz-sidebar {
972
+ width: 100%;
973
+ }
974
+
975
+ .learnpress ul {
976
+ margin-left: 0;
977
+ }
978
+
979
+ #learn-press-course-curriculum .section .course-item-meta {
980
+ float: none;
981
+ }
982
+ }
983
+
984
+ /**
985
+ * Tablet Small 740px
986
+ */
987
+
988
+ @media screen and (min-width: 46.25em) {
989
+
990
+ }
991
+
992
+ /**
993
+ * Tablet Large 880px
994
+ */
995
+
996
+ @media screen and (min-width: 55em) {
997
+ }
998
+
999
+ /**
1000
+ * Desktop Small 955px
1001
+ */
1002
+
1003
+ @media screen and (min-width: 59.6875em) {
1004
+ .twentyfifteen .learnpress-content {
1005
+ margin-left: 8.3333%;
1006
+ margin-right: 8.3333%;
1007
+ padding: 10%;
1008
+ }
1009
+ }
1010
+
1011
+ @media screen and (max-width: 59.6875em) {
1012
+
1013
+ .twentyfifteen .learnpress-content {
1014
+ padding: 10%;
1015
+ }
1016
+ }
1017
+
1018
+ /**
1019
+ * Desktop Medium 1100px
1020
+ */
1021
+
1022
+ @media screen and (max-width: 68.75em) {
1023
+ .single-quiz .quiz-summary-left,
1024
+ .single-quiz .quiz-sidebar {
1025
+ float: none;
1026
+ margin: 0 auto;
1027
+ }
1028
+
1029
+ .single-quiz .quiz-summary-left {
1030
+ padding-right: 0;
1031
+ }
1032
+ }
1033
+
1034
+ /**
1035
+ * Desktop Large 1240px
1036
+ */
1037
+
1038
+ @media screen and (min-width: 77.5em) {
1039
+ }
1040
+
1041
+ /**
1042
+ * Desktop X-Large 1403px
1043
+ */
1044
+
1045
+ @media screen and (min-width: 87.6875em) {
1046
+
1047
+ }
assets/css/admin/admin.css ADDED
@@ -0,0 +1,1468 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Define all styles for admin side
3
+ *
4
+ * @author ThimPress
5
+ * @version 1.0
6
+ */
7
+ .lp-nav-tab-wrapper {
8
+ border-bottom: 1px solid #ccc;
9
+ margin: 0;
10
+ padding: 9px 15px 0 0;
11
+ line-height: inherit;
12
+ }
13
+
14
+ .learn-press-quick-add-page-inline {
15
+ display: inline-block;
16
+ vertical-align: top;
17
+ margin: 0 !important;
18
+ }
19
+
20
+ .learn-press-quick-add-page-inline > * {
21
+ vertical-align: top;
22
+ }
23
+
24
+ .post-type-lp_course .column-price {
25
+ width: 10%;
26
+ }
27
+
28
+ /* message box */
29
+ #learn-press-message-box-block {
30
+ position: fixed;
31
+ top: 0;
32
+ left: 0;
33
+ right: 0;
34
+ bottom: 0;
35
+ background-color: #000;
36
+ z-index: 99999;
37
+ opacity: 0.8;
38
+ }
39
+
40
+ #learn-press-message-box-window {
41
+ position: fixed;
42
+ top: 0;
43
+ bottom: 0;
44
+ left: 0;
45
+ right: 0;
46
+ z-index: 100000;
47
+ color: #FFF;
48
+ text-align: center;
49
+ }
50
+
51
+ #message-box-wrap {
52
+ margin: 0 auto;
53
+ /* text-align: center; */
54
+ display: inline-block;
55
+ text-align: left;
56
+ max-width: 70%;
57
+ }
58
+
59
+ .message-box-title {
60
+ color: #FFF;
61
+ margin: 0 0 40px 0;
62
+ font-size: 34px;
63
+ }
64
+
65
+ .message-box-content {
66
+ font-size: 16px;
67
+ line-height: 1.5;
68
+ }
69
+
70
+ .message-box-animation {
71
+ background-image: url("../../images/animation.gif");
72
+ width: 220px;
73
+ height: 20px;
74
+ margin: 20px 0 0;
75
+ }
76
+
77
+ .message-box-buttons {
78
+ margin: 20px 0 0;
79
+ border-top: 1px solid #929292;
80
+ padding-top: 20px;
81
+ }
82
+
83
+ .message-box-button {
84
+ margin-right: 10px !important;
85
+ }
86
+
87
+ .post-type-lp_lesson .column-format .lp-label {
88
+ font-size: 100%;
89
+ }
90
+
91
+ /*********************************/
92
+ .hide {
93
+ display: none;
94
+ }
95
+
96
+ .handle.dashicons {
97
+ cursor: move;
98
+ margin-right: 10px;
99
+ }
100
+
101
+ .meta_box_remove .dashicons {
102
+ text-decoration: initial;
103
+ }
104
+
105
+ .meta_box_course_lesson_quiz li input,
106
+ .meta_box_course_lesson_quiz li select {
107
+ min-width: 250px;
108
+ }
109
+
110
+ .rwmb-meta-box label {
111
+ color: #222;
112
+ font-weight: bold;
113
+ display: block;
114
+ margin: 16px 0;
115
+ }
116
+
117
+ .description {
118
+ margin-top: 5px;
119
+ }
120
+
121
+ .dashed-placeholder {
122
+ border: 2px dashed #999;
123
+ padding: 10px;
124
+ }
125
+
126
+ .learn-press-admin-notice-dismiss:before {
127
+ font-family: dashicons;
128
+ content: '\f335';
129
+ width: 20px;
130
+ height: 20px;
131
+ display: inline-block;
132
+ background-color: #FFFFFF;
133
+ border-radius: 50%;
134
+ line-height: 20px;
135
+ text-align: center;
136
+ box-shadow: 0px 0px 1px 1px #F1F1F1;
137
+ font-size: 18px;
138
+ vertical-align: middle;
139
+ float: right;
140
+ }
141
+
142
+ /**
143
+ * Course Metabox
144
+ */
145
+ li.quiz, li.lesson, li.quick_lesson, li.quick_quiz {
146
+ margin-left: 30px;
147
+ }
148
+
149
+ .wp-core-ui .meta_box_add_section,
150
+ .wp-core-ui .meta_box_add_lesson,
151
+ .wp-core-ui .meta_box_add_quiz,
152
+ .wp-core-ui .meta_box_quick_add_lesson,
153
+ .wp-core-ui .meta_box_quick_add_quiz {
154
+ margin-right: 10px;
155
+ }
156
+
157
+ .column-taxonomy-course_category {
158
+ width: 15%;
159
+ }
160
+
161
+ /**/
162
+ #lpr-block {
163
+ position: fixed;
164
+ top: 0;
165
+ left: 0;
166
+ right: 0;
167
+ bottom: 0;
168
+ background-color: #000;
169
+ display: none;
170
+ z-index: 200;
171
+ opacity: 0.2;
172
+ }
173
+
174
+ .lpr-quick-add-form {
175
+ background-color: #FFF;
176
+ padding: 5px;
177
+ position: absolute;
178
+ z-index: 210;
179
+ border: 1px solid #DDD;
180
+ }
181
+
182
+ .lpr-quick-add-form input {
183
+ font-size: 15px;
184
+ border-radius: 3px;
185
+ border: 1px solid #DDD;
186
+ width: 350px;
187
+ }
188
+
189
+ .lpr-quick-add-form input,
190
+ .lpr-quick-add-form select {
191
+ vertical-align: top;
192
+ }
193
+
194
+ .lpr-quick-add-form .lpr-ajaxload {
195
+ display: none;
196
+ background: url(../../images/spinner.gif) no-repeat center;
197
+ width: 30px;
198
+ color: #FFF;
199
+ margin-top: 6px;
200
+ }
201
+
202
+ .lpr-quick-add-form.working .lpr-ajaxload {
203
+ display: inline-block;
204
+ }
205
+
206
+ .lpr-quick-add-form.working button {
207
+ display: none;
208
+ }
209
+
210
+ .post-type-lpr_question .lpr-question-option-label {
211
+ display: none;
212
+ }
213
+
214
+ #lpr-question-options-wrap {
215
+ margin-top: 8px;
216
+ }
217
+
218
+ .lpr-question tr.lpr-disabled .dashicons-trash,
219
+ .lpr-question tr.lpr-disabled .dashicons-sort {
220
+ display: none;
221
+ }
222
+
223
+ /*
224
+ * Add on page
225
+ */
226
+
227
+ .lpr-add-ons-wrapper .add-on-info {
228
+ width: 65%;
229
+ display: inline-block;
230
+ }
231
+
232
+ .lpr-add-ons-wrapper .add-on-action {
233
+ float: right;
234
+ }
235
+
236
+ .lpr-add-ons-wrapper .add-on-action a {
237
+ text-decoration: none;
238
+ padding: 20px;
239
+ height: 80px;
240
+ width: 100px;
241
+ background: #EBEBEB;
242
+ margin-right: 100px;
243
+ }
244
+
245
+ .lpr-add-ons-wrapper .add-on-action .add-on-enabled {
246
+ text-align: center;
247
+ margin: 40px;
248
+ }
249
+
250
+ .lpr-add-ons-wrapper .add-on-action .add-on-disabled {
251
+ text-align: center;
252
+ margin: 40px;
253
+ }
254
+
255
+ .lpr-add-ons-wrapper .add-on-action a:hover {
256
+ text-decoration: none;
257
+ content: attr(data-text-disable);
258
+ }
259
+
260
+ .learn-press-add-ons {
261
+ margin: 20px 0 0;
262
+ }
263
+
264
+ .learn-press-add-ons:after {
265
+ display: block;
266
+ clear: both;
267
+ content: '';
268
+ }
269
+
270
+ .learn-press-add-ons > li {
271
+ /*float: left;*/
272
+ /*width: 25%;*/
273
+ /*position: relative;*/
274
+ }
275
+
276
+ .learn-press-add-ons > li .add-on-inner {
277
+ margin: 0 20px 40px 20px;
278
+ border: 1px solid #DDD;
279
+ border-radius: 10px;
280
+ overflow: hidden;
281
+ }
282
+
283
+ .learn-press-add-ons > li .add-on-thumbnail {
284
+ position: relative;
285
+ overflow: hidden;
286
+ border-bottom: 1px solid #E3E3E3;
287
+ }
288
+
289
+ .learn-press-add-ons > li .add-on-thumbnail img {
290
+ width: 100%;
291
+ height: auto;
292
+ vertical-align: top;
293
+ }
294
+
295
+ .learn-press-add-ons > li .add-on-thumbnail .add-on-overlay {
296
+ position: absolute;
297
+ left: 0;
298
+ right: 0;
299
+ height: 100%;
300
+ top: 0;
301
+ -webkit-transition: all 0.25s;
302
+ background-color: #ADE6FF;
303
+ opacity: 0;
304
+ }
305
+
306
+ .learn-press-add-ons > li .add-on-thumbnail .add-on-description {
307
+ position: absolute;
308
+ left: 20px;
309
+ right: 20px;
310
+ bottom: 0;
311
+ -webkit-transition: all 0.25s;
312
+ color: #444;
313
+ opacity: 0;
314
+ }
315
+
316
+ .learn-press-add-ons > li:hover .add-on-overlay {
317
+ opacity: 0.3;
318
+ }
319
+
320
+ .learn-press-add-ons > li:hover .add-on-description {
321
+ opacity: 1;
322
+ }
323
+
324
+ .learn-press-add-ons > li .add-on-info {
325
+ min-height: 80px;
326
+ padding: 20px;
327
+ background-color: #F5F5F5;
328
+ border-top: 1px solid #FFF;
329
+ }
330
+
331
+ .learn-press-add-ons > li .add-on-info > h3 {
332
+ margin-top: 0;
333
+ }
334
+
335
+ .learn-press-add-ons > li .add-on-actions {
336
+ position: absolute;
337
+ bottom: 43px;
338
+ }
339
+
340
+ .learn-press-add-ons > li .add-on-actions .add-on-state {
341
+ font-size: 36px;
342
+ vertical-align: top;
343
+ display: none;
344
+ margin-top: -8px;
345
+ color: #05B3FF;
346
+ margin-left: -9px;
347
+ }
348
+
349
+ .learn-press-add-ons > li .add-on-actions .add-on-state.change {
350
+ display: inline-block;
351
+ }
352
+
353
+ .learn-press-add-ons .plugin-card-top {
354
+ min-height: 180px;
355
+ }
356
+
357
+ .learn-press-add-ons .button.spinner {
358
+ background: url(../../images/spinner.gif) no-repeat 4px !important;
359
+ padding-left: 30px;
360
+ visibility: visible;
361
+ width: auto;
362
+ }
363
+
364
+ .learn-press-add-ons .action-links > span {
365
+ display: block;
366
+ text-align: right;
367
+ font-style: italic;
368
+ }
369
+
370
+ .learn-press-add-ons .action-links > span.enabled {
371
+ color: #7ad03a;
372
+ }
373
+
374
+ .learn-press-add-ons .action-links > span.disabled {
375
+ color: #FF0000;
376
+ }
377
+
378
+ .learn-press-add-ons .plugin-icon img {
379
+ max-width: 100%;
380
+ }
381
+
382
+ #learn-press-bundle-activate-add-ons.spinner {
383
+ float: left !important;
384
+ }
385
+
386
+ .learn-press-add-ons .plugin-version {
387
+ font-weight: bold;
388
+ }
389
+
390
+ #learn-press-add-ons-wrap #name {
391
+ width: 30%;
392
+ }
393
+
394
+ @media (max-width: 1280px) {
395
+ .learn-press-add-ons > li {
396
+ width: 33.33%;
397
+ }
398
+ }
399
+
400
+ @media (max-width: 768px) {
401
+ .learn-press-add-ons > li {
402
+ width: 50%;
403
+ }
404
+ }
405
+
406
+ @media (max-width: 480px) {
407
+ .learn-press-add-ons > li {
408
+ width: 100%;
409
+ }
410
+ }
411
+
412
+ /**/
413
+
414
+ #lpr-quiz-questions-wrap .select2-container .select2-choice {
415
+ height: 29px;
416
+ padding-top: 3px;
417
+ font-size: 14px;
418
+ }
419
+
420
+ .post-title.column-title {
421
+ overflow: visible;
422
+ }
423
+
424
+ .lpr-row-actions {
425
+ display: inline-block;
426
+ position: relative;
427
+ }
428
+
429
+ .lpr-row-action-dropdown {
430
+ position: absolute;
431
+ top: 100%;
432
+ left: 0;
433
+ min-width: 150px;
434
+ background-color: #FFF;
435
+ border: 1px solid #DDD;
436
+ padding: 0;
437
+ margin: 0;
438
+ display: none;
439
+ }
440
+
441
+ .lpr-row-action-dropdown > li {
442
+ margin: 0;
443
+ }
444
+
445
+ .lpr-row-action-dropdown > li > a {
446
+ display: block;
447
+ padding: 5px;
448
+ }
449
+
450
+ .lpr-row-actions > a {
451
+ padding-right: 15px;
452
+ position: relative;
453
+ }
454
+
455
+ .lpr-row-actions > a:after {
456
+ width: 0;
457
+ height: 0;
458
+ border: 5px solid transparent;
459
+ border-top-color: #DDD;
460
+ content: '';
461
+ display: inline-block;
462
+ position: absolute;
463
+ right: 0;
464
+ top: 6px;
465
+ }
466
+
467
+ .lpr-row-actions:hover > ul {
468
+ display: block;
469
+ }
470
+
471
+ /* addons page */
472
+ #lpr-add-ons-wrapper {
473
+ }
474
+
475
+ #lpr-add-ons-wrapper .lpr-add-on-block {
476
+ border-bottom: 1px dashed #DDD;
477
+ padding-bottom: 20px;
478
+ width: 50%;
479
+ float: left;
480
+ margin-top: 20px;
481
+ }
482
+
483
+ #lpr-add-ons-wrapper .lpr-add-on-block:after {
484
+ content: '';
485
+ display: block;
486
+ clear: both;
487
+ }
488
+
489
+ #lpr-add-ons-wrapper .lpr-admin-thumbnail {
490
+ float: left;
491
+ width: 200px;
492
+ }
493
+
494
+ #lpr-add-ons-wrapper .lpr-admin-thumbnail img {
495
+ vertical-align: top;
496
+ }
497
+
498
+ #lpr-add-ons-wrapper .lpr-add-on-info {
499
+ margin-left: 220px;
500
+ margin-right: 20px;
501
+ }
502
+
503
+ #lpr-add-ons-wrapper .lpr-add-on-info > h3 {
504
+ margin-top: 0;
505
+ }
506
+
507
+ #lpr-add-ons-wrapper .lpr-add-on-info > h3 > span {
508
+ display: inline-block;
509
+ padding: 0 5px;
510
+ background-color: #7AD3FA;
511
+ color: #FFF;
512
+ border-radius: 3px;
513
+ margin-left: 10px;
514
+ font-size: 12px;
515
+ vertical-align: top;
516
+ font-weight: normal;
517
+ }
518
+
519
+ #lpr-add-ons-wrapper .lpr-add-on-action {
520
+ float: right;
521
+ width: 100px;
522
+ }
523
+
524
+ /* toggle */
525
+ input.lpr-fancy-checkbox {
526
+ display: none;
527
+ }
528
+
529
+ .lpr-fancy-checkbox.tog {
530
+ border-radius: 20px;
531
+ box-shadow: inset 0 0 4px rgba(0, 0, 0, .6);
532
+ margin: 0 auto;
533
+ height: 19px;
534
+ width: 50px;
535
+ position: relative;
536
+ cursor: pointer;
537
+ font: 11px/18px arial;
538
+ background: #ccc;
539
+ -webkit-transition: all .2s ease;
540
+ -moz-transition: all .2s ease;
541
+ -o-transition: all .2s ease;
542
+ transition: all .2s ease;
543
+ display: inline-block !important;
544
+ }
545
+
546
+ .lpr-fancy-checkbox.tog:after {
547
+ content: '';
548
+ box-shadow: 0 2px 2px rgba(0, 0, 0, .6);
549
+ border-radius: 20px;
550
+ display: block;
551
+ height: 15px;
552
+ width: 15px;
553
+ background: #fff;
554
+ position: absolute;
555
+ top: 2px;
556
+ left: 2px;
557
+ -webkit-transition: all .2s ease;
558
+ -moz-transition: all .2s ease;
559
+ -o-transition: all .2s ease;
560
+ transition: all .2s ease;
561
+ }
562
+
563
+ .lpr-fancy-checkbox.tog:before {
564
+ content: 'OFF';
565
+ position: absolute;
566
+ right: 7px;
567
+ top: 1px;
568
+ color: #fff;
569
+ }
570
+
571
+ .lpr-fancy-checkbox.tog:hover:after {
572
+ left: 5px;
573
+ }
574
+
575
+ .lpr-fancy-checkbox.tog.on:before {
576
+ content: 'ON';
577
+ right: 28px;
578
+ }
579
+
580
+ .lpr-fancy-checkbox.tog.on {
581
+ background: #05B3FF;
582
+ }
583
+
584
+ .lpr-fancy-checkbox.tog.on:after {
585
+ left: 33px;
586
+ }
587
+
588
+ .lpr-fancy-checkbox.tog.on:hover:after {
589
+ left: 30px;
590
+ }
591
+
592
+ /**/
593
+ .clearfix:after {
594
+ display: block;
595
+ content: '';
596
+ clear: both;
597
+ }
598
+
599
+ .clear {
600
+ display: block;
601
+ clear: both;
602
+ height: 0;
603
+ }
604
+
605
+ /**********************************************************************/
606
+ /**********************************************************************/
607
+
608
+ .lp-list-options {
609
+ border: 1px solid #DDD;
610
+ border-collapse: collapse;
611
+ width: 100%;
612
+ }
613
+
614
+ .lp-list-option {
615
+
616
+ }
617
+
618
+ .lp-list-option.lp-list-option-empty td,
619
+ .lp-list-option.lp-list-option-empty th {
620
+ background-color: #FBE9E9;
621
+ }
622
+
623
+ .lp-list-option.lp-list-option-empty .lp-answer-check input,
624
+ .lp-list-option.lp-list-option-empty .lp-list-option-actions i {
625
+ display: none;
626
+ }
627
+
628
+ .lp-list-option .clm {
629
+
630
+ }
631
+
632
+ .lp-list-option .lp-item-checkbox {
633
+ }
634
+
635
+ .lp-list-option .lp-item-name {
636
+ }
637
+
638
+ .lp-list-option .lp-item-actions {
639
+ }
640
+
641
+ .lp-list-options thead th {
642
+ border: 1px solid #FFF;
643
+ background-color: #EAEAEA;
644
+ padding: 10px;
645
+ text-align: left;
646
+
647
+ color: #00A0D2;
648
+
649
+ }
650
+
651
+ .lp-list-options tbody th,
652
+ .lp-list-options tbody td {
653
+ border: 1px solid #FFF;
654
+ padding: 10px 10px;
655
+ text-align: left;
656
+ background-color: #F5F5F5;
657
+ }
658
+
659
+ .lp-list-options .lp-answer-check {
660
+ width: 100px;
661
+ }
662
+
663
+ .lp-list-options tbody th input[type="text"],
664
+ .lp-list-options tbody td input[type="text"] {
665
+ width: 100%;
666
+ }
667
+
668
+ .lp-list-options .ui-sortable-placeholder {
669
+ visibility: visible !important;
670
+ }
671
+
672
+ .lp-list-options .ui-sortable-placeholder td {
673
+ background-image: url("../../images/stripe.png");
674
+ }
675
+
676
+ .lp-list-option .lp-answer-text {
677
+ color: #777;
678
+ background-color: transparent;
679
+ border-color: transparent;
680
+ box-shadow: none;
681
+ }
682
+
683
+ .lp-list-option .lp-answer-text:after {
684
+ font-family: dashicons;
685
+ content: '\f464';
686
+ }
687
+
688
+ .lp-list-option .lp-answer-text:focus,
689
+ .lp-list-option:hover .lp-answer-text {
690
+ box-shadow: none;
691
+ outline: none;
692
+ background-color: transparent;
693
+ border-color: transparent;
694
+ }
695
+
696
+ .lp-list-option:hover .lp-answer-text {
697
+ border-style: dashed;
698
+ }
699
+
700
+ .lp-list-option-actions {
701
+ cursor: pointer;
702
+ color: #00A0D2;
703
+ }
704
+
705
+ .lp-list-option-actions.lp-move-list-option {
706
+ cursor: move;
707
+ }
708
+
709
+ .lp-list-option-actions:hover {
710
+ color: #156077;
711
+ }
712
+
713
+ /* Question meta box */
714
+ #question_answer .rwmb-question-wrapper {
715
+ margin: 12px 0 0 0;
716
+ }
717
+
718
+ .question-bottom-actions > * {
719
+ vertical-align: baseline !important;
720
+ }
721
+
722
+ /* Quiz meta box */
723
+ body.post-type-lp_quiz #questions,
724
+ body.post-type-lp_question #question_answer_ {
725
+ border: none;
726
+ box-shadow: none;
727
+ background-color: transparent;
728
+ }
729
+
730
+ body.post-type-lp_quiz #questions .handlediv,
731
+ body.post-type-lp_question #question_answer_ .handlediv {
732
+ display: none;
733
+ }
734
+
735
+ body.post-type-lp_quiz #questions .hndle,
736
+ body.post-type-lp_question #question_answer_ .hndle {
737
+ display: none;
738
+ }
739
+
740
+ body.post-type-lp_quiz #questions .inside,
741
+ body.post-type-lp_question #question_answer_ .inside {
742
+ padding: 0;
743
+ }
744
+
745
+ #questions .quiz-questions-heading {
746
+ margin: 0;
747
+ padding: 20px;
748
+ background-color: #FFF;
749
+ line-height: 1;
750
+ border: 1px solid #DDD;
751
+ }
752
+
753
+ #questions .quiz-questions-heading .questions-toggle {
754
+ float: right;
755
+ margin: 0;
756
+ line-height: 1;
757
+ }
758
+
759
+ #questions .quiz-questions-heading .questions-toggle a {
760
+ color: #DDD;
761
+ box-shadow: none;
762
+ }
763
+
764
+ #questions .quiz-questions-heading .questions-toggle a:hover {
765
+ color: #00a0d2;
766
+ }
767
+
768
+ #questions #learn-press-dropdown-questions {
769
+ display: inline-block;
770
+ position: relative;
771
+ }
772
+
773
+ #questions #learn-press-dropdown-questions > ul {
774
+ position: absolute;
775
+ top: 100%;
776
+ margin: 0;
777
+ padding: 0;
778
+ background-color: #FFF;
779
+ left: 0;
780
+ right: 0;
781
+ border: 1px solid #EEE;
782
+ border-top: none;
783
+ display: none;
784
+ z-index: 50;
785
+ }
786
+
787
+ #questions #learn-press-dropdown-questions > ul > li {
788
+ margin: 0;
789
+ }
790
+
791
+ #questions #learn-press-dropdown-questions > ul li > a {
792
+ display: block;
793
+ padding: 5px;
794
+ outline: none;
795
+ box-shadow: none;
796
+ }
797
+
798
+ #questions #learn-press-question-name {
799
+ font-size: 18px;
800
+ min-width: 350px;
801
+ margin: 0;
802
+ box-shadow: none;
803
+ border-color: #EEE;
804
+ color: #BBB;
805
+ vertical-align: middle;
806
+ }
807
+
808
+ #questions #learn-press-toggle-questions {
809
+ height: 32px;
810
+ vertical-align: top;
811
+ background-color: #FFF;
812
+ border: 1px solid #EEE;
813
+ width: 32px;
814
+ margin-left: -4px;
815
+ text-align: center;
816
+ font-size: 30px;
817
+ padding: 0;
818
+ color: #CCC;
819
+ border-left: none;
820
+ outline: none;
821
+ cursor: pointer;
822
+ }
823
+
824
+ #questions #learn-press-toggle-questions:hover {
825
+ color: #AAAAAA;
826
+ }
827
+
828
+ #questions #learn-press-button-add-question {
829
+ _vertical-align: middle;
830
+ }
831
+
832
+ #questions input[name="lp-new-question-name"] {
833
+
834
+ }
835
+
836
+ #questions .question-actions {
837
+ background-color: #FFF;
838
+ border: 1px solid #DDD;
839
+ padding: 10px;
840
+ display: inline-block;
841
+ margin-top: 20px;
842
+ position: relative;
843
+ z-index: 999;
844
+ }
845
+
846
+ #questions .quiz-question {
847
+ margin: -1px 0 0 0;
848
+ }
849
+
850
+ #questions .quiz-question .learn-press-question {
851
+ padding: 20px 20px 5px 20px;
852
+ background-color: #FFF;
853
+ border: 1px solid #DDD;
854
+ border-top: none;
855
+ }
856
+
857
+ #questions .quiz-question-head {
858
+ padding: 10px 20px;
859
+ border: 1px solid #DDD;
860
+ background-color: #F5F5F5;
861
+ position: relative;
862
+ }
863
+
864
+ #questions .quiz-question.is-hidden .quiz-question-head,
865
+ #questions .quiz-question.is-hidden .question-name {
866
+ background-color: #FFF;
867
+ }
868
+
869
+ #questions .quiz-question-head .quiz-question-actions {
870
+ float: right;
871
+ margin: 1px 0;
872
+ visibility: hidden;
873
+ padding-top: 2px;
874
+ }
875
+
876
+ #questions .quiz-question-head .quiz-question-actions a {
877
+ margin: 0 3px;
878
+ color: #DDD;
879
+ vertical-align: middle;
880
+ box-shadow: none;
881
+ }
882
+
883
+ #questions .quiz-question-head .quiz-question-actions a:hover {
884
+ color: #00a0d2;
885
+ }
886
+
887
+ #questions .quiz-question-head .quiz-question-actions a.move {
888
+ cursor: url("../../images/openhand.cur") 7 5, default;
889
+ position: absolute;
890
+ right: 0;
891
+ height: 50px;
892
+ top: 0;
893
+ background: url("../../images/grippy_large.png") left no-repeat;
894
+ width: 12px;
895
+ }
896
+
897
+ #questions .quiz-question-head:hover .quiz-question-actions {
898
+ visibility: visible;
899
+ }
900
+
901
+ #questions .quiz-question.ui-sortable-placeholder {
902
+ visibility: visible !important;
903
+ background-image: url("../../images/stripe.png");
904
+ border: 1px solid #DDD;
905
+ border-bottom: none;
906
+ }
907
+
908
+ #questions .question-name {
909
+ border: none;
910
+ box-shadow: none;
911
+ padding-left: 0;
912
+ width: 70%;
913
+ font-weight: bold;
914
+ color: #777;
915
+ vertical-align: middle;
916
+ background-color: #F5F5F5;
917
+ }
918
+
919
+ #questions .quiz-question-icon {
920
+ display: inline-block;
921
+ width: 25px;
922
+ height: 25px;
923
+ vertical-align: middle;
924
+ margin-right: 10px;
925
+ }
926
+
927
+ #questions .quiz-question-icon img {
928
+ max-width: 100%;
929
+ height: auto;
930
+ }
931
+
932
+ #questions #learn-press-dropdown-questions .added {
933
+ display: none;
934
+ }
935
+
936
+ .lpr-curriculum-section > h3 {
937
+ padding: 0 !important;
938
+ }
939
+
940
+ .lpr-curriculum-section > h3 .lpr-action {
941
+ top: 0;
942
+ right: 0;
943
+ }
944
+
945
+ .lpr-curriculum-section.lpr-empty > h3 {
946
+ cursor: default !important;
947
+ }
948
+
949
+ .lpr-curriculum-section.lpr-empty .lpr-action {
950
+ display: none !important;
951
+ }
952
+
953
+ .lpr-course-curriculum button span {
954
+ text-decoration: underline;
955
+ }
956
+
957
+ #learn-press-statistic {
958
+ margin-top: 20px;
959
+ }
960
+
961
+ .learn-press-chart {
962
+ position: relative;
963
+ }
964
+
965
+ .learn-press-chart canvas {
966
+ height: 70vh;
967
+ width: 100vw;
968
+ }
969
+
970
+ .chart-buttons form {
971
+ display: inline-block;
972
+ vertical-align: top;
973
+ }
974
+
975
+ .chart-buttons form input[type="text"] {
976
+ width: 105px;
977
+ font-size: 14px;
978
+ vertical-align: top;
979
+ margin: 0;
980
+ text-align: center;
981
+ font-weight: bold;
982
+ padding: 4px;
983
+ }
984
+
985
+ .chart-buttons form span {
986
+ display: inline-block;
987
+ vertical-align: middle;
988
+ font-weight: bold;
989
+ padding: 5px;
990
+ }
991
+
992
+ .learn-press-chart.loading:after {
993
+ content: '';
994
+ position: absolute;
995
+ top: 0;
996
+ left: 0;
997
+ right: 0;
998
+ bottom: 0;
999
+ z-index: 10;
1000
+ background: #FFF;
1001
+ opacity: 0.5;
1002
+ }
1003
+
1004
+ .chart-description {
1005
+
1006
+ }
1007
+
1008
+ .chart-description li {
1009
+ display: inline-block;
1010
+ margin-right: 15px;
1011
+ }
1012
+
1013
+ .chart-description li:before {
1014
+ content: '';
1015
+ display: inline-block;
1016
+ width: 10px;
1017
+ height: 10px;
1018
+ vertical-align: middle;
1019
+ margin-right: 5px;
1020
+ }
1021
+
1022
+ .chart-description li span {
1023
+ display: inline-block;
1024
+ vertical-align: middle;
1025
+ font-weight: bold;
1026
+ }
1027
+
1028
+ .chart-description li.all:before {
1029
+ background: #2FA7FF;
1030
+ }
1031
+
1032
+ .chart-description li.instructors:before {
1033
+ background: #EAC79B;
1034
+ }
1035
+
1036
+ .chart-description li.students:before {
1037
+ background: #D4D0CB;
1038
+ }
1039
+
1040
+ .lpr-stats-time {
1041
+ text-align: center;
1042
+ }
1043
+
1044
+ .lpr-hidden {
1045
+ display: none;
1046
+ }
1047
+
1048
+ #lpr-custom-time {
1049
+ position: relative;
1050
+ top: 4px;
1051
+ }
1052
+
1053
+ /* block page */
1054
+ #lpr-page-block {
1055
+ position: fixed;
1056
+ top: 0;
1057
+ left: 0;
1058
+ right: 0;
1059
+ bottom: 0;
1060
+ background-color: #000;
1061
+ opacity: 0.5;
1062
+ display: none;
1063
+ z-index: 9999;
1064
+ }
1065
+
1066
+ #form-quick-add-lesson-link {
1067
+ position: absolute;
1068
+ }
1069
+
1070
+ #_lpr_course_price_description > span {
1071
+ font-weight: bold;
1072
+ font-size: 15px;
1073
+ }
1074
+
1075
+ .lpr-ignore, .lpr-ignore:hover {
1076
+ color: #dd3d36;
1077
+ }
1078
+
1079
+ .lpr-ignore:hover {
1080
+ cursor: pointer;
1081
+ }
1082
+
1083
+ .lpr-quick-add-page-inline,
1084
+ .lpr-quick-actions-inline {
1085
+ display: inline-block;
1086
+ vertical-align: middle;
1087
+ margin: 0 !important;
1088
+ }
1089
+
1090
+ #lpr-toggle-quiz-mode {
1091
+ background-color: #0077FF;
1092
+ padding: 3px;
1093
+ margin-left: 5px;
1094
+ display: inline-block;
1095
+ border-radius: 3px;
1096
+ text-decoration: none;
1097
+ color: #FFF;
1098
+ }
1099
+
1100
+ .column-num_of_question {
1101
+ width: 150px;
1102
+ }
1103
+
1104
+ .lp-search-items input[name="lp-item-name"] {
1105
+ width: 500px;
1106
+ }
1107
+
1108
+ .lp-button-dropdown {
1109
+ padding-left: 0 !important;
1110
+ padding-right: 28px !important;
1111
+ position: relative;
1112
+ z-index: 99998;
1113
+ }
1114
+
1115
+ .lp-button-dropdown .lp-dropdown-label {
1116
+ padding-left: 10px;
1117
+ }
1118
+
1119
+ .lp-button-dropdown .lp-dropdown-arrow {
1120
+ display: inline-block;
1121
+ /* width: 20px; */
1122
+ text-align: center;
1123
+ padding: 0 10px;
1124
+ position: absolute;
1125
+ top: -1px;
1126
+ bottom: -1px;
1127
+ }
1128
+
1129
+ .lp-button-dropdown .lp-dropdown-items {
1130
+ position: absolute;
1131
+ margin: 0;
1132
+ /* width: 100%; */
1133
+ background-color: #FFF;
1134
+ top: 100%;
1135
+ margin-top: 1px;
1136
+ border: 1px solid #DDD;
1137
+ right: -1px;
1138
+ /* right: -1px; */
1139
+ width: 200px;
1140
+ z-index: 9999999;
1141
+ display: none;
1142
+ }
1143
+
1144
+ .lp-button-dropdown .lp-dropdown-items li {
1145
+ margin: 0;
1146
+ }
1147
+
1148
+ .lp-button-dropdown .lp-dropdown-items li a {
1149
+ display: block;
1150
+ padding: 10px;
1151
+ line-height: 1;
1152
+ text-decoration: none;
1153
+ outline: none;
1154
+ box-shadow: none;
1155
+ }
1156
+
1157
+ .lp-button-dropdown .lp-dropdown-items li a:hover {
1158
+ background-color: #F5F5F5;
1159
+ }
1160
+
1161
+ .lp-button-dropdown:not(.disabled) .lp-dropdown-arrow:hover + ul,
1162
+ .lp-button-dropdown:not(.disabled) ul:hover {
1163
+ display: block;
1164
+ }
1165
+
1166
+ .curriculum-section.lp-empty-section {
1167
+ }
1168
+
1169
+ .curriculum-section .lp-check-items,
1170
+ .curriculum-section .lp-check-items:hover {
1171
+ padding-left: 5px;
1172
+ padding-right: 12px;
1173
+ border-color: transparent;
1174
+ background: transparent;
1175
+ box-shadow: none;
1176
+ }
1177
+
1178
+ .column-format,
1179
+ .column-is_previewable,
1180
+ .column-taxonomy-question-tag {
1181
+ width: 10%;
1182
+ }
1183
+
1184
+ .learn-press-add-ons .plugin-card .install-now:before,
1185
+ .learn-press-add-ons .plugin-card .disable-now:before,
1186
+ .learn-press-add-ons .plugin-card .enable-now:before {
1187
+ margin: 3px 5px 0 -2px;
1188
+ display: inline-block;
1189
+ font: 400 20px/1 dashicons;
1190
+ /*speak: none;*/
1191
+ -webkit-font-smoothing: antialiased;
1192
+ -moz-osx-font-smoothing: grayscale;
1193
+ vertical-align: top;
1194
+ }
1195
+
1196
+ .learn-press-add-ons .plugin-card .install-now:before {
1197
+ content: '\f106';
1198
+ color: #0073aa;
1199
+ }
1200
+
1201
+ .learn-press-add-ons .plugin-card .disable-now:before {
1202
+ content: '\f147';
1203
+ color: #0073aa;
1204
+ }
1205
+
1206
+ .learn-press-add-ons .plugin-card .enable-now:before {
1207
+ content: '\f335';
1208
+ color: #d54e21;
1209
+ }
1210
+
1211
+ .learn-press-add-ons .plugin-card .disable-now:hover:before {
1212
+ content: '\f335';
1213
+ color: #d54e21;
1214
+ }
1215
+
1216
+ .learn-press-add-ons .plugin-card .enable-now:hover:before {
1217
+ content: '\f147';
1218
+ color: #0073aa;
1219
+ }
1220
+
1221
+ .learn-press-add-ons .plugin-card .button-working:before {
1222
+ content: '\f463' !important;
1223
+ -webkit-animation: lp-spinner 2s infinite linear;
1224
+ animation: lp-spinner 2s infinite linear;
1225
+ margin-right: 0;
1226
+ }
1227
+
1228
+ .learn-press-add-ons .plugin-card .button-working span {
1229
+ display: none;
1230
+ }
1231
+
1232
+ .lp-button-actions a {
1233
+ text-decoration: none;
1234
+ margin-left: 5px;
1235
+ }
1236
+
1237
+ .learn-press-quick-confirm {
1238
+ position: absolute;
1239
+ z-index: 9999;
1240
+ color: rgb(255, 255, 255);
1241
+ padding: 2px 8px;
1242
+ display: block;
1243
+ white-space: nowrap;
1244
+ left: -39.625px;
1245
+ top: 24px;
1246
+ background-color: #C90202;
1247
+ cursor: pointer;
1248
+ }
1249
+
1250
+ .learn-press-quick-confirm:hover,
1251
+ .learn-press-quick-confirm:hover:before {
1252
+ background-color: #d73b00;
1253
+ }
1254
+
1255
+ .learn-press-quick-confirm:before {
1256
+ content: '';
1257
+ display: block;
1258
+ position: absolute;
1259
+ /* border: 1px solid; */
1260
+ transform: rotate(45deg);
1261
+ width: 7px;
1262
+ height: 7px;
1263
+ top: -3px;
1264
+ background-color: #C90202;
1265
+ right: 7px;
1266
+ }
1267
+
1268
+ /* course */
1269
+ .wp-core-ui .meta_box_add_section,
1270
+ .wp-core-ui .meta_box_add_lesson {
1271
+ margin-right: 10px;
1272
+ }
1273
+
1274
+ .hide {
1275
+ display: none;
1276
+ }
1277
+
1278
+ .handle.dashicons {
1279
+ cursor: move;
1280
+ margin-right: 0;
1281
+ }
1282
+
1283
+ .meta_box_remove .dashicons {
1284
+ text-decoration: initial;
1285
+ }
1286
+
1287
+ .meta_box_course_lesson_quiz li input,
1288
+ .meta_box_course_lesson_quiz li select {
1289
+ min-width: 250px;
1290
+ }
1291
+
1292
+ .rwmb-meta-box label {
1293
+ color: #222;
1294
+ font-weight: bold;
1295
+ display: block;
1296
+ margin: 16px 0;
1297
+ }
1298
+
1299
+ .description {
1300
+ margin-top: 5px;
1301
+ }
1302
+
1303
+ .dashed-placeholder {
1304
+ border: 2px dashed #999;
1305
+ padding: 10px;
1306
+ }
1307
+
1308
+ /*
1309
+ TuNN added 21 03 2015
1310
+ Modified 03 Apr 2015
1311
+ */
1312
+ /* Course Curriculumn meta box section*/
1313
+
1314
+ /************ version 1.0 **************/
1315
+
1316
+ /* order */
1317
+ .post-type-lp_order #post-body-content,
1318
+ .post-type-lp_order #order_details .handlediv,
1319
+ .post-type-lp_order #order_details .hndle {
1320
+ display: none;
1321
+ }
1322
+
1323
+ .post-type-lp_order #submitpost .misc-pub-section label {
1324
+ display: block;
1325
+ font-weight: bold;
1326
+ }
1327
+
1328
+ #learn-press-order {
1329
+ margin: 15px;
1330
+ }
1331
+
1332
+ #learn-press-order .order-data-number {
1333
+ font-size: 36px;
1334
+ padding: 0;
1335
+ margin-bottom: 20px;
1336
+ }
1337
+
1338
+ #learn-press-order > h3 {
1339
+ margin: 0 0 10px 0;
1340
+ padding: 0;
1341
+ }
1342
+
1343
+ #learn-press-order .order-data-date,
1344
+ #learn-press-order .order-data-status,
1345
+ #learn-press-order .order-data-payment-method {
1346
+ font-size: 18px;
1347
+ padding: 0 0 10px 0;
1348
+ }
1349
+
1350
+ #learn-press-order .user-display-name,
1351
+ #learn-press-order .user-email,
1352
+ #learn-press-order .user-ip-address {
1353
+ padding: 0;
1354
+ margin: 0 0 10px 0;
1355
+ }
1356
+
1357
+ #learn-press-order .order-items table {
1358
+ border: 1px solid #DDD;
1359
+ border-collapse: collapse;
1360
+ width: 100%;
1361
+ }
1362
+
1363
+ #learn-press-order .order-items table th,
1364
+ #learn-press-order .order-items table td {
1365
+ text-align: left;
1366
+ padding: 10px 15px;
1367
+ border: 1px solid #DDD;
1368
+ }
1369
+
1370
+ #learn-press-install-sample-data-notice .install-sample-data-loading {
1371
+ display: none;
1372
+ }
1373
+
1374
+ /* ios checkbox */
1375
+ .learn-press-checkbox {
1376
+ display: none !important;
1377
+ }
1378
+
1379
+ .ios-ui-select {
1380
+ background: #dddddd;
1381
+ border: none !important;
1382
+ height: 18px;
1383
+ -webkit-border-radius: 9px;
1384
+ border-radius: 9px;
1385
+ width: 30px;
1386
+ -webkit-transition: all 0.3s ease-in-out;
1387
+ -moz-transition: all 0.3s ease-in-out;
1388
+ -ms-transition: all 0.3s ease-in-out;
1389
+ -o-transition: all 0.3s ease-in-out;
1390
+ transition: all 0.3s ease-in-out;
1391
+ -webkit-box-shadow: none;
1392
+ box-shadow: none;
1393
+ cursor: pointer;
1394
+ position: relative;
1395
+ display: inline-block;
1396
+ }
1397
+
1398
+ .ios-ui-select.checked {
1399
+ -webkit-box-shadow: inset 0 0 0 18px #6ddc5f;
1400
+ box-shadow: inset 0 0 0 18px #6ddc5f;
1401
+ }
1402
+
1403
+ .ios-ui-select.checked .inner {
1404
+ left: 13px;
1405
+ }
1406
+
1407
+ .ios-ui-select .inner {
1408
+ width: 16px;
1409
+ height: 16px;
1410
+ position: absolute;
1411
+ top: 1px;
1412
+ left: 1px;
1413
+ -webkit-border-radius: 100%;
1414
+ border-radius: 100%;
1415
+ background: white;
1416
+ -webkit-transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1);
1417
+ -moz-transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1);
1418
+ -o-transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1);
1419
+ transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1);
1420
+ -webkit-box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2), 0 3px 4px 0 rgba(0, 0, 0, 0.1);
1421
+ box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2), 0 3px 4px 0 rgba(0, 0, 0, 0.1);
1422
+ }
1423
+
1424
+ .lp-label-counter {
1425
+ display: inline-block;
1426
+ /* padding: 5px; */
1427
+ line-height: 1;
1428
+ background-color: #0073AA;
1429
+ border-radius: 10px;
1430
+ height: 21px;
1431
+ line-height: 20px;
1432
+ text-align: center;
1433
+ min-width: 21px;
1434
+ color: #FFF;
1435
+ padding: 0 5px;
1436
+ }
1437
+
1438
+ .column-num_of_question,
1439
+ .column-duration {
1440
+ width: 100px;
1441
+ text-align: left;
1442
+ }
1443
+
1444
+ #learn-press-admin-settings .form-table th {
1445
+ padding: 20px 10px 20px 0 !important;
1446
+ }
1447
+
1448
+ @-webkit-keyframes lp-spinner {
1449
+ 0% {
1450
+ -webkit-transform: rotate(0deg);
1451
+ transform: rotate(0deg);
1452
+ }
1453
+ 100% {
1454
+ -webkit-transform: rotate(359deg);
1455
+ transform: rotate(359deg);
1456
+ }
1457
+ }
1458
+
1459
+ @keyframes lp-spinner {
1460
+ 0% {
1461
+ -webkit-transform: rotate(0deg);
1462
+ transform: rotate(0deg);
1463
+ }
1464
+ 100% {
1465
+ -webkit-transform: rotate(359deg);
1466
+ transform: rotate(359deg);
1467
+ }
1468
+ }
assets/css/admin/meta-box-course.css ADDED
@@ -0,0 +1,794 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .post-type-lp_course #postdivrich{
2
+ visibility: hidden;
3
+ }
4
+
5
+ #learn-press-review-message{
6
+ margin-bottom: 10px;
7
+ }
8
+ #learn-press-review-message > h4{
9
+ margin: 0 0 10px 0;
10
+ }
11
+ #learn-press-review-message > textarea{
12
+ width: 100%;
13
+ height: 100px;
14
+ }
15
+ #learn-press-button-toggle-editor{
16
+ margin: 20px 0 0;
17
+ }
18
+ #course_curriculum{
19
+ border: none;
20
+ background-color: transparent;
21
+ }
22
+ #course_curriculum .handlediv,
23
+ #course_curriculum .hndle{
24
+ display: none;
25
+ }
26
+ #course_curriculum .inside{
27
+ margin: 0;
28
+ padding: 0;
29
+ }
30
+ #course_curriculum .curriculum-heading{
31
+ margin: 0 0 20px 0;
32
+ padding: 10px 20px;
33
+ background-color: #FFF;
34
+ line-height: 1;
35
+ border: 1px solid #DDD;
36
+ }
37
+ #course_curriculum .curriculum-heading .description{
38
+ font-weight: normal;
39
+ color: #999;
40
+ display: block;
41
+ font-size: 90%;
42
+ margin-top: 10px;;
43
+ }
44
+ #course_curriculum .curriculum-heading .items-toggle{
45
+ float: right;
46
+ margin: -33px 7px 0 0;
47
+ line-height: 1;
48
+ box-shadow: none;
49
+ }
50
+ #course_curriculum .curriculum-heading .items-toggle a{
51
+ -webkit-box-shadow: none;
52
+ -moz-box-shadow: none;
53
+ box-shadow: none;
54
+ font-size: 32px;
55
+
56
+ }
57
+ #course_curriculum .curriculum-sections{
58
+ margin: 0;
59
+ background-color: #FFF;
60
+ border-bottom: 1px solid #DDD;
61
+ }
62
+ #course_curriculum .curriculum-section{
63
+ margin: -1px 0 0 0;
64
+ background-color: #FFF;
65
+ border-bottom: 1px solid #DDD;
66
+ position: relative;
67
+ }
68
+ #course_curriculum .curriculum-section.ui-sortable-placeholder{
69
+ background-image: url("../../images/stripe.png");
70
+ visibility: visible !important;
71
+ border: 1px solid #DDD;
72
+ border-bottom: none;
73
+ }
74
+ #course_curriculum .curriculum-section-head{
75
+ border: 1px solid #DDD;
76
+ background-color: #F9F9F9;
77
+ border-bottom: none;
78
+ margin: 0;
79
+ color: #777;
80
+ padding: 3px 20px;
81
+ }
82
+ #course_curriculum .curriculum-section-head input{
83
+ background-color: #F9F9F9;
84
+ }
85
+ #course_curriculum .curriculum-section-head .lp-section-actions{
86
+ float: right;
87
+ margin: 14px 0;
88
+ visibility: hidden;
89
+ position: relative;
90
+ }
91
+ #course_curriculum .curriculum-section:not(.lp-empty-section) .curriculum-section-head:hover .lp-section-actions{
92
+ visibility: visible;
93
+ }
94
+ #course_curriculum .curriculum-section .lp-section-actions a{
95
+ vertical-align: middle;
96
+ color: #DDD;
97
+ width: 24px;
98
+ height: 24px;
99
+ box-shadow: none;
100
+ }
101
+ #course_curriculum .curriculum-section .lp-section-actions a[data-action="expand"]{
102
+ line-height: 28px;
103
+ }
104
+ #course_curriculum .curriculum-section .lp-section-actions a:before{
105
+ width: 24px;
106
+ height: 24px;
107
+ font-size: 24px;
108
+ }
109
+ #course_curriculum .curriculum-section .lp-section-actions a:hover{
110
+ color: #00a0d2;
111
+ }
112
+ #course_curriculum .curriculum-section .curriculum-section-head .lp-section-actions .move{
113
+ cursor: url("../../../assets/images/openhand.cur") 7 5, default;
114
+ position: absolute;
115
+ right: -15px;
116
+ height: 57px;
117
+ top: -15px;
118
+ background: url("../../../assets/images/grippy_large.png") right no-repeat;
119
+ width: 20px;
120
+ }
121
+ #course_curriculum .curriculum-section-content{
122
+ border: 1px solid #DDD;
123
+ padding: 20px;
124
+ border-bottom-width: 0;
125
+ width: 100%;
126
+ box-sizing: border-box;
127
+ }
128
+ #course_curriculum .curriculum-section.ui-sortable-helper{
129
+ border-bottom: 1px solid #DDD;
130
+ }
131
+ #course_curriculum .curriculum-section-head .lp-section-name{
132
+ border: none;
133
+ outline: none;
134
+ box-shadow: none;
135
+ font-size: 24px;
136
+ color: #777;
137
+ width: 70%;
138
+ margin: 0;
139
+ padding: 0;
140
+ height: 50px;
141
+ }
142
+ #course_curriculum .curriculum-section-head .lp-section-name:focus{
143
+ color: #444;
144
+ }
145
+ #course_curriculum .curriculum-section.lp-empty-section .curriculum-section-content{
146
+ display: none;
147
+ }
148
+ #course_curriculum .curriculum-section-items{
149
+ border-collapse: collapse;
150
+ width: 100%;
151
+ }
152
+ #course_curriculum .curriculum-section-items .lp-section-item{
153
+ border: 1px dashed #DDD;
154
+ margin: -1px 0 0 0;
155
+ padding: 5px 0;
156
+ background-color: #FFF;
157
+ }
158
+ #course_curriculum .curriculum-section-items .lp-section-item:nth-child(2n+1),
159
+ #course_curriculum .curriculum-section-items .lp-section-item:nth-child(2n+1) .section-item-input input{
160
+ background-color: #FCFCFC;
161
+ }
162
+ #course_curriculum .curriculum-section-items .lp-section-item .lp-item-actions{
163
+ margin: 0;
164
+ float: right;
165
+ position: relative;
166
+ }
167
+ #course_curriculum .curriculum-section-items .lp-section-item .lp-item-actions a{
168
+ vertical-align: middle;
169
+ color: #DDD;
170
+ margin-top: -2px;
171
+ box-shadow: none;
172
+ }
173
+ #course_curriculum .curriculum-section-items .lp-section-item .lp-item-actions a:hover{
174
+ color: #00a0d2;
175
+ }
176
+ #course_curriculum .curriculum-section-items .lp-section-item[data-item_id=""] .lp-edit{
177
+ display: none;
178
+ }
179
+ #course_curriculum .curriculum-section-items .lp-section-item.lp-item-empty .lp-item-actions{
180
+ display: none;
181
+ }
182
+ #course_curriculum .lp-section-item.ui-sortable-helper td{
183
+
184
+ }
185
+ #course_curriculum .lp-section-item.ui-sortable-placeholder{
186
+ visibility: visible !important;
187
+ }
188
+ #course_curriculum .lp-section-item.ui-sortable-placeholder td{
189
+ background-image: url("../../../assets/images/stripe.png");
190
+ border-bottom: none;
191
+ }
192
+
193
+ #course_curriculum .lp-item-actions > *{
194
+ visibility: hidden;
195
+ }
196
+ #course_curriculum .lp-item-actions > a{}
197
+ #course_curriculum .item-bulk-actions{
198
+ text-align: right;
199
+ margin-top: 0;
200
+ margin-bottom: 15px;
201
+ }
202
+ #course_curriculum .lp-section-item:not(.lp-item-empty):hover .lp-item-actions > *{
203
+ visibility: visible;
204
+ }
205
+ #course_curriculum .curriculum-section-items .lp-section-item:not(.lp-item-empty) .item-checkbox{
206
+ display: inline-block;
207
+ height: 34px;
208
+ border: none;
209
+ line-height: 32px;
210
+ padding: 0 7px 0 0;
211
+ margin: 0 4px 0 10px;
212
+ cursor: url("../../../assets/images/openhand.cur") 7 5, default;
213
+ visibility: visible;
214
+ }
215
+ #course_curriculum .curriculum-section-items .lp-section-item .item-checkbox input{
216
+ opacity: 0.4;
217
+ }
218
+ #course_curriculum .curriculum-section-items .lp-section-item:not(.lp-item-empty):hover .item-checkbox{
219
+ background: url("../../../assets/images/grippy_large.png") right no-repeat;
220
+ }
221
+ #course_curriculum .curriculum-section-items .lp-section-item:not(.lp-item-empty):hover .item-checkbox input{
222
+ opacity: 1;
223
+ }
224
+ #course_curriculum .lp-item-lp_lesson .handle.learn-press-icon:before{
225
+ content: "\e900";
226
+ }
227
+ #course_curriculum .lp-item-lp_quiz .handle.learn-press-icon:before{
228
+ content: "\e901";
229
+ }
230
+ #course_curriculum .lp-section-item.lp-item-new .handle{
231
+ color: #999;
232
+ }
233
+ #course_curriculum .curriculum-section-items .lp-section-item:hover,
234
+ #course_curriculum .curriculum-section-items .lp-section-item:hover input.lp-item-name{
235
+ background-color: #F9F9F9;
236
+ }
237
+ #course_curriculum .lp-section-item .handle{
238
+ width: 32px;
239
+ height: 32px;
240
+ display: inline-block;
241
+ vertical-align: middle;
242
+ text-align: center;
243
+ font-size: 18px;
244
+ line-height: 32px;
245
+ color: #00A0D2;
246
+ }
247
+ #course_curriculum .lp-section-item.remove input.lp-item-name{
248
+ color: #FF0000;
249
+ }
250
+
251
+ #course_curriculum .lp-section-item.ui-sortable-helper{
252
+
253
+ }
254
+ #course_curriculum .lp-section-item input.lp-item-name {
255
+ color: #777;
256
+ border: none;
257
+ box-shadow: none;
258
+ outline: none;
259
+ font-size: 16px;
260
+ width: 100%;
261
+ vertical-align: middle;
262
+ }
263
+ #course_curriculum .lp-section-describe{
264
+ border: none;
265
+ box-shadow: none;
266
+ color: #999;
267
+ font-style: italic;
268
+ width: 60%;
269
+ float: left;
270
+ padding-left: 0;
271
+ }
272
+ #course_curriculum .curriculum-section-items .lp-section-item input.lp-item-name:focus,
273
+ #course_curriculum input:focus{
274
+ color: #444;
275
+ }
276
+ #course_curriculum .lp-section-item .section-item-icon{
277
+ width: 32px;
278
+ white-space: nowrap;
279
+ }
280
+
281
+ .lp-section-item .learn-press-icon {
282
+ width: 32px;
283
+ height: 32px;
284
+ font-family: dashicons;
285
+ display: inline-block;
286
+ font-size: 20px;
287
+ text-align: center;
288
+ line-height: 32px;
289
+ color: #DDD;
290
+ cursor: pointer;
291
+ border: 1px solid transparent;
292
+ }
293
+ #course_curriculum .lp-section-item .learn-press-icon.item-lp_quiz:before{
294
+ content: "\f469";
295
+ }
296
+ #course_curriculum .lp-section-item .learn-press-icon.item-lp_lesson:before{
297
+ content: "\f330";
298
+ }
299
+ #course_curriculum .lp-section-item .learn-press-icon.item-selected,
300
+ #course_curriculum .lp-section-item[data-item_id=""] .learn-press-icon:hover{
301
+ }
302
+ #course_curriculum .lp-section-item td{
303
+ height: 30px;
304
+ }
305
+ #poststuff .postbox-container{
306
+ position: relative;
307
+ }
308
+ #course_tabs .handlediv,
309
+ #course_tabs .hndle,
310
+ #course_tabs .rwmb-label{
311
+ display: none;
312
+ }
313
+ #course_tabs .rwmb-input{
314
+
315
+ }
316
+ #course_tabs .inside{
317
+ margin: 0;
318
+ padding: 0;
319
+ }
320
+ #course_tabs .rwmb-course_tabs-wrapper{
321
+ margin: 0;
322
+ }
323
+ #course_tabs{
324
+ position: absolute;
325
+ left: 0;
326
+ right: 0;
327
+ }
328
+ #course_tabs.fixed{
329
+ position: fixed;
330
+ top: 30px;
331
+ z-index: 10000;
332
+ opacity: 0.5;
333
+ left: 182px;
334
+ right: 320px;
335
+ }
336
+ #course_tabs.fixed:hover{
337
+ opacity: 1;
338
+ }
339
+ #course_tabs_placeholder{
340
+ height: 41px;
341
+ margin-bottom: 20px;
342
+ }
343
+ #poststuff h3#course-tabs-h3{
344
+ padding: 0;
345
+ }
346
+ #course-tabs-h3 > a{
347
+ padding: 10px;
348
+ display: inline-block;
349
+ border-right: 1px solid #DDD;
350
+ text-decoration: none;
351
+ _color: #AAA;
352
+ box-shadow: none;
353
+ }
354
+ .learn-press-review-logs{
355
+ padding-bottom: 10px;
356
+ }
357
+ .learn-press-review-logs > li{
358
+ border-bottom: 1px dashed #DDD;
359
+ padding-bottom: 20px;
360
+ margin-top: 20px;
361
+ position: relative;
362
+ }
363
+ .learn-press-review-logs > li:after{
364
+ content: '';
365
+ display: block;
366
+ clear: both;
367
+ }
368
+ .learn-press-review-logs .review-user{
369
+ width: 48px;
370
+ float: left;
371
+ }
372
+ .learn-press-review-logs .review-user img{
373
+ max-width: 100%;
374
+ height: auto;
375
+ }
376
+ .learn-press-review-logs .review-user > *{
377
+ float: left;
378
+ }
379
+ .learn-press-review-logs .user-nicename{
380
+
381
+ }
382
+ .learn-press-review-logs .review-index {
383
+ width: 46px;
384
+ font-weight: bold;
385
+ position: absolute;
386
+ bottom: -11px;
387
+ left: 0;
388
+ background-color: #FFF;
389
+ text-align: center;
390
+ border: 1px dashed #DDD;
391
+ height: 20px;
392
+ line-height: 20px;
393
+ color: #CCC;
394
+ }
395
+ .learn-press-review-logs .review-content {
396
+ margin-left: 68px;
397
+ }
398
+ .learn-press-review-logs .review-message{
399
+ font-style: italic;
400
+ font-size: 16px;
401
+ margin-top: 10px;
402
+ color: #999;
403
+ }
404
+ .learn-press-review-logs > li .lp-label{
405
+ font-size: 100%;
406
+ margin-top: 20px;
407
+ }
408
+
409
+ .rwmb-curriculum-wrapper .rwmb-label{display: none;}
410
+ .rwmb-curriculum-wrapper .rwmb-input{
411
+ width: auto !important;
412
+ display: block;
413
+ }
414
+ .column-lp_course .row-actions{
415
+ display: inline-block;
416
+ margin-left: 10px;
417
+ }
418
+ .lp-modal-search li.selected{
419
+ display: none;
420
+ }
421
+ .lp-search-items input[name="lp-item-name"]{
422
+ width: 350px;
423
+ }
424
+ .lp-modal-search{
425
+ background-color: #F5F5F5;
426
+ color: #777;
427
+ padding: 20px;
428
+ height: 100%;
429
+ }
430
+ .lp-modal-search ul{
431
+
432
+ }
433
+ .lp-highlight-color{
434
+ text-decoration: underline;
435
+ color: #00a0d2;
436
+ }
437
+
438
+ .learn-press-dropdown-item-types {
439
+ position: relative;
440
+ }
441
+
442
+ .learn-press-dropdown-item-types > ul {
443
+ display: none;
444
+ position: absolute;
445
+ top: 0px;
446
+ z-index: 10;
447
+ background: #FFF;
448
+ border: 1px solid #DDD;
449
+ left: 100%;
450
+ margin-left: -1px;
451
+ }
452
+
453
+ .learn-press-dropdown-item-types > ul > li {
454
+ margin: 0;
455
+ display: table-cell;
456
+ }
457
+
458
+ .learn-press-dropdown-item-types > ul > li span {
459
+ border-width: 0 !important;
460
+ }
461
+
462
+ tr[data-item_id=""] .learn-press-dropdown-item-types:hover > ul,
463
+ tr[data-item_id=""].focus .learn-press-dropdown-item-types > ul {
464
+ display: inline-table;
465
+ border-left-color: transparent;
466
+ }
467
+
468
+ .learn-press-dropdown-item-types:hover > span.learn-press-icon,
469
+ tr.focus .learn-press-dropdown-item-types > span.learn-press-icon {
470
+ background: #FFF;
471
+ border-color: #DDD;
472
+ z-index: 5;
473
+ position: relative;
474
+ }
475
+
476
+ .learn-press-dropdown-item-types:hover > span.learn-press-icon:after {
477
+ content: '';
478
+ border-left: 1px solid #EEE;
479
+ position: absolute;
480
+ right: 0;
481
+ display: inline-block;
482
+ height: 20px;
483
+ top: 50%;
484
+ margin-top: -10px;
485
+ }
486
+
487
+ .learn-press-dropdown-item-types > span.learn-press-icon,
488
+ .learn-press-dropdown-item-types li:hover span.learn-press-icon,
489
+ .learn-press-dropdown-item-types li span.learn-press-icon.item-selected {
490
+ color: #0085ba;
491
+ }
492
+ /*
493
+ #lp-course-curriculum .lp-course-curriculum-toggle{
494
+ padding: 0;
495
+ margin: 0;
496
+ float: right;
497
+ }
498
+ #lp-course-curriculum .lp-item-name{
499
+ box-shadow: none;
500
+ border-color: transparent;
501
+ color: #BBB;
502
+ }
503
+ #lp-course-curriculum .lp-section-item:hover,
504
+ #lp-course-curriculum .lp-section-item.hover{
505
+ background-color: #F5F5F5;
506
+ border-style: solid;
507
+ }
508
+ #lp-course-curriculum .lp-section-item.lp-item-lp_lesson .handle:after{
509
+ content: "\f497";
510
+ }
511
+ #lp-course-curriculum .lp-section-item.lp-item-lp_quiz .handle:after{
512
+ content: "\f130";
513
+ }
514
+ #lp-course-curriculum .lp-section-item:hover .lp-item-name,
515
+ #lp-course-curriculum .lp-section-item.hover .lp-item-name{
516
+ border: 1px solid #DDD;
517
+ color: #32373c;
518
+ }
519
+ #lp-course-curriculum .lp-section-empty .lp-section-items{
520
+ display: none;
521
+ }
522
+ #lp-course-curriculum .lp-section-item .lp-item-actions{
523
+ float: right;
524
+ margin-left: 5px;
525
+ margin-top: 3px;
526
+ }
527
+ #lp-course-curriculum .lp-item-empty .lp-item-actions,
528
+ #lp-course-curriculum .lp-section-empty .lp-section-head .lp-action,
529
+ #lp-course-curriculum .lp-section-empty .lp-curriculum-section-content {
530
+ display: none;
531
+ }
532
+ #lp-course-curriculum .lp-item-empty{
533
+ cursor: default;
534
+ }
535
+ #lp-course-curriculum .lp-item-new{
536
+ border-color: #00A0D2;
537
+ }
538
+ #lp-course-curriculum .lp-item-new .lp-item-name{
539
+ border-color: #00A0D2;
540
+ }
541
+ #lp-course-curriculum .lp-section-head{
542
+ padding: 0;
543
+ }
544
+ #lp-course-curriculum .lp-curriculum-section .lp-toggle i:before{
545
+ content: '\f132';
546
+ }
547
+ #lp-course-curriculum .lp-curriculum-section.open .lp-toggle i:before{
548
+ content: '\f460';
549
+ }
550
+ .lp-modal-search{
551
+ position: absolute;
552
+ background-color: #FFF;
553
+ border: 1px solid #DDD;
554
+ border-top: none;
555
+ z-index: 9999;
556
+ margin: -1px 0 0 1px;
557
+ }
558
+ .lp-modal-search ul{
559
+ margin: 0;
560
+ padding: 0;
561
+ }
562
+ .lp-modal-search ul li{
563
+ list-style: none;
564
+ padding: 5px;
565
+ margin: 0;
566
+ }
567
+ .lp-modal-search li.highlighting,
568
+ .lp-modal-search li:hover{
569
+ background-color: #EAEAEA;
570
+ cursor: pointer;
571
+ }
572
+ .lp-highlight-color{
573
+ text-decoration: underline;
574
+ }
575
+ .lp-search-no-results{
576
+ display: none;
577
+ }
578
+ .lp-curriculum-sections .ui-sortable-placeholder{
579
+ visibility: visible !important;
580
+ border: 2px dashed #DDD;
581
+ }
582
+ .lp-curriculum-sections .lp-sorting{
583
+ height: auto !important;
584
+ }
585
+ */
586
+ /*
587
+
588
+ .lp-course-curriculum{}
589
+ .lp-course-curriculum .lp-curriculum-sections{
590
+
591
+ }
592
+ .lp-course-curriculum .lp-curriculum-section{
593
+ transition: opacity 0.25s;
594
+ margin-bottom: 20px;
595
+ border: 1px solid #DDD;
596
+ }
597
+ .lp-course-curriculum .lp-curriculum-section.lp-selected .lp-curriculum-section-content{
598
+ background-color: #F5F5F5;
599
+ }
600
+ .lp-course-curriculum .lp-curriculum-section-content > p{
601
+ display: inline-block;
602
+ }
603
+ .lp-course-curriculum .lp-curriculum-section.lp-selected > h3{
604
+ _border-bottom: 1px solid #DDD;
605
+ }
606
+ .lp-course-curriculum .lp-curriculum-section > h3{
607
+ padding: 10px ;
608
+ margin: 0;
609
+ background-color: #F5F5F5;
610
+ height: 62px;
611
+ position: relative;
612
+ cursor: move;
613
+ }
614
+ .lp-course-curriculum .lp-curriculum-section > h3 .lp-section-name-wrapper{
615
+ top: 9px;
616
+ }
617
+ .lp-course-curriculum .lp-curriculum-section > h3 > span > input{
618
+ border: 1px solid #DDD;
619
+ border-radius: 3px;
620
+ font-size: 24px;
621
+ width: 100%;
622
+ color: #777;
623
+ }
624
+ .lp-course-curriculum .lp-curriculum-section > h3 > span.lp-section-name-wrapper{
625
+ position: absolute;
626
+ display: inline-block;
627
+ right: 137px;
628
+ left: 71px;
629
+ }
630
+ .lp-course-curriculum .lp-curriculum-section > h3 .lp-action{
631
+ display: block;
632
+ position: relative;
633
+ height: 62px;
634
+ width: 62px;
635
+ border-left: 1px solid #DDD;
636
+ -top: -8px;
637
+ -right: -11px;
638
+ cursor: pointer;
639
+ float: right;
640
+ }
641
+ .lp-course-curriculum .lp-curriculum-section > h3 .lp-action.lp-sort{
642
+ display: none;
643
+ }
644
+ .lp-course-curriculum .lp-curriculum-section > h3 .lp-action .dashicons{
645
+ font-size: 32px;
646
+ width: 100%;
647
+ height: 100%;
648
+ line-height: 62px;
649
+ color: #0073aa;
650
+ }
651
+ .lp-course-curriculum .lp-curriculum-section > h3 .lp-action:hover .dashicons{
652
+ color: #009ED7;
653
+ }
654
+ .lp-course-curriculum .lp-curriculum-section > h3 .lp-action.lp-toggle{
655
+ _right: 62px;
656
+ }
657
+ .lp-course-curriculum .lp-curriculum-section > h3 .lp-action.lp-remove{
658
+ _right: 124px;
659
+ }
660
+
661
+ .lp-course-curriculum .lp-curriculum-section.closed .lp-curriculum-section-content{
662
+ display: none;
663
+ }
664
+
665
+ .lp-course-curriculum .sorting .ui-sortable-helper .lp-curriculum-section-content{
666
+ display: none !important;
667
+ }
668
+ .lp-course-curriculum .sorting .ui-sortable-placeholder,
669
+ .lp-section-items.sorting .ui-sortable-placeholder{
670
+ border: 3px dashed #DDD;
671
+ visibility: visible !important;
672
+ position: relative;
673
+ }
674
+ .lp-course-curriculum .sorting .ui-sortable-placeholder:after,
675
+ .lp-section-items.sorting .ui-sortable-placeholder:after{
676
+ content: '';
677
+ display: block;
678
+ width: 0px;
679
+ height: 0px;
680
+ border: 28px solid transparent;
681
+ border-left-color: #999;
682
+ position: absolute;
683
+ top: 0;
684
+ left: -33px;
685
+
686
+ }
687
+
688
+ .lp-section-items.sorting .ui-sortable-placeholder:after{
689
+ border-width: 15px;
690
+ left: -20px;
691
+ }
692
+ .lp-curriculum-section-content{
693
+ background-color: #F5F5F5;
694
+ background-color: #FFF;
695
+ _border-bottom: 2px dashed #DDD;
696
+ padding: 20px;
697
+ margin-bottom: 0px;
698
+ border-top: 1px solid #DDD;
699
+ }
700
+ .lp-dynamic-form{
701
+ position: absolute;
702
+ padding: 0px;
703
+ background-color: transparent;
704
+ z-index: 210;
705
+ height: 15px;
706
+ overflow: hidden;
707
+ }
708
+ .lp-container-dropdown{
709
+ height: 15px;
710
+ vertical-align: top;
711
+ }
712
+ .lp-container-dropdown > a{
713
+ background-image: none !important;
714
+ background-color: #FFF !important;
715
+ }
716
+ .lp-container-dropdown.select2-drop-above > a{
717
+ height: 3px;
718
+ }
719
+ .lp-select-dropdown{
720
+ margin-top: -6px;
721
+ }
722
+ .lp-select-dropdown.select2-drop-above{
723
+ padding-bottom: 0;
724
+ }
725
+
726
+ .lp-empty .lp-curriculum-section-content{
727
+ display: none !important;
728
+ }
729
+
730
+ .lp-section-items{
731
+ min-height: 20px;
732
+
733
+
734
+ }
735
+ .lp-section-items > li{
736
+ padding: 5px;
737
+ border:1px dashed #DDD;
738
+ background-color: #FFF;
739
+ cursor: move;
740
+ position: relative;
741
+ }
742
+ .lp-section-items > li .lp-title{
743
+ cursor: auto;
744
+ padding: 3px 5px;
745
+ border: 1px solid transparent;
746
+ display: inline-block;
747
+ width: 80%;
748
+ -webkit-box-sizing: border-box;
749
+ -moz-box-sizing: border-box;
750
+ box-sizing: border-box;
751
+
752
+ }
753
+ .lp-section-items > li:hover .lp-title {
754
+ border-color: #DDD;
755
+ cursor: text;
756
+ }
757
+ .lp-section-items > li input{
758
+ width: 70%;
759
+ }
760
+
761
+ .lp-section-items > li:hover{
762
+ border-style: solid;
763
+ }
764
+ .lp-section-icon{
765
+ position: absolute;
766
+ top:0;
767
+ left:0;
768
+ width: 62px;
769
+ height: 62px;
770
+ line-height: 54px;
771
+ border-right: 1px solid #DDD;
772
+ text-align:center;
773
+ }
774
+ .lp-section-icon i{
775
+ height: 60px;
776
+ line-height: 60px;
777
+ }
778
+ .lp-course-curriculum .dashicons{
779
+ vertical-align: middle;
780
+ }
781
+
782
+ .select2-drop.select2-drop-active{
783
+ padding: 5px 10px;
784
+ }
785
+
786
+ .rwmb-course_lesson_quiz-wrapper .rwmb-label{ display: none;}
787
+ .rwmb-course_lesson_quiz-wrapper .rwmb-input{ float: none; width: auto; display: block;}
788
+
789
+ .lp-course-curriculum-toggle{
790
+
791
+ }
792
+ .lp-course-curriculum-toggle .expand{
793
+ display: none;
794
+ }*/
assets/css/admin/meta-box-order.css ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ /* admin order details */
3
+ .column-order_date,
4
+ .column-order_total,
5
+ .column-order_status,
6
+ .post-type-lp_order .column-title{
7
+ width: 10%;
8
+ }
9
+ .post-type-lp_order .column-order_student{
10
+ width: 12%;
11
+ }
12
+ .post-type-lpr_order #post-body-content,
13
+ .post-type-lpr_order #postbox-container-1,
14
+ #order_details .ui-sortable-handle,
15
+ #order_details .handlediv {
16
+ display: none !important;
17
+ }
18
+
19
+ #order_details .inside {
20
+ padding: 20px;
21
+ margin: 0;
22
+ }
23
+
24
+ #order_details .order-user-avatar {
25
+ float: left;
26
+ margin-right: 20px;
27
+ }
28
+
29
+ #order_details .order-user-meta {
30
+ float: left;
31
+ }
32
+
33
+ #order_details .order-items table {
34
+ width: 100%;
35
+ border-collapse: collapse;
36
+ margin-top: 20px;
37
+ }
38
+
39
+ #order_details .order-items table tr {
40
+ border-bottom: 1px solid #EEE;
41
+ }
42
+
43
+ #order_details .order-items table thead th {
44
+ height: 30px;
45
+ text-align: left;
46
+ font-size: 16px;
47
+ padding: 15px 10px;
48
+ }
49
+
50
+ #order_details .order-items table td {
51
+ padding: 15px 10px;
52
+ font-size: 16px;
53
+ }
54
+
55
+ #order_details .order-items table .align-right {
56
+ text-align: right;
57
+ }
58
+
59
+ #order_details .order-data {
60
+ float: right;
61
+ }
62
+
63
+ #order_details .order-data {
64
+ text-align: right;
65
+ }
66
+
67
+ #order_details .order-data .order-data-number {
68
+ font-size: 24px;
69
+ font-weight: bold;
70
+ margin-bottom: 10px;
71
+ }
72
+
73
+ #order_details .order-data .order-data-date {
74
+ font-size: 14px;
75
+ font-style: italic;
76
+ margin-bottom: 5px;
77
+ }
78
+
79
+ #order_details .order-data .order-data-payment-method {
80
+ font-size: 16px;
81
+ font-weight: bold;
82
+ margin: 5px 0;
83
+ }
84
+
85
+ #order_details .order-data .order-data-status {
86
+ border-radius: 3px;
87
+ padding: 2px 5px;
88
+ display: inline-block;
89
+ color: #FFF;
90
+ font-size: 12px;
91
+
92
+ }
93
+
94
+ #order_details .order-data .order-data-status.completed {
95
+ background-color: #006400;
96
+ }
97
+
98
+ #order_details .order-data .order-data-status.pending {
99
+ background-color: #CCCCCC;
100
+ }
101
+
102
+ #order_details .total {
103
+ font-weight: bold;
104
+ font-size: 16px;
105
+ }
106
+ /*************************************************************/
107
+ .post-type-lpr_order .column-title {
108
+ width: 120px;
109
+ }
110
+
111
+ .post-type-lpr_order .column-order_student {
112
+ width: 100px;
113
+ }
114
+
115
+ .post-type-lpr_order .column-order_date {
116
+ width: 150px;
117
+ }
118
+
119
+ .post-type-lpr_order .column-order_total {
120
+ width: 100px;
121
+ text-align: right;
122
+ }
123
+
124
+ .post-type-lpr_order .column-order_status {
125
+ width: 100px;
126
+ }
127
+ .post-type-lp_order #minor-publishing-actions,
128
+ .post-type-lp_order #submitdiv .handlediv{
129
+ display: none;
130
+ }
131
+
132
+ .order-status-description {
133
+ font-size: smaller;
134
+ background: #CEE8FF;
135
+ padding: 5px;
136
+ font-style: italic;
137
+ color: #848484;
138
+ position: relative;
139
+ margin-top: 10px;
140
+ border-radius: 3px;
141
+ }
142
+
143
+ .order-status-description:before {
144
+ content: '';
145
+ border: 5px solid transparent;
146
+ border-bottom-color: #CEE8FF;
147
+ position: absolute;
148
+ top: -10px;
149
+ }
assets/css/admin/meta-box-question.css ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #question_settings select.lpr-question-types{
2
+ margin-left: 20px;
3
+ font-weight: normal;
4
+ display: none;
5
+ font-size: 12px;
6
+ padding: 0;
7
+ height: auto;
8
+ }
9
+ .lpr-question-option{
10
+ border: 1px solid #DDD;
11
+ border-collapse: collapse;
12
+ width: 100%;
13
+ border-bottom: none ;
14
+ position: relative;
15
+ }
16
+ .lpr-question-option{}
17
+ .lpr-question-option th,
18
+ .lpr-question-option td{
19
+ padding: 5px;
20
+ border: 1px solid #DDD;
21
+ }
22
+ .lpr-question-option thead{
23
+ background-color: #F5F5F5;
24
+ }
25
+ .lpr-question-option thead th{
26
+ text-align: left;
27
+ padding: 8px 5px;
28
+ border: 1px solid #DDD;
29
+ }
30
+ .lpr-question-option tbody{
31
+ position: relative;
32
+ }
33
+ .lpr-question-option tbody tr{
34
+ width: 100%;
35
+ background-color: #FFF;
36
+ }
37
+ .lpr-question-option tbody th{
38
+ text-align: left;
39
+ padding: 5px;
40
+ border: 1px solid #DDD;
41
+ width: 25%;
42
+ }
43
+ .lpr-question-option tbody tr.placeholder td{
44
+ border: 1px solid #DDD;
45
+ background-color: #DDD;
46
+ }
47
+ .lpr-question-option tbody tr.ui-sortable-helper{
48
+ left: 0;
49
+ }
50
+ .lpr-question-option input[type="text"] {
51
+ width: 100%;
52
+ }
53
+ .lp-modal-search{
54
+ background-color: #F5F5F5;
55
+ color: #777;
56
+ padding: 20px;
57
+ height: 100%;
58
+ }
59
+ .lp-modal-search ul{
60
+
61
+ }
62
+ .lp-highlight-color{
63
+ text-decoration: underline;
64
+ color: #00a0d2;
65
+ }
assets/css/global-style.css ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .button.loading{
2
+ }
3
+ .button.loading:after,
4
+ .button.added:after{
5
+ font-family: learnpress;
6
+ content: "\e902";
7
+ vertical-align: baseline;
8
+ line-height: 20px;
9
+ width: 20px;
10
+ text-align: center;
11
+ height: 20px;
12
+ display: inline-block;
13
+ margin-left: 10px;
14
+ font-weight: 400;
15
+ }
16
+ .button.added:after{
17
+ content: '\e903';
18
+ }
19
+ .button.loading:after{
20
+ -webkit-font-smoothing: antialiased;
21
+ -webkit-animation: spin 2s linear infinite;
22
+ -moz-animation: spin 2s linear infinite;
23
+ animation: spin 2s linear infinite;
24
+ }
25
+
26
+ .button.loading-before:before,
27
+ .button.added-before:before{
28
+ font-family: learnpress;
29
+ content: "\e902";
30
+ vertical-align: baseline;
31
+ line-height: 20px;
32
+ width: 20px;
33
+ text-align: center;
34
+ height: 20px;
35
+ display: inline-block;
36
+ margin-left: 10px;
37
+ font-weight: 400;
38
+ }
39
+ .button.added-before:before{
40
+ content: '\e903';
41
+ }
42
+ .button.loading-before:before{
43
+ -webkit-font-smoothing: antialiased;
44
+ -webkit-animation: spin 2s linear infinite;
45
+ -moz-animation: spin 2s linear infinite;
46
+ animation: spin 2s linear infinite;
47
+ }
48
+ .lp-ajaxload{
49
+ text-align: center;
50
+ height: auto;
51
+ overflow: hidden;
52
+ }
53
+ .lp-ajaxload:before{
54
+ font-family: dashicons;
55
+ content: "\f111";
56
+ -webkit-animation: form-press-spinner 2s infinite linear;
57
+ animation: learn-press-ajax-spinner 2s infinite linear;
58
+ color: #CECECE;
59
+ display: inline-block;
60
+ width: 38px;
61
+ height: 40px;
62
+ font-size: 40px;
63
+ position: relative;
64
+ line-height: 1;
65
+ }
66
+ #learn-press-modal-search-items{
67
+ background-color: #FFF;
68
+ overflow: auto;
69
+ width: 768px;
70
+ max-width: 100%;
71
+ color: #777;
72
+ }
73
+ #learn-press-modal-search-items header input{
74
+ width: 100%;
75
+ }
76
+ #learn-press-modal-search-items article{
77
+ overflow: auto;
78
+ margin: 20px 0;
79
+ }
80
+ #learn-press-modal-search-items article .lp-list-items{
81
+ margin: 0;
82
+ }
83
+ #learn-press-modal-search-items article .lp-list-items > li{
84
+ margin: 3px 0;
85
+ }
86
+ #learn-press-modal-search-items article .lp-list-items.lp-ajaxload > li{
87
+ display: none;
88
+ }
89
+ #learn-press-modal-search-items footer{
90
+
91
+ }
92
+
93
+ .modal-inner{
94
+ margin: 20px;
95
+ }
96
+ @-webkit-keyframes learn-press-ajax-spinner {
97
+ 0% {
98
+ -webkit-transform: rotate(0deg);
99
+ transform: rotate(0deg);
100
+ }
101
+ 100% {
102
+ -webkit-transform: rotate(359deg);
103
+ transform: rotate(359deg);
104
+ }
105
+ }
106
+ @keyframes learn-press-ajax-spinner {
107
+ 0% {
108
+ -webkit-transform: rotate(0deg);
109
+ transform: rotate(0deg);
110
+ }
111
+ 100% {
112
+ -webkit-transform: rotate(359deg);
113
+ transform: rotate(359deg);
114
+ }
115
+ }
assets/css/icons.css ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @font-face {
2
+ font-family: 'learnpress';
3
+ src: url('../fonts/icon.eot?ym8b3w');
4
+ src: url('../fonts/icon.eot?ym8b3w#iefix') format('embedded-opentype'),
5
+ url('../fonts/icon.ttf?ym8b3w') format('truetype'),
6
+ url('../fonts/icon.woff?ym8b3w') format('woff'),
7
+ url('../fonts/icon.svg?ym8b3w#icon') format('svg');
8
+ font-weight: normal;
9
+ font-style: normal;
10
+ }
11
+
12
+ [class^="learn-press-icon-"], [class*=" learn-press-icon-"], .learn-press-icon {
13
+ font-family: 'learnpress';
14
+ /*speak: none;*/
15
+ font-style: normal;
16
+ font-weight: normal;
17
+ font-variant: normal;
18
+ text-transform: none;
19
+ line-height: 1;
20
+
21
+ /* Better Font Rendering =========== */
22
+ -webkit-font-smoothing: antialiased;
23
+ -moz-osx-font-smoothing: grayscale;
24
+ }
25
+ .icon-checkmark:before {
26
+ content: "\e903";
27
+ }
28
+ .icon-books:before {
29
+ content: "\e900";
30
+ }
31
+ .icon-alarm:before {
32
+ content: "\e901";
33
+ }
34
+ .icon-spinner:before {
35
+ content: "\e902";
36
+ }
assets/css/learnpress-0.9.x.css ADDED
@@ -0,0 +1,476 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .clearfix:after {
2
+ display: block;
3
+ content: '';
4
+ clear: both;
5
+ }
6
+
7
+ .learnpress{
8
+
9
+ }
10
+
11
+ .learnpress h3{
12
+ font-size: 2.7rem;
13
+ line-height: 1.1852;
14
+ margin-top: 2.3704em;
15
+ margin-bottom: 1.1852em;
16
+ }
17
+
18
+ .learnpress .twentyfifteen .learnpress-content{
19
+ padding-left: 7.6923%;
20
+ padding-right: 7.6923%;
21
+ padding-top: 7.6923%;
22
+ margin-bottom: 7.6923%;
23
+ background: #fff;
24
+ box-shadow: 0 0 1px rgba(0,0,0,.15);
25
+ }
26
+ @media screen and (min-width: 59.6875em) {
27
+ .twentyfifteen .learnpress-content{
28
+ margin-left: 8.3333%;
29
+ margin-right: 8.3333%;
30
+ padding: 10%;
31
+ }
32
+ }
33
+ @media screen and (min-width: 38.75em) {
34
+ .twentyfifteen .learnpress-content {
35
+ margin-right: 7.6923%;
36
+ margin-left: 7.6923%;
37
+ margin-top: 8.3333%;
38
+ }
39
+ }
40
+ /***************************/
41
+
42
+ #course-header {
43
+
44
+ }
45
+
46
+ #course-header:after {
47
+ display: block;
48
+ content: '';
49
+ clear: both;
50
+ }
51
+
52
+ #course-main {
53
+ }
54
+
55
+ #course-main:after {
56
+ content: '';
57
+ display: block;
58
+ clear: both;
59
+ }
60
+
61
+ #course-desc {
62
+ width: 100%;
63
+ }
64
+
65
+ .course-info {
66
+ width: 75%;
67
+ float: left;
68
+ }
69
+
70
+ .course-getting, .course-related {
71
+ width: 25%;
72
+ float: right;
73
+ }
74
+
75
+ .course-free-button {
76
+
77
+ }
78
+
79
+ .learn-press {
80
+
81
+ }
82
+
83
+ .learn-press ul {
84
+ list-style: none;
85
+ }
86
+
87
+ /* Course */
88
+ .course-curriculum {
89
+
90
+ }
91
+
92
+ .course-curriculum .curriculum-sections {
93
+
94
+ }
95
+
96
+ .curriculum-sections .section {
97
+ overflow: hidden;
98
+ }
99
+
100
+ .curriculum-sections .section .section-header {
101
+ margin: 0 0 20px 0;
102
+ }
103
+
104
+ .curriculum-sections .section .section-header a {
105
+ outline: none;
106
+ font-size: 12px;
107
+ float: right;
108
+ }
109
+
110
+ .curriculum-sections .section-content {
111
+
112
+ }
113
+
114
+ .curriculum-sections .section-content .course-lesson,
115
+ .curriculum-sections .section-content .course-quiz {
116
+ margin: 0 0 10px 0;
117
+ }
118
+
119
+ .curriculum-sections .section-content .lesson-quiz-icon {
120
+ margin-right: 5px;
121
+ }
122
+
123
+ .curriculum-sections .section-content .course-lesson .lesson-quiz-icon:before,
124
+ .curriculum-sections .section-content .course-quiz .lesson-quiz-icon:before {
125
+ display: inline-block;
126
+ width: 25px;
127
+ height: 25px;
128
+ border-radius: 50%;
129
+ text-align: center;
130
+ line-height: 25px;
131
+ font-size: 12px;
132
+ color: #FFF;
133
+ background-color: #999;
134
+ vertical-align: middle;
135
+ }
136
+
137
+ .curriculum-sections .section-content .course-lesson .lesson-quiz-icon.lesson:before {
138
+ content: 'L';
139
+ }
140
+
141
+ .curriculum-sections .section-content .course-lesson.current .lesson-quiz-icon:before {
142
+ content: "\f177";
143
+ font-family: dashicons;
144
+ background-color: transparent;
145
+ color: #90DFFF;
146
+ font-size: 24px;
147
+ }
148
+
149
+ .curriculum-sections .section-content .course-quiz .lesson-quiz-icon.quiz:before {
150
+ content: 'Q';
151
+ }
152
+
153
+ .curriculum-sections .section-content .course-lesson.completed a,
154
+ .curriculum-sections .section-content .course-quiz.completed a {
155
+ text-decoration: line-through;
156
+ border-bottom: none;
157
+ }
158
+
159
+ .curriculum-sections .section-content .course-lesson.loading .lesson-quiz-icon:before {
160
+ content: '';
161
+ background: url(../images/ajaxload.gif) no-repeat center;
162
+ }
163
+
164
+ .course-content-lesson-nav,
165
+ .course-content-lesson-nav-text {
166
+ overflow: hidden;
167
+ }
168
+
169
+ .course-content-lesson-nav-text {
170
+ margin-top: 20px;
171
+ margin-bottom: 0;
172
+ text-transform: uppercase;
173
+ font-size: 12px;
174
+ font-weight: bold;
175
+ border-top: 1px dashed #e0e0e0;
176
+ padding-top: 20px;
177
+ }
178
+
179
+ .course-content-lesson-nav a {
180
+ }
181
+
182
+ .course-content-lesson-nav a.next-lesson,
183
+ .course-content-lesson-nav-text .next-lesson-text {
184
+ float: right;
185
+ }
186
+
187
+ #lesson-quiz-tooltip-container {
188
+ display: none;
189
+ visibility: hidden;
190
+ }
191
+
192
+ .lesson-quiz-tooltip {
193
+ font-size: 14px;
194
+ }
195
+
196
+ /* Single Quiz Pagge*/
197
+ .twentyfifteen .single-quiz {
198
+ padding-left: 10%;
199
+ padding-right: 10%;
200
+ padding-bottom: 10%;
201
+ }
202
+
203
+ .quiz-question-nav-buttons button {
204
+ _display: none;
205
+ }
206
+
207
+ .single-quiz .no-question {
208
+ font-size: 14px;
209
+ border: 1px solid #FFB6B6;
210
+ padding: 10px;
211
+ color: #FF7979;
212
+ }
213
+
214
+ .quiz-started .quiz-content, .quiz-completed .quiz-content {
215
+ display: none;
216
+ }
217
+
218
+ .quiz-question-nav {
219
+ margin-right: -250px;
220
+ float: left;
221
+ width: 100%;
222
+ }
223
+
224
+ .quiz-question-nav .lp-question-wrap {
225
+ margin-right: 200px;
226
+ }
227
+
228
+ .quiz-sidebar {
229
+ width: 230px;
230
+ float: right;
231
+ }
232
+
233
+ #quiz-countdown {
234
+ font-size: 48px;
235
+ text-align: center;
236
+ }
237
+
238
+ .quiz-countdown-text {
239
+ text-align: center;
240
+ margin: 10px;
241
+ line-height: 1.5;
242
+ }
243
+
244
+ .quiz-countdown-text span {
245
+ display: block;
246
+ }
247
+
248
+ .quiz-buttons {
249
+ text-align: center;
250
+ }
251
+
252
+ .quiz-questions > ul {
253
+ list-style: none;
254
+ margin: 20px 0;
255
+ }
256
+
257
+ .quiz-questions > ul li {
258
+ list-style: none;
259
+ margin: 0 0 15px 0;
260
+ font-size: 14px;
261
+ line-height: 1;
262
+ }
263
+
264
+ .quiz-questions > ul > li > h4 {
265
+ font-weight: normal;
266
+ }
267
+
268
+ .quiz-questions > ul li.current > h4 {
269
+ font-weight: bold;
270
+ }
271
+
272
+ .quiz-sidebar, .quiz-question-nav {
273
+ margin-top: 20px;
274
+ }
275
+
276
+ .button-finish-quiz {
277
+ display: none;
278
+ }
279
+
280
+ .quiz-started .button-finish-quiz {
281
+ display: inline;
282
+ }
283
+
284
+ .quiz-result {
285
+ margin-top: 20px;
286
+ float: left;
287
+ margin-right: -300px;
288
+ width: 100%;
289
+ }
290
+
291
+ .quiz-result .quiz-result-mark {
292
+ float: left;
293
+ width: 150px;
294
+ height: 150px;
295
+ background-color: #F5F5F5;
296
+ border-radius: 50%;
297
+ text-align: center;
298
+ box-sizing: border-box;
299
+ padding-top: 30px;
300
+ line-height: 1;
301
+
302
+ }
303
+
304
+ .quiz-result .quiz-result-mark .quiz-mark {
305
+ font-size: 60px;
306
+ display: block;
307
+ }
308
+
309
+ .quiz-result .quiz-result-mark .quiz-mark small {
310
+ font-size: 20px;
311
+ }
312
+
313
+ .quiz-result .quiz-result-summary {
314
+ float: left;
315
+ margin-left: 30px;
316
+ }
317
+
318
+ .quiz-result .quiz-result-summary .quiz-result-field {
319
+ margin: 0;
320
+ font-size: 14px;
321
+ }
322
+
323
+ .quiz-result .quiz-result-summary .quiz-result-field > label {
324
+ width: 100px;
325
+ display: inline-block;
326
+ }
327
+
328
+ .quiz-result .quiz-result-summary .quiz-result-field.correct {
329
+ color: #0066cc;
330
+ }
331
+
332
+ .quiz-result .quiz-result-summary .quiz-result-field.wrong {
333
+ color: #BC0B0B;
334
+ }
335
+
336
+ .quiz-result .quiz-result-summary .quiz-result-field.empty {
337
+ color: #869791;
338
+ }
339
+
340
+ #learn_press_payment_form {
341
+ display: none;
342
+ }
343
+
344
+ #learn_press_payment_form .learn_press_payment_form {
345
+ display: none;
346
+ }
347
+
348
+ #quiz-accordion > div {
349
+ height: auto !important;
350
+ }
351
+
352
+ @media screen and (max-width: 480px) {
353
+ .quiz-question-nav {
354
+ margin-right: 0;
355
+ float: none;
356
+ }
357
+
358
+ .quiz-sidebar {
359
+ width: 100%;
360
+ float: none;
361
+ }
362
+ }
363
+
364
+ .lpr-question-hint {
365
+ margin-top: 10px;
366
+ line-height: 1.5;
367
+ }
368
+
369
+ .lpr-question-hint .correct {
370
+ background: #CFE6FD;
371
+ }
372
+
373
+ .lpr-question-hint .wrong {
374
+ background: #FCCED3;
375
+ }
376
+
377
+ .learn-press .message {
378
+ border: 1px solid #90DFFF;
379
+ background-color: #DFF6FF;
380
+ padding: 10px;
381
+ font-size: 12px;
382
+ margin: 20px 0;
383
+ border-radius: 5px;
384
+ }
385
+
386
+ .learn-press .message.error {
387
+ border-color: #FF9090;
388
+ background-color: #FFDFDF;
389
+ }
390
+
391
+ /* jAlert */
392
+ #popup_container {
393
+ border: 1px solid rgb(221, 221, 221);
394
+ background-color: rgb(255, 255, 255);
395
+ min-width: 350px;
396
+ }
397
+
398
+ #popup_container #popup_title,
399
+ #popup_container #popup_content {
400
+ margin: 20px;
401
+ }
402
+
403
+ #popup_container #popup_message {
404
+ margin-bottom: 20px;
405
+ }
406
+
407
+ .lpr_course.has-post-thumbnail {
408
+ padding-top: 8.3333% !important;
409
+ }
410
+
411
+ #course_taken .course,
412
+ #course_made .course{
413
+ list-style: none;
414
+ }
415
+ #course_taken .course > li,
416
+ #course_made .course > li{
417
+ margin: 0 0 20px 0;
418
+ }
419
+ #course_taken .course-status{
420
+ font-size: 12px;
421
+ display: inline-block;
422
+ border-radius: 3px;
423
+ padding: 0 5px;
424
+ margin: 0 10px;
425
+ }
426
+ #course_taken .course-status.passed{
427
+ background-color: #90DFFF;
428
+ color: #FFF;
429
+ }
430
+ #user_quizzes:after {
431
+ content: "";
432
+ display: block;
433
+ clear: both;
434
+ }
435
+ .videoWrapper {
436
+ position: relative;
437
+ padding-bottom: 56.25%; /* 16:9 */
438
+ padding-top: 25px;
439
+ height: 0;
440
+ margin-bottom: 25px;
441
+ }
442
+ .videoWrapper iframe {
443
+ position: absolute;
444
+ top: 0;
445
+ left: 0;
446
+ width: 100%;
447
+ height: 100%;
448
+ }
449
+
450
+ .question-hint-title {
451
+
452
+ }
453
+
454
+ .question-hint-title:hover {
455
+ cursor: pointer;
456
+ }
457
+ .block-ui:before,
458
+ .block-ui:after{
459
+ position: absolute;
460
+ top: 0;
461
+ left: 0;
462
+ right: 0;
463
+ bottom: 0;
464
+ content: '';
465
+ }
466
+ .block-ui:before{
467
+ background-color: #E4E4E4;
468
+ opacity: 0.3;
469
+ }
470
+ .block-ui:after{
471
+ background: url(../images/ajax-loader.gif) no-repeat center;
472
+ }
473
+
474
+ .lpr_quiz {
475
+ visibility: hidden;
476
+ }
assets/css/learnpress-admin-compat.css DELETED
@@ -1,191 +0,0 @@
1
- /* wp version 3.9 */
2
- .plugin-group {
3
- overflow: hidden; /* clearfix */
4
- margin-top: 1.5em;
5
- }
6
-
7
- .plugin-group h3 {
8
- margin-top: 0;
9
- }
10
-
11
- .plugin-card {
12
- float: left;
13
- margin: 0 8px 16px;
14
- width: 48.5%;
15
- width: -webkit-calc( 50% - 8px );
16
- width: calc( 50% - 8px );
17
- background-color: #fff;
18
- border: 1px solid #dedede;
19
- -webkit-box-sizing: border-box;
20
- -moz-box-sizing: border-box;
21
- box-sizing: border-box;
22
- }
23
-
24
- .plugin-card:nth-child(odd) {
25
- clear: both;
26
- margin-left: 0;
27
- }
28
-
29
- .plugin-card:nth-child(even) {
30
- margin-right: 0;
31
- }
32
-
33
- @media screen and ( min-width: 1600px ) {
34
- .plugin-card {
35
- width: 30%;
36
- width: -webkit-calc( 33.1% - 8px );
37
- width: calc( 33.1% - 8px );
38
- }
39
-
40
- .plugin-card:nth-child(odd) {
41
- clear: none;
42
- margin-left: 8px;
43
- }
44
-
45
- .plugin-card:nth-child(even) {
46
- margin-right: 8px;
47
- }
48
-
49
- .plugin-card:nth-child(3n+1) {
50
- clear: both;
51
- margin-left: 0;
52
- }
53
-
54
- .plugin-card:nth-child(3n) {
55
- margin-right: 0;
56
- }
57
- }
58
-
59
- @media screen and ( max-width: 782px ) {
60
- .plugin-card {
61
- margin-left: 0;
62
- margin-right: 0;
63
- width: 100%;
64
- }
65
- }
66
-
67
- .plugin-card-top {
68
- position: relative;
69
- padding: 20px 20px 10px;
70
- min-height: 135px;
71
- }
72
-
73
- div.action-links,
74
- .plugin-action-buttons {
75
- margin: 0; /* Override existing margins */
76
- }
77
-
78
- .plugin-card h4 {
79
- margin: 0 0 12px;
80
- font-size: 18px;
81
- line-height: 1.3;
82
- }
83
-
84
- .plugin-card .name,
85
- .plugin-card .desc {
86
- margin-left: 148px; /* icon + margin */
87
- margin-right: 120px; /* action links */
88
- }
89
-
90
- .plugin-card .action-links {
91
- position: absolute;
92
- top: 20px;
93
- right: 20px;
94
- width: 120px;
95
- }
96
-
97
- .plugin-action-buttons {
98
- clear: right;
99
- float: right;
100
- margin-left: 2em;
101
- margin-bottom: 1em;
102
- text-align: right;
103
- }
104
-
105
- .plugin-action-buttons li {
106
- margin-bottom: 10px;
107
- }
108
-
109
- .plugin-card-bottom {
110
- clear: both;
111
- padding: 12px 20px;
112
- background-color: #fafafa;
113
- border-top: 1px solid #dedede;
114
- overflow: hidden;
115
- }
116
-
117
- .plugin-card-bottom .star-rating {
118
- display: inline;
119
- }
120
-
121
- .plugin-card .column-rating {
122
- line-height: 23px;
123
- }
124
-
125
- .plugin-card .column-rating,
126
- .plugin-card .column-updated {
127
- margin-bottom: 4px;
128
- }
129
-
130
- .plugin-card .column-rating,
131
- .plugin-card .column-downloaded {
132
- float: left;
133
- clear: left;
134
- max-width: 180px;
135
- }
136
-
137
- .plugin-card .column-updated,
138
- .plugin-card .column-compatibility {
139
- text-align: right;
140
- float: right;
141
- clear: right;
142
- width: 65%;
143
- width: -webkit-calc( 100% - 180px );
144
- width: calc( 100% - 180px );
145
- }
146
-
147
- .plugin-card .column-compatibility span:before {
148
- font: normal 20px/.5 'dashicons';
149
- speak: none;
150
- display: inline-block;
151
- padding: 0;
152
- top: 4px;
153
- left: -2px;
154
- position: relative;
155
- vertical-align: top;
156
- -webkit-font-smoothing: antialiased;
157
- -moz-osx-font-smoothing: grayscale;
158
- text-decoration: none !important;
159
- color: #444;
160
- }
161
-
162
- .plugin-card .compatibility-incompatible:before {
163
- content: '\f158';
164
- }
165
-
166
- .plugin-card .compatibility-compatible:before {
167
- content: '\f147';
168
- }
169
-
170
- .plugin-icon {
171
- position: absolute;
172
- top: 20px;
173
- left: 20px;
174
- width: 128px;
175
- height: 128px;
176
- margin: 0 20px 20px 0;
177
- }
178
-
179
- .plugin-icon img {
180
- width: 128px;
181
- height: 128px;
182
- }
183
-
184
- .no-plugin-results {
185
- color: #999;
186
- font-size: 18px;
187
- font-style: normal;
188
- margin: 0;
189
- padding: 100px 0 0;
190
- text-align: center;
191
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/learnpress-admin.css DELETED
@@ -1,702 +0,0 @@
1
- /**
2
- * Created by Hoang Ha
3
- *
4
- * Date: 11/03/2015
5
- */
6
- .hide {
7
- display: none;
8
- }
9
-
10
- .handle.dashicons {
11
- cursor: move;
12
- margin-right: 10px;
13
- }
14
-
15
- .meta_box_remove .dashicons {
16
- text-decoration: initial;
17
- }
18
-
19
- .meta_box_course_lesson_quiz li input,
20
- .meta_box_course_lesson_quiz li select {
21
- min-width: 250px;
22
- }
23
-
24
- .rwmb-meta-box label {
25
- color: #222;
26
- font-weight: bold;
27
- display: block;
28
- margin: 16px 0;
29
- }
30
-
31
- .description {
32
- margin-top: 5px;
33
- }
34
-
35
- .dashed-placeholder {
36
- border: 2px dashed #999;
37
- padding: 10px;
38
- }
39
-
40
- /**
41
- * Course Metabox
42
- */
43
- li.quiz, li.lesson, li.quick_lesson, li.quick_quiz {
44
- margin-left: 30px;
45
- }
46
-
47
- .wp-core-ui .meta_box_add_section,
48
- .wp-core-ui .meta_box_add_lesson,
49
- .wp-core-ui .meta_box_add_quiz,
50
- .wp-core-ui .meta_box_quick_add_lesson,
51
- .wp-core-ui .meta_box_quick_add_quiz {
52
- margin-right: 10px;
53
- }
54
-
55
- /**/
56
- #lpr-block {
57
- position: fixed;
58
- top: 0;
59
- left: 0;
60
- right: 0;
61
- bottom: 0;
62
- background-color: #000;
63
- display: none;
64
- z-index: 200;
65
- opacity: 0.2;
66
- }
67
-
68
- .lpr-quick-add-form {
69
- background-color: #FFF;
70
- padding: 5px;
71
- position: absolute;
72
- z-index: 210;
73
- border: 1px solid #DDD;
74
- }
75
-
76
- .lpr-quick-add-form input {
77
- font-size: 15px;
78
- border-radius: 3px;
79
- border: 1px solid #DDD;
80
- width: 350px;
81
- }
82
-
83
- .lpr-quick-add-form input,
84
- .lpr-quick-add-form select {
85
- vertical-align: top;
86
- }
87
-
88
- .lpr-quick-add-form .lpr-ajaxload {
89
- display: none;
90
- background-image: url(../images/spinner.gif);
91
- background-position: center;
92
- background-repeat: no-repeat;
93
- width: 30px;
94
- color: #FFF;
95
- margin-top: 6px;
96
- }
97
-
98
- .lpr-quick-add-form.working .lpr-ajaxload {
99
- display: inline-block;
100
- }
101
-
102
- .lpr-quick-add-form.working button {
103
- display: none;
104
- }
105
-
106
- .post-type-lpr_question .lpr-question-option-label {
107
- display: none;
108
- }
109
-
110
- #lpr-question-options-wrap {
111
- margin-top: 8px;
112
- }
113
-
114
- .lpr-question tr.lpr-disabled .dashicons-trash,
115
- .lpr-question tr.lpr-disabled .dashicons-sort {
116
- display: none;
117
- }
118
-
119
- /*
120
- * Add on page
121
- */
122
-
123
- .lpr-add-ons-wrapper .add-on-info {
124
- width: 65%;
125
- display: inline-block;
126
- }
127
-
128
- .lpr-add-ons-wrapper .add-on-action {
129
- float: right;
130
- }
131
-
132
- .lpr-add-ons-wrapper .add-on-action a {
133
- text-decoration: none;
134
- padding: 20px;
135
- height: 80px;
136
- width: 100px;
137
- background: #EBEBEB;
138
- margin-right: 100px;
139
- }
140
-
141
- .lpr-add-ons-wrapper .add-on-action .add-on-enabled {
142
- text-align: center;
143
- margin: 40px;
144
- }
145
-
146
- .lpr-add-ons-wrapper .add-on-action .add-on-disabled {
147
- text-align: center;
148
- margin: 40px;
149
- }
150
-
151
- .lpr-add-ons-wrapper .add-on-action a:hover {
152
- text-decoration: none;
153
- content: attr(data-text-disable);
154
- }
155
-
156
- .learn-press-add-ons{
157
- margin: 20px 0 0;
158
- }
159
- .learn-press-add-ons:after{
160
- display: block;
161
- clear: both;
162
- content: '';
163
- }
164
- .learn-press-add-ons > li{
165
- /*float: left;*/
166
- /*width: 25%;*/
167
- /*position: relative;*/
168
- }
169
- .learn-press-add-ons > li .add-on-inner{
170
- margin: 0 20px 40px 20px;
171
- border: 1px solid #DDD;
172
- border-radius: 10px;
173
- overflow: hidden;
174
- }
175
- .learn-press-add-ons > li .add-on-thumbnail{
176
- position: relative;
177
- overflow: hidden;
178
- border-bottom: 1px solid #E3E3E3;
179
- }
180
- .learn-press-add-ons > li .add-on-thumbnail img{
181
- width: 100%;
182
- height: auto;
183
- vertical-align: top;
184
- }
185
- .learn-press-add-ons > li .add-on-thumbnail .add-on-overlay{
186
- position: absolute;
187
- left: 0;
188
- right: 0;
189
- height: 100%;
190
- top: 0%;
191
- -webkit-transition: all 0.25s ;
192
- background-color: #ADE6FF;
193
- opacity: 0;
194
- }
195
- .learn-press-add-ons > li .add-on-thumbnail .add-on-description{
196
- position: absolute;
197
- left: 20px;
198
- right: 20px;
199
- bottom: 0%;
200
- -webkit-transition: all 0.25s ;
201
- color: #444;
202
- opacity: 0;
203
- }
204
- .learn-press-add-ons > li:hover .add-on-overlay{
205
- opacity: 0.3;
206
- }
207
- .learn-press-add-ons > li:hover .add-on-description{
208
- opacity: 1;
209
- }
210
- .learn-press-add-ons > li .add-on-info{
211
- min-height: 80px;
212
- padding: 20px;
213
- background-color: #F5F5F5;
214
- border-top: 1px solid #FFF;
215
- }
216
- .learn-press-add-ons > li .add-on-info > h3{
217
- margin-top: 0;
218
- }
219
- .learn-press-add-ons > li .add-on-actions{
220
- position: absolute;
221
- bottom: 43px;
222
- }
223
- .learn-press-add-ons > li .add-on-actions .add-on-state{
224
- font-size: 36px;
225
- vertical-align: top;
226
- display: none;
227
- margin-top: -8px;
228
- color: #05B3FF;
229
- margin-left: -9px;
230
- }
231
- .learn-press-add-ons > li .add-on-actions .add-on-state.change{
232
- display: inline-block;
233
- }
234
- .learn-press-add-ons .plugin-card-top{
235
- min-height: 180px;
236
- }
237
- .learn-press-add-ons .button.spinner{
238
- background: url(../../assets/images/spinner.gif) no-repeat 4px !important;
239
- padding-left: 30px;
240
- visibility: visible;
241
- width: auto;
242
- }
243
- .learn-press-add-ons .action-links > span{
244
- display: block;
245
- text-align: right;
246
- font-style: italic;
247
- }
248
- .learn-press-add-ons .action-links > span.enabled{
249
- color: #7ad03a;
250
- }
251
- .learn-press-add-ons .action-links > span.disabled{
252
- color: #FF0000;
253
- }
254
- #learn-press-bundle-activate-add-ons.spinner{
255
- float: left !important;
256
- }
257
- #learn-press-add-on-state-changed-message{
258
- position: fixed;
259
- bottom: 0;
260
- background-color: #F5F5F5;
261
- padding: 10px;
262
- border: 1px solid #DDD;
263
- z-index: 1000;
264
- display: none;
265
- }
266
- #learn-press-add-ons-wrap #name{
267
- width: 30%;
268
- }
269
-
270
- @media (max-width: 1280px) {
271
- .learn-press-add-ons > li{
272
- width: 33.33%;
273
- }
274
- }
275
- @media (max-width: 768px) {
276
- .learn-press-add-ons > li{
277
- width: 50%;
278
- }
279
- }
280
- @media (max-width: 480px) {
281
- .learn-press-add-ons > li{
282
- width: 100%;
283
- }
284
- }
285
- /**/
286
-
287
- #lpr-quiz-questions-wrap .select2-container .select2-choice {
288
- height: 29px;
289
- padding-top: 3px;
290
- font-size: 14px;
291
- }
292
-
293
- .post-title.column-title {
294
- overflow: visible;
295
- }
296
-
297
- .lpr-row-actions {
298
- display: inline-block;
299
- position: relative;
300
- }
301
-
302
- .lpr-row-action-dropdown {
303
- position: absolute;
304
- top: 100%;
305
- left: 0;
306
- min-width: 150px;
307
- background-color: #FFF;
308
- border: 1px solid #DDD;
309
- padding: 0;
310
- margin: 0;
311
- display: none;
312
- }
313
-
314
- .lpr-row-action-dropdown > li {
315
- margin: 0;
316
- }
317
-
318
- .lpr-row-action-dropdown > li > a {
319
- display: block;
320
- padding: 5px;
321
- }
322
-
323
- .lpr-row-actions > a {
324
- padding-right: 15px;
325
- position: relative;
326
- }
327
-
328
- .lpr-row-actions > a:after {
329
- display: block;
330
- width: 0;
331
- height: 0;
332
- border: 5px solid transparent;
333
- border-top-color: #DDD;
334
- content: '';
335
- display: inline-block;
336
- position: absolute;
337
- right: 0;
338
- top: 6px;
339
- }
340
-
341
- .lpr-row-actions:hover > ul {
342
- display: block;
343
- }
344
-
345
- /* addons page */
346
- #lpr-add-ons-wrapper {
347
- }
348
-
349
- #lpr-add-ons-wrapper .lpr-add-on-block {
350
- border-bottom: 1px dashed #DDD;
351
- padding-bottom: 20px;
352
- width: 50%;
353
- float: left;
354
- margin-top: 20px;
355
- }
356
-
357
- #lpr-add-ons-wrapper .lpr-add-on-block:after {
358
- content: '';
359
- display: block;
360
- clear: both;
361
- }
362
-
363
- #lpr-add-ons-wrapper .lpr-admin-thumbnail {
364
- float: left;
365
- width: 200px;
366
- }
367
-
368
- #lpr-add-ons-wrapper .lpr-admin-thumbnail img {
369
- vertical-align: top;
370
- }
371
-
372
- #lpr-add-ons-wrapper .lpr-add-on-info {
373
- margin-left: 220px;
374
- margin-right: 20px;
375
- }
376
-
377
- #lpr-add-ons-wrapper .lpr-add-on-info > h3{
378
- margin-top: 0;
379
- }
380
-
381
- #lpr-add-ons-wrapper .lpr-add-on-info > h3 > span {
382
- display: inline-block;
383
- padding: 0px 5px;
384
- background-color: #7AD3FA;
385
- color: #FFF;
386
- border-radius: 3px;
387
- margin-left: 10px;
388
- font-size: 12px;
389
- vertical-align: top;
390
- font-weight: normal;
391
- }
392
-
393
- #lpr-add-ons-wrapper .lpr-add-on-action {
394
- float: right;
395
- width: 100px;
396
- }
397
-
398
- /* toggle */
399
- input.lpr-fancy-checkbox {
400
- display: none;
401
- }
402
-
403
- .lpr-fancy-checkbox.tog {
404
- border-radius: 20px;
405
- display: block;
406
- box-shadow: inset 0 0 4px rgba(0, 0, 0, .6);
407
- margin: 0 auto;
408
- height: 19px;
409
- width: 50px;
410
- position: relative;
411
- cursor: pointer;
412
- font: 11px/18px arial;
413
- background: #ccc;
414
- -webkit-transition: all .2s ease;
415
- -moz-transition: all .2s ease;
416
- -o-transition: all .2s ease;
417
- transition: all .2s ease;
418
- display: inline-block !important;
419
- }
420
-
421
- .lpr-fancy-checkbox.tog:after {
422
- content: '';
423
- box-shadow: 0px 2px 2px rgba(0, 0, 0, .6);
424
- border-radius: 20px;
425
- display: block;
426
- height: 15px;
427
- width: 15px;
428
- background: #fff;
429
- position: absolute;
430
- top: 2px;
431
- left: 2px;
432
- -webkit-transition: all .2s ease;
433
- -moz-transition: all .2s ease;
434
- -o-transition: all .2s ease;
435
- transition: all .2s ease;
436
- }
437
-
438
- .lpr-fancy-checkbox.tog:before {
439
- content: 'OFF';
440
- position: absolute;
441
- right: 7px;
442
- top: 1px;
443
- color: #fff;
444
- }
445
-
446
- .lpr-fancy-checkbox.tog:hover:after {
447
- left: 5px;
448
- }
449
-
450
- .lpr-fancy-checkbox.tog.on:before {
451
- content: 'ON';
452
- right: 28px;
453
- }
454
-
455
- .lpr-fancy-checkbox.tog.on {
456
- background: #05B3FF;
457
- }
458
-
459
- .lpr-fancy-checkbox.tog.on:after {
460
- left: 33px;
461
- }
462
-
463
- .lpr-fancy-checkbox.tog.on:hover:after {
464
- left: 30px;
465
- }
466
-
467
- /**/
468
- .clearfix:after {
469
- display: block;
470
- content: '';
471
- clear: both;
472
- }
473
-
474
- .clear {
475
- display: block;
476
- clear: both;
477
- height: 0;
478
- }
479
-
480
- /* admin order details */
481
- .post-type-lpr_order #post-body-content,
482
- .post-type-lpr_order #postbox-container-1,
483
- #order_details .ui-sortable-handle,
484
- #order_details .handlediv {
485
- display: none !important;
486
- }
487
-
488
- #order_details .inside {
489
- padding: 20px;
490
- margin: 0;
491
- }
492
-
493
- #order_details .order-user-avatar {
494
- float: left;
495
- margin-right: 20px;
496
- }
497
-
498
- #order_details .order-user-meta {
499
- float: left;
500
- }
501
-
502
- #order_details .order-products table {
503
- width: 100%;
504
- border-collapse: collapse;
505
- margin-top: 20px;
506
- }
507
-
508
- #order_details .order-products table tr {
509
- border-bottom: 1px solid #EEE;
510
- }
511
-
512
- #order_details .order-products table thead th {
513
- height: 30px;
514
- text-align: left;
515
- font-size: 16px;
516
-
517
- }
518
-
519
- #order_details .order-products table td {
520
- padding: 15px 0;
521
- font-size: 16px;
522
- }
523
-
524
- #order_details .order-products table .align-right {
525
- text-align: right;
526
- }
527
-
528
- #order_details .order-data {
529
- float: right;
530
- }
531
-
532
- #order_details .order-data {
533
- text-align: right;
534
- }
535
-
536
- #order_details .order-data .order-data-number {
537
- font-size: 24px;
538
- font-weight: bold;
539
- margin-bottom: 10px;
540
- }
541
-
542
- #order_details .order-data .order-data-date {
543
- font-size: 14px;
544
- font-style: italic;
545
- margin-bottom: 5px;
546
- }
547
-
548
- #order_details .order-data .order-data-payment-method {
549
- font-size: 16px;
550
- font-weight: bold;
551
- margin: 5px 0;
552
- }
553
-
554
- #order_details .order-data .order-data-status {
555
- border-radius: 3px;
556
- padding: 2px 5px;
557
- display: inline-block;
558
- color: #FFF;
559
- font-size: 12px;
560
-
561
- }
562
-
563
- #order_details .order-data .order-data-status.completed {
564
- background-color: #006400;
565
- }
566
-
567
- #order_details .order-data .order-data-status.pending {
568
- background-color: #CCCCCC;
569
- }
570
-
571
- #order_details .total {
572
- font-weight: bold;
573
- font-size: 16px;
574
- }
575
-
576
- .post-type-lpr_order .column-title {
577
- width: 120px;
578
- }
579
-
580
- .post-type-lpr_order .column-order_student {
581
- width: 100px;
582
- }
583
-
584
- .post-type-lpr_order .column-order_date {
585
- width: 150px;
586
- }
587
-
588
- .post-type-lpr_order .column-order_total {
589
- width: 100px;
590
- text-align: right;
591
- }
592
-
593
- .post-type-lpr_order .column-order_status {
594
- width: 100px;
595
- }
596
-
597
- .lpr-curriculum-section > h3 {
598
- padding: 0 !important;
599
- }
600
-
601
- .lpr-curriculum-section > h3 .lpr-action {
602
- top: 0;
603
- right: 0;
604
- }
605
-
606
- .lpr-curriculum-section.lpr-empty > h3 {
607
- cursor: default !important;
608
- }
609
-
610
- .lpr-curriculum-section.lpr-empty .lpr-action {
611
- display: none !important;
612
- }
613
-
614
- .lpr-course-curriculum button span {
615
- text-decoration: underline;
616
- }
617
-
618
- .lpr-chart {
619
- padding: 100px 300px;
620
- }
621
-
622
- .lpr-stats-time {
623
- text-align: center;
624
- }
625
-
626
- .lpr-hidden {
627
- display: none;
628
- }
629
- .lpr-chart-wrapper {
630
- margin: 0 30px 0 10px;
631
- }
632
- #lpr-custom-time {
633
- position: relative;
634
- top: 4px;
635
- }
636
- .lpr-chart-wrapper canvas {
637
- padding-top: 20px;
638
- height: 70vh;
639
- width: 100vw;
640
- }
641
-
642
- /* block page */
643
- #lpr-page-block{
644
- position: fixed;
645
- top: 0;
646
- left: 0;
647
- right: 0;
648
- bottom: 0;
649
- background-color: #000;
650
- opacity: 0.5;
651
- display: none;
652
- z-index: 9999;
653
- }
654
-
655
- #form-quick-add-lesson-link{
656
- position: absolute;
657
- }
658
-
659
- #_lpr_course_price_description>span {
660
- font-weight: bold;
661
- font-size: 15px;
662
- }
663
- .lpr-ignore, .lpr-ignore:hover {
664
- color: #dd3d36;
665
- }
666
- .lpr-ignore:hover {
667
- cursor: pointer;
668
- }
669
-
670
- .lpr-quick-add-page-inline,
671
- .lpr-quick-actions-inline{
672
- display: inline-block;
673
- vertical-align: middle;
674
- margin: 0 !important;
675
- }
676
-
677
- #lpr-toggle-quiz-mode{
678
- background-color: #0077FF;
679
- padding: 3px;
680
- margin-left: 5px;
681
- display: inline-block;
682
- border-radius: 3px;
683
- text-decoration: none;
684
- color: #FFF;
685
- }
686
- .column-num_of_question{
687
- width: 150px;
688
- }
689
- .lpr-change-question-type {
690
- border: 1px solid #DDD;
691
- background-color: #FCFCFC;
692
- padding: 5px;
693
- display: inline-block;
694
- margin-bottom: 0;
695
- }
696
-
697
- .lpr-change-question-type span {
698
- display: inline-block;
699
- vertical-align: middle;
700
- font-weight: bold;
701
- margin-right: 10px;
702
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/learnpress.bak.css ADDED
@@ -0,0 +1,899 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ body.course-has-popup {
2
+ overflow: hidden;
3
+ }
4
+ #course-curriculum-popup {
5
+ position: fixed;
6
+ top: 0;
7
+ left: 0;
8
+ right: 0;
9
+ bottom: 0;
10
+ background: #000;
11
+ z-index: 999999;
12
+ }
13
+ #course-curriculum-popup #popup-sidebar {
14
+ float: left;
15
+ width: 350px;
16
+ position: absolute;
17
+ top: 0;
18
+ bottom: 0;
19
+ overflow: auto;
20
+ background: #FFF;
21
+ border-right: 1px solid #DDD;
22
+ }
23
+ #course-curriculum-popup #popup-sidebar .course-curriculum-title {
24
+ display: none;
25
+ }
26
+ #course-curriculum-popup #popup-sidebar .curriculum-sections {
27
+ margin: 0;
28
+ font-size: smaller;
29
+ }
30
+ #course-curriculum-popup #popup-main {
31
+ position: absolute;
32
+ top: 0;
33
+ left: 350px;
34
+ right: 0;
35
+ bottom: 0;
36
+ background: #FFF;
37
+ }
38
+ #course-curriculum-popup #popup-main #popup-header {
39
+ position: absolute;
40
+ top: 0;
41
+ left: 0;
42
+ right: 0;
43
+ height: 50px;
44
+ background: #F5F5F5;
45
+ border-bottom: 1px solid #DDD;
46
+ }
47
+ #course-curriculum-popup #popup-main #popup-header .popup-close {
48
+ width: 50px;
49
+ height: 50px;
50
+ position: absolute;
51
+ right: 0;
52
+ top: 0;
53
+ }
54
+ #course-curriculum-popup #popup-main #popup-header .popup-close:before,
55
+ #course-curriculum-popup #popup-main #popup-header .popup-close:after {
56
+ content: '';
57
+ border-top: 3px solid #636060;
58
+ width: 30px;
59
+ display: inline-block;
60
+ position: absolute;
61
+ }
62
+ #course-curriculum-popup #popup-main #popup-header .popup-close:before {
63
+ -webkit-transform: rotate(45deg);
64
+ top: 25px;
65
+ }
66
+ #course-curriculum-popup #popup-main #popup-header .popup-close:after {
67
+ -webkit-transform: rotate(-45deg);
68
+ top: 25px;
69
+ }
70
+ #course-curriculum-popup #popup-main #popup-header h3 {
71
+ margin: 0;
72
+ height: 50px;
73
+ line-height: 50px;
74
+ padding: 0 20px;
75
+ }
76
+ #course-curriculum-popup #popup-main #popup-content {
77
+ position: absolute;
78
+ top: 50px;
79
+ bottom: 50px;
80
+ left: 0;
81
+ right: 0;
82
+ overflow: auto;
83
+ }
84
+ #course-curriculum-popup #popup-main #popup-content #popup-content-inner {
85
+ margin: 20px;
86
+ }
87
+ #course-curriculum-popup #popup-main #popup-footer {
88
+ position: absolute;
89
+ bottom: 0;
90
+ left: 0;
91
+ right: 0;
92
+ height: 50px;
93
+ background: #F5F5F5;
94
+ border-top: 1px solid #DDD;
95
+ }
96
+ .tp_single_event {
97
+ color: red;
98
+ }
99
+ .tp_single_event :before {
100
+ content: '';
101
+ position: absolute;
102
+ top: 0;
103
+ left: 0;
104
+ right: 0;
105
+ bottom: 0;
106
+ background: rgba(0, 0, 0, 0.5);
107
+ }
108
+ /*
109
+ .column-lp_course .row-actions,
110
+ .column-lp_quiz .row-actions {
111
+ display: inline-block;
112
+ margin-left: 10px;
113
+ }
114
+
115
+ .column-lp_course .row-actions a,
116
+ .column-lp_quiz .row-actions a {
117
+ color: #999;
118
+ }*/
119
+ /**/
120
+ /* message box */
121
+ #learn-press-message-box-block {
122
+ position: fixed;
123
+ top: 0;
124
+ left: 0;
125
+ right: 0;
126
+ bottom: 0;
127
+ background-color: #000;
128
+ z-index: 99999;
129
+ opacity: 0.8;
130
+ }
131
+ #learn-press-message-box-window {
132
+ position: fixed;
133
+ top: 0;
134
+ bottom: 0;
135
+ left: 0;
136
+ right: 0;
137
+ z-index: 100000;
138
+ color: #FFF;
139
+ text-align: center;
140
+ }
141
+ #message-box-wrap {
142
+ margin: 0 auto;
143
+ /* text-align: center; */
144
+ display: inline-block;
145
+ text-align: left;
146
+ max-width: 70%;
147
+ }
148
+ .message-box-title {
149
+ color: #FFF;
150
+ margin: 0 0 40px 0;
151
+ font-size: 34px;
152
+ }
153
+ .message-box-content {
154
+ font-size: 16px;
155
+ line-height: 1.5;
156
+ }
157
+ .message-box-animation {
158
+ background-image: url("../images/animation.gif");
159
+ width: 220px;
160
+ height: 20px;
161
+ margin: 20px 0 0;
162
+ }
163
+ .message-box-buttons {
164
+ margin: 20px 0 0;
165
+ border-top: 1px solid #929292;
166
+ padding-top: 20px;
167
+ }
168
+ .message-box-button {
169
+ margin-right: 10px !important;
170
+ background-color: #FFFFFF;
171
+ color: #999;
172
+ }
173
+ .message-box-button:hover {
174
+ background-color: #F5F5F5;
175
+ }
176
+ .lp-label {
177
+ display: inline-block;
178
+ padding: 3px 8px;
179
+ line-height: 1;
180
+ font-size: 65%;
181
+ vertical-align: baseline;
182
+ color: #FFF;
183
+ border-radius: 4px;
184
+ }
185
+ .lp-label-quiz {
186
+ background-color: #53658C;
187
+ }
188
+ .lp-label-preview {
189
+ background-color: #5cb85c;
190
+ }
191
+ .lp-label-viewing {
192
+ background-color: #39afff;
193
+ }
194
+ .lp-label-lesson {
195
+ background-color: #337ab7;
196
+ }
197
+ .lp-label-final {
198
+ background-color: #FF6161;
199
+ }
200
+ .lp-label-completed {
201
+ background-color: #39C7CE;
202
+ }
203
+ .lp-label-format {
204
+ background-color: #ccc416;
205
+ }
206
+ .lp-label-format-aside {
207
+ background-color: #ccc416;
208
+ }
209
+ .lp-label-format-image {
210
+ background-color: #ccc416;
211
+ }
212
+ .lp-label-format-video {
213
+ background-color: #ccc416;
214
+ }
215
+ .lp-label-format-quote {
216
+ background-color: #ccc416;
217
+ }
218
+ .lp-label-format-link {
219
+ background-color: #ccc416;
220
+ }
221
+ .lp-label-format-gallery {
222
+ background-color: #ccc416;
223
+ }
224
+ .lp-label-format-status {
225
+ background-color: #ccc416;
226
+ }
227
+ .lp-label-format-audio {
228
+ background-color: #ccc416;
229
+ }
230
+ .lp-label-format-chat {
231
+ background-color: #ccc416;
232
+ }
233
+ .course-item .lp-label-completed,
234
+ .course-item .lp-label-viewing {
235
+ display: none;
236
+ }
237
+ .course-item.item-completed .lp-label-completed,
238
+ .course-item.item-current .lp-label-viewing {
239
+ display: inline-block;
240
+ }
241
+ .course-meta > * {
242
+ display: inline-block;
243
+ font-style: italic;
244
+ font-size: smaller;
245
+ }
246
+ .course-meta > *:after {
247
+ content: ' | ';
248
+ font-style: italic;
249
+ }
250
+ .course-meta > *:last-child:after {
251
+ display: none;
252
+ }
253
+ /**/
254
+ .learnpress ul,
255
+ .learnpress li {
256
+ list-style: none;
257
+ }
258
+ .learnpress h3 {
259
+ font-size: 2.7rem;
260
+ line-height: 1.1852;
261
+ margin-top: 2.3704em;
262
+ margin-bottom: 1.1852em;
263
+ }
264
+ .learnpress .learnpress-content {
265
+ z-index: 100;
266
+ position: relative;
267
+ }
268
+ .learnpress .twentyfifteen .learnpress-content {
269
+ padding-left: 7.6923%;
270
+ padding-right: 7.6923%;
271
+ padding-top: 7.6923%;
272
+ margin-bottom: 7.6923%;
273
+ background: #fff;
274
+ box-shadow: 0 0 1px rgba(0, 0, 0, 0.15);
275
+ }
276
+ .payment-method-form {
277
+ display: none;
278
+ }
279
+ .learn-press-user-form {
280
+ float: left;
281
+ width: 50%;
282
+ box-sizing: border-box;
283
+ padding: 0 10px;
284
+ }
285
+ #learn-press-checkout-user-form {
286
+ margin: 0 -10px;
287
+ }
288
+ /* archive */
289
+ .learnpress .twentyfifteen .page-title {
290
+ margin: 0 0 30px 0;
291
+ }
292
+ .course-introduce {
293
+ margin: 20px 0 0 0;
294
+ }
295
+ .course-title,
296
+ .course-title h3 {
297
+ font-size: 18px;
298
+ }
299
+ /* pagination */
300
+ .learn-press-pagination {
301
+ text-align: center;
302
+ }
303
+ .learn-press-pagination ul > li {
304
+ display: inline-block;
305
+ }
306
+ .learn-press-pagination ul > li a,
307
+ .learn-press-pagination ul > li span {
308
+ display: inline-block;
309
+ padding: 0 10px;
310
+ border: 1px solid #DDD;
311
+ background-color: #F5F5F5;
312
+ }
313
+ .learn-press-pagination ul > li a {
314
+ background-color: #FFF;
315
+ }
316
+ .learn-press-breadcrumb {
317
+ margin: 0 0 20px 0;
318
+ }
319
+ /* course lesson nav */
320
+ .course-item-nav {
321
+ border-top: 1px dashed #DDD;
322
+ overflow: hidden;
323
+ margin: 20px 0;
324
+ padding-top: 10px;
325
+ }
326
+ .course-item-nav .course-item-prev > *,
327
+ .course-item-nav .course-item-next > * {
328
+ display: block;
329
+ }
330
+ .course-item-nav > div > span {
331
+ font-size: 70%;
332
+ text-transform: uppercase;
333
+ font-weight: bold;
334
+ }
335
+ .course-item-nav .course-item-prev {
336
+ float: left;
337
+ text-align: left;
338
+ }
339
+ .course-item-nav .course-item-next {
340
+ float: right;
341
+ text-align: right;
342
+ }
343
+ /* curriculum */
344
+ .section-header {
345
+ margin: 0 0 0 0;
346
+ padding: 10px 15px;
347
+ background-color: #EEE;
348
+ }
349
+ .section-header p {
350
+ display: inline-block;
351
+ font-weight: normal;
352
+ font-style: italic;
353
+ color: #999;
354
+ font-size: smaller;
355
+ margin: 0;
356
+ }
357
+ #learn-press-course-curriculum .section {
358
+ margin: 0 0 1px 0;
359
+ list-style: none;
360
+ }
361
+ #learn-press-course-curriculum .section-content {
362
+ margin: 0;
363
+ background-color: #F5F5F5;
364
+ }
365
+ #learn-press-course-curriculum .section .course-item {
366
+ margin: 0 0 0;
367
+ list-style: none;
368
+ padding: 10px 15px;
369
+ border-top: 1px solid #FFF;
370
+ }
371
+ #learn-press-course-curriculum .section .course-item-meta {
372
+ display: block;
373
+ float: right;
374
+ line-height: 1;
375
+ margin: 3px 0;
376
+ }
377
+ #learn-press-course-curriculum .section .course-item.section-empty {
378
+ background-color: #F5F5F5;
379
+ }
380
+ #learn-press-course-curriculum .section .course-item.section-empty .learn-press-message {
381
+ margin: 0;
382
+ }
383
+ /* QUIZ */
384
+ .single-quiz .quiz-summary-left {
385
+ float: left;
386
+ width: 100%;
387
+ padding-right: 320px;
388
+ }
389
+ .single-quiz .quiz-sidebar {
390
+ float: right;
391
+ width: 300px;
392
+ margin-left: -300px;
393
+ border: 2px solid #DDD;
394
+ padding: 20px;
395
+ }
396
+ .single-quiz.quiz-completed .quiz-questions-list .learn-press-question-title {
397
+ display: none;
398
+ }
399
+ .quiz-questions-list .current {
400
+ font-weight: bold;
401
+ }
402
+ .quiz-questions-list .current a:after {
403
+ display: inline-block;
404
+ background-color: #0066cc;
405
+ /* padding: 0px 8px; */
406
+ color: #FFF;
407
+ font-size: 70%;
408
+ border-radius: 50%;
409
+ content: '?';
410
+ /* margin-left: 10px; */
411
+ width: 20px;
412
+ height: 20px;
413
+ line-height: 20px;
414
+ text-align: center;
415
+ vertical-align: middle;
416
+ }
417
+ .quiz-countdown {
418
+ text-align: center;
419
+ }
420
+ .quiz-countdown #quiz-countdown-value {
421
+ font-size: 40px;
422
+ line-height: 1;
423
+ }
424
+ .quiz-countdown .quiz-countdown-label {
425
+ font-size: smaller;
426
+ font-style: italic;
427
+ color: #999;
428
+ }
429
+ .quiz-buttons {
430
+ text-align: center;
431
+ }
432
+ .quiz-result {
433
+ width: 100%;
434
+ }
435
+ .quiz-result .quiz-result-mark {
436
+ float: left;
437
+ width: 150px;
438
+ height: 150px;
439
+ background-color: #F5F5F5;
440
+ border-radius: 50%;
441
+ text-align: center;
442
+ box-sizing: border-box;
443
+ padding-top: 30px;
444
+ line-height: 1;
445
+ }
446
+ .quiz-result .quiz-result-mark .quiz-mark {
447
+ font-size: 60px;
448
+ display: block;
449
+ }
450
+ .quiz-result .quiz-result-mark .quiz-mark small {
451
+ font-size: 20px;
452
+ }
453
+ .quiz-result .quiz-result-summary {
454
+ float: left;
455
+ margin-left: 30px;
456
+ }
457
+ .quiz-result .quiz-result-summary .quiz-result-field {
458
+ margin: 0;
459
+ font-size: 14px;
460
+ }
461
+ .quiz-result .quiz-result-summary .quiz-result-field > label {
462
+ width: 100px;
463
+ display: inline-block;
464
+ }
465
+ .quiz-result .quiz-result-summary .quiz-result-field.correct {
466
+ color: #0066cc;
467
+ }
468
+ .quiz-result .quiz-result-summary .quiz-result-field.wrong {
469
+ color: #BC0B0B;
470
+ }
471
+ .quiz-result .quiz-result-summary .quiz-result-field.empty {
472
+ color: #869791;
473
+ }
474
+ .quiz-history {
475
+ font-size: 80%;
476
+ }
477
+ .quiz-history td {
478
+ padding: 10px;
479
+ }
480
+ .quiz-history-actions {
481
+ margin: 0;
482
+ }
483
+ /* profile */
484
+ #learn-press-user-profile {
485
+ overflow: hidden;
486
+ }
487
+ .learn-press-user-profile .user-info {
488
+ margin: 0 0 20px;
489
+ }
490
+ .learn-press-user-profile .learn-press-tabs {
491
+ list-style: none;
492
+ margin: 0 0 20px;
493
+ padding-left: 5px;
494
+ border-bottom: 1px solid #DDD;
495
+ }
496
+ .learn-press-user-profile .learn-press-tabs > li {
497
+ float: left;
498
+ }
499
+ .learn-press-user-profile .learn-press-tabs > li > a {
500
+ box-shadow: none;
501
+ outline: none;
502
+ display: block;
503
+ border: none;
504
+ padding: 5px 10px;
505
+ }
506
+ .learn-press-user-profile .learn-press-tabs > li.current a {
507
+ background-color: #FFF;
508
+ border: 1px solid #DDD;
509
+ border-bottom-color: transparent;
510
+ z-index: 10;
511
+ margin-bottom: -1px;
512
+ }
513
+ .learn-press-tabs-wrapper {
514
+ margin: 0 0 20px;
515
+ }
516
+ .learn-press-user-profile .learn-press-tabs-wrapper > .learn-press-tab {
517
+ /*padding: 0;
518
+ float: left;
519
+ width: 100%;
520
+ margin-right: -100%;
521
+ visibility: hidden;*/
522
+ }
523
+ .learn-press-user-profile .learn-press-tabs-wrapper {
524
+ /*float: left;
525
+ width: 100%;
526
+ padding-left: 170px;*/
527
+ }
528
+ .learn-press-user-profile .profile-content-left {
529
+ float: left;
530
+ margin-left: -100%;
531
+ margin-bottom: -100000px;
532
+ padding-bottom: 100000px;
533
+ background-color: #F5F5F5;
534
+ }
535
+ .profile-courses {
536
+ list-style: none;
537
+ }
538
+ .profile-courses-heading {
539
+ margin: 0 0 10px !important;
540
+ }
541
+ .learn-press-subtabs > li {
542
+ display: inline-block;
543
+ margin-right: 10px;
544
+ }
545
+ .learn-press-subtabs > li.current {
546
+ font-weight: bold;
547
+ }
548
+ .learn-press-subtab-content {
549
+ display: none;
550
+ }
551
+ .learn-press-subtab-content.current {
552
+ display: block;
553
+ }
554
+ .hide-if-js {
555
+ display: none;
556
+ }
557
+ /**/
558
+ .learn-press-cart-table td,
559
+ .learn-press-cart-table th {
560
+ vertical-align: top;
561
+ }
562
+ .learn-press-cart-table .course-remove {
563
+ width: 40px;
564
+ }
565
+ .learn-press-cart-table .course-thumbnail {
566
+ width: 20%;
567
+ }
568
+ .learn-press-cart-table .course-price,
569
+ .learn-press-cart-table .course-total {
570
+ width: 15%;
571
+ }
572
+ /* notices */
573
+ .learn-press-notice,
574
+ .learn-press-message,
575
+ .learn-press-error {
576
+ list-style: none;
577
+ margin: 0 0 20px 0;
578
+ background-color: #F5F5F5;
579
+ padding: 8px 15px;
580
+ border-left: 5px solid;
581
+ }
582
+ .learn-press-notice {
583
+ border-color: #1e85be;
584
+ }
585
+ .learn-press-message {
586
+ border-color: #8fae1b;
587
+ }
588
+ .learn-press-error {
589
+ border-color: #b81c23;
590
+ }
591
+ .open-hand {
592
+ cursor: url("../../assets/images/openhand.cur") 7 5, default !important;
593
+ }
594
+ a .archive-course:hover {
595
+ cursor: pointer;
596
+ }
597
+ .archive-course {
598
+ border: 1px solid black;
599
+ display: table;
600
+ margin-bottom: 10px;
601
+ width: 100%;
602
+ }
603
+ .course-cover {
604
+ display: table-cell;
605
+ height: 100px;
606
+ width: 100px;
607
+ }
608
+ .course-detail {
609
+ display: table-cell;
610
+ vertical-align: top;
611
+ padding-left: 10px;
612
+ }
613
+ .course-title {
614
+ font-weight: bold;
615
+ }
616
+ .lp-button-dropdown {
617
+ padding-right: 28px !important;
618
+ position: relative;
619
+ z-index: 99998;
620
+ }
621
+ .lp-course-progress {
622
+ margin-right: 50px;
623
+ }
624
+ .lp-course-progress:after {
625
+ display: block;
626
+ content: '';
627
+ clear: both;
628
+ }
629
+ .lp-course-progress .lp-course-progress-heading {
630
+ margin: 0 0 40px 0;
631
+ }
632
+ .lp-course-progress .lp-progress-bar {
633
+ height: 20px;
634
+ background: #F5F5F5;
635
+ position: relative;
636
+ /* margin-right: 80px; */
637
+ float: left;
638
+ width: 100%;
639
+ margin-bottom: 50px;
640
+ -webkit-border-radius: 5px;
641
+ -moz-border-radius: 5px;
642
+ border-radius: 5px;
643
+ }
644
+ .lp-course-progress .lp-progress-value {
645
+ height: 20px;
646
+ background: #DDD;
647
+ position: absolute;
648
+ left: 0;
649
+ -webkit-transition: width 0.25s;
650
+ -moz-transition: width 0.25s;
651
+ -ms-transition: width 0.25s;
652
+ -o-transition: width 0.25s;
653
+ transition: width 0.25s;
654
+ -webkit-border-radius: 5px;
655
+ -moz-border-radius: 5px;
656
+ border-radius: 5px;
657
+ }
658
+ .lp-course-progress .lp-progress-value > span,
659
+ .lp-course-progress .lp-passing-conditional span {
660
+ display: inline-block;
661
+ padding: 5px 10px;
662
+ font-size: small;
663
+ background: #DDD;
664
+ position: absolute;
665
+ right: 0;
666
+ top: -35px;
667
+ line-height: 1;
668
+ white-space: nowrap;
669
+ width: 50px;
670
+ text-align: center;
671
+ margin-right: -25px;
672
+ -webkit-border-radius: 3px;
673
+ -moz-border-radius: 3px;
674
+ border-radius: 3px;
675
+ }
676
+ .lp-course-progress .lp-progress-value > span:after,
677
+ .lp-course-progress .lp-passing-conditional span:after {
678
+ content: '';
679
+ display: block;
680
+ border: 6px solid #DDD;
681
+ position: absolute;
682
+ border-color: transparent;
683
+ border-top-color: #DDD;
684
+ bottom: -12px;
685
+ left: 50%;
686
+ margin-left: -6px;
687
+ }
688
+ .lp-course-progress .lp-passing-conditional span {
689
+ top: 30px;
690
+ margin-left: -25px;
691
+ }
692
+ .lp-course-progress .lp-passing-conditional span:after {
693
+ border-bottom-color: #DDD;
694
+ top: -12px;
695
+ left: 50%;
696
+ border-top-color: transparent;
697
+ bottom: auto;
698
+ }
699
+ .lp-course-progress .lp-progress-value.left > span {
700
+ left: 100%;
701
+ right: auto;
702
+ }
703
+ .lp-course-progress .lp-progress-value.left > span:after {
704
+ bottom: -4px;
705
+ transform: rotate(225deg);
706
+ left: -10px;
707
+ right: auto;
708
+ }
709
+ .lp-course-progress.passed .lp-progress-value {
710
+ background: #83D0FF;
711
+ -webkit-border-radius: 5px;
712
+ -moz-border-radius: 5px;
713
+ border-radius: 5px;
714
+ }
715
+ .lp-course-progress.passed .lp-progress-value > span {
716
+ background: #83D0FF;
717
+ }
718
+ .lp-course-progress.passed .lp-progress-value > span:after {
719
+ border-top-color: #83D0FF;
720
+ }
721
+ .lp-course-progress .lp-progress-total {
722
+ width: 50px;
723
+ float: right;
724
+ margin-right: -50px;
725
+ height: 20px;
726
+ font-size: small;
727
+ text-align: right;
728
+ line-height: 20px;
729
+ }
730
+ .lp-course-progress .lp-passing-conditional {
731
+ position: absolute;
732
+ height: 20px;
733
+ width: 1px;
734
+ background-color: #FF0000;
735
+ }
736
+ .lp-course-progress .lp-passing-conditional.right span {
737
+ right: 0;
738
+ }
739
+ .lp-course-progress .lp-passing-conditional.right span:after {
740
+ left: auto;
741
+ right: -10px;
742
+ border-left-color: transparent;
743
+ border-bottom-color: #DDD;
744
+ }
745
+ .quiz-questions-list .question-title {
746
+ font-weight: normal;
747
+ }
748
+ .question-results .question-title:after {
749
+ content: '';
750
+ display: inline-block;
751
+ font-family: dashicons;
752
+ vertical-align: middle;
753
+ font-size: 20px;
754
+ }
755
+ .question-results.correct .question-title:after {
756
+ content: "\f147";
757
+ }
758
+ .question-results.incorrect .question-title:after {
759
+ content: "\f335";
760
+ }
761
+ .learn-press-question-wrap.checked li.answer-true {
762
+ background: #C4EBFF;
763
+ }
764
+ .learn-press-question-wrap.checked li.user-answer-false {
765
+ color: #FF0000;
766
+ }
767
+ /* jAlerts */
768
+ #popup_container {
769
+ background: #FFF;
770
+ }
771
+ #popup_title {
772
+ padding: 10px 20px;
773
+ background: #18B6C7;
774
+ color: #FFF;
775
+ }
776
+ #popup_content {
777
+ padding: 20px;
778
+ }
779
+ #popup_message {
780
+ margin-bottom: 20px;
781
+ }
782
+ .question-explanation-content,
783
+ .question-hint-content {
784
+ border: 1px solid #DDD;
785
+ padding: 20px;
786
+ background: #DDD;
787
+ margin-bottom: 20px;
788
+ }
789
+ .question-explanation-content:before,
790
+ .question-hint-content:before {
791
+ content: attr(data-title);
792
+ display: block;
793
+ font-weight: bold;
794
+ }
795
+ .button-fade {
796
+ opacity: 0.5;
797
+ }
798
+ .button-fade:hover {
799
+ opacity: 1;
800
+ }
801
+ #learn-press-content-item {
802
+ margin-bottom: 20px;
803
+ background: #ffffff;
804
+ border: 1px solid #DDD;
805
+ padding: 20px;
806
+ display: none;
807
+ }
808
+ #learn-press-content-item .course-lesson-heading {
809
+ margin-top: 0;
810
+ }
811
+ #learn-press-content-item.loading {
812
+ height: 50px;
813
+ overflow: hidden;
814
+ position: relative;
815
+ }
816
+ #learn-press-content-item.loading:before,
817
+ #learn-press-content-item.loading:after {
818
+ position: absolute;
819
+ top: 0;
820
+ left: 0;
821
+ right: 0;
822
+ bottom: 0;
823
+ z-index: 10;
824
+ background: #FFF;
825
+ content: '';
826
+ }
827
+ #learn-press-content-item.loading:after {
828
+ background: url("../images/ajax-loader.gif") center no-repeat;
829
+ }
830
+ .quiz-question-nav-buttons {
831
+ margin: 10px 0;
832
+ }
833
+ @-ms-viewport {
834
+ width: device-width;
835
+ }
836
+ @viewport {
837
+ width: device-width;
838
+ }
839
+ /**
840
+ * Mobile Large 620px
841
+ */
842
+ @media screen and (min-width: 38.75em) {
843
+ .twentyfifteen .learnpress-content {
844
+ margin-right: 7.6923%;
845
+ margin-left: 7.6923%;
846
+ margin-top: 8.3333%;
847
+ }
848
+ }
849
+ @media screen and (max-width: 38.75em) {
850
+ .single-quiz .quiz-sidebar {
851
+ width: 100%;
852
+ }
853
+ .learnpress ul {
854
+ margin-left: 0;
855
+ }
856
+ #learn-press-course-curriculum .section .course-item-meta {
857
+ float: none;
858
+ }
859
+ }
860
+ /**
861
+ * Tablet Small 740px
862
+ */
863
+ /**
864
+ * Tablet Large 880px
865
+ */
866
+ /**
867
+ * Desktop Small 955px
868
+ */
869
+ @media screen and (min-width: 59.6875em) {
870
+ .twentyfifteen .learnpress-content {
871
+ margin-left: 8.3333%;
872
+ margin-right: 8.3333%;
873
+ padding: 10%;
874
+ }
875
+ }
876
+ @media screen and (max-width: 59.6875em) {
877
+ .twentyfifteen .learnpress-content {
878
+ padding: 10%;
879
+ }
880
+ }
881
+ /**
882
+ * Desktop Medium 1100px
883
+ */
884
+ @media screen and (max-width: 68.75em) {
885
+ .single-quiz .quiz-summary-left,
886
+ .single-quiz .quiz-sidebar {
887
+ float: none;
888
+ margin: 0 auto;
889
+ }
890
+ .single-quiz .quiz-summary-left {
891
+ padding-right: 0;
892
+ }
893
+ }
894
+ /**
895
+ * Desktop Large 1240px
896
+ */
897
+ /**
898
+ * Desktop X-Large 1403px
899
+ */
assets/css/learnpress.bak.less ADDED
@@ -0,0 +1,1153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ body.course-has-popup{
3
+ overflow: hidden;
4
+ }
5
+ #course-curriculum-popup {
6
+ position: fixed;
7
+ top: 0;
8
+ left: 0;
9
+ right: 0;
10
+ bottom: 0;
11
+ background: #000;
12
+ z-index: 999999;
13
+ #popup-sidebar {
14
+ float: left;
15
+ width: 350px;
16
+ position: absolute;
17
+ top: 0;
18
+ bottom: 0;
19
+ overflow: auto;
20
+ background: #FFF;
21
+ border-right: 1px solid #DDD;
22
+ .course-curriculum-title{
23
+ display: none;
24
+ }
25
+ .curriculum-sections{
26
+ margin: 0;
27
+ font-size: smaller;
28
+ }
29
+ }
30
+ #popup-main {
31
+ position: absolute;
32
+ top: 0;
33
+ left: 350px;
34
+ right: 0;
35
+ bottom: 0;
36
+ background: #FFF;
37
+ #popup-header {
38
+ position: absolute;
39
+ top: 0;
40
+ left: 0;
41
+ right: 0;
42
+ height: 50px;
43
+ background: #F5F5F5;
44
+ border-bottom: 1px solid #DDD;
45
+ .popup-close{
46
+ width: 50px;
47
+ height: 50px;
48
+ position: absolute;
49
+ right: 0;
50
+ top: 0;
51
+ &:before,
52
+ &:after{
53
+ content: '';
54
+ border-top: 3px solid #636060;
55
+ width: 30px;
56
+ display: inline-block;
57
+ position: absolute;
58
+ }
59
+ &:before{
60
+ -webkit-transform: rotate(45deg);
61
+ top: 25px;
62
+ }
63
+ &:after{
64
+ -webkit-transform: rotate(-45deg);
65
+ top: 25px;
66
+ }
67
+ }
68
+ h3{
69
+ margin: 0;
70
+ height: 50px;
71
+ line-height: 50px;
72
+ padding: 0 20px;
73
+ }
74
+
75
+ }
76
+ #popup-content{
77
+ position: absolute;
78
+ top:50px;
79
+ bottom: 50px;
80
+ left: 0;
81
+ right: 0;
82
+ overflow: auto;
83
+ #popup-content-inner{
84
+ margin: 20px;
85
+ }
86
+ }
87
+ #popup-footer {
88
+ position: absolute;
89
+ bottom: 0;
90
+ left: 0;
91
+ right: 0;
92
+ height: 50px;
93
+ background: #F5F5F5;
94
+ border-top:1px solid #DDD;
95
+ }
96
+ }
97
+ }
98
+ .tp_single_event &{
99
+ color: red;
100
+ &:before {
101
+ content: '';
102
+ position: absolute;
103
+ top: 0;
104
+ left: 0;
105
+ right: 0;
106
+ bottom: 0;
107
+ background: rgba(0, 0, 0, 0.5);
108
+ }
109
+ }
110
+ /*
111
+ .column-lp_course .row-actions,
112
+ .column-lp_quiz .row-actions {
113
+ display: inline-block;
114
+ margin-left: 10px;
115
+ }
116
+
117
+ .column-lp_course .row-actions a,
118
+ .column-lp_quiz .row-actions a {
119
+ color: #999;
120
+ }*/
121
+
122
+ /**/
123
+ /* message box */
124
+ #learn-press-message-box-block {
125
+ position: fixed;
126
+ top: 0;
127
+ left: 0;
128
+ right: 0;
129
+ bottom: 0;
130
+ background-color: #000;
131
+ z-index: 99999;
132
+ opacity: 0.8;
133
+ }
134
+
135
+ #learn-press-message-box-window {
136
+ position: fixed;
137
+ top: 0;
138
+ bottom: 0;
139
+ left: 0;
140
+ right: 0;
141
+ z-index: 100000;
142
+ color: #FFF;
143
+ text-align: center;
144
+ }
145
+
146
+ #message-box-wrap {
147
+ margin: 0 auto;
148
+ /* text-align: center; */
149
+ display: inline-block;
150
+ text-align: left;
151
+ max-width: 70%;
152
+ }
153
+
154
+ .message-box-title {
155
+ color: #FFF;
156
+ margin: 0 0 40px 0;
157
+ font-size: 34px;
158
+ }
159
+
160
+ .message-box-content {
161
+ font-size: 16px;
162
+ line-height: 1.5;
163
+ }
164
+
165
+ .message-box-animation {
166
+ background-image: url("../images/animation.gif");
167
+ width: 220px;
168
+ height: 20px;
169
+ margin: 20px 0 0;
170
+ }
171
+
172
+ .message-box-buttons {
173
+ margin: 20px 0 0;
174
+ border-top: 1px solid #929292;
175
+ padding-top: 20px;
176
+ }
177
+
178
+ .message-box-button {
179
+ margin-right: 10px !important;
180
+ background-color: #FFFFFF;
181
+ color: #999;
182
+ }
183
+
184
+ .message-box-button:hover {
185
+ background-color: #F5F5F5;
186
+ }
187
+
188
+ .lp-label {
189
+ display: inline-block;
190
+ padding: 3px 8px;
191
+ line-height: 1;
192
+ font-size: 65%;
193
+ vertical-align: baseline;
194
+ color: #FFF;
195
+ border-radius: 4px;
196
+ }
197
+
198
+ .lp-label-quiz {
199
+ background-color: #53658C;
200
+ }
201
+
202
+ .lp-label-preview {
203
+ background-color: #5cb85c;
204
+ }
205
+
206
+ .lp-label-viewing {
207
+ background-color: #39afff;
208
+ }
209
+
210
+ .lp-label-lesson {
211
+ background-color: #337ab7;
212
+ }
213
+
214
+ .lp-label-final {
215
+ background-color: #FF6161;
216
+ }
217
+
218
+ .lp-label-completed {
219
+ background-color: #39C7CE;
220
+ }
221
+
222
+ .lp-label-format {
223
+ background-color: #ccc416;
224
+ }
225
+
226
+ .lp-label-format-aside {
227
+ background-color: #ccc416;
228
+ }
229
+
230
+ .lp-label-format-image {
231
+ background-color: #ccc416;
232
+ }
233
+
234
+ .lp-label-format-video {
235
+ background-color: #ccc416;
236
+ }
237
+
238
+ .lp-label-format-quote {
239
+ background-color: #ccc416;
240
+ }
241
+
242
+ .lp-label-format-link {
243
+ background-color: #ccc416;
244
+ }
245
+
246
+ .lp-label-format-gallery {
247
+ background-color: #ccc416;
248
+ }
249
+
250
+ .lp-label-format-status {
251
+ background-color: #ccc416;
252
+ }
253
+
254
+ .lp-label-format-audio {
255
+ background-color: #ccc416;
256
+ }
257
+
258
+ .lp-label-format-chat {
259
+ background-color: #ccc416;
260
+ }
261
+
262
+ .course-item .lp-label-completed,
263
+ .course-item .lp-label-viewing {
264
+ display: none;
265
+ }
266
+
267
+ .course-item.item-completed .lp-label-completed,
268
+ .course-item.item-current .lp-label-viewing {
269
+ display: inline-block;
270
+ }
271
+
272
+ .course-meta > * {
273
+ display: inline-block;
274
+ font-style: italic;
275
+ font-size: smaller;
276
+ }
277
+
278
+ .course-meta > *:after {
279
+ content: ' | ';
280
+ font-style: italic;
281
+ }
282
+
283
+ .course-meta > *:last-child:after {
284
+ display: none;
285
+ }
286
+
287
+ /**/
288
+ .learnpress {
289
+
290
+ }
291
+
292
+ .learnpress ul,
293
+ .learnpress li {
294
+ list-style: none;
295
+ }
296
+
297
+ .learnpress h3 {
298
+ font-size: 2.7rem;
299
+ line-height: 1.1852;
300
+ margin-top: 2.3704em;
301
+ margin-bottom: 1.1852em;
302
+ }
303
+
304
+ .learnpress .learnpress-content {
305
+ z-index: 100;
306
+ position: relative;
307
+ }
308
+
309
+ .learnpress .twentyfifteen .learnpress-content {
310
+ padding-left: 7.6923%;
311
+ padding-right: 7.6923%;
312
+ padding-top: 7.6923%;
313
+ margin-bottom: 7.6923%;
314
+ background: #fff;
315
+ box-shadow: 0 0 1px rgba(0, 0, 0, .15);
316
+ }
317
+
318
+ .learn-press-checkout-payment {
319
+
320
+ }
321
+
322
+ .payment-method-form {
323
+ display: none;
324
+ }
325
+
326
+ .learn-press-user-form {
327
+ float: left;
328
+ width: 50%;
329
+ box-sizing: border-box;
330
+ padding: 0 10px;
331
+ }
332
+
333
+ .learn-press-user-form .form-heading {
334
+ }
335
+
336
+ .learn-press-user-form .form-subheading {
337
+
338
+ }
339
+
340
+ .learn-press-user-form .form-content {
341
+
342
+ }
343
+
344
+ .learn-press-user-form .form-fields {
345
+
346
+ }
347
+
348
+ #learn-press-checkout-user-form {
349
+ margin: 0 -10px;
350
+ }
351
+
352
+ /* archive */
353
+ .learnpress .twentyfifteen .page-title {
354
+ margin: 0 0 30px 0;
355
+ }
356
+
357
+ .course-introduce {
358
+ margin: 20px 0 0 0;
359
+ }
360
+
361
+ .course-introduce .more-link {
362
+
363
+ }
364
+
365
+ .course-title,
366
+ .course-title h3 {
367
+ font-size: 18px;
368
+ }
369
+
370
+ .archive .lp_course {
371
+ }
372
+
373
+ /* pagination */
374
+ .learn-press-pagination {
375
+ text-align: center;
376
+ }
377
+
378
+ .learn-press-pagination ul > li {
379
+ display: inline-block;
380
+ }
381
+
382
+ .learn-press-pagination ul > li a,
383
+ .learn-press-pagination ul > li span {
384
+ display: inline-block;
385
+ padding: 0 10px;
386
+ border: 1px solid #DDD;
387
+ background-color: #F5F5F5;
388
+ }
389
+
390
+ .learn-press-pagination ul > li a {
391
+ background-color: #FFF;
392
+ }
393
+
394
+ .learn-press-breadcrumb {
395
+ margin: 0 0 20px 0;
396
+ }
397
+
398
+ /* course lesson nav */
399
+ .course-item-nav {
400
+ border-top: 1px dashed #DDD;
401
+ overflow: hidden;
402
+ margin: 20px 0;
403
+ padding-top: 10px;
404
+ }
405
+
406
+ .course-item-nav .course-item-prev > *,
407
+ .course-item-nav .course-item-next > * {
408
+ display: block;
409
+ }
410
+
411
+ .course-item-nav > div > span {
412
+ font-size: 70%;
413
+ text-transform: uppercase;
414
+ font-weight: bold;
415
+ }
416
+
417
+ .course-item-nav .course-item-prev {
418
+ float: left;
419
+ text-align: left;
420
+ }
421
+
422
+ .course-item-nav .course-item-next {
423
+ float: right;
424
+ text-align: right;
425
+ }
426
+
427
+ /* curriculum */
428
+ .section-header {
429
+ margin: 0 0 0 0;
430
+ padding: 10px 15px;
431
+ background-color: #EEE;
432
+ }
433
+
434
+ .section-header p {
435
+ display: inline-block;
436
+ font-weight: normal;
437
+ font-style: italic;
438
+ color: #999;
439
+ font-size: smaller;
440
+ margin: 0;
441
+ }
442
+
443
+ #learn-press-course-curriculum .section {
444
+ margin: 0 0 1px 0;
445
+ list-style: none;
446
+ }
447
+
448
+ #learn-press-course-curriculum .section-content {
449
+ margin: 0;
450
+ background-color: #F5F5F5;
451
+ }
452
+
453
+ #learn-press-course-curriculum .section .course-item {
454
+ margin: 0 0 0;
455
+ list-style: none;
456
+ padding: 10px 15px;
457
+ border-top: 1px solid #FFF;
458
+ }
459
+
460
+ #learn-press-course-curriculum .section .course-item-meta {
461
+ display: block;
462
+ float: right;
463
+ line-height: 1;
464
+ margin: 3px 0;
465
+ }
466
+
467
+ #learn-press-course-curriculum .section .course-item.section-empty {
468
+ background-color: #F5F5F5;
469
+ }
470
+
471
+ #learn-press-course-curriculum .section .course-item.section-empty .learn-press-message {
472
+ margin: 0;
473
+ }
474
+
475
+ /* QUIZ */
476
+ .single-quiz {
477
+
478
+ }
479
+
480
+ .single-quiz .quiz-summary-left {
481
+ float: left;
482
+ width: 100%;
483
+ padding-right: 320px;
484
+ }
485
+
486
+ .single-quiz .quiz-sidebar {
487
+ float: right;
488
+ width: 300px;
489
+ margin-left: -300px;
490
+ border: 2px solid #DDD;
491
+ padding: 20px;
492
+ }
493
+
494
+ .single-quiz.quiz-completed .quiz-questions-list .learn-press-question-title {
495
+ display: none;
496
+ }
497
+
498
+ .quiz-questions-list .current {
499
+ font-weight: bold;
500
+ }
501
+
502
+ .quiz-questions-list .current a:after {
503
+ display: inline-block;
504
+ background-color: #0066cc;
505
+ /* padding: 0px 8px; */
506
+ color: #FFF;
507
+ font-size: 70%;
508
+ border-radius: 50%;
509
+ content: '?';
510
+ /* margin-left: 10px; */
511
+ width: 20px;
512
+ height: 20px;
513
+ line-height: 20px;
514
+ text-align: center;
515
+ vertical-align: middle;
516
+ }
517
+
518
+ .quiz-countdown {
519
+ text-align: center;
520
+ }
521
+
522
+ .quiz-countdown #quiz-countdown-value {
523
+ font-size: 40px;
524
+ line-height: 1;
525
+ }
526
+
527
+ .quiz-countdown .quiz-countdown-label {
528
+ font-size: smaller;
529
+ font-style: italic;
530
+ color: #999;
531
+ }
532
+
533
+ .quiz-buttons {
534
+ text-align: center;
535
+ }
536
+
537
+ .quiz-result {
538
+ width: 100%;
539
+ }
540
+
541
+ .quiz-result .quiz-result-mark {
542
+ float: left;
543
+ width: 150px;
544
+ height: 150px;
545
+ background-color: #F5F5F5;
546
+ border-radius: 50%;
547
+ text-align: center;
548
+ box-sizing: border-box;
549
+ padding-top: 30px;
550
+ line-height: 1;
551
+
552
+ }
553
+
554
+ .quiz-result .quiz-result-mark .quiz-mark {
555
+ font-size: 60px;
556
+ display: block;
557
+ }
558
+
559
+ .quiz-result .quiz-result-mark .quiz-mark small {
560
+ font-size: 20px;
561
+ }
562
+
563
+ .quiz-result .quiz-result-summary {
564
+ float: left;
565
+ margin-left: 30px;
566
+ }
567
+
568
+ .quiz-result .quiz-result-summary .quiz-result-field {
569
+ margin: 0;
570
+ font-size: 14px;
571
+ }
572
+
573
+ .quiz-result .quiz-result-summary .quiz-result-field > label {
574
+ width: 100px;
575
+ display: inline-block;
576
+ }
577
+
578
+ .quiz-result .quiz-result-summary .quiz-result-field.correct {
579
+ color: #0066cc;
580
+ }
581
+
582
+ .quiz-result .quiz-result-summary .quiz-result-field.wrong {
583
+ color: #BC0B0B;
584
+ }
585
+
586
+ .quiz-result .quiz-result-summary .quiz-result-field.empty {
587
+ color: #869791;
588
+ }
589
+
590
+ .quiz-history {
591
+ font-size: 80%;
592
+ }
593
+
594
+ .quiz-history td {
595
+ padding: 10px;
596
+ }
597
+
598
+ .quiz-history-actions {
599
+ margin: 0;
600
+ }
601
+
602
+ /* profile */
603
+ #learn-press-user-profile {
604
+ overflow: hidden;
605
+ }
606
+
607
+ .learn-press-user-profile .user-info {
608
+ margin: 0 0 20px;
609
+ }
610
+
611
+ .learn-press-user-profile .user-basic-info {
612
+
613
+ }
614
+
615
+ .learn-press-user-profile .learn-press-tabs {
616
+ list-style: none;
617
+ margin: 0 0 20px;
618
+ padding-left: 5px;
619
+ border-bottom: 1px solid #DDD;
620
+ }
621
+
622
+ .learn-press-user-profile .learn-press-tabs > li {
623
+ float: left;
624
+ }
625
+
626
+ .learn-press-user-profile .learn-press-tabs > li > a {
627
+ box-shadow: none;
628
+ outline: none;
629
+ display: block;
630
+ border: none;
631
+ padding: 5px 10px;
632
+ }
633
+
634
+ .learn-press-user-profile .learn-press-tabs > li.current a {
635
+ background-color: #FFF;
636
+ border: 1px solid #DDD;
637
+ border-bottom-color: transparent;
638
+ z-index: 10;
639
+ margin-bottom: -1px;
640
+ }
641
+
642
+ .learn-press-tabs-wrapper {
643
+ margin: 0 0 20px;
644
+ }
645
+
646
+ .learn-press-user-profile .learn-press-tabs-wrapper > .learn-press-tab {
647
+ /*padding: 0;
648
+ float: left;
649
+ width: 100%;
650
+ margin-right: -100%;
651
+ visibility: hidden;*/
652
+ }
653
+
654
+ .learn-press-user-profile .entry-tab-inner {
655
+ }
656
+
657
+ .learn-press-user-profile .learn-press-tabs-wrapper {
658
+ /*float: left;
659
+ width: 100%;
660
+ padding-left: 170px;*/
661
+ }
662
+
663
+ .learn-press-user-profile .profile-content-left {
664
+ float: left;
665
+ margin-left: -100%;
666
+ margin-bottom: -100000px;
667
+ padding-bottom: 100000px;
668
+ background-color: #F5F5F5;
669
+ }
670
+
671
+ .profile-courses {
672
+ list-style: none;
673
+ }
674
+
675
+ .profile-courses > li {
676
+
677
+ }
678
+
679
+ .profile-courses > li > a {
680
+ }
681
+
682
+ .profile-courses-heading {
683
+ margin: 0 0 10px !important;
684
+ }
685
+
686
+ .learn-press-subtabs {
687
+ }
688
+
689
+ .learn-press-subtabs > li {
690
+ display: inline-block;
691
+ margin-right: 10px;
692
+ }
693
+
694
+ .learn-press-subtabs > li.current {
695
+ font-weight: bold;
696
+ }
697
+
698
+ .learn-press-subtab-content {
699
+ display: none;
700
+ }
701
+
702
+ .learn-press-subtab-content.current {
703
+ display: block;
704
+ }
705
+
706
+ .hide-if-js {
707
+ display: none;
708
+ }
709
+
710
+ /**/
711
+ .purchase-course .view-cart-button {
712
+
713
+ }
714
+
715
+ .learn-press-cart-table td,
716
+ .learn-press-cart-table th {
717
+ vertical-align: top;
718
+ }
719
+
720
+ .learn-press-cart-table .course-remove {
721
+ width: 40px;
722
+ }
723
+
724
+ .learn-press-cart-table .course-thumbnail {
725
+ width: 20%;
726
+ }
727
+
728
+ .learn-press-cart-table .course-price,
729
+ .learn-press-cart-table .course-total {
730
+ width: 15%;
731
+ }
732
+
733
+ /* notices */
734
+ .learn-press-notice,
735
+ .learn-press-message,
736
+ .learn-press-error {
737
+ list-style: none;
738
+ margin: 0 0 20px 0;
739
+ background-color: #F5F5F5;
740
+ padding: 8px 15px;
741
+ border-left: 5px solid;
742
+ }
743
+
744
+ .learn-press-notice {
745
+ border-color: #1e85be;
746
+ }
747
+
748
+ .learn-press-message {
749
+ border-color: #8fae1b;
750
+ }
751
+
752
+ .learn-press-error {
753
+ border-color: #b81c23;
754
+ }
755
+
756
+ .open-hand {
757
+ cursor: url("../../assets/images/openhand.cur") 7 5, default !important;
758
+ }
759
+
760
+ a .archive-course:hover {
761
+ cursor: pointer;
762
+ }
763
+
764
+ .archive-course {
765
+ border: 1px solid black;
766
+ display: table;
767
+ margin-bottom: 10px;
768
+ width: 100%;
769
+ }
770
+
771
+ .course-cover {
772
+ display: table-cell;
773
+ height: 100px;
774
+ width: 100px;
775
+ }
776
+
777
+ .course-detail {
778
+ display: table-cell;
779
+ vertical-align: top;
780
+ padding-left: 10px;
781
+ }
782
+
783
+ .course-title {
784
+ font-weight: bold;
785
+ }
786
+
787
+ .lp-button-dropdown {
788
+ padding-right: 28px !important;
789
+ position: relative;
790
+ z-index: 99998;
791
+ }
792
+
793
+ .lp-course-progress {
794
+ margin-right: 50px;
795
+ }
796
+
797
+ .lp-course-progress:after {
798
+ display: block;
799
+ content: '';
800
+ clear: both;
801
+ }
802
+
803
+ .lp-course-progress .lp-course-progress-heading {
804
+ margin: 0 0 40px 0;
805
+ }
806
+
807
+ .lp-course-progress .lp-progress-bar {
808
+ height: 20px;
809
+ background: #F5F5F5;
810
+ position: relative;
811
+ /* margin-right: 80px; */
812
+ float: left;
813
+ width: 100%;
814
+ margin-bottom: 50px;
815
+ -webkit-border-radius: 5px;
816
+ -moz-border-radius: 5px;
817
+ border-radius: 5px;
818
+ }
819
+
820
+ .lp-course-progress .lp-progress-value {
821
+ height: 20px;
822
+ background: #DDD;
823
+ position: absolute;
824
+ left: 0;
825
+ -webkit-transition: width 0.25s;
826
+ -moz-transition: width 0.25s;
827
+ -ms-transition: width 0.25s;
828
+ -o-transition: width 0.25s;
829
+ transition: width 0.25s;
830
+ -webkit-border-radius: 5px;
831
+ -moz-border-radius: 5px;
832
+ border-radius: 5px;;
833
+ }
834
+
835
+ .lp-course-progress .lp-progress-value > span,
836
+ .lp-course-progress .lp-passing-conditional span {
837
+ display: inline-block;
838
+ padding: 5px 10px;
839
+ font-size: small;
840
+ background: #DDD;
841
+ position: absolute;
842
+ right: 0;
843
+ top: -35px;
844
+ line-height: 1;
845
+ white-space: nowrap;
846
+ width: 50px;
847
+ text-align: center;
848
+ margin-right: -25px;
849
+ -webkit-border-radius: 3px;
850
+ -moz-border-radius: 3px;
851
+ border-radius: 3px;
852
+ }
853
+
854
+ .lp-course-progress .lp-progress-value > span:after,
855
+ .lp-course-progress .lp-passing-conditional span:after {
856
+ content: '';
857
+ display: block;
858
+ border: 6px solid #DDD;
859
+ position: absolute;
860
+ border-color: transparent;
861
+ border-top-color: #DDD;
862
+ bottom: -12px;
863
+ left: 50%;
864
+ margin-left: -6px;
865
+ }
866
+
867
+ .lp-course-progress .lp-passing-conditional span {
868
+ top: 30px;
869
+ margin-left: -25px;
870
+ }
871
+
872
+ .lp-course-progress .lp-passing-conditional span:after {
873
+ border-bottom-color: #DDD;
874
+ top: -12px;
875
+ left: 50%;
876
+ border-top-color: transparent;
877
+ bottom: auto;
878
+ }
879
+
880
+ .lp-course-progress .lp-progress-value.left > span {
881
+ left: 100%;
882
+ right: auto;
883
+ }
884
+
885
+ .lp-course-progress .lp-progress-value.left > span:after {
886
+ bottom: -4px;
887
+ transform: rotate(225deg);
888
+ left: -10px;
889
+ right: auto;
890
+ }
891
+
892
+ .lp-course-progress.passed .lp-progress-value {
893
+ background: #83D0FF;
894
+ -webkit-border-radius: 5px;
895
+ -moz-border-radius: 5px;
896
+ border-radius: 5px;
897
+ }
898
+
899
+ .lp-course-progress.passed .lp-progress-value > span {
900
+ background: #83D0FF;
901
+ }
902
+
903
+ .lp-course-progress.passed .lp-progress-value > span:after {
904
+ border-top-color: #83D0FF;
905
+ }
906
+
907
+ .lp-course-progress .lp-progress-total {
908
+ width: 50px;
909
+ float: right;
910
+ margin-right: -50px;
911
+ height: 20px;
912
+ font-size: small;
913
+ text-align: right;
914
+ line-height: 20px;
915
+ }
916
+
917
+ .lp-course-progress .lp-passing-conditional {
918
+ position: absolute;
919
+ height: 20px;
920
+ width: 1px;
921
+ background-color: #FF0000;
922
+ }
923
+
924
+ .lp-course-progress .lp-passing-conditional.right span {
925
+ right: 0;
926
+ }
927
+
928
+ .lp-course-progress .lp-passing-conditional.right span:after {
929
+ left: auto;
930
+ right: -10px;
931
+ border-left-color: transparent;
932
+ border-bottom-color: #DDD;
933
+ }
934
+
935
+ .quiz-questions-list .question-title {
936
+ font-weight: normal;
937
+ }
938
+
939
+ .question-results .question-title:after {
940
+ content: '';
941
+ display: inline-block;
942
+ font-family: dashicons;
943
+ vertical-align: middle;
944
+ font-size: 20px;
945
+ }
946
+
947
+ .question-results.correct .question-title:after {
948
+ content: "\f147";
949
+ }
950
+
951
+ .question-results.incorrect .question-title:after {
952
+ content: "\f335";
953
+ }
954
+
955
+ .question-results.skipped {
956
+ }
957
+
958
+ .complete-lesson-button.completed {
959
+
960
+ }
961
+
962
+ .learn-press-question-wrap {
963
+
964
+ }
965
+
966
+ .learn-press-question-wrap.checked li.answer-true {
967
+ background: #C4EBFF;
968
+ }
969
+
970
+ .learn-press-question-wrap.checked li.user-answer-false {
971
+ color: #FF0000;
972
+ }
973
+
974
+ /* jAlerts */
975
+ #popup_container {
976
+ background: #FFF;
977
+ }
978
+
979
+ #popup_title {
980
+ padding: 10px 20px;
981
+ background: #18B6C7;
982
+ color: #FFF;
983
+ }
984
+
985
+ #popup_content {
986
+ padding: 20px;
987
+ }
988
+
989
+ #popup_message {
990
+ margin-bottom: 20px;
991
+ }
992
+
993
+ .question-explanation-content,
994
+ .question-hint-content {
995
+ border: 1px solid #DDD;
996
+ padding: 20px;
997
+ background: #DDD;
998
+ margin-bottom: 20px;
999
+ }
1000
+
1001
+ .question-explanation-content:before,
1002
+ .question-hint-content:before {
1003
+ content: attr(data-title);
1004
+ display: block;
1005
+ font-weight: bold;
1006
+ }
1007
+
1008
+ .button-fade {
1009
+ opacity: 0.5;
1010
+ }
1011
+
1012
+ .button-fade:hover {
1013
+ opacity: 1;
1014
+ }
1015
+
1016
+ #learn-press-content-item {
1017
+ margin-bottom: 20px;
1018
+ background: #ffffff;
1019
+ border: 1px solid #DDD;
1020
+ padding: 20px;
1021
+ display: none;
1022
+ }
1023
+
1024
+ #learn-press-content-item .course-lesson-heading {
1025
+ margin-top: 0;
1026
+ }
1027
+
1028
+ #learn-press-content-item.loading {
1029
+ height: 50px;
1030
+ overflow: hidden;
1031
+ position: relative;
1032
+ }
1033
+
1034
+ #learn-press-content-item.loading:before,
1035
+ #learn-press-content-item.loading:after {
1036
+ position: absolute;
1037
+ top: 0;
1038
+ left: 0;
1039
+ right: 0;
1040
+ bottom: 0;
1041
+ z-index: 10;
1042
+ background: #FFF;
1043
+ content: '';
1044
+ }
1045
+
1046
+ #learn-press-content-item.loading:after {
1047
+ background: url("../images/ajax-loader.gif") center no-repeat;
1048
+ }
1049
+
1050
+ #learn-press-course-lesson {
1051
+ }
1052
+
1053
+ .quiz-question-nav-buttons {
1054
+ margin: 10px 0;
1055
+ }
1056
+
1057
+ @-ms-viewport {
1058
+ width: device-width;
1059
+ }
1060
+
1061
+ @viewport {
1062
+ width: device-width;
1063
+ }
1064
+
1065
+ /**
1066
+ * Mobile Large 620px
1067
+ */
1068
+ @media screen and (min-width: 38.75em) {
1069
+ .twentyfifteen .learnpress-content {
1070
+ margin-right: 7.6923%;
1071
+ margin-left: 7.6923%;
1072
+ margin-top: 8.3333%;
1073
+ }
1074
+ }
1075
+
1076
+ @media screen and (max-width: 38.75em) {
1077
+ .single-quiz .quiz-sidebar {
1078
+ width: 100%;
1079
+ }
1080
+
1081
+ .learnpress ul {
1082
+ margin-left: 0;
1083
+ }
1084
+
1085
+ #learn-press-course-curriculum .section .course-item-meta {
1086
+ float: none;
1087
+ }
1088
+ }
1089
+
1090
+ /**
1091
+ * Tablet Small 740px
1092
+ */
1093
+
1094
+ @media screen and (min-width: 46.25em) {
1095
+
1096
+ }
1097
+
1098
+ /**
1099
+ * Tablet Large 880px
1100
+ */
1101
+
1102
+ @media screen and (min-width: 55em) {
1103
+ }
1104
+
1105
+ /**
1106
+ * Desktop Small 955px
1107
+ */
1108
+
1109
+ @media screen and (min-width: 59.6875em) {
1110
+ .twentyfifteen .learnpress-content {
1111
+ margin-left: 8.3333%;
1112
+ margin-right: 8.3333%;
1113
+ padding: 10%;
1114
+ }
1115
+ }
1116
+
1117
+ @media screen and (max-width: 59.6875em) {
1118
+
1119
+ .twentyfifteen .learnpress-content {
1120
+ padding: 10%;
1121
+ }
1122
+ }
1123
+
1124
+ /**
1125
+ * Desktop Medium 1100px
1126
+ */
1127
+
1128
+ @media screen and (max-width: 68.75em) {
1129
+ .single-quiz .quiz-summary-left,
1130
+ .single-quiz .quiz-sidebar {
1131
+ float: none;
1132
+ margin: 0 auto;
1133
+ }
1134
+
1135
+ .single-quiz .quiz-summary-left {
1136
+ padding-right: 0;
1137
+ }
1138
+ }
1139
+
1140
+ /**
1141
+ * Desktop Large 1240px
1142
+ */
1143
+
1144
+ @media screen and (min-width: 77.5em) {
1145
+ }
1146
+
1147
+ /**
1148
+ * Desktop X-Large 1403px
1149
+ */
1150
+
1151
+ @media screen and (min-width: 87.6875em) {
1152
+
1153
+ }
assets/css/learnpress.css CHANGED
@@ -4,241 +4,432 @@
4
  clear: both;
5
  }
6
 
7
- #course-header {
 
 
 
 
8
 
 
 
 
9
  }
10
 
11
- #course-header:after {
12
- display: block;
13
- content: '';
14
- clear: both;
 
 
 
 
 
 
 
15
  }
16
- #course-main:after {
17
- content: '';
18
- display: block;
19
- clear: both;
 
 
 
 
 
 
20
  }
21
- #course-desc {
22
- width: 100%;
 
 
 
 
 
23
  }
24
- .course-info {
25
- width: 75%;
26
- float: left;
 
 
27
  }
28
 
29
- .course-getting, .course-related {
30
- width: 25%;
31
- float: right;
32
  }
33
 
34
- .learn-press ul {
35
- list-style: none;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  }
37
 
38
- /* Course */
39
- .course-curriculum {
 
 
 
 
 
 
 
40
 
 
 
41
  }
42
 
43
- .course-curriculum .curriculum-sections {
 
 
44
 
 
 
45
  }
46
 
47
- .curriculum-sections .section {
48
- overflow: hidden;
49
  }
50
 
51
- .curriculum-sections .section .section-header {
52
- margin: 0 0 20px 0;
53
  }
54
 
55
- .curriculum-sections .section .section-header a {
56
- outline: none;
57
- font-size: 12px;
58
- float: right;
59
  }
60
 
61
- .curriculum-sections .section-content {
 
 
62
 
 
 
63
  }
64
 
65
- .curriculum-sections .section-content .course-lesson,
66
- .curriculum-sections .section-content .course-quiz {
67
- margin: 0 0 10px 0;
68
  }
69
 
70
- .curriculum-sections .section-content .lesson-quiz-icon {
71
- margin-right: 5px;
72
  }
73
 
74
- .curriculum-sections .section-content .course-lesson .lesson-quiz-icon:before,
75
- .curriculum-sections .section-content .course-quiz .lesson-quiz-icon:before {
76
- display: inline-block;
77
- width: 25px;
78
- height: 25px;
79
- border-radius: 50%;
80
- text-align: center;
81
- line-height: 25px;
82
- font-size: 12px;
83
- color: #FFF;
84
- background-color: #999;
85
- vertical-align: middle;
86
  }
87
 
88
- .curriculum-sections .section-content .course-lesson .lesson-quiz-icon.lesson:before {
89
- content: 'L';
90
  }
91
 
92
- .curriculum-sections .section-content .course-lesson.current .lesson-quiz-icon:before {
93
- content: "\f115";
94
- content: "\f177";
95
- font-family: dashicons;
96
- background-color: transparent;
97
- color: #90DFFF;
98
- font-size: 24px;
99
  }
100
 
101
- .curriculum-sections .section-content .course-quiz .lesson-quiz-icon.quiz:before {
102
- content: 'Q';
103
  }
104
 
105
- .curriculum-sections .section-content .course-lesson.completed a,
106
- .curriculum-sections .section-content .course-quiz.completed a {
107
- text-decoration: line-through;
108
- border-bottom: none;
109
  }
110
 
111
- .curriculum-sections .section-content .course-lesson.loading .lesson-quiz-icon:before {
112
- content: '';
113
- background-image: url(../images/ajaxload.gif);
114
- background-position: center;
115
- background-repeat: no-repeat;
116
  }
117
 
118
- .course-content-lesson-nav,
119
- .course-content-lesson-nav-text {
120
- overflow: hidden;
121
  }
122
 
123
- .course-content-lesson-nav-text {
124
- margin-top: 20px;
125
- margin-bottom: 0;
126
- text-transform: uppercase;
127
- font-size: 12px;
128
- font-weight: bold;
129
- border-top: 1px dashed #e0e0e0;
130
- padding-top: 20px;
131
  }
132
 
133
- .course-content-lesson-nav a {
 
 
 
134
  }
135
 
136
- .course-content-lesson-nav a.next-lesson,
137
- .course-content-lesson-nav-text .next-lesson-text {
138
- float: right;
139
  }
140
 
141
- #lesson-quiz-tooltip-container {
142
  display: none;
143
- visibility: hidden;
144
  }
 
 
145
 
146
- .lesson-quiz-tooltip {
147
- font-size: 14px;
148
  }
149
 
150
- /* Single Quiz Pagge*/
151
- .twentyfifteen .single-quiz {
152
- padding-left: 10%;
153
- padding-right: 10%;
154
- padding-bottom: 10%;
155
  }
156
 
157
- .quiz-question-nav-buttons button {
158
- _display: none;
 
 
 
159
  }
160
 
161
- .single-quiz .no-question {
162
- font-size: 14px;
163
- border: 1px solid #FFB6B6;
164
- padding: 10px;
165
- color: #FF7979;
166
  }
167
 
168
- .quiz-started .quiz-content, .quiz-completed .quiz-content {
 
 
 
 
 
 
 
 
 
 
 
 
 
169
  display: none;
170
  }
171
 
172
- .quiz-question-nav {
173
- margin-right: -250px;
174
  float: left;
175
- width: 100%;
 
 
176
  }
177
 
178
- .quiz-question-nav .lp-question-wrap {
179
- margin-right: 200px;
180
  }
181
 
182
- .quiz-sidebar {
183
- width: 230px;
184
- float: right;
185
  }
186
 
187
- #quiz-countdown {
188
- font-size: 48px;
189
- text-align: center;
 
 
 
 
 
 
 
190
  }
191
 
192
- .quiz-countdown-text {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
193
  text-align: center;
194
- margin: 10px;
195
- line-height: 1.5;
196
  }
197
 
198
- .quiz-countdown-text span {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
  display: block;
200
  }
201
 
202
- .quiz-buttons {
203
- text-align: center;
 
 
204
  }
205
 
206
- .quiz-questions > ul {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
207
  list-style: none;
208
- margin: 20px 0;
209
  }
210
 
211
- .quiz-questions > ul li {
 
 
 
 
 
 
212
  list-style: none;
213
- margin: 0 0 15px 0;
214
- font-size: 14px;
 
 
 
 
 
215
  line-height: 1;
 
 
 
 
 
 
 
 
 
216
  }
217
 
218
- .quiz-questions > ul > li > h4 {
219
- font-weight: normal;
 
220
  }
221
 
222
- .quiz-questions > ul li.current > h4 {
223
- font-weight: bold;
 
 
224
  }
225
 
226
- .quiz-sidebar, .quiz-question-nav {
227
- margin-top: 20px;
 
 
 
 
228
  }
229
 
230
- .button-finish-quiz {
231
  display: none;
232
  }
233
 
234
- .quiz-started .button-finish-quiz {
235
- display: inline;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
236
  }
237
 
238
  .quiz-result {
239
- margin-top: 20px;
240
- float: left;
241
- margin-right: -300px;
242
  width: 100%;
243
  }
244
 
@@ -291,224 +482,835 @@
291
  color: #869791;
292
  }
293
 
294
- #learn_press_payment_form {
295
- display: none;
296
  }
297
 
298
- #learn_press_payment_form .learn_press_payment_form {
299
- display: none;
300
  }
301
 
302
- #quiz-accordion > div {
303
- height: auto !important;
304
  }
305
 
306
- @media screen and (max-width: 480px) {
307
- .quiz-question-nav {
308
- margin-right: 0px;
309
- float: none;
310
- }
311
-
312
- .quiz-sidebar {
313
- width: 100%;
314
- float: none;
315
- }
316
  }
317
 
318
- .lpr-question-hint {
319
- margin-top: 10px;
320
- line-height: 1.5;
321
  }
322
 
323
- .lpr-question-hint .correct {
324
- background: #CFE6FD;
325
- }
326
 
327
- .lpr-question-hint .wrong {
328
- background: #FCCED3;
329
  }
330
 
331
- .learn-press .message {
332
- border: 1px solid #90DFFF;
333
- background-color: #DFF6FF;
334
- padding: 10px;
335
- font-size: 12px;
336
- margin: 20px 0;
337
- border-radius: 5px;
338
  }
339
 
340
- .learn-press .message.error {
341
- border-color: #FF9090;
342
- background-color: #FFDFDF;
343
  }
344
 
345
- /* jAlert */
346
- #popup_container {
347
- border: 1px solid rgb(221, 221, 221);
348
- background-color: rgb(255, 255, 255);
349
- min-width: 350px;
 
350
  }
351
 
352
- #popup_container #popup_title,
353
- #popup_container #popup_content {
354
- margin: 20px;
 
 
 
355
  }
356
 
357
- #popup_container #popup_message {
358
- margin-bottom: 20px;
359
  }
360
 
361
- .lpr_course.has-post-thumbnail {
362
- padding-top: 8.3333% !important;
 
 
 
 
363
  }
364
 
365
- #course_taken .course,
366
- #course_made .course{
367
- list-style: none;
368
  }
369
- #course_taken .course > li,
370
- #course_made .course > li{
371
- margin: 0 0 20px 0;
 
 
372
  }
373
- #course_taken .course-status{
374
- font-size: 12px;
375
- display: inline-block;
376
- border-radius: 3px;
377
- padding: 0 5px;
378
- margin: 0 10px;
 
379
  }
380
- #course_taken .course-status.passed{
381
- background-color: #90DFFF;
382
- color: #FFF;
383
  }
384
- #user_quizzes:after {
385
- content: "";
386
- display: block;
387
- clear: both;
388
  }
389
- .videoWrapper {
390
- position: relative;
391
- padding-bottom: 56.25%; /* 16:9 */
392
- padding-top: 25px;
393
- height: 0;
394
- margin-bottom: 25px;
395
  }
396
- .videoWrapper iframe {
397
- position: absolute;
398
- top: 0;
399
- left: 0;
400
- width: 100%;
401
- height: 100%;
402
  }
403
 
404
- .question-hint-title {
405
-
406
  }
407
 
408
- .question-hint-title:hover {
409
- cursor: pointer;
 
410
  }
411
- .block-ui:before,
412
- .block-ui:after{
413
- position: absolute;
414
- top: 0;
415
- left: 0;
416
- right: 0;
417
- bottom: 0;
418
- content: '';
419
  }
420
- .block-ui:before{
421
- background-color: #E4E4E4;
422
- opacity: 0.3;
423
  }
424
- .block-ui:after{
425
- background-image: url(../images/ajax-loader.gif);
426
- background-position: center;
427
- background-repeat: no-repeat;
428
  }
429
 
430
- .lpr_quiz {
431
- visibility: hidden;
432
  }
433
 
434
- .ui-helper-clearfix:before,
435
- .ui-helper-clearfix:after {
436
- content: "";
437
- display: table;
438
- border-collapse: collapse;
439
  }
440
- .ui-helper-clearfix:after {
441
- clear: both;
 
 
442
  }
443
- .ui-helper-clearfix {
444
- min-height: 0; /* support: IE7 */
 
445
  }
446
 
447
- .ui-tabs {
448
- position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
449
- padding: .2em;
450
  }
451
- .ui-tabs .ui-tabs-nav {
452
- margin: 0;
453
- padding: .2em .2em 0;
 
454
  }
455
- .ui-tabs .ui-tabs-nav li {
 
 
 
 
456
  list-style: none;
457
- float: left;
458
- position: relative;
459
- top: 0;
460
- margin: 1px .2em 0 0;
461
- border-bottom-width: 0;
462
- padding: 0;
463
- white-space: nowrap;
464
  }
465
- .ui-tabs .ui-tabs-nav .ui-tabs-anchor {
466
- float: left;
467
- padding: .5em 1em;
468
- text-decoration: none;
469
  }
470
- .ui-tabs .ui-tabs-nav li.ui-tabs-active {
471
- margin-bottom: -1px;
472
- padding-bottom: 1px;
473
  }
474
- .ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
475
- .ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,
476
- .ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor {
477
- cursor: text;
 
 
 
478
  }
479
- .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
 
480
  cursor: pointer;
481
  }
482
- .ui-tabs .ui-tabs-panel {
483
- display: block;
484
- border-width: 0;
485
- padding: 1em 1.4em;
486
- background: none;
 
487
  }
488
 
489
- .ui-accordion .ui-accordion-header {
490
- display: block;
491
- cursor: pointer;
492
- position: relative;
493
- margin: 2px 0 0 0;
494
- padding: .5em .5em .5em .7em;
495
- min-height: 0; /* support: IE7 */
496
- font-size: 100%;
 
 
497
  }
498
- .ui-accordion .ui-accordion-icons {
499
- padding-left: 2.2em;
 
500
  }
501
- .ui-accordion .ui-accordion-icons .ui-accordion-icons {
502
- padding-left: 2.2em;
 
 
 
503
  }
504
- .ui-accordion .ui-accordion-header .ui-accordion-header-icon {
505
- position: absolute;
506
- left: .5em;
507
- top: 50%;
508
- margin-top: -8px;
509
- }
510
- .ui-accordion .ui-accordion-content {
511
- padding: 1em 2.2em;
512
- border-top: 0;
513
- overflow: auto;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
514
  }
4
  clear: both;
5
  }
6
 
7
+ .column-lp_course .row-actions,
8
+ .column-lp_quiz .row-actions {
9
+ display: inline-block;
10
+ margin-left: 10px;
11
+ }
12
 
13
+ .column-lp_course .row-actions a,
14
+ .column-lp_quiz .row-actions a {
15
+ color: #999;
16
  }
17
 
18
+ /**/
19
+ /* message box */
20
+ #learn-press-message-box-block {
21
+ position: fixed;
22
+ top: 0;
23
+ left: 0;
24
+ right: 0;
25
+ bottom: 0;
26
+ background-color: #000;
27
+ z-index: 99999;
28
+ opacity: 0.8;
29
  }
30
+
31
+ #learn-press-message-box-window {
32
+ position: fixed;
33
+ top: 0;
34
+ bottom: 0;
35
+ left: 0;
36
+ right: 0;
37
+ z-index: 100000;
38
+ color: #FFF;
39
+ text-align: center;
40
  }
41
+
42
+ #message-box-wrap {
43
+ margin: 0 auto;
44
+ /* text-align: center; */
45
+ display: inline-block;
46
+ text-align: left;
47
+ max-width: 70%;
48
  }
49
+
50
+ .message-box-title {
51
+ color: #FFF;
52
+ margin: 0 0 40px 0;
53
+ font-size: 34px;
54
  }
55
 
56
+ .message-box-content {
57
+ font-size: 16px;
58
+ line-height: 1.5;
59
  }
60
 
61
+ .message-box-animation {
62
+ background-image: url("../images/animation.gif");
63
+ width: 220px;
64
+ height: 20px;
65
+ margin: 20px 0 0;
66
+ }
67
+
68
+ .message-box-buttons {
69
+ margin: 20px 0 0;
70
+ border-top: 1px solid #929292;
71
+ padding-top: 20px;
72
+ }
73
+
74
+ .message-box-button {
75
+ margin-right: 10px !important;
76
+ background-color: #FFFFFF;
77
+ color: #999;
78
+ }
79
+
80
+ .message-box-button:hover {
81
+ background-color: #F5F5F5;
82
  }
83
 
84
+ .lp-label {
85
+ display: inline-block;
86
+ padding: 3px 8px;
87
+ line-height: 1;
88
+ font-size: 65%;
89
+ vertical-align: baseline;
90
+ color: #FFF;
91
+ border-radius: 4px;
92
+ }
93
 
94
+ .lp-label-quiz {
95
+ background-color: #53658C;
96
  }
97
 
98
+ .lp-label-preview {
99
+ background-color: #5cb85c;
100
+ }
101
 
102
+ .lp-label-viewing {
103
+ background-color: #39afff;
104
  }
105
 
106
+ .lp-label-lesson {
107
+ background-color: #337ab7;
108
  }
109
 
110
+ .lp-label-final {
111
+ background-color: #FF6161;
112
  }
113
 
114
+ .lp-label-completed {
115
+ background-color: #39C7CE;
 
 
116
  }
117
 
118
+ .lp-label-format {
119
+ background-color: #ccc416;
120
+ }
121
 
122
+ .lp-label-format-aside {
123
+ background-color: #ccc416;
124
  }
125
 
126
+ .lp-label-format-image {
127
+ background-color: #ccc416;
 
128
  }
129
 
130
+ .lp-label-format-video {
131
+ background-color: #ccc416;
132
  }
133
 
134
+ .lp-label-format-quote {
135
+ background-color: #ccc416;
 
 
 
 
 
 
 
 
 
 
136
  }
137
 
138
+ .lp-label-format-link {
139
+ background-color: #ccc416;
140
  }
141
 
142
+ .lp-label-format-gallery {
143
+ background-color: #ccc416;
 
 
 
 
 
144
  }
145
 
146
+ .lp-label-format-status {
147
+ background-color: #ccc416;
148
  }
149
 
150
+ .lp-label-format-audio {
151
+ background-color: #ccc416;
 
 
152
  }
153
 
154
+ .lp-label-format-chat {
155
+ background-color: #ccc416;
 
 
 
156
  }
157
 
158
+ .course-item .lp-label-completed,
159
+ .course-item .lp-label-viewing {
160
+ display: none;
161
  }
162
 
163
+ .course-item.item-completed .lp-label-completed,
164
+ .course-item.item-current .lp-label-viewing {
165
+ display: inline-block;
 
 
 
 
 
166
  }
167
 
168
+ .course-meta > * {
169
+ display: inline-block;
170
+ font-style: italic;
171
+ font-size: smaller;
172
  }
173
 
174
+ .course-meta > *:after {
175
+ content: ' | ';
176
+ font-style: italic;
177
  }
178
 
179
+ .course-meta > *:last-child:after {
180
  display: none;
 
181
  }
182
+ /**/
183
+ .learnpress {
184
 
 
 
185
  }
186
 
187
+ .learnpress ul,
188
+ .learnpress li {
189
+ list-style: none;
 
 
190
  }
191
 
192
+ .learnpress h3 {
193
+ font-size: 2.7rem;
194
+ line-height: 1.1852;
195
+ margin-top: 2.3704em;
196
+ margin-bottom: 1.1852em;
197
  }
198
 
199
+ .learnpress .learnpress-content {
200
+ z-index: 100;
201
+ position: relative;
 
 
202
  }
203
 
204
+ .learnpress .twentyfifteen .learnpress-content {
205
+ padding-left: 7.6923%;
206
+ padding-right: 7.6923%;
207
+ padding-top: 7.6923%;
208
+ margin-bottom: 7.6923%;
209
+ background: #fff;
210
+ box-shadow: 0 0 1px rgba(0, 0, 0, .15);
211
+ }
212
+
213
+ .learn-press-checkout-payment {
214
+
215
+ }
216
+
217
+ .payment-method-form {
218
  display: none;
219
  }
220
 
221
+ .learn-press-user-form {
 
222
  float: left;
223
+ width: 50%;
224
+ box-sizing: border-box;
225
+ padding: 0 10px;
226
  }
227
 
228
+ .learn-press-user-form .form-heading {
 
229
  }
230
 
231
+ .learn-press-user-form .form-subheading {
232
+
 
233
  }
234
 
235
+ .learn-press-user-form .form-content {
236
+
237
+ }
238
+
239
+ .learn-press-user-form .form-fields {
240
+
241
+ }
242
+
243
+ #learn-press-checkout-user-form {
244
+ margin: 0 -10px;
245
  }
246
 
247
+ /* archive */
248
+ .learnpress .twentyfifteen .page-title {
249
+ margin: 0 0 30px 0;
250
+ }
251
+
252
+ .course-introduce {
253
+ margin: 20px 0 0 0;
254
+ }
255
+
256
+ .course-introduce .more-link {
257
+
258
+ }
259
+
260
+ .course-title,
261
+ .course-title h3 {
262
+ font-size: 18px;
263
+ }
264
+
265
+ .archive .lp_course {
266
+ }
267
+
268
+ /* pagination */
269
+ .learn-press-pagination {
270
  text-align: center;
 
 
271
  }
272
 
273
+ .learn-press-pagination ul > li {
274
+ display: inline-block;
275
+ }
276
+
277
+ .learn-press-pagination ul > li a,
278
+ .learn-press-pagination ul > li span {
279
+ display: inline-block;
280
+ padding: 0 10px;
281
+ border: 1px solid #DDD;
282
+ background-color: #F5F5F5;
283
+ }
284
+
285
+ .learn-press-pagination ul > li a {
286
+ background-color: #FFF;
287
+ }
288
+
289
+ .learn-press-breadcrumb {
290
+ margin: 0 0 20px 0;
291
+ }
292
+
293
+ /* course lesson nav */
294
+ .course-item-nav {
295
+ border-top: 1px dashed #DDD;
296
+ overflow: hidden;
297
+ margin: 20px 0;
298
+ padding-top: 10px;
299
+ }
300
+
301
+ .course-item-nav .course-item-prev > *,
302
+ .course-item-nav .course-item-next > * {
303
  display: block;
304
  }
305
 
306
+ .course-item-nav > div > span {
307
+ font-size: 70%;
308
+ text-transform: uppercase;
309
+ font-weight: bold;
310
  }
311
 
312
+ .course-item-nav .course-item-prev {
313
+ float: left;
314
+ text-align: left;
315
+ }
316
+
317
+ .course-item-nav .course-item-next {
318
+ float: right;
319
+ text-align: right;
320
+ }
321
+
322
+ /* curriculum */
323
+ .section-header {
324
+ margin: 0 0 0 0;
325
+ padding: 10px 15px;
326
+ background-color: #EEE;
327
+ }
328
+
329
+ .section-header p {
330
+ display: inline-block;
331
+ font-weight: normal;
332
+ font-style: italic;
333
+ color: #999;
334
+ font-size: smaller;
335
+ margin: 0;
336
+ }
337
+
338
+ #learn-press-course-curriculum .section {
339
+ margin: 0 0 1px 0;
340
  list-style: none;
 
341
  }
342
 
343
+ #learn-press-course-curriculum .section-content {
344
+ margin: 0;
345
+ background-color: #F5F5F5;
346
+ }
347
+
348
+ #learn-press-course-curriculum .section .course-item {
349
+ margin: 0 0 0;
350
  list-style: none;
351
+ padding: 10px 15px;
352
+ border-top: 1px solid #FFF;
353
+ }
354
+
355
+ #learn-press-course-curriculum .section .course-item-meta {
356
+ display: block;
357
+ float: right;
358
  line-height: 1;
359
+ margin: 3px 0;
360
+ }
361
+
362
+ #learn-press-course-curriculum .section .course-item.section-empty {
363
+ background-color: #F5F5F5;
364
+ }
365
+
366
+ #learn-press-course-curriculum .section .course-item.section-empty .learn-press-message {
367
+ margin: 0;
368
  }
369
 
370
+ /* QUIZ */
371
+ .single-quiz {
372
+
373
  }
374
 
375
+ .single-quiz .quiz-summary-left {
376
+ float: left;
377
+ width: 100%;
378
+ padding-right: 320px;
379
  }
380
 
381
+ .single-quiz .quiz-sidebar {
382
+ float: right;
383
+ width: 300px;
384
+ margin-left: -300px;
385
+ border: 2px solid #DDD;
386
+ padding: 20px;
387
  }
388
 
389
+ .single-quiz.quiz-completed .quiz-questions-list .learn-press-question-title {
390
  display: none;
391
  }
392
 
393
+ .quiz-questions-list .current {
394
+ font-weight: bold;
395
+ }
396
+
397
+ .quiz-questions-list .current a:after {
398
+ display: inline-block;
399
+ background-color: #0066cc;
400
+ /* padding: 0px 8px; */
401
+ color: #FFF;
402
+ font-size: 70%;
403
+ border-radius: 50%;
404
+ content: '?';
405
+ /* margin-left: 10px; */
406
+ width: 20px;
407
+ height: 20px;
408
+ line-height: 20px;
409
+ text-align: center;
410
+ vertical-align: middle;
411
+ }
412
+
413
+ .quiz-countdown {
414
+ text-align: center;
415
+ }
416
+
417
+ .quiz-countdown #quiz-countdown-value {
418
+ font-size: 40px;
419
+ line-height: 1;
420
+ }
421
+
422
+ .quiz-countdown .quiz-countdown-label {
423
+ font-size: smaller;
424
+ font-style: italic;
425
+ color: #999;
426
+ }
427
+
428
+ .quiz-buttons {
429
+ text-align: center;
430
  }
431
 
432
  .quiz-result {
 
 
 
433
  width: 100%;
434
  }
435
 
482
  color: #869791;
483
  }
484
 
485
+ .quiz-history {
486
+ font-size: 80%;
487
  }
488
 
489
+ .quiz-history td {
490
+ padding: 10px;
491
  }
492
 
493
+ .quiz-history-actions {
494
+ margin: 0;
495
  }
496
 
497
+ /* profile */
498
+ #learn-press-user-profile {
499
+ overflow: hidden;
 
 
 
 
 
 
 
500
  }
501
 
502
+ .learn-press-user-profile .user-info {
503
+ margin: 0 0 20px;
 
504
  }
505
 
506
+ .learn-press-user-profile .user-basic-info {
 
 
507
 
 
 
508
  }
509
 
510
+ .learn-press-user-profile .learn-press-tabs {
511
+ list-style: none;
512
+ margin: 0 0 20px;
513
+ padding-left: 5px;
514
+ border-bottom: 1px solid #DDD;
 
 
515
  }
516
 
517
+ .learn-press-user-profile .learn-press-tabs > li {
518
+ float: left;
 
519
  }
520
 
521
+ .learn-press-user-profile .learn-press-tabs > li > a {
522
+ box-shadow: none;
523
+ outline: none;
524
+ display: block;
525
+ border: none;
526
+ padding: 5px 10px;
527
  }
528
 
529
+ .learn-press-user-profile .learn-press-tabs > li.current a {
530
+ background-color: #FFF;
531
+ border: 1px solid #DDD;
532
+ border-bottom-color: transparent;
533
+ z-index: 10;
534
+ margin-bottom: -1px;
535
  }
536
 
537
+ .learn-press-tabs-wrapper {
538
+ margin: 0 0 20px;
539
  }
540
 
541
+ .learn-press-user-profile .learn-press-tabs-wrapper > .learn-press-tab {
542
+ /*padding: 0;
543
+ float: left;
544
+ width: 100%;
545
+ margin-right: -100%;
546
+ visibility: hidden;*/
547
  }
548
 
549
+ .learn-press-user-profile .entry-tab-inner {
 
 
550
  }
551
+
552
+ .learn-press-user-profile .learn-press-tabs-wrapper {
553
+ /*float: left;
554
+ width: 100%;
555
+ padding-left: 170px;*/
556
  }
557
+
558
+ .learn-press-user-profile .profile-content-left {
559
+ float: left;
560
+ margin-left: -100%;
561
+ margin-bottom: -100000px;
562
+ padding-bottom: 100000px;
563
+ background-color: #F5F5F5;
564
  }
565
+
566
+ .profile-courses {
567
+ list-style: none;
568
  }
569
+
570
+ .profile-courses > li {
571
+
 
572
  }
573
+
574
+ .profile-courses > li > a {
 
 
 
 
575
  }
576
+
577
+ .profile-courses-heading {
578
+ margin: 0 0 10px !important;
 
 
 
579
  }
580
 
581
+ .learn-press-subtabs {
 
582
  }
583
 
584
+ .learn-press-subtabs > li {
585
+ display: inline-block;
586
+ margin-right: 10px;
587
  }
588
+
589
+ .learn-press-subtabs > li.current {
590
+ font-weight: bold;
 
 
 
 
 
591
  }
592
+
593
+ .learn-press-subtab-content {
594
+ display: none;
595
  }
596
+
597
+ .learn-press-subtab-content.current {
598
+ display: block;
 
599
  }
600
 
601
+ .hide-if-js {
602
+ display: none;
603
  }
604
 
605
+ /**/
606
+ .purchase-course .view-cart-button {
607
+
 
 
608
  }
609
+
610
+ .learn-press-cart-table td,
611
+ .learn-press-cart-table th {
612
+ vertical-align: top;
613
  }
614
+
615
+ .learn-press-cart-table .course-remove {
616
+ width: 40px;
617
  }
618
 
619
+ .learn-press-cart-table .course-thumbnail {
620
+ width: 20%;
 
621
  }
622
+
623
+ .learn-press-cart-table .course-price,
624
+ .learn-press-cart-table .course-total {
625
+ width: 15%;
626
  }
627
+
628
+ /* notices */
629
+ .learn-press-notice,
630
+ .learn-press-message,
631
+ .learn-press-error {
632
  list-style: none;
633
+ margin: 0 0 20px 0;
634
+ background-color: #F5F5F5;
635
+ padding: 8px 15px;
636
+ border-left: 5px solid;
 
 
 
637
  }
638
+
639
+ .learn-press-notice {
640
+ border-color: #1e85be;
 
641
  }
642
+
643
+ .learn-press-message {
644
+ border-color: #8fae1b;
645
  }
646
+
647
+ .learn-press-error {
648
+ border-color: #b81c23;
649
+ }
650
+
651
+ .open-hand {
652
+ cursor: url("../../assets/images/openhand.cur") 7 5, default !important;
653
  }
654
+
655
+ a .archive-course:hover {
656
  cursor: pointer;
657
  }
658
+
659
+ .archive-course {
660
+ border: 1px solid black;
661
+ display: table;
662
+ margin-bottom: 10px;
663
+ width: 100%;
664
  }
665
 
666
+ .course-cover {
667
+ display: table-cell;
668
+ height: 100px;
669
+ width: 100px;
670
+ }
671
+
672
+ .course-detail {
673
+ display: table-cell;
674
+ vertical-align: top;
675
+ padding-left: 10px;
676
  }
677
+
678
+ .course-title {
679
+ font-weight: bold;
680
  }
681
+
682
+ .lp-button-dropdown {
683
+ padding-right: 28px !important;
684
+ position: relative;
685
+ z-index: 99998;
686
  }
687
+
688
+ .lp-course-progress {
689
+ margin-right: 50px;
690
+ }
691
+
692
+ .lp-course-progress:after {
693
+ display: block;
694
+ content: '';
695
+ clear: both;
696
+ }
697
+
698
+ .lp-course-progress .lp-course-progress-heading {
699
+ margin: 0 0 40px 0;
700
+ }
701
+
702
+ .lp-course-progress .lp-progress-bar {
703
+ height: 20px;
704
+ background: #F5F5F5;
705
+ position: relative;
706
+ /* margin-right: 80px; */
707
+ float: left;
708
+ width: 100%;
709
+ margin-bottom: 50px;
710
+ -webkit-border-radius: 5px;
711
+ -moz-border-radius: 5px;
712
+ border-radius: 5px;
713
+ }
714
+
715
+ .lp-course-progress .lp-progress-value {
716
+ height: 20px;
717
+ background: #DDD;
718
+ position: absolute;
719
+ left: 0;
720
+ -webkit-transition: width 0.25s;
721
+ -moz-transition: width 0.25s;
722
+ -ms-transition: width 0.25s;
723
+ -o-transition: width 0.25s;
724
+ transition: width 0.25s;
725
+ -webkit-border-radius: 5px;
726
+ -moz-border-radius: 5px;
727
+ border-radius: 5px;;
728
+ }
729
+
730
+ .lp-course-progress .lp-progress-value > span,
731
+ .lp-course-progress .lp-passing-conditional span {
732
+ display: inline-block;
733
+ padding: 5px 10px;
734
+ font-size: small;
735
+ background: #DDD;
736
+ position: absolute;
737
+ right: 0;
738
+ top: -35px;
739
+ line-height: 1;
740
+ white-space: nowrap;
741
+ width: 50px;
742
+ text-align: center;
743
+ margin-right: -25px;
744
+ -webkit-border-radius: 3px;
745
+ -moz-border-radius: 3px;
746
+ border-radius: 3px;
747
+ }
748
+
749
+ .lp-course-progress .lp-progress-value > span:after,
750
+ .lp-course-progress .lp-passing-conditional span:after {
751
+ content: '';
752
+ display: block;
753
+ border: 6px solid #DDD;
754
+ position: absolute;
755
+ border-color: transparent;
756
+ border-top-color: #DDD;
757
+ bottom: -12px;
758
+ left: 50%;
759
+ margin-left: -6px;
760
+ }
761
+
762
+ .lp-course-progress .lp-passing-conditional span {
763
+ top: 30px;
764
+ margin-left: -25px;
765
+ }
766
+
767
+ .lp-course-progress .lp-passing-conditional span:after {
768
+ border-bottom-color: #DDD;
769
+ top: -12px;
770
+ left: 50%;
771
+ border-top-color: transparent;
772
+ bottom: auto;
773
+ }
774
+
775
+ .lp-course-progress .lp-progress-value.left > span {
776
+ left: 100%;
777
+ right: auto;
778
+ }
779
+
780
+ .lp-course-progress .lp-progress-value.left > span:after {
781
+ bottom: -4px;
782
+ transform: rotate(225deg);
783
+ left: -10px;
784
+ right: auto;
785
+ }
786
+
787
+ .lp-course-progress.passed .lp-progress-value {
788
+ background: #83D0FF;
789
+ -webkit-border-radius: 5px;
790
+ -moz-border-radius: 5px;
791
+ border-radius: 5px;
792
+ }
793
+
794
+ .lp-course-progress.passed .lp-progress-value > span {
795
+ background: #83D0FF;
796
+ }
797
+
798
+ .lp-course-progress.passed .lp-progress-value > span:after {
799
+ border-top-color: #83D0FF;
800
+ }
801
+
802
+ .lp-course-progress .lp-progress-total {
803
+ width: 50px;
804
+ float: right;
805
+ margin-right: -50px;
806
+ height: 20px;
807
+ font-size: small;
808
+ text-align: right;
809
+ line-height: 20px;
810
+ }
811
+
812
+ .lp-course-progress .lp-passing-conditional {
813
+ position: absolute;
814
+ height: 20px;
815
+ width: 1px;
816
+ background-color: #FF0000;
817
+ }
818
+
819
+ .lp-course-progress .lp-passing-conditional.right span {
820
+ right: 0;
821
+ }
822
+
823
+ .lp-course-progress .lp-passing-conditional.right span:after {
824
+ left: auto;
825
+ right: -10px;
826
+ border-left-color: transparent;
827
+ border-bottom-color: #DDD;
828
+ }
829
+
830
+ .quiz-questions-list .question-title {
831
+ font-weight: normal;
832
+ }
833
+
834
+ .question-results .question-title:after {
835
+ content: '';
836
+ display: inline-block;
837
+ font-family: dashicons;
838
+ vertical-align: middle;
839
+ font-size: 20px;
840
+ }
841
+
842
+ .question-results.correct .question-title:after {
843
+ content: "\f147";
844
+ }
845
+
846
+ .question-results.incorrect .question-title:after {
847
+ content: "\f335";
848
+ }
849
+
850
+ .question-results.skipped {
851
+ }
852
+
853
+ .complete-lesson-button.completed {
854
+
855
+ }
856
+
857
+ .learn-press-question-wrap {
858
+
859
+ }
860
+
861
+ .learn-press-question-wrap.checked li.answer-true {
862
+ background: #C4EBFF;
863
+ }
864
+
865
+ .learn-press-question-wrap.checked li.user-answer-false {
866
+ color: #FF0000;
867
+ }
868
+
869
+ /* jAlerts */
870
+ #popup_container {
871
+ background: #FFF;
872
+ }
873
+
874
+ #popup_title {
875
+ padding: 10px 20px;
876
+ background: #18B6C7;
877
+ color: #FFF;
878
+ }
879
+
880
+ #popup_content {
881
+ padding: 20px;
882
+ }
883
+
884
+ #popup_message {
885
+ margin-bottom: 20px;
886
+ }
887
+
888
+ .question-explanation-content,
889
+ .question-hint-content {
890
+ border: 1px solid #DDD;
891
+ padding: 20px;
892
+ background: #DDD;
893
+ margin-bottom: 20px;
894
+ }
895
+
896
+ .question-explanation-content:before,
897
+ .question-hint-content:before {
898
+ content: attr(data-title);
899
+ display: block;
900
+ font-weight: bold;
901
+ }
902
+
903
+ .button-fade {
904
+ opacity: 0.5;
905
+ }
906
+
907
+ .button-fade:hover {
908
+ opacity: 1;
909
+ }
910
+
911
+ #learn-press-content-item {
912
+ margin-bottom: 20px;
913
+ background: #ffffff;
914
+ border: 1px solid #DDD;
915
+ padding: 20px;
916
+ display: none;
917
+ }
918
+ #learn-press-content-item .course-lesson-heading{
919
+ margin-top: 0;
920
+ }
921
+ #learn-press-content-item.loading {
922
+ height: 50px;
923
+ overflow: hidden;
924
+ position: relative;
925
+ }
926
+
927
+ #learn-press-content-item.loading:before,
928
+ #learn-press-content-item.loading:after {
929
+ position: absolute;
930
+ top: 0;
931
+ left: 0;
932
+ right: 0;
933
+ bottom: 0;
934
+ z-index: 10;
935
+ background: #FFF;
936
+ content: '';
937
+ }
938
+
939
+ #learn-press-content-item.loading:after {
940
+ background: url("../images/ajax-loader.gif") center no-repeat;
941
+ }
942
+
943
+ #learn-press-course-lesson {
944
+ }
945
+
946
+ .quiz-question-nav-buttons {
947
+ margin: 10px 0;
948
+ }
949
+
950
+ @-ms-viewport {
951
+ width: device-width;
952
+ }
953
+
954
+ @viewport {
955
+ width: device-width;
956
+ }
957
+
958
+ /**
959
+ * Mobile Large 620px
960
+ */
961
+ @media screen and (min-width: 38.75em) {
962
+ .twentyfifteen .learnpress-content {
963
+ margin-right: 7.6923%;
964
+ margin-left: 7.6923%;
965
+ margin-top: 8.3333%;
966
+ }
967
+ }
968
+
969
+ @media screen and (max-width: 38.75em) {
970
+ .single-quiz .quiz-sidebar {
971
+ width: 100%;
972
+ }
973
+
974
+ .learnpress ul {
975
+ margin-left: 0;
976
+ }
977
+
978
+ #learn-press-course-curriculum .section .course-item-meta {
979
+ float: none;
980
+ }
981
+ }
982
+
983
+ /**
984
+ * Tablet Small 740px
985
+ */
986
+
987
+ @media screen and (min-width: 46.25em) {
988
+
989
+ }
990
+
991
+ /**
992
+ * Tablet Large 880px
993
+ */
994
+
995
+ @media screen and (min-width: 55em) {
996
+ }
997
+
998
+ /**
999
+ * Desktop Small 955px
1000
+ */
1001
+
1002
+ @media screen and (min-width: 59.6875em) {
1003
+ .twentyfifteen .learnpress-content {
1004
+ margin-left: 8.3333%;
1005
+ margin-right: 8.3333%;
1006
+ padding: 10%;
1007
+ }
1008
+ }
1009
+
1010
+ @media screen and (max-width: 59.6875em) {
1011
+
1012
+ .twentyfifteen .learnpress-content {
1013
+ padding: 10%;
1014
+ }
1015
+ }
1016
+
1017
+ /**
1018
+ * Desktop Medium 1100px
1019
+ */
1020
+
1021
+ @media screen and (max-width: 68.75em) {
1022
+ .single-quiz .quiz-summary-left,
1023
+ .single-quiz .quiz-sidebar {
1024
+ float: none;
1025
+ margin: 0 auto;
1026
+ }
1027
+
1028
+ .single-quiz .quiz-summary-left {
1029
+ padding-right: 0;
1030
+ }
1031
+ }
1032
+
1033
+ /**
1034
+ * Desktop Large 1240px
1035
+ */
1036
+
1037
+ @media screen and (min-width: 77.5em) {
1038
+ }
1039
+
1040
+ /**
1041
+ * Desktop X-Large 1403px
1042
+ */
1043
+
1044
+ @media screen and (min-width: 87.6875em) {
1045
+
1046
+ }
1047
+
1048
+
1049
+
1050
+
1051
+
1052
+ /**
1053
+ * global style for widgets
1054
+ **/
1055
+ .archive-course-widget-outer .course-title{
1056
+ font-size: 16px;
1057
+ line-height: 1.3;
1058
+ }
1059
+
1060
+ /**
1061
+ * styles for archive course widget
1062
+ * template: default
1063
+ */
1064
+ .archive-course-widget-outer.default{
1065
+
1066
+ }
1067
+
1068
+ .archive-course-widget-outer.default .course-entry{
1069
+ margin-top: 8px;
1070
+ }
1071
+
1072
+ .archive-course-widget-outer.default .course-entry .course-meta-data{
1073
+ font-size: smaller;
1074
+ }
1075
+ .archive-course-widget-outer.default .course-entry .course-meta-data .section{
1076
+ display: block;
1077
+ }
1078
+
1079
+ .archive-course-widget-outer.default .course-entry .course-meta-data .section.inline .meta-field{
1080
+ display: inline-block;
1081
+ }
1082
+
1083
+ .archive-course-widget-outer.default .course-entry .course-meta-data .section.inline .meta-field:not(:last-child):after{
1084
+ content : '|';
1085
+ font-style: italic;
1086
+ }
1087
+
1088
+ .archive-course-widget-outer.default .widget-footer .pull-right{
1089
+ float: right;
1090
+ }
1091
+
1092
+ /**
1093
+ * global styles for archive course shortcode
1094
+ **/
1095
+ .archive-course-collection-outer a:link{
1096
+ text-decoration: none;
1097
+ border-bottom: none;
1098
+ }
1099
+
1100
+ .archive-course-collection-outer .course-title{
1101
+ line-height: 1.3;
1102
+ font-size: 16px;
1103
+ }
1104
+
1105
+ .archive-course-collection-outer .course-description{
1106
+ font-size: small;
1107
+ }
1108
+
1109
+ .archive-course-collection-outer .course-meta-data{
1110
+ font-size: small;
1111
+ padding-top: 4px;
1112
+ line-height: 1.4;
1113
+ }
1114
+
1115
+ .owl-buttons{
1116
+ margin-top: 15px;
1117
+ text-align: center;
1118
+ }
1119
+
1120
+ .owl-next, .owl-prev{
1121
+ margin: 2px;
1122
+ display: inline-block;
1123
+ border: 1px solid #DDD;
1124
+ background-color: #F5F5F5;
1125
+ color: black;
1126
+ box-sizing: border-box;
1127
+ padding: 0 10px;
1128
+ }
1129
+
1130
+ /**
1131
+ * style for archive course shortcodes/courses collection
1132
+ * template: list
1133
+ **/
1134
+
1135
+ .archive-course-collection-outer.list{
1136
+
1137
+ }
1138
+
1139
+ .archive-course-collection-outer.list .collection-body{
1140
+ width: 100%;
1141
+ }
1142
+
1143
+ .archive-course-collection-outer.list .course-entry{
1144
+ padding: 10px 0;
1145
+ border-bottom: solid 4px whitesmoke;
1146
+ }
1147
+
1148
+ .archive-course-collection-outer.list .course-title{
1149
+ line-height: normal;
1150
+ font-size: 18px;
1151
+ padding-bottom: 4px;
1152
+ }
1153
+
1154
+ .archive-course-collection-outer.list .course-entry .course-meta-data{
1155
+ font-size: smaller;
1156
+ }
1157
+ .archive-course-collection-outer.list .course-entry .course-meta-data .section{
1158
+ display: block;
1159
+ }
1160
+
1161
+ .archive-course-collection-outer.list .course-entry .course-meta-data .section.inline .meta-field{
1162
+ display: inline-block;
1163
+ }
1164
+
1165
+ .archive-course-collection-outer.list .course-entry .course-meta-data .section.inline .meta-field:not(:last-child):after{
1166
+ content : '|';
1167
+ font-style: italic;
1168
+ }
1169
+
1170
+ .archive-course-collection-outer.list .collection-footer .pull-right{
1171
+ float: right;
1172
+ }
1173
+
1174
+ /**
1175
+ * style for archive course shortcodes/courses collection
1176
+ * template: grids
1177
+ **/
1178
+
1179
+ .archive-course-collection-outer.grids{
1180
+ width: 100%;
1181
+ overflow: hidden;
1182
+ position: relative;
1183
+ }
1184
+ .archive-course-collection-outer.grids .item{
1185
+ margin: 10px 5px;
1186
+ min-width: 150px;
1187
+ max-width: 400px;
1188
+ }
1189
+
1190
+ .archive-course-collection-outer.grids .collection-body {
1191
+ display: flex;
1192
+ flex-direction: row;
1193
+ flex-wrap: wrap;
1194
+ width: 100%;
1195
+ white-space: normal;
1196
+ }
1197
+
1198
+ .archive-course-collection-outer.grids .course-entry-outer{
1199
+ width: 25%;
1200
+ overflow: hidden;
1201
+ padding: 5px;
1202
+ }
1203
+
1204
+ .archive-course-collection-outer.grids .course-entry{
1205
+ height: 100%;
1206
+
1207
+ }
1208
+
1209
+ .archive-course-collection-outer.grids .course-cover{
1210
+ display: block;
1211
+ width: 100%;
1212
+ }
1213
+ .archive-course-collection-outer.grids .course-cover .img-link,
1214
+ .archive-course-collection-outer.grids .course-cover .img-link img{
1215
+ width: 100%;
1216
+ height: 100%;
1217
+ }
1218
+ .archive-course-collection-outer.grids .course-detail{
1219
+ padding: 5px;
1220
+ }
1221
+ .archive-course-collection-outer.grids .course-title{
1222
+ min-height: 5em;
1223
+ text-align: center;
1224
+ }
1225
+
1226
+ .archive-course-collection-outer.grids .course-entry .course-meta-data{
1227
+ font-size: smaller;
1228
+ }
1229
+
1230
+ .archive-course-collection-outer.grids .course-entry .course-meta-data .section{
1231
+ display: block;
1232
+ }
1233
+
1234
+ .archive-course-collection-outer.grids .course-entry .course-meta-data .section.inline .meta-field{
1235
+ display: inline-block;
1236
+ }
1237
+
1238
+ .archive-course-collection-outer.grids .course-entry .course-meta-data .section.inline .meta-field:not(:last-child):after{
1239
+
1240
+ }
1241
+
1242
+ .archive-course-collection-outer.grids .collection-footer .pull-right{
1243
+ float: right;
1244
+ }
1245
+
1246
+ .archive-course-collection-outer.grids.shadow .item{
1247
+ -webkit-box-shadow: 2px 2px 10px 0px rgba(0, 0, 0,0.2);
1248
+ -moz-box-shadow: 2px 2px 10px 0px rgba(0, 0, 0,0.2);
1249
+ box-shadow: 2px 2px 10px 0px rgba(0, 0, 0,0.2);
1250
+ }
1251
+ /**
1252
+ * style for archive course shortcodes/courses collection
1253
+ * template: cards
1254
+ **/
1255
+
1256
+ .archive-course-collection-outer.cards{
1257
+
1258
+ }
1259
+ .archive-course-collection-outer.cards .item{
1260
+ height: 280px;
1261
+ margin: 10px 5px;
1262
+ min-width: 200px;
1263
+ max-width: 400px;
1264
+ -webkit-box-shadow: 2px 2px 10px 0px rgba(0, 0, 0,0.2);
1265
+ -moz-box-shadow: 2px 2px 10px 0px rgba(0, 0, 0,0.2);
1266
+ box-shadow: 2px 2px 10px 0px rgba(0, 0, 0,0.2);
1267
+ }
1268
+ .archive-course-collection-outer.cards .course-entry{
1269
+ }
1270
+
1271
+ .archive-course-collection-outer.cards .course-cover{
1272
+ position: relative;
1273
+ display: block;
1274
+ width: 100%;
1275
+ height: 60%;
1276
+ }
1277
+
1278
+ .archive-course-collection-outer.cards .course-cover img{
1279
+ width: 100%;
1280
+ height: 100%;
1281
+ }
1282
+
1283
+ .archive-course-collection-outer.cards .course-title {
1284
+ text-align: center;
1285
+ padding-top: 1em;
1286
+ height: 40%;
1287
+ }
1288
+
1289
+ .archive-course-collection-outer.cards .course-entry:hover .course-detail{
1290
+ display: block;
1291
+ opacity: 1;
1292
+ }
1293
+
1294
+ .archive-course-collection-outer.cards .course-detail{
1295
+ position: absolute;
1296
+ display: block;
1297
+ opacity: 0;
1298
+ top: 0;
1299
+ width: 100%;
1300
+ height: 100%;
1301
+ color: white;
1302
+ background-color: rgba(0,0, 0, 0.8);
1303
+ transition: opacity 0.7s;
1304
+ }
1305
+ .archive-course-collection-outer.cards .course-meta-data{
1306
+ font-size: 100%;
1307
+ line-height: 1.6;
1308
+ }
1309
+
1310
+ .archive-course-collection-outer.cards .course-detail a{
1311
+ color: green;
1312
+ }
1313
+
1314
+ .archive-course-collection-outer.cards .course-detail a:hover{
1315
+ color: #419641;
1316
  }
assets/css/learnpress.less ADDED
@@ -0,0 +1,536 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @icon-url: '../fonts/icomoon';
2
+ @font-face {
3
+ font-family: 'lp-icons';
4
+ src: url('@{icon-url}.eot?6gvjr0');
5
+ src: url('@{icon-url}.eot?6gvjr0#iefix') format('embedded-opentype'),
6
+ url('@{icon-url}.ttf?6gvjr0') format('truetype'),
7
+ url('@{icon-url}.woff?6gvjr0') format('woff'),
8
+ url('@{icon-url}.svg?6gvjr0#icons') format('svg');
9
+ font-weight: normal;
10
+ font-style: normal;
11
+ }
12
+
13
+ [class^="lp-icon-"], [class*=" lp-icon-"] {
14
+ /* use !important to prevent issues with browser extensions that change fonts */
15
+ font-family: 'lp-icons' !important;
16
+ speak: none;
17
+ font-style: normal;
18
+ font-weight: normal;
19
+ font-variant: normal;
20
+ text-transform: none;
21
+ line-height: 1;
22
+
23
+ /* Better Font Rendering =========== */
24
+ -webkit-font-smoothing: antialiased;
25
+ -moz-osx-font-smoothing: grayscale;
26
+ }
27
+
28
+ .clearfix:after {
29
+ display: block;
30
+ content: '';
31
+ clear: both;
32
+ }
33
+
34
+ .border-radius(@a: 3px, @b: 3px, @c: 3px, @d: 3px) {
35
+ -webkit-border-radius: @arguments;
36
+ -khtml-border-radius: @arguments;
37
+ -moz-border-radius: @arguments;
38
+ -ms-border-radius: @arguments;
39
+ -o-border-radius: @arguments;
40
+ border-radius: @arguments;
41
+ }
42
+
43
+ .transform(@args) {
44
+ -webkit-transform: @arguments;
45
+ -khtml-transform: @arguments;
46
+ -moz-transform: @arguments;
47
+ -ms-transform: @arguments;
48
+ -o-transform: @arguments;
49
+ transform: @arguments;
50
+ }
51
+
52
+ .transition(@args) {
53
+ -webkit-transition: @arguments;
54
+ -khtml-transition: @arguments;
55
+ -moz-transition: @arguments;
56
+ -ms-transition: @arguments;
57
+ -o-transition: @arguments;
58
+ transition: @arguments;
59
+ }
60
+
61
+ .cross(@size: 30px, @border: 3px, @color: #000) {
62
+ &:before,
63
+ &:after {
64
+ width: @border;
65
+ background: @color;
66
+ height: @size;
67
+ content: '';
68
+ display: inline-block;
69
+ position: absolute;
70
+ top: 0;
71
+ left: (@size - @border) / 2;
72
+ }
73
+ &:before {
74
+ .transform(rotate(-45deg));
75
+ }
76
+ &:after {
77
+ .transform(rotate(45deg));
78
+ }
79
+ }
80
+
81
+ .hide-if-js {
82
+ display: none;
83
+ }
84
+
85
+ /* Archive courses */
86
+ .learn-press-courses {
87
+ list-style: none;
88
+ clear: both;
89
+ margin: 0 -30px 0 0;
90
+ padding: 0;
91
+ &:after {
92
+ display: block;
93
+ content: '';
94
+ clear: both;
95
+ }
96
+ li.course {
97
+ float: left;
98
+ width: 23%;
99
+ margin: 0 2% 30px 0;
100
+ /* padding: 0 20px; */
101
+ box-sizing: border-box;
102
+ border: 1px solid #DDD;
103
+ background: #FFF;
104
+ h3 {
105
+ padding: 15px;
106
+ margin: 0;
107
+ font-size: 18px;
108
+ line-height: 1.5;
109
+ }
110
+ .course-thumbnail {
111
+ & img {
112
+ max-width: 100%;
113
+ height: auto;
114
+ }
115
+ }
116
+ .course-info {
117
+ padding: 0 15px 15px;
118
+ font-size: 14px;
119
+ overflow: hidden;
120
+ }
121
+ .course-students {
122
+ float: left;
123
+ }
124
+ .course-instructor {
125
+ margin-bottom: 20px;
126
+ }
127
+ .course-price {
128
+ float: right;
129
+ color: rgb(84, 181, 81);
130
+ }
131
+ .course-info > * {
132
+ display: block;
133
+ }
134
+ &:nth-child(4n+1) {
135
+ clear: left;
136
+ margin-left: 0px;
137
+ }
138
+ }
139
+ }
140
+
141
+ .learn-press-notice .button {
142
+ float: right;
143
+ }
144
+
145
+ #learn-press-course-curriculum {
146
+ ul.curriculum-sections,
147
+ ul.section-content {
148
+ list-style: none;
149
+ margin: 0;
150
+ padding: 0;
151
+ background-color: #F5F5F5;
152
+ }
153
+ .section-header {
154
+ background-color: #EEE;
155
+ margin: 0px;
156
+ padding: 20px 15px;
157
+ border-top: 1px solid #FFF;
158
+ p {
159
+ display: inline-block;
160
+ font-weight: normal;
161
+ font-style: italic;
162
+ color: rgb(153, 153, 153);
163
+ font-size: smaller;
164
+ margin: 0px;
165
+ }
166
+ &:hover {
167
+ background: #DDD;
168
+ }
169
+ span {
170
+ font-size: smaller;
171
+ font-weight: normal;
172
+ float: right;
173
+ margin-top: 5px;
174
+ }
175
+ }
176
+ .course-item {
177
+ margin: 0px;
178
+ list-style: none;
179
+ padding: 15px 15px;
180
+ border-top: 1px solid rgb(255, 255, 255);
181
+ position: relative;
182
+ cursor: pointer;
183
+ .transition(background linear 0.5s);
184
+ .lp-label-viewing,
185
+ .lp-label-completed {
186
+ display: none;
187
+ }
188
+ .course-item-title {
189
+ &:before {
190
+ display: inline-block;
191
+ font-size: 16px;
192
+ margin-right: 5px;
193
+ font-family: 'lp-icons';
194
+ }
195
+ }
196
+ .lp-icon {
197
+ display: none;
198
+ }
199
+ &.course-lesson {
200
+ .course-item-title {
201
+ &:before {
202
+ content: '\e926';
203
+ }
204
+ }
205
+ }
206
+ &.course-quiz {
207
+ .course-item-title {
208
+ &:before {
209
+ content: '\e950';
210
+ }
211
+ }
212
+ }
213
+ &.item-current {
214
+ background: #FFF;
215
+ &:before {
216
+ display: block;
217
+ width: 3px;
218
+ background: #95e6f9;
219
+ position: absolute;
220
+ left: 0;
221
+ top: 0;
222
+ height: 100%;
223
+ content: '';
224
+ }
225
+ }
226
+ &.item-has-status .item-status {
227
+ display: inline-block;
228
+ background: #d6d6d6;
229
+ &:before {
230
+ content: '\ea10';
231
+ }
232
+ }
233
+ &.item-has-status.item-completed {
234
+ .item-status {
235
+ background: #95e6f9;
236
+ }
237
+ }
238
+ &.focus {
239
+ background: #ffb710;
240
+ &.off {
241
+ .transition(none);
242
+ }
243
+ }
244
+ &:hover {
245
+ background: #e7ecfb;
246
+ .transition(background linear 0s);
247
+ }
248
+ }
249
+
250
+ .course-item-meta {
251
+ display: block;
252
+ float: right;
253
+ line-height: 1;
254
+ }
255
+ }
256
+
257
+ .lp-icon {
258
+ display: inline-block;
259
+ font-family: 'lp-icons';
260
+ background: #95e6f9;
261
+ width: 24px;
262
+ height: 24px;
263
+ line-height: 24px;
264
+ text-align: center;
265
+ color: #FFF;
266
+ border-radius: 5px;
267
+ vertical-align: middle;
268
+ &:before {
269
+ width: 32px;
270
+ height: 32px;
271
+ }
272
+
273
+ }
274
+
275
+ .lp-label {
276
+ display: inline-block;
277
+ line-height: 1;
278
+ font-size: 65%;
279
+ vertical-align: baseline;
280
+ color: rgb(255, 255, 255);
281
+ padding: 3px 8px;
282
+ .border-radius(4px);
283
+ &.lp-label-viewing {
284
+ background-color: rgb(57, 175, 255);
285
+ }
286
+ &.lp-label-completed {
287
+ background-color: #39c7ce;
288
+ }
289
+ &.lp-label-lesson {
290
+ background-color: #337ab7;
291
+ }
292
+ &.lp-label-quiz {
293
+ background-color: #53658c;
294
+ }
295
+ }
296
+
297
+ .learn-press-content-protected-message {
298
+ border: 3px solid #ff8484;
299
+ background: #FFF;
300
+ padding: 20px;
301
+ color: #ff8484;
302
+ margin: 10px 0;
303
+ border-radius: 6px;
304
+ .icon {
305
+ position: relative;
306
+ display: inline-block;
307
+ width: 30px;
308
+ height: 30px;
309
+ margin-right: 10px;
310
+ vertical-align: middle;
311
+ .cross(30px, 3px, #ff8484);
312
+ }
313
+ }
314
+
315
+ /** COURSE PROGRESS **/
316
+ .lp-course-progress {
317
+ position: relative;
318
+ .lp-progress-bar {
319
+ height: 15px;
320
+ background: #DDD;
321
+ margin: 10px 0px 20px 0px;
322
+ overflow: hidden;
323
+ .border-radius(3px);
324
+ .lp-progress-value {
325
+ width: 50%;
326
+ height: 15px;
327
+ background: #95e6f9;
328
+ }
329
+ }
330
+ .lp-passing-conditional {
331
+ left: 0%;
332
+ position: absolute;
333
+ height: 25px;
334
+ top: -5px;
335
+ &:before,
336
+ &:after {
337
+ content: '';
338
+ display: inline-block;
339
+ border: 5px solid transparent;
340
+ left: 0;
341
+ position: absolute;
342
+ }
343
+ &:before {
344
+ border-top-color: #DDD;
345
+ }
346
+ &:after {
347
+ border-bottom-color: #DDD;
348
+ bottom: 0;
349
+ }
350
+ }
351
+ }
352
+
353
+ #learn-press-content-item {
354
+ border: 1px solid #DDD;
355
+ .learn-press-content-item-title {
356
+ padding: 20px;
357
+ background: #F5F5F5;
358
+ margin: 0;
359
+ }
360
+ .learn-press-content-item-summary {
361
+ padding: 20px;
362
+ border-top: 1px solid #DDD;
363
+ }
364
+ }
365
+
366
+ /** COURSE TABS **/
367
+ .learn-press-tabs {
368
+ .learn-press-nav-tabs {
369
+ list-style: none;
370
+ padding: 0 0 0 15px;
371
+ margin: 0;
372
+ border-bottom: 1px solid #DDD;
373
+ .learn-press-nav-tab {
374
+ float: left;
375
+ margin-bottom: -1px;
376
+ position: relative;
377
+ a {
378
+ display: inline-block;
379
+ padding: 10px 15px;
380
+ }
381
+ &.active {
382
+ border: 1px solid #DDD;
383
+ }
384
+ &.active:after {
385
+ position: absolute;
386
+ width: 100%;
387
+ border-bottom: 1px solid #FFF;
388
+ bottom: -1px;
389
+ content: '';
390
+ }
391
+ }
392
+ &:hover {
393
+
394
+ }
395
+ &:after {
396
+ content: '';
397
+ display: block;
398
+ clear: both;
399
+ }
400
+ }
401
+ .learn-press-tab-panel {
402
+ display: none;
403
+ &.active {
404
+ display: block;
405
+ }
406
+ }
407
+ }
408
+
409
+ /* POPUP */
410
+
411
+ body.course-has-popup {
412
+ overflow: hidden;
413
+ }
414
+
415
+ #course-curriculum-popup {
416
+ position: fixed;
417
+ top: 0;
418
+ left: 0;
419
+ right: 0;
420
+ bottom: 0;
421
+ background: #000;
422
+ z-index: 999999;
423
+ #popup-sidebar {
424
+ float: left;
425
+ width: 350px;
426
+ position: absolute;
427
+ top: 0;
428
+ bottom: 0;
429
+ overflow: auto;
430
+ background: #FFF;
431
+ border-right: 1px solid #DDD;
432
+ .course-curriculum-title {
433
+ display: none;
434
+ }
435
+ .curriculum-sections {
436
+ margin: 0;
437
+ font-size: smaller;
438
+ }
439
+ }
440
+ #popup-main {
441
+ position: absolute;
442
+ top: 0;
443
+ left: 350px;
444
+ right: 0;
445
+ bottom: 0;
446
+ background: #FFF;
447
+ #popup-header {
448
+ position: absolute;
449
+ top: 0;
450
+ left: 0;
451
+ right: 0;
452
+ height: 50px;
453
+ background: #F5F5F5;
454
+ border-bottom: 1px solid #DDD;
455
+ .popup-close {
456
+ width: 50px;
457
+ height: 50px;
458
+ position: absolute;
459
+ right: 0;
460
+ top: 0;
461
+ &:before,
462
+ &:after {
463
+ content: '';
464
+ border-top: 3px solid #636060;
465
+ width: 30px;
466
+ display: inline-block;
467
+ position: absolute;
468
+ }
469
+ &:before {
470
+ -webkit-transform: rotate(45deg);
471
+ top: 25px;
472
+ }
473
+ &:after {
474
+ -webkit-transform: rotate(-45deg);
475
+ top: 25px;
476
+ }
477
+ }
478
+ h3 {
479
+ margin: 0;
480
+ height: 50px;
481
+ line-height: 50px;
482
+ padding: 0 20px;
483
+ }
484
+
485
+ }
486
+ #popup-content {
487
+ position: absolute;
488
+ top: 50px;
489
+ bottom: 50px;
490
+ left: 0;
491
+ right: 0;
492
+ overflow: auto;
493
+ #popup-content-inner {
494
+ margin: 20px;
495
+ }
496
+ .learn-press-course-results-progress{
497
+ margin: 20px;
498
+
499
+ }
500
+ }
501
+ #popup-footer {
502
+ position: absolute;
503
+ bottom: 0;
504
+ left: 0;
505
+ right: 0;
506
+ height: 50px;
507
+ background: #F5F5F5;
508
+ border-top: 1px solid #DDD;
509
+ .footer-control {
510
+ display: block;
511
+ height: 50px;
512
+ line-height: 50px;
513
+ padding: 0 20px;
514
+ background: #FFF;
515
+ &.prev-item {
516
+ float: left;
517
+ }
518
+ &.next-item {
519
+ float: right;
520
+ }
521
+ }
522
+ }
523
+ }
524
+ }
525
+
526
+ /* COURSE QUIZ */
527
+ .single-quiz {
528
+ .quiz-questions-list {
529
+ list-style: none;
530
+ padding: 0;
531
+ }
532
+ .quiz-intro {
533
+ list-style: none;
534
+ padding: 0;
535
+ }
536
+ }
assets/css/owlcarousel/owl.carousel.css ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Core Owl Carousel CSS File
3
+ * v1.3.3
4
+ */
5
+
6
+ /* clearfix */
7
+ .owl-carousel .owl-wrapper:after {
8
+ content: ".";
9
+ display: block;
10
+ clear: both;
11
+ visibility: hidden;
12
+ line-height: 0;
13
+ height: 0;
14
+ }
15
+ /* display none until init */
16
+ .owl-carousel{
17
+ display: none;
18
+ position: relative;
19
+ width: 100%;
20
+ -ms-touch-action: pan-y;
21
+ }
22
+ .owl-carousel .owl-wrapper{
23
+ display: none;
24
+ position: relative;
25
+ -webkit-transform: translate3d(0px, 0px, 0px);
26
+ }
27
+ .owl-carousel .owl-wrapper-outer{
28
+ overflow: hidden;
29
+ position: relative;
30
+ width: 100%;
31
+ }
32
+ .owl-carousel .owl-wrapper-outer.autoHeight{
33
+ -webkit-transition: height 500ms ease-in-out;
34
+ -moz-transition: height 500ms ease-in-out;
35
+ -ms-transition: height 500ms ease-in-out;
36
+ -o-transition: height 500ms ease-in-out;
37
+ transition: height 500ms ease-in-out;
38
+ }
39
+
40
+ .owl-carousel .owl-item{
41
+ float: left;
42
+ }
43
+ .owl-controls .owl-page,
44
+ .owl-controls .owl-buttons div{
45
+ cursor: pointer;
46
+ }
47
+ .owl-controls {
48
+ -webkit-user-select: none;
49
+ -khtml-user-select: none;
50
+ -moz-user-select: none;
51
+ -ms-user-select: none;
52
+ user-select: none;
53
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
54
+ }
55
+
56
+ /* mouse grab icon */
57
+ .grabbing {
58
+ cursor:url(grabbing.png) 8 8, move;
59
+ }
60
+
61
+ /* fix */
62
+ .owl-carousel .owl-wrapper,
63
+ .owl-carousel .owl-item{
64
+ -webkit-backface-visibility: hidden;
65
+ -moz-backface-visibility: hidden;
66
+ -ms-backface-visibility: hidden;
67
+ -webkit-transform: translate3d(0,0,0);
68
+ -moz-transform: translate3d(0,0,0);
69
+ -ms-transform: translate3d(0,0,0);
70
+ }
71
+
assets/css/shortcode-style/learnpress-archive-course.css DELETED
@@ -1,26 +0,0 @@
1
- a .archive-course:hover {
2
- cursor: pointer;
3
- }
4
-
5
- .archive-course {
6
- border: 1px solid black;
7
- display: table;
8
- margin-bottom: 10px;
9
- width: 100%;
10
- }
11
-
12
- .course-cover {
13
- display: table-cell;
14
- height: 100px;
15
- width: 100px;
16
- }
17
-
18
- .course-detail {
19
- display: table-cell;
20
- vertical-align: top;
21
- padding-left: 10px;
22
- }
23
-
24
- .course-title {
25
- font-weight: bold;
26
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/eduma/custom-script.js ADDED
@@ -0,0 +1,309 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Custom functions to improves popup that display content of course's item
3
+ * Combine this functions to main file when release theme
4
+ */
5
+ ;(function ($) {
6
+ "use strict";
7
+ var $doc = $(document),
8
+ $body = null,
9
+ $popup = null,
10
+ $popupOverlay = null,
11
+ resizeTimer = null,
12
+ navItems = null,
13
+ thim_scroll = false;
14
+
15
+ function _init() {
16
+ navItems = LP.Views.Course.model.items;
17
+ $().extend(navItems, {
18
+ getNext: function () {
19
+ var current = this.getCurrent(),
20
+ next = false,
21
+ _at = false;
22
+ for (var i = 0; i < this.length; i++) {
23
+ _at = this.at(i);
24
+ if (_at && (_at.get('current') == true)) {
25
+ for (var j = i + 1; j < this.length; j++) {
26
+ _at = this.at(j);
27
+ if (_at && _at.get('viewable')) {
28
+ next = this.at(j);
29
+ break;
30
+ }
31
+ }
32
+ }
33
+ if (next) break;
34
+ }
35
+ return next;
36
+ },
37
+ getPrev: function () {
38
+ var current = this.getCurrent(),
39
+ prev = false,
40
+ _at = false;
41
+ for (var n = this.length, i = n - 1; i >= 0; i--) {
42
+ _at = this.at(i);
43
+ if (_at && (_at.get('current') == true)) {
44
+ for (var j = i - 1; j >= 0; j--) {
45
+ _at = this.at(j);
46
+ if (_at && _at.get('viewable')) {
47
+ prev = this.at(j);
48
+ break;
49
+ }
50
+ }
51
+ }
52
+ if (prev) break;
53
+ }
54
+ return prev;
55
+ }
56
+ });
57
+
58
+ if (navItems.getCurrent()) {
59
+ $('.course-content-item').css({
60
+ visibility: 'visible'
61
+ });
62
+ showPopup();
63
+ $('.mfp-content').prepend($('.popup-title'));
64
+ $('.mfp-wrap').scroll(function () {
65
+ $(this).find('.popup-title').css('top', 'inherit').attr('x', Math.random());
66
+ });
67
+ ///$('.popup-title').css('top', 32)
68
+ }
69
+
70
+ }
71
+
72
+ function showPopup($content) {
73
+ $.magnificPopup.open({
74
+ closeOnBgClick: false,
75
+ preloader : false,
76
+ showCloseBtn : false,
77
+ items : {
78
+ src : $content || $('.popup-content'),
79
+ type: 'inline'
80
+ },
81
+ mainClass : 'mfp-with-fade',
82
+ removalDelay : 300,
83
+ callbacks : {
84
+ open : function () {
85
+ thim_scroll = false;
86
+ if ($('.thim-course-menu-landing').length > 0) {
87
+ $('.thim-course-menu-landing').addClass('thim-hidden');
88
+ }
89
+
90
+ //Cancel event close when loading
91
+ $.magnificPopup.instance.close = function () {
92
+ if ($('.thim-loading-container').length > 0) {
93
+ return;
94
+ }
95
+ thim_scroll = true;
96
+ $('.thim-course-menu-landing.thim-hidden').removeClass('thim-hidden');
97
+ $.magnificPopup.proto.close.call(this);
98
+ $('.course-content').removeClass('rendered');
99
+ };
100
+ this.container.css('padding-top', 0).parent().css({
101
+ top : $('html').css('margin-top'),
102
+ height: 'auto',
103
+ bottom: 0
104
+ })
105
+
106
+ },
107
+ resize: function () {
108
+ var $courseContent = $('.course-content'),
109
+ $title = $courseContent.find('.popup-title'),
110
+ position = $('.mfp-content').position() || {top: 0, left: 0},
111
+ htmlPadding = parseInt($('html').css('margin-top'));
112
+ /*$title.css({
113
+ 'left' : position.left,
114
+ 'top' : position.top + htmlPadding,
115
+ 'width': $courseContent.innerWidth()
116
+ });*/
117
+ }
118
+ }
119
+ });
120
+ }
121
+
122
+ $doc.ready(_init);
123
+
124
+ return;
125
+
126
+ function _ready() {
127
+ $body = $(document.body);
128
+ $popup = $('.course-content-item.popup-content');
129
+ $popupOverlay = $('.popup-overlay');
130
+
131
+
132
+ $(window).bind('resize.thim_resize_popup', function () {
133
+ resizeTimer && clearTimeout(resizeTimer);
134
+ resizeTimer = setTimeout(_resize, 150);
135
+ });
136
+
137
+ LP.Views.Course.setElement($body);
138
+
139
+ var navItems = LP.Views.Course.model.items;
140
+ $().extend(navItems, {
141
+ getNext: function () {
142
+ var current = this.getCurrent(),
143
+ next = false,
144
+ _at = false;
145
+ for (var i = 0; i < this.length; i++) {
146
+ _at = this.at(i);
147
+ if (_at && (_at.get('current') == true)) {
148
+ for (var j = i + 1; j < this.length; j++) {
149
+ _at = this.at(j);
150
+ if (_at && _at.get('viewable')) {
151
+ next = this.at(j);
152
+ break;
153
+ }
154
+ }
155
+ }
156
+ if (next) break;
157
+ }
158
+ return next;
159
+ },
160
+ getPrev: function () {
161
+ var current = this.getCurrent(),
162
+ prev = false,
163
+ _at = false;
164
+ for (var n = this.length, i = n - 1; i >= 0; i--) {
165
+ _at = this.at(i);
166
+ if (_at && (_at.get('current') == true)) {
167
+ for (var j = i - 1; j >= 0; j--) {
168
+ _at = this.at(j);
169
+ if (_at && _at.get('viewable')) {
170
+ prev = this.at(j);
171
+ break;
172
+ }
173
+ }
174
+ }
175
+ if (prev) break;
176
+ }
177
+ return prev;
178
+ }
179
+ });
180
+
181
+ $doc
182
+ //.unbind('learn_press_item_loaded')
183
+ .unbind('learn_press_item_current_changed')
184
+ .on('learn_press_item_current_changed', function () {
185
+ if (!$popup.is(':visible')) {
186
+ $popupOverlay.fadeIn();
187
+ $popup.show();
188
+ }
189
+ $popup.addClass('ajax-loading');
190
+
191
+ }).on('learn_press_item_loaded', function (e, data) {
192
+ var newHeading = $popup.find('#learn-press-content-item .popup-title'),
193
+ oldHeading = $popup.find('.popup-title').not(newHeading),
194
+ newNav = $popup.find('.yyyyy .course-item-nav'),
195
+ oldNav = $popup.find('.course-item-nav').not(newNav);
196
+ if (newHeading.length == 0) {
197
+ newHeading = oldHeading;
198
+ }
199
+ if (data.item) {
200
+ newHeading.find('.index').remove();
201
+ newHeading.find('.title').html(data.item.get('title'));
202
+ newHeading.prepend(data.item.get('el').find('.index').clone());
203
+ console.log("xxx", data.item.get('title'));
204
+
205
+ }
206
+ if (oldHeading.length) {
207
+ oldHeading.replaceWith(newHeading);
208
+ } else {
209
+ $popup.find('.xxxxx').prepend(newHeading);
210
+ }
211
+ var prev = navItems.getPrev(),
212
+ next = navItems.getNext();
213
+ if (next) {
214
+ oldNav.find('.course-item-next').show().find('a').attr({
215
+ 'data-id': next.get('id'),
216
+ 'href' : next.get('url')
217
+ }).html(next.get('title'));
218
+ } else {
219
+ oldNav.find('.course-item-next').hide();
220
+ }
221
+ if (prev) {
222
+ oldNav.find('.course-item-prev').show().find('a').attr({
223
+ 'data-id': prev.get('id'),
224
+ 'href' : prev.get('url')
225
+ }).html(prev.get('title'));
226
+ } else {
227
+ oldNav.find('.course-item-prev').hide();
228
+ }
229
+ $popup.removeClass('ajax-loading');
230
+ $(window).trigger('resize.thim_resize_popup');
231
+ }).on('learn_press_item_redirect_url', function (e, data) {
232
+ var item = data.item,
233
+ _callback = function (item) {
234
+ var iframe = $('<iframe />', {id: 'thim-popup-quiz', src: item.get('url')});
235
+ $('#learn-press-content-item').html(iframe)
236
+ iframe.load(function () {
237
+ $(this).css({
238
+ width : '100%',
239
+ height: $(this).contents().find('body').height()
240
+ })
241
+ $(window).trigger('resize.thim_resize_popup')
242
+ });
243
+ LP.setUrl(LP.Views.Course.model.get('url'));
244
+ }
245
+ if (item.get('type') == 'lp_quiz') {
246
+ _callback(item);
247
+ $doc.bind('learn_press_set_course_url.quiz_url', function (e, a) {
248
+ $doc.unbind('learn_press_set_course_url.quiz_url');
249
+ return false;
250
+ })
251
+ return false;
252
+ }
253
+ return data;
254
+ }
255
+ ).on('click', '.mfp-close', function (e) {
256
+ e.preventDefault();
257
+ $('.popup-content,.popup-overlay').fadeOut();
258
+ var cur = navItems.getCurrent();
259
+ if (cur) {
260
+ cur.set('current', false);
261
+ LP.setUrl(LP.Views.Course.model.get('url'))
262
+ }
263
+ });
264
+
265
+ $body.prepend($popup).prepend($popupOverlay);
266
+ $popup.css({visibility: 'visible', display: 'none'});
267
+ var cur = navItems.getCurrent();
268
+ if (cur) {
269
+ $doc.triggerHandler('learn_press_item_current_changed');
270
+ $doc.triggerHandler('learn_press_item_loaded', {html: cur.get('content'), item: cur});
271
+ }
272
+ }
273
+
274
+ function _resize() {
275
+ var $el = $popup.find('.yyyyy'),
276
+ $xx = $popup.find('.xxxxx'),
277
+ popH = 0,
278
+ winH = 0,
279
+ dx = 0,
280
+ $ifr = $popup.find('#thim-popup-quiz');
281
+ winH = $(window).height();
282
+ if ($ifr.length) {
283
+ var ifrH = $ifr.contents().find('body').outerHeight(),
284
+ contentH = winH - 240;
285
+ if (ifrH > contentH) {
286
+ //$ifr.height(contentH);
287
+ } else {
288
+ contentH = ifrH - 80;
289
+ }
290
+ popH = contentH + 240;// including header
291
+ dx = (dx = (winH - popH) / 2) >= 10 ? dx : 10
292
+
293
+ } else {
294
+ popH = $el.find('#learn-press-content-item').outerHeight() + 240;// including header
295
+ dx = (dx = (winH - popH) / 2) >= 10 ? dx : 10
296
+ }
297
+ $popup.stop().animate({
298
+ top : dx,
299
+ bottom: dx
300
+ }, 'fast', function () {
301
+ //$xx.height($el.height()+180)
302
+ });
303
+ console.log('resize:' + dx)
304
+
305
+ }
306
+
307
+ $doc.ready(_ready);
308
+ })
309
+ (jQuery);
assets/eduma/custom-style.css ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ .mfp-content .popup-title{
2
+ top: inherit;
3
+ left:inherit;
4
+ }
5
+ .learn-press .popup-content #learn-press-course-lesson{
6
+ display: block;
7
+ }
assets/fonts/Sumana-Regular.ttf DELETED
Binary file
assets/fonts/icomoon.eot ADDED
Binary file
assets/fonts/icomoon.svg ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>Generated by IcoMoon</metadata>
5
+ <defs>
6
+ <font id="icomoon" horiz-adv-x="1024">
7
+ <font-face units-per-em="1024" ascent="960" descent="-64" />
8
+ <missing-glyph horiz-adv-x="1024" />
9
+ <glyph unicode="&#x20;" horiz-adv-x="512" d="" />
10
+ <glyph unicode="&#xe926;" glyph-name="file-text2" d="M917.806 730.924c-22.212 30.292-53.174 65.7-87.178 99.704s-69.412 64.964-99.704 87.178c-51.574 37.82-76.592 42.194-90.924 42.194h-496c-44.112 0-80-35.888-80-80v-864c0-44.112 35.888-80 80-80h736c44.112 0 80 35.888 80 80v624c0 14.332-4.372 39.35-42.194 90.924zM785.374 785.374c30.7-30.7 54.8-58.398 72.58-81.374h-153.954v153.946c22.984-17.78 50.678-41.878 81.374-72.572zM896 16c0-8.672-7.328-16-16-16h-736c-8.672 0-16 7.328-16 16v864c0 8.672 7.328 16 16 16 0 0 495.956 0.002 496 0v-224c0-17.672 14.326-32 32-32h224v-624zM736 128h-448c-17.672 0-32 14.326-32 32s14.328 32 32 32h448c17.674 0 32-14.326 32-32s-14.326-32-32-32zM736 256h-448c-17.672 0-32 14.326-32 32s14.328 32 32 32h448c17.674 0 32-14.326 32-32s-14.326-32-32-32zM736 384h-448c-17.672 0-32 14.326-32 32s14.328 32 32 32h448c17.674 0 32-14.326 32-32s-14.326-32-32-32z" />
11
+ <glyph unicode="&#xe927;" glyph-name="file-picture" d="M832 64h-640v128l192 320 263-320 185 128v-256zM832 480c0-53.020-42.98-96-96-96-53.022 0-96 42.98-96 96s42.978 96 96 96c53.020 0 96-42.98 96-96zM917.806 730.924c-22.212 30.292-53.174 65.7-87.178 99.704s-69.412 64.964-99.704 87.178c-51.574 37.82-76.592 42.194-90.924 42.194h-496c-44.112 0-80-35.888-80-80v-864c0-44.112 35.888-80 80-80h736c44.112 0 80 35.888 80 80v624c0 14.332-4.372 39.35-42.194 90.924zM785.374 785.374c30.7-30.7 54.8-58.398 72.58-81.374h-153.954v153.946c22.984-17.78 50.678-41.878 81.374-72.572zM896 16c0-8.672-7.328-16-16-16h-736c-8.672 0-16 7.328-16 16v864c0 8.672 7.328 16 16 16 0 0 495.956 0.002 496 0v-224c0-17.672 14.326-32 32-32h224v-624z" />
12
+ <glyph unicode="&#xe928;" glyph-name="file-music" d="M917.806 730.924c-22.21 30.292-53.174 65.7-87.178 99.704s-69.412 64.964-99.704 87.178c-51.574 37.82-76.592 42.194-90.924 42.194h-496c-44.112 0-80-35.888-80-80v-864c0-44.112 35.886-80 80-80h736c44.112 0 80 35.888 80 80v624c0 14.332-4.372 39.35-42.194 90.924v0zM785.374 785.374c30.7-30.7 54.8-58.398 72.58-81.374h-153.954v153.946c22.982-17.78 50.678-41.878 81.374-72.572v0zM896 16c0-8.672-7.328-16-16-16h-736c-8.672 0-16 7.328-16 16v864c0 8.672 7.328 16 16 16 0 0 495.956 0.002 496 0v-224c0-17.672 14.324-32 32-32h224v-624zM756.288 568.748c-7.414 6.080-17.164 8.514-26.562 6.632l-320-64c-14.958-2.994-25.726-16.126-25.726-31.38v-236.876c-18.832 8.174-40.678 12.876-64 12.876-70.692 0-128-42.98-128-96s57.308-96 128-96 128 42.98 128 96v229.766l256 51.202v-133.842c-18.832 8.174-40.678 12.876-64 12.876-70.692 0-128-42.98-128-96s57.308-96 128-96 128 42.98 128 96v319.998c0 9.586-4.298 18.668-11.712 24.748z" />
13
+ <glyph unicode="&#xe92a;" glyph-name="file-video" d="M917.806 730.924c-22.208 30.292-53.174 65.7-87.178 99.704s-69.412 64.964-99.704 87.178c-51.574 37.82-76.594 42.194-90.924 42.194h-496c-44.112 0-80-35.888-80-80v-864c0-44.112 35.882-80 80-80h736c44.112 0 80 35.888 80 80v624c0 14.332-4.372 39.35-42.194 90.924v0 0zM785.374 785.374c30.7-30.7 54.8-58.398 72.58-81.374h-153.954v153.946c22.98-17.78 50.678-41.878 81.374-72.572v0 0zM896 16c0-8.672-7.328-16-16-16h-736c-8.672 0-16 7.328-16 16v864c0 8.672 7.328 16 16 16 0 0 495.956 0.002 496 0v-224c0-17.672 14.32-32 32-32h224v-624zM256 448h320v-320h-320v320zM576 320l192 128v-320l-192 128z" />
14
+ <glyph unicode="&#xe92b;" glyph-name="file-zip" d="M917.806 730.924c-22.208 30.292-53.174 65.7-87.178 99.704s-69.412 64.964-99.704 87.178c-51.574 37.82-76.592 42.194-90.924 42.194h-496c-44.112 0-80-35.888-80-80v-864c0-44.112 35.884-80 80-80h736c44.112 0 80 35.888 80 80v624c0 14.332-4.372 39.35-42.194 90.924v0 0zM785.374 785.374c30.7-30.7 54.8-58.398 72.58-81.374h-153.954v153.946c22.98-17.78 50.678-41.878 81.374-72.572v0 0zM896 16c0-8.672-7.328-16-16-16h-736c-8.672 0-16 7.328-16 16v864c0 8.672 7.328 16 16 16 0 0 495.956 0.002 496 0v-224c0-17.672 14.322-32 32-32h224v-624zM256 896h128v-64h-128v64zM384 832h128v-64h-128v64zM256 768h128v-64h-128v64zM384 704h128v-64h-128v64zM256 640h128v-64h-128v64zM384 576h128v-64h-128v64zM256 512h128v-64h-128v64zM384 448h128v-64h-128v64zM256 112c0-26.4 21.6-48 48-48h160c26.4 0 48 21.6 48 48v160c0 26.4-21.6 48-48 48h-80v64h-128v-272zM448 192v-64h-128v64h128z" />
15
+ <glyph unicode="&#xe92d;" glyph-name="paste" d="M704 832h-128v64c0 35.2-28.8 64-64 64h-128c-35.204 0-64-28.8-64-64v-64h-128v-128h512v128zM512 832h-128v63.886c0.034 0.038 0.072 0.078 0.114 0.114h127.768c0.042-0.036 0.082-0.076 0.118-0.114v-63.886zM832 640v160c0 17.6-14.4 32-32 32h-64v-64h32v-128h-192l-192-192v-256h-256v576h32v64h-64c-17.602 0-32-14.4-32-32v-640c0-17.6 14.398-32 32-32h288v-192h640v704h-192zM576 549.49v-101.49h-101.49l101.49 101.49zM960 0h-512v384h192v192h320v-576z" />
16
+ <glyph unicode="&#xe950;" glyph-name="alarm" d="M512 832c-247.424 0-448-200.576-448-448s200.576-448 448-448 448 200.576 448 448-200.576 448-448 448zM512 24c-198.824 0-360 161.178-360 360 0 198.824 161.176 360 360 360 198.822 0 360-161.176 360-360 0-198.822-161.178-360-360-360zM934.784 672.826c16.042 28.052 25.216 60.542 25.216 95.174 0 106.040-85.96 192-192 192-61.818 0-116.802-29.222-151.92-74.596 131.884-27.236 245.206-105.198 318.704-212.578v0zM407.92 885.404c-35.116 45.374-90.102 74.596-151.92 74.596-106.040 0-192-85.96-192-192 0-34.632 9.174-67.122 25.216-95.174 73.5 107.38 186.822 185.342 318.704 212.578zM512 384v256h-64v-320h256v64z" />
17
+ <glyph unicode="&#xea0f;" glyph-name="cross" d="M1014.662 137.34c-0.004 0.004-0.008 0.008-0.012 0.010l-310.644 310.65 310.644 310.65c0.004 0.004 0.008 0.006 0.012 0.010 3.344 3.346 5.762 7.254 7.312 11.416 4.246 11.376 1.824 24.682-7.324 33.83l-146.746 146.746c-9.148 9.146-22.45 11.566-33.828 7.32-4.16-1.55-8.070-3.968-11.418-7.31 0-0.004-0.004-0.006-0.008-0.010l-310.648-310.652-310.648 310.65c-0.004 0.004-0.006 0.006-0.010 0.010-3.346 3.342-7.254 5.76-11.414 7.31-11.38 4.248-24.682 1.826-33.83-7.32l-146.748-146.748c-9.148-9.148-11.568-22.452-7.322-33.828 1.552-4.16 3.97-8.072 7.312-11.416 0.004-0.002 0.006-0.006 0.010-0.010l310.65-310.648-310.65-310.652c-0.002-0.004-0.006-0.006-0.008-0.010-3.342-3.346-5.76-7.254-7.314-11.414-4.248-11.376-1.826-24.682 7.322-33.83l146.748-146.746c9.15-9.148 22.452-11.568 33.83-7.322 4.16 1.552 8.070 3.97 11.416 7.312 0.002 0.004 0.006 0.006 0.010 0.010l310.648 310.65 310.648-310.65c0.004-0.002 0.008-0.006 0.012-0.008 3.348-3.344 7.254-5.762 11.414-7.314 11.378-4.246 24.684-1.826 33.828 7.322l146.746 146.748c9.148 9.148 11.57 22.454 7.324 33.83-1.552 4.16-3.97 8.068-7.314 11.414z" />
18
+ <glyph unicode="&#xea10;" glyph-name="checkmark" d="M864 832l-480-480-224 224-160-160 384-384 640 640z" />
19
+ </font></defs></svg>
assets/fonts/icomoon.ttf ADDED
Binary file
assets/fonts/icomoon.woff ADDED
Binary file
assets/fonts/icomoon.zip ADDED
Binary file
assets/fonts/icomoon/Read Me.txt ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ Open *demo.html* to see a list of all the glyphs in your font along with their codes/ligatures.
2
+
3
+ To use the generated font in desktop programs, you can install the TTF font. In order to copy the character associated with each icon, refer to the text box at the bottom right corner of each glyph in demo.html. The character inside this text box may be invisible; but it can still be copied. See this guide for more info: https://icomoon.io/#docs/local-fonts
4
+
5
+ You won't need any of the files located under the *demo-files* directory when including the generated font in your own projects.
6
+
7
+ You can import *selection.json* back to the IcoMoon app using the *Import Icons* button (or via Main Menu → Manage Projects) to retrieve your icon selection.
assets/fonts/icomoon/demo-files/demo.css ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ body {
2
+ padding: 0;
3
+ margin: 0;
4
+ font-family: sans-serif;
5
+ font-size: 1em;
6
+ line-height: 1.5;
7
+ color: #555;
8
+ background: #fff;
9
+ }
10
+ h1 {
11
+ font-size: 1.5em;
12
+ font-weight: normal;
13
+ }
14
+ small {
15
+ font-size: .66666667em;
16
+ }
17
+ a {
18
+ color: #e74c3c;
19
+ text-decoration: none;
20
+ }
21
+ a:hover, a:focus {
22
+ box-shadow: 0 1px #e74c3c;
23
+ }
24
+ .bshadow0, input {
25
+ box-shadow: inset 0 -2px #e7e7e7;
26
+ }
27
+ input:hover {
28
+ box-shadow: inset 0 -2px #ccc;
29
+ }
30
+ input, fieldset {
31
+ font-family: sans-serif;
32
+ font-size: 1em;
33
+ margin: 0;
34
+ padding: 0;
35
+ border: 0;
36
+ }
37
+ input {
38
+ color: inherit;
39
+ line-height: 1.5;
40
+ height: 1.5em;
41
+ padding: .25em 0;
42
+ }
43
+ input:focus {
44
+ outline: none;
45
+ box-shadow: inset 0 -2px #449fdb;
46
+ }
47
+ .glyph {
48
+ font-size: 16px;
49
+ width: 15em;
50
+ padding-bottom: 1em;
51
+ margin-right: 4em;
52
+ margin-bottom: 1em;
53
+ float: left;
54
+ overflow: hidden;
55
+ }
56
+ .liga {
57
+ width: 80%;
58
+ width: calc(100% - 2.5em);
59
+ }
60
+ .talign-right {
61
+ text-align: right;
62
+ }
63
+ .talign-center {
64
+ text-align: center;
65
+ }
66
+ .bgc1 {
67
+ background: #f1f1f1;
68
+ }
69
+ .fgc1 {
70
+ color: #999;
71
+ }
72
+ .fgc0 {
73
+ color: #000;
74
+ }
75
+ p {
76
+ margin-top: 1em;
77
+ margin-bottom: 1em;
78
+ }
79
+ .mvm {
80
+ margin-top: .75em;
81
+ margin-bottom: .75em;
82
+ }
83
+ .mtn {
84
+ margin-top: 0;
85
+ }
86
+ .mtl, .mal {
87
+ margin-top: 1.5em;
88
+ }
89
+ .mbl, .mal {
90
+ margin-bottom: 1.5em;
91
+ }
92
+ .mal, .mhl {
93
+ margin-left: 1.5em;
94
+ margin-right: 1.5em;
95
+ }
96
+ .mhmm {
97
+ margin-left: 1em;
98
+ margin-right: 1em;
99
+ }
100
+ .mls {
101
+ margin-left: .25em;
102
+ }
103
+ .ptl {
104
+ padding-top: 1.5em;
105
+ }
106
+ .pbs, .pvs {
107
+ padding-bottom: .25em;
108
+ }
109
+ .pvs, .pts {
110
+ padding-top: .25em;
111
+ }
112
+ .unit {
113
+ float: left;
114
+ }
115
+ .unitRight {
116
+ float: right;
117
+ }
118
+ .size1of2 {
119
+ width: 50%;
120
+ }
121
+ .size1of1 {
122
+ width: 100%;
123
+ }
124
+ .clearfix:before, .clearfix:after {
125
+ content: " ";
126
+ display: table;
127
+ }
128
+ .clearfix:after {
129
+ clear: both;
130
+ }
131
+ .hidden-true {
132
+ display: none;
133
+ }
134
+ .textbox0 {
135
+ width: 3em;
136
+ background: #f1f1f1;
137
+ padding: .25em .5em;
138
+ line-height: 1.5;
139
+ height: 1.5em;
140
+ }
141
+ #testDrive {
142
+ display: block;
143
+ padding-top: 24px;
144
+ line-height: 1.5;
145
+ }
146
+ .fs0 {
147
+ font-size: 16px;
148
+ }
149
+ .fs1 {
150
+ font-size: 32px;
151
+ }
152
+
assets/fonts/icomoon/demo-files/demo.js ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if (!('boxShadow' in document.body.style)) {
2
+ document.body.setAttribute('class', 'noBoxShadow');
3
+ }
4
+
5
+ document.body.addEventListener("click", function(e) {
6
+ var target = e.target;
7
+ if (target.tagName === "INPUT" &&
8
+ target.getAttribute('class').indexOf('liga') === -1) {
9
+ target.select();
10
+ }
11
+ });
12
+
13
+ (function() {
14
+ var fontSize = document.getElementById('fontSize'),
15
+ testDrive = document.getElementById('testDrive'),
16
+ testText = document.getElementById('testText');
17
+ function updateTest() {
18
+ testDrive.innerHTML = testText.value || String.fromCharCode(160);
19
+ if (window.icomoonLiga) {
20
+ window.icomoonLiga(testDrive);
21
+ }
22
+ }
23
+ function updateSize() {
24
+ testDrive.style.fontSize = fontSize.value + 'px';
25
+ }
26
+ fontSize.addEventListener('change', updateSize, false);
27
+ testText.addEventListener('input', updateTest, false);
28
+ testText.addEventListener('change', updateTest, false);
29
+ updateSize();
30
+ }());
assets/fonts/icomoon/demo-files/demo.min.js ADDED
@@ -0,0 +1 @@
 
1
+ if(!("boxShadow" in document.body.style)){document.body.setAttribute("class","noBoxShadow")}document.body.addEventListener("click",function(b){var a=b.target;if(a.tagName==="INPUT"&&a.getAttribute("class").indexOf("liga")===-1){a.select()}});(function(){var e=document.getElementById("fontSize"),d=document.getElementById("testDrive"),c=document.getElementById("testText");function b(){d.innerHTML=c.value||String.fromCharCode(160);if(window.icomoonLiga){window.icomoonLiga(d)}}function a(){d.style.fontSize=e.value+"px"}e.addEventListener("change",a,false);c.addEventListener("input",b,false);c.addEventListener("change",b,false);a()}());
assets/fonts/icomoon/demo.html ADDED
@@ -0,0 +1,183 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>IcoMoon Demo</title>
6
+ <meta name="description" content="An Icon Font Generated By IcoMoon.io">
7
+ <meta name="viewport" content="width=device-width, initial-scale=1">
8
+ <link rel="stylesheet" href="demo-files/demo.css">
9
+ <link rel="stylesheet" href="style.css"></head>
10
+ <body>
11
+ <div class="bgc1 clearfix">
12
+ <h1 class="mhmm mvm"><span class="fgc1">Font Name:</span> icomoon <small class="fgc1">(Glyphs:&nbsp;9)</small></h1>
13
+ </div>
14
+ <div class="clearfix mhl ptl">
15
+ <h1 class="mvm mtn fgc1">Grid Size: 16</h1>
16
+ <div class="glyph fs1">
17
+ <div class="clearfix bshadow0 pbs">
18
+ <span class="icon-file-text2">
19
+
20
+ </span>
21
+ <span class="mls"> icon-file-text2</span>
22
+ </div>
23
+ <fieldset class="fs0 size1of1 clearfix hidden-false">
24
+ <input type="text" readonly value="e926" class="unit size1of2" />
25
+ <input type="text" maxlength="1" readonly value="&#xe926;" class="unitRight size1of2 talign-right" />
26
+ </fieldset>
27
+ <div class="fs0 bshadow0 clearfix hidden-true">
28
+ <span class="unit pvs fgc1">liga: </span>
29
+ <input type="text" readonly value="file-text2, file4" class="liga unitRight" />
30
+ </div>
31
+ </div>
32
+ <div class="glyph fs1">
33
+ <div class="clearfix bshadow0 pbs">
34
+ <span class="icon-file-picture">
35
+
36
+ </span>
37
+ <span class="mls"> icon-file-picture</span>
38
+ </div>
39
+ <fieldset class="fs0 size1of1 clearfix hidden-false">
40
+ <input type="text" readonly value="e927" class="unit size1of2" />
41
+ <input type="text" maxlength="1" readonly value="&#xe927;" class="unitRight size1of2 talign-right" />
42
+ </fieldset>
43
+ <div class="fs0 bshadow0 clearfix hidden-true">
44
+ <span class="unit pvs fgc1">liga: </span>
45
+ <input type="text" readonly value="file-picture, file5" class="liga unitRight" />
46
+ </div>
47
+ </div>
48
+ <div class="glyph fs1">
49
+ <div class="clearfix bshadow0 pbs">
50
+ <span class="icon-file-music">
51
+
52
+ </span>
53
+ <span class="mls"> icon-file-music</span>
54
+ </div>
55
+ <fieldset class="fs0 size1of1 clearfix hidden-false">
56
+ <input type="text" readonly value="e928" class="unit size1of2" />
57
+ <input type="text" maxlength="1" readonly value="&#xe928;" class="unitRight size1of2 talign-right" />
58
+ </fieldset>
59
+ <div class="fs0 bshadow0 clearfix hidden-true">
60
+ <span class="unit pvs fgc1">liga: </span>
61
+ <input type="text" readonly value="file-music, file6" class="liga unitRight" />
62
+ </div>
63
+ </div>
64
+ <div class="glyph fs1">
65
+ <div class="clearfix bshadow0 pbs">
66
+ <span class="icon-file-video">
67
+
68
+ </span>
69
+ <span class="mls"> icon-file-video</span>
70
+ </div>
71
+ <fieldset class="fs0 size1of1 clearfix hidden-false">
72
+ <input type="text" readonly value="e92a" class="unit size1of2" />
73
+ <input type="text" maxlength="1" readonly value="&#xe92a;" class="unitRight size1of2 talign-right" />
74
+ </fieldset>
75
+ <div class="fs0 bshadow0 clearfix hidden-true">
76
+ <span class="unit pvs fgc1">liga: </span>
77
+ <input type="text" readonly value="file-video, file8" class="liga unitRight" />
78
+ </div>
79
+ </div>
80
+ <div class="glyph fs1">
81
+ <div class="clearfix bshadow0 pbs">
82
+ <span class="icon-file-zip">
83
+
84
+ </span>
85
+ <span class="mls"> icon-file-zip</span>
86
+ </div>
87
+ <fieldset class="fs0 size1of1 clearfix hidden-false">
88
+ <input type="text" readonly value="e92b" class="unit size1of2" />
89
+ <input type="text" maxlength="1" readonly value="&#xe92b;" class="unitRight size1of2 talign-right" />
90
+ </fieldset>
91
+ <div class="fs0 bshadow0 clearfix hidden-true">
92
+ <span class="unit pvs fgc1">liga: </span>
93
+ <input type="text" readonly value="file-zip, file9" class="liga unitRight" />
94
+ </div>
95
+ </div>
96
+ <div class="glyph fs1">
97
+ <div class="clearfix bshadow0 pbs">
98
+ <span class="icon-paste">
99
+
100
+ </span>
101
+ <span class="mls"> icon-paste</span>
102
+ </div>
103
+ <fieldset class="fs0 size1of1 clearfix hidden-false">
104
+ <input type="text" readonly value="e92d" class="unit size1of2" />
105
+ <input type="text" maxlength="1" readonly value="&#xe92d;" class="unitRight size1of2 talign-right" />
106
+ </fieldset>
107
+ <div class="fs0 bshadow0 clearfix hidden-true">
108
+ <span class="unit pvs fgc1">liga: </span>
109
+ <input type="text" readonly value="paste, clipboard-file" class="liga unitRight" />
110
+ </div>
111
+ </div>
112
+ <div class="glyph fs1">
113
+ <div class="clearfix bshadow0 pbs">
114
+ <span class="icon-alarm">
115
+
116
+ </span>
117
+ <span class="mls"> icon-alarm</span>
118
+ </div>
119
+ <fieldset class="fs0 size1of1 clearfix hidden-false">
120
+ <input type="text" readonly value="e950" class="unit size1of2" />
121
+ <input type="text" maxlength="1" readonly value="&#xe950;" class="unitRight size1of2 talign-right" />
122
+ </fieldset>
123
+ <div class="fs0 bshadow0 clearfix hidden-true">
124
+ <span class="unit pvs fgc1">liga: </span>
125
+ <input type="text" readonly value="alarm, time4" class="liga unitRight" />
126
+ </div>
127
+ </div>
128
+ <div class="glyph fs1">
129
+ <div class="clearfix bshadow0 pbs">
130
+ <span class="icon-cross">
131
+
132
+ </span>
133
+ <span class="mls"> icon-cross</span>
134
+ </div>
135
+ <fieldset class="fs0 size1of1 clearfix hidden-false">
136
+ <input type="text" readonly value="ea0f" class="unit size1of2" />
137
+ <input type="text" maxlength="1" readonly value="&#xea0f;" class="unitRight size1of2 talign-right" />
138
+ </fieldset>
139
+ <div class="fs0 bshadow0 clearfix hidden-true">
140
+ <span class="unit pvs fgc1">liga: </span>
141
+ <input type="text" readonly value="cross, cancel" class="liga unitRight" />
142
+ </div>
143
+ </div>
144
+ <div class="glyph fs1">
145
+ <div class="clearfix bshadow0 pbs">
146
+ <span class="icon-checkmark">
147
+
148
+ </span>
149
+ <span class="mls"> icon-checkmark</span>
150
+ </div>
151
+ <fieldset class="fs0 size1of1 clearfix hidden-false">
152
+ <input type="text" readonly value="ea10" class="unit size1of2" />
153
+ <input type="text" maxlength="1" readonly value="&#xea10;" class="unitRight size1of2 talign-right" />
154
+ </fieldset>
155
+ <div class="fs0 bshadow0 clearfix hidden-true">
156
+ <span class="unit pvs fgc1">liga: </span>
157
+ <input type="text" readonly value="checkmark, tick" class="liga unitRight" />
158
+ </div>
159
+ </div>
160
+ </div>
161
+
162
+ <!--[if gt IE 8]><!-->
163
+ <div class="mhl clearfix mbl">
164
+ <h1>Font Test Drive</h1>
165
+ <label>
166
+ Font Size: <input id="fontSize" type="number" class="textbox0 mbm"
167
+ min="8" value="48" />
168
+ px
169
+ </label>
170
+ <input id="testText" type="text" class="phl size1of1 mvl"
171
+ placeholder="Type some text to test..." value=""/>
172
+ </label>
173
+ <div id="testDrive" class="icon-">&nbsp;
174
+ </div>
175
+ </div>
176
+ <!--<![endif]-->
177
+ <div class="bgc1 clearfix">
178
+ <p class="mhl">Generated by <a href="https://icomoon.io/app">IcoMoon</a></p>
179
+ </div>
180
+
181
+ <script src="demo-files/demo.js"></script>
182
+ </body>
183
+ </html>
assets/fonts/icomoon/fonts/icomoon.eot ADDED
Binary file
assets/fonts/icomoon/fonts/icomoon.svg ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>Generated by IcoMoon</metadata>
5
+ <defs>
6
+ <font id="icomoon" horiz-adv-x="1024">
7
+ <font-face units-per-em="1024" ascent="960" descent="-64" />
8
+ <missing-glyph horiz-adv-x="1024" />
9
+ <glyph unicode="&#x20;" horiz-adv-x="512" d="" />
10
+ <glyph unicode="&#xe926;" glyph-name="file-text2" d="M917.806 730.924c-22.212 30.292-53.174 65.7-87.178 99.704s-69.412 64.964-99.704 87.178c-51.574 37.82-76.592 42.194-90.924 42.194h-496c-44.112 0-80-35.888-80-80v-864c0-44.112 35.888-80 80-80h736c44.112 0 80 35.888 80 80v624c0 14.332-4.372 39.35-42.194 90.924zM785.374 785.374c30.7-30.7 54.8-58.398 72.58-81.374h-153.954v153.946c22.984-17.78 50.678-41.878 81.374-72.572zM896 16c0-8.672-7.328-16-16-16h-736c-8.672 0-16 7.328-16 16v864c0 8.672 7.328 16 16 16 0 0 495.956 0.002 496 0v-224c0-17.672 14.326-32 32-32h224v-624zM736 128h-448c-17.672 0-32 14.326-32 32s14.328 32 32 32h448c17.674 0 32-14.326 32-32s-14.326-32-32-32zM736 256h-448c-17.672 0-32 14.326-32 32s14.328 32 32 32h448c17.674 0 32-14.326 32-32s-14.326-32-32-32zM736 384h-448c-17.672 0-32 14.326-32 32s14.328 32 32 32h448c17.674 0 32-14.326 32-32s-14.326-32-32-32z" />
11
+ <glyph unicode="&#xe927;" glyph-name="file-picture" d="M832 64h-640v128l192 320 263-320 185 128v-256zM832 480c0-53.020-42.98-96-96-96-53.022 0-96 42.98-96 96s42.978 96 96 96c53.020 0 96-42.98 96-96zM917.806 730.924c-22.212 30.292-53.174 65.7-87.178 99.704s-69.412 64.964-99.704 87.178c-51.574 37.82-76.592 42.194-90.924 42.194h-496c-44.112 0-80-35.888-80-80v-864c0-44.112 35.888-80 80-80h736c44.112 0 80 35.888 80 80v624c0 14.332-4.372 39.35-42.194 90.924zM785.374 785.374c30.7-30.7 54.8-58.398 72.58-81.374h-153.954v153.946c22.984-17.78 50.678-41.878 81.374-72.572zM896 16c0-8.672-7.328-16-16-16h-736c-8.672 0-16 7.328-16 16v864c0 8.672 7.328 16 16 16 0 0 495.956 0.002 496 0v-224c0-17.672 14.326-32 32-32h224v-624z" />
12
+ <glyph unicode="&#xe928;" glyph-name="file-music" d="M917.806 730.924c-22.21 30.292-53.174 65.7-87.178 99.704s-69.412 64.964-99.704 87.178c-51.574 37.82-76.592 42.194-90.924 42.194h-496c-44.112 0-80-35.888-80-80v-864c0-44.112 35.886-80 80-80h736c44.112 0 80 35.888 80 80v624c0 14.332-4.372 39.35-42.194 90.924v0zM785.374 785.374c30.7-30.7 54.8-58.398 72.58-81.374h-153.954v153.946c22.982-17.78 50.678-41.878 81.374-72.572v0zM896 16c0-8.672-7.328-16-16-16h-736c-8.672 0-16 7.328-16 16v864c0 8.672 7.328 16 16 16 0 0 495.956 0.002 496 0v-224c0-17.672 14.324-32 32-32h224v-624zM756.288 568.748c-7.414 6.080-17.164 8.514-26.562 6.632l-320-64c-14.958-2.994-25.726-16.126-25.726-31.38v-236.876c-18.832 8.174-40.678 12.876-64 12.876-70.692 0-128-42.98-128-96s57.308-96 128-96 128 42.98 128 96v229.766l256 51.202v-133.842c-18.832 8.174-40.678 12.876-64 12.876-70.692 0-128-42.98-128-96s57.308-96 128-96 128 42.98 128 96v319.998c0 9.586-4.298 18.668-11.712 24.748z" />
13
+ <glyph unicode="&#xe92a;" glyph-name="file-video" d="M917.806 730.924c-22.208 30.292-53.174 65.7-87.178 99.704s-69.412 64.964-99.704 87.178c-51.574 37.82-76.594 42.194-90.924 42.194h-496c-44.112 0-80-35.888-80-80v-864c0-44.112 35.882-80 80-80h736c44.112 0 80 35.888 80 80v624c0 14.332-4.372 39.35-42.194 90.924v0 0zM785.374 785.374c30.7-30.7 54.8-58.398 72.58-81.374h-153.954v153.946c22.98-17.78 50.678-41.878 81.374-72.572v0 0zM896 16c0-8.672-7.328-16-16-16h-736c-8.672 0-16 7.328-16 16v864c0 8.672 7.328 16 16 16 0 0 495.956 0.002 496 0v-224c0-17.672 14.32-32 32-32h224v-624zM256 448h320v-320h-320v320zM576 320l192 128v-320l-192 128z" />
14
+ <glyph unicode="&#xe92b;" glyph-name="file-zip" d="M917.806 730.924c-22.208 30.292-53.174 65.7-87.178 99.704s-69.412 64.964-99.704 87.178c-51.574 37.82-76.592 42.194-90.924 42.194h-496c-44.112 0-80-35.888-80-80v-864c0-44.112 35.884-80 80-80h736c44.112 0 80 35.888 80 80v624c0 14.332-4.372 39.35-42.194 90.924v0 0zM785.374 785.374c30.7-30.7 54.8-58.398 72.58-81.374h-153.954v153.946c22.98-17.78 50.678-41.878 81.374-72.572v0 0zM896 16c0-8.672-7.328-16-16-16h-736c-8.672 0-16 7.328-16 16v864c0 8.672 7.328 16 16 16 0 0 495.956 0.002 496 0v-224c0-17.672 14.322-32 32-32h224v-624zM256 896h128v-64h-128v64zM384 832h128v-64h-128v64zM256 768h128v-64h-128v64zM384 704h128v-64h-128v64zM256 640h128v-64h-128v64zM384 576h128v-64h-128v64zM256 512h128v-64h-128v64zM384 448h128v-64h-128v64zM256 112c0-26.4 21.6-48 48-48h160c26.4 0 48 21.6 48 48v160c0 26.4-21.6 48-48 48h-80v64h-128v-272zM448 192v-64h-128v64h128z" />
15
+ <glyph unicode="&#xe92d;" glyph-name="paste" d="M704 832h-128v64c0 35.2-28.8 64-64 64h-128c-35.204 0-64-28.8-64-64v-64h-128v-128h512v128zM512 832h-128v63.886c0.034 0.038 0.072 0.078 0.114 0.114h127.768c0.042-0.036 0.082-0.076 0.118-0.114v-63.886zM832 640v160c0 17.6-14.4 32-32 32h-64v-64h32v-128h-192l-192-192v-256h-256v576h32v64h-64c-17.602 0-32-14.4-32-32v-640c0-17.6 14.398-32 32-32h288v-192h640v704h-192zM576 549.49v-101.49h-101.49l101.49 101.49zM960 0h-512v384h192v192h320v-576z" />
16
+ <glyph unicode="&#xe950;" glyph-name="alarm" d="M512 832c-247.424 0-448-200.576-448-448s200.576-448 448-448 448 200.576 448 448-200.576 448-448 448zM512 24c-198.824 0-360 161.178-360 360 0 198.824 161.176 360 360 360 198.822 0 360-161.176 360-360 0-198.822-161.178-360-360-360zM934.784 672.826c16.042 28.052 25.216 60.542 25.216 95.174 0 106.040-85.96 192-192 192-61.818 0-116.802-29.222-151.92-74.596 131.884-27.236 245.206-105.198 318.704-212.578v0zM407.92 885.404c-35.116 45.374-90.102 74.596-151.92 74.596-106.040 0-192-85.96-192-192 0-34.632 9.174-67.122 25.216-95.174 73.5 107.38 186.822 185.342 318.704 212.578zM512 384v256h-64v-320h256v64z" />
17
+ <glyph unicode="&#xea0f;" glyph-name="cross" d="M1014.662 137.34c-0.004 0.004-0.008 0.008-0.012 0.010l-310.644 310.65 310.644 310.65c0.004 0.004 0.008 0.006 0.012 0.010 3.344 3.346 5.762 7.254 7.312 11.416 4.246 11.376 1.824 24.682-7.324 33.83l-146.746 146.746c-9.148 9.146-22.45 11.566-33.828 7.32-4.16-1.55-8.070-3.968-11.418-7.31 0-0.004-0.004-0.006-0.008-0.010l-310.648-310.652-310.648 310.65c-0.004 0.004-0.006 0.006-0.010 0.010-3.346 3.342-7.254 5.76-11.414 7.31-11.38 4.248-24.682 1.826-33.83-7.32l-146.748-146.748c-9.148-9.148-11.568-22.452-7.322-33.828 1.552-4.16 3.97-8.072 7.312-11.416 0.004-0.002 0.006-0.006 0.010-0.010l310.65-310.648-310.65-310.652c-0.002-0.004-0.006-0.006-0.008-0.010-3.342-3.346-5.76-7.254-7.314-11.414-4.248-11.376-1.826-24.682 7.322-33.83l146.748-146.746c9.15-9.148 22.452-11.568 33.83-7.322 4.16 1.552 8.070 3.97 11.416 7.312 0.002 0.004 0.006 0.006 0.010 0.010l310.648 310.65 310.648-310.65c0.004-0.002 0.008-0.006 0.012-0.008 3.348-3.344 7.254-5.762 11.414-7.314 11.378-4.246 24.684-1.826 33.828 7.322l146.746 146.748c9.148 9.148 11.57 22.454 7.324 33.83-1.552 4.16-3.97 8.068-7.314 11.414z" />
18
+ <glyph unicode="&#xea10;" glyph-name="checkmark" d="M864 832l-480-480-224 224-160-160 384-384 640 640z" />
19
+ </font></defs></svg>
assets/fonts/icomoon/fonts/icomoon.ttf ADDED
Binary file
assets/fonts/icomoon/fonts/icomoon.woff ADDED
Binary file
assets/fonts/icomoon/selection.json ADDED
@@ -0,0 +1,312 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "IcoMoonType": "selection",
3
+ "icons": [
4
+ {
5
+ "icon": {
6
+ "paths": [
7
+ "M917.806 229.076c-22.212-30.292-53.174-65.7-87.178-99.704s-69.412-64.964-99.704-87.178c-51.574-37.82-76.592-42.194-90.924-42.194h-496c-44.112 0-80 35.888-80 80v864c0 44.112 35.888 80 80 80h736c44.112 0 80-35.888 80-80v-624c0-14.332-4.372-39.35-42.194-90.924zM785.374 174.626c30.7 30.7 54.8 58.398 72.58 81.374h-153.954v-153.946c22.984 17.78 50.678 41.878 81.374 72.572zM896 944c0 8.672-7.328 16-16 16h-736c-8.672 0-16-7.328-16-16v-864c0-8.672 7.328-16 16-16 0 0 495.956-0.002 496 0v224c0 17.672 14.326 32 32 32h224v624z",
8
+ "M736 832h-448c-17.672 0-32-14.326-32-32s14.328-32 32-32h448c17.674 0 32 14.326 32 32s-14.326 32-32 32z",
9
+ "M736 704h-448c-17.672 0-32-14.326-32-32s14.328-32 32-32h448c17.674 0 32 14.326 32 32s-14.326 32-32 32z",
10
+ "M736 576h-448c-17.672 0-32-14.326-32-32s14.328-32 32-32h448c17.674 0 32 14.326 32 32s-14.326 32-32 32z"
11
+ ],
12
+ "tags": [
13
+ "file-text",
14
+ "file",
15
+ "document",
16
+ "list",
17
+ "paper",
18
+ "page"
19
+ ],
20
+ "defaultCode": 59686,
21
+ "grid": 16,
22
+ "attrs": []
23
+ },
24
+ "attrs": [],
25
+ "properties": {
26
+ "ligatures": "file-text2, file4",
27
+ "name": "file-text2",
28
+ "order": 2,
29
+ "id": 39,
30
+ "prevSize": 32,
31
+ "code": 59686
32
+ },
33
+ "setIdx": 0,
34
+ "setId": 1,
35
+ "iconIdx": 38
36
+ },
37
+ {
38
+ "icon": {
39
+ "paths": [
40
+ "M832 896h-640v-128l192-320 263 320 185-128v256z",
41
+ "M832 480c0 53.020-42.98 96-96 96-53.022 0-96-42.98-96-96s42.978-96 96-96c53.020 0 96 42.98 96 96z",
42
+ "M917.806 229.076c-22.212-30.292-53.174-65.7-87.178-99.704s-69.412-64.964-99.704-87.178c-51.574-37.82-76.592-42.194-90.924-42.194h-496c-44.112 0-80 35.888-80 80v864c0 44.112 35.888 80 80 80h736c44.112 0 80-35.888 80-80v-624c0-14.332-4.372-39.35-42.194-90.924zM785.374 174.626c30.7 30.7 54.8 58.398 72.58 81.374h-153.954v-153.946c22.984 17.78 50.678 41.878 81.374 72.572zM896 944c0 8.672-7.328 16-16 16h-736c-8.672 0-16-7.328-16-16v-864c0-8.672 7.328-16 16-16 0 0 495.956-0.002 496 0v224c0 17.672 14.326 32 32 32h224v624z"
43
+ ],
44
+ "tags": [
45
+ "file-picture",
46
+ "file",
47
+ "document",
48
+ "file-image"
49
+ ],
50
+ "defaultCode": 59687,
51
+ "grid": 16,
52
+ "attrs": []
53
+ },
54
+ "attrs": [],
55
+ "properties": {
56
+ "ligatures": "file-picture, file5",
57
+ "name": "file-picture",
58
+ "order": 3,
59
+ "id": 40,
60
+ "prevSize": 32,
61
+ "code": 59687
62
+ },
63
+ "setIdx": 0,
64
+ "setId": 1,
65
+ "iconIdx": 39
66
+ },
67
+ {
68
+ "icon": {
69
+ "paths": [
70
+ "M917.806 229.076c-22.21-30.292-53.174-65.7-87.178-99.704s-69.412-64.964-99.704-87.178c-51.574-37.82-76.592-42.194-90.924-42.194h-496c-44.112 0-80 35.888-80 80v864c0 44.112 35.886 80 80 80h736c44.112 0 80-35.888 80-80v-624c0-14.332-4.372-39.35-42.194-90.924v0zM785.374 174.626c30.7 30.7 54.8 58.398 72.58 81.374h-153.954v-153.946c22.982 17.78 50.678 41.878 81.374 72.572v0zM896 944c0 8.672-7.328 16-16 16h-736c-8.672 0-16-7.328-16-16v-864c0-8.672 7.328-16 16-16 0 0 495.956-0.002 496 0v224c0 17.672 14.324 32 32 32h224v624z",
71
+ "M756.288 391.252c-7.414-6.080-17.164-8.514-26.562-6.632l-320 64c-14.958 2.994-25.726 16.126-25.726 31.38v236.876c-18.832-8.174-40.678-12.876-64-12.876-70.692 0-128 42.98-128 96s57.308 96 128 96 128-42.98 128-96v-229.766l256-51.202v133.842c-18.832-8.174-40.678-12.876-64-12.876-70.692 0-128 42.98-128 96s57.308 96 128 96 128-42.98 128-96v-319.998c0-9.586-4.298-18.668-11.712-24.748z"
72
+ ],
73
+ "tags": [
74
+ "file-music",
75
+ "file",
76
+ "document",
77
+ "file-song",
78
+ "file-audio"
79
+ ],
80
+ "defaultCode": 59688,
81
+ "grid": 16,
82
+ "attrs": []
83
+ },
84
+ "attrs": [],
85
+ "properties": {
86
+ "ligatures": "file-music, file6",
87
+ "name": "file-music",
88
+ "order": 4,
89
+ "id": 41,
90
+ "prevSize": 32,
91
+ "code": 59688
92
+ },
93
+ "setIdx": 0,
94
+ "setId": 1,
95
+ "iconIdx": 40
96
+ },
97
+ {
98
+ "icon": {
99
+ "paths": [
100
+ "M917.806 229.076c-22.208-30.292-53.174-65.7-87.178-99.704s-69.412-64.964-99.704-87.178c-51.574-37.82-76.594-42.194-90.924-42.194h-496c-44.112 0-80 35.888-80 80v864c0 44.112 35.882 80 80 80h736c44.112 0 80-35.888 80-80v-624c0-14.332-4.372-39.35-42.194-90.924v0 0zM785.374 174.626c30.7 30.7 54.8 58.398 72.58 81.374h-153.954v-153.946c22.98 17.78 50.678 41.878 81.374 72.572v0 0zM896 944c0 8.672-7.328 16-16 16h-736c-8.672 0-16-7.328-16-16v-864c0-8.672 7.328-16 16-16 0 0 495.956-0.002 496 0v224c0 17.672 14.32 32 32 32h224v624z",
101
+ "M256 512h320v320h-320v-320z",
102
+ "M576 640l192-128v320l-192-128z"
103
+ ],
104
+ "tags": [
105
+ "file-video",
106
+ "file",
107
+ "document",
108
+ "file-camera"
109
+ ],
110
+ "defaultCode": 59690,
111
+ "grid": 16,
112
+ "attrs": []
113
+ },
114
+ "attrs": [],
115
+ "properties": {
116
+ "ligatures": "file-video, file8",
117
+ "name": "file-video",
118
+ "order": 5,
119
+ "id": 43,
120
+ "prevSize": 32,
121
+ "code": 59690
122
+ },
123
+ "setIdx": 0,
124
+ "setId": 1,
125
+ "iconIdx": 42
126
+ },
127
+ {
128
+ "icon": {
129
+ "paths": [
130
+ "M917.806 229.076c-22.208-30.292-53.174-65.7-87.178-99.704s-69.412-64.964-99.704-87.178c-51.574-37.82-76.592-42.194-90.924-42.194h-496c-44.112 0-80 35.888-80 80v864c0 44.112 35.884 80 80 80h736c44.112 0 80-35.888 80-80v-624c0-14.332-4.372-39.35-42.194-90.924v0 0zM785.374 174.626c30.7 30.7 54.8 58.398 72.58 81.374h-153.954v-153.946c22.98 17.78 50.678 41.878 81.374 72.572v0 0zM896 944c0 8.672-7.328 16-16 16h-736c-8.672 0-16-7.328-16-16v-864c0-8.672 7.328-16 16-16 0 0 495.956-0.002 496 0v224c0 17.672 14.322 32 32 32h224v624z",
131
+ "M256 64h128v64h-128v-64z",
132
+ "M384 128h128v64h-128v-64z",
133
+ "M256 192h128v64h-128v-64z",
134
+ "M384 256h128v64h-128v-64z",
135
+ "M256 320h128v64h-128v-64z",
136
+ "M384 384h128v64h-128v-64z",
137
+ "M256 448h128v64h-128v-64z",
138
+ "M384 512h128v64h-128v-64z",
139
+ "M256 848c0 26.4 21.6 48 48 48h160c26.4 0 48-21.6 48-48v-160c0-26.4-21.6-48-48-48h-80v-64h-128v272zM448 768v64h-128v-64h128z"
140
+ ],
141
+ "tags": [
142
+ "file-zip",
143
+ "file",
144
+ "document",
145
+ "file-compressed",
146
+ "file-type",
147
+ "file-format"
148
+ ],
149
+ "defaultCode": 59691,
150
+ "grid": 16,
151
+ "attrs": []
152
+ },
153
+ "attrs": [],
154
+ "properties": {
155
+ "ligatures": "file-zip, file9",
156
+ "name": "file-zip",
157
+ "order": 6,
158
+ "id": 44,
159
+ "prevSize": 32,
160
+ "code": 59691
161
+ },
162
+ "setIdx": 0,
163
+ "setId": 1,
164
+ "iconIdx": 43
165
+ },
166
+ {
167
+ "icon": {
168
+ "paths": [
169
+ "M704 128h-128v-64c0-35.2-28.8-64-64-64h-128c-35.204 0-64 28.8-64 64v64h-128v128h512v-128zM512 128h-128v-63.886c0.034-0.038 0.072-0.078 0.114-0.114h127.768c0.042 0.036 0.082 0.076 0.118 0.114v63.886zM832 320v-160c0-17.6-14.4-32-32-32h-64v64h32v128h-192l-192 192v256h-256v-576h32v-64h-64c-17.602 0-32 14.4-32 32v640c0 17.6 14.398 32 32 32h288v192h640v-704h-192zM576 410.51v101.49h-101.49l101.49-101.49zM960 960h-512v-384h192v-192h320v576z"
170
+ ],
171
+ "tags": [
172
+ "paste",
173
+ "clipboard-file"
174
+ ],
175
+ "defaultCode": 59693,
176
+ "grid": 16,
177
+ "attrs": []
178
+ },
179
+ "attrs": [],
180
+ "properties": {
181
+ "ligatures": "paste, clipboard-file",
182
+ "name": "paste",
183
+ "order": 7,
184
+ "id": 46,
185
+ "prevSize": 32,
186
+ "code": 59693
187
+ },
188
+ "setIdx": 0,
189
+ "setId": 1,
190
+ "iconIdx": 45
191
+ },
192
+ {
193
+ "icon": {
194
+ "paths": [
195
+ "M512 128c-247.424 0-448 200.576-448 448s200.576 448 448 448 448-200.576 448-448-200.576-448-448-448zM512 936c-198.824 0-360-161.178-360-360 0-198.824 161.176-360 360-360 198.822 0 360 161.176 360 360 0 198.822-161.178 360-360 360zM934.784 287.174c16.042-28.052 25.216-60.542 25.216-95.174 0-106.040-85.96-192-192-192-61.818 0-116.802 29.222-151.92 74.596 131.884 27.236 245.206 105.198 318.704 212.578v0zM407.92 74.596c-35.116-45.374-90.102-74.596-151.92-74.596-106.040 0-192 85.96-192 192 0 34.632 9.174 67.122 25.216 95.174 73.5-107.38 186.822-185.342 318.704-212.578z",
196
+ "M512 576v-256h-64v320h256v-64z"
197
+ ],
198
+ "tags": [
199
+ "alarm",
200
+ "time",
201
+ "clock"
202
+ ],
203
+ "defaultCode": 59728,
204
+ "grid": 16,
205
+ "attrs": []
206
+ },
207
+ "attrs": [],
208
+ "properties": {
209
+ "ligatures": "alarm, time4",
210
+ "name": "alarm",
211
+ "order": 8,
212
+ "id": 81,
213
+ "prevSize": 32,
214
+ "code": 59728
215
+ },
216
+ "setIdx": 0,
217
+ "setId": 1,
218
+ "iconIdx": 80
219
+ },
220
+ {
221
+ "icon": {
222
+ "paths": [
223
+ "M1014.662 822.66c-0.004-0.004-0.008-0.008-0.012-0.010l-310.644-310.65 310.644-310.65c0.004-0.004 0.008-0.006 0.012-0.010 3.344-3.346 5.762-7.254 7.312-11.416 4.246-11.376 1.824-24.682-7.324-33.83l-146.746-146.746c-9.148-9.146-22.45-11.566-33.828-7.32-4.16 1.55-8.070 3.968-11.418 7.31 0 0.004-0.004 0.006-0.008 0.010l-310.648 310.652-310.648-310.65c-0.004-0.004-0.006-0.006-0.010-0.010-3.346-3.342-7.254-5.76-11.414-7.31-11.38-4.248-24.682-1.826-33.83 7.32l-146.748 146.748c-9.148 9.148-11.568 22.452-7.322 33.828 1.552 4.16 3.97 8.072 7.312 11.416 0.004 0.002 0.006 0.006 0.010 0.010l310.65 310.648-310.65 310.652c-0.002 0.004-0.006 0.006-0.008 0.010-3.342 3.346-5.76 7.254-7.314 11.414-4.248 11.376-1.826 24.682 7.322 33.83l146.748 146.746c9.15 9.148 22.452 11.568 33.83 7.322 4.16-1.552 8.070-3.97 11.416-7.312 0.002-0.004 0.006-0.006 0.010-0.010l310.648-310.65 310.648 310.65c0.004 0.002 0.008 0.006 0.012 0.008 3.348 3.344 7.254 5.762 11.414 7.314 11.378 4.246 24.684 1.826 33.828-7.322l146.746-146.748c9.148-9.148 11.57-22.454 7.324-33.83-1.552-4.16-3.97-8.068-7.314-11.414z"
224
+ ],
225
+ "tags": [
226
+ "cross",
227
+ "cancel",
228
+ "close",
229
+ "quit",
230
+ "remove"
231
+ ],
232
+ "defaultCode": 59919,
233
+ "grid": 16,
234
+ "attrs": []
235
+ },
236
+ "attrs": [],
237
+ "properties": {
238
+ "ligatures": "cross, cancel",
239
+ "name": "cross",
240
+ "order": 10,
241
+ "id": 272,
242
+ "prevSize": 32,
243
+ "code": 59919
244
+ },
245
+ "setIdx": 0,
246
+ "setId": 1,
247
+ "iconIdx": 271
248
+ },
249
+ {
250
+ "icon": {
251
+ "paths": [
252
+ "M864 128l-480 480-224-224-160 160 384 384 640-640z"
253
+ ],
254
+ "tags": [
255
+ "checkmark",
256
+ "tick",
257
+ "correct",
258
+ "accept",
259
+ "ok"
260
+ ],
261
+ "defaultCode": 59920,
262
+ "grid": 16,
263
+ "attrs": []
264
+ },
265
+ "attrs": [],
266
+ "properties": {
267
+ "ligatures": "checkmark, tick",
268
+ "name": "checkmark",
269
+ "order": 9,
270
+ "id": 273,
271
+ "prevSize": 32,
272
+ "code": 59920
273
+ },
274
+ "setIdx": 0,
275
+ "setId": 1,
276
+ "iconIdx": 272
277
+ }
278
+ ],
279
+ "height": 1024,
280
+ "metadata": {
281
+ "name": "icomoon"
282
+ },
283
+ "preferences": {
284
+ "showGlyphs": true,
285
+ "showQuickUse": true,
286
+ "showQuickUse2": true,
287
+ "showSVGs": true,
288
+ "fontPref": {
289
+ "prefix": "icon-",
290
+ "metadata": {
291
+ "fontFamily": "icomoon"
292
+ },
293
+ "metrics": {
294
+ "emSize": 1024,
295
+ "baseline": 6.25,
296
+ "whitespace": 50
297
+ },
298
+ "embed": false
299
+ },
300
+ "imagePref": {
301
+ "prefix": "icon-",
302
+ "png": true,
303
+ "useClassSelector": true,
304
+ "color": 0,
305
+ "bgColor": 16777215,
306
+ "classSelector": ".icon"
307
+ },
308
+ "historySize": 100,
309
+ "showCodes": true,
310
+ "gridSize": 16
311
+ }
312
+ }
assets/fonts/icomoon/style.css ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @font-face {
2
+ font-family: 'icomoon';
3
+ src: url('fonts/icomoon.eot?8uirti');
4
+ src: url('fonts/icomoon.eot?8uirti#iefix') format('embedded-opentype'),
5
+ url('fonts/icomoon.ttf?8uirti') format('truetype'),
6
+ url('fonts/icomoon.woff?8uirti') format('woff'),
7
+ url('fonts/icomoon.svg?8uirti#icomoon') format('svg');
8
+ font-weight: normal;
9
+ font-style: normal;
10
+ }
11
+
12
+ [class^="icon-"], [class*=" icon-"] {
13
+ /* use !important to prevent issues with browser extensions that change fonts */
14
+ font-family: 'icomoon' !important;
15
+ speak: none;
16
+ font-style: normal;
17
+ font-weight: normal;
18
+ font-variant: normal;
19
+ text-transform: none;
20
+ line-height: 1;
21
+
22
+ /* Better Font Rendering =========== */
23
+ -webkit-font-smoothing: antialiased;
24
+ -moz-osx-font-smoothing: grayscale;
25
+ }
26
+
27
+ .icon-file-text2:before {
28
+ content: "\e926";
29
+ }
30
+ .icon-file-picture:before {
31
+ content: "\e927";
32
+ }
33
+ .icon-file-music:before {
34
+ content: "\e928";
35
+ }
36
+ .icon-file-video:before {
37
+ content: "\e92a";
38
+ }
39
+ .icon-file-zip:before {
40
+ content: "\e92b";
41
+ }
42
+ .icon-paste:before {
43
+ content: "\e92d";
44
+ }
45
+ .icon-alarm:before {
46
+ content: "\e950";
47
+ }
48
+ .icon-cross:before {
49
+ content: "\ea0f";
50
+ }
51
+ .icon-checkmark:before {
52
+ content: "\ea10";
53
+ }
54
+
assets/fonts/icon.eot ADDED
Binary file
assets/fonts/icon.svg ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>Icon Font</metadata>
5
+ <defs>
6
+ <font id="icon" horiz-adv-x="1024">
7
+ <font-face units-per-em="1024" ascent="960" descent="-64" />
8
+ <missing-glyph horiz-adv-x="1024" />
9
+ <glyph unicode="&#x20;" horiz-adv-x="512" d="" />
10
+ <glyph unicode="&#xe900;" glyph-name="books" horiz-adv-x="1152" d="M224 832h-192c-17.6 0-32-14.4-32-32v-704c0-17.6 14.4-32 32-32h192c17.6 0 32 14.4 32 32v704c0 17.6-14.4 32-32 32zM192 640h-128v64h128v-64zM544 832h-192c-17.6 0-32-14.4-32-32v-704c0-17.6 14.4-32 32-32h192c17.6 0 32 14.4 32 32v704c0 17.6-14.4 32-32 32zM512 640h-128v64h128v-64zM765.088 782.52l-171.464-86.394c-15.716-7.918-22.096-27.258-14.178-42.976l287.978-571.548c7.918-15.718 27.258-22.098 42.976-14.178l171.464 86.392c15.716 7.92 22.096 27.26 14.178 42.974l-287.978 571.55c-7.92 15.718-27.26 22.1-42.976 14.18zM928 96c0-17.673-14.327-32-32-32s-32 14.327-32 32c0 17.673 14.327 32 32 32s32-14.327 32-32z" />
11
+ <glyph unicode="&#xe901;" glyph-name="alarm" d="M512 832c-247.424 0-448-200.576-448-448s200.576-448 448-448 448 200.576 448 448-200.576 448-448 448zM512 24c-198.824 0-360 161.178-360 360 0 198.824 161.176 360 360 360 198.822 0 360-161.176 360-360 0-198.822-161.178-360-360-360zM934.784 672.826c16.042 28.052 25.216 60.542 25.216 95.174 0 106.040-85.96 192-192 192-61.818 0-116.802-29.222-151.92-74.596 131.884-27.236 245.206-105.198 318.704-212.578v0zM407.92 885.404c-35.116 45.374-90.102 74.596-151.92 74.596-106.040 0-192-85.96-192-192 0-34.632 9.174-67.122 25.216-95.174 73.5 107.38 186.822 185.342 318.704 212.578zM512 384v256h-64v-320h256v64z" />
12
+ <glyph unicode="&#xe902;" glyph-name="spinner10" d="M0.042 446.382l-0.022-0.004c0 0 0.012-0.090 0.028-0.222 0.11-3.878 0.55-7.676 1.322-11.352 0.204-1.746 0.428-3.66 0.674-5.774 0.222-1.886 0.46-3.914 0.718-6.078 0.374-2.566 0.77-5.292 1.19-8.176 0.856-5.746 1.8-12.124 2.908-18.958 1.348-6.446 2.804-13.414 4.364-20.864 0.71-3.718 1.776-7.504 2.786-11.406 1.024-3.89 2.078-7.894 3.16-12.004 0.566-2.042 1.040-4.132 1.708-6.208 0.656-2.074 1.32-4.176 1.988-6.3 1.348-4.234 2.726-8.566 4.136-12.988 0.352-1.106 0.708-2.21 1.064-3.324 0.408-1.102 0.814-2.208 1.226-3.316 0.826-2.218 1.658-4.458 2.502-6.714 1.696-4.496 3.422-9.078 5.18-13.742 1.968-4.566 3.97-9.214 6.004-13.934 1.018-2.348 2.044-4.714 3.078-7.098 1.048-2.376 2.27-4.704 3.408-7.074 2.322-4.714 4.678-9.496 7.062-14.332 2.47-4.786 5.208-9.512 7.846-14.328 1.336-2.398 2.68-4.808 4.028-7.23 1.368-2.41 2.902-4.75 4.356-7.14 2.95-4.738 5.93-9.524 8.934-14.348 12.64-18.894 26.676-37.566 42.21-55.278 15.712-17.578 32.726-34.25 50.692-49.602 18.18-15.136 37.264-28.902 56.726-41.114 19.604-12.036 39.644-22.312 59.376-31.144 5.004-2.040 9.964-4.062 14.878-6.066 2.462-0.972 4.868-2.032 7.336-2.918 2.47-0.868 4.93-1.734 7.376-2.594 4.898-1.684 9.678-3.468 14.484-4.992 4.832-1.43 9.604-2.844 14.312-4.242 2.356-0.672 4.66-1.426 7.004-2.012 2.346-0.574 4.676-1.14 6.986-1.704 4.606-1.118 9.142-2.214 13.604-3.296 4.5-0.868 8.926-1.722 13.27-2.558 2.166-0.41 4.31-0.82 6.434-1.222 1.062-0.2 2.118-0.398 3.166-0.598 1.060-0.148 2.118-0.292 3.166-0.442 4.192-0.582 8.292-1.152 12.3-1.71 1.998-0.274 3.972-0.546 5.922-0.816 1.946-0.286 3.904-0.378 5.814-0.57 3.822-0.336 7.544-0.664 11.164-0.98 3.616-0.304 7.104-0.688 10.526-0.738 0.23-0.008 0.452-0.016 0.682-0.026 0.614-34.812 29.008-62.846 63.968-62.846 0.542 0 1.080 0.028 1.62 0.042v-0.022c0 0 0.090 0.012 0.224 0.028 3.878 0.11 7.674 0.55 11.35 1.322 1.748 0.204 3.662 0.426 5.776 0.672 1.884 0.222 3.912 0.462 6.076 0.718 2.566 0.376 5.292 0.772 8.176 1.192 5.746 0.856 12.124 1.8 18.958 2.908 6.446 1.348 13.414 2.804 20.864 4.362 3.718 0.712 7.504 1.778 11.406 2.786 3.892 1.026 7.894 2.080 12.004 3.162 2.044 0.566 4.132 1.040 6.208 1.708 2.074 0.656 4.174 1.318 6.3 1.988 4.232 1.348 8.564 2.726 12.988 4.134 1.104 0.354 2.21 0.708 3.324 1.066 1.1 0.406 2.206 0.814 3.316 1.226 2.216 0.824 4.456 1.658 6.714 2.5 4.496 1.698 9.078 3.424 13.74 5.182 4.568 1.968 9.216 3.97 13.936 6.004 2.348 1.018 4.714 2.044 7.098 3.078 2.376 1.048 4.702 2.27 7.074 3.408 4.714 2.322 9.494 4.678 14.33 7.062 4.786 2.47 9.512 5.208 14.328 7.846 2.398 1.336 4.808 2.678 7.23 4.028 2.41 1.366 4.75 2.9 7.14 4.354 4.738 2.952 9.524 5.93 14.35 8.936 18.89 12.64 37.564 26.674 55.278 42.21 17.574 15.712 34.248 32.726 49.602 50.69 15.136 18.182 28.902 37.264 41.112 56.728 12.036 19.602 22.314 39.644 31.142 59.376 2.042 5.002 4.062 9.964 6.068 14.878 0.974 2.462 2.032 4.868 2.918 7.334 0.87 2.472 1.732 4.932 2.592 7.376 1.686 4.898 3.468 9.678 4.994 14.484 1.432 4.832 2.846 9.604 4.24 14.31 0.674 2.358 1.43 4.66 2.016 7.004 0.57 2.348 1.138 4.676 1.702 6.988 1.118 4.606 2.216 9.14 3.296 13.602 0.868 4.502 1.72 8.928 2.558 13.272 0.41 2.164 0.818 4.308 1.222 6.434 0.2 1.060 0.398 2.116 0.596 3.164 0.148 1.062 0.296 2.118 0.444 3.168 0.582 4.19 1.152 8.292 1.708 12.3 0.278 1.996 0.55 3.97 0.82 5.922 0.284 1.946 0.376 3.902 0.568 5.812 0.336 3.822 0.664 7.546 0.98 11.164 0.304 3.616 0.686 7.106 0.738 10.528 0.020 0.534 0.040 1.044 0.058 1.574 35.224 0.146 63.732 28.738 63.732 63.992 0 0.542-0.028 1.080-0.042 1.62h0.022c0 0-0.012 0.090-0.028 0.224-0.11 3.878-0.55 7.674-1.322 11.35-0.204 1.748-0.428 3.662-0.674 5.776-0.222 1.886-0.46 3.914-0.718 6.076-0.374 2.566-0.77 5.294-1.19 8.176-0.856 5.746-1.8 12.124-2.908 18.958-1.348 6.444-2.804 13.414-4.364 20.862-0.71 3.72-1.776 7.506-2.786 11.408-1.024 3.892-2.078 7.894-3.16 12.002-0.566 2.044-1.040 4.134-1.708 6.208-0.656 2.076-1.32 4.174-1.988 6.3-1.348 4.234-2.726 8.566-4.136 12.99-0.352 1.102-0.708 2.21-1.064 3.324-0.408 1.1-0.814 2.206-1.226 3.316-0.826 2.216-1.658 4.454-2.502 6.714-1.696 4.498-3.422 9.080-5.18 13.74-1.968 4.57-3.97 9.216-6.004 13.936-1.020 2.348-2.044 4.714-3.078 7.098-1.048 2.376-2.27 4.702-3.408 7.076-2.322 4.714-4.678 9.494-7.062 14.33-2.47 4.786-5.208 9.512-7.846 14.328-1.336 2.398-2.68 4.808-4.028 7.23-1.368 2.41-2.902 4.75-4.356 7.14-2.95 4.74-5.93 9.524-8.934 14.35-12.64 18.892-26.676 37.564-42.21 55.278-15.712 17.576-32.726 34.25-50.692 49.602-18.18 15.136-37.264 28.902-56.726 41.112-19.604 12.036-39.644 22.314-59.376 31.142-5.004 2.040-9.964 4.062-14.878 6.068-2.462 0.974-4.868 2.032-7.336 2.918-2.47 0.87-4.93 1.734-7.376 2.592-4.898 1.684-9.678 3.468-14.484 4.994-4.832 1.432-9.604 2.846-14.312 4.242-2.356 0.672-4.66 1.428-7.004 2.014-2.346 0.572-4.676 1.138-6.986 1.702-4.606 1.118-9.142 2.216-13.604 3.298-4.5 0.868-8.926 1.72-13.27 2.558-2.166 0.412-4.31 0.82-6.434 1.222-1.062 0.2-2.118 0.398-3.166 0.596-1.060 0.148-2.118 0.296-3.166 0.442-4.192 0.584-8.292 1.154-12.3 1.71-1.998 0.276-3.972 0.55-5.922 0.82-1.946 0.284-3.904 0.376-5.814 0.57-3.822 0.336-7.544 0.664-11.164 0.98-3.616 0.304-7.104 0.686-10.526 0.738-0.852 0.032-1.674 0.062-2.512 0.092-0.65 34.78-29.028 62.778-63.966 62.778-0.542 0-1.080-0.028-1.62-0.042l-0.002 0.022c0 0-0.090-0.012-0.222-0.028-3.878-0.11-7.676-0.55-11.352-1.322-1.748-0.204-3.662-0.426-5.776-0.672-1.884-0.222-3.912-0.462-6.076-0.718-2.566-0.376-5.292-0.772-8.176-1.192-5.746-0.856-12.124-1.8-18.958-2.908-6.446-1.348-13.414-2.804-20.864-4.362-3.718-0.712-7.504-1.778-11.406-2.786-3.892-1.026-7.894-2.080-12.004-3.162-2.044-0.566-4.132-1.040-6.208-1.708-2.074-0.656-4.174-1.318-6.3-1.988-4.232-1.348-8.564-2.726-12.988-4.134-1.104-0.354-2.21-0.708-3.324-1.066-1.1-0.406-2.206-0.814-3.316-1.226-2.216-0.824-4.456-1.658-6.714-2.5-4.496-1.698-9.078-3.424-13.74-5.182-4.568-1.968-9.216-3.97-13.936-6.004-2.348-1.018-4.714-2.044-7.098-3.078-2.376-1.048-4.702-2.27-7.074-3.408-4.714-2.322-9.494-4.678-14.33-7.062-4.786-2.47-9.512-5.208-14.328-7.846-2.398-1.336-4.808-2.678-7.23-4.028-2.41-1.366-4.75-2.9-7.14-4.354-4.738-2.952-9.524-5.93-14.35-8.936-18.89-12.64-37.564-26.674-55.278-42.21-17.574-15.712-34.248-32.726-49.602-50.69-15.136-18.182-28.902-37.264-41.112-56.728-12.036-19.602-22.314-39.644-31.142-59.376-2.042-5.002-4.062-9.964-6.068-14.878-0.974-2.462-2.032-4.868-2.918-7.334-0.87-2.472-1.732-4.932-2.592-7.376-1.686-4.898-3.468-9.678-4.994-14.484-1.432-4.832-2.846-9.604-4.24-14.31-0.674-2.358-1.43-4.66-2.016-7.004-0.57-2.348-1.138-4.676-1.702-6.988-1.118-4.606-2.216-9.14-3.296-13.602-0.868-4.502-1.72-8.928-2.558-13.272-0.41-2.164-0.818-4.308-1.222-6.434-0.2-1.060-0.398-2.116-0.596-3.164-0.148-1.062-0.296-2.118-0.444-3.168-0.582-4.19-1.152-8.292-1.708-12.3-0.278-1.996-0.55-3.97-0.82-5.922-0.284-1.946-0.376-3.902-0.568-5.812-0.336-3.822-0.664-7.546-0.98-11.164-0.304-3.616-0.686-7.106-0.738-10.528-0.020-0.548-0.040-1.076-0.058-1.62-34.376-1.112-61.902-29.304-61.902-63.946 0-0.542 0.028-1.078 0.042-1.618zM73.518 511.294c0.042 0.196 0.086 0.384 0.128 0.58 0.644 3.248 1.632 6.542 2.556 9.942 0.934 3.388 1.894 6.876 2.88 10.454 0.516 1.78 0.934 3.602 1.546 5.406 0.596 1.802 1.202 3.628 1.81 5.476 1.218 3.682 2.464 7.45 3.736 11.294 0.316 0.958 0.634 1.924 0.956 2.892 0.37 0.954 0.74 1.914 1.114 2.876 0.746 1.924 1.5 3.868 2.26 5.83 1.52 3.904 3.070 7.882 4.646 11.93 1.768 3.96 3.566 7.99 5.392 12.080 0.908 2.038 1.824 4.090 2.746 6.156 0.932 2.060 2.036 4.072 3.052 6.126 2.070 4.084 4.17 8.222 6.294 12.412 2.202 4.142 4.654 8.224 6.998 12.392 1.184 2.074 2.374 4.16 3.57 6.256 1.21 2.086 2.586 4.102 3.876 6.166 2.616 4.098 5.256 8.232 7.918 12.402 11.234 16.298 23.632 32.398 37.33 47.638 13.874 15.104 28.842 29.404 44.598 42.548 15.974 12.928 32.686 24.65 49.676 35.022 17.13 10.194 34.6 18.838 51.734 26.258 4.35 1.7 8.662 3.382 12.934 5.050 2.136 0.812 4.216 1.71 6.36 2.444 2.146 0.714 4.28 1.428 6.404 2.136 4.25 1.386 8.382 2.888 12.548 4.142 4.184 1.174 8.314 2.332 12.392 3.474 2.038 0.55 4.026 1.19 6.054 1.662 2.030 0.458 4.044 0.914 6.044 1.368 3.978 0.91 7.896 1.806 11.748 2.688 3.888 0.686 7.71 1.36 11.462 2.022 1.868 0.33 3.716 0.658 5.546 0.98 0.914 0.162 1.824 0.324 2.728 0.484 0.916 0.112 1.828 0.222 2.734 0.332 3.612 0.448 7.148 0.882 10.604 1.31 1.72 0.216 3.422 0.432 5.102 0.644 1.674 0.226 3.364 0.266 5.010 0.408 3.292 0.238 6.498 0.472 9.616 0.7 3.11 0.218 6.11 0.524 9.058 0.508 5.848 0.132 11.32 0.256 16.38 0.372 4.664-0.168 8.948-0.324 12.818-0.462 1.914-0.054 3.726-0.108 5.432-0.156 2.122-0.134 4.108-0.26 5.958-0.378 2.13-0.138 4.060-0.266 5.82-0.38 3.256-0.51 6.592-0.782 9.99-0.782 0.466 0 0.93 0.026 1.396 0.036 0.132-0.008 0.224-0.014 0.224-0.014v0.020c31.14 0.778 56.75 23.784 61.556 53.754 0.542-0.12 1.064-0.236 1.612-0.356 3.246-0.644 6.542-1.632 9.942-2.556 3.386-0.934 6.876-1.894 10.454-2.88 1.778-0.516 3.602-0.934 5.404-1.546 1.802-0.596 3.63-1.202 5.478-1.812 3.68-1.218 7.448-2.464 11.292-3.736 0.96-0.316 1.924-0.634 2.892-0.956 0.956-0.37 1.914-0.74 2.876-1.112 1.926-0.746 3.868-1.5 5.83-2.26 3.904-1.52 7.884-3.070 11.932-4.646 3.96-1.768 7.988-3.566 12.080-5.392 2.038-0.908 4.088-1.824 6.156-2.746 2.060-0.932 4.072-2.036 6.126-3.054 4.082-2.070 8.222-4.17 12.41-6.294 4.144-2.202 8.226-4.654 12.394-6.998 2.074-1.184 4.16-2.374 6.256-3.572 2.086-1.21 4.102-2.586 6.166-3.876 4.098-2.616 8.23-5.256 12.402-7.918 16.296-11.234 32.398-23.632 47.636-37.33 15.104-13.874 29.406-28.842 42.55-44.598 12.928-15.974 24.648-32.686 35.020-49.676 10.196-17.13 18.84-34.6 26.26-51.736 1.698-4.348 3.382-8.662 5.050-12.932 0.812-2.136 1.71-4.216 2.444-6.36 0.714-2.146 1.428-4.28 2.136-6.404 1.386-4.25 2.888-8.384 4.142-12.548 1.174-4.184 2.33-8.316 3.474-12.392 0.55-2.038 1.19-4.026 1.66-6.054 0.46-2.030 0.916-4.046 1.368-6.046 0.91-3.978 1.808-7.896 2.688-11.748 0.688-3.888 1.362-7.71 2.024-11.462 0.33-1.868 0.656-3.716 0.98-5.548 0.162-0.914 0.324-1.824 0.484-2.728 0.11-0.916 0.222-1.828 0.332-2.734 0.446-3.612 0.882-7.148 1.31-10.604 0.216-1.72 0.432-3.42 0.642-5.1 0.226-1.674 0.268-3.364 0.41-5.010 0.238-3.292 0.472-6.498 0.7-9.616 0.218-3.11 0.524-6.11 0.508-9.058 0.132-5.848 0.256-11.32 0.372-16.38-0.168-4.664-0.324-8.948-0.462-12.818-0.054-1.914-0.108-3.726-0.156-5.432-0.134-2.122-0.26-4.108-0.378-5.958-0.138-2.13-0.266-4.060-0.38-5.82-0.498-3.256-0.768-6.592-0.768-9.99 0-0.468 0.026-0.93 0.036-1.396-0.008-0.132-0.016-0.224-0.016-0.224h0.022c0.768-30.766 23.236-56.128 52.682-61.37-0.066-0.296-0.13-0.584-0.198-0.884-0.644-3.248-1.632-6.542-2.556-9.942-0.934-3.388-1.894-6.876-2.88-10.454-0.516-1.78-0.934-3.602-1.546-5.406-0.596-1.802-1.202-3.628-1.81-5.476-1.218-3.682-2.464-7.45-3.736-11.294-0.316-0.958-0.634-1.924-0.956-2.892-0.37-0.954-0.74-1.914-1.114-2.876-0.746-1.924-1.5-3.868-2.26-5.83-1.52-3.904-3.070-7.882-4.646-11.93-1.768-3.96-3.566-7.99-5.392-12.080-0.908-2.038-1.824-4.090-2.746-6.156-0.932-2.060-2.036-4.072-3.052-6.126-2.070-4.084-4.17-8.222-6.294-12.412-2.202-4.142-4.654-8.224-6.998-12.392-1.184-2.074-2.374-4.16-3.57-6.256-1.21-2.086-2.586-4.102-3.876-6.166-2.616-4.098-5.256-8.232-7.918-12.402-11.234-16.298-23.632-32.398-37.33-47.638-13.874-15.104-28.842-29.404-44.598-42.548-15.974-12.928-32.686-24.65-49.676-35.022-17.13-10.194-34.6-18.838-51.734-26.258-4.35-1.7-8.662-3.382-12.934-5.050-2.136-0.812-4.216-1.71-6.36-2.444-2.146-0.714-4.28-1.428-6.404-2.136-4.25-1.386-8.382-2.888-12.548-4.142-4.184-1.174-8.314-2.332-12.392-3.474-2.038-0.55-4.026-1.19-6.054-1.662-2.030-0.458-4.044-0.914-6.044-1.368-3.978-0.91-7.896-1.806-11.748-2.688-3.888-0.686-7.71-1.36-11.462-2.022-1.868-0.33-3.716-0.658-5.546-0.98-0.914-0.162-1.824-0.324-2.728-0.484-0.916-0.112-1.828-0.222-2.734-0.332-3.612-0.448-7.148-0.882-10.604-1.31-1.72-0.216-3.422-0.432-5.102-0.644-1.674-0.226-3.364-0.266-5.010-0.408-3.292-0.238-6.498-0.472-9.616-0.7-3.11-0.218-6.11-0.524-9.058-0.508-5.848-0.132-11.32-0.256-16.38-0.372-4.664 0.168-8.948 0.324-12.818 0.462-1.914 0.054-3.726 0.108-5.432 0.156-2.122 0.134-4.108 0.26-5.958 0.378-2.13 0.138-4.060 0.266-5.82 0.38-3.256 0.51-6.592 0.782-9.99 0.782-0.466 0-0.93-0.026-1.396-0.036-0.132 0.008-0.224 0.014-0.224 0.014v-0.020c-31.004-0.774-56.524-23.586-61.488-53.364-3.2 0.64-6.446 1.61-9.792 2.522-3.386 0.934-6.876 1.894-10.454 2.878-1.778 0.516-3.602 0.938-5.404 1.546-1.802 0.598-3.63 1.204-5.478 1.812-3.68 1.218-7.448 2.464-11.292 3.738-0.96 0.316-1.924 0.632-2.892 0.954-0.956 0.372-1.914 0.742-2.876 1.114-1.926 0.746-3.868 1.5-5.83 2.258-3.904 1.524-7.884 3.070-11.932 4.648-3.96 1.77-7.988 3.566-12.080 5.39-2.038 0.91-4.088 1.824-6.156 2.746-2.060 0.934-4.072 2.036-6.126 3.054-4.082 2.070-8.222 4.172-12.41 6.296-4.144 2.2-8.226 4.652-12.394 6.996-2.074 1.184-4.16 2.376-6.256 3.57-2.086 1.21-4.102 2.586-6.166 3.878-4.098 2.614-8.23 5.254-12.402 7.918-16.296 11.23-32.398 23.632-47.636 37.328-15.104 13.876-29.406 28.84-42.55 44.598-12.928 15.972-24.648 32.684-35.020 49.676-10.196 17.128-18.84 34.602-26.26 51.734-1.698 4.352-3.382 8.664-5.050 12.934-0.812 2.136-1.71 4.218-2.444 6.36-0.714 2.148-1.428 4.282-2.136 6.406-1.386 4.25-2.888 8.382-4.142 12.546-1.174 4.184-2.33 8.316-3.474 12.394-0.55 2.036-1.19 4.024-1.66 6.054-0.46 2.028-0.916 4.042-1.368 6.042-0.91 3.98-1.808 7.898-2.688 11.75-0.688 3.886-1.362 7.71-2.024 11.46-0.33 1.868-0.656 3.718-0.98 5.546-0.162 0.914-0.324 1.824-0.484 2.73-0.11 0.914-0.222 1.828-0.332 2.734-0.446 3.61-0.882 7.148-1.31 10.602-0.216 1.722-0.432 3.422-0.642 5.102-0.226 1.676-0.268 3.364-0.41 5.012-0.238 3.29-0.472 6.496-0.7 9.614-0.218 3.11-0.524 6.11-0.508 9.058-0.132 5.848-0.256 11.32-0.372 16.382 0.168 4.664 0.324 8.946 0.462 12.816 0.054 1.914 0.108 3.726 0.156 5.434 0.134 2.122 0.26 4.106 0.378 5.958 0.138 2.128 0.266 4.058 0.38 5.82 0.496 3.26 0.766 6.596 0.766 9.994 0 0.466-0.026 0.93-0.036 1.396 0.008 0.132 0.016 0.224 0.016 0.224h-0.022c-0.78 31.38-24.134 57.154-54.44 61.674z" />
13
+ <glyph unicode="&#xe903;" glyph-name="checkmark" d="M864 832l-480-480-224 224-160-160 384-384 640 640z" />
14
+ </font></defs></svg>
assets/fonts/icon.ttf ADDED
Binary file
assets/fonts/icon.woff ADDED
Binary file
assets/fonts/icons.eot ADDED
Binary file
assets/fonts/icons.svg ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>Generated by IcoMoon</metadata>
5
+ <defs>
6
+ <font id="icomoon" horiz-adv-x="1024">
7
+ <font-face units-per-em="1024" ascent="960" descent="-64" />
8
+ <missing-glyph horiz-adv-x="1024" />
9
+ <glyph unicode="&#x20;" horiz-adv-x="512" d="" />
10
+ <glyph unicode="&#xe926;" glyph-name="file-text2" d="M917.806 730.924c-22.212 30.292-53.174 65.7-87.178 99.704s-69.412 64.964-99.704 87.178c-51.574 37.82-76.592 42.194-90.924 42.194h-496c-44.112 0-80-35.888-80-80v-864c0-44.112 35.888-80 80-80h736c44.112 0 80 35.888 80 80v624c0 14.332-4.372 39.35-42.194 90.924zM785.374 785.374c30.7-30.7 54.8-58.398 72.58-81.374h-153.954v153.946c22.984-17.78 50.678-41.878 81.374-72.572zM896 16c0-8.672-7.328-16-16-16h-736c-8.672 0-16 7.328-16 16v864c0 8.672 7.328 16 16 16 0 0 495.956 0.002 496 0v-224c0-17.672 14.326-32 32-32h224v-624zM736 128h-448c-17.672 0-32 14.326-32 32s14.328 32 32 32h448c17.674 0 32-14.326 32-32s-14.326-32-32-32zM736 256h-448c-17.672 0-32 14.326-32 32s14.328 32 32 32h448c17.674 0 32-14.326 32-32s-14.326-32-32-32zM736 384h-448c-17.672 0-32 14.326-32 32s14.328 32 32 32h448c17.674 0 32-14.326 32-32s-14.326-32-32-32z" />
11
+ <glyph unicode="&#xe927;" glyph-name="file-picture" d="M832 64h-640v128l192 320 263-320 185 128v-256zM832 480c0-53.020-42.98-96-96-96-53.022 0-96 42.98-96 96s42.978 96 96 96c53.020 0 96-42.98 96-96zM917.806 730.924c-22.212 30.292-53.174 65.7-87.178 99.704s-69.412 64.964-99.704 87.178c-51.574 37.82-76.592 42.194-90.924 42.194h-496c-44.112 0-80-35.888-80-80v-864c0-44.112 35.888-80 80-80h736c44.112 0 80 35.888 80 80v624c0 14.332-4.372 39.35-42.194 90.924zM785.374 785.374c30.7-30.7 54.8-58.398 72.58-81.374h-153.954v153.946c22.984-17.78 50.678-41.878 81.374-72.572zM896 16c0-8.672-7.328-16-16-16h-736c-8.672 0-16 7.328-16 16v864c0 8.672 7.328 16 16 16 0 0 495.956 0.002 496 0v-224c0-17.672 14.326-32 32-32h224v-624z" />
12
+ <glyph unicode="&#xe928;" glyph-name="file-music" d="M917.806 730.924c-22.21 30.292-53.174 65.7-87.178 99.704s-69.412 64.964-99.704 87.178c-51.574 37.82-76.592 42.194-90.924 42.194h-496c-44.112 0-80-35.888-80-80v-864c0-44.112 35.886-80 80-80h736c44.112 0 80 35.888 80 80v624c0 14.332-4.372 39.35-42.194 90.924v0zM785.374 785.374c30.7-30.7 54.8-58.398 72.58-81.374h-153.954v153.946c22.982-17.78 50.678-41.878 81.374-72.572v0zM896 16c0-8.672-7.328-16-16-16h-736c-8.672 0-16 7.328-16 16v864c0 8.672 7.328 16 16 16 0 0 495.956 0.002 496 0v-224c0-17.672 14.324-32 32-32h224v-624zM756.288 568.748c-7.414 6.080-17.164 8.514-26.562 6.632l-320-64c-14.958-2.994-25.726-16.126-25.726-31.38v-236.876c-18.832 8.174-40.678 12.876-64 12.876-70.692 0-128-42.98-128-96s57.308-96 128-96 128 42.98 128 96v229.766l256 51.202v-133.842c-18.832 8.174-40.678 12.876-64 12.876-70.692 0-128-42.98-128-96s57.308-96 128-96 128 42.98 128 96v319.998c0 9.586-4.298 18.668-11.712 24.748z" />
13
+ <glyph unicode="&#xe92a;" glyph-name="file-video" d="M917.806 730.924c-22.208 30.292-53.174 65.7-87.178 99.704s-69.412 64.964-99.704 87.178c-51.574 37.82-76.594 42.194-90.924 42.194h-496c-44.112 0-80-35.888-80-80v-864c0-44.112 35.882-80 80-80h736c44.112 0 80 35.888 80 80v624c0 14.332-4.372 39.35-42.194 90.924v0 0zM785.374 785.374c30.7-30.7 54.8-58.398 72.58-81.374h-153.954v153.946c22.98-17.78 50.678-41.878 81.374-72.572v0 0zM896 16c0-8.672-7.328-16-16-16h-736c-8.672 0-16 7.328-16 16v864c0 8.672 7.328 16 16 16 0 0 495.956 0.002 496 0v-224c0-17.672 14.32-32 32-32h224v-624zM256 448h320v-320h-320v320zM576 320l192 128v-320l-192 128z" />
14
+ <glyph unicode="&#xe92b;" glyph-name="file-zip" d="M917.806 730.924c-22.208 30.292-53.174 65.7-87.178 99.704s-69.412 64.964-99.704 87.178c-51.574 37.82-76.592 42.194-90.924 42.194h-496c-44.112 0-80-35.888-80-80v-864c0-44.112 35.884-80 80-80h736c44.112 0 80 35.888 80 80v624c0 14.332-4.372 39.35-42.194 90.924v0 0zM785.374 785.374c30.7-30.7 54.8-58.398 72.58-81.374h-153.954v153.946c22.98-17.78 50.678-41.878 81.374-72.572v0 0zM896 16c0-8.672-7.328-16-16-16h-736c-8.672 0-16 7.328-16 16v864c0 8.672 7.328 16 16 16 0 0 495.956 0.002 496 0v-224c0-17.672 14.322-32 32-32h224v-624zM256 896h128v-64h-128v64zM384 832h128v-64h-128v64zM256 768h128v-64h-128v64zM384 704h128v-64h-128v64zM256 640h128v-64h-128v64zM384 576h128v-64h-128v64zM256 512h128v-64h-128v64zM384 448h128v-64h-128v64zM256 112c0-26.4 21.6-48 48-48h160c26.4 0 48 21.6 48 48v160c0 26.4-21.6 48-48 48h-80v64h-128v-272zM448 192v-64h-128v64h128z" />
15
+ <glyph unicode="&#xe92d;" glyph-name="paste" d="M704 832h-128v64c0 35.2-28.8 64-64 64h-128c-35.204 0-64-28.8-64-64v-64h-128v-128h512v128zM512 832h-128v63.886c0.034 0.038 0.072 0.078 0.114 0.114h127.768c0.042-0.036 0.082-0.076 0.118-0.114v-63.886zM832 640v160c0 17.6-14.4 32-32 32h-64v-64h32v-128h-192l-192-192v-256h-256v576h32v64h-64c-17.602 0-32-14.4-32-32v-640c0-17.6 14.398-32 32-32h288v-192h640v704h-192zM576 549.49v-101.49h-101.49l101.49 101.49zM960 0h-512v384h192v192h320v-576z" />
16
+ <glyph unicode="&#xe950;" glyph-name="alarm" d="M512 832c-247.424 0-448-200.576-448-448s200.576-448 448-448 448 200.576 448 448-200.576 448-448 448zM512 24c-198.824 0-360 161.178-360 360 0 198.824 161.176 360 360 360 198.822 0 360-161.176 360-360 0-198.822-161.178-360-360-360zM934.784 672.826c16.042 28.052 25.216 60.542 25.216 95.174 0 106.040-85.96 192-192 192-61.818 0-116.802-29.222-151.92-74.596 131.884-27.236 245.206-105.198 318.704-212.578v0zM407.92 885.404c-35.116 45.374-90.102 74.596-151.92 74.596-106.040 0-192-85.96-192-192 0-34.632 9.174-67.122 25.216-95.174 73.5 107.38 186.822 185.342 318.704 212.578zM512 384v256h-64v-320h256v64z" />
17
+ </font></defs></svg>
assets/fonts/icons.ttf ADDED
Binary file
assets/fonts/icons.woff ADDED
Binary file
assets/images/animation.gif ADDED
Binary file
assets/images/grippy_large.png ADDED
Binary file
assets/images/multiple-choice.png ADDED
Binary file
assets/images/placeholder-300x300.jpg ADDED
Binary file
assets/images/placeholder-400x250.jpg ADDED
Binary file
assets/images/placeholder-800x450.jpg ADDED
Binary file
assets/images/placeholder.jpg ADDED
Binary file
assets/images/question.png ADDED
Binary file
assets/images/single-choice.png ADDED
Binary file
assets/images/stripe.png ADDED
Binary file
assets/images/true-false.png ADDED
Binary file
assets/js/admin/admin.js ADDED
@@ -0,0 +1,824 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;(function($){
2
+ var LP_Admin = window.LP_Admin = {
3
+ init: function(){
4
+ var $doc = $(document);
5
+ $doc.on('click', '#learn-press-install-sample-data-notice a', this._importCourses )
6
+ .on('click', '.learn-press-admin-notice-dismiss', this._dismissNotice)
7
+ .on('click', '[data-remove-confirm]', this._confirm);
8
+ setTimeout(function() {
9
+ $('[data-remove-confirm]').each(function () {
10
+ })
11
+ }, 1000);
12
+ },
13
+ _confirm: function(e){
14
+ e.preventDefault();
15
+ return false;
16
+ },
17
+ _dismissNotice: function(e){
18
+
19
+ var $notice = $(e.target),
20
+ context = $notice.attr('data-context'),
21
+ transient = $notice.attr('data-transient');
22
+ if(context){
23
+ $.ajax({
24
+ url: LearnPress_Settings.ajax,
25
+ data: {
26
+ action: 'learnpress_dismiss_notice',
27
+ context: context,
28
+ transient: transient
29
+ },
30
+ success: function(response){
31
+ $notice.closest('.updated').fadeOut();
32
+ $notice.closest('.error').fadeOut();
33
+ }
34
+ });
35
+ return false;
36
+ }
37
+ },
38
+ _importCourses: function(e){
39
+ var $container = $('#learn-press-install-sample-data-notice'),
40
+ action = $(this).attr('data-action');
41
+ if( !action ){
42
+ return;
43
+ }
44
+ e.preventDefault();
45
+
46
+ if( action == 'yes' ) {
47
+ $container
48
+ .find('.install-sample-data-notice').slideUp()
49
+ .siblings('.install-sample-data-loading').slideDown()
50
+ }else{
51
+ $('#learn-press-install-sample-data-notice').fadeOut();
52
+ }
53
+ $.ajax({
54
+ url: ajaxurl,
55
+ dataType: 'html',
56
+ type: 'post',
57
+ data:{
58
+ action: 'learnpress_install_sample_data',
59
+ yes: action
60
+ },
61
+ success: function(response){
62
+ response = LearnPress.parseJSON(response);
63
+ if( response.url ){
64
+ $.ajax({
65
+ url: response.url,
66
+ success: function(){
67
+ $container
68
+ .find('.install-sample-data-notice').html(response.message).slideDown()
69
+ .siblings('.install-sample-data-loading').slideUp();
70
+ }
71
+ });
72
+ }else {
73
+ $container
74
+ .find('.install-sample-data-notice').html(response.message).slideDown()
75
+ .siblings('.install-sample-data-loading').slideUp();
76
+ }
77
+ }
78
+ })
79
+ }
80
+ }
81
+ var $doc = $(document);
82
+ function _ready(){
83
+ LP_Admin.init();
84
+ $(document).on('click', '.learn-press-add-ons .plugin-action-buttons a', function(e){
85
+ e.preventDefault();
86
+ var $plugin = $(this).closest('.plugin-card');
87
+ if( $(this).hasClass('button-working') ){
88
+ return;
89
+ }
90
+ $(this).addClass('button-working disabled');
91
+ $.ajax({
92
+ url: $(this).attr('href'),
93
+ data: {},
94
+ success: function(r){
95
+ $.ajax({
96
+ url: window.location.href,
97
+ success: function(r){
98
+ var $p = $(r).find('#'+$plugin.attr('id'));
99
+ if( $p.length ) {
100
+ $plugin.replaceWith($p)
101
+ }
102
+ }
103
+ })
104
+ }
105
+ });
106
+ });
107
+ var $sandbox_mode = $('#learn_press_paypal_sandbox_mode'),
108
+ $paypal_type = $('#learn_press_paypal_type');
109
+ $paypal_type.change(function(){
110
+ $('.learn_press_paypal_type_security').toggleClass( 'hide-if-js', 'security' != this.value );
111
+ });
112
+ $sandbox_mode.change(function(){
113
+ this.checked ? $('.sandbox input').removeAttr( 'readonly' ) : $('.sandbox input').attr( 'readonly', true );
114
+ });
115
+
116
+ $('#learn_press_paypal_enable').change(function(){
117
+ var $rows = $(this).closest('tr').siblings('tr');
118
+ if( this.checked ){
119
+ $rows.css("display", "");
120
+ }else{
121
+ $rows.css("display", "none");
122
+ }
123
+ }).trigger('change');
124
+
125
+ $('.learn-press-toggle-lesson-preview').on('change', function(){
126
+ $.ajax({
127
+ url: LearnPress_Settings.ajax,
128
+ data: {
129
+ action: 'learnpress_toggle_lesson_preview',
130
+ lesson_id: this.value,
131
+ previewable: this.checked ? 'yes' : 'no',
132
+ nonce: $(this).attr('data-nonce')
133
+ },
134
+ dataType: 'text',
135
+ success: function(response){
136
+ response = LearnPress.parseJSON(response);
137
+ }
138
+ });
139
+ });
140
+ }
141
+ $doc.ready(_ready);
142
+ })(jQuery);
143
+
144
+ /**
145
+ * Created by foobla on 3/10/2015.
146
+ */
147
+
148
+ if( typeof LearnPress == 'undefined' ) LearnPress = {};
149
+
150
+ jQuery(document).ready(function ($) {
151
+ $('.meta_box_edit').click(function (event) {
152
+ event.preventDefault();
153
+ LearnPress.log("haha");
154
+ var post_id = jQuery(this).closest('select').val();
155
+ var edit_link = jQuery('.meta_box_course_lesson_quiz').attr('site_url');
156
+ edit_link += "wp-admin/post.php?post=" + post_id + "&action=edit";
157
+ var new_window = window.open(edit_link);
158
+ LearnPress.log(post_id);
159
+ })
160
+ });
161
+
162
+ jQuery(document).ready(function ($) {
163
+ $("[name='lpr_settings[payment][method]']").click(function () {
164
+ $(".payments").css("display", "none");
165
+ var check = $(this).val();
166
+ $("[id*=" + check + "]").css("display", "");
167
+ });
168
+ $(".payments").css("display", "none");
169
+ var check = $("[name='lpr_settings[payment][method]']:checked").val();
170
+ $("[id*=" + check + "]").css("display", "");
171
+ });
172
+
173
+
174
+ jQuery(document).ready(function ($) {
175
+ $('#wp-admin-bar-be_teacher').click(function () {
176
+ $.ajax({
177
+ url : ajaxurl,
178
+ data : {
179
+ action: 'learnpress_be_teacher'
180
+ },
181
+ success: function () {
182
+ alert('You Are An Instructor Now');
183
+ setTimeout(function () {
184
+ location.reload();
185
+ }, 500);
186
+ }
187
+ })
188
+ });
189
+ });
190
+
191
+ jQuery(document).ready(function ($) {
192
+ $('.lpr-set-up').click(function (evt) {
193
+ evt.preventDefault();
194
+ var $link = $(this);
195
+ $.ajax({
196
+ url : ajaxurl,
197
+ data : {
198
+ action: 'learnpress_ignore_setting_up'
199
+ },
200
+ success: function () {
201
+ if( $link.attr('href') ){
202
+ window.location.href = $link.attr('href');
203
+ }else {
204
+ $('#lpr-setting-up').remove();
205
+ }
206
+ }
207
+ })
208
+ });
209
+ });
210
+
211
+ jQuery(document).ready(function ($){
212
+ var input = $('#_lpr_course_condition');
213
+ $('[name=_lpr_course_final]').change(function (){
214
+ if($('[value=yes]').is(':checked')){
215
+ input.prop('disabled', false);
216
+ } else {
217
+ input.prop('disabled', true);
218
+ }
219
+ })
220
+ });
221
+
222
+ jQuery(document).ready(function($){
223
+ $('#lpr-custom-time').submit(function(){
224
+ $.ajax({
225
+ url: ajaxurl,
226
+ data: $(this).serialize(),
227
+ success:function(response){
228
+ drawStudentsChart(response, config)
229
+ },
230
+ type: 'POST',
231
+ dataType: 'json'
232
+ })
233
+ return false;
234
+ })
235
+
236
+ return;
237
+ // admin notice install sample data
238
+
239
+
240
+ var $checked = null;
241
+ $checked = $('input[name="_lpr_course_enrolled_require"]').bind('click change', function () {
242
+
243
+ var payment_field = $('.lpr-course-payment-field').toggleClass('hide-if-js', !( $(this).val() != 'no' ));
244
+ if (payment_field.is(':visible')) {
245
+ $('input[name="_lpr_course_payment"]:checked', payment_field).trigger('change')
246
+ } else {
247
+ $('.lpr-course-price-field').addClass('hide-if-js');
248
+ }
249
+
250
+ });
251
+ $checked.filter(':checked').trigger('change');
252
+ if ($checked.length == 0) {
253
+ $('input[name="_lpr_course_enrolled_require"][value="yes"]').trigger('click');
254
+ }
255
+
256
+ $('input[name="_lpr_course_payment"]').bind('click change', function () {
257
+ $('.lpr-course-price-field').toggleClass('hide-if-js', !( $(this).val() != 'free' ) || ( $('input[name="_lpr_course_enrolled_require"]:checked').val() == 'no' ));
258
+ }).filter(':checked').trigger('change');
259
+
260
+ $checked.closest('.rwmb-field').removeClass('hide-if-js');
261
+
262
+ });
263
+
264
+ //javascript hook functions
265
+ var lprHook = {
266
+ hooks : {action: {}, filter: {}},
267
+ addAction : function (action, callable, priority, tag) {
268
+ lprHook.addHook('action', action, callable, priority, tag);
269
+ },
270
+ addFilter : function (action, callable, priority, tag) {
271
+ lprHook.addHook('filter', action, callable, priority, tag);
272
+ },
273
+ doAction : function (action) {
274
+ lprHook.doHook('action', action, arguments);
275
+ },
276
+ applyFilters: function (action) {
277
+ return lprHook.doHook('filter', action, arguments);
278
+ },
279
+ removeAction: function (action, tag) {
280
+ lprHook.removeHook('action', action, tag);
281
+ },
282
+ removeFilter: function (action, priority, tag) {
283
+ lprHook.removeHook('filter', action, priority, tag);
284
+ },
285
+ addHook : function (hookType, action, callable, priority, tag) {
286
+ if (undefined == lprHook.hooks[hookType][action]) {
287
+ lprHook.hooks[hookType][action] = [];
288
+ }
289
+ var hooks = lprHook.hooks[hookType][action];
290
+ if (undefined == tag) {
291
+ tag = action + '_' + hooks.length;
292
+ }
293
+ lprHook.hooks[hookType][action].push({tag: tag, callable: callable, priority: priority});
294
+ },
295
+ doHook : function (hookType, action, args) {
296
+
297
+ // splice args from object into array and remove first index which is the hook name
298
+ args = Array.prototype.slice.call(args, 1);
299
+
300
+ if (undefined != lprHook.hooks[hookType][action]) {
301
+ var hooks = lprHook.hooks[hookType][action], hook;
302
+ //sort by priority
303
+ hooks.sort(function (a, b) {
304
+ return a["priority"] - b["priority"]
305
+ });
306
+ for (var i = 0; i < hooks.length; i++) {
307
+ hook = hooks[i].callable;
308
+ if (typeof hook != 'function')
309
+ hook = window[hook];
310
+ if ('action' == hookType) {
311
+ hook.apply(null, args);
312
+ } else {
313
+ args[0] = hook.apply(null, args);
314
+ }
315
+ }
316
+ }
317
+ if ('filter' == hookType) {
318
+ return args[0];
319
+ }
320
+ },
321
+ removeHook : function (hookType, action, priority, tag) {
322
+ if (undefined != lprHook.hooks[hookType][action]) {
323
+ var hooks = lprHook.hooks[hookType][action];
324
+ for (var i = hooks.length - 1; i >= 0; i--) {
325
+ if ((undefined == tag || tag == hooks[i].tag) && (undefined == priority || priority == hooks[i].priority)) {
326
+ hooks.splice(i, 1);
327
+ }
328
+ }
329
+ }
330
+ }
331
+ };
332
+ //end of javascript hook functions
333
+
334
+ function _lprAdminQuestionHTML($dom, type) {
335
+ switch (type) {
336
+ case 'true_or_false':
337
+ $dom.lprTrueOrFalseQuestion();
338
+ break;
339
+ case 'multi_choice':
340
+ $dom.lprMultiChoiceQuestion();
341
+ break;
342
+ case 'single_choice':
343
+ $dom.lprSingleChoiceQuestion();
344
+ break;
345
+ }
346
+ }
347
+ lprHook.addAction('lpr_admin_question_html', _lprAdminQuestionHTML);
348
+ lprHook.addAction('lpr_admin_quiz_question_html', _lprAdminQuestionHTML);
349
+
350
+ ;
351
+ (function ($) {
352
+ var $doc = $(document),
353
+ $body = $(document.body);
354
+ $.fn.scrollTo = function(options){
355
+ return this.each(function(){
356
+ options = $.extend({
357
+ delay: 0,
358
+ offset: 0,
359
+ speed: 'slow'
360
+ }, options || {});
361
+
362
+ $('body')
363
+ .fadeIn( 0 )
364
+ .delay( options.delay )
365
+ .animate({
366
+ scrollTop: $(this).offset().top - options.offset
367
+ }, options.speed);
368
+
369
+ return this;
370
+ })
371
+ }
372
+
373
+
374
+ $.lprShowBlock = function ($form) {
375
+ var $block = $("#lpr-block");
376
+
377
+ if (!$block.get(0)) {
378
+ $block = $('<div id="lpr-block" />').appendTo($body).hide();
379
+ $block.click($.lprHideBlock);
380
+
381
+
382
+ }
383
+ $block.show().data('form', $form);
384
+
385
+ return $block;
386
+ }
387
+ $.lprHideBlock = function () {
388
+ var $block = $("#lpr-block");
389
+ if (!$block.get(0)) return;
390
+ $block.hide();
391
+ if ($block.data('form')) $block.data('form').hide();
392
+ $block.data('form', 0);
393
+ return $block;
394
+ }
395
+
396
+ $.fn.lprFancyCheckbox = function (options) {
397
+ var defaults = {
398
+ newElementClass : 'tog',
399
+ activeElementClass: 'on'
400
+ };
401
+ var options = $.extend(defaults, options);
402
+ this.each(function () {
403
+ //Assign the current checkbox to obj
404
+ var obj = $(this);
405
+ //Create new span element to be styled
406
+ var newObj = $('<div/>', {
407
+ 'id' : obj.attr('id'),
408
+ 'class': 'lpr-fancy-checkbox ' + options.newElementClass
409
+ }).insertAfter(this).data('input', this);
410
+ //Make sure pre-checked boxes are rendered as checked
411
+ if (obj.is(':checked')) {
412
+ newObj.addClass(options.activeElementClass);
413
+ }
414
+ obj.hide(); //Hide original checkbox
415
+ //Labels can be painful, let's fix that
416
+ if ($('[for=' + obj.attr('id') + ']').length) {
417
+
418
+ var label = $('[for=' + obj.attr('id') + ']');
419
+ label.click(function () {
420
+ newObj.trigger('click'); //Force the label to fire our element
421
+ return false;
422
+ });
423
+ }
424
+ //Attach a click handler
425
+ newObj.click(function () {
426
+ //Assign current clicked object
427
+ var obj = $(this);
428
+ //Check the current state of the checkbox
429
+ if (obj.hasClass(options.activeElementClass)) {
430
+ obj.removeClass(options.activeElementClass);
431
+ $(obj.data('input')).attr('checked', false).trigger('change');
432
+ } else {
433
+ obj.addClass(options.activeElementClass);
434
+ $(obj.data('input')).attr('checked', true).trigger('change');
435
+ }
436
+ //Kill the click function
437
+ return false;
438
+ });
439
+ });
440
+ }
441
+
442
+ $doc.ready(function () {
443
+ $body = $(document.body);
444
+
445
+ $('input.lpr-fancy-checkbox')
446
+ .on('change', function () {
447
+ var $chk = $(this),
448
+ state = $(this).data('state'),
449
+ checked = $(this).is(':checked');
450
+ $.ajax({
451
+ url: ajaxurl,
452
+ data: {
453
+ url: $chk.attr('data-url'),
454
+ plugin: $chk.attr('data-plugin'),
455
+ t: checked ? 'activate' : 'deactivate',
456
+ action: 'learnpress_update_add_on_status'
457
+ },
458
+ success: function(response){
459
+
460
+ $chk.attr('data-url', response.url)
461
+ .attr('state', response.status)
462
+
463
+ }
464
+ })
465
+ })
466
+ .lprFancyCheckbox();
467
+ $('#learn-press-add-ons-wrap').on('click', '.plugin-action-buttons a', function(evt){
468
+ evt.preventDefault();
469
+ var $link = $(this), action = $link.data('action');
470
+ if( ! action ) return;
471
+ $link.addClass('disabled spinner');
472
+ $.ajax({
473
+ url: $link.attr('href'),
474
+ dataType: 'html',
475
+ success: function(response){
476
+ if(action == 'install-now' || action == 'update-now' || action == 'active-now'){
477
+ if( $link.hasClass('thimpress') ){
478
+ response = LearnPress.parseJSON( response );
479
+ $link.removeClass( 'spinner' );
480
+ if( response.status == 'activate' ){
481
+ $link.addClass('disabled').html(response.status_text).removeAttr('href').removeAttr('data-action');
482
+ $('.addon-status', $link.closest('.action-links')).html(response.status_text).addClass('enabled');
483
+ }else{
484
+ $link.removeClass('disabled');
485
+ }
486
+ }
487
+ }
488
+ }
489
+ })
490
+ });
491
+
492
+ $('#learn-press-bundle-activate-add-ons').click(function(){
493
+ var $button = $(this);
494
+ $button.addClass('spinner').attr('disabled', 'disabled');
495
+ $.ajax({
496
+ url: ajaxurl,
497
+ data: {
498
+ action: 'learnpress_bundle_activate_add_ons'
499
+ },
500
+ dataType: 'html',
501
+ success: function(response){
502
+ response = LearnPress.parseJSON( response );
503
+ if( response.addons ){
504
+ for(var slug in response.addons ){
505
+ var plugin = response.addons[slug];
506
+ if( 'activate' == plugin.status ){
507
+ $('.plugin-card-'+slug).find('.install-now.thimpress, .active-now.thimpress').addClass('disabled').attr('href', '').html(plugin.status_text);
508
+ }else{
509
+
510
+ }
511
+ }
512
+ }
513
+ $button.removeClass('spinner').removeAttr('disabled');
514
+ }
515
+ })
516
+ });
517
+ (function() {
518
+ var boxes = $('.post-type-lpr_quiz, .post-type-lpr_course, .post-type-lpr_lesson, .post-type-lpr_question').find('#postbox-container-1');
519
+ if( !boxes.length ) return;
520
+ var $win = $(window),
521
+ $container = $('#poststuff'),
522
+ currentOffset = 0;
523
+ $(window).scroll(function () {
524
+ var container_height = $container.height(),
525
+ dir = $win.scrollTop() > currentOffset ? 'down' : 'up';
526
+ currentOffset = $win.scrollTop();
527
+
528
+ boxes.each(function(){
529
+ var $box = $(this),
530
+ box_height = $box.height(),
531
+ container_height = $container.height(),
532
+ max_scroll = container_height - box_height - 10,
533
+ scroll_top = $win.scrollTop(),
534
+ offset = ( scroll_top - $container.offset().top - $box.height() ) + $win.height();
535
+ if( max_scroll <= 0 ) return;
536
+ if( box_height < $win.height() ) offset = scroll_top - $container.offset().top + 50;
537
+ else{
538
+ if( offset >= max_scroll ) offset = max_scroll;
539
+ }
540
+ $box.css("margin-top", Math.max( 0, offset ) );
541
+ })
542
+ })
543
+ })();
544
+
545
+ $('.lpr-dropdown-pages').each( function(){
546
+ var $select = $(this),
547
+ $form = $select.siblings('.lpr-quick-add-page-inline'),
548
+ $actions = $select.siblings('.lpr-quick-actions-inline');
549
+ function add_page_to_all_dropdowns( response ){
550
+ var pos = $.inArray( response.page.ID.toString() + "", response.ordering );
551
+ $('.lpr-dropdown-pages').each(function() {
552
+ var $select = $(this),
553
+ $new_option = $('<option value="'+response.page.ID+'">'+response.page.post_title+'</option>')
554
+ if (pos == 0) {
555
+ $('option', $select).each(function () {
556
+ if (parseInt($(this).val())) {
557
+ $new_option.insertBefore($(this));
558
+ return false;
559
+ }
560
+ })
561
+ } else if (pos == response.ordering.length - 1) {
562
+ $select.append($new_option);
563
+ } else {
564
+ $new_option.insertAfter($('option[value="' + response.ordering[pos - 1] + '"]', $select));
565
+ }
566
+ });
567
+ }
568
+ $select.click(function(){
569
+ $select.data('value', this.value)
570
+ }).change(function(){
571
+ var option = $(this).val();
572
+ $actions.addClass('hide-if-js');
573
+ if( option == 'add_new_page'){
574
+ $form.removeClass('hide-if-js').find('input').val('').focus();
575
+ $(this).attr('disabled', true);
576
+ }else if( ! isNaN(option) ){
577
+ $.ajax({
578
+ url: ajaxurl,
579
+ data: {
580
+ action: 'learnpress_get_page_permalink',
581
+ page_id: option
582
+ },
583
+ success: function(response) {
584
+ if( response ) {
585
+ $actions.html(response).removeClass('hide-if-js')
586
+ }
587
+ },
588
+ dataType: 'html'
589
+ })
590
+ }
591
+ })//.trigger('change');
592
+ $form.on('keypress', 'input', function(evt){
593
+ if( evt.keyCode == 13 ){
594
+ evt.preventDefault();
595
+ $(this).siblings('button').trigger('click');
596
+ }
597
+ }).on('keydown', 'input', function(evt){
598
+ if( evt.keyCode == 27 ){
599
+ $(this).siblings('a').trigger('click');
600
+ }
601
+ });
602
+ $('button', $form).click(function(){
603
+ var $input = $(this).siblings('input');
604
+ if( ! $input.val().length ){
605
+ $input.focus();
606
+ return;
607
+ }
608
+ $form.block_ui();
609
+ $.ajax(ajaxurl, {
610
+ data: {
611
+ action: 'learnpress_create_page',
612
+ title: $input.val()
613
+ },
614
+ success:function( response ){
615
+ if(response.page){
616
+ add_page_to_all_dropdowns( response );
617
+ $select.removeAttr('disabled').val(response.page.ID);
618
+ $form.addClass('hide-if-js');
619
+ $actions.html(response.html).removeClass('hide-if-js');
620
+ }else{
621
+ alert(response.error);
622
+ $select.removeAttr('disabled').val( $select.data('value'));
623
+ if( $select.data('value') ) $actions.removeClass('hide-if-js');
624
+ }
625
+ $form.unblock_ui();
626
+ },
627
+ dataType: 'json',
628
+ type: 'post'
629
+ })
630
+ });
631
+ $('a', $form).click(function(evt){
632
+ evt.preventDefault();
633
+ $(this).parent().addClass('hide-if-js');
634
+ $select.removeAttr('disabled').val( $select.data('value') );
635
+ if( $select.data('value') ) $actions.removeClass('hide-if-js');
636
+ })
637
+ })
638
+
639
+ })
640
+
641
+ $.extend( LearnPress, {
642
+ parse_json: function(response){
643
+ if( typeof reposnse == 'object' ) return response;
644
+ try {
645
+ var m = response.match(/<!-- LP_AJAX_START -->(.*)<!-- LP_AJAX_END -->/)
646
+
647
+ if (m && m[1]) {
648
+ response = JSON.parse(m[1])
649
+ } else {
650
+ response = JSON.parse(response)
651
+ }
652
+ }catch(e){ response = false }
653
+ return response;
654
+ },
655
+ block_page: function(args){
656
+ var block_page = $( '#lpr-page-block' );
657
+ if( block_page.length == 0 ){
658
+ block_page = $( wp.template( 'page-block' )()).appendTo($body);
659
+ block_page.click($.proxy( function(){ this.unblock_page() }, this ));
660
+ }
661
+ args = $.extend( {
662
+ on_close: function () {
663
+
664
+ },
665
+ backgroundColor: undefined,
666
+ opacity: undefined
667
+ }, args || {} );
668
+ $.each(['backgroundColor', 'opacity'], function(){
669
+ block_page.css( this, args[this] );
670
+ })
671
+ block_page.data('args', args).show();
672
+ },
673
+ unblock_page: function(args){
674
+ args = $.extend( {
675
+
676
+ }, args || {} );
677
+ var block_page = $( '#lpr-page-block'),
678
+ stored_args = block_page.data('args');
679
+ block_page.hide();
680
+
681
+ if( stored_args ){
682
+ $.each(['backgroundColor', 'opacity'], function(){
683
+ block_page.css( this, '' );
684
+ });
685
+ $.isFunction(stored_args.on_close) && stored_args.on_close.call(block_page);
686
+ }
687
+ },
688
+ showLessonQuiz: function( pos, ed ){
689
+ var textNode = $(ed.selection.getNode()),
690
+ iframe = $('#content_ifr'),
691
+ form = $('#form-quick-add-lesson-link'),
692
+ offset = textNode.offset(),
693
+ iframe_offset = iframe.offset(),
694
+ range = ed.selection.getRng();
695
+ ed.execCommand('mceInsertContent', false,'<span id="learn_press_book_mark"></span>');
696
+ offset = $( '#learn_press_book_mark', textNode).position();
697
+ $( '#learn_press_book_mark', textNode).remove();
698
+ ed.selection.setRng(range);
699
+ if( form.length == 0 ){
700
+ form = $( wp.template('form-quick-add-lesson-link')()).css({zIndex: 99999}).appendTo($body);
701
+ $('select', form).select2({
702
+ width: 300,
703
+ containerCssClass: 'lpr-container-dropdown',
704
+ dropdownCssClass: 'lpr-select-dropdown'
705
+ })
706
+ .on('select2-close', function(){
707
+ $('#form-quick-add-lesson-link').hide();
708
+ tinyMCE.activeEditor.focus();
709
+ })
710
+ .on('select2-selecting', function(e){
711
+ var lesson_id = e.val;
712
+ if( !lesson_id ) return;
713
+ var ed = tinymce.activeEditor,
714
+ shortcode = '[quick_lesson_link id="'+lesson_id + '"]',
715
+ range = ed.selection.getRng();
716
+ range.startContainer.nodeValue = range.startContainer.nodeValue.replace(/@l/, '');
717
+ ed.selection.setCursorLocation( range.startContainer, range.startContainer.nodeValue.length )
718
+ ed.selection.setContent(shortcode)
719
+ $('#form-quick-add-lesson-link').hide();
720
+ });
721
+ }
722
+ form.css({
723
+ top: iframe_offset.top + offset.top,
724
+ left: iframe_offset.left + offset.left + 40
725
+ }).show();
726
+ $('select', form).select2('open');
727
+ }
728
+ });
729
+
730
+ $(document).ready(function(){
731
+ var $add_new_h2 = $('body.post-type-lpr_course').find('.page-title-action, .add-new-h2'),
732
+ $reset_h2 = $('<a href="" class="page-title-action add-new-h2">Reset</a>');
733
+
734
+ $reset_h2
735
+ .insertAfter($add_new_h2)
736
+ .click(function(evt){
737
+ evt.preventDefault();
738
+ var link = window.location.href.replace(/reset-course-data=([0-9]+)/, '');
739
+ link += '&reset-course-data=' + $('input#post_ID').val();
740
+ window.location.href = link;
741
+ });
742
+ })
743
+ })(jQuery)
744
+
745
+ ;(function() {
746
+ if( typeof tinymce == 'undefined' ){
747
+ return;
748
+ }
749
+ tinymce.PluginManager.add('embed', function( editor )
750
+ {
751
+ editor.addButton('embed', {
752
+ type: 'button',
753
+ text: 'Embed',
754
+ onclick: function(event) {
755
+ editor.windowManager.open({
756
+ title: 'Your video embed link',
757
+ body: [
758
+ {type: 'textbox', name: 'link', label: 'Your video embed link'}
759
+ ],
760
+ onsubmit: function(e) {
761
+ // Insert content when the window form is submitted
762
+ editor.insertContent('[embed_video link=' + e.data.link + ']');
763
+ }
764
+ });
765
+ }
766
+ });
767
+ });
768
+ })();
769
+
770
+ /* pointer.js */
771
+ jQuery(document).ready( function($) {
772
+ if( typeof lpPointer == 'undefined' ){
773
+ return;
774
+ }
775
+ learn_press_open_pointer(0);
776
+ function learn_press_open_pointer(i) {
777
+ pointer = lpPointer.pointers[i];
778
+ options = $.extend( pointer.options, {
779
+ close: function() {
780
+ $.post( ajaxurl, {
781
+ pointer: pointer.pointer_id,
782
+ action: 'dismiss-wp-pointer'
783
+ });
784
+ }
785
+ });
786
+
787
+ $(pointer.target).pointer( options ).pointer('open');
788
+ }
789
+ });
790
+
791
+ /* ui.js */
792
+ (function( $ ){
793
+ $.fn.extend({
794
+ iosCheckbox: function ( ) {
795
+ $(this).each(function (){
796
+ var $checkbox = $(this),
797
+ $ui = $("<div>",{class: 'ios-ui-select'}).append($("<div>",{class: 'inner'}));
798
+ if ($checkbox.is(":checked")){
799
+ $ui.addClass("checked");
800
+ }
801
+ $checkbox.after($ui)
802
+ .on('update', function(){
803
+ $ui.trigger('update')
804
+ })//.hide().appendTo($ui);
805
+ $ui.on('click update', function (){
806
+ $ui.toggleClass("checked");
807
+ $checkbox.prop('checked', $ui.hasClass("checked")).trigger('change')
808
+ });
809
+ });
810
+ }
811
+ });
812
+
813
+ $(document).ready(function(){
814
+ $('.learn-press-checkbox').iosCheckbox();
815
+
816
+ if ( typeof Switchery !== 'undefined' ) {
817
+ var elems = Array.prototype.slice.call( document.querySelectorAll('.rwmb-learnpress-switchbutton') );
818
+
819
+ elems.forEach(function(html) {
820
+ var switchery = new Switchery( html, { size: 'small' } );
821
+ });
822
+ }
823
+ });
824
+ })(jQuery);
assets/js/admin/meta-box-course.js ADDED
@@ -0,0 +1,1326 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;
2
+ (function ($) {
3
+ if (typeof LearnPress == 'undefined') {
4
+ LearnPress = {};
5
+ }
6
+ $(document).ready(function () {
7
+ if (typeof Backbone == 'undefined') return;
8
+ var LP_Curriculum_Model = window.LP_Curriculum_Model = Backbone.Model.extend({
9
+ defaults : {},
10
+ data : null,
11
+ view : false,
12
+ urlRoot : '',
13
+ initialize: function () {
14
+ },
15
+ removeItem: function (item) {
16
+ var items = this.get('selectedItems');
17
+ items = _.without(items, item);
18
+ this.set('selectedItems', items);
19
+ },
20
+ addItem : function (id) {
21
+ var items = this.get('selectedItems');
22
+ items.push(id);
23
+ this.set('selectedItems', items);
24
+ }
25
+ });
26
+
27
+ var LP_Curriculum_View = window.LP_Curriculum_View = Backbone.View.extend({
28
+ model : {},
29
+ events : {
30
+ 'keyup' : 'processKeyEvents',
31
+ 'click .lp-section-item .lp-remove' : '_removeItem',
32
+ 'click .lp-toggle' : 'toggleSection',
33
+ 'click .lp-course-curriculum-toggle a' : 'toggleSections',
34
+ 'keyup input.no-submit' : 'onEnterInput',
35
+ 'update input.no-submit' : 'onEnterInput',
36
+ 'keydown' : 'preventSubmit',
37
+ 'click .lp-add-buttons button' : 'sectionActionHandler',
38
+ 'click .lp-item-new .handle' : 'toggleItemType',
39
+ 'click .lp-button-add-item' : '_addNewItem',
40
+ 'click .item-bulk-actions button' : 'sectionBulkActions',
41
+ 'change .item-checkbox input' : 'toggleButtonBulkActions',
42
+ 'change .lp-check-items' : 'toggleButtonBulkActions',
43
+ 'click .lp-section-actions.lp-button-actions' : '_sectionActionHandler',
44
+ 'click .lp-section-item .section-item-icon span': '_changeItemType',
45
+ 'click .learn-press-dropdown-item-types > li a' : '_changeItemType',
46
+ 'change .lp-item-name ' : '_updateItem',
47
+ 'focus .lp-item-name' : '_focusItem',
48
+ 'blur .lp-item-name' : '_blurItem'
49
+ },
50
+ removeSectionIds : [],
51
+ removeItemIds : [],
52
+ el : '#lp-course-curriculum',
53
+ initialize : function (model) {
54
+ if (this.$el.length == 0) return;
55
+ this.model = model;
56
+ this.model.view = this;
57
+ this.listenTo(this.model, 'change', this.render);
58
+ this.render();
59
+ _.bindAll(this, 'render', 'searchItem', 'addItemsToSection', 'addItemToSection', 'addNewItem', 'toggleAddItemButtonState', 'getSelectedItems', '_sectionActionHandler', '_changeItemType', '_updateItem');
60
+ this.initPage();
61
+ LearnPress.Hook.addAction('learn_press_message_box_before_resize', this.resetModalSearch)
62
+ LearnPress.Hook.addAction('learn_press_message_box_resize', this.updateModalSearch);
63
+ $(document).on('learn_press_modal_search_items_response', this.addItemsToSection);
64
+ LearnPress.Hook.addFilter('learn_press_modal_search_items_exclude', this.getSelectedItems);
65
+ },
66
+ _focusItem : function (e) {
67
+ $(e.target).closest('tr').removeClass('focus');
68
+ },
69
+ _blurItem : function (e) {
70
+ //$(e.target).closest('tr').removeClass('focus');
71
+ },
72
+ _changeItemType : function (e) {
73
+ var $icon = $(e.target),
74
+ $row = $icon.closest('tr'),
75
+ type = $icon.attr('data-type'),
76
+ item_id = $row.attr('data-item_id');
77
+ if ($icon.hasClass('item-selected')) {
78
+ return;
79
+ }
80
+ if (item_id) {
81
+ //if (!confirm('Change type of item will replace all data. Sure?')) {
82
+ return;
83
+ //}
84
+ }
85
+ $row.attr({
86
+ 'data-type': type
87
+ }).find('.lp-item-type').val(type);
88
+ $icon.addClass('item-selected').parent().siblings().find('span').removeClass('item-selected');
89
+ var pos = $icon.parent().position(),
90
+ $rep = $icon.closest('.learn-press-dropdown-item-types').find('>span'),
91
+ $i = $icon.clone().removeAttr('title').insertAfter($icon).css({
92
+ position: 'absolute',
93
+ top : pos.top + 2,
94
+ left : pos.left + 2,
95
+ zIndex : 20
96
+ }).animate({
97
+ left: -32
98
+ });
99
+ $rep.fadeOut(function () {
100
+ $i.css({position: '', top: '', left: '', zIndex: ''});
101
+ $(this).replaceWith($i);
102
+ $row.removeClass('focus');
103
+ });
104
+ //$icon.closest('.learn-press-dropdown-item-types').find('>span').replaceWith();
105
+ },
106
+ _updateItem : function (e) {
107
+ var $inp = $(e.target),
108
+ item_name = $inp.val();
109
+ },
110
+ updateModalSearch : function (height, $app) {
111
+ $('.lp-modal-search ul').css('height', height - 120).css('overflow', 'auto');
112
+ },
113
+ resetModalSearch : function ($app) {
114
+ $('.lp-modal-search ul').css('height', '').css('overflow', '')
115
+ },
116
+ initPage : function () {
117
+ var that = this;
118
+ this.$form = $('#post');
119
+ this.$form.on('submit', $.proxy(function (e) {
120
+ if ($(e.target).hasClass('no-submit')) {
121
+ return false;
122
+ }
123
+ return this.onSave()
124
+ }, this));
125
+ $('input[name="_lp_course_result"]').bind('click change', function () {
126
+ return;
127
+ if ($(this).val() == 'yes') {
128
+ $(this).closest('.rwmb-field').next().removeClass('hide-if-js');
129
+ } else {
130
+ $(this).closest('.rwmb-field').next().hide();
131
+ }
132
+ }).filter(":checked").trigger('change');
133
+
134
+ ///////////
135
+ var $chkPayment = $('input[name="_lp_payment"]').on('change', function () {
136
+ var toggle = this.value != 'yes';
137
+ $('.lp-course-price-field').toggleClass('hide-if-js', toggle).attr('xxx', Math.random());
138
+ $('.lp-course-required-enroll').toggleClass('hide-if-js', !toggle);
139
+ })
140
+ $chkPayment.filter(':checked').trigger('change');
141
+
142
+ if ($('input[name="_lp_course_result"]:checked').length == 0) {
143
+ $('input[name="_lp_course_result"]').filter(function () {
144
+ return this.value == 'evaluate_lesson';
145
+ }).prop('checked', true)
146
+ }
147
+
148
+
149
+ $(document).on('mouseover', '.lp-modal-search li', function () {
150
+ $(this).addClass('highlighting').siblings().removeClass('highlighting');
151
+ }).on('click', '.lp-modal-search li', function (e) {
152
+ e.keyCode = 13;
153
+ e.target = $(this).closest('.lp-section-item').find('.lp-item-name').get(0)
154
+ that.searchQuizFormKeyEvents(e);
155
+ });
156
+ this.$el
157
+ .on('focus', '.lp-item-name', function () {
158
+ that.$('.lp-section-item').removeClass('hover');
159
+ $(this).parent().addClass('hover')
160
+ })
161
+ .on('blur', '.lp-item-name', function () {
162
+ var $e = $(this);
163
+ setTimeout(function () {
164
+ var $item = $e.closest('.lp-section-item');
165
+ if (that.isShowing != 'searchQuizForm') {
166
+ $item.removeClass('hover');
167
+ }
168
+ if (($e.val() + '').length == 0) {
169
+ if ($item.hasClass('lp-item-new')) {
170
+ ///$item.remove();
171
+ } else {
172
+ $e.val($item.attr('data-text'));
173
+ }
174
+ }
175
+ }, 500);
176
+ });
177
+ this.$('.lp-curriculum-sections').sortable({
178
+ axis : 'y',
179
+ items : 'li:not(.lp-empty-section)',
180
+ handle: '.lp-section-icon',
181
+ start : function (e, ui) {
182
+ $('.lp-curriculum-section-content').css('display', 'none');
183
+ $(ui.item).addClass('lp-sorting');
184
+ },
185
+ stop : function (e, ui) {
186
+ $('.lp-curriculum-section-content').css('display', '');
187
+ $(ui.item).removeClass('lp-sorting');
188
+ }
189
+ });
190
+ this.$('.lp-curriculum-sections .lp-section-items').sortable({
191
+ axis : 'y',
192
+ items : 'li:not(.lp-item-empty)',
193
+ handle : '.lp-sort-item',
194
+ connectWith: '.lp-section-items'
195
+ });
196
+ if (this.$('.lp-curriculum-section-content:visible').length) {
197
+
198
+ }
199
+
200
+ $('#postbox-container-2').prepend($('#course_tabs'));
201
+ $('#course_tabs #course-tabs-h3 a').click(function (e) {
202
+ e.preventDefault();
203
+ var id = $(this).attr('href'),
204
+ $box = $(id);
205
+ $(window).scrollTop($box.offset().top - 120);
206
+ });
207
+ $('<div id="course_tabs_placeholder" />').insertAfter($('#course_tabs'));
208
+
209
+ $(document)
210
+ .on('keyup', '.lp-modal-search input[name="lp-item-name"]', this.searchItem)
211
+ .on('click change', '.lp-modal-search input[type="checkbox"]', this.toggleAddItemButtonState)
212
+ .on('click', '.lp-modal-search .lp-add-item', this.addItemsToSection)
213
+ .on('click', '.lp-modal-search .lp-add-new-item', this.addNewItem)
214
+ .on('change', 'input[name="learn_press_submit_course_notice_reviewer"]', this.updatePublishAction);
215
+
216
+ $('input[name="learn_press_submit_course_notice_reviewer"]').trigger('change');
217
+ $(window).scroll(function () {
218
+ return;
219
+ var $holder = $('#course_tabs_placeholder'),
220
+ $tabs = $('#course_tabs'),
221
+ top = $holder.offset().top;
222
+ if ($(window).scrollTop() > top) {
223
+ $tabs.css('width', $tabs.width()).addClass('fixed');
224
+ } else {
225
+ $tabs.css('width', '').removeClass('fixed');
226
+ }
227
+ });
228
+ },
229
+ updatePublishAction : function (e) {
230
+ if (e.target.checked) {
231
+ $('#publish').val(meta_box_course_localize.submit_course_review);
232
+ } else {
233
+ $('#publish').val(meta_box_course_localize.save_course);
234
+ }
235
+ },
236
+ toggleButtonBulkActions : function (e) {
237
+ var $checkbox = $(e.target),
238
+ $checkAll = $checkbox,
239
+ $all = $checkbox.closest('.curriculum-section-content').find('.lp-section-item:not(.lp-item-empty) .item-checkbox input'),
240
+ len;
241
+ if ($checkbox.attr('data-action') == 'check-all') {
242
+ $all.prop('checked', $checkbox.is(':checked')).trigger('change')
243
+ return;
244
+ } else {
245
+ $checkAll = $checkbox.closest('.curriculum-section-content').find('input.lp-check-all-items')
246
+ }
247
+ (len = $all.filter(function () {
248
+ return this.checked
249
+ }).length)
250
+ ? (
251
+ $checkbox.closest('.curriculum-section-content')
252
+ .find('.item-bulk-actions button')
253
+ .removeAttr('disabled')
254
+ .removeClass('hide-if-js')
255
+ .map(function () {
256
+ var $b = $(this);
257
+ $b.attr('data-action') == 'cancel' ? $b.removeClass('hide-if-js') : $b.html($b.attr('data-title') + ' (+' + len + ')').show()
258
+ })
259
+ )
260
+ : $checkbox.closest('.curriculum-section-content')
261
+ .find('.item-bulk-actions button')
262
+ .hide()
263
+ .map(function () {
264
+ var $b = $(this);
265
+ $b.attr('data-action') == 'cancel' ? $b.hide() : $b.html($b.attr('data-title')).hide()
266
+ });
267
+ $checkbox.closest('.lp-section-item').toggleClass('remove', e.target.checked);
268
+ if (len == $all.length) {
269
+ $checkAll.attr('checked', 'checked')
270
+ } else if (len == 0) {
271
+ $checkAll.removeAttr('checked')
272
+ }
273
+ },
274
+ sectionBulkActions : function (e) {
275
+ var $button = $(e.target),
276
+ $all = $button.closest('.item-bulk-actions').siblings('.curriculum-section-items').find('.lp-section-item'),
277
+ action = $button.attr('data-action');
278
+
279
+ switch (action) {
280
+ case 'delete':
281
+ case 'delete-forever':
282
+ var $items = $all.filter(function () {
283
+ return $(this).find('.item-checkbox input').is(':checked')
284
+ });
285
+ this.removeItem($items, true, function () {
286
+ $button.closest('.item-bulk-actions').find('button').map(function () {
287
+ var $b = $(this).html($(this).attr('data-title'));
288
+ ($.inArray($b.attr('data-action'), ['cancel', 'delete']) != -1) && $b.hide();
289
+ });
290
+ }, $button);
291
+ break;
292
+ case 'cancel':
293
+ $all.filter(function () {
294
+ return $(this).find('.item-checkbox input').removeAttr('checked').trigger('change');
295
+ })
296
+ /*.first()
297
+ .find('.item-checkbox input')
298
+ .trigger('change');*/
299
+ }
300
+ },
301
+ toggleItemType : function (e) {
302
+ var $item = $(e.target).closest('.lp-section-item'),
303
+ from = $item.attr('data-type'),
304
+ to = null;
305
+ if ($item.attr('data-item_id')) {
306
+ return;
307
+ }
308
+ if ($item.hasClass('lp-item-lp_lesson')) {
309
+ to = 'lp_quiz';
310
+ $item
311
+ .removeClass('lp-item-lp_lesson')
312
+ .addClass('lp-item-lp_quiz')
313
+ .attr('data-type', to)
314
+ .find('.lp-item-type').val(to);
315
+ } else {
316
+ to = 'lp_lesson';
317
+ $item
318
+ .removeClass('lp-item-lp_quiz')
319
+ .addClass('lp-item-lp_lesson')
320
+ .attr('data-type', to)
321
+ .find('.lp-item-type', to);
322
+ }
323
+ LearnPress.Hook.doAction('learn_press_change_section_item_type', from, to);
324
+ },
325
+ getPrevInput : function ($input) {
326
+ var $inputs = this.$('input.no-submit:visible'),
327
+ position = $inputs.index($input);
328
+ $prev = position == 0 ? $inputs.eq($inputs.length - 1) : $inputs.eq(position - 1);
329
+ return $prev;
330
+ },
331
+ getNextInput : function ($input) {
332
+ var $inputs = this.$('input.no-submit:visible'),
333
+ position = $inputs.index($input);
334
+ $next = position >= $inputs.length - 1 ? $inputs.eq(0) : $inputs.eq(position + 1);
335
+ return $next;
336
+ },
337
+ preventSubmit : function (e) {
338
+ var $input = $(e.target);
339
+ if ($input.hasClass('no-submit')) {
340
+ if (($input.val() + '').length >= 2) {
341
+ $input.closest('.lp-item-empty').removeClass('lp-item-empty');
342
+ $input.closest('.lp-empty-section').removeClass('lp-empty-section');
343
+ } else {
344
+ $input.closest('.lp-item-empty').addClass('lp-item-empty');
345
+ $input.closest('.lp-empty-section').addClass('lp-empty-section');
346
+ }
347
+ if (e.keyCode == 13) {
348
+ return false;
349
+ }
350
+ }
351
+ },
352
+ _addNewItem : function (e) {
353
+ e.preventDefault();
354
+ var that = this,
355
+ $target = $(e.target),
356
+ $section = $target.closest('.curriculum-section'),
357
+ $input = $section.find('input[name="lp-new-item-name"]'),
358
+ type = null;
359
+ if ($target.is('a')) {
360
+ type = $target.attr('data-type');
361
+ $target = $target.closest('.lp-button-add-item');
362
+ } else {
363
+ if (!$target.is('.lp-button-add-item')) {
364
+ $target = $target.closest('.lp-button-add-item');
365
+ }
366
+ type = $target.find('ul > li > a:first').attr('data-type');
367
+ }
368
+ if ($target.hasClass('disabled')) {
369
+ return;
370
+ }
371
+ if (($input.val() + '').length == 0) {
372
+ alert('Please enter item name');
373
+ $input.focus();
374
+ return;
375
+ }
376
+ $.ajax({
377
+ url : LearnPress_Settings.ajax,
378
+ data : {
379
+ action: 'learnpress_add_new_item',
380
+ name : $input.val(),
381
+ type : type
382
+ },
383
+ type : 'post',
384
+ dataType: 'html',
385
+ success : function (response) {
386
+ var json = LearnPress.parseJSON(response);
387
+ if (json.post && json.post.ID) {
388
+ $item = that.createItem({
389
+ id : json.post.ID,
390
+ type : json.post.post_type,
391
+ text : json.post.post_title,
392
+ edit_link: json.post.edit_link.replace('&amp;', '&')
393
+ });
394
+ if ($item) {
395
+ that.addItemToSection($item, $section);
396
+ }
397
+ $item.removeClass('lp-item-empty');
398
+ $input.val('').focus().trigger('keyup');
399
+ }
400
+ }
401
+ });
402
+ },
403
+ onEnterInput : function (e) {
404
+ var $input = $(e.target),
405
+ $item = $input.closest('.lp-section-item'),
406
+ $section = $item.length ? $item.closest('.curriculum-section') : $input.closest('.curriculum-section'),
407
+ value = $input.val(),
408
+ textLen = value.length,
409
+ type = $input.data('field');
410
+ if ($input.attr('name') == 'lp-new-item-name') {
411
+ LearnPress.log(textLen)
412
+ if (textLen > 0) {
413
+ $input.siblings('.lp-button-add-item').removeClass('disabled');
414
+ } else {
415
+ $input.siblings('.lp-button-add-item').addClass('disabled');
416
+ }
417
+ }
418
+ switch (e.keyCode) {
419
+ case 13:
420
+ if ($input.attr('name') == 'lp-new-item-name') {
421
+ $input.siblings('.lp-button-add-item').trigger('click')
422
+ return;
423
+ }
424
+ case 40:
425
+ var $next = this.getNextInput($input);
426
+ $next.focus();
427
+ break;
428
+ case 38:
429
+ var $prev = this.getPrevInput($input);
430
+ $prev.focus();
431
+ break;
432
+ case 8:
433
+ case 46:
434
+ if (type == 'section-name') {
435
+ if (textLen == 0 && $section.siblings().length) {
436
+ if ($input.attr('empty-value')) {
437
+ var $prev = this.getPrevInput($input);
438
+ $prev.focus();
439
+ $section.remove();
440
+ } else {
441
+ $input.attr('empty-value', 1);
442
+ }
443
+ } else {
444
+ $input.removeAttr('empty-value');
445
+ }
446
+ } else if (type == 'item-name') {
447
+ if (textLen == 0 && $item.siblings().length) {
448
+ if ($input.attr('empty-value')) {
449
+ var $prev = this.getPrevInput($input);
450
+ $prev.focus();
451
+ $item.remove();
452
+ } else {
453
+ $input.attr('empty-value', 1);
454
+ }
455
+ } else {
456
+ $input.removeAttr('empty-value');
457
+ }
458
+ }
459
+ break;
460
+ default:
461
+ if (type == 'section-name') {
462
+ var $nextSection = $section.next();
463
+
464
+ if ($nextSection.length == 0 && textLen >= 1) {
465
+ var $emptySection = this.createSection();
466
+
467
+ }
468
+ } else if (type == 'item-name') {
469
+ var $nextItem = $item.next();
470
+ if ($nextItem.length == 0 && textLen >= 1) {
471
+ var $emptyItem = this.createItem({type: 'lp_lesson'});
472
+ var $last = $section.find('.curriculum-section-items .lp-section-item:last');
473
+ $emptyItem.insertAfter($last);
474
+ }
475
+ }
476
+
477
+ }
478
+
479
+ },
480
+ getEmptySection : function () {
481
+ if (!this.$emptySection) {
482
+ this.createSection();
483
+ }
484
+ return this.$emptySection;
485
+ },
486
+ createSection : function () {
487
+ var tmpl = wp.template('curriculum-section');
488
+ this.$emptySection = $(tmpl({}));
489
+ this.$('.curriculum-sections').append(this.$emptySection);
490
+ return this.$emptySection;
491
+ },
492
+ createItem : function (args, $section) {
493
+ args = $.extend({
494
+ edit_link: 'post.php?post=' + args.id + '&action=edit'
495
+ }, args || {});
496
+
497
+ var tmpl = wp.template('section-item'),
498
+ $item = $(tmpl(args || {}));
499
+ $item = LearnPress.Hook.applyFilters('learn_press_create_new_item', $item, $section);
500
+ return $item;
501
+ },
502
+ needCreateNewSection : function () {
503
+
504
+ },
505
+ toggleSection : function (e) {
506
+ var $button = $(e.target),
507
+ $section = $button.closest('.lp-curriculum-section');
508
+ $section.find('.lp-curriculum-section-content').stop().slideToggle(function () {
509
+ if ($(this).is(':visible')) {
510
+ $(this).parent().addClass('open')
511
+ } else {
512
+ $(this).parent().removeClass('open')
513
+ }
514
+ });
515
+ },
516
+ toggleSections : function (e) {
517
+ e.preventDefault();
518
+ var $target = $(e.target);
519
+ if ($target.attr('data-action') == 'expand') {
520
+ this.$('.curriculum-section:not(.lp-empty-section) .lp-curriculum-section-content').slideDown();
521
+ } else {
522
+ this.$('.curriculum-section:not(.lp-empty-section) .lp-curriculum-section-content').slideUp();
523
+ }
524
+ },
525
+ getSelectedItems : function () {
526
+ return this.$('.lp-section-item[data-item_id]').map(function () {
527
+ return ($(this).attr('data-item_id'))
528
+ }).filter(function (i, c) {
529
+ return c > 0
530
+ }).get();
531
+ },
532
+ showFormItems : function (type, action, $button) {
533
+ var $form = LearnPress.ModalSearchItems({
534
+ template : 'tmpl-learn-press-search-items',
535
+ type : type,
536
+ section : $button.closest('.curriculum-section'),
537
+ context : 'course-items',
538
+ context_id: $('#post_ID').val(),
539
+ exclude : this.getSelectedItems()
540
+ });
541
+ LearnPress.MessageBox.show($form.$el);
542
+ $form.$el.find('header input').focus();
543
+
544
+ },
545
+ sectionActionHandler : function (e) {
546
+ var that = this,
547
+ $button = $(e.target),
548
+ action = $button.data('action'),
549
+ type = $button.data('type'),
550
+ $form = null;
551
+ switch (action) {
552
+ case 'add-lp_quiz':
553
+ case 'add-lp_lesson':
554
+ this.showFormItems(type, action, $button);
555
+ break;
556
+ default:
557
+ LearnPress.Hook.doAction('learn_press_section_button_click', $button, action, this);
558
+ }
559
+ },
560
+ searchItem : function (e) {
561
+ var $input = $(e.target),
562
+ $form = $input.closest('.lp-modal-search'),
563
+ text = $input.val().replace(/\\q\?[\s]*/ig, ''),
564
+ $lis = $form.find('li:not(.lp-search-no-results):not(.selected)').addClass('hide-if-js'),
565
+ reg = new RegExp($.grep(text.split(/[\s]+/), function (a) {
566
+ return a.length
567
+ }).join('|'), "ig"),
568
+ found = 0;
569
+ LearnPress.log(text)
570
+ found = $lis.filter(function () {
571
+ var $el = $(this),
572
+ itemText = $el.data('text') + '',
573
+ ret = itemText.search(reg) >= 0;
574
+ if (ret) {
575
+ $el.find('.lp-item-text').html(itemText.replace(reg, "<i class=\"lp-highlight-color\">\$&</i>"));
576
+ } else {
577
+ $el.find('.lp-item-text').html(itemText);
578
+ }
579
+ return ret;
580
+ }).removeClass('hide-if-js').length;
581
+
582
+ if (!found) {
583
+ $form.find('.lp-search-no-results').removeClass('hide-if-js');
584
+ } else {
585
+ $form.find('.lp-search-no-results').addClass('hide-if-js');
586
+ }
587
+ },
588
+ addItemsToSection : function (e, $view, $items) {
589
+ var that = this,
590
+ selected = $items, //$form.find('li:visible input:checked'),
591
+ $section = $view.options.section;
592
+ selected.each(function () {
593
+ var $li = $(this),//.closest('li').addClass('selected'),
594
+ args = $li.dataToJSON(),
595
+ $item = that.createItem(args, $section);
596
+ if ($item) {
597
+ that.addItemToSection($item, $section);
598
+ }
599
+ $li.remove();
600
+ });
601
+
602
+ },
603
+ addItemToSection : function ($item, $section) {
604
+ var $last = $section.find('.curriculum-section-items .lp-section-item:last');
605
+ $item.insertBefore($last);
606
+ $item.removeClass('lp-item-empty');
607
+ if (!parseInt($item.attr('data-item_id'))) {
608
+ $item.find('a[data-action="remove"]').hide();
609
+ } else {
610
+ $item.removeClass('focus').find('.learn-press-dropdown-item-types ul').remove();
611
+ }
612
+ this.model.addItem(parseInt($item.attr('data-id')));
613
+ LearnPress.Hook.doAction('learn_press_add_item_to_section', $item, $section);
614
+ },
615
+ addNewItem : function (e) {
616
+ var $form = $(e.target).closest('.lp-modal-search');
617
+ $.ajax({
618
+ url : LearnPress_Settings.ajax,
619
+ data : {
620
+ action: 'learnpress_quick_add_item',
621
+ name : $form.find('input[name="lp-item-name"]').val(),
622
+ type : $form.data('item_type') || 'lp_lesson'
623
+ },
624
+ type : 'post',
625
+ dataType: 'html',
626
+ success : function (response) {
627
+ var json = LearnPress.parseJSON(response);
628
+ if (json.html) {
629
+ var $item = $(json.html)
630
+ $form.find('ul').append($item);
631
+ $item.find('input[type="checkbox"]').attr('checked', true).trigger('change');
632
+ }
633
+ }
634
+ });
635
+ },
636
+ toggleAddItemButtonState: function (e) {
637
+ var $form = $(e.target).closest('.lp-modal-search'),
638
+ selected = $form.find('li input:checked'),
639
+ $button = $form.find('.lp-add-item');
640
+ if (selected.length) {
641
+ $button.each(function () {
642
+ var $btn = $(this);
643
+ $btn.removeAttr('disabled').html($btn.attr('data-text') + ' (+' + selected.length + ')');
644
+ });
645
+ } else {
646
+ $button.each(function () {
647
+ var $btn = $(this);
648
+ $btn.attr('disabled', true).html($btn.attr('data-text'));
649
+ });
650
+ }
651
+ },
652
+ onSave : function (evt) {
653
+ /*return;
654
+ var $title = $('#title'),
655
+ $curriculum = $('.lp-curriculum-section:not(.lp-section-empty)'),
656
+ is_error = false;
657
+ if (0 == $title.val().length) {
658
+ alert( lp_course_params.notice_empty_title );
659
+ $title.focus();
660
+ is_error = true;
661
+ } else if (0 == $curriculum.length) {
662
+ alert( lp_course_params.notice_empty_section );
663
+ $('.lp-curriculum-section .lp-section-name').focus();
664
+ is_error = true;
665
+ } else {
666
+ /*$curriculum.each(function () {
667
+ var $section = $('.lpr-section-name', this);
668
+ if (0 == $section.val().length) {
669
+ alert( lp_course_params.notice_empty_section_name );
670
+ $section.focus();
671
+ is_error = true;
672
+ return false;
673
+ }
674
+ });
675
+ }
676
+ if( $( 'input[name="_lpr_course_payment"]:checked').val() == 'not_free' && $('input[name="_lpr_course_price"]').val() <= 0 ){
677
+ alert( lp_course_params.notice_empty_price );
678
+ is_error = true;
679
+ $('input[name="_lpr_course_price"]').focus();
680
+ }
681
+ if (true == is_error) {
682
+ evt.preventDefault();
683
+ return false;
684
+ }
685
+ */
686
+ return this._prepareSections();
687
+ //return false
688
+ },
689
+ _prepareSections : function () {
690
+ var $sections = this.$form.find('.curriculum-section');
691
+ $sections.each(function (i, n) {
692
+ var $section = $(this),
693
+ $items = $section.find('.lp-section-item'),
694
+ $inputs = $('input[name*="__SECTION__"]', $section),
695
+ section_id = parseInt($section.attr('data-id'));
696
+ $inputs.each(function () {
697
+ var $input = $(this),
698
+ name = $input.attr('name');
699
+ name = name.replace(/__SECTION__/, section_id ? section_id : 'section-' + i);
700
+ $input.attr('name', name);
701
+ });
702
+ $items.each(function (j, l) {
703
+ $(this).find('input[name*="__ITEM__"]').each(function () {
704
+ var $input = $(this),
705
+ name = $input.attr('name');
706
+ name = name.replace(/__ITEM__/, 'item-' + j);
707
+ $input.attr('name', name);
708
+ });
709
+ });
710
+ });
711
+ if (this.removeItemIds) {
712
+ this.$form.append('<input type="hidden" name="_lp_remove_item_ids" value="' + this.removeItemIds.join(',') + '" />');
713
+ }
714
+ },
715
+ render : function () {
716
+
717
+ },
718
+ inputKeyPressEvent : function (e) {
719
+ if (this.isShowing && e.keyCode == 13) {
720
+ return false;
721
+ }
722
+ },
723
+ inputKeyDownEvent : function (e) {
724
+ var $input = $(e.target);
725
+ $input.attr('lastCode', e.keyCode);
726
+ $input.attr('caret', $input.caret());
727
+ },
728
+ processKeyEvents : function (e) {
729
+ var $target = $(e.target),
730
+ $section = $target.closest('.lp-curriculum-section'),
731
+ field = $target.attr('data-field'),
732
+ lastCode = $target.data('lastCode'),
733
+ keyCode = e.keyCode,
734
+ text = $target.val(),
735
+ caretPos = $target.attr('type') == 'text' ? $target.caret() : false,
736
+ caretLen = text.length,
737
+ that = this;
738
+ if (field == 'item-name') {
739
+ var $item = $target.closest('.lp-section-item');
740
+ if (text.match(/\\q\?/i) || this.isShowing == 'searchQuizForm') {
741
+ this.searchQuizForm($item);
742
+ }
743
+ if (text.match(/\\l\?/i)) {
744
+ this.searchLessonForm($item);
745
+ }
746
+ if (e.altKey) {
747
+ if (keyCode == 81) {
748
+ $target.closest('.lp-section-item').find('.handle.dashicons').removeClass('dashicons-media-document').addClass('dashicons-format-status');
749
+ $target.siblings('.lp-item-type').attr('value', 'lp_quiz');
750
+ } else if (keyCode == 76) {
751
+ $target.closest('.lp-section-item').find('.handle.dashicons').removeClass('dashicons-format-status').addClass('dashicons-media-document');
752
+ $target.siblings('.lp-item-type').attr('value', 'lp_lesson');
753
+ }
754
+ }
755
+ }
756
+ var xxx = true;
757
+ if (this.isShowing) {
758
+ xxx = this[this.isShowing + 'KeyEvents'] && this[this.isShowing + 'KeyEvents'].call(this, e);
759
+ }
760
+ if (xxx === false) return;
761
+ //[33 = page up, 34 = page down, 35 = end, 36 = home, 37 = left, 38 = up, 39 = right, 40 = down, 8 = backspace, enter = 13, 46 = del]
762
+ switch (keyCode) {
763
+ case 8: // backspace
764
+ case 46:
765
+ if (text.length == 0 && $target.data('keyRepeat') == 2) {
766
+ if (field == 'section-name') {
767
+
768
+ } else if (field == 'item-name') {
769
+ var $item = $target.closest('.lp-section-item').css('visibility', 'hidden');
770
+ var $inputs = this.$('.lp-item-name:visible'),
771
+ pos = $inputs.index($target);
772
+ if ($inputs.length == 1) {
773
+ $inputs.addClass('lp-item-empty');
774
+ break;
775
+ }
776
+ if (keyCode == 8) {
777
+ pos > 0 ? $inputs.eq(pos - 1).focus().caret($inputs.eq(pos - 1).val().length) : '';
778
+ } else {
779
+ pos < $inputs.length - 1 ? $inputs.eq(pos + 1).focus().caret(0) : '';
780
+ }
781
+ $item.remove();
782
+ }
783
+ }
784
+ break;
785
+ case 13: // enter
786
+
787
+ break;
788
+ case 33: // page up
789
+ case 34: // page down
790
+ case 35: // end
791
+ case 36: // home
792
+ case 37: // left
793
+ case 39: // right
794
+ break;
795
+ case 38: // up
796
+ case 40: // down
797
+ //if( this.isShowing ){
798
+ this[this.isShowing + 'KeyEvents'] && this[this.isShowing + 'KeyEvents'].call(this, e);
799
+ //}else {
800
+ var isDown = keyCode == 40;
801
+ var $inputs = this.$('.lp-section-name:visible, .lp-item-name:visible'),
802
+ pos = $inputs.index($target);
803
+ if (isDown) {
804
+ pos == $inputs.length - 1 ? $inputs.eq(0).focus() : $inputs.eq(pos + 1).focus();
805
+ } else {
806
+ pos == 0 ? $inputs.eq($inputs.length - 1).focus() : $inputs.eq(pos - 1).focus();
807
+ }
808
+ //}
809
+ break;
810
+ default:
811
+ if ($target.val().length > 0) {
812
+ if (field == 'section-name') {
813
+ $section.removeClass('lp-section-empty');
814
+ that.appendSection($section);
815
+ } else if (field == 'item-name') {
816
+ var $item = $target.closest('.lp-section-item').removeClass('lp-item-empty');
817
+ that.appendSectionItem($item);
818
+ }
819
+ }
820
+ }
821
+ if (lastCode == keyCode && text.length == 0) {
822
+ var keyRepeat = $target.data('keyRepeat');
823
+ if (!keyRepeat) {
824
+ keyCode = 1
825
+ }
826
+ $target.data('keyRepeat', keyRepeat + 1);
827
+ } else {
828
+ $target.data('keyRepeat', 1);
829
+ }
830
+
831
+ $target.data('lastCode', keyCode);
832
+
833
+ },
834
+ appendSection : function ($section) {
835
+ var that = this,
836
+ $sections = this.$('.lp-curriculum-section'),
837
+ $last = $sections.last();
838
+ if (!$last.hasClass('lp-section-empty')) {
839
+ this._createSection().insertAfter($last);
840
+ }
841
+ },
842
+ appendSectionItem : function ($item, $section) {
843
+ if (!$section) $section = $item.closest('.lp-curriculum-section');
844
+ var that = this,
845
+ $items = $section.find('.lp-section-item'),
846
+ $last = $items.last();
847
+ if (!$last.hasClass('lp-item-empty')) {
848
+ this._createItem().insertAfter($last);
849
+ }
850
+ },
851
+ searchQuizForm : function ($item) {
852
+ if (this.isShowing == 'searchQuizForm' && this.$modalQuizzes) {
853
+ var $input = $item.find('.lp-item-name'),
854
+ text = $input.val().replace(/\\q\?[\s]*/ig, ''),
855
+ $lis = this.$modalQuizzes.find('li:not(.lp-search-no-results):not(.selected)').addClass('hide-if-js'),
856
+ reg = new RegExp($.grep(text.split(/[\s]+/), function (a) {
857
+ return a.length
858
+ }).join('|'), "ig"),
859
+ found = 0;
860
+ if (text.length) {
861
+ found = $lis.filter(function () {
862
+ var $el = $(this),
863
+ itemText = $el.data('text'),
864
+ ret = itemText.search(reg) >= 0;
865
+ if (ret) {
866
+ $el.html(itemText.replace(reg, "<i class=\"lp-highlight-color\">\$&</i>"));
867
+ } else {
868
+ $el.html(itemText);
869
+ }
870
+ return ret;
871
+ }).removeClass('hide-if-js').length;
872
+ } else {
873
+ found = $lis.removeClass('hide-if-js').length;
874
+ }
875
+ if (!found) {
876
+ this.$modalQuizzes.find('.lp-search-no-results').removeClass('hide-if-js');
877
+ } else {
878
+ this.$modalQuizzes.find('.lp-search-no-results').addClass('hide-if-js');
879
+ }
880
+ return;
881
+ }
882
+ if (!this.$modalQuizzes) {
883
+ this.$modalQuizzes = $(wp.template('lp-modal-search-quiz')({}))
884
+ }
885
+ var $input = $item.find('.lp-item-name'),
886
+ position = $input.offset();
887
+
888
+ this.$modalQuizzes.insertAfter($input).css({
889
+ position: 'absolute',
890
+ //top: position.top + $input.outerHeight(),
891
+ left : $input.position().left,
892
+ width : $input.outerWidth() - 2
893
+ }).removeClass('hide-if-js');
894
+ if (this.$modalQuizzes.find('li:not(.lp-search-no-results):not(.selected)').length == 0) {
895
+ this.$modalQuizzes.find('li.lp-search-no-results').removeClass('hide-if-js');
896
+ }
897
+ this.isShowing = 'searchQuizForm';
898
+ },
899
+ searchQuizFormKeyEvents : function (e) {
900
+ return;
901
+ var $items = this.$modalQuizzes.find('li:visible:not(.lp-search-no-results)'),
902
+ $activeItem = $items.filter('.highlighting'),
903
+ $next = false;
904
+ switch (e.keyCode) {
905
+ case 38: // up
906
+ if ($activeItem.length) {
907
+ $next = $activeItem.prev();
908
+ }
909
+ if (!$next.length) {
910
+ $next = $items.last();
911
+ }
912
+ //.removeClass('highlighting');
913
+ $next.addClass('highlighting').siblings().removeClass('highlighting');
914
+ return false;
915
+ break;
916
+ case 40: // down
917
+ if ($activeItem.length) {
918
+ $next = $activeItem.next();
919
+ }
920
+ if (!$next.length) {
921
+ $next = $items.first();
922
+ }
923
+ //$activeItem.removeClass('highlighting');
924
+ $next.addClass('highlighting').siblings().removeClass('highlighting');
925
+ return false;
926
+ break;
927
+ case 13:
928
+ case 27:
929
+ this.isShowing = '';
930
+ if (e.keyCode == 13) {
931
+ var $input = $(e.target),
932
+ $item = $input.closest('.lp-section-item');
933
+ $input.val($activeItem.data('text'));
934
+ var id = $activeItem.attr('data-id'),
935
+ type = $activeItem.attr('data-type');
936
+ $item.removeClass('.lp-item-lp_lesson lp-item-empty lp-item-new').addClass('lp-item-' + type).attr({
937
+ 'data-type': type,
938
+ 'data-id' : id
939
+ })
940
+ } else {
941
+ $(e.target).val($(e.target).val().replace(/\\q\?[\s]*/ig, ''));
942
+ }
943
+ this.$modalQuizzes.hide();
944
+ e.preventDefault();
945
+ return false;
946
+ break;
947
+ }
948
+
949
+ },
950
+ searchLessonForm : function () {
951
+ alert('search lesson')
952
+ },
953
+ _getNextSection : function ($section, loop) {
954
+ var $nextSection = $section.next();
955
+ if ($nextSection.length == 0 && ((typeof loop == 'undefined') || (loop == true))) {
956
+ $nextSection = $section.parent().children().first();
957
+ }
958
+ return $nextSection;
959
+ },
960
+ _getPrevSection : function ($section, loop) {
961
+ var $prevSection = $section.prev();
962
+ if ($prevSection.length == 0 && ((typeof loop == 'undefined') || (loop == true))) {
963
+ $prevSection = $section.parent().children().last();
964
+ }
965
+ return $prevSection;
966
+ },
967
+ _createSection : function () {
968
+ var sectionTemplate = wp.template('curriculum-section');
969
+ return $(sectionTemplate({}));
970
+ },
971
+ _createItem : function () {
972
+ var itemTemplate = wp.template('section-item');
973
+ return $(itemTemplate({}));
974
+ },
975
+ _removeItem : function (e) {
976
+ e.preventDefault();
977
+ var $item = $(e.target).closest('.lp-section-item');
978
+ this.removeItem($item, true, null, e.target);
979
+ },
980
+ removeItem : function ($items, b, callback, target) {
981
+ if ($items.length == 0) return;
982
+ var that = this,
983
+ itemNames = $items.map(function () {
984
+ return $(this).find('.lp-item-name').val()
985
+ }).get().join('</p><p>+&nbsp;');
986
+
987
+ LearnPress.MessageBox.quickConfirm(target, {
988
+ onOk : function (a) {
989
+ var ids = [];
990
+ a.items && a.items.each(function () {
991
+ var $item = $(this),
992
+ id = parseInt($item.attr('data-section_item_id')),
993
+ type = $item.attr('data-type');
994
+ $item.remove();
995
+ if (id) {
996
+ a.self.model.removeItem(id);
997
+ ids.push(id);
998
+ }
999
+ });
1000
+ if (b) {
1001
+ a.self.removeItemDB(ids);
1002
+ }
1003
+ $.isFunction(callback) && callback.call();
1004
+ },
1005
+ onCancel: function (a) {
1006
+ a.items
1007
+ .each(function () {
1008
+ $(this).removeClass('remove').find('.item-checkbox input').prop('checked', false).trigger('change')
1009
+ })
1010
+ .closest('.curriculum-section')
1011
+ .find('.item-bulk-actions button')
1012
+ .map(function () {
1013
+ var $b = $(this);
1014
+ ($.inArray($b.attr('data-action'), ['cancel', 'delete']) != -1) && $b.hide();
1015
+ if ($b.attr('data-action') == 'delete') $b.html($b.attr('data-title'))
1016
+ });
1017
+ },
1018
+ data : {
1019
+ items: $items,
1020
+ self : this
1021
+ }
1022
+ });
1023
+
1024
+ },
1025
+ removeItemDB : function (id) {
1026
+ $.ajax({
1027
+ url : LearnPress_Settings.ajax,
1028
+ data : {
1029
+ action: 'learnpress_remove_course_items',
1030
+ id : id
1031
+ },
1032
+ success: function (response) {
1033
+ LearnPress.log(response)
1034
+ }
1035
+ });
1036
+ },
1037
+ findItemsById : function (id) {
1038
+ if (!$.isArray(id)) {
1039
+ id = [parseInt(id)];
1040
+ } else {
1041
+ id = id.map(function (n) {
1042
+ return parseInt(n)
1043
+ });
1044
+ }
1045
+ return this.$('.lp-section-item').filter(function () {
1046
+ return $.inArray(parseInt($(this).attr('data-id')), id) != -1
1047
+ });
1048
+ },
1049
+ _sectionActionHandler : function (e) {
1050
+ var that = this,
1051
+ $button = $(e.target),
1052
+ action = $button.attr('data-action');
1053
+ switch (action) {
1054
+ case 'expand':
1055
+ $button
1056
+ .addClass('hide-if-js')
1057
+ .siblings('a[data-action="collapse"]')
1058
+ .removeClass('hide-if-js')
1059
+ .closest('.curriculum-section')
1060
+ .removeClass('is-hidden')
1061
+ .find('.curriculum-section-content').slideDown(function () {
1062
+ if (updateHiddenCurriculum().length == 0) {
1063
+
1064
+ }
1065
+ });
1066
+ break;
1067
+ case 'collapse':
1068
+ $button
1069
+ .addClass('hide-if-js')
1070
+ .siblings('a[data-action="expand"]')
1071
+ .removeClass('hide-if-js')
1072
+ .closest('.curriculum-section')
1073
+ .addClass('is-hidden')
1074
+ .find('.curriculum-section-content').slideUp(function () {
1075
+ updateHiddenCurriculum();
1076
+ });
1077
+ break;
1078
+ case 'remove':
1079
+ LearnPress.MessageBox.quickConfirm($button, {
1080
+ onOk: function (a) {
1081
+ var $section = $(a);
1082
+
1083
+ $.ajax({
1084
+ url : LearnPress_Settings.ajax,
1085
+ data : {
1086
+ action: 'learnpress_remove_course_section',
1087
+ id : $section.attr('data-id')
1088
+ },
1089
+ success: function () {
1090
+ $section.remove();
1091
+ }
1092
+ });
1093
+ },
1094
+ data: $button.closest('.curriculum-section')
1095
+ });
1096
+ break;
1097
+ LearnPress.MessageBox.show('Do you want to remove this section?', {
1098
+ buttons: 'yesNo',
1099
+ data : $button.closest('.curriculum-section'),
1100
+ events : {
1101
+ onYes: function (args) {
1102
+ var $section = $(args.data);
1103
+
1104
+ $.ajax({
1105
+ url : LearnPress_Settings.ajax,
1106
+ data : {
1107
+ action: 'learnpress_remove_course_section',
1108
+ id : $section.attr('data-id')
1109
+ },
1110
+ success: function () {
1111
+ $section.remove();
1112
+ }
1113
+ });
1114
+ }
1115
+ }
1116
+ })
1117
+ break;
1118
+ }
1119
+ if (action) {
1120
+ e.preventDefault();
1121
+ }
1122
+ }
1123
+ });
1124
+ var model = new LP_Curriculum_Model(LP_Curriculum_Settings),
1125
+ view = new LP_Curriculum_View(model);
1126
+
1127
+ LearnPress.$LP_Curriculum_Model = model;
1128
+ LearnPress.$LP_Curriculum_View = view;
1129
+ });
1130
+
1131
+ function updateHiddenCurriculum(hidden) {
1132
+ if (hidden == undefined) {
1133
+ hidden = [];
1134
+ var len = $('.curriculum-section-content').each(function () {
1135
+ if ($(this).is(':hidden')) {
1136
+ hidden.push($(this).parent().attr('data-id'));
1137
+ }
1138
+ }).length;
1139
+ if (hidden.length == len) {
1140
+ $('.lp-section-actions a[data-action="collapse"]')
1141
+ .addClass('hide-if-js')
1142
+ .siblings('a[data-action="expand"]')
1143
+ .removeClass('hide-if-js');
1144
+ }
1145
+ }
1146
+ if (hidden.length == 0) {
1147
+ $('.lp-section-actions a[data-action="collapse"]')
1148
+ .removeClass('hide-if-js')
1149
+ .siblings('a[data-action="expand"]')
1150
+ .addClass('hide-if-js');
1151
+ }
1152
+
1153
+ $.ajax({
1154
+ url : LearnPress_Settings.ajax,
1155
+ data : {
1156
+ action : 'learnpress_update_curriculum_section_state',
1157
+ course_id: $('#post_ID').val(),
1158
+ hidden : hidden
1159
+ },
1160
+ success: function () {
1161
+
1162
+ }
1163
+ });
1164
+ return hidden;
1165
+ }
1166
+
1167
+ function _removeSectionHandler() {
1168
+
1169
+ }
1170
+
1171
+ function _toggleSectionsHandler(e) {
1172
+ e.preventDefault();
1173
+ var action = $(this).attr('data-action');
1174
+ switch (action) {
1175
+ case 'expand':
1176
+ var $items = $('.curriculum-section-content'),
1177
+ len = $items.length, i = 0;
1178
+ $(this)
1179
+ .addClass('hide-if-js')
1180
+ .siblings('a[data-action="collapse"]')
1181
+ .removeClass('hide-if-js');
1182
+ $items
1183
+ .removeClass('is-hidden')
1184
+ .slideDown(function () {
1185
+ if (++i == len) {
1186
+ updateHiddenCurriculum([]);
1187
+ }
1188
+ });
1189
+ $items.siblings('.curriculum-section-head')
1190
+ .find('a[data-action]')
1191
+ .map(function () {
1192
+ var $a = $(this);
1193
+ switch ($a.attr('data-action')) {
1194
+ case 'collapse':
1195
+ $a.removeClass('hide-if-js');
1196
+ break;
1197
+ case 'expand':
1198
+ $a.addClass('hide-if-js');
1199
+ }
1200
+ });
1201
+ break;
1202
+ case 'collapse':
1203
+ var $items = $('.curriculum-section-content'),
1204
+ len = $items.length, i = 0,
1205
+ hidden = [];
1206
+ $(this)
1207
+ .addClass('hide-if-js')
1208
+ .siblings('a[data-action="expand"]')
1209
+ .removeClass('hide-if-js');
1210
+ $items
1211
+ .addClass('is-hidden')
1212
+ .slideUp(function () {
1213
+ hidden.push($(this).parent().attr('data-id'));
1214
+ if (++i == len) {
1215
+ updateHiddenCurriculum(hidden);
1216
+ }
1217
+ });
1218
+ $items.siblings('.curriculum-section-head')
1219
+ .find('a[data-action]')
1220
+ .map(function () {
1221
+ var $a = $(this);
1222
+ switch ($a.attr('data-action')) {
1223
+ case 'collapse':
1224
+ $a.addClass('hide-if-js');
1225
+ break;
1226
+ case 'expand':
1227
+ $a.removeClass('hide-if-js');
1228
+ }
1229
+ });
1230
+ break;
1231
+ }
1232
+ }
1233
+
1234
+ function _toggleEditorHandler(e) {
1235
+ if (e.type == '_click') {
1236
+ if ($(this).data('hidden') == 'yes') {
1237
+ $('#postdivrich').addClass('hide-if-js');
1238
+ }
1239
+ $('#postdivrich').css('visibility', 'visible');
1240
+ } else {
1241
+ var is_hidden = 'yes';
1242
+ if (!$('#postdivrich').toggleClass('hide-if-js').hasClass('hide-if-js')) {
1243
+ $(window).trigger('scroll');
1244
+ is_hidden = '';
1245
+ }
1246
+ ;
1247
+ $.ajax({
1248
+ url : LearnPress_Settings.ajax,
1249
+ type : 'post',
1250
+ data : {
1251
+ action : 'learnpress_update_editor_hidden',
1252
+ course_id: $('#post_ID').val(),
1253
+ is_hidden: is_hidden
1254
+ },
1255
+ success: function () {
1256
+
1257
+ }
1258
+ });
1259
+ }
1260
+ }
1261
+
1262
+ function _makeListSortable() {
1263
+ $('.curriculum-sections')
1264
+ .sortable({
1265
+ items : '.curriculum-section:not(.lp-empty-section)',
1266
+ handle: '.lp-section-actions a.move',
1267
+ axis : 'y'
1268
+ });
1269
+
1270
+ $('.curriculum-section-items > tbody')
1271
+ .sortable({
1272
+ items : '.lp-section-item:not(.lp-item-empty)',
1273
+ handle : '.item-checkbox',
1274
+ axis : 'y',
1275
+ connectWith: '.curriculum-section-items > tbody',
1276
+ helper : function (e, tr) {
1277
+ var $originals = tr.children();
1278
+ var $helper = tr.clone();
1279
+ $helper.children().each(function (index) {
1280
+ // Set helper cell sizes to match the original sizes
1281
+ $(this).width($originals.eq(index).width());
1282
+ });
1283
+
1284
+ $(tr).parent().append($helper);
1285
+
1286
+ return $helper;
1287
+ },
1288
+ start : function (e, ui) {
1289
+ var cellCount = 0;
1290
+ $('td, th', ui.helper).each(function () {
1291
+ var colspan = 1;
1292
+ var colspanAttr = $(this).attr('colspan');
1293
+ if (colspanAttr > 1) {
1294
+ colspan = colspanAttr;
1295
+ }
1296
+ cellCount += colspan;
1297
+ });
1298
+ ui.placeholder.html('<td colspan="' + cellCount + '">&nbsp;</td>');
1299
+ },
1300
+ sort : function (e, ui) {
1301
+ LearnPress.log(ui.helper.html())
1302
+ },
1303
+ stop : function (e, ui) {
1304
+ var $emptyItem = ui.item.parent().find('.lp-item-empty:last');
1305
+ LearnPress.log('empty:')
1306
+ LearnPress.log($emptyItem.get(0))
1307
+ LearnPress.log('next:')
1308
+ LearnPress.log($emptyItem.next().get(0))
1309
+ if ($emptyItem.next().is(ui.item.get(0))) {
1310
+ $emptyItem.insertAfter(ui.item);
1311
+ }
1312
+ }
1313
+ });
1314
+ }
1315
+
1316
+ function _ready() {
1317
+ $('#learn-press-button-toggle-editor').off('click _click').on('click _click', _toggleEditorHandler).trigger('_click');
1318
+
1319
+ _makeListSortable();
1320
+ }
1321
+
1322
+ $(document)
1323
+ .ready(_ready)
1324
+ .on('click', '.items-toggle a', _toggleSectionsHandler);
1325
+
1326
+ })(jQuery);
assets/js/admin/meta-box-order.js ADDED
@@ -0,0 +1,184 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;
2
+ (function ($) {
3
+ var LP_Order_View = window.LP_Order_View = Backbone.View.extend({
4
+ el : 'body',
5
+ events : {
6
+ 'click #learn-press-add-order-item' : '_addItem',
7
+ 'click #learn-press-calculate-order-total' : 'calculateTotal',
8
+ 'click #learn-press-courses-result a[data-id]': 'addItem',
9
+ 'click .remove-order-item' : 'removeItem',
10
+ 'keyup #learn-press-search-item-term' : 'searchItems',
11
+ 'change select[name="order-status"]' : '_updateDescription'
12
+ },
13
+ initialize : function () {
14
+ _.bindAll(this, 'resetModal', 'updateModal', '_updateDescription');
15
+ LearnPress.Hook.addAction('learn_press_message_box_before_resize', this.resetModal);
16
+ LearnPress.Hook.addAction('learn_press_message_box_resize', this.updateModal);
17
+ this.userSuggest();
18
+ },
19
+ _updateDescription: function (e) {
20
+ var $sel = $(e.target),
21
+ $option = $sel.find('option:selected');
22
+ $sel.siblings('.description').fadeOut('fast', function () {
23
+ $(this).html($option.attr('data-desc'))
24
+ .removeClass(function (c, d) {
25
+ var m = d.match(/(lp-.*)\s?/);
26
+ return m ? m[0] : '';
27
+ }).addClass($option.val()).fadeIn('fast');
28
+ })
29
+ },
30
+ userSuggest : function () {
31
+ var id = ( typeof current_site_id !== 'undefined' ) ? '&site_id=' + current_site_id : '';
32
+ var position = {offset: '0, -1'};
33
+ if (typeof isRtl !== 'undefined' && isRtl) {
34
+ position.my = 'right top';
35
+ position.at = 'right bottom';
36
+ }
37
+ $('.wp-suggest-user').each(function () {
38
+ var $this = $(this),
39
+ autocompleteType = ( typeof $this.data('autocompleteType') !== 'undefined' ) ? $this.data('autocompleteType') : 'add',
40
+ autocompleteField = ( typeof $this.data('autocompleteField') !== 'undefined' ) ? $this.data('autocompleteField') : 'user_login';
41
+
42
+ $this.autocomplete({
43
+ source : LearnPress_Settings.ajax + '?action=learnpress_search_users&autocomplete_type=' + autocompleteType + '&autocomplete_field=' + autocompleteField + id,
44
+ delay : 500,
45
+ minLength: 2,
46
+ position : position,
47
+ open : function () {
48
+ $(this).addClass('open');
49
+ },
50
+ close : function () {
51
+ $(this).removeClass('open');
52
+ },
53
+ select : function (a, b) {
54
+ LearnPress.log(a, b)
55
+ }
56
+ });
57
+ });
58
+ },
59
+ resetModal : function (height, $app) {
60
+ this.$('#learn-press-courses-result').css('height', height - 120).css('overflow', 'auto');
61
+ },
62
+ updateModal : function ($app) {
63
+ this.$('#learn-press-courses-result').css('height', '').css('overflow', '')
64
+ },
65
+ _addItem : function (e) {
66
+ var $form = $('#learn-press-modal-add-order-courses');
67
+ if ($form.length == 0) {
68
+ $form = $(wp.template('learn-press-modal-add-order-courses')());
69
+ }
70
+ LearnPress.MessageBox.show($form);
71
+ },
72
+ addItem : function (e) {
73
+ var that = this,
74
+ $item = $(e.target);
75
+ if (e.ctrlKey) {
76
+ //return true;
77
+ }
78
+ $.ajax({
79
+ url : LearnPress_Settings.ajax,
80
+ data : {
81
+ action : 'learnpress_add_item_to_order',
82
+ order_id: parseInt($('input#post_ID').val()),
83
+ item_id : parseInt($item.attr('data-id')),
84
+ nonce : $('#learn-press-modal-add-order-courses').attr('data-nonce')
85
+ },
86
+ dataType: 'text',
87
+ type : 'post',
88
+ success : function (response) {
89
+ LearnPress.log(response);
90
+ response = LearnPress.parseJSON(response);
91
+ if (response.result == 'success') {
92
+ var $order_table = that.$('.order-items'),
93
+ $no_item = $order_table.find('.no-order-items');
94
+ $(response.item_html).insertBefore($no_item);
95
+ $order_table.find('.order-subtotal').html(response.order_data.subtotal_html);
96
+ $order_table.find('.order-total').html(response.order_data.total_html);
97
+
98
+ $item.remove();
99
+ $no_item.addClass('hide-if-js');
100
+ }
101
+ }
102
+ })
103
+
104
+ return false;
105
+ },
106
+ removeItem : function (e) {
107
+ e.preventDefault();
108
+ var that = this,
109
+ $item = $(e.target).closest('tr'),
110
+ item_id = parseInt($item.attr('data-item_id'));
111
+ if (!item_id) {
112
+ return;
113
+ }
114
+ $.ajax({
115
+ url : LearnPress_Settings.ajax,
116
+ data : {
117
+ action : 'learnpress_remove_order_item',
118
+ order_id : $('#post_ID').val(),
119
+ item_id : item_id,
120
+ remove_nonce: $item.attr('data-remove_nonce')
121
+ },
122
+ type : 'post',
123
+ dataType: 'text',
124
+ success : function (response) {
125
+ response = LearnPress.parseJSON(response);
126
+ if (response.result == 'success') {
127
+ var $order_table = that.$('.order-items'),
128
+ $no_item = $order_table.find('.no-order-items'),
129
+ $other_items = $item.siblings().filter(function () {
130
+ return !$(this).is($no_item)
131
+ });
132
+ $order_table.find('.order-subtotal').html(response.order_data.subtotal_html);
133
+ $order_table.find('.order-total').html(response.order_data.total_html);
134
+ $item.remove();
135
+ $other_items.length == 0 && $no_item.removeClass('hide-if-js');
136
+ }
137
+ }
138
+ });
139
+ },
140
+ calculateTotal : function (e) {
141
+ LearnPress.log(e)
142
+ },
143
+ fetchResults : function (results) {
144
+ var $list = this.$('#learn-press-courses-result'),
145
+ $t = $list.find('li').filter(function () {
146
+ return $(this).hasClass('lp-search-no-results') ? true : $(this).remove() && false;
147
+ });
148
+ _.each(results, function (i, k) {
149
+ $('<li><a href="' + i.permalink + '" data-id="' + k + '">' + i.title + '</a></li>').insertBefore($t);
150
+ });
151
+ },
152
+ searchItems : function (e) {
153
+ var that = this,
154
+ $input = $(e.target),
155
+ timer = $input.data('timer'),
156
+ term = $input.val(),
157
+ _search = function () {
158
+ $.ajax({
159
+ url : LearnPress_Settings.ajax,
160
+ data : {
161
+ action: 'learnpress_search_courses',
162
+ nonce : $input.attr('data-nonce'),
163
+ term : term
164
+ },
165
+ type : 'get',
166
+ dataType: 'text',
167
+ success : function (response) {
168
+ response = LearnPress.parseJSON(response);
169
+ that.fetchResults(response);
170
+ }
171
+ });
172
+ };
173
+ timer && clearTimeout(timer);
174
+ if ((term + '').length >= 3) {
175
+ timer = setTimeout(_search, 250);
176
+ $input.data('timer', timer);
177
+ }
178
+ }
179
+ });
180
+
181
+ $(document).ready(function () {
182
+ new LP_Order_View();
183
+ });
184
+ })(jQuery);
assets/js/admin/meta-box-question.js ADDED
@@ -0,0 +1,422 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @author ThimPress
3
+ * @package LearnPress/Javascript
4
+ * @version 1.0
5
+ */
6
+ ;
7
+ if (typeof window.LearnPress == 'undefined') {
8
+ window.LearnPress = {};
9
+ }
10
+ ;(function ($) {
11
+ var $doc = $(document);
12
+ LearnPress.Hook.addFilter('before_add_question_option', function($el, args){
13
+ return true;
14
+ }).addAction('question_option_added', function($el){
15
+ //$el.find('input[type="text"]').focus();
16
+ })
17
+
18
+ LearnPress.Question = {
19
+ _getEmptyOption: function(question_id){
20
+ var $options = $('#learn-press-list-options-' + question_id + ' tbody .lp-list-option-empty');
21
+ return $options.length ? $options : false;
22
+ },
23
+ addOption : function (question_id, args) {
24
+ var $newOption = this._getEmptyOption(question_id);
25
+ args = $.extend({autoFocus: true}, args || {});
26
+ if( $newOption ){
27
+
28
+ }else {
29
+ var templateArgs = {
30
+ question_id: question_id,
31
+ text : '',
32
+ value : LearnPress.uniqueId()
33
+ },
34
+ tmpl = wp.template($('#learn-press-question-' + question_id).attr('data-type') + '-option'),
35
+ $list = $('#learn-press-list-options-' + question_id + ' tbody');
36
+ $newOption = $(tmpl(templateArgs));
37
+ if (LearnPress.Hook.applyFilters('before_add_question_option', $newOption, args) !== false) {
38
+ $list.append($newOption);
39
+ LearnPress.Hook.doAction('question_option_added', $newOption, args);
40
+ }
41
+ }
42
+ if($newOption && args.autoFocus){
43
+ $newOption.find('.lp-answer-text').focus();
44
+ }
45
+ },
46
+ removeOption: function(theOption){
47
+ var $theOption = null;
48
+ if($.type( theOption ) == 'integer' ){
49
+ $theOption = $('lp-list-option-'+theOption);
50
+ }else{
51
+ $theOption = $(theOption);
52
+ }
53
+ if( LearnPress.Hook.applyFilters('before_remove_question_option', true, $theOption) !== false ) {
54
+ $theOption.remove();
55
+ LearnPress.Hook.doAction('question_option_removed', $theOption);
56
+ }
57
+ },
58
+ addQuestion: function (args) {
59
+ args = $.extend({
60
+ id : 0,
61
+ type: null,
62
+ name: null
63
+ }, args);
64
+ if (!args.id && !args.type) {
65
+ alert('ERROR');
66
+ return;
67
+ }
68
+ var post_data = $.extend({
69
+ action: 'learnpress_add_question'
70
+ }, args);
71
+
72
+ post_data = LearnPress.Hook.applyFilters( 'LearnPress.add_question_post_data', post_data );
73
+
74
+ $.ajax({
75
+ url : LearnPress_Settings.ajax,
76
+ dataType: 'html',
77
+ type : 'post',
78
+ data : post_data,
79
+ success : function (response) {
80
+ response = LearnPress.parseJSON(response);
81
+ var $newQuestion = $(response.html);
82
+ $('#learn-press-list-questions').append($newQuestion);
83
+ LearnPress.Question._hideQuestion( args.id )
84
+ LearnPress.Hook.doAction( 'learn_press_add_quiz_question', $newQuestion, args);
85
+ }
86
+ });
87
+ },
88
+ _hideQuestion: function(question){
89
+ if($.type( question ) == 'number' ) {
90
+ question = $('#learn-press-dropdown-questions .question a[data-id="' + question + '"]').parent()
91
+ }
92
+ $(question).addClass('added');
93
+ },
94
+ _showQuestion: function(question){
95
+ if($.type( question ) == 'number' ) {
96
+ question = $('#learn-press-dropdown-questions .question a[data-id="' + question + '"]').parent()
97
+ }
98
+ $(question).removeClass('added');
99
+ }
100
+ };
101
+ function updateHiddenQuestions(hidden){
102
+ if( hidden == undefined ) {
103
+ hidden = [];
104
+ var len = $('.quiz-question-content').each(function () {
105
+ if ($(this).is(':hidden')) {
106
+ hidden.push($('.learn-press-question', this).attr('data-id'));
107
+ }
108
+ }).length;
109
+ if( hidden.length == 0 ){
110
+ $('.questions-toggle a[data-action="collapse"]')
111
+ .show()
112
+ .siblings('a[data-action="expand"]')
113
+ .hide();
114
+ }else if( hidden.length == len ){
115
+ $('.questions-toggle a[data-action="collapse"]')
116
+ .hide()
117
+ .siblings('a[data-action="expand"]')
118
+ .show();
119
+ }
120
+ }
121
+
122
+ $.ajax({
123
+ url: LearnPress_Settings.ajax,
124
+ data: {
125
+ action: 'learnpress_update_quiz_question_state',
126
+ quiz_id: $('#post_ID').val(),
127
+ hidden: hidden
128
+ },
129
+ success: function(){
130
+
131
+ }
132
+ });
133
+ return hidden;
134
+ }
135
+ LearnPress.sortableQuestionAnswers = function( $questions, args ){
136
+ args = $.extend({
137
+ stop: function(){}
138
+ }, args || {});
139
+ $questions.find('.lp-list-options tbody').sortable({
140
+ handle: '.lp-move-list-option',
141
+ axis: 'y',
142
+ start: function(e, ui){
143
+ var $heads = ui.item.parent().closest('table').find('tr > th');
144
+ ui.item.children().each(function(i){
145
+ $(this).css({
146
+ width: $heads.eq(i).outerWidth()
147
+ });
148
+ })
149
+ var $this = $(this),
150
+ cols = $this.find('tr:first').children().length;
151
+ $this.find('.ui-sortable-placeholder td:gt(0)').remove();
152
+ $this.find('.ui-sortable-placeholder td:eq(0)').attr('colspan', cols)
153
+ },
154
+ stop: function(e, ui){
155
+ $.isFunction( args.stop ) && args.stop.apply( this, [e, ui] );
156
+ }
157
+ });
158
+ }
159
+ function _ready() {
160
+ $('#learn-press-toggle-questions').on('click', function () {
161
+ $(this).siblings('ul').toggle();
162
+ });
163
+
164
+ $doc.on('click', '#learn-press-dropdown-questions ul li a', function (e) {
165
+ e.preventDefault();
166
+ LearnPress.Question.addQuestion({id: $(this).data('id')});
167
+ $(this).closest('ul').hide();
168
+ });
169
+
170
+ $('#learn-press-button-add-question').on('click', function () {
171
+ //LearnPress.Question.addQuestion({name: $('#learn-press-question-name').val(), type: 'true_or_false'});
172
+ });
173
+
174
+ $doc.on('click', '.add-question-option-button', function (e, data) {
175
+ var question_id = $(this).attr('data-id');
176
+ LearnPress.Question.addOption(question_id, data);
177
+ }).on('click', '.lp-remove-list-option', function () {
178
+ var $option = $(this).closest('tr');
179
+ LearnPress.MessageBox.quickConfirm( $('i', this), {
180
+ message: 'Are you sure you want to remove this option?',
181
+ onOk: function (a) {
182
+ LearnPress.Question.removeOption($option);
183
+ }
184
+ });
185
+ }).on('change', '.lp-dropdown-question-types', function(){
186
+ var $select = $(this),
187
+ $wrap = $select.closest('.learn-press-question'),
188
+ questionId = $wrap.data('id'),
189
+ from = $select.data('selected'),
190
+ to = this.value,
191
+ _do = function(){
192
+ LearnPress.MessageBox.blockUI();
193
+ $.ajax({
194
+ url: LearnPress_Settings.ajax,
195
+ type: 'post',
196
+ dataType: 'html',
197
+ data: {
198
+ action: 'learnpress_convert_question_type',
199
+ question_id: questionId,
200
+ from: from,
201
+ to: to,
202
+ data: $('#post').serialize()//$wrap.find('input, select, textarea').
203
+ },
204
+ success: function(response){
205
+ response = LearnPress.parseJSON(response);
206
+ var $newOptions = $(response.html),
207
+ $question = $('#learn-press-question-'+questionId),
208
+ $icon = $question.closest('.quiz-question').find('.quiz-question-icon img');
209
+ $question.replaceWith($newOptions);
210
+ if($icon.length){
211
+ $icon.replaceWith(response.icon)
212
+ }
213
+ LearnPress.Hook.doAction('learn_press_convert_question_type', questionId, from, to, $newOptions );
214
+ LearnPress.MessageBox.hide();
215
+ }
216
+ });
217
+ };
218
+
219
+ LearnPress.MessageBox.show( 'Are you sure you want to convert to new type?', {
220
+ buttons: 'yesNo',
221
+ events: {
222
+ onYes: function () {
223
+ _do();
224
+ },
225
+ onNo : function () {
226
+ //revert
227
+ $select.val(from);//find('option:selected').prop('selected', false).siblings('[value="' + from + '"]').prop('selected', true);
228
+ }
229
+ }
230
+ });
231
+ return;
232
+
233
+ }).on('click', '.questions-toggle a', function(e){
234
+ e.preventDefault();
235
+ var action = $(this).attr('data-action');
236
+ switch (action){
237
+ case 'expand':
238
+ var $items = $('.quiz-question'),
239
+ len = $items.length, i = 0;
240
+ $(this)
241
+ .hide()
242
+ .siblings('a[data-action="collapse"]')
243
+ .show();
244
+ $items
245
+ .removeClass('is-hidden')
246
+ .find('.quiz-question-content').slideDown(function(){
247
+ if(++i == len){
248
+ updateHiddenQuestions([]);
249
+ }
250
+ });
251
+ $items.find('a[data-action="collapse"]').show();
252
+ $items.find('a[data-action="expand"]').hide();
253
+ break;
254
+ case 'collapse':
255
+ var $items = $('.quiz-question'),
256
+ len = $items.length, i = 0,
257
+ hidden = [];
258
+ $(this)
259
+ .hide()
260
+ .siblings('a[data-action="expand"]')
261
+ .show();
262
+ $items
263
+ .addClass('is-hidden')
264
+ .find('.quiz-question-content').slideUp(function(){
265
+ hidden.push($('.learn-press-question', this).attr('data-id'));
266
+ if(++i == len){
267
+ updateHiddenQuestions(hidden);
268
+ }
269
+ });
270
+ $items.find('a[data-action="collapse"]').hide();
271
+ $items.find('a[data-action="expand"]').show();
272
+ break;
273
+ }
274
+ }).on('click', '.quiz-question-actions a', function(e){
275
+ var $link = $(this),
276
+ action = $link.attr('data-action');
277
+
278
+ switch (action){
279
+ case 'expand':
280
+ $(this)
281
+ .hide()
282
+ .siblings('a[data-action="collapse"]')
283
+ .show()
284
+ .closest('.quiz-question')
285
+ .removeClass('is-hidden')
286
+ .find('.quiz-question-content').slideDown(function(){
287
+ if( updateHiddenQuestions().length == 0 ){
288
+
289
+ }
290
+ });
291
+ break;
292
+ case 'collapse':
293
+ $(this)
294
+ .hide()
295
+ .siblings('a[data-action="expand"]')
296
+ .show()
297
+ .closest('.quiz-question')
298
+ .addClass('is-hidden')
299
+ .find('.quiz-question-content').slideUp(function(){
300
+ updateHiddenQuestions();
301
+ });
302
+ break;
303
+ case 'remove':
304
+ LearnPress.MessageBox.quickConfirm( $link, {
305
+ onOk: function(a){
306
+ var $question = $(a);
307
+ $.ajax({
308
+ url: $link.attr('href'),
309
+ /*data: {
310
+ action: 'learnpress_remove_quiz_question',
311
+ question_id: $question.attr('data-id'),
312
+ quiz_id: $('#post_ID').val()
313
+ },*/
314
+ success: function(){
315
+ $question.fadeOut(function(){$(this).remove()});
316
+ }
317
+ });
318
+ },
319
+ onCancel: function(a){
320
+
321
+ },
322
+ data: $(this).closest('.quiz-question')
323
+ });
324
+ break;
325
+ LearnPress.MessageBox.show( 'Do you want to remove this question from quiz?', {
326
+ buttons: 'yesNo',
327
+ data: $(this).closest('.quiz-question'),
328
+ events: {
329
+ onYes: function (instance) {
330
+ var $question = $(instance.data);
331
+ $.ajax({
332
+ url: $link.attr('href'),
333
+ /*data: {
334
+ action: 'learnpress_remove_quiz_question',
335
+ question_id: $question.attr('data-id'),
336
+ quiz_id: $('#post_ID').val()
337
+ },*/
338
+ success: function(){
339
+ $question.fadeOut(function(){$(this).remove()});
340
+ }
341
+ });
342
+ }
343
+ }
344
+ })
345
+ break;
346
+ //case 'edit':
347
+ //LearnPress.MessageBox.show('<iframe src="'+$(this).attr('href')+'" />');
348
+
349
+ }
350
+ if( action ){
351
+ e.preventDefault();
352
+ }
353
+ }).on('keydown', '.no-submit', function(e){
354
+ if(e.keyCode == 13) {
355
+ e.preventDefault();
356
+ LearnPress.log('no submit form');
357
+ }
358
+ }).on('change keyup', '.lp-answer-text', function(e){
359
+ var $input = $(this),
360
+ $option = $input.closest('.lp-list-option'),
361
+ value = $input.val()+'';
362
+ if(e.keyCode != 13){
363
+ switch (e.keyCode){
364
+ case 38:
365
+ case 40:
366
+ case 8:
367
+ case 46:
368
+ var pressed = $input.data('key-'+ e.keyCode) || 1;
369
+ LearnPress.log('pressed:'+pressed)
370
+ if(pressed > 1){
371
+ if(e.keyCode == 38){
372
+ ( $prev = $input.findPrev('.key-nav') ) && $prev.focus();
373
+ pressed = 0;
374
+ }else if(e.keyCode == 40){
375
+ ( $next = $input.findNext('.key-nav') ) && $next.focus();
376
+ pressed = 0;
377
+ }else if(e.keyCode == 8 && value.length == 0){
378
+ var $row = $input.closest('tr'),
379
+ $prev = $row.prev();
380
+ if( $prev.length ){
381
+ $prev.find('.lp-answer-text').focus();
382
+ $row.remove();
383
+ }
384
+ }else if(e.keyCode == 46 && value.length == 0){
385
+ var $row = $input.closest('tr'),
386
+ $next = $row.next();
387
+ if( !$next.hasClass('lp-list-option-empty') ){
388
+ $next.find('.lp-answer-text').focus();
389
+ $row.remove();
390
+ }
391
+ }
392
+ $input.data('key-'+ e.keyCode, 0 );
393
+ }else {
394
+ if( e.keyCode == 8 || e.keyCode == 46 ){
395
+ if( value.length == 0 ){
396
+ $input.data('key-' + e.keyCode, pressed + 1);
397
+ }
398
+ } else {
399
+ $input.data('key-' + e.keyCode, pressed + 1);
400
+ }
401
+ }
402
+ break;
403
+ }
404
+ if( value.length ){
405
+ $option.removeClass('lp-list-option-empty');
406
+ }else{
407
+ $option.addClass('lp-list-option-empty');
408
+ return;
409
+ }
410
+ }
411
+ var $wrap = $(this).closest('.learn-press-question'),
412
+ $button = $wrap.find('.add-question-option-button');
413
+ $button.trigger('click', {autoFocus: e.keyCode == 13});
414
+ });
415
+
416
+
417
+ }
418
+
419
+ $(document).ready(_ready);
420
+
421
+ })
422
+ (jQuery);
assets/js/admin/meta-box-quiz.js ADDED
@@ -0,0 +1,268 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Created by Tu on 30/03/2015.
3
+ */
4
+ ;
5
+ (function ($) {
6
+
7
+ $(document).ready(function () {
8
+ if (typeof Backbone == 'undefined') return;
9
+ var LP_Quiz_Question_Model = window.LP_Quiz_Question_Model = Backbone.Model.extend({})
10
+
11
+ var LP_Quiz_Question_View = window.LP_Quiz_Question_View = Backbone.View.extend({
12
+ el : 'body',
13
+ events : {
14
+ 'click #learn-press-button-add-question': 'showListQuestions',
15
+ 'keyup #lp-modal-quiz-questions input[name="lp-item-name"]': 'searchItem',
16
+ 'click #lp-modal-quiz-questions input[type="checkbox"]': 'toggleAddItemButtonState',
17
+ 'change #lp-modal-quiz-questions input[type="checkbox"]': 'toggleAddItemButtonState',
18
+ 'click #lp-modal-quiz-questions .lp-add-item': 'addItemToQuiz',
19
+ 'keyup input[name="lp-new-question-name"]': 'toggleAddButtonState',
20
+ 'keydown .no-submit': 'preventSubmitForm',
21
+ 'click .lp-button-add-question': 'addNewItem'
22
+ },
23
+ initialize: function () {
24
+ $('#learn-press-list-questions').sortable({
25
+ handle: '.quiz-question-actions .move',
26
+ axis: 'y'
27
+ });
28
+ _.bindAll( this, 'addItemsToSection', 'getSelectedItems' );
29
+ LearnPress.Hook.addAction( 'learn_press_message_box_before_resize', this.resetModalSearch);
30
+ LearnPress.Hook.addAction( 'learn_press_message_box_resize', this.updateModalSearch);
31
+ LearnPress.Hook.addFilter( 'learn_press_modal_search_items_exclude', this.getSelectedItems );
32
+
33
+ $(document).on('learn_press_modal_search_items_response', this.addItemsToSection );
34
+ },
35
+ updateModalSearch: function(height, $app){
36
+ $('.lp-modal-search ul.lp-list-items').css('height', height - 120).css('overflow', 'auto');
37
+ },
38
+ resetModalSearch: function($app){
39
+ $('.lp-modal-search ul.lp-list-items').css('height', '').css('overflow', '')
40
+ },
41
+ toggleAddButtonState: function(e){
42
+ LearnPress.log(e.target.value)
43
+ if((e.target.value+'').length == 0){
44
+ $('.lp-button-add-question').addClass('disabled')
45
+ }else{
46
+ $('.lp-button-add-question').removeClass('disabled')
47
+ }
48
+ if(e.keyCode == 13){
49
+ $(e.target).siblings('.lp-button-add-question').trigger('click')
50
+ }
51
+ },
52
+ preventSubmitForm: function(e){
53
+ if(e.keyCode == 13){
54
+ return false;
55
+ }
56
+ },
57
+ showListQuestions: function(){
58
+ var $form = LearnPress.ModalSearchItems( {
59
+ template: 'tmpl-learn-press-search-items',
60
+ type: 'lp_question',
61
+ context: 'quiz-items',
62
+ context_id: $('#post_ID').val(),
63
+ exclude: this.getSelectedItems()
64
+ } );
65
+ LearnPress.MessageBox.show($form.$el);
66
+ $form.$el.find('header input').focus();
67
+
68
+ return;
69
+ var $form = $('#lp-modal-quiz-questions'),
70
+ $button = $form.find('.lp-add-item');
71
+ if ($form.length == 0) {
72
+ $form = $(wp.template('lp-modal-quiz-questions')());
73
+ }
74
+
75
+ LearnPress.MessageBox.show($form);
76
+ $form.find('[name="lp-item-name"]').focus().trigger('keyup');
77
+ $button.html($button.attr('data-text'));
78
+ },
79
+ searchItem: function(e){
80
+ var that = this,
81
+ $input = $(e.target);
82
+ if($input.val() == $input.data('search-term')){
83
+ return;
84
+ }
85
+ $input.data('search-term', $input.val() );
86
+ var $form = $input.closest('.lp-modal-search'),
87
+ text = $input.val().replace(/\\q\?[\s]*/ig, ''),
88
+ $button = $form.find('.lp-add-item'),
89
+ timer = $input.data('timer'),
90
+ _search = function(){
91
+ $.ajax({
92
+ url: LearnPress_Settings.ajax,
93
+ data: {
94
+ action: 'learnpress_search_questions',
95
+ quiz_id: $('#post_ID').val(),
96
+ term: text,
97
+ exclude: that.getAddedQuestions()
98
+ },
99
+ dataType: 'text',
100
+ success: function(response){
101
+ response = LearnPress.parseJSON(response);
102
+ LearnPress.log(response);
103
+ $form.find('.lp-list-items').html(response.html).removeClass('lp-ajaxload');
104
+ $(window).trigger('resize');
105
+ }
106
+ });
107
+ };
108
+ $form.find('.lp-list-items').html('').addClass('lp-ajaxload');
109
+ $button.html( $button.attr('data-text')).prop('disabled', true);
110
+ timer && clearTimeout(timer);
111
+ timer = setTimeout(_search, 300);
112
+ $input.data('timer', timer);
113
+ $(window).trigger('resize');
114
+
115
+ },
116
+ toggleAddItemButtonState: function(e){
117
+ var $form = $(e.target).closest('.lp-modal-search'),
118
+ selected = $form.find('.lp-list-items li:visible input:checked'),
119
+ $button = $form.find('.lp-add-item');
120
+ if( selected.length ){
121
+ $button.removeAttr('disabled').html($button.attr('data-text')+' (+'+selected.length+')');
122
+ }else{
123
+ $button.attr('disabled', true).html($button.attr('data-text'));
124
+ }
125
+ },
126
+ getSelectedItems: function( exclude ){
127
+ return this.$('.learn-press-question[data-id]').map(function(){return ($(this).attr('data-id'))}).filter(function(i, c){return c > 0}).get();
128
+ },
129
+ addItemsToSection: function(e, $view, $items) {
130
+ var that = this,
131
+ selected = $items;
132
+ selected.each(function () {
133
+ var $li = $(this);//.closest('li').addClass('selected'),
134
+ args = $li.dataToJSON();
135
+ that.addQuestion(args);
136
+ $li.remove();
137
+ });
138
+ },
139
+ addQuestion: function (args) {
140
+ args = $.extend({
141
+ id : 0,
142
+ type: null,
143
+ name: null
144
+ }, args);
145
+ if (!args.id && !args.type) {
146
+ alert('ERROR');
147
+ return;
148
+ }
149
+ var that = this,
150
+ post_data = $.extend({
151
+ action: 'learnpress_add_quiz_question',
152
+ quiz_id: $('#post_ID').val()
153
+ }, args);
154
+
155
+ post_data = LearnPress.Hook.applyFilters( 'LearnPress.add_question_post_data', post_data );
156
+
157
+ $.ajax({
158
+ url : LearnPress_Settings.ajax,
159
+ dataType: 'html',
160
+ type : 'post',
161
+ data : post_data,
162
+ success : function (response) {
163
+ response = LearnPress.parseJSON(response);
164
+ var $newQuestion = $(response.html);
165
+ $('#learn-press-list-questions').append($newQuestion);
166
+ that.$('#lp-modal-quiz-questions li[data-id="'+response.id+'"]').addClass('selected hide-if-js');
167
+ //LearnPress.Question._hideQuestion( args.id )
168
+ LearnPress.Hook.doAction( 'learn_press_add_quiz_question', $newQuestion, args);
169
+ }
170
+ });
171
+ },
172
+ addNewItem: function(e){
173
+ e.preventDefault();
174
+ var $target = $(e.target),
175
+ $form = $target.closest('.lp-modal-search'),
176
+ $input = this.$('input[name="lp-new-question-name"]'),
177
+ type = null;
178
+ if($target.is('a')){
179
+ type = $target.attr('data-type');
180
+ $target = $target.closest('.lp-button-add-question');
181
+ }else{
182
+ if(!$target.is('.lp-button-add-question')){
183
+ $target = $target.closest('.lp-button-add-question');
184
+ }
185
+ type = $target.find('ul > li > a:first').attr('data-type');
186
+ }
187
+ if($target.hasClass('disabled')){
188
+ return;
189
+ }
190
+ if( ($input.val()+'').length == 0 ){
191
+ alert('Please enter question name');
192
+ $input.focus();
193
+ return;
194
+ }
195
+ this.addQuestion({
196
+ type: type,
197
+ name: $input.val()
198
+ });
199
+ $input.focus().val('').trigger('keyup')
200
+ },
201
+ addItemToQuiz: function(e){
202
+ var that = this,
203
+ $form = $(e.target).closest('.lp-modal-search'),
204
+ selected = $form.find('li:visible input:checked'),
205
+ $section = $form.data('section');
206
+ selected.each(function(){
207
+ var $li = $(this).closest('li').addClass('selected'),
208
+ args = $li.dataToJSON();
209
+ /*$item = that.createItem( args, $section );
210
+ $item.removeClass('lp-item-empty');*/
211
+ that.addQuestion({id: $(this).val()});
212
+ });
213
+ $form.remove();
214
+ LearnPress.MessageBox.hide();
215
+ },
216
+ createItem: function(args, $section){
217
+ var tmpl = wp.template('quiz-question'),
218
+ $item = $(tmpl(args));
219
+ if( $section ) {
220
+ var $last = $section.find('.curriculum-section-items li:last');
221
+ $item.insertBefore($last);
222
+ }
223
+ return $item;
224
+ },
225
+ getAddedQuestions: function(){
226
+ var ids =
227
+ this.$('.learn-press-question')
228
+ .map(function(){
229
+ return parseInt($(this).attr('data-id'))
230
+ }).get();
231
+ return ids;
232
+ }
233
+ });
234
+
235
+ new LP_Quiz_Question_View(new LP_Quiz_Question_Model());
236
+ });
237
+
238
+ return
239
+ var $doc = $(document),
240
+ $body = $(document.body);
241
+
242
+ function addNewQuestion() {
243
+ var type = $('#lpr-quiz-question-type').val();
244
+ if (!type) {
245
+ // warning
246
+ return;
247
+ }
248
+ var data = {
249
+ action : 'lpr_quiz_question_add',
250
+ quiz_id: lpr_quiz_id,
251
+ type : type
252
+ };
253
+ $.post(ajaxurl, data, function (res) {
254
+ var $question = $(res)
255
+ $('#lpr-quiz-questions').append($question);
256
+ lprHook.doAction('lpr_admin_quiz_question_html', $question, type);
257
+
258
+ $('#lpr-quiz-question-type').val('')
259
+ }, 'text');
260
+ }
261
+
262
+ function _ready() {
263
+ $('#lpr-quiz-question-add').click(addNewQuestion);
264
+ }
265
+
266
+ $doc.ready(_ready);
267
+
268
+ })(jQuery)
assets/js/admin/modal-search-items.js ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*global jQuery, Backbone, _ */
2
+ ( function ($, Backbone, _) {
3
+ 'use strict';
4
+
5
+ LearnPress.ModalSearchItems = function (options) {
6
+ return new LearnPress.ModalSearchItems.View(options);
7
+ };
8
+
9
+ LearnPress.ModalSearchItems.View = Backbone.View.extend({
10
+ tagName : 'div',
11
+ id : 'learn-press-modal-search-items',
12
+ options : {
13
+ template: 'tmpl-learn-press-search-items',
14
+ type : ''
15
+ },
16
+ events : {
17
+ 'click .close-modal' : '_closeModal',
18
+ 'click .lp-add-item' : '_addItems',
19
+ 'keydown' : 'keyboardActions',
20
+ 'change input[type="checkbox"]': '_toggleAddItemButtonState',
21
+ 'click .chk-checkall' : '_checkAll'
22
+ },
23
+ searchTimer : null,
24
+ searchTerm : null,
25
+ initialize : function (options) {
26
+ var that = this;
27
+ this.options = options;
28
+ _.bindAll(this, 'render');
29
+ this.render();
30
+ LearnPress.Hook
31
+ .addAction('learn_press_message_box_before_resize', function () {
32
+ that.$('article').css('height', '');
33
+ })
34
+ .addAction('learn_press_message_box_resize', function (height, app) {
35
+ that.$('article').css({
36
+ height: height - 135
37
+ });
38
+ });
39
+ },
40
+ render : function () {
41
+ this.$el.attr({
42
+ tabindex : 0,
43
+ 'data-tmpl': this.options.template
44
+ }).append(LearnPress.template(this.options.template));
45
+
46
+ $(document.body).css({
47
+ 'overflow': 'hidden'
48
+ }).append(this.$el);
49
+ this.search({
50
+ exclude: this.options.exclude
51
+ });
52
+
53
+ $(document.body).trigger('learn_press_modal_search_items_loaded', this);
54
+ },
55
+ _toggleAddItemButtonState: function (e) {
56
+ var
57
+ $selected = this.$('li input:checked'),
58
+ $button = this.$('.lp-add-item');
59
+ if ($selected.length) {
60
+ $button.each(function () {
61
+ var $btn = $(this);
62
+ $btn.removeAttr('disabled').html($btn.attr('data-text') + ' (+' + $selected.length + ')');
63
+ })
64
+
65
+ } else {
66
+ $button.each(function () {
67
+ var $btn = $(this);
68
+ $btn.attr('disabled', true).html($btn.attr('data-text'));
69
+ })
70
+
71
+ }
72
+ },
73
+ _checkAll : function (e) {
74
+ this.$('.lp-list-items li input[type="checkbox"]').prop('checked', e.target.checked).first().trigger('change');
75
+ },
76
+ _search : function () {
77
+
78
+ },
79
+ _fetchItems : function (response) {
80
+ this.$('article .lp-list-items').removeClass('lp-ajaxload').html(response.html);
81
+ LearnPress.log(response.html);
82
+ this.refreshModal();
83
+ $(document.body).trigger('learn_press_modal_search_items_fetch', this);
84
+ },
85
+ search : function (args) {
86
+ var that = this;
87
+ this.$('article ul').addClass('lp-ajaxload');
88
+ this.refreshModal();
89
+ args = $.extend({
90
+ term : '',
91
+ exclude: ''
92
+ }, args || {});
93
+ $.ajax({
94
+ url : LearnPress_Settings.ajax,
95
+ data : {
96
+ action : 'learnpress_modal_search_items',
97
+ type : this.options.type,
98
+ term : args.term,
99
+ exclude : args.exclude,
100
+ context : this.options.context,
101
+ context_id: this.options.context_id
102
+ },
103
+ type : 'get',
104
+ dataType: 'text',
105
+ success : function (response) {
106
+ response = LearnPress.parseJSON(response);
107
+ that._fetchItems(response);
108
+ }
109
+ })
110
+ },
111
+ _closeModal : function (e) {
112
+ e.preventDefault();
113
+ $(document.body).trigger('learn_press_modal_search_items_before_remove', this);
114
+ this.undelegateEvents();
115
+ $(document).off('focusin');
116
+ $(document.body).css({
117
+ 'overflow': 'auto'
118
+ });
119
+ this.remove();
120
+ LearnPress.MessageBox.hide();
121
+ $(document.body).trigger('learn_press_modal_search_items_removed', this);
122
+ },
123
+ _addItems : function (e) {
124
+ $(document.body).trigger('learn_press_modal_search_items_response', [this, this.getItems()]);
125
+ this.refreshModal(e);
126
+ if ($(e.target).hasClass('close')) {
127
+ this.$('.close-modal').trigger('click')
128
+ }
129
+ },
130
+ refreshModal : function (e) {
131
+ this._toggleAddItemButtonState(e);
132
+ this.$('.chk-checkall').prop('disabled', this.$('.lp-list-items li input[type="checkbox"]').length == 0);
133
+ $(window).trigger('resize.message-box');
134
+ },
135
+ getItems : function () {
136
+ return this.$('li input:checked').map(function () {
137
+ return $(this).closest('li')
138
+ });
139
+ },
140
+ keyboardActions : function (e) {
141
+ var that = this,
142
+ button = e.keyCode || e.which;
143
+ // Enter key
144
+ if (e.target.tagName && ( e.target.tagName.toLowerCase() === 'input' || e.target.tagName.toLowerCase() === 'textarea' ) && e.target.value != this.searchTerm) {
145
+ this.searchTimer && clearTimeout(this.searchTimer);
146
+ this.searchTimer = setTimeout(function () {
147
+ that.search({
148
+ term : e.target.value,
149
+ exclude: LearnPress.Hook.applyFilters('learn_press_modal_search_items_exclude', that.options.exclude, that)
150
+ });
151
+ }, 300);
152
+ this.searchTerm = e.target.value;
153
+ this.$('.chk-checkall').prop('checked', false);
154
+ }
155
+
156
+ // ESC key
157
+ if (27 === button) {
158
+ this._closeModal(e);
159
+ }
160
+ }
161
+ });
162
+
163
+ }(jQuery, Backbone, _));
assets/js/admin/question.min.js ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if(typeof window.LearnPress=='undefined'){window.LearnPress={}};(function($){var $doc=$(document);LearnPress.Hook.addFilter('before_add_question_option',function($el,args){return !0}).addAction('question_option_added',function($el){})
2
+ LearnPress.Question={_getEmptyOption:function(question_id){var $options=$('#learn-press-list-options-'+question_id+' tbody .lp-list-option-empty');return $options.length?$options:!1},addOption:function(question_id,args){var $newOption=this._getEmptyOption(question_id);args=$.extend({autoFocus:!0},args||{});if($newOption){}else{var templateArgs={question_id:question_id,text:'',value:LearnPress.uniqueId()},tmpl=wp.template($('#learn-press-question-'+question_id).attr('data-type')+'-option'),$list=$('#learn-press-list-options-'+question_id+' tbody');$newOption=$(tmpl(templateArgs));if(LearnPress.Hook.applyFilters('before_add_question_option',$newOption,args)!==!1){$list.append($newOption);LearnPress.Hook.doAction('question_option_added',$newOption,args)}}
3
+ if($newOption&&args.autoFocus){$newOption.find('.lp-answer-text').focus()}},removeOption:function(theOption){var $theOption=null;if($.type(theOption)=='integer'){$theOption=$('lp-list-option-'+theOption)}else{$theOption=$(theOption)}
4
+ if(LearnPress.Hook.applyFilters('before_remove_question_option',!0,$theOption)!==!1){$theOption.remove();LearnPress.Hook.doAction('question_option_removed',$theOption)}},addQuestion:function(args){args=$.extend({id:0,type:null,name:null},args);if(!args.id&&!args.type){alert('ERROR');return}
5
+ var post_data=$.extend({action:'learnpress_add_question'},args);post_data=LearnPress.Hook.applyFilters('LearnPress.add_question_post_data',post_data);$.ajax({url:LearnPress_Settings.ajax,dataType:'html',type:'post',data:post_data,success:function(response){response=LearnPress.parseJSON(response);var $newQuestion=$(response.html);$('#learn-press-list-questions').append($newQuestion);LearnPress.Question._hideQuestion(args.id)
6
+ LearnPress.Hook.doAction('learn_press_add_quiz_question',$newQuestion,args)}})},_hideQuestion:function(question){if($.type(question)=='number'){question=$('#learn-press-dropdown-questions .question a[data-id="'+question+'"]').parent()}
7
+ $(question).addClass('added')},_showQuestion:function(question){if($.type(question)=='number'){question=$('#learn-press-dropdown-questions .question a[data-id="'+question+'"]').parent()}
8
+ $(question).removeClass('added')}};function updateHiddenQuestions(hidden){if(hidden==undefined){hidden=[];var len=$('.quiz-question-content').each(function(){if($(this).is(':hidden')){hidden.push($('.learn-press-question',this).attr('data-id'))}}).length;if(hidden.length==0){$('.questions-toggle a[data-action="collapse"]').show().siblings('a[data-action="expand"]').hide()}else if(hidden.length==len){$('.questions-toggle a[data-action="collapse"]').hide().siblings('a[data-action="expand"]').show()}}
9
+ $.ajax({url:LearnPress_Settings.ajax,data:{action:'learnpress_update_quiz_question_state',quiz_id:$('#post_ID').val(),hidden:hidden},success:function(){}});return hidden}
10
+ LearnPress.sortableQuestionAnswers=function($questions){$questions.find('.lp-list-options tbody').sortable({handle:'.lp-move-list-option',axis:'y',start:function(e,ui){var $heads=ui.item.parent().closest('table').find('tr > th');ui.item.children().each(function(i){$(this).css({width:$heads.eq(i).width()})})
11
+ var $this=$(this),cols=$this.find('tr:first').children().length;$this.find('.ui-sortable-placeholder td:gt(0)').remove();$this.find('.ui-sortable-placeholder td:eq(0)').attr('colspan',cols)},stop:function(){}})}
12
+ function _ready(){$('#learn-press-toggle-questions').on('click',function(){$(this).siblings('ul').toggle()});$doc.on('click','#learn-press-dropdown-questions ul li a',function(e){e.preventDefault();LearnPress.Question.addQuestion({id:$(this).data('id')});$(this).closest('ul').hide()});$('#learn-press-button-add-question').on('click',function(){});$doc.on('click','.add-question-option-button',function(e,data){var question_id=$(this).attr('data-id');LearnPress.Question.addOption(question_id,data)}).on('click','.lp-remove-list-option',function(){var $option=$(this).closest('tr');LearnPress.Question.removeOption($option)}).on('change','.lp-dropdown-question-types',function(){var $select=$(this),$wrap=$select.closest('.learn-press-question'),questionId=$wrap.data('id'),from=$select.data('selected'),to=this.value,_do=function(){LearnPress.MessageBox.blockUI();$.ajax({url:LearnPress_Settings.ajax,type:'post',dataType:'html',data:{action:'learnpress_convert_question_type',question_id:questionId,from:from,to:to,data:$('#post').serialize()},success:function(response){response=LearnPress.parseJSON(response);var $newOptions=$(response.html),$question=$('#learn-press-question-'+questionId),$icon=$question.closest('.quiz-question').find('.quiz-question-icon img');$question.replaceWith($newOptions);if($icon.length){$icon.replaceWith(response.icon)}
13
+ LearnPress.Hook.doAction('learn_press_convert_question_type',questionId,from,to,$newOptions);LearnPress.MessageBox.hide()}})};LearnPress.MessageBox.show('Are you sure you want to convert to new type?',{buttons:'yesNo',events:{onYes:function(){_do()},onNo:function(){$select.val(from)}}});return}).on('click','.questions-toggle a',function(e){e.preventDefault();var action=$(this).attr('data-action');switch(action){case 'expand':var $items=$('.quiz-question'),len=$items.length,i=0;$(this).hide().siblings('a[data-action="collapse"]').show();$items.removeClass('is-hidden').find('.quiz-question-content').slideDown(function(){if(++i==len){updateHiddenQuestions([])}});$items.find('a[data-action="collapse"]').show();$items.find('a[data-action="expand"]').hide();break;case 'collapse':var $items=$('.quiz-question'),len=$items.length,i=0,hidden=[];$(this).hide().siblings('a[data-action="expand"]').show();$items.addClass('is-hidden').find('.quiz-question-content').slideUp(function(){hidden.push($('.learn-press-question',this).attr('data-id'));if(++i==len){updateHiddenQuestions(hidden)}});$items.find('a[data-action="collapse"]').hide();$items.find('a[data-action="expand"]').show();break}}).on('click','.quiz-question-actions a',function(e){var $link=$(this),action=$link.attr('data-action');switch(action){case 'expand':$(this).hide().siblings('a[data-action="collapse"]').show().closest('.quiz-question').removeClass('is-hidden').find('.quiz-question-content').slideDown(function(){if(updateHiddenQuestions().length==0){}});break;case 'collapse':$(this).hide().siblings('a[data-action="expand"]').show().closest('.quiz-question').addClass('is-hidden').find('.quiz-question-content').slideUp(function(){updateHiddenQuestions()});break;case 'remove':LearnPress.MessageBox.show('Do you want to remove this question from quiz?',{buttons:'yesNo',data:$(this).closest('.quiz-question'),events:{onYes:function(instance){var $question=$(instance.data);$.ajax({url:$link.attr('href'),success:function(){$question.fadeOut(function(){$(this).remove()})}})}}})
14
+ break}
15
+ if(action){e.preventDefault()}}).on('keydown','.no-submit',function(e){if(e.keyCode==13){e.preventDefault();LearnPress.log('no submit form')}}).on('change keyup','.lp-answer-text',function(e){var $input=$(this),$option=$input.closest('.lp-list-option'),value=$input.val()+'';if(e.keyCode!=13){switch(e.keyCode){case 38:case 40:case 8:case 46:var pressed=$input.data('key-'+e.keyCode)||1;LearnPress.log('pressed:'+pressed)
16
+ if(pressed>1){if(e.keyCode==38){($prev=$input.findPrev('.key-nav'))&&$prev.focus();pressed=0}else if(e.keyCode==40){($next=$input.findNext('.key-nav'))&&$next.focus();pressed=0}else if(e.keyCode==8&&value.length==0){var $row=$input.closest('tr'),$prev=$row.prev();if($prev.length){$prev.find('.lp-answer-text').focus();$row.remove()}}else if(e.keyCode==46&&value.length==0){var $row=$input.closest('tr'),$next=$row.next();if(!$next.hasClass('lp-list-option-empty')){$next.find('.lp-answer-text').focus();$row.remove()}}
17
+ $input.data('key-'+e.keyCode,0)}else{if(e.keyCode==8||e.keyCode==46){if(value.length==0){$input.data('key-'+e.keyCode,pressed+1)}}else{$input.data('key-'+e.keyCode,pressed+1)}}
18
+ break}
19
+ if(value.length){$option.removeClass('lp-list-option-empty')}else{$option.addClass('lp-list-option-empty');return}}
20
+ var $wrap=$(this).closest('.learn-press-question'),$button=$wrap.find('.add-question-option-button');$button.trigger('click',{autoFocus:e.keyCode==13})})}
21
+ $(document).ready(_ready)})(jQuery)
assets/js/admin/settings.js ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;(function ($) {
2
+ var $doc = $(document),
3
+ oldData = false;
4
+
5
+ function addPageToAllDropdowns(args) {
6
+ var position = $.inArray(args.ID + "", args.positions);
7
+ $('.learn-press-dropdown-pages').each(function () {
8
+ var $select = $(this),
9
+ $new_option = $('<option value="' + args.ID + '">' + args.name + '</option>')
10
+ if (position == 0) {
11
+ $('option', $select).each(function () {
12
+ if (parseInt($(this).val())) {
13
+ $new_option.insertBefore($(this));
14
+ return false;
15
+ }
16
+ })
17
+ } else if (position == args.positions.length - 1) {
18
+ $select.append($new_option);
19
+ } else {
20
+ $new_option.insertAfter($('option[value="' + args.positions[position - 1] + '"]', $select));
21
+ }
22
+ });
23
+ }
24
+
25
+ function _ready() {
26
+
27
+ $('.learn-press-dropdown-pages').each(function () {
28
+ $(this).change(function () {
29
+ var $select = $(this),
30
+ thisId = $select.attr('id'),
31
+ $actions = $select.siblings('.learn-press-quick-add-page-actions');
32
+ $select.siblings('[data-id="' + thisId + '"]').hide();
33
+ $actions.addClass('hide-if-js');
34
+ if (this.value != 'add_new_page') {
35
+ if (parseInt(this.value)) {
36
+ $actions.find('a.edit-page').attr('href', 'post.php?post=' + this.value + '&action=edit');
37
+ $actions.find('a.view-page').attr('href', LearnPress_Settings.siteurl + '?page_id=' + this.value);
38
+ $actions.removeClass('hide-if-js');
39
+ $select.attr('data-selected', this.value);
40
+ }
41
+ return;
42
+ }
43
+ ;
44
+ $select.attr('disabled', true);
45
+ $('.learn-press-quick-add-page-inline.' + thisId).removeClass('hide-if-js').find('input').focus().val('');
46
+ });
47
+ });
48
+
49
+ $doc.on('click', '.learn-press-quick-add-page-inline button', function () {
50
+ var $form = $(this).parent(),
51
+ $input = $form.find('input'),
52
+ $select = $form.siblings('select'),
53
+ page_name = $input.val();
54
+ if (!page_name) {
55
+ alert('Please enter the name of page');
56
+ $input.focus();
57
+ return;
58
+ }
59
+
60
+ $.ajax({
61
+ url : LearnPress_Settings.ajax,
62
+ data : {
63
+ action : 'learnpress_create_page',
64
+ page_name: page_name
65
+ },
66
+ type : 'post',
67
+ dataType: 'html',
68
+ success : function (response) {
69
+ response = LearnPress.parseJSON(response);
70
+ if (response.page) {
71
+ addPageToAllDropdowns({
72
+ ID : response.page.ID,
73
+ name : response.page.post_title,
74
+ positions: response.positions
75
+ });
76
+ $select.val(response.page.ID).removeAttr('disabled').focus().trigger('change');
77
+ $form.addClass('hide-if-js');
78
+ } else if (response.error) {
79
+ alert(response.error);
80
+ $select.removeAttr('disabled')
81
+ }
82
+ $select.siblings('button').show();
83
+ }
84
+ });
85
+ }).on('click', '.learn-press-quick-add-page-inline a', function (e) {
86
+ e.preventDefault();
87
+ var $select = $(this).parent().addClass('hide-if-js').siblings('select');
88
+ $select.val($select.attr('data-selected')).removeAttr('disabled').trigger('change');
89
+ $select.siblings('button').show();
90
+ }).on('click', '.button-quick-add-page', function (e) {
91
+ var $button = $(this),
92
+ id = $button.data('id');
93
+ $button.siblings('select#' + id).val('add_new_page').trigger('change');
94
+ }).on('keypress keydown', '.learn-press-quick-add-page-inline input[type="text"]', function (e) {
95
+ if (e.keyCode == 13 && e.type == 'keypress') {
96
+ e.preventDefault();
97
+ $(this).siblings('button').trigger('click')
98
+ } else if (e.keyCode == 27 && e.type == 'keydown') {
99
+ $(this).siblings('a').trigger('click')
100
+ }
101
+ });
102
+ $('#learn-press-admin-settings').on('click', '.nav-tab, .subsubsub > li > a', function (e) {
103
+ e.preventDefault();
104
+ var redirect = $(this).attr('href'),
105
+ data = $('#mainform').serialize();
106
+ if (data != oldData) {
107
+ $('#learn-press-updating-message').show();
108
+ $.ajax({
109
+ url : window.location.href,
110
+ data : data,
111
+ type : 'post',
112
+ dataType: 'html',
113
+ success : function (res) {
114
+ $('#learn-press-updating-message').hide();
115
+ $('#learn-press-updated-message').show();
116
+ window.location.href = redirect;
117
+ }
118
+ });
119
+ } else {
120
+ window.location.href = redirect;
121
+ }
122
+ });
123
+ // hold current settings to know if user changed anything
124
+ oldData = $('#mainform').serialize();
125
+ }
126
+
127
+ $doc.ready(_ready);
128
+ })(jQuery);
assets/js/admin/statistic.js ADDED
@@ -0,0 +1,192 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;(function ($) {
2
+ $.fn.LP_Chart_Line = function (data, config) {
3
+ return $.each(this, function () {
4
+ var $elem = $(this),
5
+ $canvas = $('<canvas />');
6
+ $elem.html('');
7
+ $canvas.appendTo($elem);
8
+ new Chart($canvas.get(0).getContext('2d')).Line(data, config);
9
+ });
10
+ //
11
+ }
12
+
13
+ $.fn.LP_Statistic_Users = function () {
14
+ return $.each(this, function () {
15
+ var $buttons = $('.chart-buttons button').on('click', function () {
16
+ var $button = $(this),
17
+ type = $button.data('type'),
18
+ from = '', to = '',
19
+ $container = $('#learn-press-chart');
20
+ $buttons.not(this).not('[data-type="user-custom-time"]').prop('disabled', false);
21
+ if (type == 'user-custom-time') {
22
+ from = $('#user-custom-time input[name="from"]').val();
23
+ to = $('#user-custom-time input[name="to"]').val();
24
+
25
+ if (from == '' || to == '') {
26
+ return false;
27
+ }
28
+ } else {
29
+ $button.prop('disabled', true)
30
+ }
31
+ $container.addClass('loading')
32
+ $.ajax({
33
+ url : 'admin-ajax.php',
34
+ data : {
35
+ action: 'learnpress_load_chart',
36
+ type : type,
37
+ range : [from, to]
38
+ },
39
+ dataType: 'text',
40
+ success : function (response) {
41
+ response = LearnPress.parseJSON(response);
42
+ $container.LP_Chart_Line(response, LP_Chart_Config);
43
+ $container.removeClass('loading');
44
+ }
45
+ });
46
+ return false;
47
+ }),
48
+ $inputs = $('.chart-buttons #user-custom-time input[type="text"]').change(function () {
49
+ var _valid_date = function () {
50
+ if (new Date($inputs[0].value) < new Date($inputs[1].value)) {
51
+ return true;
52
+ }
53
+ }
54
+ $buttons.filter('[data-type="user-custom-time"]').prop('disabled', $inputs.filter(function () {
55
+ return this.value == '';
56
+ }).get().length || !_valid_date());
57
+ })
58
+ });
59
+ }
60
+
61
+ $.fn.LP_Statistic_Courses = function () {
62
+ return $.each(this, function () {
63
+ var $buttons = $('.chart-buttons button').on('click', function () {
64
+ var $button = $(this),
65
+ type = $button.data('type'),
66
+ from = '', to = '',
67
+ $container = $('#learn-press-chart');
68
+ $buttons.not(this).not('[data-type="course-custom-time"]').prop('disabled', false);
69
+ if (type == 'course-custom-time') {
70
+ from = $('#course-custom-time input[name="from"]').val();
71
+ to = $('#course-custom-time input[name="to"]').val();
72
+
73
+ if (from == '' || to == '') {
74
+ return false;
75
+ }
76
+ } else {
77
+ $button.prop('disabled', true)
78
+ }
79
+ $container.addClass('loading')
80
+ $.ajax({
81
+ url : 'admin-ajax.php',
82
+ data : {
83
+ action: 'learnpress_load_chart',
84
+ type : type,
85
+ range : [from, to]
86
+ },
87
+ dataType: 'text',
88
+ success : function (response) {
89
+ response = LearnPress.parseJSON(response);
90
+ $container.LP_Chart_Line(response, LP_Chart_Config);
91
+ $container.removeClass('loading');
92
+ }
93
+ });
94
+ return false;
95
+ }),
96
+ $inputs = $('.chart-buttons #course-custom-time input[type="text"]').change(function () {
97
+ var _valid_date = function () {
98
+ if (new Date($inputs[0].value) < new Date($inputs[1].value)) {
99
+ return true;
100
+ }
101
+ }
102
+ $buttons.filter('[data-type="course-custom-time"]').prop('disabled', $inputs.filter(function () {
103
+ return this.value == '';
104
+ }).get().length || !_valid_date());
105
+ })
106
+ });
107
+ }
108
+
109
+ $.fn.LP_Statistic_Orders = function () {
110
+ return $.each(this, function () {
111
+ var $buttons = $('.chart-buttons button').on('click', function () {
112
+ var $button = $(this),
113
+ type = $button.data('type'),
114
+ from = '', to = '',
115
+ $container = $('#learn-press-chart');
116
+ $buttons.not(this).not('[data-type="order-custom-time"]').prop('disabled', false);
117
+ if (type == 'order-custom-time') {
118
+ from = $('#order-custom-time input[name="from"]').val();
119
+ to = $('#order-custom-time input[name="to"]').val();
120
+
121
+ if (from == '' || to == '') {
122
+ return false;
123
+ }
124
+ } else {
125
+ $button.prop('disabled', true)
126
+ }
127
+ $container.addClass('loading')
128
+ $.ajax({
129
+ url : 'admin-ajax.php',
130
+ data : {
131
+ action: 'learnpress_load_chart',
132
+ type : type,
133
+ range : [from, to]
134
+ },
135
+ dataType: 'text',
136
+ success : function (response) {
137
+ response = LearnPress.parseJSON(response);
138
+ $container.LP_Chart_Line(response, LP_Chart_Config);
139
+ $container.removeClass('loading');
140
+ }
141
+ });
142
+ return false;
143
+ }),
144
+ $inputs = $('.chart-buttons #order-custom-time input[type="text"]').change(function () {
145
+ var _valid_date = function () {
146
+ if (new Date($inputs[0].value) < new Date($inputs[1].value)) {
147
+ return true;
148
+ }
149
+ }
150
+ $buttons.filter('[data-type="order-custom-time"]').prop('disabled', $inputs.filter(function () {
151
+ return this.value == '';
152
+ }).get().length || !_valid_date());
153
+ })
154
+ });
155
+ }
156
+ ;
157
+ $(document).ready(function () {
158
+ if (typeof $.fn.datepicker != 'undefined') {
159
+ $(".date-picker").datepicker({
160
+ dateFormat: 'yy/mm/dd'
161
+ });
162
+ }
163
+ $('.learn-press-statistic-users').LP_Statistic_Users();
164
+ $('.learn-press-statistic-courses').LP_Statistic_Courses();
165
+ $('.learn-press-statistic-orders').LP_Statistic_Orders();
166
+ })
167
+ return;
168
+
169
+ var student_chart;
170
+ window.drawStudentsChart = drawStudentsChart = function (data, config) {
171
+ var $student_chart = $("#lpr-chart-students").clone().attr('style', '').removeAttr("width").removeAttr('height');
172
+ $("#lpr-chart-students").replaceWith($student_chart);
173
+ $student_chart = $student_chart[0].getContext("2d");
174
+ student_chart = new Chart($student_chart).Line(data, config);
175
+ }
176
+ if (typeof last_seven_days == 'undefined') return;
177
+ drawStudentsChart(last_seven_days, config);
178
+
179
+
180
+ var courses_chart;
181
+ window.drawCoursesChart = drawCoursesChart = function (data, config) {
182
+ var $courses_chart = $("#lpr-chart-courses").clone().attr('style', '').removeAttr("width").removeAttr('height');
183
+ $("#lpr-chart-courses").replaceWith($courses_chart);
184
+ $courses_chart = $courses_chart[0].getContext("2d");
185
+ courses_chart = new Chart($courses_chart).Bar(data, config);
186
+ }
187
+ if (typeof data == 'undefined') return;
188
+
189
+ drawCoursesChart(data, config);
190
+
191
+ })(jQuery);
192
+
assets/js/custom.chart.js DELETED
@@ -1,32 +0,0 @@
1
- jQuery(document).ready(function ($) {
2
- if( typeof $.fn.datepicker == 'undefined' ) return;
3
- $( ".lpr-time" ).datepicker();
4
- });
5
- jQuery(document).ready(function ($) {
6
-
7
- var student_chart;
8
- window.drawStudentsChart = drawStudentsChart = function( data,config ) {
9
- var $student_chart = $("#lpr-chart-students").clone().attr('style', '').removeAttr("width").removeAttr('height');
10
- $("#lpr-chart-students").replaceWith($student_chart);
11
- $student_chart = $student_chart[0].getContext("2d");
12
- student_chart = new Chart($student_chart).Line(data, config);
13
- }
14
- if (typeof last_seven_days == 'undefined') return;
15
- drawStudentsChart( last_seven_days, config );
16
-
17
- });
18
- jQuery(document).ready(function ($) {
19
-
20
- var courses_chart;
21
- window.drawCoursesChart = drawCoursesChart = function( data,config ) {
22
- var $courses_chart= $("#lpr-chart-courses").clone().attr('style', '').removeAttr("width").removeAttr('height');
23
- $("#lpr-chart-courses").replaceWith($courses_chart);
24
- $courses_chart = $courses_chart[0].getContext("2d");
25
- courses_chart = new Chart($courses_chart).Bar(data, config);
26
- }
27
- if (typeof data == 'undefined') return;
28
-
29
- drawCoursesChart( data, config );
30
-
31
- });
32
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/frontend/add-to-cart.js ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;(function($){
2
+ "use strict";
3
+ function _ready(){
4
+ $('form.purchase-course').submit(function(){
5
+ var $button = $('button.purchase-button', this),
6
+ $view_cart = $('.view-cart-button', this);
7
+ $button.removeClass('added').addClass('loading');
8
+ $.ajax({
9
+ url: $('input[name="_wp_http_referer"]', this).val() + '?lp-ajax=add-to-cart',
10
+ data: $(this).serialize(),
11
+ error: function(){
12
+ $button.removeClass('loading');
13
+ },
14
+ dataType: 'html',
15
+ success: function(response){
16
+ $button.addClass('added').removeClass('loading');
17
+ $view_cart.removeClass('hide-if-js');
18
+ }
19
+ });
20
+ return false;
21
+ });
22
+ }
23
+ $(document).ready(_ready);
24
+ })(jQuery);
assets/js/frontend/become-teacher.js ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;(function ($) {
2
+ $(document).ready(function () {
3
+ $('form[name="become-teacher-form"]').submit(function () {
4
+ var $form = $(this),
5
+ $submit = $form.find('button[type="submit"]');
6
+ $form.find('.learn-press-error, .learn-press-message').fadeOut('fast', function () {
7
+ $(this).remove()
8
+ });
9
+ $submit.prop('disabled', true).html($submit.data('text-process'));
10
+ if ($form.triggerHandler('become_teacher_send') !== false) {
11
+ $.ajax({
12
+ url : $form.attr('action'),
13
+ data : $form.serialize(),
14
+ dataType: 'html',
15
+ type : 'post',
16
+ success : function (code) {
17
+ var response = LearnPress.parseJSON(code);
18
+ if (response.message) {
19
+ for (var n = response.message.length, i = n - 1; i >= 0; i--) {
20
+ $form.prepend($(response.message[i]))
21
+ }
22
+ }
23
+ if (response.result == 'success') {
24
+ $form.find('input, select, textarea, button').prop('disabled', true);
25
+ } else {
26
+ $submit.prop('disabled', false);
27
+ }
28
+ $submit.html($submit.data('text'))
29
+ }
30
+ });
31
+ }
32
+ return false;
33
+ });
34
+ });
35
+ })(jQuery);
assets/js/frontend/checkout.js ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if (typeof window.LearnPress == 'undefined') {
2
+ window.LearnPress = {};
3
+ }
4
+ ;
5
+ (function ($) {
6
+ "use strict";
7
+ LearnPress.reload = function (url) {
8
+ if (!url) {
9
+ url = window.location.href;
10
+ }
11
+ window.location.href = url;
12
+ }
13
+ LearnPress.Checkout = {
14
+ $form : null,
15
+ init : function () {
16
+ var $doc = $(document);
17
+ this.$form = $('form[name="lp-checkout"]');
18
+ $doc.on('click', 'input[name="payment_method"]', this.selectPaymentMethod);
19
+ $doc.on('click', '#learn-press-checkout-login-button', this.login);
20
+
21
+ $('input[name="payment_method"]:checked').trigger('click');
22
+ this.$form.on('submit', this.doCheckout);
23
+ },
24
+ selectPaymentMethod: function () {
25
+ if ($('.payment-methods input.input-radio').length > 1) {
26
+ var $paymentForm = $('div.payment-method-form.' + $(this).attr('id'));
27
+ if ($(this).is(':checked') && !$paymentForm.is(':visible')) {
28
+ $('div.payment-method-form').filter(':visible').slideUp(250);
29
+
30
+ $('div.payment-method-form.' + $(this).attr('id')).slideDown(250);
31
+ }
32
+ } else {
33
+ $('div.payment-method-form ').show();
34
+ }
35
+
36
+ if ($(this).data('order_button_text')) {
37
+ $('#learn-press-checkout').val($('#learn-press-checkout').data('order_button_text'));
38
+ } else {
39
+ $('#learn-press-checkout').val($('#learn-press-checkout').data('value'));
40
+ }
41
+ },
42
+ login : function () {
43
+ var $form = $(this.form);
44
+ if ($form.triggerHandler('checkout_login') !== false) {
45
+ $.ajax({
46
+ url : LearnPress_Settings.siteurl +'/?lp-ajax=checkout-login',
47
+ dataType: 'html',
48
+ data : $form.serialize(),
49
+ type : 'post',
50
+ success : function (response) {
51
+ response = LearnPress.parseJSON(response);
52
+ if (response.result == 'fail') {
53
+ if (response.messages) {
54
+ LearnPress.Checkout.showErrors(response.messages);
55
+ } else {
56
+ LearnPress.Checkout.showErrors('<div class="learn-press-error">Unknown error!</div>');
57
+ }
58
+ } else {
59
+ if (response.redirect) {
60
+ window.location.href = response.redirect;
61
+ }
62
+ }
63
+ }
64
+ })
65
+ }
66
+ return false;
67
+ },
68
+ doCheckout : function () {
69
+ var $form = $(this),
70
+ $place_order = $form.find( '#learn-press-checkout'),
71
+ processing_text = $place_order.attr('data-processing-text'),
72
+ text = $place_order.attr('value');
73
+ if ($form.triggerHandler('learn_press_checkout_place_order') !== false && $form.triggerHandler('learn_press_checkout_place_order_' + $('#order_review').find('input[name=payment_method]:checked').val()) !== false) {
74
+ if( processing_text ){
75
+ $place_order.val(processing_text)
76
+ }
77
+ $place_order.prop('disabled', true);
78
+ $.ajax({
79
+ url : LearnPress_Settings.siteurl + '/?lp-ajax=checkout',
80
+ dataType: 'html',
81
+ data : $form.serialize(),
82
+ type : 'post',
83
+ success : function (response) {
84
+ response = LearnPress.parseJSON(response);
85
+ if (response.result == 'fail') {
86
+ if (response.messages) {
87
+ LearnPress.Checkout.showErrors(response.messages);
88
+ } else {
89
+ LearnPress.Checkout.showErrors('<div class="learn-press-error">Unknown error!</div>');
90
+ }
91
+ } else if( response.result == 'success'){
92
+ if (response.redirect) {
93
+ $place_order.val('Redirecting')
94
+ LearnPress.reload(response.redirect);
95
+ return;
96
+ }
97
+ }
98
+ $place_order.val(text)
99
+ $place_order.prop('disabled', false);
100
+ },
101
+ error: function( jqXHR, textStatus, errorThrown ) {
102
+ LearnPress.Checkout.showErrors('<div class="learn-press-error">'+errorThrown+'</div>');
103
+ $place_order.val(text)
104
+ $place_order.prop('disabled', false)
105
+
106
+ }
107
+ })
108
+ }
109
+ return false;
110
+ },
111
+ showErrors : function (messages) {
112
+ $('.learn-press-error, .learn-press-notice, .learn-press-message').remove();
113
+ this.$form.prepend(messages);
114
+ $('html, body').animate({
115
+ scrollTop: ( LearnPress.Checkout.$form.offset().top - 100 )
116
+ }, 1000);
117
+ $(document).trigger('learnpress_checkout_error');
118
+ }
119
+ }
120
+ $(document).ready(function () {
121
+ LearnPress.Checkout.init()
122
+ });
123
+ })(jQuery);
assets/js/frontend/course-lesson.js ADDED
@@ -0,0 +1,210 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;(function ($) {
2
+ "use strict";
3
+ $.LP_Course_Item = function () {
4
+
5
+ }
6
+ $.LP_Course_Item.Model = Backbone.Model.extend({
7
+ url : function () {
8
+ return this.rootUrl
9
+ },
10
+ rootUrl : '',
11
+ initialize: function (data) {
12
+ this.rootUrl = data.rootUrl;
13
+ },
14
+ load : function (callback) {
15
+ var that = this,
16
+ _completed = function (response, success) {
17
+ var $html = $(response || ''),
18
+ $lesson = $html.find('#learn-press-course-lesson');
19
+ if ($lesson.length == 0) {
20
+ $lesson = $('<div id="learn-press-course-lesson" />');
21
+ }
22
+ if (LearnPress.Hook.applyFilters('learn_press_update_item_content', $lesson, that) !== false) {
23
+ that.set('content', $lesson);
24
+ $(document).trigger('learn_press_course_item_content_replaced', $lesson, that);
25
+ $('.course-item.item-current')
26
+ .removeClass('item-current');
27
+ $('.course-item.course-item-' + that.get('id'))
28
+ .addClass('item-current');
29
+ }
30
+ $.isFunction(callback) && callback.call(that, response);
31
+ };
32
+ $.ajax({
33
+ url : this.url(),
34
+ dataType: 'html',
35
+ success : function (response) {
36
+ _completed(response, true);
37
+ },
38
+ error : function () {
39
+ _completed('', false)
40
+ }
41
+ });
42
+ },
43
+ complete : function (args) {
44
+ var that = this;
45
+ args = $.extend({
46
+ data : null,
47
+ success: null
48
+ }, args || {});
49
+ $.ajax({
50
+ url : LearnPress_Settings.ajax,
51
+ dataType: 'html',
52
+ data : $.extend({
53
+ action: 'learnpress_complete_lesson',
54
+ id : this.get('id')
55
+ }, args.data || {}),
56
+ success : function (response) {
57
+ response = LearnPress.parseJSON(response);
58
+ $.isFunction(args.success) && args.success.call(that, $.extend(response, {id: that.get('id')}))
59
+ }
60
+ })
61
+ }
62
+ });
63
+
64
+ $.LP_Course_Item.View = Backbone.View.extend({
65
+ el : '#learn-press-course-lesson',
66
+ events : {
67
+ 'click .complete-lesson-button': '_completeLesson'
68
+ },
69
+ initialize : function () {
70
+ _.bindAll(this, 'updateItem', '_completeLesson');
71
+ this.model.on('change', this.updateItem, this);
72
+
73
+ if (LearnPress.Hook.applyFilters('learn_press_before_load_item', this) !== false) {
74
+ if (this.model.get('id') /*&& this.$('input[name="learn-press-lesson-viewing"]').val() != this.model.get('id')*/) {
75
+ if (this.model.get('content') == 'no-cache') {
76
+ this.updateItem();
77
+ } else {
78
+ this.model.load();
79
+ }
80
+ } else if (this.model.get('content')) {
81
+ LearnPress.Hook.doAction('learn_press_item_content_loaded', this.model.get('content'), this);
82
+ }
83
+ }
84
+ },
85
+ updateItem : function () {
86
+ var $content = this.model.get('content');
87
+ this.$el.replaceWith($content);
88
+ this.setElement($content.show());
89
+ var url = LearnPress.Hook.applyFilters('learn_press_set_item_url', this.model.get('rootUrl'), this);
90
+ if (url) {
91
+ LearnPress.setUrl(url);
92
+ }
93
+ $content.closest('#learn-press-content-item').show();
94
+ LearnPress.Hook.doAction('learn_press_item_content_loaded', $content, this);
95
+ },
96
+ _autoNextItem : function (item, delay) {
97
+ var $link = this.$('.course-item-next a[data-id="' + item + '"]');
98
+ if (!$link.length) {
99
+ return;
100
+ }
101
+ var duration = 3,
102
+ $span = $('<span>Auto next in ' + duration + 's</span>').insertAfter(this.$('.complete-lesson-button'));
103
+ setInterval(function () {
104
+ duration--;
105
+ $span.html('Auto next in ' + duration + 's');
106
+ if (duration == 0) {
107
+ $link.trigger('click')
108
+ }
109
+ }, 1000);
110
+ },
111
+ _completeLesson: function (e) {
112
+ var that = this;
113
+ this.model.complete({
114
+ data : $(e.target).data(),
115
+ success: function (response) {
116
+ response = LearnPress.Hook.applyFilters('learn_press_user_complete_lesson_response', response);
117
+ if (response.next_item) {
118
+ //that._autoNextItem(response.next_item, 3);
119
+ }
120
+ LearnPress.Hook.doAction('learn_press_user_completed_lesson', response, that);
121
+ }
122
+ });
123
+ }
124
+ });
125
+ $.LP_Course_Item.Collection = Backbone.Collection.extend({
126
+ model : $.LP_Course_Item.Model,
127
+ current : 0,
128
+ lastLoaded: null,
129
+
130
+ initialize: function () {
131
+ var that = this;
132
+ _.bindAll(this, 'initItems', 'loadItem');
133
+ this.initItems();
134
+ },
135
+ initItems : function () {
136
+ var that = this;
137
+ $('.section-content .course-item').each(function () {
138
+ var $li = $(this),
139
+ $link = $li.find('a'),
140
+ id = parseInt($link.attr('data-id')),
141
+ args = {
142
+ id : id,
143
+ nonce : {
144
+ complete: $link.attr('data-complete-nonce')
145
+ },
146
+ rootUrl: $link.attr('href'),
147
+ type : $li.data('type')
148
+ };
149
+ if ($li.hasClass('item-current')) {
150
+ that.current = id;
151
+ //args.content = $('#learn-press-course-lesson')
152
+ }
153
+ var model = new $.LP_Course_Item.Model(args);
154
+ that.add(model);
155
+ });
156
+
157
+ },
158
+ loadItem : function (item, link) {
159
+
160
+ if ($.isNumeric(item)) {
161
+ item = this.findWhere({id: item});
162
+ } else if ($.type(item) == 'string') {
163
+ item = this.findWhere({rootUrl: item});
164
+ } else {
165
+
166
+ }
167
+ if (LearnPress.Hook.applyFilters('learn_press_load_item_content', true, item, link) !== false) {
168
+ if (item) {
169
+ if (this.view) {
170
+ this.view.undelegateEvents();
171
+ //this.view.model.set('content', this.view.$el);
172
+ $('.course-item.item-current')
173
+ .removeClass('item-current');
174
+ $('.course-item.course-item-' + item.get('id'))
175
+ .addClass('item-current');
176
+ }
177
+ if (link) {
178
+ item.set('rootUrl', link);
179
+ item.rootUrl = link;
180
+ }
181
+ this.view = new $.LP_Course_Item.View({model: item});
182
+ }
183
+ }
184
+ }
185
+ });
186
+
187
+ $.LP_Course_Item_List_View = Backbone.View.extend({
188
+ model : $.LP_Course_Item.Collection,
189
+ el : 'body',
190
+ events : {
191
+ 'click .section-content .course-item a': '_loadItem',
192
+ 'click .course-item-nav a' : '_loadItem'
193
+ },
194
+ initialize: function (args) {
195
+ _.bindAll(this, '_loadItem');
196
+ },
197
+ _loadItem : function (e) {
198
+ e.preventDefault();
199
+ var $item = $(e.target).closest('a'),
200
+ id = parseInt($item.attr('data-id')),
201
+ link = $item.attr('href');
202
+ var item = id ? id : link;
203
+ if (this.lastLoaded == item) {
204
+ return;
205
+ }
206
+ this.model.loadItem(item, link);
207
+ }
208
+ });
209
+
210
+ })(jQuery);
assets/js/frontend/course-quiz.js ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Quiz functions
3
+ *
4
+ * @author ThimPress
5
+ * @version 1.1
6
+ */
7
+ if (typeof LP == 'undefined') {
8
+ window.LP = {};
9
+ }
10
+ ;(function ($, bb, _) {
11
+ var Quiz = function (args) {
12
+ this.model = new Quiz.Model(args);
13
+ this.view = new Quiz.View({
14
+ model: this.model
15
+ });
16
+ }, Questions = bb.Collection.extend({
17
+ initialize: function () {
18
+ console.log(this.length)
19
+ }
20
+ });
21
+ Quiz.View = bb.View.extend({
22
+ initialize: function () {
23
+ LP.log('Quiz.View.initialize');
24
+ }
25
+ });
26
+ Quiz.Model = bb.Model.extend({
27
+ questions : null,
28
+ initialize: function () {
29
+ this.questions = new Questions();
30
+ this.questions.add(_.values(this.get('questions')));
31
+ console.log(this.questions.length);
32
+ }
33
+ });
34
+ $.extend(LP, {
35
+ Quiz : Quiz,
36
+ $quiz : null,
37
+ _initQuiz: function (args) {
38
+ if (!this.$quiz || this.$quiz.model.get('id') != args.id) {
39
+ delete this.$quiz;
40
+ this.$quiz = new Quiz(args);
41
+ }
42
+ return this.$quiz;
43
+ }
44
+ });
45
+ })(jQuery, Backbone, _);
46
+
assets/js/frontend/course-quiz.min.js ADDED
@@ -0,0 +1 @@
 
1
+ if(typeof LP=="undefined"){window.LP={}}(function(d,e,b){var a=function(f){this.model=new a.Model(f);this.view=new a.View({model:this.model})},c=e.Collection.extend({initialize:function(){console.log(this.length)}});a.View=e.View.extend({initialize:function(){LP.log("Quiz.View.initialize")}});a.Model=e.Model.extend({questions:null,initialize:function(){this.questions=new c();this.questions.add(b.values(this.get("questions")));console.log(this.questions.length)}});d.extend(LP,{Quiz:a,$quiz:null,_initQuiz:function(f){if(!this.$quiz||this.$quiz.model.get("id")!=f.id){delete this.$quiz;this.$quiz=new a(f)}return this.$quiz}})})(jQuery,Backbone,_);
assets/js/frontend/enroll.js ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if (typeof window.LearnPress == 'undefined') {
2
+ window.LearnPress = {};
3
+ }
4
+ ;
5
+ (function ($) {
6
+ "use strict";
7
+ LearnPress.Enroll = {
8
+ $form : null,
9
+ init : function () {
10
+ var $doc = $(document);
11
+ this.$form = $('form[name="enroll-course"]');
12
+ this.$form.on('submit', this.enroll);
13
+ },
14
+ enroll : function () {
15
+ var $form = $(this),
16
+ $button = $form.find('.button.enroll-button'),
17
+ course_id = $form.find('input[name="enroll-course"]').val();
18
+ if (!$button.hasClass('enrolled') && $form.triggerHandler('learn_press_enroll_course') !== false ) {
19
+ $button.removeClass('enrolled failed').addClass('loading');
20
+ $.ajax({
21
+ url : LearnPress.getUrl(),
22
+ dataType: 'html',
23
+ data : $form.serialize(),
24
+ type : 'post',
25
+ success : function (response) {
26
+ response = LearnPress.parseJSON(response);
27
+ if (response.result == 'fail') {
28
+ if( LearnPress.Hook.applyFilters( 'learn_press_user_enroll_course_failed', course_id ) !== false ) {
29
+ if (response.redirect) {
30
+ LearnPress.reload(response.redirect);
31
+ }
32
+ }
33
+ } else {
34
+ if( LearnPress.Hook.applyFilters( 'learn_press_user_enrolled_course', course_id ) !== false ) {
35
+ if (response.redirect) {
36
+ LearnPress.reload(response.redirect);
37
+ }
38
+ }
39
+ }
40
+ },
41
+ error: function( jqXHR, textStatus, errorThrown ) {
42
+ LearnPress.Hook.doAction( 'learn_press_user_enroll_course_failed', course_id );
43
+ $button.removeClass('loading').addClass('failed');
44
+ LearnPress.Enroll.showErrors('<div class="learn-press-error">'+errorThrown+'</div>');
45
+ }
46
+ })
47
+ }
48
+ return false;
49
+ },
50
+ showErrors : function (messages) {
51
+ this.removeErrors();
52
+ this.$form.prepend(messages);
53
+ $('html, body').animate({
54
+ scrollTop: ( LearnPress.Enroll.$form.offset().top - 100 )
55
+ }, 1000);
56
+ $(document.body).trigger('learn_press_enroll_error');
57
+ },
58
+ removeErrors: function(){
59
+ $('.learn-press-error, .learn-press-notice, .learn-press-message').remove();
60
+ }
61
+ }
62
+ $(document).ready(function () {
63
+ LearnPress.Enroll.init()
64
+ });
65
+ })(jQuery);
assets/js/frontend/learnpress.js ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @author ThimPress
3
+ * @package LearnPress/Javascript
4
+ * @version 1.0
5
+ */
6
+ ;if (typeof window.LearnPress == 'undefined') {
7
+ window.LearnPress = {};
8
+ }
9
+ ;(function ($) {
10
+ "use strict";
11
+ LearnPress = $.extend({
12
+ setUrl : function (url, title) {
13
+ history.pushState({}, title, url);
14
+ },
15
+ reload : function (url) {
16
+ if (!url) {
17
+ url = window.location.href;
18
+ }
19
+ window.location.href = url;
20
+ },
21
+ parseJSON: function (data) {
22
+ var m = data.match(/<!-- LP_AJAX_START -->(.*)<!-- LP_AJAX_END -->/);
23
+ try {
24
+ if (m) {
25
+ data = $.parseJSON(m[1]);
26
+ } else {
27
+ data = $.parseJSON(data);
28
+ }
29
+ } catch (e) {
30
+ LearnPress.log(e);
31
+ data = {};
32
+ }
33
+ return data;
34
+ },
35
+ toElement: function (element, args) {
36
+ args = $.extend({
37
+ delay : 300,
38
+ duration: 'slow',
39
+ offset : 50,
40
+ callback: null
41
+ }, args || {});
42
+ $('body, html')
43
+ .fadeIn(10)
44
+ .delay(args.delay)
45
+ .animate({
46
+ scrollTop: $(element).offset().top - args.offset
47
+ }, args.duration, args.callback);
48
+ }
49
+ }, LearnPress);
50
+
51
+ $(document).on('submit', '#learn-press-form-login', function (e) {
52
+ LearnPress.doAjax({
53
+ data : {
54
+ 'lp-ajax': 'login',
55
+ data : $(this).serialize()
56
+ },
57
+ success: function (response, raw) {
58
+ if (response.message) {
59
+ LearnPress.alert(response.message, function () {
60
+ if (response.redirect) {
61
+ LearnPress.reload(response.redirect);
62
+ }
63
+ });
64
+ } else {
65
+ if (response.redirect) {
66
+ LearnPress.reload(response.redirect);
67
+ }
68
+ }
69
+ }
70
+ })
71
+ return false;
72
+ });
73
+ })(jQuery);
assets/js/frontend/shortcodes.js ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ //define some shortcodes scripts
2
+
3
+ //courses collection pagination
4
+ jQuery(function ($) {
5
+ $.fn.LPCourseCollectionCarousel = function () {
6
+ if(typeof $.fn.owlCarousel !== 'function') {
7
+ console.error('owlcarousel not found!');
8
+ return;
9
+ }
10
+
11
+ var carouselElement = $(this).find('.owl-carousel');
12
+
13
+ var defaultOptions = {
14
+ items: 4,
15
+ itemsDesktop: [1199, 4],
16
+ itemsDesktopSmall: [979, 3],
17
+ itemsTablet: [768, 2],
18
+ itemsTabletSmall : [600, 2],
19
+ itemsMobile: [481, 1],
20
+ singleItem: false,
21
+ itemsScaleUp: true,
22
+ slideSpeed: 200,
23
+ paginationSpeed: 800,
24
+ rewindSpeed: 1000,
25
+ autoPlay: false,
26
+ stopOnHover: true,
27
+ navigation: true,
28
+ navigationText: ['&larr;',"&rarr;"],
29
+ scrollPerPage: false,
30
+ pagination: false,
31
+ autoHeight: false
32
+ };
33
+
34
+
35
+ var options = getDataOptions();
36
+
37
+ function getDataOptions() {
38
+ var dataOptions = carouselElement.data();
39
+ for(var op in defaultOptions){
40
+ var prop = op.toLowerCase();
41
+ if(defaultOptions.hasOwnProperty(op) && dataOptions.hasOwnProperty((prop)) && dataOptions[prop] != ""){
42
+ switch(typeof defaultOptions[op]){
43
+ case 'number':{
44
+ dataOptions[op] = Number(dataOptions[prop]);
45
+ break;
46
+ }
47
+ case 'object': {
48
+ switch(typeof defaultOptions[op][0]) {
49
+ case 'number':{
50
+ var value = parseInt(dataOptions[prop]);
51
+ dataOptions[op] = [defaultOptions[op][0], value];
52
+ break;
53
+ }
54
+ default:{
55
+ try {
56
+ dataOptions[op] = JSON.parse(dataOptions[prop]);
57
+ } catch(e){
58
+ console.error('JSON parse error! can not set input data for property ' + prop);
59
+ }
60
+ }
61
+ }
62
+ break;
63
+ }
64
+ case 'boolean': {
65
+ dataOptions[op] = Boolean(dataOptions[prop]);
66
+ break;
67
+ }
68
+ default:{
69
+ dataOptions[op] = dataOptions[prop];
70
+ }
71
+ }
72
+ }
73
+
74
+ if(prop == 'navigationtextnext'){
75
+ options['navigationtext'][1] = options['navigationtextnext'];
76
+ }
77
+
78
+ if(prop == 'navigationtextprev' ){
79
+ options['navigationtext'][0] = options['navigationtextprev'];
80
+ }
81
+ };
82
+
83
+
84
+ return $.extend({}, defaultOptions, dataOptions);
85
+ };
86
+
87
+ carouselElement.owlCarousel(options);
88
+
89
+ //handle events
90
+ $(this).find('.owl.next').click(function (e) {
91
+ trigger('owl.next');
92
+ });
93
+
94
+ $(this).find('.owl.prev').click(function (e) {
95
+ trigger('owl.prev');
96
+ });
97
+
98
+ return carouselElement;
99
+ };
100
+ });
101
+
102
+ jQuery(function ($) {
103
+ $('.archive-course-collection-outer').each(function(){
104
+ $(this).LPCourseCollectionCarousel();
105
+ });
106
+ });
assets/js/frontend/single-course.js ADDED
@@ -0,0 +1,220 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Single course functions
3
+ */
4
+ if (typeof LearnPress == 'undefined') {
5
+ window.LearnPress = {}
6
+ }
7
+ ;(function ($) {
8
+ "use strict";
9
+ LearnPress.Course = $.extend(
10
+ LearnPress.Course || {}, {
11
+ finish: function (data, callback) {
12
+ LearnPress.$Course && LearnPress.$Course.finishCourse({data: data, success: callback});
13
+ }
14
+ }
15
+ );
16
+ var LearnPress_View_Course = window.LearnPress_View_Course = Backbone.View.extend({
17
+ $doc : null,
18
+ $body : null,
19
+ courseItems : null,
20
+ courseItemsView : null,
21
+ el : '.course-summary',
22
+ events : {
23
+ //'click .curriculum-sections .section-content > li a': '_loadLesson',
24
+ //'click .course-item-nav a': '_loadLesson',
25
+ 'click #learn-press-finish-course': '_finishCourse'
26
+ },
27
+ initialize : function (args) {
28
+
29
+
30
+ var id = parseInt($('.course-item.item-current').find('>a').attr('data-id')),
31
+ item = null;
32
+ if (id) {
33
+ $('[id="learn-press-course-lesson"]').html('')
34
+ //this.model.loadItem(item);
35
+ }
36
+ this.courseItems = new $.LP_Course_Item.Collection();
37
+ this.courseItemsView = new $.LP_Course_Item_List_View({model: this.courseItems});
38
+
39
+ if (id) {
40
+ this.courseItems.loadItem(id);
41
+ }
42
+
43
+ _.bindAll(this, '_finishCourse', '_sanitizeProgress', 'completeLesson');
44
+ this.$doc = $(document);
45
+ this.$body = $(document.body);
46
+ LearnPress.Hook.addFilter('learn_press_before_load_item', function ($view) {
47
+ LearnPress.MessageBox.blockUI();
48
+ if ($view.model.get('type') == 'lp_quiz') {
49
+ var redirect = LearnPress.Hook.applyFilters('learn_press_course_item_redirect_url', $('.course-item-' + $view.model.get('id') + ' a').prop('href'), $view);
50
+ if (redirect !== false) {
51
+ var win = window.open(redirect, '_blank');
52
+ try {
53
+ win.focus();
54
+ } catch (e) {
55
+ }
56
+ }
57
+ }
58
+ return true;
59
+ });
60
+ LearnPress.Hook
61
+ .addAction('learn_press_item_content_loaded', this.itemLoaded)
62
+ .addAction('learn_press_user_completed_lesson', this.completeLesson)
63
+ .addAction('learn_press_user_passed_course_condition', function () {
64
+ });
65
+
66
+ this._sanitizeProgress();
67
+
68
+ },
69
+ itemLoaded : function ($content, $view) {
70
+ LearnPress.toElement('#learn-press-course-lesson-heading');
71
+ LearnPress.MessageBox.hide();
72
+ },
73
+ completeLesson : function (response, that) {
74
+ if (response && response.result == 'success') {
75
+ var $button = this.$('.complete-lesson-button').addClass('completed').prop('disabled', true).html(response.button_text);
76
+ $('.course-item-' + response.id).addClass('item-completed');
77
+ if (response.course_result) {
78
+ if (response.can_finish) {
79
+ this.$('#learn-press-finish-course').removeClass('hide-if-js');
80
+ LearnPress.Hook.doAction('learn_press_user_passed_course_condition', response, this, that);
81
+ }
82
+ if (response.message) {
83
+ $(response.message).insertBefore($button);
84
+ }
85
+ this.updateProgress(response);
86
+ }
87
+ }
88
+ },
89
+ updateProgress : function (data) {
90
+ $('.lp-course-progress')
91
+ .attr({
92
+ 'data-value': data.course_result
93
+ })
94
+ this._sanitizeProgress();
95
+ },
96
+ _loadLesson : function (e) {
97
+ this.loadLesson($(e.target).attr('href'));
98
+ },
99
+ loadLesson : function (permalink, args) {
100
+ var that = this;
101
+ LearnPress.Hook.doAction('learn_press_before_load_lesson', permalink, this);
102
+ args = $.extend({
103
+ success: function () {
104
+ return true;
105
+ },
106
+ error : function () {
107
+ }
108
+ }, args || {})
109
+
110
+ $.ajax({
111
+ url : permalink,
112
+ success: function (response) {
113
+ var ret = true;
114
+ $.isFunction(args.success) && ( ret = args.success.call(this, response) );
115
+ if (ret === true) {
116
+ var $html = $(response),
117
+ $newLesson = $html.find('#learn-press-course-lesson-summary'),
118
+ $newHeading = $html.find('#learn-press-course-lesson-heading');
119
+
120
+ $('title').html($html.filter('title').text());
121
+ $('#learn-press-course-description-heading, #learn-press-course-lesson-heading').replaceWith($newHeading)
122
+ $('#learn-press-course-description, #learn-press-course-lesson-summary').replaceWith($newLesson);
123
+
124
+ LearnPress.Hook.doAction('learn_press_load_lesson_completed', permalink, that);
125
+ LearnPress.Hook.doAction('learn_press_lesson_content_loaded', $html, this);
126
+
127
+ }
128
+ },
129
+ error : function () {
130
+ // TODO: handle the error here
131
+ LearnPress.MessageBox.hide();
132
+ }
133
+ })
134
+ },
135
+ _finishCourse : function (e) {
136
+ var that = this,
137
+ $button = $(e.target),
138
+ data = $button.data();
139
+ data = LearnPress.Hook.applyFilters('learn_press_user_finish_course_data', data);
140
+ if (data && data.id) {
141
+ $button.prop('disabled', true);
142
+ this.finishCourse({
143
+ data : data,
144
+ success: function (response) {
145
+ LearnPress.Hook.applyFilters('learn_press_finish_course_params', response);
146
+
147
+ if (response && response.result == 'success') {
148
+ that.$('#learn-press-finish-course, .complete-lesson-button').remove();
149
+ LearnPress.Hook.doAction('learn_press_finish_course', response);
150
+ }
151
+ if (response.message) {
152
+ LearnPress.alert(response.message, function () {
153
+ if (response.redirect) {
154
+ LearnPress.reload(response.redirect);
155
+ }
156
+ });
157
+ } else {
158
+ if (response.redirect) {
159
+ LearnPress.reload(response.redirect);
160
+ }
161
+ }
162
+ }
163
+ });
164
+ }
165
+ },
166
+ finishCourse : function (args) {
167
+ args = args || {};
168
+ var _do = function (e) {
169
+ if (e) {
170
+ LearnPress.doAjax({
171
+ prefix : '',
172
+ data : data,
173
+ success: _success
174
+ });
175
+ }
176
+ },
177
+ _success = function (response) {
178
+ $.isFunction(args.success) && args.success.call(that, response);
179
+ },
180
+ that = this,
181
+ data = $.extend({
182
+ 'lp-ajax': 'finish_course'
183
+ }, args.data || {});
184
+ LearnPress.confirm(single_course_localize.confirm_finish_course, _do);
185
+ },
186
+ _sanitizeProgress: function () {
187
+ var $el = $('.lp-course-progress'),
188
+ $progress = $('.lp-progress-value', $el),
189
+ $passing = $('.lp-passing-conditional', $el),
190
+ value = parseFloat($el.attr('data-value')),
191
+ passing_condition = parseFloat($el.attr('data-passing-condition')),
192
+ _done = function () {
193
+ var progress = parseInt($progress.css('width')),
194
+ passing = parseInt($passing.css('left'));
195
+
196
+ if (value >= passing_condition) {
197
+ $el.addClass('passed');
198
+ }
199
+ };
200
+ $progress.css('width', value + '%').find('span span').html(value);
201
+ setTimeout(_done, 500);
202
+
203
+ }
204
+ });
205
+
206
+ $(document).ready(function () {
207
+ //LearnPress.Course.init( $(this), $(document.body) );
208
+ LearnPress.$Course = new LearnPress_View_Course();
209
+
210
+ LearnPress.Hook.addAction('learn_press_item_content_loaded', function (a, b) {
211
+ setTimeout(function () {
212
+ try {
213
+ //console.log(a.html())
214
+ window.wp.mediaelement.initialize();
215
+ } catch (e) {
216
+ }
217
+ }, 300);
218
+ })
219
+ });
220
+ })(jQuery);
assets/js/frontend/single-course.min.js ADDED
@@ -0,0 +1 @@
 
1
+ if(typeof LP=="undefined"){window.LP={}}(function(c){LP.Course=c.extend(LP.Course||{},{finish:function(f,g){LP.$Course&&LP.$Course.finishCourse({data:f,success:g})}});var d=function(f){this.model=new d.Model(f);this.view=new d.View({model:this.model})},e=Backbone.Model.extend({initialize:function(){this.on("change:content",this._changeContent)},_changeContent:function(){LP.Hook.doAction("learn_press_update_item_content",this)},request:function(f){var g=this;if(!this.get("url")){return false}alert();f=c.extend({context:null,callback:null},f||{});LP.ajax({url:this.get("url"),action:"load-item",data:c.extend({format:"html"},this.toJSON()),dataType:"html",success:function(h){LP.Hook.doAction("learn_press_course_item_loaded",h,g);h=LP.Hook.applyFilters("learn_press_course_item_content",h,g);c.isFunction(f.callback)&&f.callback.call(f.context,h,g)}});return this},complete:function(f){var g=this;f=c.extend({context:null,callback:null,format:"json"},this.toJSON(),f||{});var h={};_.forEach(f,function(j,i){if((c.inArray(i,["content","current","title","url"])==-1)&&!c.isFunction(j)){h[i]=j}});LP.ajax({url:this.get("url"),action:"complete-item",data:h,dataType:"json",success:function(i){LP.Hook.doAction("learn_press_course_item_completed",i,g);i=LP.Hook.applyFilters("learn_press_course_item_complete_response",i,g);c.isFunction(f.callback)&&f.callback.call(f.context,i,g)}})},_toJSON:function(){var f=e.__super__.toJSON.apply(this,arguments);console.log(f);alert()}}),b=Backbone.Collection.extend({model:e,initialize:function(){this.on("add",function(f){})}});d.View=Backbone.View.extend({el:".course-summary",itemEl:null,events:{"click .button-load-item":"_loadItem","click .button-complete-item":"_completeItem","click .section-header":"_toggleSection"},currentItem:null,initialize:function(){var f=this.$(".course-item");_.bindAll(this,"updateItemContent");this.itemEl=this.$("#learn-press-content-item");this.model.items.forEach(function(h,g){h.course=this;h.$el=f.filter(".course-item-"+h.get("id"))},this);this._initHooks();if(this.$(".course-item.item-current").length){this.viewItem(this.$(".course-item.item-current .button-load-item").data("id"),{content:this.itemEl.html()})}LP.log(this.model.get("results"))},_initHooks:function(){LP.Hook.addAction("learn_press_update_item_content",this.updateItemContent)},_loadItem:function(g){g.preventDefault();var f=this,h=c(g.target).data("id");alert("xxxxxxxxxxxxxx");this.currentItem=this.model.getItem(h).request({context:this,item:this.currentItem,callback:function(i){f.viewItem(h,{content:c(i).html()})}})},_completeItem:function(i){var f=this,g=c(i.target),h=g.data("security");this.currentItem.complete({security:h,course_id:this.model.get("id"),callback:function(j,k){if(j.result=="success"){k.$el.removeClass("item-started").addClass("item-completed focus off");_.delay(function(l){l.$el.removeClass("focus off")},3000,k);f.$(".learn-press-course-results-progress").replaceWith(c(j.html))}}})},_toggleSection:function(h){var f=c(h.target).closest(".section-header"),g=f.siblings("ul.section-content");g.slideToggle()},updateItemContent:function(f){this.itemEl.html(f.get("content"))},viewItem:function(h,f){var g=this.model.getItem(h);if(g){g.set(f);g.set("current",true)}this.itemEl.show();this.currentItem=g;this.$('.course-item [data-id="'+g.get("id")+'"]').parent().addClass("item-current item-has-status").siblings(".item-current").removeClass("item-current");LP.setUrl(g.get("url"));return g}});d.Model=Backbone.Model.extend({items:null,initialize:function(){LP.log("Course.Model.initialize");this.createItems()},createItems:function(){this.items=new b();this.items.add(this.get("items"))},getItem:function(f){return c.isPlainObject(f)?this.items.findWhere(f):this.items.findWhere({id:f})},getItems:function(f){return typeof f=="undefined"?this.items:this.items.where(f)},getCurrent:function(){}});LP.Course=d;LP.$Course=new d(LP_Course_Params);return;var a=window.LP_View_Course=Backbone.View.extend({$doc:null,$body:null,courseItems:null,courseItemsView:null,el:".course-summary",events:{"click #learn-press-finish-course":"_finishCourse"},initialize:function(f){var h=parseInt(c(".course-item.item-current").find(">a").attr("data-id")),g=null;if(h){c('[id="learn-press-course-lesson"]').html("")}this.courseItems=new c.LP_Course_Item.Collection();this.courseItemsView=new c.LP_Course_Item_List_View({model:this.courseItems});if(h){this.courseItems.loadItem(h)}_.bindAll(this,"_finishCourse","_sanitizeProgress","completeLesson");this.$doc=c(document);this.$body=c(document.body);LP.Hook.addFilter("learn_press_before_load_item",function(k){LP.MessageBox.blockUI();if(k.model.get("type")=="lp_quiz"){var l=LP.Hook.applyFilters("learn_press_course_item_redirect_url",c(".course-item-"+k.model.get("id")+" a").prop("href"),k);if(l!==false){var j=window.open(l,"_blank");try{j.focus()}catch(i){}}}return true});LP.Hook.addAction("learn_press_item_content_loaded",this.itemLoaded).addAction("learn_press_user_completed_lesson",this.completeLesson).addAction("learn_press_user_passed_course_condition",function(){});this._sanitizeProgress()},itemLoaded:function(f,g){LP.toElement("#learn-press-course-lesson-heading");LP.MessageBox.hide()},completeLesson:function(f,g){if(f&&f.result=="success"){var h=this.$(".complete-lesson-button").addClass("completed").prop("disabled",true).html(f.button_text);c(".course-item-"+f.id).addClass("item-completed");if(f.course_result){if(f.can_finish){this.$("#learn-press-finish-course").removeClass("hide-if-js");LP.Hook.doAction("learn_press_user_passed_course_condition",f,this,g)}if(f.message){c(f.message).insertBefore(h)}this.updateProgress(f)}}},updateProgress:function(f){c(".lp-course-progress").attr({"data-value":f.course_result});this._sanitizeProgress()},_loadLesson:function(f){this.loadLesson(c(f.target).attr("href"))},loadLesson:function(h,f){var g=this;LP.Hook.doAction("learn_press_before_load_lesson",h,this);f=c.extend({success:function(){return true},error:function(){}},f||{});c.ajax({url:h,success:function(l){var m=true;c.isFunction(f.success)&&(m=f.success.call(this,l));if(m===true){var i=c(l),k=i.find("#learn-press-course-lesson-summary"),j=i.find("#learn-press-course-lesson-heading");c("title").html(i.filter("title").text());c("#learn-press-course-description-heading, #learn-press-course-lesson-heading").replaceWith(j);c("#learn-press-course-description, #learn-press-course-lesson-summary").replaceWith(k);LP.Hook.doAction("learn_press_load_lesson_completed",h,g);LP.Hook.doAction("learn_press_lesson_content_loaded",i,this)}},error:function(){LP.MessageBox.hide()}})},_finishCourse:function(i){var f=this,h=c(i.target),g=h.data();g=LP.Hook.applyFilters("learn_press_user_finish_course_data",g);if(g&&g.id){h.prop("disabled",true);this.finishCourse({data:g,success:function(j){LP.Hook.applyFilters("learn_press_finish_course_params",j);if(j&&j.result=="success"){f.$("#learn-press-finish-course, .complete-lesson-button").remove();LP.Hook.doAction("learn_press_finish_course",j)}if(j.message){LP.alert(j.message,function(){if(j.redirect){LP.reload(j.redirect)}})}else{if(j.redirect){LP.reload(j.redirect)}}}})}},finishCourse:function(f){f=f||{};var g=function(k){if(k){LP.doAjax({prefix:"",data:j,success:i})}},i=function(k){c.isFunction(f.success)&&f.success.call(h,k)},h=this,j=c.extend({"lp-ajax":"finish_course"},f.data||{});LP.confirm(single_course_localize.confirm_finish_course,g)},_sanitizeProgress:function(){var h=c(".lp-course-progress"),f=c(".lp-progress-value",h),i=c(".lp-passing-conditional",h),j=parseFloat(h.attr("data-value")),g=parseFloat(h.attr("data-passing-condition")),k=function(){var l=parseInt(f.css("width")),m=parseInt(i.css("left"));if(j>=g){h.addClass("passed")}};f.css("width",j+"%").find("span span").html(j);setTimeout(k,500)}});c(document).ready(function(){LP.$Course=new a();LP.Hook.addAction("learn_press_item_content_loaded",function(g,f){setTimeout(function(){try{window.wp.mediaelement.initialize()}catch(h){}},300)})})})(jQuery);
assets/js/frontend/single-course.v2.js ADDED
@@ -0,0 +1,245 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Single course JS
3
+ *
4
+ * @requires jQuery, Backbone
5
+ */
6
+ ;(function ($) {
7
+
8
+ window.LP_V2 = true;
9
+ if (typeof jQuery == 'undefined' || typeof Backbone == 'undefined') {
10
+ console.log('Error');
11
+ return;
12
+ }
13
+
14
+ if (typeof LP == 'undefined') {
15
+ window.LP = {};
16
+ }
17
+
18
+ $.extend(LP, {
19
+ Views: {},
20
+ Model: {}
21
+ });
22
+
23
+ var CourseModel,
24
+ CourseView,
25
+ CourseItem,
26
+ CourseItems;
27
+
28
+ CourseItem = LP.CourseItem = Backbone.Model.extend({
29
+ $doc : false,
30
+ initialize : function () {
31
+ this.$doc = $(document);
32
+ this.on('change', this.onChange);
33
+ _.bindAll(this, 'itemLoaded');
34
+ },
35
+ onChange : function (a, b) {
36
+ var that = this,
37
+ data = {
38
+ item: this
39
+ };
40
+ if (a.changed['current'] !== undefined) {
41
+ $.extend(data, {
42
+ key : 'current',
43
+ value: a.changed['current']
44
+ });
45
+ this.get('el').find('.lp-label-viewing').toggle(a.changed['current']);
46
+ if (this.onChangeCurrent(data) !== false && a.changed['current']) {
47
+ if (that.get('content')) {
48
+ that.itemLoaded.apply(that, [that.get('content')])
49
+ } else {
50
+ if (that.get('type') == 'lp_lesson') {
51
+ $.ajax({
52
+ url : that.get('url'),
53
+ dataType: 'html',
54
+ success : that.itemLoaded
55
+ });
56
+ } else {
57
+ that.itemLoaded()
58
+ }
59
+ }
60
+ }
61
+ }
62
+ },
63
+ onChangeCurrent: function (data) {
64
+ return this.$doc.triggerHandler('learn_press_item_current_changed', data)
65
+ },
66
+ isCurrent : function () {
67
+ return this.get('current') == true;
68
+ },
69
+ itemLoaded : function (response) {
70
+ var $html = $(response);
71
+ this.set('content', response);
72
+ switch (this.get('type')) {
73
+ case 'lp_lesson':
74
+ var $content = $html.find('#learn-press-content-item').html();
75
+ $('#learn-press-content-item').html($content).show();
76
+ break;
77
+ case 'lp_quiz':
78
+ var data = this.$doc.triggerHandler('learn_press_item_redirect_url', {
79
+ url : this.get('url'),
80
+ item: this
81
+ });
82
+ if (data !== false) {
83
+ if (data == undefined || data.redirect == undefined) {
84
+ data.redirect = this.get('url');
85
+ }
86
+ LearnPress.reload(data.redirect);
87
+ }
88
+ break;
89
+ default:
90
+ this._trigger('learn_press_item_' + this.get('type') + '_loaded', {html: $html, item: this});
91
+ }
92
+ try {
93
+ window.wp.mediaelement.initialize();
94
+ } catch (e) {
95
+ }
96
+ this.$doc.triggerHandler('learn_press_item_loaded', {html: $html, item: this});
97
+ },
98
+ _trigger : function () {
99
+ var args = [];
100
+ for (var i = 0, n = arguments.length; i < n; i++) {
101
+ args.push(arguments[i]);
102
+ }
103
+ return this.$doc.triggerHandler.apply(this.$doc[0], args);
104
+ }
105
+ });
106
+
107
+ CourseItems = LP.CourseItems = Backbone.Collection.extend({
108
+ getCurrent: function () {
109
+ var item = this.findWhere({current: true});
110
+ return item;
111
+ },
112
+ setCurrent: function (item) {
113
+ if (!item instanceof CourseItem) {
114
+ item = this.findWhere({id: item});
115
+ }
116
+ this.map(function (item) {
117
+ if (item.get('current')) {
118
+ item.set('current', false);
119
+ }
120
+ });
121
+ if (item) {
122
+ item.set('current', true);
123
+ var _r = $(document).triggerHandler('learn_press_set_course_url', {url: item.get('url')});
124
+ if (_r !== false) {
125
+ if (_r == undefined) {
126
+ _r = item.get('url')
127
+ }
128
+ try {
129
+ LearnPress.setUrl(_r);
130
+ } catch (e) {
131
+ }
132
+ }
133
+ }
134
+ }
135
+ });
136
+
137
+ CourseModel = LP.CourseModel = Backbone.Model.extend({
138
+ items : new CourseItems(),
139
+ initialize: function (args) {
140
+ this.parseItems(args);
141
+ },
142
+ parseItems: function (args) {
143
+ var $items = $('.course-curriculum .course-item');
144
+ _.forEach(args.items, function (item, i) {
145
+ item.el = $items.filter('.course-item-' + item.id);
146
+ this.items.add(new CourseItem(item));
147
+ }, this);
148
+ }
149
+ });
150
+
151
+ CourseView = LP.CourseView = Backbone.View.extend({
152
+ el : 'body',
153
+ events : {
154
+ 'click .button-load-item' : '_loadItem',
155
+ 'click .course-item-nav a': '_loadItemNav',
156
+ 'click .finish-course' : '_finishCourse'
157
+ },
158
+ initialize : function () {
159
+ _.bindAll(this, '_itemChanged', '_itemLoaded');
160
+ this.initEvents();
161
+ this.initCurrent();
162
+ },
163
+ initEvents : function () {
164
+ $(document)
165
+ .on('learn_press_item_current_changed', this._itemChanged)
166
+ .on('learn_press_item_loaded', this._itemLoaded)
167
+
168
+ },
169
+ initCurrent : function () {
170
+ var current = this.model.items.getCurrent();
171
+ if (!current) {
172
+ return;
173
+ }
174
+ current.itemLoaded($("html").html());
175
+ },
176
+ _itemChanged : function (e, data) {
177
+ var that = this;
178
+ switch (data.key) {
179
+ case 'current':
180
+ if (data.value == true) {
181
+ if (data.item.get('type') == 'lp_quiz') {
182
+ data.callback && data.callback();
183
+ return;
184
+ }
185
+ $('#learn-press-content-item').addClass('loading');
186
+ LearnPress.toElement('#learn-press-content-item', {
187
+ delay : 0,
188
+ duration: 0,
189
+ callback: function () {
190
+
191
+ }
192
+ });
193
+ }
194
+ }
195
+ },
196
+ _itemLoaded : function (e, data) {
197
+ $('.course-description-heading, .course-description').hide();
198
+ $('#learn-press-content-item').removeClass('loading');
199
+ return data;
200
+ },
201
+ _loadItem : function (e) {
202
+ e.preventDefault();
203
+ var $tag = $(e.target).closest('.button-load-item');
204
+ if (!$tag.is('a')) {
205
+ return false;
206
+ }
207
+ var id = parseInt($tag.data('id')),
208
+ type = $tag.closest('.course-item').data('type'),
209
+ $item = this.model.items.findWhere({id: id});
210
+ if (!$item) {
211
+ return false;
212
+ }
213
+ if ($item.isCurrent()) {
214
+ return false;
215
+ }
216
+ this.model.items.setCurrent($item);
217
+ },
218
+ _loadItemNav : function (e) {
219
+ e.preventDefault();
220
+
221
+ var id = $(e.target).attr('data-id'),
222
+ $item = this.$('.section-content a.button-load-item[data-id="' + id + '"]');
223
+ $item.trigger('click');
224
+ },
225
+ _finishCourse: function (e) {
226
+
227
+ },
228
+ loadItem : function (item) {
229
+ },
230
+ extend : function (obj) {
231
+ for (var i in obj) {
232
+ this[i] = obj[i];
233
+ }
234
+ return this;
235
+ }
236
+ });
237
+
238
+ $(document).ready(function () {
239
+ if (typeof SingleCourse_Params != 'undefined') {
240
+ LP.Views.Course = new CourseView({
241
+ model: new CourseModel(SingleCourse_Params)
242
+ });
243
+ }
244
+ })
245
+ })(jQuery);
assets/js/frontend/single-quiz.js ADDED
@@ -0,0 +1,731 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if (typeof LearnPress == 'undefined') var LearnPress = {};
2
+ (function ($) {
3
+ "use strict";
4
+
5
+ var LearnPress_Model_Quiz = window.LearnPress_Model_Quiz = Backbone.Model.extend({
6
+ defaults : {
7
+ //question_id: 0
8
+ },
9
+ data : null,
10
+ view : false,
11
+ url : function () {
12
+ },
13
+ urlRoot : '',
14
+ questions : null,
15
+ initialize : function () {
16
+
17
+ this.createQuestionsList();
18
+
19
+ },
20
+ createQuestionsList: function () {
21
+ this.questions = new LearnPress_Collection_Questions();
22
+ _.each(this.get('questions'), function (args, i) {
23
+ var $model = new LearnPress_Model_Question($.extend({
24
+ quiz_id: this.get('id'),
25
+ user_id: this.get('user_id'),
26
+ }, args));
27
+ $model.urlRoot = this.get('ajaxurl');
28
+ $model.view = this.view;
29
+ this.questions.add($model);
30
+ }, this);
31
+ },
32
+ next : function (callback) {
33
+ if (!this.isLast()) {
34
+ var next_id = this.findNext(),
35
+ question = this.questions.findWhere({id: next_id}),
36
+ that = this;
37
+ question.submit({
38
+ data : {
39
+ save_id : that.get('question_id'),
40
+ question_answer: this.view.$('form').serialize(),
41
+ time_remaining : that.get('time_remaining')
42
+ },
43
+ complete: function () {
44
+ that.set('question_id', next_id);
45
+ $.isFunction(callback) && callback.apply(that);
46
+ LearnPress.Hook.doAction('learn_press_next_question', next_id, that);
47
+ }
48
+ });
49
+ }
50
+ },
51
+ prev : function (callback) {
52
+ if (!this.isFirst()) {
53
+ var prev_id = this.findPrev(),
54
+ question = this.questions.findWhere({id: prev_id}),
55
+ that = this;
56
+ //if (!question.get('content')) {
57
+ question.submit({
58
+ data : {
59
+ save_id : that.get('question_id'),
60
+ question_answer: this.view.$('form').serialize(),
61
+ time_remaining : that.get('time_remaining')
62
+ },
63
+ complete: function () {
64
+ that.set('question_id', prev_id);
65
+ $.isFunction(callback) && callback.apply(that);
66
+ LearnPress.Hook.doAction('learn_press_previous_question', prev_id, that);
67
+ }
68
+ });
69
+
70
+ }
71
+ },
72
+ select : function (id, callback) {
73
+ var question = this.questions.findWhere({id: id}),
74
+ that = this;
75
+ question && question.submit({
76
+ data : {
77
+ save_id : that.get('question_id'),
78
+ question_answer: this.view.$('form').serialize(), //$('input, select, textarea', this.view.$('form')).toJSON(),
79
+ time_remaining : that.get('time_remaining')
80
+ },
81
+ complete: function (response) {
82
+ that.set('question_id', id);
83
+ $.isFunction(callback) && callback.apply(that, [response])
84
+ }
85
+ });
86
+ },
87
+ getQuestionPosition: function (question_id) {
88
+ question_id = question_id || this.get('question_id');
89
+ return _.indexOf(this.getIds(), question_id);
90
+ },
91
+ countQuestions : function () {
92
+ return this.questions.length;
93
+ },
94
+ isLast : function (question_id) {
95
+ question_id = question_id || this.get('question_id');
96
+ return this.getQuestionPosition(question_id) == (this.countQuestions() - 1);
97
+ },
98
+ isFirst : function (question_id) {
99
+ question_id = question_id || this.get('question_id');
100
+ return this.getQuestionPosition(question_id) == 0;
101
+ },
102
+ findNext : function (question_id) {
103
+ question_id = question_id || this.get('question_id');
104
+ var ids = this.getIds(),
105
+ pos = this.getQuestionPosition(question_id);
106
+ pos++;
107
+ if (typeof ids[pos] == 'undefined') return false;
108
+ return ids[pos];
109
+ },
110
+ findPrev : function (question_id) {
111
+ question_id = question_id || this.get('question_id');
112
+ var ids = this.getIds(),
113
+ pos = this.getQuestionPosition(question_id);
114
+ pos--;
115
+ if (typeof ids[pos] == 'undefined') return false;
116
+ return ids[pos];
117
+ },
118
+ current : function () {
119
+ return this.questions.findWhere({id: parseInt(this.get('question_id'))});
120
+ },
121
+ getIds : function () {
122
+ return $.map(this.get('questions'), function (i, v) {
123
+ return parseInt(i.id)
124
+ });
125
+ }
126
+ });
127
+
128
+ var LearnPress_Model_Question = window.LearnPress_Model_Question = Backbone.Model.extend({
129
+ defaults : {
130
+ //question_id: 0
131
+ },
132
+ data : null,
133
+ view : false,
134
+ url : function () {
135
+ return this.urlRoot;
136
+ },
137
+ urlRoot : '',
138
+ initialize: function () {
139
+ },
140
+ element : function () {
141
+ return $(this.get('content'));
142
+ },
143
+ submit : function (args) {
144
+ var that = this;
145
+ args = $.extend({
146
+ complete: null,
147
+ data : {}
148
+ }, args || {});
149
+ this.fetch({
150
+ data : $.extend({
151
+ action : 'learnpress_load_quiz_question',
152
+ user_id : this.get('user_id'),
153
+ quiz_id : this.get('quiz_id'),
154
+ question_id: this.get('id')
155
+ }, args.data || {}),
156
+ complete: (function (e) {
157
+ var response = LearnPress.parseJSON(e.responseText);
158
+ if (response.result == 'success') {
159
+ //if (!that.get('content')) {
160
+ that.set(response.question);
161
+ if (response.permalink) {
162
+ LearnPress.setUrl(response.permalink);
163
+ }
164
+ //}
165
+ $.isFunction(args.complete) && args.complete.call(that, response);
166
+ }
167
+ })
168
+ });
169
+ },
170
+ check : function (args) {
171
+ var that = this;
172
+ if ($.isFunction(args)) {
173
+ args = {
174
+ complete: args
175
+ }
176
+ } else {
177
+ args = $.extend({
178
+ complete: null,
179
+ data : {}
180
+ }, args || {});
181
+ }
182
+ LearnPress.doAjax({
183
+ data : $.extend({
184
+ 'lp-ajax' : 'check-question',
185
+ user_id : this.get('user_id'),
186
+ quiz_id : this.get('quiz_id'),
187
+ question_id : this.get('id'),
188
+ save_id : this.get('id'),
189
+ question_answer: $('form#learn-press-quiz-question').serialize()
190
+ }, args.data || {}),
191
+ success: function (response, raw) {
192
+ that.set('checked', response.checked);
193
+ $.isFunction(args.complete) && args.complete.call(that, response)
194
+ }
195
+ })
196
+ }
197
+ });
198
+
199
+ var LearnPress_Collection_Questions = window.LearnPress_Collection_Questions = Backbone.Collection.extend({
200
+ url : 'admin-ajax.php',
201
+ model: LearnPress_Model_Question
202
+ });
203
+
204
+ var LearnPress_View_Quiz = window.LearnPress_View_Quiz = Backbone.View.extend({
205
+ model : {},
206
+ events : {
207
+ 'click .button-start-quiz' : '_startQuiz',
208
+ 'click .button-finish-quiz' : '_finishQuiz',
209
+ 'click .button-retake-quiz' : '_retakeQuiz',
210
+ 'click .next-question' : '_nextQuestion',
211
+ 'click .prev-question' : '_prevQuestion',
212
+ 'click .check-question' : '_checkQuestion',
213
+ 'click .quiz-questions-list li a': '_selectQuestion',
214
+ 'click .hint-question' : '_hintQuestion',
215
+ 'click .explain-question' : '_explainQuestion'
216
+ },
217
+ el : '.single-quiz',
218
+ isRendered : false,
219
+ $buttons : {},
220
+ initialize : function (model) {
221
+ this.model = model;
222
+ this.model.view = this;
223
+ this.listenTo(this.model, 'change:question_id', this.changeQuestion);
224
+ this.listenTo(this.model, 'change', this.render);
225
+ this.listenTo(this.model, 'change', this.updateCountdown);
226
+
227
+ LearnPress.Hook
228
+ .addAction('learn_press_check_question', function (response, that) {
229
+ that.updateAnswer.apply(that, [response]);
230
+ })
231
+ .addAction('learn_press_update_question_content', function ($newQuestion, $oldQuestion, that) {
232
+ var $current = that.model.current();
233
+ setTimeout(function () {
234
+ if ($current.get('checked')) {
235
+ that.updateAnswer.apply(that, [{checked: $current.get('checked'), result: 'success'}]);
236
+ }
237
+ }, 100)
238
+
239
+ });
240
+ _.bindAll(this, 'render', '_timeOver', '_checkQuestion', '_hintQuestion', 'updateAnswer', 'updateCountdown');
241
+
242
+ this._create();
243
+ this.render();
244
+ this.updateCountdown(true);
245
+ },
246
+ _create : function () {
247
+ this.$buttons = {
248
+ start : this.$('.button-start-quiz'),
249
+ finish : this.$('.button-finish-quiz'),
250
+ retake : this.$('.button-retake-quiz'),
251
+ next : this.$('.next-question'),
252
+ prev : this.$('.prev-question'),
253
+ check : this.$('.check-question'),
254
+ hint : this.$('.hint-question'),
255
+ explain: this.$('.explain-question'),
256
+ };
257
+ if (this.model.get('status') == 'started') {
258
+ this.initCountdown();
259
+
260
+ var $current = this.model.current();
261
+ if ($current) {
262
+ $current.set({
263
+ content: $('#learn-press-quiz-question .question-' + $current.get('id'))
264
+ });
265
+ this._updateQuestion($current.element());
266
+ }
267
+ }
268
+ var that = this;
269
+ this.setButtonsState();
270
+ },
271
+ changeQuestion : function () {
272
+ var $current = this.model.current();
273
+ if ($current) {
274
+ this._updateQuestion($current.element());
275
+ }
276
+ },
277
+ updateCountdown : function (force) {
278
+ if (!this.model.hasChanged('status') && !force) {
279
+ return;
280
+ }
281
+ if (this.model.get('status') == 'started') {
282
+ if (!this.$countdown) {
283
+ this.initCountdown();
284
+ }
285
+ this.$countdown.backward_timer('start');
286
+ }
287
+ },
288
+ render : function () {
289
+ if (!this.model.hasChanged('question_id') && !this.model.hasChanged('status')) {
290
+ //return;
291
+ }
292
+ var $question = this.model.current();
293
+
294
+ this.setButtonsState();
295
+ switch (this.model.get('status')) {
296
+ case 'started':
297
+ this.$('.quiz-intro').remove();
298
+ this.$('.quiz-countdown').removeClass('hide-if-js');
299
+ }
300
+ if ($question && this.model.get('status') == 'started') {
301
+ this.$('form[name="learn-press-quiz-question"]').html($question.get('content'));
302
+ this.$('#learn-press-quiz-questions li[data-id="' + $question.get('id') + '"]')
303
+ .addClass('current')
304
+ .siblings('.current').removeClass('current');
305
+ }
306
+
307
+ this.isRendered = true;
308
+ this.$el.css('visibility', 'visible');
309
+ },
310
+ setButtonsState : function () {
311
+ var hidden = 'hide-if-js',
312
+ current = this.model.current();
313
+ switch (this.model.get('status').toLowerCase()) {
314
+ case 'completed':
315
+ this.$buttons.start.addClass(hidden);
316
+ this.$buttons.finish.addClass(hidden);
317
+ this.$buttons.check.addClass(hidden);
318
+ this.$buttons.retake.removeClass(hidden);
319
+ break;
320
+ case 'started':
321
+ this.$buttons.start.addClass(hidden);
322
+ this.$buttons.finish.removeClass(hidden);
323
+ this.$buttons.retake.addClass(hidden);
324
+
325
+ if (this.model.countQuestions() <= 1) {
326
+ this.$buttons.next.addClass(hidden);
327
+ this.$buttons.prev.addClass(hidden);
328
+ } else {
329
+ this.$buttons.next.removeClass(hidden);
330
+ this.$buttons.prev.removeClass(hidden);
331
+ if (this.model.isLast()) {
332
+ this.$buttons.next.addClass(hidden);
333
+ this.$buttons.finish.filter('[data-area="nav"]').removeClass(hidden);
334
+ } else {
335
+ this.$buttons.finish.filter('[data-area="nav"]').addClass(hidden);
336
+ }
337
+ if (this.model.isFirst()) {
338
+ this.$buttons.prev.addClass(hidden);
339
+ }
340
+ }
341
+ if (current && current.get('check_answer')) {
342
+ this.$buttons.check.removeClass(hidden);
343
+ } else {
344
+ this.$buttons.check.addClass(hidden);
345
+ }
346
+ if (current && current.get('hint')) {
347
+ this.$buttons.hint.removeClass(hidden);
348
+ } else {
349
+ this.$buttons.hint.addClass(hidden);
350
+ }
351
+ if (current && current.get('explanation')) {
352
+ this.$buttons.explain.removeClass(hidden);
353
+ } else {
354
+ this.$buttons.explain.addClass(hidden);
355
+ }
356
+ break;
357
+ default:
358
+ this.$buttons.next.addClass(hidden);
359
+ this.$buttons.prev.addClass(hidden);
360
+ this.$buttons.start.removeClass(hidden);
361
+ this.$buttons.finish.addClass(hidden);
362
+ this.$buttons.retake.addClass(hidden);
363
+ this.$('.quiz-questions .qq.current').removeClass('current');
364
+ }
365
+
366
+ },
367
+ startQuiz : function (args) {
368
+ this.block_page();
369
+ args = $.extend({
370
+ complete: false
371
+ }, args || {});
372
+
373
+ var that = this,
374
+ data = $.extend({
375
+ 'lp-ajax': 'start-quiz',
376
+ quiz_id : this.model.get('id'),
377
+ nonce : this.model.get('nonce')
378
+ }, args.data || {});
379
+ LearnPress.doAjax({
380
+ url : window.location.href,
381
+ data : data,
382
+ success: function (response, raw) {
383
+ LearnPress.MessageBox.hide();
384
+ var response = LearnPress.Hook.applyFilters('learn_press_start_quiz_results', response, that);
385
+ if (response.result == 'success') {
386
+ that.model.current().set(response.question);
387
+ that.model.set({status: response.data.status, question_id: response.question.id});
388
+ LearnPress.setUrl(response.question.permalink);
389
+ }
390
+ $.isFunction(args.complete) && args.complete.call(that, response)
391
+ }
392
+ });
393
+ },
394
+ finishQuiz : function (args) {
395
+ this.pause();
396
+ this.block_page();
397
+ args = $.extend({
398
+ complete: false
399
+ }, args || {});
400
+
401
+ var that = this,
402
+ data = $.extend({
403
+ 'lp-ajax': 'finish-quiz',
404
+ quiz_id : this.model.get('id'),
405
+ nonce : this.model.get('nonce')
406
+ }, args.data || {});
407
+ LearnPress.doAjax({
408
+ data : data,
409
+ success: function (response) {
410
+ var callbackReturn = undefined;
411
+ $.isFunction(args.complete) && ( callbackReturn = args.complete.call(LearnPress.Quiz, response) );
412
+ LearnPress.Hook.doAction('learn_press_finish_quiz', that.model.get('id'), that);
413
+ LearnPress.MessageBox.show(single_quiz_localize.finished_quiz, {
414
+ autohide: 2000,
415
+ onHide : function () {
416
+ if (callbackReturn && callbackReturn.redirect) {
417
+ LearnPress.reload(callbackReturn.redirect);
418
+ } else if (callbackReturn == undefined && response.redirect) {
419
+ LearnPress.reload(response.redirect);
420
+ }
421
+ }
422
+ });
423
+ }
424
+ });
425
+ },
426
+ retakeQuiz : function (args) {
427
+ this.block_page();
428
+ args = $.extend({
429
+ complete: false
430
+ }, args || {});
431
+
432
+ var that = this,
433
+ data = $.extend({
434
+ 'lp-ajax': 'retake-quiz',
435
+ quiz_id : this.model.get('id'),
436
+ nonce : this.model.get('nonce')
437
+ }, args.data || {});
438
+ LearnPress.doAjax({
439
+ data : data,
440
+ success: function (response, raw) {
441
+ LearnPress.MessageBox.hide();
442
+ if (response.result == 'success') {
443
+ $.isFunction(args.complete) && args.complete.call(LearnPress.Quiz, response);
444
+ LearnPress.MessageBox.show(single_quiz_localize.retaken_quiz, {
445
+ autohide: 2000,
446
+ onHide : function () {
447
+ LearnPress.reload(response.redirect);
448
+ }
449
+ });
450
+ } else {
451
+ LearnPress.alert(response.message);
452
+ }
453
+ }
454
+ });
455
+ },
456
+ updateAnswer : function (response) {
457
+ if (!response || response.result != 'success') {
458
+ return;
459
+ }
460
+ var $current = this.model.current(),
461
+ $content = $($current.get('content'));
462
+ switch ($current.get('type')) {
463
+ case 'true_or_false':
464
+ case 'single_choice':
465
+ case 'multi_choice':
466
+ $.each(response.checked, function (k, v) {
467
+ var $input = $content.find('input[value="' + v.value + '"]'),
468
+ $li = $input.closest('li').removeClass('answer-true user-answer-false');
469
+ if (v.is_true == 'yes') {
470
+ $li.addClass('answer-true')
471
+ }
472
+ if (response.answered) {
473
+ if (typeof response.answered == 'string') {
474
+ if (response.answered == v.value) {
475
+ $input.prop('checked', true);
476
+ }
477
+ } else if ($.inArray(v.value, response.answered) != -1) {
478
+ $input.prop('checked', true);
479
+ }
480
+ }
481
+ if ($input.is(':checked') && v.is_true == 'yes') {
482
+ } else {
483
+ $li.addClass('user-answer-false');
484
+ }
485
+
486
+ });
487
+ $content.addClass('checked').find('input, select, textarea').prop('disabled', true);
488
+ $current.set({
489
+ content: $content
490
+ });
491
+ }
492
+ //LearnPress.Hook.doAction('learn_press_check_question', response, $current);
493
+ this.render();
494
+ },
495
+ _checkQuestion : function () {
496
+ if (LearnPress.Hook.applyFilters('learn_press_before_check_question', true, this) !== false) {
497
+ var that = this;
498
+ this.$buttons.next.prop('disabled', true);
499
+ this.$buttons.prev.prop('disabled', true);
500
+ this.$buttons.finish.prop('disabled', true);
501
+ this.$buttons.check.prop('disabled', true);
502
+ this.pause();
503
+ this.block_page();
504
+ this.model.current().check({
505
+ complete: function (response) {
506
+ that.$buttons.next.prop('disabled', false);
507
+ that.$buttons.prev.prop('disabled', false);
508
+ that.$buttons.finish.prop('disabled', false);
509
+ that.$buttons.check.prop('disabled', false);
510
+ LearnPress.Hook.doAction('learn_press_check_question', response, that);
511
+ that.resume();
512
+ },
513
+ data : {nonce: this.model.get('nonce')}
514
+ });
515
+ }
516
+ },
517
+ _hintQuestion : function (e) {
518
+ e.preventDefault();
519
+ var current = this.model.current();
520
+ if (current && current.get('hint')) {
521
+ $('#learn-press-question-hint-' + current.get('id')).toggleClass('hide-if-js')
522
+ }
523
+
524
+ },
525
+ _explainQuestion: function (e) {
526
+ e.preventDefault();
527
+ var current = this.model.current();
528
+ if (current && current.get('explanation')) {
529
+ $('#learn-press-question-explanation-' + current.get('id')).toggleClass('hide-if-js')
530
+ }
531
+
532
+ },
533
+ _nextQuestion : function () {
534
+ if (LearnPress.Hook.applyFilters('learn_press_before_next_question', true, this) !== false) {
535
+ var that = this;
536
+ this.$buttons.next.prop('disabled', true);
537
+ this.$buttons.prev.prop('disabled', true);
538
+ this.$buttons.finish.prop('disabled', true);
539
+ this.pause();
540
+ this.block_page();
541
+ this.model.next(function () {
542
+ that.$buttons.next.prop('disabled', false);
543
+ that.$buttons.prev.prop('disabled', false);
544
+ that.$buttons.finish.prop('disabled', false);
545
+ });
546
+ }
547
+ },
548
+ _prevQuestion : function () {
549
+ if (LearnPress.Hook.applyFilters('learn_press_before_prev_question', true, this) !== false) {
550
+ var that = this;
551
+ this.$buttons.next.prop('disabled', true);
552
+ this.$buttons.prev.prop('disabled', true);
553
+ this.$buttons.finish.prop('disabled', true);
554
+ this.pause();
555
+ this.block_page();
556
+ this.model.prev(function () {
557
+ that.$buttons.next.prop('disabled', false);
558
+ that.$buttons.prev.prop('disabled', false);
559
+ that.$buttons.finish.prop('disabled', false);
560
+ });
561
+ }
562
+ },
563
+ _selectQuestion : function (e) {
564
+ e.preventDefault();
565
+ var that = this,
566
+ id = $(e.target).closest('.learn-press-question-wrap').data('id');
567
+ if (this.model.get('status') != 'started') {
568
+ return false;
569
+ }
570
+ if (LearnPress.Hook.applyFilters('learn_press_before_select_question', true, that) !== false) {
571
+ this.pause();
572
+ this.$buttons.next.prop('disabled', true);
573
+ this.$buttons.prev.prop('disabled', true);
574
+ this.$buttons.finish.prop('disabled', true);
575
+ this.pause();
576
+ this.model.select(id, function (response) {
577
+ LearnPress.Hook.doAction('learn_press_selected_question', id, that);
578
+ that.$buttons.next.prop('disabled', false);
579
+ that.$buttons.prev.prop('disabled', false);
580
+ that.$buttons.finish.prop('disabled', false);
581
+ });
582
+ }
583
+ },
584
+ _getNonce : function (field) {
585
+ return this.$('input#' + field + '-nonce').val();
586
+ },
587
+ _startQuiz : function () {
588
+ var that = this;
589
+ if (LearnPress.Hook.applyFilters('learn_press_before_start_quiz', true, that) !== false) {
590
+ that.$buttons.next.prop('disabled', true);
591
+ that.$buttons.prev.prop('disabled', true);
592
+ that.$buttons.finish.prop('disabled', true);
593
+ LearnPress.MessageBox.blockUI();
594
+ that.startQuiz({
595
+ complete: function (response) {
596
+ LearnPress.MessageBox.hide();
597
+ if (response.message) {
598
+ LearnPress.alert(response.message, function () {
599
+ if (response.redirect) {
600
+ LearnPress.reload(response.redirect)
601
+ }
602
+ });
603
+ } else {
604
+ if (response.redirect) {
605
+ LearnPress.reload(response.redirect)
606
+ }
607
+ }
608
+ that.$buttons.next.prop('disabled', false);
609
+ that.$buttons.prev.prop('disabled', false);
610
+ that.$buttons.finish.prop('disabled', false);
611
+ LearnPress.Hook.doAction('learn_press_start_quiz', response, that);
612
+ }
613
+ });
614
+ }
615
+ },
616
+ _retakeQuiz : function () {
617
+ var that = this;
618
+ if (LearnPress.Hook.applyFilters('learn_press_before_retake_quiz', true, that) !== false) {
619
+ LearnPress.confirm(single_quiz_localize.confirm_retake_quiz, function (confirm) {
620
+ if (!confirm) {
621
+ return;
622
+ }
623
+ that.$buttons.retake.prop('disabled', true);
624
+ LearnPress.MessageBox.blockUI();
625
+ that.retakeQuiz({
626
+ complete: function (response) {
627
+ LearnPress.MessageBox.hide();
628
+ LearnPress.Hook.doAction('learn_press_user_retaken_quiz', response, that);
629
+ }
630
+ });
631
+ })
632
+ }
633
+ },
634
+ _finishQuiz : function () {
635
+ var that = this;
636
+ if (LearnPress.Hook.applyFilters('learn_press_before_finish_quiz', true, that) !== false) {
637
+ LearnPress.confirm(single_quiz_localize.confirm_finish_quiz, function (confirm) {
638
+ if (!confirm) {
639
+ return;
640
+ }
641
+ that.$buttons.next.prop('disabled', true);
642
+ that.$buttons.prev.prop('disabled', true);
643
+ that.$buttons.finish.prop('disabled', true);
644
+ LearnPress.MessageBox.blockUI();
645
+ that.finishQuiz({
646
+ data : {
647
+ save_id : that.model.get('question_id'),
648
+ question_answer: that.$('form').serialize(),
649
+ time_remaining : that.model.get('time_remaining')
650
+ },
651
+ complete: function (response) {
652
+ LearnPress.MessageBox.hide();
653
+ LearnPress.Hook.doAction('learn_press_user_finished_quiz', response, that);
654
+ }
655
+ });
656
+ });
657
+ }
658
+ },
659
+ _updateQuestion : function ($newQuestion) {
660
+ var $container = this.$('.quiz-question-content form'),
661
+ $oldQuestion = $container.find('.learn-press-question-wrap');
662
+ if ($oldQuestion.length) {
663
+ $oldQuestion.replaceWith($newQuestion);
664
+ } else {
665
+ $container.append($newQuestion);
666
+ }
667
+ LearnPress.Hook.doAction('learn_press_update_question_content', $newQuestion, $oldQuestion, this);
668
+ LearnPress.setUrl($newQuestion.find('input[name="learn-press-question-permalink"]').val());
669
+
670
+ },
671
+ initCountdown : function () {
672
+ var that = this,
673
+ $countdown = this.$countdown;
674
+ if (!$countdown) {
675
+ this.$countdown = $("#quiz-countdown-value");
676
+ this.$countdown.backward_timer({
677
+ seconds : parseInt(this.model.get('time_remaining')),
678
+ format : that.model.get('time_format'),
679
+ on_exhausted: function (timer) {
680
+ that._timeOver(timer)
681
+ },
682
+ on_tick : function (timer) {
683
+ var color = (timer.seconds_left <= 5) ? "#F00" : "";
684
+ if (color) timer.target.css('color', color);
685
+ //that.model.set('time_remaining', timer.seconds_left);
686
+ }
687
+ });
688
+ }
689
+ },
690
+ pause : function () {
691
+ this.$countdown.backward_timer('cancel');
692
+ },
693
+ resume : function () {
694
+ this.$countdown.backward_timer('start');
695
+ },
696
+ loadPage : function (url) {
697
+ url = url || window.location.href;
698
+ window.location.href = url;
699
+ },
700
+ _timeOver : function (timer) {
701
+ timer.target.css('color', '#F00');
702
+ LearnPress.MessageBox.blockUI(single_quiz_localize.quiz_time_is_over_message);
703
+ this.finishQuiz({
704
+ complete: function (response) {
705
+ LearnPress.MessageBox.hide();
706
+ if (response.redirect) {
707
+ LearnPress.reload(response.redirect);
708
+ }
709
+ }
710
+ });
711
+ },
712
+ block_page : function () {
713
+ //this.$el.block_ui();
714
+ },
715
+ unblock_page : function () {
716
+ //this.$el.unblock_ui();
717
+ }
718
+ });
719
+ LearnPress.Quiz = {
720
+ init: function (data) {
721
+ var model = new LearnPress_Model_Quiz(data);
722
+ new LearnPress_View_Quiz(model);
723
+ }
724
+ }
725
+
726
+
727
+ $(document).ready(function () {
728
+ var json = JSON.stringify(single_quiz_params);
729
+ LearnPress.Quiz.init(single_quiz_params);
730
+ })
731
+ })(jQuery);
assets/js/frontend/single-quiz.min.js ADDED
@@ -0,0 +1 @@
 
1
+ if(typeof LP=="undefined"){var LP={}}(function(d){var e=window.LP_Model_Quiz=Backbone.Model.extend({defaults:{},data:null,view:false,url:function(){},urlRoot:"",questions:null,initialize:function(){this.createQuestionsList()},createQuestionsList:function(){this.questions=new c();_.each(this.get("questions"),function(g,h){var f=new a(d.extend({quiz_id:this.get("id"),user_id:this.get("user_id")},g));f.urlRoot=this.get("ajaxurl");f.view=this.view;this.questions.add(f)},this)},next:function(i){if(!this.isLast()){var g=this.findNext(),f=this.questions.findWhere({id:g}),h=this;f.submit({data:{save_id:h.get("question_id"),question_answer:this.view.$("form").serializeJSON(),time_remaining:h.get("time_remaining")},complete:function(){h.set("question_id",g);d.isFunction(i)&&i.apply(h);LP.Hook.doAction("learn_press_next_question",g,h)}})}},prev:function(i){if(!this.isFirst()){var h=this.findPrev(),f=this.questions.findWhere({id:h}),g=this;f.submit({data:{save_id:g.get("question_id"),question_answer:this.view.$("form").serializeJSON(),time_remaining:g.get("time_remaining")},complete:function(){g.set("question_id",h);d.isFunction(i)&&i.apply(g);LP.Hook.doAction("learn_press_previous_question",h,g)}})}},select:function(i,h){var f=this.questions.findWhere({id:i}),g=this;f&&f.submit({data:{save_id:g.get("question_id"),question_answer:this.view.$("form").serializeJSON(),time_remaining:g.get("time_remaining")},complete:function(j){g.set("question_id",i);d.isFunction(h)&&h.apply(g,[j])}})},getQuestionPosition:function(f){f=f||this.get("question_id");return _.indexOf(this.getIds(),f)},countQuestions:function(){return this.questions.length},isLast:function(f){f=f||this.get("question_id");return this.getQuestionPosition(f)==(this.countQuestions()-1)},isFirst:function(f){f=f||this.get("question_id");return this.getQuestionPosition(f)==0},findNext:function(f){f=f||this.get("question_id");var g=this.getIds(),h=this.getQuestionPosition(f);h++;if(typeof g[h]=="undefined"){return false}return g[h]},findPrev:function(f){f=f||this.get("question_id");var g=this.getIds(),h=this.getQuestionPosition(f);h--;if(typeof g[h]=="undefined"){return false}return g[h]},current:function(){return this.questions.findWhere({id:parseInt(this.get("question_id"))})},getIds:function(){return d.map(this.get("questions"),function(g,f){return parseInt(g.id)})}});var a=window.LP_Model_Question=Backbone.Model.extend({defaults:{},data:null,view:false,url:function(){return this.urlRoot},urlRoot:"",initialize:function(){},element:function(){return d(this.get("content"))},submit:function(f){var g=this;f=d.extend({complete:null,data:{}},f||{});this.fetch({data:d.extend({action:"learnpress_load_quiz_question",user_id:this.get("user_id"),quiz_id:this.get("quiz_id"),question_id:this.get("id")},f.data||{}),complete:(function(i){var h=LP.parseJSON(i.responseText);if(h.result=="success"){g.set(h.question);if(h.permalink){LP.setUrl(h.permalink)}d.isFunction(f.complete)&&f.complete.call(g,h)}})})},check:function(f){var g=this;if(d.isFunction(f)){f={complete:f}}else{f=d.extend({complete:null,data:{}},f||{})}LP.doAjax({data:d.extend({"lp-ajax":"check-question",user_id:this.get("user_id"),quiz_id:this.get("quiz_id"),question_id:this.get("id"),save_id:this.get("id"),question_answer:d("form#learn-press-quiz-question").serializeJSON()},f.data||{}),success:function(h,i){g.set("checked",h.checked);d.isFunction(f.complete)&&f.complete.call(g,h)}})}});var c=window.LP_Collection_Questions=Backbone.Collection.extend({url:"admin-ajax.php",model:a});var b=window.LP_View_Quiz=Backbone.View.extend({model:{},events:{"click .button-start-quiz":"_startQuiz","click .button-finish-quiz":"_finishQuiz","click .button-retake-quiz":"_retakeQuiz","click .next-question":"_nextQuestion","click .prev-question":"_prevQuestion","click .check-question":"_checkQuestion","click .quiz-questions-list li a":"_selectQuestion","click .hint-question":"_hintQuestion","click .explain-question":"_explainQuestion"},el:".single-quiz",isRendered:false,$buttons:{},initialize:function(f){this.model=f;this.model.view=this;this.listenTo(this.model,"change:question_id",this.changeQuestion);this.listenTo(this.model,"change",this.render);this.listenTo(this.model,"change",this.updateCountdown);LP.Hook.addAction("learn_press_check_question",function(g,h){h.updateAnswer.apply(h,[g])}).addAction("learn_press_update_question_content",function(h,g,j){var i=j.model.current();setTimeout(function(){if(i.get("checked")){j.updateAnswer.apply(j,[{checked:i.get("checked"),result:"success"}])}},100)});_.bindAll(this,"render","_timeOver","_checkQuestion","_hintQuestion","updateAnswer","updateCountdown");this._create();this.render();this.updateCountdown(true)},_create:function(){this.$buttons={start:this.$(".button-start-quiz"),finish:this.$(".button-finish-quiz"),retake:this.$(".button-retake-quiz"),next:this.$(".next-question"),prev:this.$(".prev-question"),check:this.$(".check-question"),hint:this.$(".hint-question"),explain:this.$(".explain-question")};if(this.model.get("status")=="started"){this.initCountdown();var f=this.model.current();if(f){f.set({content:d("#learn-press-quiz-question .question-"+f.get("id"))});this._updateQuestion(f.element())}}var g=this;this.setButtonsState()},changeQuestion:function(){var f=this.model.current();if(f){this._updateQuestion(f.element())}},updateCountdown:function(f){if(!this.model.hasChanged("status")&&!f){return}if(this.model.get("status")=="started"){if(!this.$countdown){this.initCountdown()}this.$countdown.backward_timer("start")}},render:function(){if(!this.model.hasChanged("question_id")&&!this.model.hasChanged("status")){}var f=this.model.current();this.setButtonsState();switch(this.model.get("status")){case"started":this.$(".quiz-intro").remove();this.$(".quiz-countdown").removeClass("hide-if-js")}if(f&&this.model.get("status")=="started"){this.$('form[name="learn-press-quiz-question"]').html(f.get("content"));this.$('#learn-press-quiz-questions li[data-id="'+f.get("id")+'"]').addClass("current").siblings(".current").removeClass("current")}this.isRendered=true;this.$el.css("visibility","visible")},setButtonsState:function(){var f="hide-if-js",g=this.model.current();switch(this.model.get("status").toLowerCase()){case"completed":this.$buttons.start.addClass(f);this.$buttons.finish.addClass(f);this.$buttons.check.addClass(f);this.$buttons.retake.removeClass(f);break;case"started":this.$buttons.start.addClass(f);this.$buttons.finish.removeClass(f);this.$buttons.retake.addClass(f);if(this.model.countQuestions()<=1){this.$buttons.next.addClass(f);this.$buttons.prev.addClass(f)}else{this.$buttons.next.removeClass(f);this.$buttons.prev.removeClass(f);if(this.model.isLast()){this.$buttons.next.addClass(f);this.$buttons.finish.filter('[data-area="nav"]').removeClass(f)}else{this.$buttons.finish.filter('[data-area="nav"]').addClass(f)}if(this.model.isFirst()){this.$buttons.prev.addClass(f)}}if(g&&g.get("check_answer")){this.$buttons.check.removeClass(f)}else{this.$buttons.check.addClass(f)}if(g&&g.get("hint")){this.$buttons.hint.removeClass(f)}else{this.$buttons.hint.addClass(f)}if(g&&g.get("explanation")){this.$buttons.explain.removeClass(f)}else{this.$buttons.explain.addClass(f)}break;default:this.$buttons.next.addClass(f);this.$buttons.prev.addClass(f);this.$buttons.start.removeClass(f);this.$buttons.finish.addClass(f);this.$buttons.retake.addClass(f);this.$(".quiz-questions .qq.current").removeClass("current")}},startQuiz:function(f){this.block_page();f=d.extend({complete:false},f||{});var g=this,h=d.extend({"lp-ajax":"start-quiz",quiz_id:this.model.get("id"),nonce:this.model.get("nonce")},f.data||{});LP.doAjax({url:window.location.href,data:h,success:function(i,j){LP.MessageBox.hide();var i=LP.Hook.applyFilters("learn_press_start_quiz_results",i,g);if(i.result=="success"){g.model.current().set(i.question);g.model.set({status:i.data.status,question_id:i.question.id});LP.setUrl(i.question.permalink)}d.isFunction(f.complete)&&f.complete.call(g,i)}})},finishQuiz:function(f){this.pause();this.block_page();f=d.extend({complete:false},f||{});var g=this,h=d.extend({"lp-ajax":"finish-quiz",quiz_id:this.model.get("id"),nonce:this.model.get("nonce")},f.data||{});LP.doAjax({data:h,success:function(i){var j=undefined;d.isFunction(f.complete)&&(j=f.complete.call(LP.Quiz,i));LP.Hook.doAction("learn_press_finish_quiz",g.model.get("id"),g);LP.MessageBox.show(single_quiz_localize.finished_quiz,{autohide:2000,onHide:function(){if(j&&j.redirect){LP.reload(j.redirect)}else{if(j==undefined&&i.redirect){LP.reload(i.redirect)}}}})}})},retakeQuiz:function(f){this.block_page();f=d.extend({complete:false},f||{});var g=this,h=d.extend({"lp-ajax":"retake-quiz",quiz_id:this.model.get("id"),nonce:this.model.get("nonce")},f.data||{});LP.doAjax({data:h,success:function(i,j){LP.MessageBox.hide();if(i.result=="success"){d.isFunction(f.complete)&&f.complete.call(LP.Quiz,i);LP.MessageBox.show(single_quiz_localize.retaken_quiz,{autohide:2000,onHide:function(){LP.reload(i.redirect)}})}else{LP.alert(i.message)}}})},updateAnswer:function(f){if(!f||f.result!="success"){return}var h=this.model.current(),g=d(h.get("content"));switch(h.get("type")){case"true_or_false":case"single_choice":case"multi_choice":d.each(f.checked,function(j,i){var m=g.find('input[value="'+i.value+'"]'),l=m.closest("li").removeClass("answer-true user-answer-false");if(i.is_true=="yes"){l.addClass("answer-true")}if(f.answered){if(typeof f.answered=="string"){if(f.answered==i.value){m.prop("checked",true)}}else{if(d.inArray(i.value,f.answered)!=-1){m.prop("checked",true)}}}if(m.is(":checked")&&i.is_true=="yes"){}else{l.addClass("user-answer-false")}});g.addClass("checked").find("input, select, textarea").prop("disabled",true);h.set({content:g})}this.render()},_checkQuestion:function(){if(LP.Hook.applyFilters("learn_press_before_check_question",true,this)!==false){var f=this;this.$buttons.next.prop("disabled",true);this.$buttons.prev.prop("disabled",true);this.$buttons.finish.prop("disabled",true);this.$buttons.check.prop("disabled",true);this.pause();this.block_page();this.model.current().check({complete:function(g){f.$buttons.next.prop("disabled",false);f.$buttons.prev.prop("disabled",false);f.$buttons.finish.prop("disabled",false);f.$buttons.check.prop("disabled",false);LP.Hook.doAction("learn_press_check_question",g,f);f.resume()},data:{nonce:this.model.get("nonce")}})}},_hintQuestion:function(g){g.preventDefault();var f=this.model.current();if(f&&f.get("hint")){d("#learn-press-question-hint-"+f.get("id")).toggleClass("hide-if-js")}},_explainQuestion:function(g){g.preventDefault();var f=this.model.current();if(f&&f.get("explanation")){d("#learn-press-question-explanation-"+f.get("id")).toggleClass("hide-if-js")}},_nextQuestion:function(){if(LP.Hook.applyFilters("learn_press_before_next_question",true,this)!==false){var f=this;this.$buttons.next.prop("disabled",true);this.$buttons.prev.prop("disabled",true);this.$buttons.finish.prop("disabled",true);this.pause();this.block_page();this.model.next(function(){f.$buttons.next.prop("disabled",false);f.$buttons.prev.prop("disabled",false);f.$buttons.finish.prop("disabled",false)})}},_prevQuestion:function(){if(LP.Hook.applyFilters("learn_press_before_prev_question",true,this)!==false){var f=this;this.$buttons.next.prop("disabled",true);this.$buttons.prev.prop("disabled",true);this.$buttons.finish.prop("disabled",true);this.pause();this.block_page();this.model.prev(function(){f.$buttons.next.prop("disabled",false);f.$buttons.prev.prop("disabled",false);f.$buttons.finish.prop("disabled",false)})}},_selectQuestion:function(g){g.preventDefault();var f=this,h=d(g.target).closest(".learn-press-question-wrap").data("id");if(this.model.get("status")!="started"){return false}if(LP.Hook.applyFilters("learn_press_before_select_question",true,f)!==false){this.pause();this.$buttons.next.prop("disabled",true);this.$buttons.prev.prop("disabled",true);this.$buttons.finish.prop("disabled",true);this.pause();this.model.select(h,function(i){LP.Hook.doAction("learn_press_selected_question",h,f);f.$buttons.next.prop("disabled",false);f.$buttons.prev.prop("disabled",false);f.$buttons.finish.prop("disabled",false)})}},_getNonce:function(f){return this.$("input#"+f+"-nonce").val()},_startQuiz:function(){var f=this;if(LP.Hook.applyFilters("learn_press_before_start_quiz",true,f)!==false){f.$buttons.next.prop("disabled",true);f.$buttons.prev.prop("disabled",true);f.$buttons.finish.prop("disabled",true);LP.MessageBox.blockUI();f.startQuiz({complete:function(g){LP.MessageBox.hide();if(g.message){LP.alert(g.message,function(){if(g.redirect){LP.reload(g.redirect)}})}else{if(g.redirect){LP.reload(g.redirect)}}f.$buttons.next.prop("disabled",false);f.$buttons.prev.prop("disabled",false);f.$buttons.finish.prop("disabled",false);LP.Hook.doAction("learn_press_start_quiz",g,f)}})}},_retakeQuiz:function(){var f=this;if(LP.Hook.applyFilters("learn_press_before_retake_quiz",true,f)!==false){LP.confirm(single_quiz_localize.confirm_retake_quiz,function(g){if(!g){return}f.$buttons.retake.prop("disabled",true);LP.MessageBox.blockUI();f.retakeQuiz({complete:function(h){LP.MessageBox.hide();LP.Hook.doAction("learn_press_user_retaken_quiz",h,f)}})})}},_finishQuiz:function(){var f=this;if(LP.Hook.applyFilters("learn_press_before_finish_quiz",true,f)!==false){LP.confirm(single_quiz_localize.confirm_finish_quiz,function(g){if(!g){return}f.$buttons.next.prop("disabled",true);f.$buttons.prev.prop("disabled",true);f.$buttons.finish.prop("disabled",true);LP.MessageBox.blockUI();f.finishQuiz({data:{save_id:f.model.get("question_id"),question_answer:f.$("form").serializeJSON(),time_remaining:f.model.get("time_remaining")},complete:function(h){LP.MessageBox.hide();LP.Hook.doAction("learn_press_user_finished_quiz",h,f)}})})}},_updateQuestion:function(g){var h=this.$(".quiz-question-content form"),f=h.find(".learn-press-question-wrap");if(f.length){f.replaceWith(g)}else{h.append(g)}LP.Hook.doAction("learn_press_update_question_content",g,f,this);LP.setUrl(g.find('input[name="learn-press-question-permalink"]').val())},initCountdown:function(){var g=this,f=this.$countdown;if(!f){this.$countdown=d("#quiz-countdown-value");this.$countdown.backward_timer({seconds:parseInt(this.model.get("time_remaining")),format:g.model.get("time_format"),on_exhausted:function(h){g._timeOver(h)},on_tick:function(i){var h=(i.seconds_left<=5)?"#F00":"";if(h){i.target.css("color",h)}}})}},pause:function(){this.$countdown.backward_timer("cancel")},resume:function(){this.$countdown.backward_timer("start")},loadPage:function(f){f=f||window.location.href;window.location.href=f},_timeOver:function(f){f.target.css("color","#F00");LP.MessageBox.blockUI(single_quiz_localize.quiz_time_is_over_message);this.finishQuiz({complete:function(g){LP.MessageBox.hide();if(g.redirect){LP.reload(g.redirect)}}})},block_page:function(){},unblock_page:function(){}});LP.Quiz={init:function(g){var f=new e(g);new b(f)}};d(document).ready(function(){var f=JSON.stringify(single_quiz_params);LP.Quiz.init(single_quiz_params)})})(jQuery);
assets/js/global.js CHANGED
@@ -1,27 +1,758 @@
1
  /**
2
  * Common functions/utils used in all page
3
  */
4
- if( typeof window.LearnPress == 'undefined' ){
5
- window.LearnPress = {};
6
  }
7
- ;(function($){
8
- window.LearnPress = $.extend( window.LearnPress, {
9
- reload: function( url ) {
10
- window.location.href = url || window.location.href;
11
- },
12
- parse_json: function (data){
13
- var m = data.match(/<!-- LPR_AJAX_START -->(.*)<!-- LPR_AJAX_END -->/);
14
- try {
15
- if (m) {
16
- data = $.parseJSON(m[1]);
17
- } else {
18
- data = $.parseJSON(data);
19
- }
20
- }catch(e){
21
- console.log(e);
22
- data = {};
23
- }
24
- return data;
25
- }
26
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  })(jQuery);
1
  /**
2
  * Common functions/utils used in all page
3
  */
4
+ if (typeof window.LearnPress == 'undefined') {
5
+ window.LearnPress = {};
6
  }
7
+ ;
8
+ (function ($) {
9
+ $.fn.serializeJSON = function () {
10
+ var unIndexed = $(this).serializeArray(),
11
+ indexed = {},
12
+ validate = /(\[([a-zA-Z0-9_-]+)?\]?)/g,
13
+ arrayKeys = {},
14
+ end = false;
15
+ $.each(unIndexed, function () {
16
+ var that = this,
17
+ match = this.name.match(/^([0-9a-zA-Z_-]+)/);
18
+ if (!match) {
19
+ return;
20
+ }
21
+ var keys = this.name.match(validate),
22
+ objPath = "indexed['" + match[0] + "']";
23
+
24
+ if (keys) {
25
+ if (typeof indexed[match[0]] != 'object') {
26
+ indexed[match[0]] = {};
27
+ }
28
+
29
+ $.each(keys, function (i, prop) {
30
+ prop = prop.replace(/\]|\[/g, '');
31
+ var rawPath = objPath.replace(/'|\[|\]/g, ''),
32
+ objExp = '',
33
+ preObjPath = objPath;
34
+
35
+ if (prop == '') {
36
+ if (arrayKeys[rawPath] == undefined) {
37
+ arrayKeys[rawPath] = 0;
38
+ } else {
39
+ arrayKeys[rawPath]++;
40
+ }
41
+ objPath += "['" + arrayKeys[rawPath] + "']";
42
+ } else {
43
+ if (!isNaN(prop)) {
44
+ arrayKeys[rawPath] = prop;
45
+ }
46
+ objPath += "['" + prop + "']";
47
+ }
48
+ try {
49
+ if (i == keys.length - 1) {
50
+ objExp = objPath + "=that.value;";
51
+ end = true;
52
+ } else {
53
+ objExp = objPath + "={}";
54
+ end = false;
55
+ }
56
+
57
+ var evalString = "" +
58
+ "if( typeof " + objPath + " == 'undefined'){" + objExp + ";" +
59
+ "}else{" +
60
+ "if(end){" +
61
+ "if(typeof " + preObjPath + "!='object'){" + preObjPath + "={};}" +
62
+ objExp +
63
+ "}" +
64
+ "}";
65
+ eval(evalString);
66
+ } catch (e) {
67
+ console.log('Error:' + e + "\n" + objExp);
68
+ }
69
+ })
70
+ } else {
71
+ indexed[match[0]] = this.value;
72
+ }
73
+ indexed['how-old-are-you'] = 11
74
+ });
75
+ return indexed;
76
+ };
77
+ $.fn.hasEvent = function (name) {
78
+ var events = $(this).data('events');
79
+ if (typeof events.LearnPress == 'undefined') {
80
+ return false;
81
+ }
82
+ for (i = 0; i < events.LearnPress.length; i++) {
83
+ if (events.LearnPress[i].namespace == name) {
84
+ return true;
85
+ }
86
+ }
87
+ return false;
88
+ }
89
+ $.fn.dataToJSON = function () {
90
+ var json = {};
91
+ $.each(this[0].attributes, function () {
92
+ var m = this.name.match(/^data-(.*)/);
93
+ if (m) {
94
+ json[m[1]] = this.value;
95
+ }
96
+ });
97
+ return json;
98
+ }
99
+
100
+ String.prototype.getQueryVar = function (name) {
101
+ name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
102
+ var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
103
+ results = regex.exec(this);
104
+ return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
105
+ }
106
+ String.prototype.addQueryVar = function (name, value) {
107
+ var url = this;
108
+ if (name.match(/\[/)) {
109
+ url += url.match(/\?/) ? '&' : '?';
110
+ url += name + '=' + value;
111
+ } else {
112
+ if ((url.indexOf('&' + name + '=') != -1) || (url.indexOf('?' + name + '=') != -1)) {
113
+ url = url.replace(new RegExp(name + "=([^&#]*)", 'g'), name + '=' + value);
114
+ } else {
115
+ url += url.match(/\?/) ? '&' : '?';
116
+ url += name + '=' + value;
117
+ }
118
+ }
119
+ return url;
120
+ }
121
+ String.prototype.removeQueryVar = function (name) {
122
+ var url = this;
123
+ name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
124
+ var regex = new RegExp("[\\?&]" + name + "([\[][^=]*)?=([^&#]*)", 'g');
125
+ url = url.replace(regex, '');
126
+ return url;
127
+ }
128
+ if($.isEmptyObject("") == false){
129
+ $.isEmptyObject = function(a){
130
+ for (prop in a) {
131
+ if (a.hasOwnProperty(prop)) {
132
+ return false;
133
+ }
134
+ }
135
+ return true;
136
+ }
137
+ }
138
+
139
+ LearnPress.MessageBox = {
140
+ /*
141
+ *
142
+ */
143
+ $block : null,
144
+ $window : null,
145
+ events : {},
146
+ instances : [],
147
+ instance : null,
148
+ quickConfirm : function (elem, args) {
149
+ var $e = $(elem);
150
+ $('[learn-press-quick-confirm]').each(function () {
151
+ ( $ins = $(this).data('quick-confirm') ) && (console.log($ins), $ins.destroy() );
152
+ });
153
+ !$e.attr('learn-press-quick-confirm') && $e.attr('learn-press-quick-confirm', 'true').data('quick-confirm',
154
+ new (function (elem, args) {
155
+ var $elem = $(elem),
156
+ $div = $('<span class="learn-press-quick-confirm"></span>').insertAfter($elem), //($(document.body)),
157
+ offset = $(elem).position() || {left: 0, top: 0},
158
+ timerOut = null,
159
+ timerHide = null,
160
+ n = 3,
161
+ hide = function () {
162
+ $div.fadeOut('fast', function () {
163
+ $(this).remove();
164
+ $div.parent().css('position', '');
165
+ });
166
+ $elem.removeAttr('learn-press-quick-confirm').data('quick-confirm', undefined);
167
+ stop();
168
+ },
169
+ stop = function () {
170
+ timerHide && clearInterval(timerHide);
171
+ timerOut && clearInterval(timerOut);
172
+ },
173
+ start = function () {
174
+ timerOut = setInterval(function () {
175
+ if (--n == 0) {
176
+ hide.call($div[0]);
177
+ $.isFunction(args.onCancel) && args.onCancel(args.data);
178
+ stop();
179
+ }
180
+ $div.find('span').html(' (' + n + ')');
181
+ }, 1000);
182
+
183
+ timerHide = setInterval(function () {
184
+ if (!$elem.is(':visible') || $elem.css("visibility") == 'hidden') {
185
+ stop();
186
+ $div.remove();
187
+ $div.parent().css('position', '');
188
+ $.isFunction(args.onCancel) && args.onCancel(args.data);
189
+ }
190
+ }, 350);
191
+ };
192
+ args = $.extend({
193
+ message : '',
194
+ data : null,
195
+ onOk : null,
196
+ onCancel: null,
197
+ offset : {top: 0, left: 0}
198
+ }, args || {});
199
+ $div.html(args.message || $elem.attr('data-confirm-remove') || 'Are you sure?').append('<span> (' + n + ')</span>').css({});
200
+ $div.click(function () {
201
+ $.isFunction(args.onOk) && args.onOk(args.data);
202
+ hide();
203
+ }).hover(function () {
204
+ stop();
205
+ }, function () {
206
+ start();
207
+ });
208
+ //$div.parent().css('position', 'relative');
209
+ $div.css({
210
+ left: ( ( offset.left + $elem.outerWidth() ) - $div.outerWidth() ) + args.offset.left,
211
+ top : offset.top + $elem.outerHeight() + args.offset.top + 5
212
+ }).hide().fadeIn('fast');
213
+ start();
214
+
215
+ this.destroy = function () {
216
+ $div.remove();
217
+ $elem.removeAttr('learn-press-quick-confirm').data('quick-confirm', undefined);
218
+ ;
219
+ stop();
220
+ console.log('die');
221
+ };
222
+ })(elem, args)
223
+ );
224
+ },
225
+ show : function (message, args) {
226
+ //this.hide();
227
+ $.proxy(function () {
228
+ args = $.extend({
229
+ title : '',
230
+ buttons : '',
231
+ events : false,
232
+ autohide: false,
233
+ message : message,
234
+ data : false,
235
+ id : LearnPress.uniqueId(),
236
+ onHide : null
237
+ }, args || {});
238
+
239
+ this.instances.push(args)
240
+ this.instance = args;
241
+
242
+ var $doc = $(document),
243
+ $body = $(document.body);
244
+ if (!this.$block) {
245
+ this.$block = $('<div id="learn-press-message-box-block"></div>').appendTo($body);
246
+
247
+ }
248
+ if (!this.$window) {
249
+ this.$window = $('<div id="learn-press-message-box-window"><div id="message-box-wrap"></div> </div>').insertAfter(this.$block);
250
+ this.$window.click(function () {
251
+ })
252
+ }
253
+ //this.events = args.events || {};
254
+ this._createWindow(message, args.title, args.buttons);
255
+ this.$block.show();
256
+ this.$window.show().attr('instance', args.id);
257
+ $(window)
258
+ .bind('resize.message-box', $.proxy(this.update, this))
259
+ .bind('scroll.message-box', $.proxy(this.update, this));
260
+ this.update(true);
261
+ if (args.autohide) {
262
+ setTimeout(function () {
263
+ LearnPress.MessageBox.hide();
264
+ $.isFunction(args.onHide) && args.onHide.call(LearnPress.MessageBox, args);
265
+ }, args.autohide)
266
+ }
267
+ }, this)()
268
+ },
269
+ blockUI : function (message) {
270
+
271
+ message = (message !== false ? ( message ? message : 'Wait a moment' ) : '') + '<div class="message-box-animation"></div>';
272
+ this.show(message);
273
+ },
274
+ hide : function (delay, instance) {
275
+ if (instance) {
276
+ this._removeInstance(instance.id);
277
+ } else if (this.instance) {
278
+ this._removeInstance(this.instance.id);
279
+ }
280
+ if (this.instances.length == 0) {
281
+ if (this.$block) {
282
+ this.$block.hide();
283
+ }
284
+ if (this.$window) {
285
+ this.$window.hide();
286
+ }
287
+ $(window)
288
+ .unbind('resize.message-box', this.update)
289
+ .unbind('scroll.message-box', this.update);
290
+ } else {
291
+ if (this.instance) {
292
+ this._createWindow(this.instance.message, this.instance.title, this.instance.buttons)
293
+ }
294
+ }
295
+
296
+ },
297
+ update : function (force) {
298
+ var that = this,
299
+ $wrap = this.$window.find('#message-box-wrap'),
300
+ timer = $wrap.data('timer'),
301
+ _update = function () {
302
+ LearnPress.Hook.doAction('learn_press_message_box_before_resize', that);
303
+ var $content = $wrap.find('.message-box-content').css("height", "").css('overflow', 'hidden'),
304
+ width = $wrap.outerWidth(),
305
+ height = $wrap.outerHeight(),
306
+ contentHeight = $content.height(),
307
+ windowHeight = $(window).height(),
308
+ top = $wrap.offset().top;
309
+ if (contentHeight > windowHeight - 50) {
310
+ $content.css({
311
+ height: windowHeight - 50
312
+ });
313
+ height = $wrap.outerHeight()
314
+ } else {
315
+ $content.css("height", "").css('overflow', '');
316
+ }
317
+ $wrap.css({
318
+ marginTop: ( $(window).height() - height ) / 2
319
+ });
320
+ LearnPress.Hook.doAction('learn_press_message_box_resize', height, that);
321
+ };
322
+ if (force) _update();
323
+ timer && clearTimeout(timer);
324
+ timer = setTimeout(_update, 250);
325
+ },
326
+ _removeInstance: function (id) {
327
+ for (var i = 0; i < this.instances.length; i++) {
328
+ if (this.instances[i].id == id) {
329
+
330
+ this.instances.splice(i, 1);
331
+
332
+ var len = this.instances.length;
333
+ if (len) {
334
+ this.instance = this.instances[len - 1];
335
+ this.$window.attr('instance', this.instance.id)
336
+ } else {
337
+ this.instance = false;
338
+ this.$window.removeAttr('instance')
339
+ }
340
+ break;
341
+ }
342
+ }
343
+ },
344
+ _getInstance : function (id) {
345
+ for (var i = 0; i < this.instances.length; i++) {
346
+ if (this.instances[i].id == id) {
347
+ return this.instances[i];
348
+ break;
349
+ }
350
+ }
351
+ },
352
+ _createWindow : function (message, title, buttons) {
353
+ var $wrap = this.$window.find('#message-box-wrap').html('');
354
+ if (title) {
355
+ $wrap.append('<h3 class="message-box-title">' + title + '</h3>');
356
+ }
357
+ $wrap.append($('<div class="message-box-content"></div>').html(message));
358
+ if (buttons) {
359
+ var $buttons = $('<div class="message-box-buttons"></div>');
360
+ switch (buttons) {
361
+ case 'yesNo':
362
+ $buttons.append(this._createButton(LearnPress_Settings.localize.button_yes, 'yes'));
363
+ $buttons.append(this._createButton(LearnPress_Settings.localize.button_no, 'no'));
364
+ break;
365
+ case 'okCancel':
366
+ $buttons.append(this._createButton(LearnPress_Settings.localize.button_ok, 'ok'));
367
+ $buttons.append(this._createButton(LearnPress_Settings.localize.button_cancel, 'cancel'));
368
+ break;
369
+ default:
370
+ $buttons.append(this._createButton(LearnPress_Settings.localize.button_ok, 'ok'));
371
+ }
372
+ $wrap.append($buttons);
373
+ }
374
+ },
375
+ _createButton : function (title, type) {
376
+ var $button = $('<button type="button" class="button message-box-button message-box-button-' + type + '">' + title + '</button>'),
377
+ callback = 'on' + ( type.substr(0, 1).toUpperCase() + type.substr(1) );
378
+ $button.data('callback', callback).click(function () {
379
+ var instance = $(this).data('instance'),
380
+ callback = instance.events[$(this).data('callback')];
381
+ if ($.type(callback) == 'function') {
382
+ if (callback.apply(LearnPress.MessageBox, [instance]) === false) {
383
+ return;
384
+ } else {
385
+ LearnPress.MessageBox.hide(null, instance);
386
+ }
387
+ } else {
388
+ LearnPress.MessageBox.hide(null, instance);
389
+ }
390
+ }).data('instance', this.instance);
391
+ return $button;
392
+ }
393
+ }
394
+ LearnPress.Hook = {
395
+ hooks : {action: {}, filter: {}},
396
+ addAction : function (action, callable, priority, tag) {
397
+ this.addHook('action', action, callable, priority, tag);
398
+ return this;
399
+ },
400
+ addFilter : function (action, callable, priority, tag) {
401
+ this.addHook('filter', action, callable, priority, tag);
402
+ return this;
403
+ },
404
+ doAction : function (action) {
405
+ this.doHook('action', action, arguments);
406
+ return this;
407
+ },
408
+ applyFilters: function (action) {
409
+ return this.doHook('filter', action, arguments);
410
+ },
411
+ removeAction: function (action, tag) {
412
+ this.removeHook('action', action, tag);
413
+ return this;
414
+ },
415
+ removeFilter: function (action, priority, tag) {
416
+ this.removeHook('filter', action, priority, tag);
417
+ return this;
418
+ },
419
+ addHook : function (hookType, action, callable, priority, tag) {
420
+ if (undefined == this.hooks[hookType][action]) {
421
+ this.hooks[hookType][action] = [];
422
+ }
423
+ var hooks = this.hooks[hookType][action];
424
+ if (undefined == tag) {
425
+ tag = action + '_' + hooks.length;
426
+ }
427
+ this.hooks[hookType][action].push({tag: tag, callable: callable, priority: priority});
428
+ return this;
429
+ },
430
+ doHook : function (hookType, action, args) {
431
+
432
+ // splice args from object into array and remove first index which is the hook name
433
+ args = Array.prototype.slice.call(args, 1);
434
+
435
+ if (undefined != this.hooks[hookType][action]) {
436
+ var hooks = this.hooks[hookType][action], hook;
437
+ //sort by priority
438
+ hooks.sort(function (a, b) {
439
+ return a["priority"] - b["priority"]
440
+ });
441
+ for (var i = 0; i < hooks.length; i++) {
442
+ hook = hooks[i].callable;
443
+ if (typeof hook != 'function')
444
+ hook = window[hook];
445
+ if ('action' == hookType) {
446
+ hook.apply(null, args);
447
+ } else {
448
+ args[0] = hook.apply(null, args);
449
+ }
450
+ }
451
+ }
452
+ if ('filter' == hookType) {
453
+ return args[0];
454
+ }
455
+ return this;
456
+ },
457
+ removeHook : function (hookType, action, priority, tag) {
458
+ if (undefined != this.hooks[hookType][action]) {
459
+ var hooks = this.hooks[hookType][action];
460
+ for (var i = hooks.length - 1; i >= 0; i--) {
461
+ if ((undefined == tag || tag == hooks[i].tag) && (undefined == priority || priority == hooks[i].priority)) {
462
+ hooks.splice(i, 1);
463
+ }
464
+ }
465
+ }
466
+ return this;
467
+ }
468
+ };
469
+ LearnPress = $.extend({
470
+ setUrl : function (url, title) {
471
+ history.pushState({}, title, url);
472
+ },
473
+ getUrl : function () {
474
+ return window.location.href;
475
+ },
476
+ addQueryVar : function (name, value, url) {
477
+ return (url == undefined ? window.location.href : url).addQueryVar(name, value);
478
+ },
479
+ removeQueryVar: function (name, url) {
480
+ return (url == undefined ? window.location.href : url).removeQueryVar(name);
481
+ },
482
+ reload : function (url) {
483
+ if (!url) {
484
+ url = window.location.href;
485
+ }
486
+ window.location.href = url;
487
+ },
488
+ parseJSON : function (data) {
489
+ var m = data.match(/<!-- LP_AJAX_START -->(.*)<!-- LP_AJAX_END -->/);
490
+ try {
491
+ if (m) {
492
+ data = $.parseJSON(m[1]);
493
+ } else {
494
+ data = $.parseJSON(data);
495
+ }
496
+ } catch (e) {
497
+ LearnPress.log(e);
498
+ data = {};
499
+ }
500
+ return data;
501
+ },
502
+ parseResponse : function (response, type) {
503
+ var m = response.match(/<!-- LP_AJAX_START -->(.*)<!-- LP_AJAX_END -->/);
504
+ if (m) {
505
+ response = m[1];
506
+ }
507
+ return ( type || 'json' ) == 'json' ? this.parseJSON(response) : response;
508
+ },
509
+ doAjax : function (args) {
510
+ var type = args.type || 'post',
511
+ dataType = args.dataType || 'json',
512
+ action = ( ( args.prefix == undefined ) || 'learnpress_') + args.action,
513
+ data = args.action ? $.extend(args.data, {action: action}) : args.data;
514
+
515
+ $.ajax({
516
+ data : data,
517
+ url : ( args.url || window.location.href ),
518
+ type : type,
519
+ dataType: 'html',
520
+ success : function (raw) {
521
+ var response = LearnPress.parseResponse(raw, dataType);
522
+ $.isFunction(args.success) && args.success(response, raw);
523
+ },
524
+ error : function () {
525
+ $.isFunction(args.error) && args.error.apply(null, LearnPress.funcArgs2Array());
526
+ }
527
+ });
528
+ },
529
+
530
+ funcArgs2Array: function (args) {
531
+ var arr = [];
532
+ for (var i = 0; i < args.length; i++) {
533
+ arr.push(args[i]);
534
+ }
535
+ return arr;
536
+ },
537
+ addFilter : function (action, callback) {
538
+ var $doc = $(document),
539
+ event = 'LearnPress.' + action;
540
+ $doc.on(event, callback);
541
+ LearnPress.log($doc.data('events'));
542
+ return this;
543
+ },
544
+ applyFilters : function () {
545
+ var $doc = $(document),
546
+ action = arguments[0],
547
+ args = this.funcArgs2Array(arguments);
548
+ if ($doc.hasEvent(action)) {
549
+ args[0] = 'LearnPress.' + action;
550
+ return $doc.triggerHandler.apply($doc, args);
551
+ }
552
+ return args[1];
553
+ },
554
+ addAction : function (action, callback) {
555
+ return this.addFilter(action, callback);
556
+ },
557
+ doAction : function () {
558
+ var $doc = $(document),
559
+ action = arguments[0],
560
+ args = this.funcArgs2Array(arguments);
561
+ if ($doc.hasEvent(action)) {
562
+ args[0] = 'LearnPress.' + action;
563
+ $doc.trigger.apply($doc, args);
564
+ }
565
+ },
566
+ toElement : function (element, args) {
567
+ if ($(element).length == 0) {
568
+ return;
569
+ }
570
+ args = $.extend({
571
+ delay : 300,
572
+ duration: 'slow',
573
+ offset : 50,
574
+ callback: null
575
+ }, args || {});
576
+ $('body, html')
577
+ .fadeIn(10)
578
+ .delay(args.delay)
579
+ .animate({
580
+ scrollTop: $(element).offset().top - args.offset
581
+ }, args.duration, args.callback);
582
+ },
583
+ uniqueId : function (prefix, more_entropy) {
584
+ if (typeof prefix === 'undefined') {
585
+ prefix = '';
586
+ }
587
+
588
+ var retId;
589
+ var formatSeed = function (seed, reqWidth) {
590
+ seed = parseInt(seed, 10)
591
+ .toString(16); // to hex str
592
+ if (reqWidth < seed.length) { // so long we split
593
+ return seed.slice(seed.length - reqWidth);
594
+ }
595
+ if (reqWidth > seed.length) { // so short we pad
596
+ return Array(1 + (reqWidth - seed.length))
597
+ .join('0') + seed;
598
+ }
599
+ return seed;
600
+ };
601
+
602
+ // BEGIN REDUNDANT
603
+ if (!this.php_js) {
604
+ this.php_js = {};
605
+ }
606
+ // END REDUNDANT
607
+ if (!this.php_js.uniqidSeed) { // init seed with big random int
608
+ this.php_js.uniqidSeed = Math.floor(Math.random() * 0x75bcd15);
609
+ }
610
+ this.php_js.uniqidSeed++;
611
+
612
+ retId = prefix; // start with prefix, add current milliseconds hex string
613
+ retId += formatSeed(parseInt(new Date()
614
+ .getTime() / 1000, 10), 8);
615
+ retId += formatSeed(this.php_js.uniqidSeed, 5); // add seed hex string
616
+ if (more_entropy) {
617
+ // for more entropy we add a float lower to 10
618
+ retId += (Math.random() * 10)
619
+ .toFixed(8)
620
+ .toString();
621
+ }
622
+
623
+ return retId;
624
+ },
625
+ log : function () {
626
+ if (typeof LEARN_PRESS_DEBUG != 'undefined' && LEARN_PRESS_DEBUG && console) {
627
+ for (var i = 0, n = arguments.length; i < n; i++) {
628
+ console.log(arguments[i]);
629
+ }
630
+ }
631
+ },
632
+ template : _.memoize(function (id, data) {
633
+ var compiled,
634
+ options = {
635
+ evaluate : /<#([\s\S]+?)#>/g,
636
+ interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
637
+ escape : /\{\{([^\}]+?)\}\}(?!\})/g,
638
+ variable : 'data'
639
+ };
640
+
641
+ var tmpl = function (data) {
642
+ compiled = compiled || _.template($('#' + id).html(), null, options);
643
+ return compiled(data);
644
+ };
645
+ return data ? tmpl(data) : tmpl;
646
+ }, function (a, b) {
647
+ return JSON.stringify(b)
648
+ }),
649
+ alert : function (localize, callback) {
650
+ var title = '',
651
+ message = '';
652
+ if (typeof localize == 'string') {
653
+ message = localize;
654
+ } else {
655
+ if (typeof localize['title'] != 'undefined') {
656
+ title = localize['title'];
657
+ }
658
+ if (typeof localize['message'] != 'undefined') {
659
+ message = localize['message'];
660
+ }
661
+ }
662
+ $.alerts.alert(message, title, function (e) {
663
+ LearnPress._on_alert_hide();
664
+ callback && callback(e);
665
+ });
666
+ this._on_alert_show();
667
+ },
668
+ confirm : function (localize, callback) {
669
+ var title = '',
670
+ message = '';
671
+
672
+ if (typeof localize == 'string') {
673
+ message = localize;
674
+ } else {
675
+ if (typeof localize['title'] != 'undefined') {
676
+ title = localize['title'];
677
+ }
678
+ if (typeof localize['message'] != 'undefined') {
679
+ message = localize['message'];
680
+ }
681
+ }
682
+ $.alerts.confirm(message, title, function (e) {
683
+ LearnPress._on_alert_hide();
684
+ callback && callback(e);
685
+ });
686
+ this._on_alert_show();
687
+
688
+ },
689
+ _on_alert_show: function () {
690
+ var $container = $('#popup_container'),
691
+ $placeholder = $('<span id="popup_container_placeholder" />').insertAfter($container).data('xxx', $container);
692
+ $container.stop().css('top', '-=50').css('opacity', '0').animate({
693
+ top : '+=50',
694
+ opacity: 1
695
+ }, 250);
696
+ },
697
+ _on_alert_hide: function () {
698
+ var $holder = $("#popup_container_placeholder"),
699
+ $container = $holder.data('xxx');
700
+ if ($container) {
701
+ $container.replaceWith($holder);
702
+ }
703
+ $container.appendTo($(document.body))
704
+ $container.stop().animate({
705
+ top : '+=50',
706
+ opacity: 0
707
+ }, 250, function () {
708
+ $(this).remove()
709
+ })
710
+ }
711
+ }, LearnPress);
712
+
713
+ $.fn.findNext = function (selector) {
714
+ var $selector = $(selector),
715
+ $root = this.first(),
716
+ index = $selector.index($root),
717
+ $next = $selector.eq(index + 1);
718
+ return $next.length ? $next : false;
719
+ }
720
+
721
+ $.fn.findPrev = function (selector) {
722
+ var $selector = $(selector),
723
+ $root = this.first(),
724
+ index = $selector.index($root),
725
+ $prev = $selector.eq(index - 1);
726
+ return $prev.length ? $prev : false;
727
+ }
728
+
729
+ function __initSubtabs() {
730
+ $('.learn-press-subtabs').each(function () {
731
+ var $tabContainer = $(this),
732
+ $tabs = $tabContainer.find('a'),
733
+ current = null;
734
+ $tabs.click(function (e) {
735
+ var $tab = $(this),
736
+ $contentID = $tab.attr('href');
737
+ $tab.parent().addClass('current').siblings().removeClass('current');
738
+ current = $($contentID).addClass('current');
739
+ current.siblings().removeClass('current');
740
+ //LearnPress.setUrl($contentID);
741
+ e.preventDefault();
742
+ }).filter(function () {
743
+ return $(this).attr('href') == window.location.hash;
744
+ }).trigger('click');
745
+ if (!current) {
746
+ $tabs.first().trigger('click')
747
+ }
748
+ })
749
+ }
750
+
751
+ $(document).ready(function () {
752
+ if (typeof $.alerts != 'undefined') {
753
+ $.alerts.overlayColor = '#000';
754
+ $.alerts.overlayOpacity = 0.5;
755
+ }
756
+ });
757
+
758
  })(jQuery);
assets/js/global.min.js ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if(typeof window.LearnPress=='undefined'){window.LearnPress={}};(function($){$.fn.hasEvent=function(name){var events=$(this).data('events');if(typeof events.LearnPress=='undefined'){return !1}
2
+ for(i=0;i<events.LearnPress.length;i++){if(events.LearnPress[i].namespace==name){return !0}}
3
+ return !1}
4
+ $.fn.dataToJSON=function(){var json={};$.each(this[0].attributes,function(){var m=this.name.match(/^data-(.*)/);if(m){json[m[1]]=this.value}});return json}
5
+ String.prototype.getQueryVar=function(name){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regex=new RegExp("[\\?&]"+name+"=([^&#]*)"),results=regex.exec(this);return results===null?"":decodeURIComponent(results[1].replace(/\+/g," "))}
6
+ String.prototype.addQueryVar=function(name,value){var url=this;if(name.match(/\[/)){url+=url.match(/\?/)?'&':'?';url+=name+'='+value}else{if((url.indexOf('&'+name+'=')!=-1)||(url.indexOf('?'+name+'=')!=-1)){url=url.replace(new RegExp(name+"=([^&#]*)",'g'),name+'='+value)}else{url+=url.match(/\?/)?'&':'?';url+=name+'='+value}}
7
+ return url}
8
+ String.prototype.removeQueryVar=function(name){var url=this;name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regex=new RegExp("[\\?&]"+name+"([\[][^=]*)?=([^&#]*)",'g');url=url.replace(regex,'');return url}
9
+ LearnPress.MessageBox={$block:null,$window:null,events:{},instances:[],instance:null,show:function(message,args){$.proxy(function(){args=$.extend({title:'',buttons:'',events:!1,autohide:!1,message:message,data:!1,id:LearnPress.uniqueId(),onHide:null},args||{});this.instances.push(args)
10
+ this.instance=args;var $doc=$(document),$body=$(document.body);if(!this.$block){this.$block=$('<div id="learn-press-message-box-block"></div>').appendTo($body)}
11
+ if(!this.$window){this.$window=$('<div id="learn-press-message-box-window"><div id="message-box-wrap"></div> </div>').insertAfter(this.$block);this.$window.click(function(){})}
12
+ this._createWindow(message,args.title,args.buttons);this.$block.show();this.$window.show().attr('instance',args.id);$(window).bind('resize.message-box',$.proxy(this.update,this)).bind('scroll.message-box',$.proxy(this.update,this));this.update(!0);if(args.autohide){setTimeout(function(){LearnPress.MessageBox.hide();$.isFunction(args.onHide)&&args.onHide.call(LearnPress.MessageBox,args)},args.autohide)}},this)()},blockUI:function(message){message=(message!==!1?(message?message:'Wait a moment'):'')+'<div class="message-box-animation"></div>';this.show(message)},hide:function(delay,instance){if(instance){this._removeInstance(instance.id)}else{this._removeInstance(this.instance.id)}
13
+ if(this.instances.length==0){if(this.$block){this.$block.hide()}
14
+ if(this.$window){this.$window.hide()}
15
+ $(window).unbind('resize.message-box',this.update).unbind('scroll.message-box',this.update)}else{this._createWindow(this.instance.message,this.instance.title,this.instance.buttons)}},update:function(force){var that=this,$wrap=this.$window.find('#message-box-wrap'),timer=$wrap.data('timer'),_update=function(){LearnPress.Hook.doAction('learn_press_message_box_before_resize',that);var $content=$wrap.find('.message-box-content').css("height","").css('overflow','hidden'),width=$wrap.outerWidth(),height=$wrap.outerHeight(),contentHeight=$content.height(),windowHeight=$(window).height(),top=$wrap.offset().top;if(contentHeight>windowHeight-50){$content.css({height:windowHeight-50});height=$wrap.outerHeight()}else{$content.css("height","").css('overflow','')}
16
+ $wrap.css({marginTop:($(window).height()-height)/2});LearnPress.Hook.doAction('learn_press_message_box_resize',height,that)};if(force)_update();timer&&clearTimeout(timer);timer=setTimeout(_update,250)},_removeInstance:function(id){for(var i=0;i<this.instances.length;i++){if(this.instances[i].id==id){this.instances.splice(i,1);var len=this.instances.length;if(len){this.instance=this.instances[len-1];this.$window.attr('instance',this.instance.id)}else{this.instance=!1;this.$window.removeAttr('instance')}
17
+ break}}},_getInstance:function(id){for(var i=0;i<this.instances.length;i++){if(this.instances[i].id==id){return this.instances[i];break}}},_createWindow:function(message,title,buttons){var $wrap=this.$window.find('#message-box-wrap').html('');if(title){$wrap.append('<h3 class="message-box-title">'+title+'</h3>')}
18
+ $wrap.append($('<div class="message-box-content"></div>').html(message));if(buttons){var $buttons=$('<div class="message-box-buttons"></div>');switch(buttons){case 'yesNo':$buttons.append(this._createButton('Yes','yes'));$buttons.append(this._createButton('No','no'));break;case 'okCancel':$buttons.append(this._createButton('Ok','ok'));$buttons.append(this._createButton('Cancel','cancel'));break;default:$buttons.append(this._createButton('Ok','ok'))}
19
+ $wrap.append($buttons)}},_createButton:function(title,type){var $button=$('<button type="button" class="button message-box-button message-box-button-'+type+'">'+title+'</button>'),callback='on'+(type.substr(0,1).toUpperCase()+type.substr(1));$button.data('callback',callback).click(function(){var instance=$(this).data('instance'),callback=instance.events[$(this).data('callback')];if($.type(callback)=='function'){if(callback.apply(LearnPress.MessageBox,[instance])===!1){return}else{LearnPress.MessageBox.hide(null,instance)}}else{LearnPress.MessageBox.hide(null,instance)}}).data('instance',this.instance);return $button}}
20
+ LearnPress.Hook={hooks:{action:{},filter:{}},addAction:function(action,callable,priority,tag){this.addHook('action',action,callable,priority,tag);return this},addFilter:function(action,callable,priority,tag){this.addHook('filter',action,callable,priority,tag);return this},doAction:function(action){this.doHook('action',action,arguments);return this},applyFilters:function(action){return this.doHook('filter',action,arguments)},removeAction:function(action,tag){this.removeHook('action',action,tag);return this},removeFilter:function(action,priority,tag){this.removeHook('filter',action,priority,tag);return this},addHook:function(hookType,action,callable,priority,tag){if(undefined==this.hooks[hookType][action]){this.hooks[hookType][action]=[]}
21
+ var hooks=this.hooks[hookType][action];if(undefined==tag){tag=action+'_'+hooks.length}
22
+ this.hooks[hookType][action].push({tag:tag,callable:callable,priority:priority});return this},doHook:function(hookType,action,args){args=Array.prototype.slice.call(args,1);if(undefined!=this.hooks[hookType][action]){var hooks=this.hooks[hookType][action],hook;hooks.sort(function(a,b){return a.priority-b.priority});for(var i=0;i<hooks.length;i++){hook=hooks[i].callable;if(typeof hook!='function')
23
+ hook=window[hook];if('action'==hookType){hook.apply(null,args)}else{args[0]=hook.apply(null,args)}}}
24
+ if('filter'==hookType){return args[0]}
25
+ return this},removeHook:function(hookType,action,priority,tag){if(undefined!=this.hooks[hookType][action]){var hooks=this.hooks[hookType][action];for(var i=hooks.length-1;i>=0;i--){if((undefined==tag||tag==hooks[i].tag)&&(undefined==priority||priority==hooks[i].priority)){hooks.splice(i,1)}}}
26
+ return this}};LearnPress=$.extend({setUrl:function(url,title){history.pushState({},title,url)},getUrl:function(){return window.location.href},addQueryVar:function(name,value,url){return(url==undefined?window.location.href:url).addQueryVar(name,value)},removeQueryVar:function(name,url){return(url==undefined?window.location.href:url).removeQueryVar(name)},reload:function(url){if(!url){url=window.location.href}
27
+ window.location.href=url},parseJSON:function(data){var m=data.match(/<!-- LP_AJAX_START -->(.*)<!-- LP_AJAX_END -->/);try{if(m){data=$.parseJSON(m[1])}else{data=$.parseJSON(data)}}catch(e){LearnPress.log(e);data={}}
28
+ return data},funcArgs2Array:function(args){var arr=[];for(var i=0;i<args.length;i++){arr.push(args[i])}
29
+ return arr},addFilter:function(action,callback){var $doc=$(document),event='LearnPress.'+action;$doc.on(event,callback);LearnPress.log($doc.data('events'));return this},applyFilters:function(){var $doc=$(document),action=arguments[0],args=this.funcArgs2Array(arguments);if($doc.hasEvent(action)){args[0]='LearnPress.'+action;return $doc.triggerHandler.apply($doc,args)}
30
+ return args[1]},addAction:function(action,callback){return this.addFilter(action,callback)},doAction:function(){var $doc=$(document),action=arguments[0],args=this.funcArgs2Array(arguments);if($doc.hasEvent(action)){args[0]='LearnPress.'+action;$doc.trigger.apply($doc,args)}},toElement:function(element,args){if($(element).length==0){return}
31
+ args=$.extend({delay:300,duration:'slow',offset:50},args||{});$('body, html').fadeIn(10).delay(args.delay).animate({scrollTop:$(element).offset().top-args.offset},args.duration)},uniqueId:function(prefix,more_entropy){if(typeof prefix==='undefined'){prefix=''}
32
+ var retId;var formatSeed=function(seed,reqWidth){seed=parseInt(seed,10).toString(16);if(reqWidth<seed.length){return seed.slice(seed.length-reqWidth)}
33
+ if(reqWidth>seed.length){return Array(1+(reqWidth-seed.length)).join('0')+seed}
34
+ return seed};if(!this.php_js){this.php_js={}}
35
+ if(!this.php_js.uniqidSeed){this.php_js.uniqidSeed=Math.floor(Math.random()*0x75bcd15)}
36
+ this.php_js.uniqidSeed++;retId=prefix;retId+=formatSeed(parseInt(new Date().getTime()/1000,10),8);retId+=formatSeed(this.php_js.uniqidSeed,5);if(more_entropy){retId+=(Math.random()*10).toFixed(8).toString()}
37
+ return retId},log:function(){if(typeof LEARN_PRESS_DEBUG!='undefined'&&LEARN_PRESS_DEBUG&&console){for(var i=0,n=arguments.length;i<n;i++){console.log(arguments[i])}}},template:_.memoize(function(id,data){var compiled,options={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:'data'};var tmpl=function(data){compiled=compiled||_.template($('#'+id).html(),null,options);return compiled(data)};return data?tmpl(data):tmpl},function(a,b){return JSON.stringify(b)})},LearnPress);$.fn.findNext=function(selector){var $selector=$(selector),$root=this.first(),index=$selector.index($root),$next=$selector.eq(index+1);return $next.length?$next:!1}
38
+ $.fn.findPrev=function(selector){var $selector=$(selector),$root=this.first(),index=$selector.index($root),$prev=$selector.eq(index-1);return $prev.length?$prev:!1}})(jQuery)
assets/js/jquery.block-ui.js DELETED
@@ -1,26 +0,0 @@
1
- ;
2
- (function ($) {
3
- $.fn.block_ui = function (args) {
4
- var position = $(this).css("position");
5
- args = $.extend({
6
- position: 'absolute',
7
- top : 0,
8
- left : 0,
9
- right : 0,
10
- bottom : 0,
11
- zIndex : 1000
12
- }, args || {});
13
- $(this).attr("data-position", position);
14
-
15
- //.css("position", "relative");
16
- var $block = $('<div class="block-ui" />').css(args).appendTo($(this));
17
- }
18
-
19
- $.fn.unblock_ui = function () {
20
- var $block = $('.block-ui', this).fadeOut(function () {
21
- $(this).remove();
22
- });
23
- var position = $(this).data("position", position);
24
- $(this).css("position", position);
25
- }
26
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/jquery.caret.js ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function($) {
2
+ $.fn.caret = function(pos) {
3
+ var target = this[0];
4
+ var isContentEditable = target.contentEditable === 'true';
5
+ //get
6
+ if (arguments.length == 0) {
7
+ //HTML5
8
+ if (window.getSelection) {
9
+ //contenteditable
10
+ if (isContentEditable) {
11
+ target.focus();
12
+ var range1 = window.getSelection().getRangeAt(0),
13
+ range2 = range1.cloneRange();
14
+ range2.selectNodeContents(target);
15
+ range2.setEnd(range1.endContainer, range1.endOffset);
16
+ return range2.toString().length;
17
+ }
18
+ //textarea
19
+ return target.selectionStart;
20
+ }
21
+ //IE<9
22
+ if (document.selection) {
23
+ target.focus();
24
+ //contenteditable
25
+ if (isContentEditable) {
26
+ var range1 = document.selection.createRange(),
27
+ range2 = document.body.createTextRange();
28
+ range2.moveToElementText(target);
29
+ range2.setEndPoint('EndToEnd', range1);
30
+ return range2.text.length;
31
+ }
32
+ //textarea
33
+ var pos = 0,
34
+ range = target.createTextRange(),
35
+ range2 = document.selection.createRange().duplicate(),
36
+ bookmark = range2.getBookmark();
37
+ range.moveToBookmark(bookmark);
38
+ while (range.moveStart('character', -1) !== 0) pos++;
39
+ return pos;
40
+ }
41
+ // Addition for jsdom support
42
+ if (target.selectionStart)
43
+ return target.selectionStart;
44
+ //not supported
45
+ return 0;
46
+ }
47
+ //set
48
+ if (pos == -1)
49
+ pos = this[isContentEditable? 'text' : 'val']().length;
50
+ //HTML5
51
+ if (window.getSelection) {
52
+ //contenteditable
53
+ if (isContentEditable) {
54
+ target.focus();
55
+ window.getSelection().collapse(target.firstChild, pos);
56
+ }
57
+ //textarea
58
+ else
59
+ target.setSelectionRange(pos, pos);
60
+ }
61
+ //IE<9
62
+ else if (document.body.createTextRange) {
63
+ if (isContentEditable) {
64
+ var range = document.body.createTextRange();
65
+ range.moveToElementText(target);
66
+ range.moveStart('character', pos);
67
+ range.collapse(true);
68
+ range.select();
69
+ } else {
70
+ var range = target.createTextRange();
71
+ range.move('character', pos);
72
+ range.select();
73
+ }
74
+ }
75
+ if (!isContentEditable)
76
+ target.focus();
77
+ return this;
78
+ }
79
+ })(jQuery);
assets/js/learnpress-admin.js DELETED
@@ -1,655 +0,0 @@
1
- /**
2
- * Created by foobla on 3/10/2015.
3
- */
4
-
5
- if( typeof LearnPress == 'undefined' ) LearnPress = {};
6
-
7
- jQuery(document).ready(function ($) {
8
- $('.meta_box_edit').click(function (event) {
9
- event.preventDefault();
10
- console.log("haha");
11
- var post_id = jQuery(this).closest('select').val();
12
- var edit_link = jQuery('.meta_box_course_lesson_quiz').attr('site_url');
13
- edit_link += "wp-admin/post.php?post=" + post_id + "&action=edit";
14
- var new_window = window.open(edit_link);
15
- console.log(post_id);
16
- })
17
- });
18
-
19
- jQuery(document).ready(function ($) {
20
-
21
- $("[name='lpr_settings[payment][method]']").click(function () {
22
- $(".payments").css("display", "none");
23
- var check = $(this).val();
24
- $("[id*=" + check + "]").css("display", "");
25
- });
26
- $(".payments").css("display", "none");
27
- var check = $("[name='lpr_settings[payment][method]']:checked").val();
28
- $("[id*=" + check + "]").css("display", "");
29
- });
30
-
31
- jQuery(document).ready(function ($) {
32
- var input = $('#_lpr_course_price');
33
- var input2 = $('#_lpr_course_suggestion_price');
34
- $('[name=_lpr_course_payment]').change(function () {
35
- if ($('[value=free]').is(':checked')) {
36
- input.prop('disabled', true);
37
- input2.prop('disabled', true);
38
- } else {
39
- input.prop('disabled', false);
40
- input2.prop('disabled', false);
41
- }
42
- });
43
- });
44
-
45
- jQuery(document).ready(function ($) {
46
- $('#wp-admin-bar-be_teacher').click(function () {
47
- $.ajax({
48
- url : ajaxurl,
49
- data : {
50
- action: 'learnpress_be_teacher'
51
- },
52
- success: function () {
53
- alert('You Are An Instructor Now');
54
- setTimeout(function () {
55
- location.reload();
56
- }, 500);
57
- }
58
- })
59
- });
60
- });
61
-
62
- jQuery(document).ready(function ($) {
63
- $('.lpr-set-up').click(function (evt) {
64
- evt.preventDefault();
65
- var $link = $(this);
66
- $.ajax({
67
- url : ajaxurl,
68
- data : {
69
- action: 'learnpress_ignore_setting_up'
70
- },
71
- success: function () {
72
- if( $link.attr('href') ){
73
- window.location.href = $link.attr('href');
74
- }else {
75
- $('#lpr-setting-up').remove();
76
- }
77
- }
78
- })
79
- });
80
- });
81
-
82
- jQuery(document).ready(function ($){
83
- var input = $('#_lpr_course_condition');
84
- $('[name=_lpr_course_final]').change(function (){
85
- if($('[value=yes]').is(':checked')){
86
- input.prop('disabled', false);
87
- } else {
88
- input.prop('disabled', true);
89
- }
90
- })
91
- });
92
-
93
- jQuery(document).ready(function($){
94
- $('#lpr-custom-time').submit(function(){
95
- $.ajax({
96
- url: ajaxurl,
97
- data: $(this).serialize(),
98
- success:function(response){
99
- drawStudentsChart(response, config)
100
- },
101
- type: 'POST',
102
- dataType: 'json'
103
- })
104
- return false;
105
- })
106
-
107
- // admin notice install sample data
108
- $(document).on('click', '#learn-press-install-sample-data-notice a', function(e){
109
- e.preventDefault();
110
- var yes = $(this).hasClass('yes') ? true : false;
111
- if( yes ){
112
- $(document.body).block_ui({
113
- position: 'fixed',
114
- zIndex: 999999,
115
- backgroundImage: 'url(' + LearnPress_Settings.plugin_url + '/assets/images/spinner.gif)',
116
- backgroundRepeat: 'no-repeat',
117
- backgroundPosition: 'center'
118
- });
119
- }
120
- $.ajax({
121
- url: ajaxurl,
122
- dataType: 'html',
123
- type: 'post',
124
- data:{
125
- action: 'learnpress_install_sample_data',
126
- yes: yes
127
- },
128
- success: function(response){
129
- response = LearnPress.parse_json(response);
130
- if( response.hide_notice ){
131
- $('#learn-press-install-sample-data-notice').fadeOut();
132
- }else{
133
- if( response.error ){
134
- alert(response.error)
135
- }else if(response.success){
136
- alert( response.success );
137
- if( response.redirect )
138
- window.location.href = response.redirect;
139
- }
140
- $(document.body).unblock_ui()
141
- }
142
- }
143
- })
144
- });
145
-
146
- var $checked = null;
147
- $checked = $('input[name="_lpr_course_enrolled_require"]').bind('click change', function () {
148
-
149
- var payment_field = $('.lpr-course-payment-field').toggleClass('hide-if-js', !( $(this).val() != 'no' ));
150
- if (payment_field.is(':visible')) {
151
- $('input[name="_lpr_course_payment"]:checked', payment_field).trigger('change')
152
- } else {
153
- $('.lpr-course-price-field').addClass('hide-if-js');
154
- }
155
-
156
- });
157
- $checked.filter(':checked').trigger('change');
158
- if ($checked.length == 0) {
159
- $('input[name="_lpr_course_enrolled_require"][value="yes"]').trigger('click');
160
- }
161
-
162
- $('input[name="_lpr_course_payment"]').bind('click change', function () {
163
- $('.lpr-course-price-field').toggleClass('hide-if-js', !( $(this).val() != 'free' ) || ( $('input[name="_lpr_course_enrolled_require"]:checked').val() == 'no' ));
164
- }).filter(':checked').trigger('change');
165
-
166
- $checked.closest('.rwmb-field').removeClass('hide-if-js');
167
-
168
- });
169
-
170
- //javascript hook functions
171
- var lprHook = {
172
- hooks : {action: {}, filter: {}},
173
- addAction : function (action, callable, priority, tag) {
174
- lprHook.addHook('action', action, callable, priority, tag);
175
- },
176
- addFilter : function (action, callable, priority, tag) {
177
- lprHook.addHook('filter', action, callable, priority, tag);
178
- },
179
- doAction : function (action) {
180
- lprHook.doHook('action', action, arguments);
181
- },
182
- applyFilters: function (action) {
183
- return lprHook.doHook('filter', action, arguments);
184
- },
185
- removeAction: function (action, tag) {
186
- lprHook.removeHook('action', action, tag);
187
- },
188
- removeFilter: function (action, priority, tag) {
189
- lprHook.removeHook('filter', action, priority, tag);
190
- },
191
- addHook : function (hookType, action, callable, priority, tag) {
192
- if (undefined == lprHook.hooks[hookType][action]) {
193
- lprHook.hooks[hookType][action] = [];
194
- }
195
- var hooks = lprHook.hooks[hookType][action];
196
- if (undefined == tag) {
197
- tag = action + '_' + hooks.length;
198
- }
199
- lprHook.hooks[hookType][action].push({tag: tag, callable: callable, priority: priority});
200
- },
201
- doHook : function (hookType, action, args) {
202
-
203
- // splice args from object into array and remove first index which is the hook name
204
- args = Array.prototype.slice.call(args, 1);
205
-
206
- if (undefined != lprHook.hooks[hookType][action]) {
207
- var hooks = lprHook.hooks[hookType][action], hook;
208
- //sort by priority
209
- hooks.sort(function (a, b) {
210
- return a["priority"] - b["priority"]
211
- });
212
- for (var i = 0; i < hooks.length; i++) {
213
- hook = hooks[i].callable;
214
- if (typeof hook != 'function')
215
- hook = window[hook];
216
- if ('action' == hookType) {
217
- hook.apply(null, args);
218
- } else {
219
- args[0] = hook.apply(null, args);
220
- }
221
- }
222
- }
223
- if ('filter' == hookType) {
224
- return args[0];
225
- }
226
- },
227
- removeHook : function (hookType, action, priority, tag) {
228
- if (undefined != lprHook.hooks[hookType][action]) {
229
- var hooks = lprHook.hooks[hookType][action];
230
- for (var i = hooks.length - 1; i >= 0; i--) {
231
- if ((undefined == tag || tag == hooks[i].tag) && (undefined == priority || priority == hooks[i].priority)) {
232
- hooks.splice(i, 1);
233
- }
234
- }
235
- }
236
- }
237
- };
238
- //end of javascript hook functions
239
- /*
240
- function _lprAdminQuestionHTML($dom, type) {
241
- switch (type) {
242
- case 'true_or_false':
243
- $dom.lprTrueOrFalseQuestion();
244
- break;
245
- case 'multi_choice':
246
- $dom.lprMultiChoiceQuestion();
247
- break;
248
- case 'single_choice':
249
- $dom.lprSingleChoiceQuestion();
250
- break;
251
- }
252
- }*/
253
- //lprHook.addAction('lpr_admin_question_html', _lprAdminQuestionHTML);
254
- //lprHook.addAction('lpr_admin_quiz_question_html', _lprAdminQuestionHTML);
255
-
256
- ;
257
- (function ($) {
258
- var $doc = $(document),
259
- $body = $(document.body);
260
- $.fn.scrollTo = function(options){
261
- return this.each(function(){
262
- options = $.extend({
263
- delay: 0,
264
- offset: 0,
265
- speed: 'slow'
266
- }, options || {});
267
-
268
- $('body')
269
- .fadeIn( 0 )
270
- .delay( options.delay )
271
- .animate({
272
- scrollTop: $(this).offset().top - options.offset
273
- }, options.speed);
274
-
275
- return this;
276
- })
277
- }
278
-
279
-
280
- $.lprShowBlock = function ($form) {
281
- var $block = $("#lpr-block");
282
-
283
- if (!$block.get(0)) {
284
- $block = $('<div id="lpr-block" />').appendTo($body).hide();
285
- $block.click($.lprHideBlock);
286
-
287
-
288
- }
289
- $block.show().data('form', $form);
290
-
291
- return $block;
292
- }
293
- $.lprHideBlock = function () {
294
- var $block = $("#lpr-block");
295
- if (!$block.get(0)) return;
296
- $block.hide();
297
- if ($block.data('form')) $block.data('form').hide();
298
- $block.data('form', 0);
299
- return $block;
300
- }
301
-
302
- $.fn.lprFancyCheckbox = function (options) {
303
- var defaults = {
304
- newElementClass : 'tog',
305
- activeElementClass: 'on'
306
- };
307
- var options = $.extend(defaults, options);
308
- this.each(function () {
309
- //Assign the current checkbox to obj
310
- var obj = $(this);
311
- //Create new span element to be styled
312
- var newObj = $('<div/>', {
313
- 'id' : obj.attr('id'),
314
- 'class': 'lpr-fancy-checkbox ' + options.newElementClass
315
- }).insertAfter(this).data('input', this);
316
- //Make sure pre-checked boxes are rendered as checked
317
- if (obj.is(':checked')) {
318
- newObj.addClass(options.activeElementClass);
319
- }
320
- obj.hide(); //Hide original checkbox
321
- //Labels can be painful, let's fix that
322
- if ($('[for=' + obj.attr('id') + ']').length) {
323
-
324
- var label = $('[for=' + obj.attr('id') + ']');
325
- label.click(function () {
326
- newObj.trigger('click'); //Force the label to fire our element
327
- return false;
328
- });
329
- }
330
- //Attach a click handler
331
- newObj.click(function () {
332
- //Assign current clicked object
333
- var obj = $(this);
334
- //Check the current state of the checkbox
335
- if (obj.hasClass(options.activeElementClass)) {
336
- obj.removeClass(options.activeElementClass);
337
- $(obj.data('input')).attr('checked', false).trigger('change');
338
- } else {
339
- obj.addClass(options.activeElementClass);
340
- $(obj.data('input')).attr('checked', true).trigger('change');
341
- }
342
- //Kill the click function
343
- return false;
344
- });
345
- });
346
- }
347
-
348
- $doc.ready(function () {
349
- $body = $(document.body);
350
-
351
- $('input.lpr-fancy-checkbox')
352
- .on('change', function () {
353
- var $chk = $(this),
354
- state = $(this).data('state'),
355
- checked = $(this).is(':checked');
356
- $.ajax({
357
- url: ajaxurl,
358
- data: {
359
- url: $chk.attr('data-url'),
360
- plugin: $chk.attr('data-plugin'),
361
- t: checked ? 'activate' : 'deactivate',
362
- action: 'learnpress_update_add_on_status'
363
- },
364
- success: function(response){
365
-
366
- $chk.attr('data-url', response.url)
367
- .attr('state', response.status)
368
-
369
- }
370
- })
371
- })
372
- .lprFancyCheckbox();
373
- $('#learn-press-add-ons-wrap').on('click', '.plugin-action-buttons a', function(evt){
374
- evt.preventDefault();
375
- var $link = $(this), action = $link.data('action');
376
- if( ! action ) return;
377
- $link.addClass('disabled spinner');
378
- $.ajax({
379
- url: $link.attr('href'),
380
- dataType: 'html',
381
- success: function(response){
382
- if(action == 'install-now' || action == 'update-now' || action == 'active-now'){
383
- if( $link.hasClass('thimpress') ){
384
- response = LearnPress.parse_json( response );
385
- $link.removeClass( 'spinner' );
386
- if( response.status == 'activate' ){
387
- $link.addClass('disabled').html(response.status_text).removeAttr('href').removeAttr('data-action');
388
- $('.addon-status', $link.closest('.action-links')).html(response.status_text).addClass('enabled');
389
- }else{
390
- $link.removeClass('disabled');
391
- }
392
- }
393
- }
394
- }
395
- })
396
- });
397
-
398
- $('#learn-press-bundle-activate-add-ons').click(function(){
399
- var $button = $(this);
400
- $button.addClass('spinner').attr('disabled', 'disabled');
401
- $.ajax({
402
- url: ajaxurl,
403
- data: {
404
- action: 'learnpress_bundle_activate_add_ons'
405
- },
406
- dataType: 'html',
407
- success: function(response){
408
- response = LearnPress.parse_json( response );
409
- if( response.addons ){
410
- for(var slug in response.addons ){
411
- var plugin = response.addons[slug];
412
- if( 'activate' == plugin.status ){
413
- $('.plugin-card-'+slug).find('.install-now.thimpress, .active-now.thimpress').addClass('disabled').attr('href', '').html(plugin.status_text);
414
- }else{
415
-
416
- }
417
- }
418
- }
419
- $button.removeClass('spinner').removeAttr('disabled');
420
- }
421
- })
422
- });
423
- (function() {
424
- var boxes = $('.post-type-lpr_quiz, .post-type-lpr_course, .post-type-lpr_lesson, .post-type-lpr_question').find('#postbox-container-1');
425
- if( !boxes.length ) return;
426
- var $win = $(window),
427
- $container = $('#poststuff'),
428
- currentOffset = 0;
429
- $(window).scroll(function () {
430
- var container_height = $container.height(),
431
- dir = $win.scrollTop() > currentOffset ? 'down' : 'up';
432
- currentOffset = $win.scrollTop();
433
-
434
- boxes.each(function(){
435
- var $box = $(this),
436
- box_height = $box.height(),
437
- container_height = $container.height(),
438
- max_scroll = container_height - box_height - 10,
439
- scroll_top = $win.scrollTop(),
440
- offset = ( scroll_top - $container.offset().top - $box.height() ) + $win.height();
441
- if( max_scroll <= 0 ) return;
442
- if( box_height < $win.height() ) offset = scroll_top - $container.offset().top + 50;
443
- else{
444
- if( offset >= max_scroll ) offset = max_scroll;
445
- }
446
- $box.css("margin-top", Math.max( 0, offset ) );
447
- })
448
- })
449
- })();
450
-
451
- $('.lpr-dropdown-pages').each( function(){
452
- var $select = $(this),
453
- $form = $select.siblings('.lpr-quick-add-page-inline'),
454
- $actions = $select.siblings('.lpr-quick-actions-inline');
455
- function add_page_to_all_dropdowns( response ){
456
- var pos = $.inArray( response.page.ID.toString() + "", response.ordering );
457
- $('.lpr-dropdown-pages').each(function() {
458
- var $select = $(this),
459
- $new_option = $('<option value="'+response.page.ID+'">'+response.page.post_title+'</option>')
460
- if (pos == 0) {
461
- $('option', $select).each(function () {
462
- if (parseInt($(this).val())) {
463
- $new_option.insertBefore($(this));
464
- return false;
465
- }
466
- })
467
- } else if (pos == response.ordering.length - 1) {
468
- $select.append($new_option);
469
- } else {
470
- $new_option.insertAfter($('option[value="' + response.ordering[pos - 1] + '"]', $select));
471
- }
472
- });
473
- }
474
- $select.click(function(){
475
- $select.data('value', this.value)
476
- }).change(function(){
477
- var option = $(this).val();
478
- $actions.addClass('hide-if-js');
479
- if( option == 'add_new_page'){
480
- $form.removeClass('hide-if-js').find('input').val('').focus();
481
- $(this).attr('disabled', true);
482
- }else if( ! isNaN(option) ){
483
- $.ajax({
484
- url: ajaxurl,
485
- data: {
486
- action: 'learnpress_get_page_permalink',
487
- page_id: option
488
- },
489
- success: function(response) {
490
- if( response ) {
491
- $actions.html(response).removeClass('hide-if-js')
492
- }
493
- },
494
- dataType: 'html'
495
- })
496
- }
497
- })//.trigger('change');
498
- $form.on('keypress', 'input', function(evt){
499
- if( evt.keyCode == 13 ){
500
- evt.preventDefault();
501
- $(this).siblings('button').trigger('click');
502
- }
503
- }).on('keydown', 'input', function(evt){
504
- if( evt.keyCode == 27 ){
505
- $(this).siblings('a').trigger('click');
506
- }
507
- });
508
- $('button', $form).click(function(){
509
- var $input = $(this).siblings('input');
510
- if( ! $input.val().length ){
511
- $input.focus();
512
- return;
513
- }
514
- $form.block_ui();
515
- $.ajax(ajaxurl, {
516
- data: {
517
- action: 'learnpress_create_page',
518
- title: $input.val()
519
- },
520
- success:function( response ){
521
- if(response.page){
522
- add_page_to_all_dropdowns( response );
523
- $select.removeAttr('disabled').val(response.page.ID);
524
- $form.addClass('hide-if-js');
525
- $actions.html(response.html).removeClass('hide-if-js');
526
- }else{
527
- alert(response.error);
528
- $select.removeAttr('disabled').val( $select.data('value'));
529
- if( $select.data('value') ) $actions.removeClass('hide-if-js');
530
- }
531
- $form.unblock_ui();
532
- },
533
- dataType: 'json',
534
- type: 'post'
535
- })
536
- });
537
- $('a', $form).click(function(evt){
538
- evt.preventDefault();
539
- $(this).parent().addClass('hide-if-js');
540
- $select.removeAttr('disabled').val( $select.data('value') );
541
- if( $select.data('value') ) $actions.removeClass('hide-if-js');
542
- })
543
- })
544
-
545
- })
546
-
547
- $.extend( LearnPress, {
548
- parse_json: function(response){
549
- if( typeof reposnse == 'object' ) return response;
550
- try {
551
- var m = response.match(/<!-- LPR_AJAX_START -->(.*)<!-- LPR_AJAX_END -->/)
552
-
553
- if (m && m[1]) {
554
- response = JSON.parse(m[1])
555
- } else {
556
- response = JSON.parse(response)
557
- }
558
- }catch(e){ response = false }
559
- return response;
560
- },
561
- block_page: function(args){
562
- var block_page = $( '#lpr-page-block' );
563
- if( block_page.length == 0 ){
564
- block_page = $( wp.template( 'page-block' )()).appendTo($body);
565
- block_page.click($.proxy( function(){ this.unblock_page() }, this ));
566
- }
567
- args = $.extend( {
568
- on_close: function () {
569
-
570
- },
571
- backgroundColor: undefined,
572
- opacity: undefined
573
- }, args || {} );
574
- $.each(['backgroundColor', 'opacity'], function(){
575
- block_page.css( this, args[this] );
576
- })
577
- block_page.data('args', args).show();
578
- },
579
- unblock_page: function(args){
580
- args = $.extend( {
581
-
582
- }, args || {} );
583
- var block_page = $( '#lpr-page-block'),
584
- stored_args = block_page.data('args');
585
- block_page.hide();
586
-
587
- if( stored_args ){
588
- $.each(['backgroundColor', 'opacity'], function(){
589
- block_page.css( this, '' );
590
- });
591
- $.isFunction(stored_args.on_close) && stored_args.on_close.call(block_page);
592
- }
593
- },
594
- showLessonQuiz: function( pos, ed ){
595
- var textNode = $(ed.selection.getNode()),
596
- iframe = $('#content_ifr'),
597
- form = $('#form-quick-add-lesson-link'),
598
- offset = textNode.offset(),
599
- iframe_offset = iframe.offset(),
600
- range = ed.selection.getRng();
601
- ed.execCommand('mceInsertContent', false,'<span id="learn_press_book_mark"></span>');
602
- offset = $( '#learn_press_book_mark', textNode).position();
603
- $( '#learn_press_book_mark', textNode).remove();
604
- ed.selection.setRng(range);
605
- if( form.length == 0 ){
606
- form = $( wp.template('form-quick-add-lesson-link')()).css({zIndex: 99999}).appendTo($body);
607
- $('select', form).select2({
608
- width: 300,
609
- containerCssClass: 'lpr-container-dropdown',
610
- dropdownCssClass: 'lpr-select-dropdown'
611
- })
612
- .on('select2-close', function(){
613
- $('#form-quick-add-lesson-link').hide();
614
- tinyMCE.activeEditor.focus();
615
- })
616
- .on('select2-selecting', function(e){
617
- var lesson_id = e.val;
618
- if( !lesson_id ) return;
619
- var ed = tinymce.activeEditor,
620
- shortcode = '[quick_lesson_link id="'+lesson_id + '"]',
621
- range = ed.selection.getRng();
622
- range.startContainer.nodeValue = range.startContainer.nodeValue.replace(/@l/, '');
623
- ed.selection.setCursorLocation( range.startContainer, range.startContainer.nodeValue.length )
624
- ed.selection.setContent(shortcode)
625
- $('#form-quick-add-lesson-link').hide();
626
- });
627
- }
628
- form.css({
629
- top: iframe_offset.top + offset.top,
630
- left: iframe_offset.left + offset.left + 40
631
- }).show();
632
- $('select', form).select2('open');
633
- }
634
- });
635
-
636
- $(document).ready(function(){
637
- if( ! window.location.href.match(/http:\/\/localhost/) ) return;
638
-
639
- var post_ID = $('input#post_ID').val();
640
-
641
- if( ! post_ID ) return;
642
- var $add_new_h2 = $('body.post-type-lpr_course').find('.page-title-action, .add-new-h2'),
643
- $reset_h2 = $('<a href="" class="page-title-action add-new-h2">Reset</a>');
644
-
645
- $reset_h2
646
- .insertAfter($add_new_h2)
647
- .click(function(evt){
648
- evt.preventDefault();
649
- var link = window.location.href.replace(/reset-course-data=([0-9]+)/, '');
650
- link += '&reset-course-data=' + $('input#post_ID').val();
651
- window.location.href = link;
652
- });
653
- })
654
- })(jQuery)
655
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/learnpress-embed-button.js DELETED
@@ -1,22 +0,0 @@
1
- (function() {
2
-
3
- tinymce.PluginManager.add('embed', function( editor )
4
- {
5
- editor.addButton('embed', {
6
- type: 'button',
7
- text: 'Embed',
8
- onclick: function(event) {
9
- editor.windowManager.open({
10
- title: 'Your video embed link',
11
- body: [
12
- {type: 'textbox', name: 'link', label: 'Your video embed link'}
13
- ],
14
- onsubmit: function(e) {
15
- // Insert content when the window form is submitted
16
- editor.insertContent('[embed_video link=' + e.data.link + ']');
17
- }
18
- });
19
- }
20
- });
21
- });
22
- })();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/learnpress.js CHANGED
@@ -1,7 +1,3 @@
1
- /**
2
- * Created by GiapNV on 1/16/15.
3
- */
4
- ;
5
  if (typeof LearnPress == 'undefined') window.LearnPress = {};
6
  ;
7
  (function ($) {
@@ -29,7 +25,11 @@ if (typeof LearnPress == 'undefined') window.LearnPress = {};
29
  user_id: user_id
30
  },
31
  success : function (response) {
32
- var response = LearnPress.parse_json(response);
 
 
 
 
33
  if (response.url) {
34
  LearnPress.reload(response.url)
35
  } else {
@@ -56,26 +56,8 @@ if (typeof LearnPress == 'undefined') window.LearnPress = {};
56
  }
57
  });
58
  },
59
- finish_course : function (course_id) {
60
- $.alerts.confirm(learn_press_js_localize.confirm_finish_course, learn_press_js_localize.confirm_finish_course_title, function (confirm) {
61
- if (!confirm) {
62
- return;
63
- }
64
- $.ajax({
65
- type : "POST",
66
- url : ajaxurl,
67
- data : {
68
- action : 'learnpress_finish_course',
69
- course_id: course_id
70
- },
71
- success: function (response) {
72
- alert(response.message)
73
- if (response.finish) {
74
- LearnPress.reload();
75
- }
76
- }
77
- });
78
- })
79
  },
80
 
81
  load_lesson: function (permalink, args) {
@@ -96,7 +78,7 @@ if (typeof LearnPress == 'undefined') window.LearnPress = {};
96
  $.isFunction(args.success) && args.success.call(this, response)
97
  } else {
98
  if (!( $.isFunction(args.error) && args.error.call(this, response) )) {
99
- alert("ERROR")
100
  }
101
  }
102
  }
@@ -109,13 +91,9 @@ if (typeof LearnPress == 'undefined') window.LearnPress = {};
109
 
110
  function complete_lesson(event) {
111
  event.preventDefault();
112
- var lesson = $(this).data('id');
113
- $.alerts.confirm(learn_press_js_localize.confirm_complete_lesson, learn_press_js_localize.confirm_complete_lesson_title, function (confirm) {
114
- if (!confirm) {
115
- return
116
- }
117
- LearnPress.complete_lesson(lesson);
118
- })
119
  }
120
 
121
  function finish_course() {
@@ -125,17 +103,14 @@ if (typeof LearnPress == 'undefined') window.LearnPress = {};
125
  }
126
 
127
  function retake_course() {
 
128
  var $button = $(this),
129
  course_id = $button.data('id');
130
- $.alerts.confirm(learn_press_js_localize.confirm_retake_course, learn_press_js_localize.confirm_retake_course_title, function (confirm) {
131
- if (!confirm) {
132
- return;
133
- }
134
- LearnPress.retake_course(course_id);
135
- });
136
  }
137
 
138
  function load_lesson(evt) {
 
139
  evt.preventDefault();
140
  var $link = $(this),
141
  $parent = $link.parent(),
@@ -162,13 +137,13 @@ if (typeof LearnPress == 'undefined') window.LearnPress = {};
162
  }
163
 
164
  function _ready() {
165
- $doc
166
  .on('click', '.complete-lesson-button', complete_lesson)
167
  .on('click', '#finish-course', finish_course)
168
  .on('click', '#learn_press_retake_course', retake_course)
169
  .on('click', '.course-content-lesson-nav a', load_lesson)
170
  .on('click', '.section-content .course-lesson a', load_lesson);
171
-
172
  $('.lesson-quiz-icon', '.section-content').each(function () {
173
  var $target = $(this), $parent = $target.closest('li');
174
  $target.tipsy({
@@ -195,6 +170,44 @@ if (typeof LearnPress == 'undefined') window.LearnPress = {};
195
 
196
  })(jQuery);
197
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
198
  jQuery(document).ready(function ($) {
199
  $('.quiz-curriculum').click(function (event) {
200
  event.preventDefault();
@@ -265,7 +278,7 @@ jQuery(document).ready(function ($) {
265
  lesson_id: $(this).attr('lesson-id')
266
  },
267
  success: function (html) {
268
- console.log($url);
269
  history.pushState({}, '', $url);
270
  $('.course-content').html($('.course-content', html).html());
271
  $('html, body').animate({scrollTop: $('.course-content').offset().top}, 'slow');
@@ -279,6 +292,34 @@ jQuery(document).ready(function ($) {
279
  });
280
  });
281
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
282
 
283
  jQuery(document).ready(function ($) {
284
  $('#lpr-join-event').click(function (event) {
@@ -411,7 +452,7 @@ jQuery(document).ready(function ($) {
411
  event.preventDefault();
412
  var $this = $(this);
413
  var $certi_link = $this.attr("certi_link");
414
- console.log($certi_link);
415
  $.ajax({
416
  type : "POST",
417
  url : ajaxurl,
@@ -420,7 +461,7 @@ jQuery(document).ready(function ($) {
420
  course_id: $this.attr('course-id')
421
  },
422
  success: function (html) {
423
- console.log(html);
424
  if (html == 'success') {
425
  if ($certi_link) {
426
  window.location.replace($certi_link);
@@ -479,12 +520,11 @@ jQuery(document).ready(function ($) {
479
  $.ajax({
480
  url : ajaxurl,
481
  type : 'POST',
482
- dataType: 'text',
483
  data : $payment_form.serialize(),
484
  success : function (res) {
485
- var matches = res.match(/<!-- LPR_AJAX_START -->(.*)<!-- LPR_AJAX_END -->/),
486
- message = '',
487
- redirect = '';
488
  if (matches && matches[1]) {
489
  var json = JSON.parse(matches[1]);
490
  if (json) {
@@ -494,9 +534,6 @@ jQuery(document).ready(function ($) {
494
  } else {
495
  message = json.message
496
  }
497
- if( json.redirect ){
498
- redirect = json.redirect;
499
- }
500
  } else {
501
  message = matches[1];
502
  }
@@ -506,9 +543,6 @@ jQuery(document).ready(function ($) {
506
  if (message) {
507
  alert(message);
508
  }
509
- if (redirect) {
510
- window.location.href = redirect;
511
- }
512
  button.removeAttr('disabled').html(button.data('text'))
513
  }
514
  });
@@ -533,3 +567,9 @@ jQuery(document).ready(function ($) {
533
  })
534
  });
535
  });
 
 
 
 
 
 
 
 
 
 
1
  if (typeof LearnPress == 'undefined') window.LearnPress = {};
2
  ;
3
  (function ($) {
25
  user_id: user_id
26
  },
27
  success : function (response) {
28
+ var response = LearnPress.parseJSON(response);
29
+ response = $(document).triggerHandler('learn_press_user_complete_lesson', response);
30
+ if(response.result == 'success'){
31
+ $('.course-item-' + lesson).addClass('item-completed');
32
+ }
33
  if (response.url) {
34
  LearnPress.reload(response.url)
35
  } else {
56
  }
57
  });
58
  },
59
+ finishCourse : function (course_id, callback) {
60
+ if (!confirm(confirm_finish_course.confirm_finish_course)) return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  },
62
 
63
  load_lesson: function (permalink, args) {
78
  $.isFunction(args.success) && args.success.call(this, response)
79
  } else {
80
  if (!( $.isFunction(args.error) && args.error.call(this, response) )) {
81
+ alert("UNKNOW ERROR")
82
  }
83
  }
84
  }
91
 
92
  function complete_lesson(event) {
93
  event.preventDefault();
94
+ if (!confirm(learn_press_js_localize.confirm_complete_lesson)) return;
95
+ var lesson = $(this).attr('data-id');
96
+ LearnPress.complete_lesson(lesson);
 
 
 
 
97
  }
98
 
99
  function finish_course() {
103
  }
104
 
105
  function retake_course() {
106
+ if (!confirm(learn_press_js_localize.confirm_retake_course)) return;
107
  var $button = $(this),
108
  course_id = $button.data('id');
109
+ LearnPress.retake_course(course_id);
 
 
 
 
 
110
  }
111
 
112
  function load_lesson(evt) {
113
+ return;
114
  evt.preventDefault();
115
  var $link = $(this),
116
  $parent = $link.parent(),
137
  }
138
 
139
  function _ready() {
140
+ /*$doc
141
  .on('click', '.complete-lesson-button', complete_lesson)
142
  .on('click', '#finish-course', finish_course)
143
  .on('click', '#learn_press_retake_course', retake_course)
144
  .on('click', '.course-content-lesson-nav a', load_lesson)
145
  .on('click', '.section-content .course-lesson a', load_lesson);
146
+ */
147
  $('.lesson-quiz-icon', '.section-content').each(function () {
148
  var $target = $(this), $parent = $target.closest('li');
149
  $target.tipsy({
170
 
171
  })(jQuery);
172
 
173
+ ;
174
+ jQuery(document).ready(function ($) {
175
+ $('#clear_previous_submissions').click(function (event) {
176
+ event.preventDefault();
177
+ var $this = $(this);
178
+ var defaulttxt = $this.html();
179
+ $this.prepend('<i class="fa fa-spinner fa-spin">&nbsp;</i>');
180
+
181
+ $.ajax({
182
+ type : "POST",
183
+ url : ajaxurl,
184
+ data : {
185
+ action : 'clear_previous_submissions',
186
+ id : $this.attr('data-id'),
187
+ security: $this.attr('data-security')
188
+ },
189
+ cache : false,
190
+ success: function (html) {
191
+ $this.find('i').remove();
192
+ $this.html(html);
193
+ setTimeout(function () {
194
+ location.reload();
195
+ }, 3000);
196
+ }
197
+ });
198
+
199
+ });
200
+
201
+ $.ajaxSetup({cache: false});
202
+ $("#btn_roll").click(function () {
203
+ event.preventDefault();
204
+ var post_link = $(this).attr("rel");
205
+ $("#course_main").html("loading...");
206
+ $("#course_main").load(post_link);
207
+ return false;
208
+ });
209
+ });
210
+
211
  jQuery(document).ready(function ($) {
212
  $('.quiz-curriculum').click(function (event) {
213
  event.preventDefault();
278
  lesson_id: $(this).attr('lesson-id')
279
  },
280
  success: function (html) {
281
+ LearnPress.log($url);
282
  history.pushState({}, '', $url);
283
  $('.course-content').html($('.course-content', html).html());
284
  $('html, body').animate({scrollTop: $('.course-content').offset().top}, 'slow');
292
  });
293
  });
294
 
295
+ jQuery(document).ready(function ($) {
296
+ $('.button-finish-quiz').click(function ($event) {
297
+ return;
298
+ $event.preventDefault();
299
+ var $temp = jQuery(".question-form").serializeArray();
300
+ var $question_answer = 1;
301
+ if (0 < $temp.length) {
302
+ $question_answer = $temp[0].value;
303
+ }
304
+ var $question_id = jQuery('.quiz-questions').find('li.current a').attr('question-id');
305
+
306
+ $.ajax({
307
+ type : "POST",
308
+ url : ajaxurl,
309
+ data : {
310
+ action : 'learnpress_finish_quiz',
311
+ course_id : $('.quiz-main').attr('course-id'),
312
+ quiz_id : $(this).attr('quiz-id'),
313
+ question_id : $question_id,
314
+ question_answer: $question_answer
315
+ },
316
+ success: function (html) {
317
+ LearnPress.log(html);
318
+ location.reload(true);
319
+ }
320
+ })
321
+ })
322
+ });
323
 
324
  jQuery(document).ready(function ($) {
325
  $('#lpr-join-event').click(function (event) {
452
  event.preventDefault();
453
  var $this = $(this);
454
  var $certi_link = $this.attr("certi_link");
455
+ LearnPress.log($certi_link);
456
  $.ajax({
457
  type : "POST",
458
  url : ajaxurl,
461
  course_id: $this.attr('course-id')
462
  },
463
  success: function (html) {
464
+ LearnPress.log(html);
465
  if (html == 'success') {
466
  if ($certi_link) {
467
  window.location.replace($certi_link);
520
  $.ajax({
521
  url : ajaxurl,
522
  type : 'POST',
523
+ dataType: 'html',
524
  data : $payment_form.serialize(),
525
  success : function (res) {
526
+ var matches = res.match(/<!-- LP_AJAX_START -->(.*)<!-- LP_AJAX_END -->/),
527
+ message = '';
 
528
  if (matches && matches[1]) {
529
  var json = JSON.parse(matches[1]);
530
  if (json) {
534
  } else {
535
  message = json.message
536
  }
 
 
 
537
  } else {
538
  message = matches[1];
539
  }
543
  if (message) {
544
  alert(message);
545
  }
 
 
 
546
  button.removeAttr('disabled').html(button.data('text'))
547
  }
548
  });
567
  })
568
  });
569
  });
570
+
571
+ // jQuery(document).ready(function ($) {
572
+ // $('#question-hint').on('click', function(){
573
+ // $('.question-hint-content').fadeToggle();
574
+ // });
575
+ // });
assets/js/learnpress.min.js DELETED
@@ -1,534 +0,0 @@
1
- /**
2
- * Created by GiapNV on 1/16/15.
3
- */
4
- ;
5
- if (typeof LearnPress == 'undefined') window.LearnPress = {};
6
- ;
7
- (function ($) {
8
-
9
- $.fn.outerHTML = function () {
10
- // IE, Chrome & Safari will comply with the non-standard outerHTML, all others (FF) will have a fall-back for cloning
11
- return (!this.length) ? this : (this[0].outerHTML || (function (el) {
12
- var div = document.createElement('div');
13
- div.appendChild(el.cloneNode(true));
14
- var contents = div.innerHTML;
15
- div = null;
16
- return $(contents);
17
- })(this[0]));
18
-
19
- }
20
- $.extend(LearnPress, {
21
- complete_lesson: function (lesson, user_id) {
22
- $.ajax({
23
- type : "POST",
24
- dataType: 'html',
25
- url : ajaxurl,
26
- data : {
27
- action : 'learnpress_complete_lesson',
28
- lesson : lesson,
29
- user_id: user_id
30
- },
31
- success : function (response) {
32
- var response = LearnPress.parse_json(response);
33
- if (response.url) {
34
- LearnPress.reload(response.url)
35
- } else {
36
- LearnPress.reload();
37
- }
38
- }
39
- })
40
- },
41
- retake_course : function (course_id, user_id) {
42
- $.ajax({
43
- type : 'POST',
44
- url : '',
45
- data : {
46
- action : 'learn_press_retake_course',
47
- course_id: course_id,
48
- user_id : user_id
49
- },
50
- success: function (response) {
51
- if (response) {
52
- if (response.message) alert(response.message);
53
- if (response.redirect)
54
- LearnPress.reload(response.redirect)
55
- }
56
- }
57
- });
58
- },
59
- finish_course : function (course_id) {
60
- $.alerts.confirm(confirm_finish_course.confirm_finish_course, confirm_finish_course.confirm_finish_course_title, function(confirm){
61
- if( !confirm ){
62
- return;
63
- }
64
- $.ajax({
65
- type : "POST",
66
- url : ajaxurl,
67
- data : {
68
- action : 'learnpress_finish_course',
69
- course_id: course_id
70
- },
71
- success: function (response) {
72
- alert(response.message)
73
- if (response.finish) {
74
- LearnPress.reload();
75
- }
76
- }
77
- });
78
- })
79
- },
80
-
81
- load_lesson: function (permalink, args) {
82
- args = $.extend({
83
- success: function () {
84
- },
85
- error : function () {
86
- }
87
- }, args || {})
88
- $.ajax({
89
- url : permalink,
90
- success: function (response) {
91
- var $response = $(response),
92
- $new_lesson = $('.course-content', $response);
93
- if ($new_lesson.length) {
94
- $('.course-content').replaceWith($new_lesson);
95
- $('title').html($response.filter('title').text());
96
- $.isFunction(args.success) && args.success.call(this, response)
97
- } else {
98
- if (!( $.isFunction(args.error) && args.error.call(this, response) )) {
99
- alert("ERROR")
100
- }
101
- }
102
- }
103
- })
104
- }
105
- });
106
-
107
- var $doc = $(document),
108
- $win = $(window);
109
-
110
- function complete_lesson(event) {
111
- event.preventDefault();
112
- var lesson = $(this).data('id');
113
- $.alerts.confirm(learn_press_js_localize.confirm_complete_lesson, learn_press_js_localize.confirm_complete_lesson_title, function(confirm){
114
- if( !confirm ){
115
- return
116
- }
117
- LearnPress.complete_lesson(lesson);
118
- })
119
- }
120
-
121
- function finish_course() {
122
- var $button = $(this),
123
- course_id = $button.data('id');
124
- LearnPress.finish_course(course_id);
125
- }
126
-
127
- function retake_course() {
128
- var $button = $(this),
129
- course_id = $button.data('id');
130
- $.alerts.confirm(learn_press_js_localize.confirm_retake_course, learn_press_js_localize.confirm_retake_course_title, function( confirm ){
131
- if( !confirm ){
132
- return;
133
- }
134
- LearnPress.retake_course(course_id);
135
- });
136
- }
137
-
138
- function load_lesson(evt) {
139
- evt.preventDefault();
140
- var $link = $(this),
141
- $parent = $link.parent(),
142
- permalink = $link.attr('href');
143
- if (!$link.data('id')) return false;
144
- if ($parent.hasClass('current')) return false;
145
- if ($parent.hasClass('course-lesson')) {
146
- $('.curriculum-sections .course-lesson.loading').removeClass('loading')
147
- $parent.addClass('loading')
148
- }
149
- history.pushState({}, '', permalink);
150
- LearnPress.load_lesson(permalink, {
151
- success: function () {
152
- $('.curriculum-sections .course-lesson.current').removeClass('current')
153
- if ($parent.hasClass('course-lesson')) {
154
- $parent.removeClass('loading');
155
- $parent.addClass('current');
156
- } else {
157
- $('.curriculum-sections .course-lesson a[lesson-id="' + $link.data('id') + '"]').parent().addClass('current')
158
- }
159
- $('body, html').fadeIn(100).delay(300).animate({scrollTop: $('.course-content').offset().top - 50}, 'slow');
160
- }
161
- });
162
- }
163
-
164
- function _ready() {
165
- $doc
166
- .on('click', '.complete-lesson-button', complete_lesson)
167
- .on('click', '#finish-course', finish_course)
168
- .on('click', '#learn_press_retake_course', retake_course)
169
- .on('click', '.course-content-lesson-nav a', load_lesson)
170
- .on('click', '.section-content .course-lesson a', load_lesson);
171
-
172
- $('.lesson-quiz-icon', '.section-content').each(function () {
173
- var $target = $(this), $parent = $target.closest('li');
174
- $target.tipsy({
175
- title : function () {
176
- var tip = undefined;
177
- if ($parent.hasClass('completed')) {
178
- tip = $('#lesson-quiz-tip-completed-' + $(this).next().data('id')).html();
179
- } else if ($parent.hasClass('current')) {
180
- tip = $('#lesson-quiz-tip-current-' + $(this).next().data('id')).html();
181
- }
182
- if (tip == undefined) {
183
- tip = $('#lesson-quiz-tip-message-' + $(this).next().data('id')).html();
184
- }
185
- return tip;
186
- },
187
- gravity: 's',
188
- fade : true,
189
- html : true
190
- })
191
- });
192
- }
193
-
194
- $doc.ready(_ready);
195
-
196
- })(jQuery);
197
-
198
- jQuery(document).ready(function ($) {
199
- $('.quiz-curriculum').click(function (event) {
200
- event.preventDefault();
201
-
202
- $.ajax({
203
- type : "POST",
204
- url : ajaxurl,
205
- data : {
206
- action: 'learnpress_list_quiz'
207
- },
208
- success: function (html) {
209
- $('.course-content').html(html);
210
- }
211
- })
212
- })
213
- });
214
-
215
- jQuery(document).ready(function ($) {
216
- $('.list-quiz-question').click(function (event) {
217
- event.preventDefault();
218
- var $this = $(this);
219
-
220
- $.ajax({
221
- type : "POST",
222
- url : ajaxurl,
223
- data : {
224
- action : 'learnpress_load_quiz_question',
225
- course_id : $('.quiz-main').attr('course-id'),
226
- quiz_id : window.quiz_id,
227
- question_id: $this.attr('question-id')
228
- },
229
- success: function (html) {
230
- $('.quiz-question').html(html);
231
- $('.qq').removeClass('current');
232
- var cl = ".qq:nth-child(" + $this.attr('question-index') + ")";
233
- $(cl).addClass('current');
234
- //$this.attr('question-id').addClass('active');
235
-
236
- if (jQuery('.quiz-questions li').first().hasClass('current')) {
237
- jQuery('.button-prev-question').addClass('hidden');
238
- } else if ($('.button-prev-question').hasClass('hidden')) {
239
- $('.button-prev-question').removeClass('hidden')
240
- }
241
-
242
-
243
- if (jQuery('.quiz-questions li').last().hasClass('current')) {
244
- jQuery('.button-next-question').addClass('hidden');
245
- } else if ($('.button-next-question').hasClass('hidden')) {
246
- $('.button-next-question').removeClass('hidden');
247
- }
248
- }
249
- });
250
- });
251
- });
252
-
253
- jQuery(document).ready(function ($) {
254
- $('.lesson_curriculum').click(function (event) {
255
- event.preventDefault();
256
- var $this = $(this);
257
- var $url = $(this).attr('href');
258
- var link = window.location.href;
259
-
260
- $.ajax({
261
- type : "POST",
262
- url : $url, //ajaxurl,
263
- data : {
264
- action : 'learnpress_load_lesson_content',
265
- lesson_id: $(this).attr('lesson-id')
266
- },
267
- success: function (html) {
268
- console.log($url);
269
- history.pushState({}, '', $url);
270
- $('.course-content').html($('.course-content', html).html());
271
- $('html, body').animate({scrollTop: $('.course-content').offset().top}, 'slow');
272
- $('.button-prev-lesson').removeClass('hidden');
273
- $('.button-complete-lesson').removeClass('hidden');
274
- $('.button-next-lesson').removeClass('hidden');
275
- $('.course-curriculum').find('.current').removeClass('current');
276
- $this.addClass('current');
277
- }
278
- });
279
- });
280
- });
281
-
282
-
283
- jQuery(document).ready(function ($) {
284
- $('#lpr-join-event').click(function (event) {
285
- event.preventDefault();
286
- var $this = $(this);
287
-
288
- $.ajax({
289
- type : "POST",
290
- url : ajaxurl,
291
- data : {
292
- action : 'learnpress_join_event',
293
- event_id: $(this).attr('event-id')
294
- },
295
- success: function (html) {
296
- $this.html(html);
297
- $this.removeAttr('id').attr('id', 'lpr-not-going');
298
- }
299
- });
300
- });
301
- });
302
-
303
- jQuery(document).ready(function ($) {
304
- $('#lpr-not-going').click(function (event) {
305
- event.preventDefault();
306
- var $this = $(this);
307
-
308
- $.ajax({
309
- type : "POST",
310
- url : ajaxurl,
311
- data : {
312
- action : 'learnpress_not_going',
313
- event_id: $(this).attr('event-id')
314
- },
315
- success: function (html) {
316
- $this.html(html);
317
- $this.removeAttr('id').attr('id', 'lpr-join-event');
318
- }
319
- });
320
- });
321
- });
322
-
323
-
324
- jQuery(document).ready(function ($) {
325
- $('.course-free-button').click(function (event) {
326
- event.preventDefault();
327
- var $this = $(this);
328
- $.ajax({
329
- type : "POST",
330
- url : ajaxurl,
331
- data : {
332
- action : 'learnpress_take_free_course',
333
- course_id: $this.attr('course-id')
334
- },
335
- success: function (html) {
336
- if (html == 'not prerequisite') {
337
- //jAlert('You have to complete prereqisite courses before taking this course');
338
- $('.error-notice').html('You have to complete prereqisite courses before taking this course');
339
- } else if (html == 'not logged in') {
340
- $('.error-notice').html('You have to log in to take this course');
341
- } else {
342
- location.reload(true);
343
- }
344
- }
345
- })
346
- });
347
-
348
- $('#myModal').on('shown.bs.modal', function () {
349
- $('#myInput').focus()
350
- })
351
- });
352
-
353
- jQuery(document).ready(function ($) {
354
- $('.button-prev-lesson').on("click", function (event) {
355
- event.preventDefault();
356
- var $lesson_link = $('.course-curriculum').find('.current').parent().prevAll('.course-lesson').first().find('a').attr('href');
357
- var $current = $('.course-curriculum').find('.current');
358
-
359
- if ($lesson_link != '') {
360
- window.location.replace($lesson_link);
361
- } else {
362
- $.ajax({
363
- type : "POST",
364
- url : ajaxurl,
365
- data : {
366
- action : 'learnpress_load_prev_lesson',
367
- lesson_id: $('.course-curriculum').find('.current').parent().prevAll('.course-lesson').first().find('a').attr('lesson-id')
368
- },
369
- success: function (html) {
370
- $('.course-content').html(html);
371
- $current.removeClass('current');
372
- $current.parent().prevAll('.course-lesson').first().find('a').addClass('current');
373
- var $forum_link = $('.course-curriculum').find('.current').attr('data-link');
374
- $('.button-forum').removeClass('hidden').attr('href', $forum_link);
375
- }
376
- })
377
- }
378
- });
379
- });
380
-
381
- jQuery(document).ready(function ($) {
382
- $('.button-next-lesson').on("click", function (event) {
383
- event.preventDefault();
384
- var $lesson_link = $('.course-curriculum').find('.current').parent().nextAll('.course-lesson').first().find('a').attr('href');
385
- var $current = $('.course-curriculum').find('.current');
386
-
387
- if ($lesson_link != '') {
388
- window.location.replace($lesson_link);
389
- } else {
390
- $.ajax({
391
- type : "POST",
392
- url : ajaxurl,
393
- data : {
394
- action : 'learnpress_load_next_lesson',
395
- lesson_id: $('.course-curriculum').find('.current').parent().nextAll('.course-lesson').first().find('a').attr('lesson-id')
396
- },
397
- success: function (html) {
398
- $('.course-content').html(html);
399
- $current.removeClass('current');
400
- $current.parent().nextAll('.course-lesson').first().find('a').addClass('current');
401
- }
402
- })
403
- }
404
- });
405
- });
406
-
407
-
408
- jQuery(document).ready(function ($) {
409
-
410
- $('.button-finish-course').click(function (event) {
411
- event.preventDefault();
412
- var $this = $(this);
413
- var $certi_link = $this.attr("certi_link");
414
- console.log($certi_link);
415
- $.ajax({
416
- type : "POST",
417
- url : ajaxurl,
418
- data : {
419
- action : 'learnpress_finish_course',
420
- course_id: $this.attr('course-id')
421
- },
422
- success: function (html) {
423
- console.log(html);
424
- if (html == 'success') {
425
- if ($certi_link) {
426
- window.location.replace($certi_link);
427
- } else {
428
- jAlert('Congratulation ! You have finished this course.')
429
- }
430
- } else {
431
- jAlert(html);
432
- }
433
- }
434
- })
435
- });
436
-
437
- var $payment_form = $('form[name="learn_press_payment_form"]');
438
- $('input[name="payment_method"]', $payment_form).click(function () {
439
- var $this = $(this);
440
- if ($this.is(":checked")) {
441
- $this.closest('li').find('.learn_press_payment_form').slideDown();
442
- $('.learn_press_payment_form', $this.closest('li').siblings()).slideUp();
443
- }
444
- });
445
- $('#learn_press_take_course')
446
- .click(function () {
447
- var button = $(this),
448
- payment_methods = $('input[name="payment_method"]', $payment_form),
449
- take = false,
450
- payment = payment_methods.filter(":checked").val();
451
- if (0 == payment_methods.length) {
452
- take = true;
453
- } else if (1 == payment_methods.length) {
454
- payment_methods.attr('checked', true);
455
- take = true;
456
- } else {
457
- if ($payment_form.is(':visible')) {
458
- if (!payment) {
459
- alert(learn_press_js_localize.no_payment_method);
460
- return;
461
- } else {
462
- take = true
463
- }
464
- } else {
465
- $payment_form.show();
466
- return;
467
- }
468
- }
469
- if (!take) return;
470
- $(this).html($(this).data('loading-text') || 'Processing').attr('disabled', true);
471
- if ($payment_form.triggerHandler('learn_press_place_order') !== false && $payment_form.triggerHandler('learn_press_place_order_' + payment) !== false) {
472
- var data = {
473
- action : 'learnpress_take_course',
474
- payment_method: payment_methods.filter(":checked").val(),
475
- course_id : button.data('id'),
476
- data : $payment_form.serialize()
477
- }
478
-
479
- $.ajax({
480
- url : ajaxurl,
481
- type : 'POST',
482
- dataType: 'html',
483
- data : $payment_form.serialize(),
484
- success : function (res) {
485
- var matches = res.match(/<!-- LPR_AJAX_START -->(.*)<!-- LPR_AJAX_END -->/),
486
- message = '';
487
- if (matches && matches[1]) {
488
- var json = JSON.parse(matches[1]);
489
- if (json) {
490
- if (json.redirect && (json.result.toLowerCase() == 'success')) {
491
- window.location.href = json.redirect;
492
- return;
493
- } else {
494
- message = json.message
495
- }
496
- } else {
497
- message = matches[1];
498
- }
499
- } else {
500
- message = res
501
- }
502
- if (message) {
503
- alert(message);
504
- }
505
- button.removeAttr('disabled').html(button.data('text'))
506
- }
507
- });
508
- }
509
- return false;
510
- });
511
- });
512
-
513
- jQuery(document).ready(function ($) {
514
- $('#wp-admin-bar-be_teacher').click(function () {
515
- $.ajax({
516
- url : ajaxurl,
517
- data : {
518
- action: 'learnpress_be_teacher'
519
- },
520
- success: function () {
521
- alert(learn_press_js_localize.you_are_instructor_now);
522
- setTimeout(function () {
523
- location.reload();
524
- }, 500);
525
- }
526
- })
527
- });
528
- });
529
-
530
- // jQuery(document).ready(function ($) {
531
- // $('#question-hint').on('click', function(){
532
- // $('.question-hint-content').fadeToggle();
533
- // });
534
- // });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/owlcarousel/owl.carousel.min.js ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "function"!==typeof Object.create&&(Object.create=function(f){function g(){}g.prototype=f;return new g});
2
+ (function(f,g,k){var l={init:function(a,b){this.$elem=f(b);this.options=f.extend({},f.fn.owlCarousel.options,this.$elem.data(),a);this.userOptions=a;this.loadContent()},loadContent:function(){function a(a){var d,e="";if("function"===typeof b.options.jsonSuccess)b.options.jsonSuccess.apply(this,[a]);else{for(d in a.owl)a.owl.hasOwnProperty(d)&&(e+=a.owl[d].item);b.$elem.html(e)}b.logIn()}var b=this,e;"function"===typeof b.options.beforeInit&&b.options.beforeInit.apply(this,[b.$elem]);"string"===typeof b.options.jsonPath?
3
+ (e=b.options.jsonPath,f.getJSON(e,a)):b.logIn()},logIn:function(){this.$elem.data("owl-originalStyles",this.$elem.attr("style"));this.$elem.data("owl-originalClasses",this.$elem.attr("class"));this.$elem.css({opacity:0});this.orignalItems=this.options.items;this.checkBrowser();this.wrapperWidth=0;this.checkVisible=null;this.setVars()},setVars:function(){if(0===this.$elem.children().length)return!1;this.baseClass();this.eventTypes();this.$userItems=this.$elem.children();this.itemsAmount=this.$userItems.length;
4
+ this.wrapItems();this.$owlItems=this.$elem.find(".owl-item");this.$owlWrapper=this.$elem.find(".owl-wrapper");this.playDirection="next";this.prevItem=0;this.prevArr=[0];this.currentItem=0;this.customEvents();this.onStartup()},onStartup:function(){this.updateItems();this.calculateAll();this.buildControls();this.updateControls();this.response();this.moveEvents();this.stopOnHover();this.owlStatus();!1!==this.options.transitionStyle&&this.transitionTypes(this.options.transitionStyle);!0===this.options.autoPlay&&
5
+ (this.options.autoPlay=5E3);this.play();this.$elem.find(".owl-wrapper").css("display","block");this.$elem.is(":visible")?this.$elem.css("opacity",1):this.watchVisibility();this.onstartup=!1;this.eachMoveUpdate();"function"===typeof this.options.afterInit&&this.options.afterInit.apply(this,[this.$elem])},eachMoveUpdate:function(){!0===this.options.lazyLoad&&this.lazyLoad();!0===this.options.autoHeight&&this.autoHeight();this.onVisibleItems();"function"===typeof this.options.afterAction&&this.options.afterAction.apply(this,
6
+ [this.$elem])},updateVars:function(){"function"===typeof this.options.beforeUpdate&&this.options.beforeUpdate.apply(this,[this.$elem]);this.watchVisibility();this.updateItems();this.calculateAll();this.updatePosition();this.updateControls();this.eachMoveUpdate();"function"===typeof this.options.afterUpdate&&this.options.afterUpdate.apply(this,[this.$elem])},reload:function(){var a=this;g.setTimeout(function(){a.updateVars()},0)},watchVisibility:function(){var a=this;if(!1===a.$elem.is(":visible"))a.$elem.css({opacity:0}),
7
+ g.clearInterval(a.autoPlayInterval),g.clearInterval(a.checkVisible);else return!1;a.checkVisible=g.setInterval(function(){a.$elem.is(":visible")&&(a.reload(),a.$elem.animate({opacity:1},200),g.clearInterval(a.checkVisible))},500)},wrapItems:function(){this.$userItems.wrapAll('<div class="owl-wrapper">').wrap('<div class="owl-item"></div>');this.$elem.find(".owl-wrapper").wrap('<div class="owl-wrapper-outer">');this.wrapperOuter=this.$elem.find(".owl-wrapper-outer");this.$elem.css("display","block")},
8
+ baseClass:function(){var a=this.$elem.hasClass(this.options.baseClass),b=this.$elem.hasClass(this.options.theme);a||this.$elem.addClass(this.options.baseClass);b||this.$elem.addClass(this.options.theme)},updateItems:function(){var a,b;if(!1===this.options.responsive)return!1;if(!0===this.options.singleItem)return this.options.items=this.orignalItems=1,this.options.itemsCustom=!1,this.options.itemsDesktop=!1,this.options.itemsDesktopSmall=!1,this.options.itemsTablet=!1,this.options.itemsTabletSmall=
9
+ !1,this.options.itemsMobile=!1;a=f(this.options.responsiveBaseWidth).width();a>(this.options.itemsDesktop[0]||this.orignalItems)&&(this.options.items=this.orignalItems);if(!1!==this.options.itemsCustom)for(this.options.itemsCustom.sort(function(a,b){return a[0]-b[0]}),b=0;b<this.options.itemsCustom.length;b+=1)this.options.itemsCustom[b][0]<=a&&(this.options.items=this.options.itemsCustom[b][1]);else a<=this.options.itemsDesktop[0]&&!1!==this.options.itemsDesktop&&(this.options.items=this.options.itemsDesktop[1]),
10
+ a<=this.options.itemsDesktopSmall[0]&&!1!==this.options.itemsDesktopSmall&&(this.options.items=this.options.itemsDesktopSmall[1]),a<=this.options.itemsTablet[0]&&!1!==this.options.itemsTablet&&(this.options.items=this.options.itemsTablet[1]),a<=this.options.itemsTabletSmall[0]&&!1!==this.options.itemsTabletSmall&&(this.options.items=this.options.itemsTabletSmall[1]),a<=this.options.itemsMobile[0]&&!1!==this.options.itemsMobile&&(this.options.items=this.options.itemsMobile[1]);this.options.items>this.itemsAmount&&
11
+ !0===this.options.itemsScaleUp&&(this.options.items=this.itemsAmount)},response:function(){var a=this,b,e;if(!0!==a.options.responsive)return!1;e=f(g).width();a.resizer=function(){f(g).width()!==e&&(!1!==a.options.autoPlay&&g.clearInterval(a.autoPlayInterval),g.clearTimeout(b),b=g.setTimeout(function(){e=f(g).width();a.updateVars()},a.options.responsiveRefreshRate))};f(g).resize(a.resizer)},updatePosition:function(){this.jumpTo(this.currentItem);!1!==this.options.autoPlay&&this.checkAp()},appendItemsSizes:function(){var a=
12
+ this,b=0,e=a.itemsAmount-a.options.items;a.$owlItems.each(function(c){var d=f(this);d.css({width:a.itemWidth}).data("owl-item",Number(c));if(0===c%a.options.items||c===e)c>e||(b+=1);d.data("owl-roundPages",b)})},appendWrapperSizes:function(){this.$owlWrapper.css({width:this.$owlItems.length*this.itemWidth*2,left:0});this.appendItemsSizes()},calculateAll:function(){this.calculateWidth();this.appendWrapperSizes();this.loops();this.max()},calculateWidth:function(){this.itemWidth=Math.round(this.$elem.width()/
13
+ this.options.items)},max:function(){var a=-1*(this.itemsAmount*this.itemWidth-this.options.items*this.itemWidth);this.options.items>this.itemsAmount?this.maximumPixels=a=this.maximumItem=0:(this.maximumItem=this.itemsAmount-this.options.items,this.maximumPixels=a);return a},min:function(){return 0},loops:function(){var a=0,b=0,e,c;this.positionsInArray=[0];this.pagesInArray=[];for(e=0;e<this.itemsAmount;e+=1)b+=this.itemWidth,this.positionsInArray.push(-b),!0===this.options.scrollPerPage&&(c=f(this.$owlItems[e]),
14
+ c=c.data("owl-roundPages"),c!==a&&(this.pagesInArray[a]=this.positionsInArray[e],a=c))},buildControls:function(){if(!0===this.options.navigation||!0===this.options.pagination)this.owlControls=f('<div class="owl-controls"/>').toggleClass("clickable",!this.browser.isTouch).appendTo(this.$elem);!0===this.options.pagination&&this.buildPagination();!0===this.options.navigation&&this.buildButtons()},buildButtons:function(){var a=this,b=f('<div class="owl-buttons"/>');a.owlControls.append(b);a.buttonPrev=
15
+ f("<div/>",{"class":"owl-prev",html:a.options.navigationText[0]||""});a.buttonNext=f("<div/>",{"class":"owl-next",html:a.options.navigationText[1]||""});b.append(a.buttonPrev).append(a.buttonNext);b.on("touchstart.owlControls mousedown.owlControls",'div[class^="owl"]',function(a){a.preventDefault()});b.on("touchend.owlControls mouseup.owlControls",'div[class^="owl"]',function(b){b.preventDefault();f(this).hasClass("owl-next")?a.next():a.prev()})},buildPagination:function(){var a=this;a.paginationWrapper=
16
+ f('<div class="owl-pagination"/>');a.owlControls.append(a.paginationWrapper);a.paginationWrapper.on("touchend.owlControls mouseup.owlControls",".owl-page",function(b){b.preventDefault();Number(f(this).data("owl-page"))!==a.currentItem&&a.goTo(Number(f(this).data("owl-page")),!0)})},updatePagination:function(){var a,b,e,c,d,g;if(!1===this.options.pagination)return!1;this.paginationWrapper.html("");a=0;b=this.itemsAmount-this.itemsAmount%this.options.items;for(c=0;c<this.itemsAmount;c+=1)0===c%this.options.items&&
17
+ (a+=1,b===c&&(e=this.itemsAmount-this.options.items),d=f("<div/>",{"class":"owl-page"}),g=f("<span></span>",{text:!0===this.options.paginationNumbers?a:"","class":!0===this.options.paginationNumbers?"owl-numbers":""}),d.append(g),d.data("owl-page",b===c?e:c),d.data("owl-roundPages",a),this.paginationWrapper.append(d));this.checkPagination()},checkPagination:function(){var a=this;if(!1===a.options.pagination)return!1;a.paginationWrapper.find(".owl-page").each(function(){f(this).data("owl-roundPages")===
18
+ f(a.$owlItems[a.currentItem]).data("owl-roundPages")&&(a.paginationWrapper.find(".owl-page").removeClass("active"),f(this).addClass("active"))})},checkNavigation:function(){if(!1===this.options.navigation)return!1;!1===this.options.rewindNav&&(0===this.currentItem&&0===this.maximumItem?(this.buttonPrev.addClass("disabled"),this.buttonNext.addClass("disabled")):0===this.currentItem&&0!==this.maximumItem?(this.buttonPrev.addClass("disabled"),this.buttonNext.removeClass("disabled")):this.currentItem===
19
+ this.maximumItem?(this.buttonPrev.removeClass("disabled"),this.buttonNext.addClass("disabled")):0!==this.currentItem&&this.currentItem!==this.maximumItem&&(this.buttonPrev.removeClass("disabled"),this.buttonNext.removeClass("disabled")))},updateControls:function(){this.updatePagination();this.checkNavigation();this.owlControls&&(this.options.items>=this.itemsAmount?this.owlControls.hide():this.owlControls.show())},destroyControls:function(){this.owlControls&&this.owlControls.remove()},next:function(a){if(this.isTransition)return!1;
20
+ this.currentItem+=!0===this.options.scrollPerPage?this.options.items:1;if(this.currentItem>this.maximumItem+(!0===this.options.scrollPerPage?this.options.items-1:0))if(!0===this.options.rewindNav)this.currentItem=0,a="rewind";else return this.currentItem=this.maximumItem,!1;this.goTo(this.currentItem,a)},prev:function(a){if(this.isTransition)return!1;this.currentItem=!0===this.options.scrollPerPage&&0<this.currentItem&&this.currentItem<this.options.items?0:this.currentItem-(!0===this.options.scrollPerPage?
21
+ this.options.items:1);if(0>this.currentItem)if(!0===this.options.rewindNav)this.currentItem=this.maximumItem,a="rewind";else return this.currentItem=0,!1;this.goTo(this.currentItem,a)},goTo:function(a,b,e){var c=this;if(c.isTransition)return!1;"function"===typeof c.options.beforeMove&&c.options.beforeMove.apply(this,[c.$elem]);a>=c.maximumItem?a=c.maximumItem:0>=a&&(a=0);c.currentItem=c.owl.currentItem=a;if(!1!==c.options.transitionStyle&&"drag"!==e&&1===c.options.items&&!0===c.browser.support3d)return c.swapSpeed(0),
22
+ !0===c.browser.support3d?c.transition3d(c.positionsInArray[a]):c.css2slide(c.positionsInArray[a],1),c.afterGo(),c.singleItemTransition(),!1;a=c.positionsInArray[a];!0===c.browser.support3d?(c.isCss3Finish=!1,!0===b?(c.swapSpeed("paginationSpeed"),g.setTimeout(function(){c.isCss3Finish=!0},c.options.paginationSpeed)):"rewind"===b?(c.swapSpeed(c.options.rewindSpeed),g.setTimeout(function(){c.isCss3Finish=!0},c.options.rewindSpeed)):(c.swapSpeed("slideSpeed"),g.setTimeout(function(){c.isCss3Finish=!0},
23
+ c.options.slideSpeed)),c.transition3d(a)):!0===b?c.css2slide(a,c.options.paginationSpeed):"rewind"===b?c.css2slide(a,c.options.rewindSpeed):c.css2slide(a,c.options.slideSpeed);c.afterGo()},jumpTo:function(a){"function"===typeof this.options.beforeMove&&this.options.beforeMove.apply(this,[this.$elem]);a>=this.maximumItem||-1===a?a=this.maximumItem:0>=a&&(a=0);this.swapSpeed(0);!0===this.browser.support3d?this.transition3d(this.positionsInArray[a]):this.css2slide(this.positionsInArray[a],1);this.currentItem=
24
+ this.owl.currentItem=a;this.afterGo()},afterGo:function(){this.prevArr.push(this.currentItem);this.prevItem=this.owl.prevItem=this.prevArr[this.prevArr.length-2];this.prevArr.shift(0);this.prevItem!==this.currentItem&&(this.checkPagination(),this.checkNavigation(),this.eachMoveUpdate(),!1!==this.options.autoPlay&&this.checkAp());"function"===typeof this.options.afterMove&&this.prevItem!==this.currentItem&&this.options.afterMove.apply(this,[this.$elem])},stop:function(){this.apStatus="stop";g.clearInterval(this.autoPlayInterval)},
25
+ checkAp:function(){"stop"!==this.apStatus&&this.play()},play:function(){var a=this;a.apStatus="play";if(!1===a.options.autoPlay)return!1;g.clearInterval(a.autoPlayInterval);a.autoPlayInterval=g.setInterval(function(){a.next(!0)},a.options.autoPlay)},swapSpeed:function(a){"slideSpeed"===a?this.$owlWrapper.css(this.addCssSpeed(this.options.slideSpeed)):"paginationSpeed"===a?this.$owlWrapper.css(this.addCssSpeed(this.options.paginationSpeed)):"string"!==typeof a&&this.$owlWrapper.css(this.addCssSpeed(a))},
26
+ addCssSpeed:function(a){return{"-webkit-transition":"all "+a+"ms ease","-moz-transition":"all "+a+"ms ease","-o-transition":"all "+a+"ms ease",transition:"all "+a+"ms ease"}},removeTransition:function(){return{"-webkit-transition":"","-moz-transition":"","-o-transition":"",transition:""}},doTranslate:function(a){return{"-webkit-transform":"translate3d("+a+"px, 0px, 0px)","-moz-transform":"translate3d("+a+"px, 0px, 0px)","-o-transform":"translate3d("+a+"px, 0px, 0px)","-ms-transform":"translate3d("+
27
+ a+"px, 0px, 0px)",transform:"translate3d("+a+"px, 0px,0px)"}},transition3d:function(a){this.$owlWrapper.css(this.doTranslate(a))},css2move:function(a){this.$owlWrapper.css({left:a})},css2slide:function(a,b){var e=this;e.isCssFinish=!1;e.$owlWrapper.stop(!0,!0).animate({left:a},{duration:b||e.options.slideSpeed,complete:function(){e.isCssFinish=!0}})},checkBrowser:function(){var a=k.createElement("div");a.style.cssText=" -moz-transform:translate3d(0px, 0px, 0px); -ms-transform:translate3d(0px, 0px, 0px); -o-transform:translate3d(0px, 0px, 0px); -webkit-transform:translate3d(0px, 0px, 0px); transform:translate3d(0px, 0px, 0px)";
28
+ a=a.style.cssText.match(/translate3d\(0px, 0px, 0px\)/g);this.browser={support3d:null!==a&&1===a.length,isTouch:"ontouchstart"in g||g.navigator.msMaxTouchPoints}},moveEvents:function(){if(!1!==this.options.mouseDrag||!1!==this.options.touchDrag)this.gestures(),this.disabledEvents()},eventTypes:function(){var a=["s","e","x"];this.ev_types={};!0===this.options.mouseDrag&&!0===this.options.touchDrag?a=["touchstart.owl mousedown.owl","touchmove.owl mousemove.owl","touchend.owl touchcancel.owl mouseup.owl"]:
29
+ !1===this.options.mouseDrag&&!0===this.options.touchDrag?a=["touchstart.owl","touchmove.owl","touchend.owl touchcancel.owl"]:!0===this.options.mouseDrag&&!1===this.options.touchDrag&&(a=["mousedown.owl","mousemove.owl","mouseup.owl"]);this.ev_types.start=a[0];this.ev_types.move=a[1];this.ev_types.end=a[2]},disabledEvents:function(){this.$elem.on("dragstart.owl",function(a){a.preventDefault()});this.$elem.on("mousedown.disableTextSelect",function(a){return f(a.target).is("input, textarea, select, option")})},
30
+ gestures:function(){function a(a){if(void 0!==a.touches)return{x:a.touches[0].pageX,y:a.touches[0].pageY};if(void 0===a.touches){if(void 0!==a.pageX)return{x:a.pageX,y:a.pageY};if(void 0===a.pageX)return{x:a.clientX,y:a.clientY}}}function b(a){"on"===a?(f(k).on(d.ev_types.move,e),f(k).on(d.ev_types.end,c)):"off"===a&&(f(k).off(d.ev_types.move),f(k).off(d.ev_types.end))}function e(b){b=b.originalEvent||b||g.event;d.newPosX=a(b).x-h.offsetX;d.newPosY=a(b).y-h.offsetY;d.newRelativeX=d.newPosX-h.relativePos;
31
+ "function"===typeof d.options.startDragging&&!0!==h.dragging&&0!==d.newRelativeX&&(h.dragging=!0,d.options.startDragging.apply(d,[d.$elem]));(8<d.newRelativeX||-8>d.newRelativeX)&&!0===d.browser.isTouch&&(void 0!==b.preventDefault?b.preventDefault():b.returnValue=!1,h.sliding=!0);(10<d.newPosY||-10>d.newPosY)&&!1===h.sliding&&f(k).off("touchmove.owl");d.newPosX=Math.max(Math.min(d.newPosX,d.newRelativeX/5),d.maximumPixels+d.newRelativeX/5);!0===d.browser.support3d?d.transition3d(d.newPosX):d.css2move(d.newPosX)}
32
+ function c(a){a=a.originalEvent||a||g.event;var c;a.target=a.target||a.srcElement;h.dragging=!1;!0!==d.browser.isTouch&&d.$owlWrapper.removeClass("grabbing");d.dragDirection=0>d.newRelativeX?d.owl.dragDirection="left":d.owl.dragDirection="right";0!==d.newRelativeX&&(c=d.getNewPosition(),d.goTo(c,!1,"drag"),h.targetElement===a.target&&!0!==d.browser.isTouch&&(f(a.target).on("click.disable",function(a){a.stopImmediatePropagation();a.stopPropagation();a.preventDefault();f(a.target).off("click.disable")}),
33
+ a=f._data(a.target,"events").click,c=a.pop(),a.splice(0,0,c)));b("off")}var d=this,h={offsetX:0,offsetY:0,baseElWidth:0,relativePos:0,position:null,minSwipe:null,maxSwipe:null,sliding:null,dargging:null,targetElement:null};d.isCssFinish=!0;d.$elem.on(d.ev_types.start,".owl-wrapper",function(c){c=c.originalEvent||c||g.event;var e;if(3===c.which)return!1;if(!(d.itemsAmount<=d.options.items)){if(!1===d.isCssFinish&&!d.options.dragBeforeAnimFinish||!1===d.isCss3Finish&&!d.options.dragBeforeAnimFinish)return!1;
34
+ !1!==d.options.autoPlay&&g.clearInterval(d.autoPlayInterval);!0===d.browser.isTouch||d.$owlWrapper.hasClass("grabbing")||d.$owlWrapper.addClass("grabbing");d.newPosX=0;d.newRelativeX=0;f(this).css(d.removeTransition());e=f(this).position();h.relativePos=e.left;h.offsetX=a(c).x-e.left;h.offsetY=a(c).y-e.top;b("on");h.sliding=!1;h.targetElement=c.target||c.srcElement}})},getNewPosition:function(){var a=this.closestItem();a>this.maximumItem?a=this.currentItem=this.maximumItem:0<=this.newPosX&&(this.currentItem=
35
+ a=0);return a},closestItem:function(){var a=this,b=!0===a.options.scrollPerPage?a.pagesInArray:a.positionsInArray,e=a.newPosX,c=null;f.each(b,function(d,g){e-a.itemWidth/20>b[d+1]&&e-a.itemWidth/20<g&&"left"===a.moveDirection()?(c=g,a.currentItem=!0===a.options.scrollPerPage?f.inArray(c,a.positionsInArray):d):e+a.itemWidth/20<g&&e+a.itemWidth/20>(b[d+1]||b[d]-a.itemWidth)&&"right"===a.moveDirection()&&(!0===a.options.scrollPerPage?(c=b[d+1]||b[b.length-1],a.currentItem=f.inArray(c,a.positionsInArray)):
36
+ (c=b[d+1],a.currentItem=d+1))});return a.currentItem},moveDirection:function(){var a;0>this.newRelativeX?(a="right",this.playDirection="next"):(a="left",this.playDirection="prev");return a},customEvents:function(){var a=this;a.$elem.on("owl.next",function(){a.next()});a.$elem.on("owl.prev",function(){a.prev()});a.$elem.on("owl.play",function(b,e){a.options.autoPlay=e;a.play();a.hoverStatus="play"});a.$elem.on("owl.stop",function(){a.stop();a.hoverStatus="stop"});a.$elem.on("owl.goTo",function(b,e){a.goTo(e)});
37
+ a.$elem.on("owl.jumpTo",function(b,e){a.jumpTo(e)})},stopOnHover:function(){var a=this;!0===a.options.stopOnHover&&!0!==a.browser.isTouch&&!1!==a.options.autoPlay&&(a.$elem.on("mouseover",function(){a.stop()}),a.$elem.on("mouseout",function(){"stop"!==a.hoverStatus&&a.play()}))},lazyLoad:function(){var a,b,e,c,d;if(!1===this.options.lazyLoad)return!1;for(a=0;a<this.itemsAmount;a+=1)b=f(this.$owlItems[a]),"loaded"!==b.data("owl-loaded")&&(e=b.data("owl-item"),c=b.find(".lazyOwl"),"string"!==typeof c.data("src")?
38
+ b.data("owl-loaded","loaded"):(void 0===b.data("owl-loaded")&&(c.hide(),b.addClass("loading").data("owl-loaded","checked")),(d=!0===this.options.lazyFollow?e>=this.currentItem:!0)&&e<this.currentItem+this.options.items&&c.length&&this.lazyPreload(b,c)))},lazyPreload:function(a,b){function e(){a.data("owl-loaded","loaded").removeClass("loading");b.removeAttr("data-src");"fade"===d.options.lazyEffect?b.fadeIn(400):b.show();"function"===typeof d.options.afterLazyLoad&&d.options.afterLazyLoad.apply(this,
39
+ [d.$elem])}function c(){f+=1;d.completeImg(b.get(0))||!0===k?e():100>=f?g.setTimeout(c,100):e()}var d=this,f=0,k;"DIV"===b.prop("tagName")?(b.css("background-image","url("+b.data("src")+")"),k=!0):b[0].src=b.data("src");c()},autoHeight:function(){function a(){var a=f(e.$owlItems[e.currentItem]).height();e.wrapperOuter.css("height",a+"px");e.wrapperOuter.hasClass("autoHeight")||g.setTimeout(function(){e.wrapperOuter.addClass("autoHeight")},0)}function b(){d+=1;e.completeImg(c.get(0))?a():100>=d?g.setTimeout(b,
40
+ 100):e.wrapperOuter.css("height","")}var e=this,c=f(e.$owlItems[e.currentItem]).find("img"),d;void 0!==c.get(0)?(d=0,b()):a()},completeImg:function(a){return!a.complete||"undefined"!==typeof a.naturalWidth&&0===a.naturalWidth?!1:!0},onVisibleItems:function(){var a;!0===this.options.addClassActive&&this.$owlItems.removeClass("active");this.visibleItems=[];for(a=this.currentItem;a<this.currentItem+this.options.items;a+=1)this.visibleItems.push(a),!0===this.options.addClassActive&&f(this.$owlItems[a]).addClass("active");
41
+ this.owl.visibleItems=this.visibleItems},transitionTypes:function(a){this.outClass="owl-"+a+"-out";this.inClass="owl-"+a+"-in"},singleItemTransition:function(){var a=this,b=a.outClass,e=a.inClass,c=a.$owlItems.eq(a.currentItem),d=a.$owlItems.eq(a.prevItem),f=Math.abs(a.positionsInArray[a.currentItem])+a.positionsInArray[a.prevItem],g=Math.abs(a.positionsInArray[a.currentItem])+a.itemWidth/2;a.isTransition=!0;a.$owlWrapper.addClass("owl-origin").css({"-webkit-transform-origin":g+"px","-moz-perspective-origin":g+
42
+ "px","perspective-origin":g+"px"});d.css({position:"relative",left:f+"px"}).addClass(b).on("webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend",function(){a.endPrev=!0;d.off("webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend");a.clearTransStyle(d,b)});c.addClass(e).on("webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend",function(){a.endCurrent=!0;c.off("webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend");a.clearTransStyle(c,e)})},clearTransStyle:function(a,
43
+ b){a.css({position:"",left:""}).removeClass(b);this.endPrev&&this.endCurrent&&(this.$owlWrapper.removeClass("owl-origin"),this.isTransition=this.endCurrent=this.endPrev=!1)},owlStatus:function(){this.owl={userOptions:this.userOptions,baseElement:this.$elem,userItems:this.$userItems,owlItems:this.$owlItems,currentItem:this.currentItem,prevItem:this.prevItem,visibleItems:this.visibleItems,isTouch:this.browser.isTouch,browser:this.browser,dragDirection:this.dragDirection}},clearEvents:function(){this.$elem.off(".owl owl mousedown.disableTextSelect");
44
+ f(k).off(".owl owl");f(g).off("resize",this.resizer)},unWrap:function(){0!==this.$elem.children().length&&(this.$owlWrapper.unwrap(),this.$userItems.unwrap().unwrap(),this.owlControls&&this.owlControls.remove());this.clearEvents();this.$elem.attr("style",this.$elem.data("owl-originalStyles")||"").attr("class",this.$elem.data("owl-originalClasses"))},destroy:function(){this.stop();g.clearInterval(this.checkVisible);this.unWrap();this.$elem.removeData()},reinit:function(a){a=f.extend({},this.userOptions,
45
+ a);this.unWrap();this.init(a,this.$elem)},addItem:function(a,b){var e;if(!a)return!1;if(0===this.$elem.children().length)return this.$elem.append(a),this.setVars(),!1;this.unWrap();e=void 0===b||-1===b?-1:b;e>=this.$userItems.length||-1===e?this.$userItems.eq(-1).after(a):this.$userItems.eq(e).before(a);this.setVars()},removeItem:function(a){if(0===this.$elem.children().length)return!1;a=void 0===a||-1===a?-1:a;this.unWrap();this.$userItems.eq(a).remove();this.setVars()}};f.fn.owlCarousel=function(a){return this.each(function(){if(!0===
46
+ f(this).data("owl-init"))return!1;f(this).data("owl-init",!0);var b=Object.create(l);b.init(a,this);f.data(this,"owlCarousel",b)})};f.fn.owlCarousel.options={items:5,itemsCustom:!1,itemsDesktop:[1199,4],itemsDesktopSmall:[979,3],itemsTablet:[768,2],itemsTabletSmall:!1,itemsMobile:[479,1],singleItem:!1,itemsScaleUp:!1,slideSpeed:200,paginationSpeed:800,rewindSpeed:1E3,autoPlay:!1,stopOnHover:!1,navigation:!1,navigationText:["prev","next"],rewindNav:!0,scrollPerPage:!1,pagination:!0,paginationNumbers:!1,
47
+ responsive:!0,responsiveRefreshRate:200,responsiveBaseWidth:g,baseClass:"owl-carousel",theme:"owl-theme",lazyLoad:!1,lazyFollow:!0,lazyEffect:"fade",autoHeight:!1,jsonPath:!1,jsonSuccess:!1,dragBeforeAnimFinish:!0,mouseDrag:!0,touchDrag:!0,addClassActive:!1,transitionStyle:!1,beforeUpdate:!1,afterUpdate:!1,beforeInit:!1,afterInit:!1,beforeMove:!1,afterMove:!1,afterAction:!1,startDragging:!1,afterLazyLoad:!1}})(jQuery,window,document);
assets/js/pointer.js DELETED
@@ -1,17 +0,0 @@
1
-
2
- jQuery(document).ready( function($) {
3
- learn_press_open_pointer(0);
4
- function learn_press_open_pointer(i) {
5
- pointer = lpPointer.pointers[i];
6
- options = $.extend( pointer.options, {
7
- close: function() {
8
- $.post( ajaxurl, {
9
- pointer: pointer.pointer_id,
10
- action: 'dismiss-wp-pointer'
11
- });
12
- }
13
- });
14
-
15
- $(pointer.target).pointer( options ).pointer('open');
16
- }
17
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/single-quiz.js DELETED
@@ -1,476 +0,0 @@
1
- if (typeof LearnPress == 'undefined') var LearnPress = {};
2
-
3
-
4
- (function ($) {
5
-
6
- var LearnPress_Model_Quiz = window.LearnPress_Model_Quiz = Backbone.Model.extend({
7
- defaults : {
8
- //question_id: 0
9
- },
10
- data : null,
11
- view : false,
12
- url : function () {
13
- },
14
- urlRoot : '',
15
- questions : null,
16
- initialize : function () {
17
- this.createQuestionsList();
18
- },
19
- createQuestionsList: function () {
20
- this.questions = new LearnPress_Collection_Questions();
21
- _.each(this.get('questions'), function (question_id, i) {
22
- var $model = new LearnPress_Model_Question({
23
- id : question_id,
24
- quiz_id: this.get('id'),
25
- user_id: this.get('user_id')
26
- });
27
- $model.urlRoot = this.get('ajaxurl');
28
- $model.view = this.view;
29
- this.questions.add($model);
30
- }, this);
31
- },
32
- next : function () {
33
- if (!this.isLast()) {
34
- var next_id = this.findNext(),
35
- question = this.questions.findWhere({id: next_id}),
36
- that = this;
37
- question.submit({
38
- data : {
39
- save_id : that.get('question_id'),
40
- question_answer: $('input, select, textarea', this.view.$('form')).toJSON(),
41
- time_remaining: that.get('time_remaining')
42
- },
43
- complete: function () {
44
- that.set('question_id', next_id);
45
- }
46
- });
47
- }
48
- },
49
- prev : function () {
50
- if (!this.isFirst()) {
51
- var prev_id = this.findPrev(),
52
- question = this.questions.findWhere({id: prev_id}),
53
- that = this;
54
- //if (!question.get('content')) {
55
- question.submit({
56
- data : {
57
- save_id: that.get('question_id'),
58
- question_answer: $('input, select, textarea', this.view.$('form')).toJSON(),
59
- time_remaining: that.get('time_remaining')
60
- },
61
- complete: function () {
62
- that.set('question_id', prev_id);
63
- }
64
- });
65
- //} else {
66
- // this.set('question_id', prev_id);
67
- //}
68
- }
69
- },
70
- getQuestionPosition: function (question_id) {
71
- question_id = question_id || this.get('question_id');
72
- return _.indexOf(this.get('questions'), question_id);
73
- },
74
- countQuestions : function () {
75
- return this.questions.length;
76
- },
77
- isLast : function (question_id) {
78
- question_id = question_id || this.get('question_id');
79
- return this.getQuestionPosition(question_id) == (this.countQuestions() - 1);
80
- },
81
- isFirst : function (question_id) {
82
- question_id = question_id || this.get('question_id');
83
- return this.getQuestionPosition(question_id) == 0;
84
- },
85
- findNext : function (question_id) {
86
- question_id = question_id || this.get('question_id');
87
- var ids = this.get('questions'),
88
- pos = this.getQuestionPosition(question_id);
89
- pos++;
90
- if (typeof ids[pos] == 'undefined') return false;
91
- return ids[pos];
92
- },
93
- findPrev : function (question_id) {
94
- question_id = question_id || this.get('question_id');
95
- var ids = this.get('questions'),
96
- pos = this.getQuestionPosition(question_id);
97
- pos--;
98
- if (typeof ids[pos] == 'undefined') return false;
99
- return ids[pos];
100
- },
101
- current : function () {
102
- return this.questions.findWhere({id: this.get('question_id')});
103
- }
104
- });
105
-
106
- var LearnPress_Model_Question = window.LearnPress_Model_Question = Backbone.Model.extend({
107
- defaults : {
108
- //question_id: 0
109
- },
110
- data : null,
111
- view : false,
112
- url : function () {
113
- return this.urlRoot;
114
- },
115
- urlRoot : '',
116
- initialize: function () {
117
-
118
- },
119
- element : function () {
120
- return $(this.get('content'));
121
- },
122
- submit : function (args) {
123
- var that = this;
124
- args = $.extend({
125
- complete: null,
126
- data : {}
127
- }, args || {});
128
- this.fetch({
129
- data : $.extend({
130
- action : 'learnpress_load_quiz_question',
131
- user_id : this.get('user_id'),
132
- quiz_id : this.get('quiz_id'),
133
- question_id: this.get('id')
134
- }, args.data || {}),
135
- complete: (function (e) {
136
- var response = LearnPress.parse_json(e.responseText);
137
- if(response.result == 'success') {
138
- var $content = $(response.content);
139
-
140
- that.set('content', $content);
141
- if(response.permalink){
142
- LearnPress.pushHistory( response.permalink );
143
- }
144
- $.isFunction(args.complete) && args.complete.call(that, response);
145
-
146
- }
147
- })
148
- });
149
- }
150
- });
151
-
152
- var LearnPress_Collection_Questions = window.LearnPress_Collection_Questions = Backbone.Collection.extend({
153
- url : 'admin-ajax.php',
154
- model: LearnPress_Model_Question
155
- });
156
-
157
- var LearnPress_View_Quiz = window.LearnPress_View_Quiz = Backbone.View.extend({
158
- model : {},
159
- events : {
160
- 'click .button-start-quiz' : 'startQuiz',
161
- 'click .button-finish-quiz': 'finishQuiz',
162
- 'click .button-retake-quiz': 'retakeQuiz',
163
- 'click .next-question' : 'nextQuestion',
164
- 'click .prev-question' : 'prevQuestion',
165
- 'click .check_answer' : 'showAnswer'
166
- },
167
- el : '.lpr_quiz',
168
- isRendered : false,
169
- $buttons : {},
170
- //questionsHint: [],
171
- initialize : function (model) {
172
- this.model = model;
173
- this.model.view = this;
174
- this.listenTo(this.model, 'change', this.render);
175
-
176
- //this.questionsHint = this.model.get('hint') || [];
177
- _.bindAll(this, 'render');
178
- this._create();
179
- this.render();
180
- },
181
- _create : function () {
182
- this.$buttons = {
183
- start : this.$('.button-start-quiz'),
184
- finish: this.$('.button-finish-quiz'),
185
- retake: this.$('.button-retake-quiz'),
186
- next : this.$('.next-question'),
187
- prev : this.$('.prev-question'),
188
- check: this.$('.check_answer')
189
- };
190
- },
191
- render : function () {
192
- var $question = this.model.current(),
193
- old = this.$('.lp-question-wrap'),
194
- $content = $question.element(),
195
- isHint = false;
196
-
197
- if($.inArray($question.get('id'), this.model.get('hint')) != -1){
198
- isHint = $question.get('id');
199
- };
200
- if ($question) {
201
- if( this.isRendered ){
202
- if (old.length) {
203
- old.replaceWith($content);
204
- } else {
205
- this.$('#nav-question-form').prepend($content);
206
- }
207
- }
208
- if(isHint) {
209
- this.$('.lp-question-wrap.question-' + isHint + ' input').attr('disabled', 'disabled');
210
- this.$('.check_answer').hide();
211
-
212
- }else{
213
- this.$('.check_answer').show();
214
- }
215
- }
216
- this.setButtonsState();
217
- if (this.model.get('status') == 'started') {
218
- this.$('.quiz-questions .sibdebar-quiz-question-' + $question.get('id'))
219
- .addClass('current')
220
- .siblings('.current').removeClass('current');
221
- }
222
-
223
- this.initCountdown();
224
- this.isRendered = true;
225
- this.$el.css('visibility', 'visible');
226
- this.unblock_page();
227
-
228
- },
229
- setButtonsState: function () {
230
- switch (this.model.get('status').toLowerCase()) {
231
- case 'completed':
232
- this.$buttons.start.hide();
233
- this.$buttons.check.hide();
234
- this.$buttons.finish.hide();
235
- this.$buttons.retake.show();
236
- break;
237
- case 'started':
238
- this.$buttons.start.hide();
239
- this.$buttons.finish.show();
240
- //this.$buttons.check.show();
241
- this.$buttons.retake.hide();
242
-
243
- if (this.model.countQuestions() <= 1) {
244
- this.$buttons.next.hide();
245
- this.$buttons.prev.hide();
246
- } else {
247
- this.$buttons.next.show();
248
- this.$buttons.prev.show();
249
- if (this.model.isLast()) {
250
- this.$buttons.next.hide();
251
- this.$buttons.finish.filter('[data-area="nav"]').show();
252
- } else {
253
- this.$buttons.finish.filter('[data-area="nav"]').hide();
254
- }
255
- if (this.model.isFirst()) {
256
- this.$buttons.prev.hide();
257
- }
258
- }
259
-
260
- break;
261
- default:
262
- this.$buttons.next.hide();
263
- this.$buttons.prev.hide();
264
- this.$buttons.check.hide();
265
- this.$buttons.start.show();
266
- this.$buttons.finish.hide();
267
- this.$buttons.retake.hide();
268
- this.$('.quiz-questions .qq.current').removeClass('current');
269
- }
270
-
271
- },
272
- startQuiz : function (args) {
273
- this.block_page();
274
- args = $.extend({}, args || {});
275
- var that = this,
276
- data = $.extend({
277
- action : 'learnpress_start_quiz',
278
- quiz_id: this.model.get('id')
279
- }, $('input, textarea, select', '#nav-question-form').toJSON() || {});
280
- $.ajax({
281
- url : this.model.get('ajaxurl'),
282
- data : data,
283
- dataType: 'html',
284
- type : 'post',
285
- success : function (code) {
286
- var res = LearnPress.parse_json(code);
287
- if (res.result == 'success' && res.question_url) {
288
- that.model.current().set('content', $(res.question_content));
289
- that.model.set('status', 'started');
290
- LearnPress.pushHistory( res.question_url );
291
- }else if(res.message){
292
- alert(res.message)
293
- }
294
- that.unblock_page();
295
- }
296
- });
297
- },
298
- finishQuiz : function (args) {
299
- if( $(document).triggerHandler( 'learn_press_finish_quiz' ) === false ){
300
- return;
301
- }
302
- var that = this,
303
- _do = function(){
304
- that.pause();
305
- that.block_page();
306
- $.ajax({
307
- url : that.model.get('ajaxurl'),
308
- dataType: 'html',
309
- data : {
310
- action : 'learnpress_finish_quiz',
311
- save_id : that.model.get('question_id'),
312
- question_answer: $('input, select, textarea', that.$('form')).toJSON(),
313
- quiz_id : that.model.get('id')
314
- },
315
- success : function (response) {
316
- var json = LearnPress.parse_json(response);
317
- that.unblock_page();
318
- if( $(document).triggerHandler( 'learn_press_after_finish_quiz' ) === false ){
319
- return;
320
- }
321
- if (json.redirect) {
322
- that.loadPage(json.redirect);
323
- }else if(json.message){
324
- alert(json.message);
325
- }
326
- }
327
- });
328
- };
329
-
330
- args = $.extend({
331
- confirm: true
332
- }, args || {});
333
- args.confirm ? $.alerts.confirm(learn_press_js_localize.confirm_finish_quiz, learn_press_js_localize.confirm_finish_quiz_title, function(confirm){
334
- var _confirm = $(document).triggerHandler( 'learn_press_before_finish_quiz', confirm );
335
- if( _confirm != undefined ){
336
- confirm = _confirm;
337
- }
338
- if( !confirm ){
339
- return;
340
- }
341
- _do();
342
- }) : _do();
343
-
344
- },
345
- retakeQuiz : function (args) {
346
- var that = this,
347
- _do = function(){
348
- that.block_page();
349
- args = $.extend({}, args || {});
350
- $.ajax({
351
- url : that.model.get('ajaxurl'),
352
- dataType: 'html',
353
- data : {
354
- action : 'learnpress_retake_quiz',
355
- quiz_id: that.model.get('id')
356
- },
357
- success : function (response) {
358
- var json = LearnPress.parse_json(response);
359
- that.unblock_page();
360
- if( $(document).triggerHandler( 'learn_press_after_retake_quiz' ) === false ){
361
- return;
362
- }
363
- if (json.redirect) {
364
- that.loadPage(json.redirect);
365
- }else if(json.message){
366
- alert(json.message);
367
- }
368
- }
369
- });
370
- };
371
- if( $(document).triggerHandler( 'learn_press_retake_quiz' ) === false ){
372
- return;
373
- }
374
- $.alerts.confirm( learn_press_js_localize.confirm_retake_quiz, learn_press_js_localize.confirm_retake_quiz_title, function(confirm){
375
- var _confirm = $(document).triggerHandler( 'learn_press_before_retake_quiz', confirm );
376
- if( _confirm != undefined ){
377
- confirm = _confirm;
378
- }
379
- if( !confirm ){
380
- return;
381
- }
382
- _do();
383
- });
384
- },
385
- nextQuestion : function () {
386
- var that = this;
387
- this.pause();
388
- this.block_page();
389
- this.model.next();
390
- },
391
- prevQuestion : function () {
392
- this.pause();
393
- this.block_page();
394
- this.model.prev();
395
- },
396
- showAnswer: function (e) {
397
- var that = this,
398
- $button = $(e.target),
399
- question_id = this.model.get('question_id'),
400
- data = {
401
- action : 'learn_press_show_answer',
402
- quiz_id : this.model.get( 'id' ),
403
- question_id : this.model.get( 'question_id' ),
404
- question_answer: $('input, select, textarea', $('.quiz-question-nav .question-' + question_id)).toJSON(),
405
- };
406
- if($.inArray(question_id, this.model.get('hint')) != -1){
407
- return
408
- }
409
- $button.attr('disabled', 'disabled');
410
- $('.single-quiz').block_ui();
411
- $.post(ajaxurl, data, function (res) {
412
- res = LearnPress.parse_json(res);
413
- question_answer_show = $(res.html);
414
- $('.question-' + question_id + ' .question-content').replaceWith(question_answer_show);
415
- $('.single-quiz').unblock_ui();
416
- $button.removeAttr('disabled');
417
- var hint = that.model.get('hint');
418
- hint.push(question_id);
419
- that.model.set('hint', hint);
420
- that.$buttons.check.hide();
421
- }, 'text');
422
- },
423
- initCountdown : function () {
424
- var that = this,
425
- $countdown = this.$countdown;
426
- if (!this.isRendered || !$countdown) {
427
- this.$countdown = $("#quiz-countdown");
428
- this.$countdown.backward_timer({
429
- seconds : this.model.get('time_remaining'),
430
- format : this.model.get('time_remaining') < 60 ? 'm%:s%' : 'h%:m%:s%',
431
- on_exhausted: function (timer) {
432
- jAlert(learn_press_js_localize.quiz_time_is_over_message, learn_press_js_localize.quiz_time_is_over_title, function () {
433
- that.finishQuiz({confirm: false});
434
- });
435
- },
436
- on_tick : function (timer) {
437
- var color = (timer.seconds_left <= 5) ? "#F00" : "";
438
- if (color) timer.target.css('color', color);
439
- //that.model.set('time_remaining', timer.seconds_left);
440
- }
441
- });
442
- }
443
- if (this.model.get('status') == 'started') {
444
- this.$countdown.backward_timer('start');
445
- }
446
- },
447
- pause : function () {
448
- this.$countdown.backward_timer('cancel');
449
- },
450
- resume : function () {
451
- this.$countdown.backward_timer('start');
452
- },
453
- loadPage : function (url) {
454
- url = url || window.location.href;
455
- window.location.href = url;
456
- },
457
- block_page: function(){
458
- this.$el.block_ui();
459
- },
460
- unblock_page: function(){
461
- this.$el.unblock_ui();
462
- }
463
- });
464
- LearnPress = $.extend(
465
- LearnPress, {
466
- pushHistory: function(url){
467
- history.pushState({}, '', url);
468
- },
469
- initQuiz: function (data) {
470
- var model = new LearnPress_Model_Quiz(data);
471
- new LearnPress_View_Quiz(model);
472
- }
473
- }
474
- );
475
-
476
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/toastr.js DELETED
@@ -1,415 +0,0 @@
1
- /*
2
- * Toastr
3
- * Copyright 2012-2015
4
- * Authors: John Papa, Hans Fjällemark, and Tim Ferrell.
5
- * All Rights Reserved.
6
- * Use, reproduction, distribution, and modification of this code is subject to the terms and
7
- * conditions of the MIT license, available at http://www.opensource.org/licenses/mit-license.php
8
- *
9
- * ARIA Support: Greta Krafsig
10
- *
11
- * Project: https://github.com/CodeSeven/toastr
12
- */
13
- /* global define */
14
- ; (function (define) {
15
- define(['jquery'], function ($) {
16
- return (function () {
17
- var $container;
18
- var listener;
19
- var toastId = 0;
20
- var toastType = {
21
- error: 'error',
22
- info: 'info',
23
- success: 'success',
24
- warning: 'warning'
25
- };
26
-
27
- var toastr = {
28
- clear: clear,
29
- remove: remove,
30
- error: error,
31
- getContainer: getContainer,
32
- info: info,
33
- options: {},
34
- subscribe: subscribe,
35
- success: success,
36
- version: '2.1.1',
37
- warning: warning
38
- };
39
-
40
- var previousToast;
41
-
42
- return toastr;
43
-
44
- ////////////////
45
-
46
- function error(message, title, optionsOverride) {
47
- return notify({
48
- type: toastType.error,
49
- iconClass: getOptions().iconClasses.error,
50
- message: message,
51
- optionsOverride: optionsOverride,
52
- title: title
53
- });
54
- }
55
-
56
- function getContainer(options, create) {
57
- if (!options) { options = getOptions(); }
58
- $container = $('#' + options.containerId);
59
- if ($container.length) {
60
- return $container;
61
- }
62
- if (create) {
63
- $container = createContainer(options);
64
- }
65
- return $container;
66
- }
67
-
68
- function info(message, title, optionsOverride) {
69
- return notify({
70
- type: toastType.info,
71
- iconClass: getOptions().iconClasses.info,
72
- message: message,
73
- optionsOverride: optionsOverride,
74
- title: title
75
- });
76
- }
77
-
78
- function subscribe(callback) {
79
- listener = callback;
80
- }
81
-
82
- function success(message, title, optionsOverride) {
83
- return notify({
84
- type: toastType.success,
85
- iconClass: getOptions().iconClasses.success,
86
- message: message,
87
- optionsOverride: optionsOverride,
88
- title: title
89
- });
90
- }
91
-
92
- function warning(message, title, optionsOverride) {
93
- return notify({
94
- type: toastType.warning,
95
- iconClass: getOptions().iconClasses.warning,
96
- message: message,
97
- optionsOverride: optionsOverride,
98
- title: title
99
- });
100
- }
101
-
102
- function clear($toastElement, clearOptions) {
103
- var options = getOptions();
104
- if (!$container) { getContainer(options); }
105
- if (!clearToast($toastElement, options, clearOptions)) {
106
- clearContainer(options);
107
- }
108
- }
109
-
110
- function remove($toastElement) {
111
- var options = getOptions();
112
- if (!$container) { getContainer(options); }
113
- if ($toastElement && $(':focus', $toastElement).length === 0) {
114
- removeToast($toastElement);
115
- return;
116
- }
117
- if ($container.children().length) {
118
- $container.remove();
119
- }
120
- }
121
-
122
- // internal functions
123
-
124
- function clearContainer (options) {
125
- var toastsToClear = $container.children();
126
- for (var i = toastsToClear.length - 1; i >= 0; i--) {
127
- clearToast($(toastsToClear[i]), options);
128
- }
129
- }
130
-
131
- function clearToast ($toastElement, options, clearOptions) {
132
- var force = clearOptions && clearOptions.force ? clearOptions.force : false;
133
- if ($toastElement && (force || $(':focus', $toastElement).length === 0)) {
134
- $toastElement[options.hideMethod]({
135
- duration: options.hideDuration,
136
- easing: options.hideEasing,
137
- complete: function () { removeToast($toastElement); }
138
- });
139
- return true;
140
- }
141
- return false;
142
- }
143
-
144
- function createContainer(options) {
145
- $container = $('<div/>')
146
- .attr('id', options.containerId)
147
- .addClass(options.positionClass)
148
- .attr('aria-live', 'polite')
149
- .attr('role', 'alert');
150
-
151
- $container.appendTo($(options.target));
152
- return $container;
153
- }
154
-
155
- function getDefaults() {
156
- return {
157
- tapToDismiss: true,
158
- toastClass: 'toast',
159
- containerId: 'toast-container',
160
- debug: false,
161
-
162
- showMethod: 'fadeIn', //fadeIn, slideDown, and show are built into jQuery
163
- showDuration: 300,
164
- showEasing: 'swing', //swing and linear are built into jQuery
165
- onShown: undefined,
166
- hideMethod: 'fadeOut',
167
- hideDuration: 1000,
168
- hideEasing: 'swing',
169
- onHidden: undefined,
170
-
171
- extendedTimeOut: 1000,
172
- iconClasses: {
173
- error: 'toast-error',
174
- info: 'toast-info',
175
- success: 'toast-success',
176
- warning: 'toast-warning'
177
- },
178
- iconClass: 'toast-info',
179
- positionClass: 'toast-top-right',
180
- timeOut: 5000, // Set timeOut and extendedTimeOut to 0 to make it sticky
181
- titleClass: 'toast-title',
182
- messageClass: 'toast-message',
183
- target: 'body',
184
- closeHtml: '<button type="button">&times;</button>',
185
- newestOnTop: true,
186
- preventDuplicates: false,
187
- progressBar: false
188
- };
189
- }
190
-
191
- function publish(args) {
192
- if (!listener) { return; }
193
- listener(args);
194
- }
195
-
196
- function notify(map) {
197
- var options = getOptions();
198
- var iconClass = map.iconClass || options.iconClass;
199
-
200
- if (typeof (map.optionsOverride) !== 'undefined') {
201
- options = $.extend(options, map.optionsOverride);
202
- iconClass = map.optionsOverride.iconClass || iconClass;
203
- }
204
-
205
- if (shouldExit(options, map)) { return; }
206
-
207
- toastId++;
208
-
209
- $container = getContainer(options, true);
210
-
211
- var intervalId = null;
212
- var $toastElement = $('<div/>');
213
- var $titleElement = $('<div/>');
214
- var $messageElement = $('<div/>');
215
- var $progressElement = $('<div/>');
216
- var $closeElement = $(options.closeHtml);
217
- var progressBar = {
218
- intervalId: null,
219
- hideEta: null,
220
- maxHideTime: null
221
- };
222
- var response = {
223
- toastId: toastId,
224
- state: 'visible',
225
- startTime: new Date(),
226
- options: options,
227
- map: map
228
- };
229
-
230
- personalizeToast();
231
-
232
- displayToast();
233
-
234
- handleEvents();
235
-
236
- publish(response);
237
-
238
- if (options.debug && console) {
239
- console.log(response);
240
- }
241
-
242
- return $toastElement;
243
-
244
- function personalizeToast() {
245
- setIcon();
246
- setTitle();
247
- setMessage();
248
- setCloseButton();
249
- setProgressBar();
250
- setSequence();
251
- }
252
-
253
- function handleEvents() {
254
- $toastElement.hover(stickAround, delayedHideToast);
255
- if (!options.onclick && options.tapToDismiss) {
256
- $toastElement.click(hideToast);
257
- }
258
-
259
- if (options.closeButton && $closeElement) {
260
- $closeElement.click(function (event) {
261
- if (event.stopPropagation) {
262
- event.stopPropagation();
263
- } else if (event.cancelBubble !== undefined && event.cancelBubble !== true) {
264
- event.cancelBubble = true;
265
- }
266
- hideToast(true);
267
- });
268
- }
269
-
270
- if (options.onclick) {
271
- $toastElement.click(function () {
272
- options.onclick();
273
- hideToast();
274
- });
275
- }
276
- }
277
-
278
- function displayToast() {
279
- $toastElement.hide();
280
-
281
- $toastElement[options.showMethod](
282
- {duration: options.showDuration, easing: options.showEasing, complete: options.onShown}
283
- );
284
-
285
- if (options.timeOut > 0) {
286
- intervalId = setTimeout(hideToast, options.timeOut);
287
- progressBar.maxHideTime = parseFloat(options.timeOut);
288
- progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;
289
- if (options.progressBar) {
290
- progressBar.intervalId = setInterval(updateProgress, 10);
291
- }
292
- }
293
- }
294
-
295
- function setIcon() {
296
- if (map.iconClass) {
297
- $toastElement.addClass(options.toastClass).addClass(iconClass);
298
- }
299
- }
300
-
301
- function setSequence() {
302
- if (options.newestOnTop) {
303
- $container.prepend($toastElement);
304
- } else {
305
- $container.append($toastElement);
306
- }
307
- }
308
-
309
- function setTitle() {
310
- if (map.title) {
311
- $titleElement.append(map.title).addClass(options.titleClass);
312
- $toastElement.append($titleElement);
313
- }
314
- }
315
-
316
- function setMessage() {
317
- if (map.message) {
318
- $messageElement.append(map.message).addClass(options.messageClass);
319
- $toastElement.append($messageElement);
320
- }
321
- }
322
-
323
- function setCloseButton() {
324
- if (options.closeButton) {
325
- $closeElement.addClass('toast-close-button').attr('role', 'button');
326
- $toastElement.prepend($closeElement);
327
- }
328
- }
329
-
330
- function setProgressBar() {
331
- if (options.progressBar) {
332
- $progressElement.addClass('toast-progress');
333
- $toastElement.prepend($progressElement);
334
- }
335
- }
336
-
337
- function shouldExit(options, map) {
338
- if (options.preventDuplicates) {
339
- if (map.message === previousToast) {
340
- return true;
341
- } else {
342
- previousToast = map.message;
343
- }
344
- }
345
- return false;
346
- }
347
-
348
- function hideToast(override) {
349
- if ($(':focus', $toastElement).length && !override) {
350
- return;
351
- }
352
- clearTimeout(progressBar.intervalId);
353
- return $toastElement[options.hideMethod]({
354
- duration: options.hideDuration,
355
- easing: options.hideEasing,
356
- complete: function () {
357
- removeToast($toastElement);
358
- if (options.onHidden && response.state !== 'hidden') {
359
- options.onHidden();
360
- }
361
- response.state = 'hidden';
362
- response.endTime = new Date();
363
- publish(response);
364
- }
365
- });
366
- }
367
-
368
- function delayedHideToast() {
369
- if (options.timeOut > 0 || options.extendedTimeOut > 0) {
370
- intervalId = setTimeout(hideToast, options.extendedTimeOut);
371
- progressBar.maxHideTime = parseFloat(options.extendedTimeOut);
372
- progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;
373
- }
374
- }
375
-
376
- function stickAround() {
377
- clearTimeout(intervalId);
378
- progressBar.hideEta = 0;
379
- $toastElement.stop(true, true)[options.showMethod](
380
- {duration: options.showDuration, easing: options.showEasing}
381
- );
382
- }
383
-
384
- function updateProgress() {
385
- var percentage = ((progressBar.hideEta - (new Date().getTime())) / progressBar.maxHideTime) * 100;
386
- $progressElement.width(percentage + '%');
387
- }
388
- }
389
-
390
- function getOptions() {
391
- return $.extend({}, getDefaults(), toastr.options);
392
- }
393
-
394
- function removeToast($toastElement) {
395
- if (!$container) { $container = getContainer(); }
396
- if ($toastElement.is(':visible')) {
397
- return;
398
- }
399
- $toastElement.remove();
400
- $toastElement = null;
401
- if ($container.children().length === 0) {
402
- $container.remove();
403
- previousToast = undefined;
404
- }
405
- }
406
-
407
- })();
408
- });
409
- }(typeof define === 'function' && define.amd ? define : function (deps, factory) {
410
- if (typeof module !== 'undefined' && module.exports) { //Node
411
- module.exports = factory(require('jquery'));
412
- } else {
413
- window['toastr'] = factory(window['jQuery']);
414
- }
415
- }));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
changelog.md ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ **0.9.14**
2
+ - Fixed can not start a quiz for guest.
3
+ - Fixed course evaluation error and shows wrong message
4
+ - Added "preload icon" for quiz actions and question navigation
5
+ - Added option for instructors registration
6
+ - Updated default language file.
7
+
8
+ **0.9.13.1**
9
+ - Added lacked files.
10
+
11
+ **0.9.13**
12
+ - Fixed profile link problem.
13
+ - Fixed conflict with Woo payments add-on.
14
+ - Added shortcodes to display free courses, paid courses and newest courses.
15
+ - Added shortcodes to display course summary.
16
+ - Provided premium add-on assignments.
17
+ - Provided premium add-on gradebook.
18
+
19
+ **0.9.12**
20
+ - Support languages: Italian, Indonesian, German.
21
+
22
+ **0.9.11**
23
+ - Fixed resets all user settings back to default when re-active LearnPress.
24
+ - Fixed certificates trigger error "header already sent" when saving templates.
25
+ - Made translatable strings in javascript code.
26
+ - Fixed course review add-on error on PHP version 5.3.x.
27
+ - Fixed text domain error on translating plugin.
28
+
29
+ **0.9.10**
30
+ - Fixed bug: Template loader missing header and footer.
31
+ - Updated default language file.
32
+
33
+ **0.9.9**
34
+ - Fixed bug: Course price always showing "FREE" on category page.
35
+ - Updated language Polish.
36
+
37
+ **0.9.8**
38
+ - Fixed wrong placeholder in email settings.
39
+ - Updated addon Certificates for GUI and functions with more options
40
+ - Used Google Fonts instead of True Type Font (*.ttf)
41
+ - Color picker
42
+ - Text align (vertical and horizontal)
43
+ - Text rotation
44
+ - Text transform ( scale X and scale Y)
45
+ - More options to display the name of a user:
46
+ + User login
47
+ + User nice name
48
+ + Nickname
49
+ + First name
50
+ + Last name
51
+ + First name then Last name
52
+ + Last name then First name
53
+ - Support Dutch and French (special thank to Bart Kleijheeg and fxbenard)
54
+
55
+ **0.9.7**
56
+ Fixed wrong query of quizzes result in Profile.
57
+
58
+ **0.9.6**
59
+ - Fix translation textdomain error - Thank polischmen for your concern.
60
+ - Updated question hint
61
+ - Option to set course is public or enrolled require
62
+ - Certificates add-on:
63
+ - Add more fonts
64
+ - Option to display the full name with {firstname}=User first name and {lastname}=User last name
65
+ - Option to format date
66
+ - Created a sample Certificate when plugin is activated
67
+
68
+
69
+ **0.9.5**
70
+ - Added showing question answer and explaination feature
71
+ - Fixed bugs for addon Fill In Blank question
72
+ - Fixed bugs for addon Sorting Choice question
73
+ - Fixed bugs for addon Certificates
74
+ - Fixed bugs for addon WooCommerce Payment
75
+ - Prevent access to lesson directly by using permalink
76
+ - Random quiz questions addon (premium add-on)
77
+ - Content Drip addon (premium add-on)
78
+ - Support multi language
79
+
80
+ **0.9.4**
81
+ - Set up sample data for LearnPress
82
+ - Provided sorting question type (you can find it in premium add-on list)
83
+ - Provided fill in blank question type (we are uploading it to WordPress.org so if you cannot find it, wait for it to be available soon)
84
+ - Fixed bug profile template
85
+ - Updated LearnPress profile method
86
+
87
+ **0.9.3**
88
+ - Fix menu position problem (3.14).
89
+ - Fix bug shortcut key @l to insert lesson link when writing a lesson.
90
+ - Fix bug when add Lesson/Quiz into a section but it is not assigned to the course.
91
+ - List the addons from wordpress.org in addons page.
92
+ - Add new option into settings page lets to choose the page to display form "Become a teacher".
93
+ - Add shortcode to insert form "Become a teacher".
94
+ - Update lesson/quiz title also update its slug.
95
+ - Align review form to center of the page.
96
+ - Course review pagination.
97
+ - Provide related courses function.
98
+ - Support full width embed video.
99
+
100
+ **0.9.2**
101
+ - Update add-on management page.
102
+ - Add auto next lesson after complete a quiz feature.
103
+ - Fix course-review bugs.
104
+ - Fix bug on curriculum when use "shift + (" or "shift+&" ..... to edit Lesson title or Section title.
105
+ - Fix course result bug.
106
+ - Fix export/import addon - sometime the image is not imported.
107
+ - Fix bug show certificate after user finished a course.
108
+
109
+ **0.9.1**
110
+ The first beta release.
111
+
112
+ **Upgrade Notice**
113
+ *0.9.2*
114
+ We have changed directory structure and separated all out core add-ons to become independence plugins, so after upgrading version, if you face any add-ons problems, please completely delete the old version and re-install LearnPress. Thank!
dummy-data/dummy-data.xml ADDED
@@ -0,0 +1,1453 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8" ?>
2
+ <rss version="2.0"
3
+ xmlns:excerpt="http://wordpress.org/export/LPR_EXPORT_VER/excerpt/"
4
+ xmlns:content="http://purl.org/rss/1.0/modules/content/"
5
+ xmlns:wfw="http://wellformedweb.org/CommentAPI/"
6
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
7
+ xmlns:wp="http://wordpress.org/export/LPR_EXPORT_VER/"
8
+ >
9
+ <channel>
10
+ <title>DEV LearnPress 1.0</title>
11
+ <link>http://localhost/foobla/learnpress/1.0</link>
12
+ <description>Just another WordPress site</description>
13
+ <pubDate>Sat, 09 Jan 2016 07:59:54 +0000</pubDate>
14
+ <language>en-US</language>
15
+ <wp:wxr_version>1.0</wp:wxr_version>
16
+ <wp:base_site_url>http://localhost/foobla/learnpress/1.0</wp:base_site_url>
17
+ <wp:base_blog_url>http://localhost/foobla/learnpress/1.0</wp:base_blog_url>
18
+ <wp:plugin_name>learnpress</wp:plugin_name>
19
+ <wp:plugin_version>1.0</wp:plugin_version>
20
+ <wp:author><wp:author_id>1</wp:author_id><wp:author_login>admin</wp:author_login><wp:author_email>tunnhn@gmail.com</wp:author_email><wp:author_display_name><![CDATA[admin]]></wp:author_display_name><wp:author_first_name><![CDATA[]]></wp:author_first_name><wp:author_last_name><![CDATA[]]></wp:author_last_name></wp:author>
21
+ <item>
22
+ <title>This is a new course</title>
23
+ <link>http://localhost/foobla/learnpress/1.0/dao-tao-cac-khoa-hoc-onine/this-is-a-new-course/</link>
24
+ <pubDate>Wed, 11 Nov 2015 10:45:53 +0000</pubDate>
25
+ <dc:creator><![CDATA[admin]]></dc:creator>
26
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/?post_type=lp_course&#038;p=873</guid>
27
+ <description></description>
28
+ <content:encoded><![CDATA[]]></content:encoded>
29
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
30
+ <wp:post_id>1511</wp:post_id>
31
+ <wp:post_date>2015-11-11 10:45:53</wp:post_date>
32
+ <wp:post_date_gmt>2015-11-11 10:45:53</wp:post_date_gmt>
33
+ <wp:comment_status>open</wp:comment_status>
34
+ <wp:ping_status>open</wp:ping_status>
35
+ <wp:post_name>this-is-a-new-course</wp:post_name>
36
+ <wp:status>publish</wp:status>
37
+ <wp:post_parent>0</wp:post_parent>
38
+ <wp:menu_order>0</wp:menu_order>
39
+ <wp:post_type>lp_course</wp:post_type>
40
+ <wp:post_password></wp:post_password>
41
+ <wp:post_author_id>1</wp:post_author_id>
42
+ <wp:is_sticky>0</wp:is_sticky>
43
+ <wp:postmeta>
44
+ <wp:meta_key>_edit_lock</wp:meta_key>
45
+ <wp:meta_value><![CDATA[1451441611:1]]></wp:meta_value>
46
+ </wp:postmeta> <wp:postmeta>
47
+ <wp:meta_key>_edit_last</wp:meta_key>
48
+ <wp:meta_value><![CDATA[1]]></wp:meta_value>
49
+ </wp:postmeta> <wp:postmeta>
50
+ <wp:meta_key>_lp_duration</wp:meta_key>
51
+ <wp:meta_value><![CDATA[10]]></wp:meta_value>
52
+ </wp:postmeta> <wp:postmeta>
53
+ <wp:meta_key>_lp_max_students</wp:meta_key>
54
+ <wp:meta_value><![CDATA[1000]]></wp:meta_value>
55
+ </wp:postmeta> <wp:postmeta>
56
+ <wp:meta_key>_lp_students</wp:meta_key>
57
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
58
+ </wp:postmeta> <wp:postmeta>
59
+ <wp:meta_key>_lp_retake_count</wp:meta_key>
60
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
61
+ </wp:postmeta> <wp:postmeta>
62
+ <wp:meta_key>_lp_passing_condition</wp:meta_key>
63
+ <wp:meta_value><![CDATA[50]]></wp:meta_value>
64
+ </wp:postmeta> <wp:postmeta>
65
+ <wp:meta_key>_lp_enroll_requirement</wp:meta_key>
66
+ <wp:meta_value><![CDATA[yes]]></wp:meta_value>
67
+ </wp:postmeta> <wp:postmeta>
68
+ <wp:meta_key>_lp_payment</wp:meta_key>
69
+ <wp:meta_value><![CDATA[free]]></wp:meta_value>
70
+ </wp:postmeta> <wp:postmeta>
71
+ <wp:meta_key>_lpr_course_lesson_quiz</wp:meta_key>
72
+ <wp:meta_value><![CDATA[]]></wp:meta_value>
73
+ </wp:postmeta> <wp:postmeta>
74
+ <wp:meta_key>_lp_course_status</wp:meta_key>
75
+ <wp:meta_value><![CDATA[publish]]></wp:meta_value>
76
+ </wp:postmeta> <wp:postmeta>
77
+ <wp:meta_key>_lp_curriculum</wp:meta_key>
78
+ <wp:meta_value><![CDATA[a:1:{i:0;a:3:{s:4:"name";s:10:"Section #1";s:11:"description";s:0:"";s:5:"items";a:2:{i:614;a:5:{s:4:"name";s:18:"word wide web 2222";s:8:"old_name";s:13:"word wide web";s:7:"item_id";s:4:"1232";s:15:"section_item_id";s:3:"614";s:9:"post_type";s:9:"lp_lesson";}s:6:"item-1";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}}]]></wp:meta_value>
79
+ </wp:postmeta>
80
+ <wp:section>
81
+ <wp:section_id>207</wp:section_id>
82
+ <wp:section_name>Section #1</wp:section_name>
83
+ <wp:section_course_id>1511</wp:section_course_id>
84
+ <wp:section_order>1</wp:section_order>
85
+ <wp:section_description><![CDATA[]]></wp:section_description>
86
+ <wp:section_item>
87
+ <wp:section_id>207</wp:section_id>
88
+ <wp:item_id>1512</wp:item_id>
89
+ <wp:item_order>1</wp:item_order>
90
+ <wp:item_type>lp_lesson</wp:item_type>
91
+ </wp:section_item>
92
+ </wp:section>
93
+
94
+ </item><item>
95
+ <title>word wide web 2222</title>
96
+ <link>http://localhost/foobla/learnpress/1.0/lessons/wwwwwwwwwwwwwwwwwwww/</link>
97
+ <pubDate>Wed, 30 Dec 2015 02:06:58 +0000</pubDate>
98
+ <dc:creator><![CDATA[admin]]></dc:creator>
99
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/?post_type=lp_lesson&#038;p=1232</guid>
100
+ <description></description>
101
+ <content:encoded><![CDATA[]]></content:encoded>
102
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
103
+ <wp:post_id>1512</wp:post_id>
104
+ <wp:post_date>2015-12-30 02:06:58</wp:post_date>
105
+ <wp:post_date_gmt>2015-12-30 02:06:58</wp:post_date_gmt>
106
+ <wp:comment_status>closed</wp:comment_status>
107
+ <wp:ping_status>closed</wp:ping_status>
108
+ <wp:post_name>wwwwwwwwwwwwwwwwwwww</wp:post_name>
109
+ <wp:status>publish</wp:status>
110
+ <wp:post_parent>0</wp:post_parent>
111
+ <wp:menu_order>0</wp:menu_order>
112
+ <wp:post_type>lp_lesson</wp:post_type>
113
+ <wp:post_password></wp:post_password>
114
+ <wp:post_author_id>1</wp:post_author_id>
115
+ <wp:is_sticky>0</wp:is_sticky>
116
+ <wp:postmeta>
117
+ <wp:meta_key>_edit_lock</wp:meta_key>
118
+ <wp:meta_value><![CDATA[1451443416:1]]></wp:meta_value>
119
+ </wp:postmeta>
120
+ </item> <item>
121
+ <title>What should be here?</title>
122
+ <link>http://localhost/foobla/learnpress/1.0/dao-tao-cac-khoa-hoc-onine/what-should-be-here/</link>
123
+ <pubDate>Fri, 04 Dec 2015 07:08:08 +0000</pubDate>
124
+ <dc:creator><![CDATA[admin]]></dc:creator>
125
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/?post_type=lp_course&#038;p=908</guid>
126
+ <description></description>
127
+ <content:encoded><![CDATA[Phasellus accumsan cursus velit. Phasellus nec sem in justo pellentesque facilisis. Fusce vel dui. Integer tincidunt. Quisque id odio.
128
+
129
+ Sed hendrerit. Morbi mattis ullamcorper velit. Phasellus dolor. Sed libero. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem.
130
+
131
+ Sed magna purus, fermentum eu, tincidunt eu, varius ut, felis. Phasellus tempus. Donec posuere vulputate arcu. Aenean posuere, tortor sed cursus feugiat, nunc augue blandit nunc, eu sollicitudin urna dolor sagittis lacus. Sed a libero.
132
+
133
+ Nam eget dui. Quisque ut nisi. Curabitur ligula sapien, tincidunt non, euismod vitae, posuere imperdiet, leo. Nunc nec neque. Pellentesque libero tortor, tincidunt et, tincidunt eget, semper nec, quam.
134
+
135
+ Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Vestibulum suscipit nulla quis orci. Fusce ac felis sit amet ligula pharetra condimentum. Vestibulum fringilla pede sit amet augue. Etiam rhoncus.]]></content:encoded>
136
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
137
+ <wp:post_id>1513</wp:post_id>
138
+ <wp:post_date>2015-12-04 07:08:08</wp:post_date>
139
+ <wp:post_date_gmt>2015-12-04 07:08:08</wp:post_date_gmt>
140
+ <wp:comment_status>open</wp:comment_status>
141
+ <wp:ping_status>open</wp:ping_status>
142
+ <wp:post_name>what-should-be-here</wp:post_name>
143
+ <wp:status>publish</wp:status>
144
+ <wp:post_parent>0</wp:post_parent>
145
+ <wp:menu_order>0</wp:menu_order>
146
+ <wp:post_type>lp_course</wp:post_type>
147
+ <wp:post_password></wp:post_password>
148
+ <wp:post_author_id>1</wp:post_author_id>
149
+ <wp:is_sticky>0</wp:is_sticky>
150
+ <category domain="course_category" nicename="it" id="18" parent="0" description=" "><![CDATA[IT]]></category>
151
+ <category domain="course_category" nicename="software" id="19" parent="18" description=" "><![CDATA[Software]]></category>
152
+ <wp:postmeta>
153
+ <wp:meta_key>_edit_lock</wp:meta_key>
154
+ <wp:meta_value><![CDATA[1452319104:1]]></wp:meta_value>
155
+ </wp:postmeta> <wp:postmeta>
156
+ <wp:meta_key>_edit_last</wp:meta_key>
157
+ <wp:meta_value><![CDATA[1]]></wp:meta_value>
158
+ </wp:postmeta> <wp:postmeta>
159
+ <wp:meta_key>_admin_hidden_sections</wp:meta_key>
160
+ <wp:meta_value><![CDATA[a:5:{i:0;s:3:"132";i:1;s:3:"133";i:2;s:3:"134";i:3;s:3:"135";i:4;s:0:"";}]]></wp:meta_value>
161
+ </wp:postmeta> <wp:postmeta>
162
+ <wp:meta_key>_lpr_course_lesson_quiz</wp:meta_key>
163
+ <wp:meta_value><![CDATA[]]></wp:meta_value>
164
+ </wp:postmeta> <wp:postmeta>
165
+ <wp:meta_key>_lp_curriculum</wp:meta_key>
166
+ <wp:meta_value><![CDATA[a:6:{i:0;a:3:{s:4:"name";s:10:"Section #1";s:11:"description";s:33:"asd asd asdasd asdasd asdasd asda";s:5:"items";a:15:{i:615;a:5:{s:4:"name";s:12:"333333333333";s:8:"old_name";s:12:"333333333333";s:7:"item_id";s:4:"1146";s:15:"section_item_id";s:3:"615";s:9:"post_type";s:7:"lp_quiz";}i:616;a:5:{s:4:"name";s:18:"where are you now?";s:8:"old_name";s:18:"where are you now?";s:7:"item_id";s:4:"1148";s:15:"section_item_id";s:3:"616";s:9:"post_type";s:9:"lp_lesson";}i:617;a:5:{s:4:"name";s:21:"I am here, beside you";s:8:"old_name";s:21:"I am here, beside you";s:7:"item_id";s:4:"1149";s:15:"section_item_id";s:3:"617";s:9:"post_type";s:7:"lp_quiz";}i:618;a:5:{s:4:"name";s:9:"asdasdasd";s:8:"old_name";s:9:"asdasdasd";s:7:"item_id";s:4:"1143";s:15:"section_item_id";s:3:"618";s:9:"post_type";s:9:"lp_lesson";}i:619;a:5:{s:4:"name";s:9:"dsfsdfsdf";s:8:"old_name";s:9:"dsfsdfsdf";s:7:"item_id";s:4:"1144";s:15:"section_item_id";s:3:"619";s:9:"post_type";s:9:"lp_lesson";}i:620;a:5:{s:4:"name";s:8:"Lesson 1";s:8:"old_name";s:8:"Lesson 1";s:7:"item_id";s:4:"1139";s:15:"section_item_id";s:3:"620";s:9:"post_type";s:9:"lp_lesson";}i:621;a:5:{s:4:"name";s:8:"Lesson 2";s:8:"old_name";s:8:"Lesson 2";s:7:"item_id";s:4:"1140";s:15:"section_item_id";s:3:"621";s:9:"post_type";s:9:"lp_lesson";}i:622;a:5:{s:4:"name";s:8:"Lesson 3";s:8:"old_name";s:8:"Lesson 3";s:7:"item_id";s:4:"1142";s:15:"section_item_id";s:3:"622";s:9:"post_type";s:9:"lp_lesson";}i:623;a:5:{s:4:"name";s:17:"qqqqqqqqqqqqqqqqq";s:8:"old_name";s:17:"qqqqqqqqqqqqqqqqq";s:7:"item_id";s:4:"1153";s:15:"section_item_id";s:3:"623";s:9:"post_type";s:9:"lp_lesson";}i:624;a:5:{s:4:"name";s:10:"trau va bo";s:8:"old_name";s:10:"trau va bo";s:7:"item_id";s:4:"1154";s:15:"section_item_id";s:3:"624";s:9:"post_type";s:9:"lp_lesson";}i:625;a:5:{s:4:"name";s:19:"adasdasdasda asd as";s:8:"old_name";s:19:"adasdasdasda asd as";s:7:"item_id";s:4:"1164";s:15:"section_item_id";s:3:"625";s:9:"post_type";s:9:"lp_lesson";}i:626;a:5:{s:4:"name";s:19:"asd asda sdasdas da";s:8:"old_name";s:19:"asd asda sdasdas da";s:7:"item_id";s:4:"1165";s:15:"section_item_id";s:3:"626";s:9:"post_type";s:9:"lp_lesson";}i:627;a:5:{s:4:"name";s:16:"asdasdasdasdasda";s:8:"old_name";s:16:"asdasdasdasdasda";s:7:"item_id";s:4:"1166";s:15:"section_item_id";s:3:"627";s:9:"post_type";s:9:"lp_lesson";}i:628;a:5:{s:4:"name";s:18:"assasdasdasdasdasd";s:8:"old_name";s:18:"assasdasdasdasdasd";s:7:"item_id";s:4:"1167";s:15:"section_item_id";s:3:"628";s:9:"post_type";s:9:"lp_lesson";}s:7:"item-14";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}i:1;a:3:{s:4:"name";s:10:"Section #2";s:11:"description";s:49:"asdas das d asdas das asdasd asdas dasdas dasdasd";s:5:"items";a:5:{i:629;a:5:{s:4:"name";s:22:"How to create a course";s:8:"old_name";s:22:"How to create a course";s:7:"item_id";s:4:"1169";s:15:"section_item_id";s:3:"629";s:9:"post_type";s:9:"lp_lesson";}i:630;a:5:{s:4:"name";s:17:"What is your name";s:8:"old_name";s:17:"What is your name";s:7:"item_id";s:4:"1170";s:15:"section_item_id";s:3:"630";s:9:"post_type";s:9:"lp_lesson";}i:631;a:5:{s:4:"name";s:20:"My name is Tu Nguyen";s:8:"old_name";s:20:"My name is Tu Nguyen";s:7:"item_id";s:4:"1171";s:15:"section_item_id";s:3:"631";s:9:"post_type";s:9:"lp_lesson";}i:632;a:5:{s:4:"name";s:23:"sdfsdfsdf sdf sdf sdf s";s:8:"old_name";s:23:"sdfsdfsdf sdf sdf sdf s";s:7:"item_id";s:4:"1168";s:15:"section_item_id";s:3:"632";s:9:"post_type";s:7:"lp_quiz";}s:6:"item-4";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}i:2;a:3:{s:4:"name";s:10:"Section #3";s:11:"description";s:0:"";s:5:"items";a:2:{i:633;a:5:{s:4:"name";s:14:"sdfsd fsd fsdf";s:8:"old_name";s:14:"sdfsd fsd fsdf";s:7:"item_id";s:4:"1172";s:15:"section_item_id";s:3:"633";s:9:"post_type";s:7:"lp_quiz";}s:6:"item-1";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}i:3;a:3:{s:4:"name";s:10:"Section #4";s:11:"description";s:0:"";s:5:"items";a:2:{i:634;a:5:{s:4:"name";s:22:"sdf sdfsd fsdf sdfsd f";s:8:"old_name";s:22:"sdf sdfsd fsdf sdfsd f";s:7:"item_id";s:4:"1173";s:15:"section_item_id";s:3:"634";s:9:"post_type";s:7:"lp_quiz";}s:6:"item-1";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}i:4;a:3:{s:4:"name";s:10:"Section #5";s:11:"description";s:0:"";s:5:"items";a:6:{i:635;a:5:{s:4:"name";s:15:"happy new year!";s:8:"old_name";s:15:"happy new year!";s:7:"item_id";s:4:"1228";s:15:"section_item_id";s:3:"635";s:9:"post_type";s:9:"lp_lesson";}i:636;a:5:{s:4:"name";s:15:"happy new year!";s:8:"old_name";s:15:"happy new year!";s:7:"item_id";s:4:"1229";s:15:"section_item_id";s:3:"636";s:9:"post_type";s:9:"lp_lesson";}i:637;a:5:{s:4:"name";s:8:"Lesson 1";s:8:"old_name";s:8:"Lesson 1";s:7:"item_id";s:4:"1136";s:15:"section_item_id";s:3:"637";s:9:"post_type";s:9:"lp_lesson";}i:638;a:5:{s:4:"name";s:8:"Lesson 2";s:8:"old_name";s:8:"Lesson 2";s:7:"item_id";s:4:"1137";s:15:"section_item_id";s:3:"638";s:9:"post_type";s:9:"lp_lesson";}i:639;a:5:{s:4:"name";s:18:"oi troi oi la troi";s:8:"old_name";s:18:"oi troi oi la troi";s:7:"item_id";s:4:"1230";s:15:"section_item_id";s:3:"639";s:9:"post_type";s:9:"lp_lesson";}s:6:"item-5";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}i:5;a:3:{s:4:"name";s:10:"Section #6";s:11:"description";s:0:"";s:5:"items";a:4:{i:640;a:5:{s:4:"name";s:12:"333333333333";s:8:"old_name";s:12:"333333333333";s:7:"item_id";s:4:"1145";s:15:"section_item_id";s:3:"640";s:9:"post_type";s:9:"lp_lesson";}i:641;a:5:{s:4:"name";s:8:"44444444";s:8:"old_name";s:8:"44444444";s:7:"item_id";s:4:"1227";s:15:"section_item_id";s:3:"641";s:9:"post_type";s:9:"lp_lesson";}i:642;a:5:{s:4:"name";s:6:"cookie";s:8:"old_name";s:6:"cookie";s:7:"item_id";s:4:"1231";s:15:"section_item_id";s:3:"642";s:9:"post_type";s:9:"lp_lesson";}s:6:"item-3";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}}]]></wp:meta_value>
167
+ </wp:postmeta> <wp:postmeta>
168
+ <wp:meta_key>_lp_duration</wp:meta_key>
169
+ <wp:meta_value><![CDATA[10]]></wp:meta_value>
170
+ </wp:postmeta> <wp:postmeta>
171
+ <wp:meta_key>_lp_max_students</wp:meta_key>
172
+ <wp:meta_value><![CDATA[1000]]></wp:meta_value>
173
+ </wp:postmeta> <wp:postmeta>
174
+ <wp:meta_key>_lp_students</wp:meta_key>
175
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
176
+ </wp:postmeta> <wp:postmeta>
177
+ <wp:meta_key>_lp_retake_count</wp:meta_key>
178
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
179
+ </wp:postmeta> <wp:postmeta>
180
+ <wp:meta_key>_lp_passing_condition</wp:meta_key>
181
+ <wp:meta_value><![CDATA[50]]></wp:meta_value>
182
+ </wp:postmeta> <wp:postmeta>
183
+ <wp:meta_key>_lp_enroll_requirement</wp:meta_key>
184
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
185
+ </wp:postmeta> <wp:postmeta>
186
+ <wp:meta_key>_lp_payment</wp:meta_key>
187
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
188
+ </wp:postmeta> <wp:postmeta>
189
+ <wp:meta_key>_lp_course_status</wp:meta_key>
190
+ <wp:meta_value><![CDATA[publish]]></wp:meta_value>
191
+ </wp:postmeta> <wp:postmeta>
192
+ <wp:meta_key>_lp_course_result</wp:meta_key>
193
+ <wp:meta_value><![CDATA[evaluate_lesson]]></wp:meta_value>
194
+ </wp:postmeta> <wp:postmeta>
195
+ <wp:meta_key>_lp_required_enroll</wp:meta_key>
196
+ <wp:meta_value><![CDATA[yes]]></wp:meta_value>
197
+ </wp:postmeta>
198
+ <wp:section>
199
+ <wp:section_id>208</wp:section_id>
200
+ <wp:section_name>Section #1</wp:section_name>
201
+ <wp:section_course_id>1513</wp:section_course_id>
202
+ <wp:section_order>1</wp:section_order>
203
+ <wp:section_description><![CDATA[asd asd asdasd asdasd asdasd asda]]></wp:section_description>
204
+ <wp:section_item>
205
+ <wp:section_id>208</wp:section_id>
206
+ <wp:item_id>1514</wp:item_id>
207
+ <wp:item_order>1</wp:item_order>
208
+ <wp:item_type>lp_quiz</wp:item_type>
209
+ </wp:section_item>
210
+ <wp:section_item>
211
+ <wp:section_id>208</wp:section_id>
212
+ <wp:item_id>1515</wp:item_id>
213
+ <wp:item_order>2</wp:item_order>
214
+ <wp:item_type>lp_lesson</wp:item_type>
215
+ </wp:section_item>
216
+ <wp:section_item>
217
+ <wp:section_id>208</wp:section_id>
218
+ <wp:item_id>1516</wp:item_id>
219
+ <wp:item_order>3</wp:item_order>
220
+ <wp:item_type>lp_quiz</wp:item_type>
221
+ </wp:section_item>
222
+ <wp:section_item>
223
+ <wp:section_id>208</wp:section_id>
224
+ <wp:item_id>1517</wp:item_id>
225
+ <wp:item_order>4</wp:item_order>
226
+ <wp:item_type>lp_lesson</wp:item_type>
227
+ </wp:section_item>
228
+ <wp:section_item>
229
+ <wp:section_id>208</wp:section_id>
230
+ <wp:item_id>1518</wp:item_id>
231
+ <wp:item_order>5</wp:item_order>
232
+ <wp:item_type>lp_lesson</wp:item_type>
233
+ </wp:section_item>
234
+ <wp:section_item>
235
+ <wp:section_id>208</wp:section_id>
236
+ <wp:item_id>1519</wp:item_id>
237
+ <wp:item_order>6</wp:item_order>
238
+ <wp:item_type>lp_lesson</wp:item_type>
239
+ </wp:section_item>
240
+ <wp:section_item>
241
+ <wp:section_id>208</wp:section_id>
242
+ <wp:item_id>1520</wp:item_id>
243
+ <wp:item_order>7</wp:item_order>
244
+ <wp:item_type>lp_lesson</wp:item_type>
245
+ </wp:section_item>
246
+ <wp:section_item>
247
+ <wp:section_id>208</wp:section_id>
248
+ <wp:item_id>1521</wp:item_id>
249
+ <wp:item_order>8</wp:item_order>
250
+ <wp:item_type>lp_lesson</wp:item_type>
251
+ </wp:section_item>
252
+ <wp:section_item>
253
+ <wp:section_id>208</wp:section_id>
254
+ <wp:item_id>1522</wp:item_id>
255
+ <wp:item_order>9</wp:item_order>
256
+ <wp:item_type>lp_lesson</wp:item_type>
257
+ </wp:section_item>
258
+ <wp:section_item>
259
+ <wp:section_id>208</wp:section_id>
260
+ <wp:item_id>1523</wp:item_id>
261
+ <wp:item_order>10</wp:item_order>
262
+ <wp:item_type>lp_lesson</wp:item_type>
263
+ </wp:section_item>
264
+ <wp:section_item>
265
+ <wp:section_id>208</wp:section_id>
266
+ <wp:item_id>1524</wp:item_id>
267
+ <wp:item_order>11</wp:item_order>
268
+ <wp:item_type>lp_lesson</wp:item_type>
269
+ </wp:section_item>
270
+ <wp:section_item>
271
+ <wp:section_id>208</wp:section_id>
272
+ <wp:item_id>1525</wp:item_id>
273
+ <wp:item_order>12</wp:item_order>
274
+ <wp:item_type>lp_lesson</wp:item_type>
275
+ </wp:section_item>
276
+ <wp:section_item>
277
+ <wp:section_id>208</wp:section_id>
278
+ <wp:item_id>1526</wp:item_id>
279
+ <wp:item_order>13</wp:item_order>
280
+ <wp:item_type>lp_lesson</wp:item_type>
281
+ </wp:section_item>
282
+ <wp:section_item>
283
+ <wp:section_id>208</wp:section_id>
284
+ <wp:item_id>1527</wp:item_id>
285
+ <wp:item_order>14</wp:item_order>
286
+ <wp:item_type>lp_lesson</wp:item_type>
287
+ </wp:section_item>
288
+ </wp:section>
289
+
290
+ <wp:section>
291
+ <wp:section_id>209</wp:section_id>
292
+ <wp:section_name>Section #2</wp:section_name>
293
+ <wp:section_course_id>1513</wp:section_course_id>
294
+ <wp:section_order>2</wp:section_order>
295
+ <wp:section_description><![CDATA[asdas das d asdas das asdasd asdas dasdas dasdasd]]></wp:section_description>
296
+ <wp:section_item>
297
+ <wp:section_id>209</wp:section_id>
298
+ <wp:item_id>1528</wp:item_id>
299
+ <wp:item_order>1</wp:item_order>
300
+ <wp:item_type>lp_lesson</wp:item_type>
301
+ </wp:section_item>
302
+ <wp:section_item>
303
+ <wp:section_id>209</wp:section_id>
304
+ <wp:item_id>1529</wp:item_id>
305
+ <wp:item_order>2</wp:item_order>
306
+ <wp:item_type>lp_lesson</wp:item_type>
307
+ </wp:section_item>
308
+ <wp:section_item>
309
+ <wp:section_id>209</wp:section_id>
310
+ <wp:item_id>1530</wp:item_id>
311
+ <wp:item_order>3</wp:item_order>
312
+ <wp:item_type>lp_lesson</wp:item_type>
313
+ </wp:section_item>
314
+ <wp:section_item>
315
+ <wp:section_id>209</wp:section_id>
316
+ <wp:item_id>1531</wp:item_id>
317
+ <wp:item_order>4</wp:item_order>
318
+ <wp:item_type>lp_quiz</wp:item_type>
319
+ </wp:section_item>
320
+ </wp:section>
321
+
322
+ <wp:section>
323
+ <wp:section_id>210</wp:section_id>
324
+ <wp:section_name>Section #3</wp:section_name>
325
+ <wp:section_course_id>1513</wp:section_course_id>
326
+ <wp:section_order>3</wp:section_order>
327
+ <wp:section_description><![CDATA[]]></wp:section_description>
328
+ <wp:section_item>
329
+ <wp:section_id>210</wp:section_id>
330
+ <wp:item_id>1532</wp:item_id>
331
+ <wp:item_order>1</wp:item_order>
332
+ <wp:item_type>lp_quiz</wp:item_type>
333
+ </wp:section_item>
334
+ </wp:section>
335
+
336
+ <wp:section>
337
+ <wp:section_id>211</wp:section_id>
338
+ <wp:section_name>Section #4</wp:section_name>
339
+ <wp:section_course_id>1513</wp:section_course_id>
340
+ <wp:section_order>4</wp:section_order>
341
+ <wp:section_description><![CDATA[]]></wp:section_description>
342
+ <wp:section_item>
343
+ <wp:section_id>211</wp:section_id>
344
+ <wp:item_id>1533</wp:item_id>
345
+ <wp:item_order>1</wp:item_order>
346
+ <wp:item_type>lp_quiz</wp:item_type>
347
+ </wp:section_item>
348
+ </wp:section>
349
+
350
+ <wp:section>
351
+ <wp:section_id>212</wp:section_id>
352
+ <wp:section_name>Section #5</wp:section_name>
353
+ <wp:section_course_id>1513</wp:section_course_id>
354
+ <wp:section_order>5</wp:section_order>
355
+ <wp:section_description><![CDATA[]]></wp:section_description>
356
+ <wp:section_item>
357
+ <wp:section_id>212</wp:section_id>
358
+ <wp:item_id>1534</wp:item_id>
359
+ <wp:item_order>1</wp:item_order>
360
+ <wp:item_type>lp_lesson</wp:item_type>
361
+ </wp:section_item>
362
+ <wp:section_item>
363
+ <wp:section_id>212</wp:section_id>
364
+ <wp:item_id>1535</wp:item_id>
365
+ <wp:item_order>2</wp:item_order>
366
+ <wp:item_type>lp_lesson</wp:item_type>
367
+ </wp:section_item>
368
+ <wp:section_item>
369
+ <wp:section_id>212</wp:section_id>
370
+ <wp:item_id>1536</wp:item_id>
371
+ <wp:item_order>3</wp:item_order>
372
+ <wp:item_type>lp_lesson</wp:item_type>
373
+ </wp:section_item>
374
+ <wp:section_item>
375
+ <wp:section_id>212</wp:section_id>
376
+ <wp:item_id>1537</wp:item_id>
377
+ <wp:item_order>4</wp:item_order>
378
+ <wp:item_type>lp_lesson</wp:item_type>
379
+ </wp:section_item>
380
+ <wp:section_item>
381
+ <wp:section_id>212</wp:section_id>
382
+ <wp:item_id>1538</wp:item_id>
383
+ <wp:item_order>5</wp:item_order>
384
+ <wp:item_type>lp_lesson</wp:item_type>
385
+ </wp:section_item>
386
+ </wp:section>
387
+
388
+ <wp:section>
389
+ <wp:section_id>213</wp:section_id>
390
+ <wp:section_name>Section #6</wp:section_name>
391
+ <wp:section_course_id>1513</wp:section_course_id>
392
+ <wp:section_order>6</wp:section_order>
393
+ <wp:section_description><![CDATA[]]></wp:section_description>
394
+ <wp:section_item>
395
+ <wp:section_id>213</wp:section_id>
396
+ <wp:item_id>1539</wp:item_id>
397
+ <wp:item_order>1</wp:item_order>
398
+ <wp:item_type>lp_lesson</wp:item_type>
399
+ </wp:section_item>
400
+ <wp:section_item>
401
+ <wp:section_id>213</wp:section_id>
402
+ <wp:item_id>1540</wp:item_id>
403
+ <wp:item_order>2</wp:item_order>
404
+ <wp:item_type>lp_lesson</wp:item_type>
405
+ </wp:section_item>
406
+ <wp:section_item>
407
+ <wp:section_id>213</wp:section_id>
408
+ <wp:item_id>1541</wp:item_id>
409
+ <wp:item_order>3</wp:item_order>
410
+ <wp:item_type>lp_lesson</wp:item_type>
411
+ </wp:section_item>
412
+ </wp:section>
413
+
414
+ </item><item>
415
+ <title>333333333333</title>
416
+ <link>http://localhost/foobla/learnpress/1.0/quizzes/333333333333-2/</link>
417
+ <pubDate>Tue, 08 Dec 2015 04:19:22 +0000</pubDate>
418
+ <dc:creator><![CDATA[admin]]></dc:creator>
419
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/quizzes/333333333333-2/</guid>
420
+ <description></description>
421
+ <content:encoded><![CDATA[]]></content:encoded>
422
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
423
+ <wp:post_id>1514</wp:post_id>
424
+ <wp:post_date>2015-12-08 04:19:22</wp:post_date>
425
+ <wp:post_date_gmt>2015-12-08 04:19:22</wp:post_date_gmt>
426
+ <wp:comment_status>open</wp:comment_status>
427
+ <wp:ping_status>open</wp:ping_status>
428
+ <wp:post_name>333333333333-2</wp:post_name>
429
+ <wp:status>publish</wp:status>
430
+ <wp:post_parent>0</wp:post_parent>
431
+ <wp:menu_order>0</wp:menu_order>
432
+ <wp:post_type>lp_quiz</wp:post_type>
433
+ <wp:post_password></wp:post_password>
434
+ <wp:post_author_id>1</wp:post_author_id>
435
+ <wp:is_sticky>0</wp:is_sticky>
436
+ <wp:postmeta>
437
+ <wp:meta_key>_edit_lock</wp:meta_key>
438
+ <wp:meta_value><![CDATA[1451469598:1]]></wp:meta_value>
439
+ </wp:postmeta> <wp:postmeta>
440
+ <wp:meta_key>_edit_last</wp:meta_key>
441
+ <wp:meta_value><![CDATA[1]]></wp:meta_value>
442
+ </wp:postmeta> <wp:postmeta>
443
+ <wp:meta_key>_lp_duration</wp:meta_key>
444
+ <wp:meta_value><![CDATA[10]]></wp:meta_value>
445
+ </wp:postmeta> <wp:postmeta>
446
+ <wp:meta_key>_lp_show_result</wp:meta_key>
447
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
448
+ </wp:postmeta> <wp:postmeta>
449
+ <wp:meta_key>_lp_show_question_answer</wp:meta_key>
450
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
451
+ </wp:postmeta> <wp:postmeta>
452
+ <wp:meta_key>_lp_type</wp:meta_key>
453
+ <wp:meta_value><![CDATA[true_or_false]]></wp:meta_value>
454
+ </wp:postmeta>
455
+ </item><item>
456
+ <title>where are you now?</title>
457
+ <link>http://localhost/foobla/learnpress/1.0/lessons/where-are-you-now/</link>
458
+ <pubDate>Tue, 08 Dec 2015 08:20:59 +0000</pubDate>
459
+ <dc:creator><![CDATA[admin]]></dc:creator>
460
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/where-are-you-now/</guid>
461
+ <description></description>
462
+ <content:encoded><![CDATA[Nulla porta dolor. Ut varius tincidunt libero. Sed augue ipsum, egestas nec, vestibulum et, malesuada adipiscing, dui. Fusce egestas elit eget lorem. Vivamus aliquet elit ac nisl.
463
+
464
+ Cras ultricies mi eu turpis hendrerit fringilla. Quisque id mi. Fusce ac felis sit amet ligula pharetra condimentum. Maecenas malesuada. Praesent nec nisl a purus blandit viverra.
465
+
466
+ In auctor lobortis lacus. Phasellus leo dolor, tempus non, auctor et, hendrerit quis, nisi. Nam adipiscing. Pellentesque libero tortor, tincidunt et, tincidunt eget, semper nec, quam. Nam commodo suscipit quam.
467
+
468
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nullam accumsan lorem in dui. Cras varius. Nunc egestas, augue at pellentesque laoreet, felis eros vehicula leo, at malesuada velit leo quis pede. Suspendisse non nisl sit amet velit hendrerit rutrum.
469
+
470
+ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc nulla. In turpis.]]></content:encoded>
471
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
472
+ <wp:post_id>1515</wp:post_id>
473
+ <wp:post_date>2015-12-08 08:20:59</wp:post_date>
474
+ <wp:post_date_gmt>2015-12-08 08:20:59</wp:post_date_gmt>
475
+ <wp:comment_status>closed</wp:comment_status>
476
+ <wp:ping_status>closed</wp:ping_status>
477
+ <wp:post_name>where-are-you-now</wp:post_name>
478
+ <wp:status>publish</wp:status>
479
+ <wp:post_parent>0</wp:post_parent>
480
+ <wp:menu_order>0</wp:menu_order>
481
+ <wp:post_type>lp_lesson</wp:post_type>
482
+ <wp:post_password></wp:post_password>
483
+ <wp:post_author_id>1</wp:post_author_id>
484
+ <wp:is_sticky>0</wp:is_sticky>
485
+ <wp:postmeta>
486
+ <wp:meta_key>_lp_duration</wp:meta_key>
487
+ <wp:meta_value><![CDATA[10]]></wp:meta_value>
488
+ </wp:postmeta> <wp:postmeta>
489
+ <wp:meta_key>_lp_max_students</wp:meta_key>
490
+ <wp:meta_value><![CDATA[1000]]></wp:meta_value>
491
+ </wp:postmeta> <wp:postmeta>
492
+ <wp:meta_key>_lp_students</wp:meta_key>
493
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
494
+ </wp:postmeta> <wp:postmeta>
495
+ <wp:meta_key>_lp_retake_count</wp:meta_key>
496
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
497
+ </wp:postmeta> <wp:postmeta>
498
+ <wp:meta_key>_lp_passing_condition</wp:meta_key>
499
+ <wp:meta_value><![CDATA[50]]></wp:meta_value>
500
+ </wp:postmeta> <wp:postmeta>
501
+ <wp:meta_key>_lp_enroll_requirement</wp:meta_key>
502
+ <wp:meta_value><![CDATA[yes]]></wp:meta_value>
503
+ </wp:postmeta> <wp:postmeta>
504
+ <wp:meta_key>_lp_payment</wp:meta_key>
505
+ <wp:meta_value><![CDATA[free]]></wp:meta_value>
506
+ </wp:postmeta> <wp:postmeta>
507
+ <wp:meta_key>_lp_is_previewable</wp:meta_key>
508
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
509
+ </wp:postmeta> <wp:postmeta>
510
+ <wp:meta_key>_edit_lock</wp:meta_key>
511
+ <wp:meta_value><![CDATA[1451449804:1]]></wp:meta_value>
512
+ </wp:postmeta> <wp:postmeta>
513
+ <wp:meta_key>_edit_last</wp:meta_key>
514
+ <wp:meta_value><![CDATA[1]]></wp:meta_value>
515
+ </wp:postmeta>
516
+ </item><item>
517
+ <title>I am here, beside you</title>
518
+ <link>http://localhost/foobla/learnpress/1.0/quizzes/i-am-here-beside-you/</link>
519
+ <pubDate>Tue, 08 Dec 2015 08:26:07 +0000</pubDate>
520
+ <dc:creator><![CDATA[admin]]></dc:creator>
521
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/quizzes/i-am-here-beside-you/</guid>
522
+ <description></description>
523
+ <content:encoded><![CDATA[]]></content:encoded>
524
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
525
+ <wp:post_id>1516</wp:post_id>
526
+ <wp:post_date>2015-12-08 08:26:07</wp:post_date>
527
+ <wp:post_date_gmt>2015-12-08 08:26:07</wp:post_date_gmt>
528
+ <wp:comment_status>open</wp:comment_status>
529
+ <wp:ping_status>open</wp:ping_status>
530
+ <wp:post_name>i-am-here-beside-you</wp:post_name>
531
+ <wp:status>publish</wp:status>
532
+ <wp:post_parent>0</wp:post_parent>
533
+ <wp:menu_order>0</wp:menu_order>
534
+ <wp:post_type>lp_quiz</wp:post_type>
535
+ <wp:post_password></wp:post_password>
536
+ <wp:post_author_id>1</wp:post_author_id>
537
+ <wp:is_sticky>0</wp:is_sticky>
538
+ <wp:postmeta>
539
+ <wp:meta_key>_lp_duration</wp:meta_key>
540
+ <wp:meta_value><![CDATA[10]]></wp:meta_value>
541
+ </wp:postmeta> <wp:postmeta>
542
+ <wp:meta_key>_lp_max_students</wp:meta_key>
543
+ <wp:meta_value><![CDATA[1000]]></wp:meta_value>
544
+ </wp:postmeta> <wp:postmeta>
545
+ <wp:meta_key>_lp_students</wp:meta_key>
546
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
547
+ </wp:postmeta> <wp:postmeta>
548
+ <wp:meta_key>_lp_retake_count</wp:meta_key>
549
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
550
+ </wp:postmeta> <wp:postmeta>
551
+ <wp:meta_key>_lp_passing_condition</wp:meta_key>
552
+ <wp:meta_value><![CDATA[50]]></wp:meta_value>
553
+ </wp:postmeta> <wp:postmeta>
554
+ <wp:meta_key>_lp_enroll_requirement</wp:meta_key>
555
+ <wp:meta_value><![CDATA[yes]]></wp:meta_value>
556
+ </wp:postmeta> <wp:postmeta>
557
+ <wp:meta_key>_lp_payment</wp:meta_key>
558
+ <wp:meta_value><![CDATA[free]]></wp:meta_value>
559
+ </wp:postmeta> <wp:postmeta>
560
+ <wp:meta_key>_edit_lock</wp:meta_key>
561
+ <wp:meta_value><![CDATA[1452319835:1]]></wp:meta_value>
562
+ </wp:postmeta> <wp:postmeta>
563
+ <wp:meta_key>_edit_last</wp:meta_key>
564
+ <wp:meta_value><![CDATA[1]]></wp:meta_value>
565
+ </wp:postmeta> <wp:postmeta>
566
+ <wp:meta_key>_lp_show_result</wp:meta_key>
567
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
568
+ </wp:postmeta> <wp:postmeta>
569
+ <wp:meta_key>_lp_show_question_answer</wp:meta_key>
570
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
571
+ </wp:postmeta>
572
+ <wp:question>
573
+ <wp:quiz_id>1516</wp:quiz_id>
574
+ <wp:question_id>1542</wp:question_id>
575
+ <wp:params><![CDATA[]]></wp:params>
576
+ <wp:question_order></wp:question_order>
577
+ </wp:question>
578
+
579
+
580
+ <wp:question>
581
+ <wp:quiz_id>1516</wp:quiz_id>
582
+ <wp:question_id>1543</wp:question_id>
583
+ <wp:params><![CDATA[]]></wp:params>
584
+ <wp:question_order></wp:question_order>
585
+ </wp:question>
586
+
587
+
588
+ </item><item>
589
+ <title>Question #1</title>
590
+ <link>http://localhost/foobla/learnpress/1.0/questions/question-1/</link>
591
+ <pubDate>Sat, 09 Jan 2016 06:12:35 +0000</pubDate>
592
+ <dc:creator><![CDATA[admin]]></dc:creator>
593
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/questions/question-1/</guid>
594
+ <description></description>
595
+ <content:encoded><![CDATA[]]></content:encoded>
596
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
597
+ <wp:post_id>1542</wp:post_id>
598
+ <wp:post_date>2016-01-09 06:12:35</wp:post_date>
599
+ <wp:post_date_gmt>2016-01-09 06:12:35</wp:post_date_gmt>
600
+ <wp:comment_status>closed</wp:comment_status>
601
+ <wp:ping_status>closed</wp:ping_status>
602
+ <wp:post_name>question-1</wp:post_name>
603
+ <wp:status>publish</wp:status>
604
+ <wp:post_parent>0</wp:post_parent>
605
+ <wp:menu_order>0</wp:menu_order>
606
+ <wp:post_type>lp_question</wp:post_type>
607
+ <wp:post_password></wp:post_password>
608
+ <wp:post_author_id>1</wp:post_author_id>
609
+ <wp:is_sticky>0</wp:is_sticky>
610
+ <wp:postmeta>
611
+ <wp:meta_key>_lp_type</wp:meta_key>
612
+ <wp:meta_value><![CDATA[multi_choice]]></wp:meta_value>
613
+ </wp:postmeta> <wp:postmeta>
614
+ <wp:meta_key>_edit_lock</wp:meta_key>
615
+ <wp:meta_value><![CDATA[1452321706:1]]></wp:meta_value>
616
+ </wp:postmeta> <wp:postmeta>
617
+ <wp:meta_key>_edit_last</wp:meta_key>
618
+ <wp:meta_value><![CDATA[1]]></wp:meta_value>
619
+ </wp:postmeta> <wp:postmeta>
620
+ <wp:meta_key>_lp_mark</wp:meta_key>
621
+ <wp:meta_value><![CDATA[1]]></wp:meta_value>
622
+ </wp:postmeta>
623
+ <wp:answer>
624
+ <wp:question_id>1543</wp:question_id>
625
+ <wp:answer_data><![CDATA[a:3:{s:4:"text";s:4:"True";s:5:"value";s:4:"true";s:7:"is_true";s:3:"yes";}]]></wp:answer_data>
626
+ <wp:answer_order>1</wp:answer_order>
627
+ </wp:answer>
628
+
629
+
630
+ <wp:answer>
631
+ <wp:question_id>1543</wp:question_id>
632
+ <wp:answer_data><![CDATA[a:3:{s:4:"text";s:11:"Falseasdasd";s:5:"value";s:5:"false";s:7:"is_true";s:3:"yes";}]]></wp:answer_data>
633
+ <wp:answer_order>2</wp:answer_order>
634
+ </wp:answer>
635
+
636
+
637
+ <wp:answer>
638
+ <wp:question_id>1543</wp:question_id>
639
+ <wp:answer_data><![CDATA[a:3:{s:4:"text";s:13:"asdasdasdadss";s:5:"value";s:13:"5690ac2667caa";s:7:"is_true";s:2:"no";}]]></wp:answer_data>
640
+ <wp:answer_order>3</wp:answer_order>
641
+ </wp:answer>
642
+
643
+
644
+ </item><item>
645
+ <title>Question #2</title>
646
+ <link>http://localhost/foobla/learnpress/1.0/questions/question-2/</link>
647
+ <pubDate>Sat, 09 Jan 2016 06:12:49 +0000</pubDate>
648
+ <dc:creator><![CDATA[admin]]></dc:creator>
649
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/questions/question-2/</guid>
650
+ <description></description>
651
+ <content:encoded><![CDATA[]]></content:encoded>
652
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
653
+ <wp:post_id>1543</wp:post_id>
654
+ <wp:post_date>2016-01-09 06:12:49</wp:post_date>
655
+ <wp:post_date_gmt>2016-01-09 06:12:49</wp:post_date_gmt>
656
+ <wp:comment_status>closed</wp:comment_status>
657
+ <wp:ping_status>closed</wp:ping_status>
658
+ <wp:post_name>question-2</wp:post_name>
659
+ <wp:status>publish</wp:status>
660
+ <wp:post_parent>0</wp:post_parent>
661
+ <wp:menu_order>0</wp:menu_order>
662
+ <wp:post_type>lp_question</wp:post_type>
663
+ <wp:post_password></wp:post_password>
664
+ <wp:post_author_id>1</wp:post_author_id>
665
+ <wp:is_sticky>0</wp:is_sticky>
666
+ <wp:postmeta>
667
+ <wp:meta_key>_lp_type</wp:meta_key>
668
+ <wp:meta_value><![CDATA[multi_choice]]></wp:meta_value>
669
+ </wp:postmeta> <wp:postmeta>
670
+ <wp:meta_key>_edit_lock</wp:meta_key>
671
+ <wp:meta_value><![CDATA[1452326236:1]]></wp:meta_value>
672
+ </wp:postmeta> <wp:postmeta>
673
+ <wp:meta_key>_edit_last</wp:meta_key>
674
+ <wp:meta_value><![CDATA[1]]></wp:meta_value>
675
+ </wp:postmeta> <wp:postmeta>
676
+ <wp:meta_key>_lp_mark</wp:meta_key>
677
+ <wp:meta_value><![CDATA[1]]></wp:meta_value>
678
+ </wp:postmeta>
679
+ <wp:answer>
680
+ <wp:question_id>1543</wp:question_id>
681
+ <wp:answer_data><![CDATA[a:3:{s:4:"text";s:12:"Option First";s:5:"value";s:12:"option_first";s:7:"is_true";s:3:"yes";}]]></wp:answer_data>
682
+ <wp:answer_order>1</wp:answer_order>
683
+ </wp:answer>
684
+
685
+
686
+ <wp:answer>
687
+ <wp:question_id>1543</wp:question_id>
688
+ <wp:answer_data><![CDATA[a:3:{s:4:"text";s:14:"Option Seconds";s:5:"value";s:14:"option_seconds";s:7:"is_true";s:3:"yes";}]]></wp:answer_data>
689
+ <wp:answer_order>2</wp:answer_order>
690
+ </wp:answer>
691
+
692
+
693
+ <wp:answer>
694
+ <wp:question_id>1543</wp:question_id>
695
+ <wp:answer_data><![CDATA[a:3:{s:4:"text";s:12:"Option Third";s:5:"value";s:12:"option_third";s:7:"is_true";s:2:"no";}]]></wp:answer_data>
696
+ <wp:answer_order>3</wp:answer_order>
697
+ </wp:answer>
698
+
699
+
700
+ </item><item>
701
+ <title>asdasdasd</title>
702
+ <link>http://localhost/foobla/learnpress/1.0/lessons/asdasdasd/</link>
703
+ <pubDate>Tue, 08 Dec 2015 03:58:51 +0000</pubDate>
704
+ <dc:creator><![CDATA[admin]]></dc:creator>
705
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/asdasdasd/</guid>
706
+ <description></description>
707
+ <content:encoded><![CDATA[]]></content:encoded>
708
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
709
+ <wp:post_id>1517</wp:post_id>
710
+ <wp:post_date>2015-12-08 03:58:51</wp:post_date>
711
+ <wp:post_date_gmt>2015-12-08 03:58:51</wp:post_date_gmt>
712
+ <wp:comment_status>open</wp:comment_status>
713
+ <wp:ping_status>open</wp:ping_status>
714
+ <wp:post_name>asdasdasd</wp:post_name>
715
+ <wp:status>publish</wp:status>
716
+ <wp:post_parent>0</wp:post_parent>
717
+ <wp:menu_order>0</wp:menu_order>
718
+ <wp:post_type>lp_lesson</wp:post_type>
719
+ <wp:post_password></wp:post_password>
720
+ <wp:post_author_id>1</wp:post_author_id>
721
+ <wp:is_sticky>0</wp:is_sticky>
722
+ <wp:postmeta>
723
+ <wp:meta_key>_lp_is_previewable</wp:meta_key>
724
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
725
+ </wp:postmeta>
726
+ </item><item>
727
+ <title>dsfsdfsdf</title>
728
+ <link>http://localhost/foobla/learnpress/1.0/lessons/dsfsdfsdf/</link>
729
+ <pubDate>Tue, 08 Dec 2015 03:59:33 +0000</pubDate>
730
+ <dc:creator><![CDATA[admin]]></dc:creator>
731
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/dsfsdfsdf/</guid>
732
+ <description></description>
733
+ <content:encoded><![CDATA[]]></content:encoded>
734
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
735
+ <wp:post_id>1518</wp:post_id>
736
+ <wp:post_date>2015-12-08 03:59:33</wp:post_date>
737
+ <wp:post_date_gmt>2015-12-08 03:59:33</wp:post_date_gmt>
738
+ <wp:comment_status>open</wp:comment_status>
739
+ <wp:ping_status>open</wp:ping_status>
740
+ <wp:post_name>dsfsdfsdf</wp:post_name>
741
+ <wp:status>publish</wp:status>
742
+ <wp:post_parent>0</wp:post_parent>
743
+ <wp:menu_order>0</wp:menu_order>
744
+ <wp:post_type>lp_lesson</wp:post_type>
745
+ <wp:post_password></wp:post_password>
746
+ <wp:post_author_id>1</wp:post_author_id>
747
+ <wp:is_sticky>0</wp:is_sticky>
748
+ <wp:postmeta>
749
+ <wp:meta_key>_lp_is_previewable</wp:meta_key>
750
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
751
+ </wp:postmeta>
752
+ </item><item>
753
+ <title>Lesson 1</title>
754
+ <link>http://localhost/foobla/learnpress/1.0/lessons/lesson-1-2/</link>
755
+ <pubDate>Fri, 04 Dec 2015 08:41:24 +0000</pubDate>
756
+ <dc:creator><![CDATA[admin]]></dc:creator>
757
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/lesson-1-2/</guid>
758
+ <description></description>
759
+ <content:encoded><![CDATA[]]></content:encoded>
760
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
761
+ <wp:post_id>1519</wp:post_id>
762
+ <wp:post_date>2015-12-04 08:41:24</wp:post_date>
763
+ <wp:post_date_gmt>2015-12-04 08:41:24</wp:post_date_gmt>
764
+ <wp:comment_status>open</wp:comment_status>
765
+ <wp:ping_status>open</wp:ping_status>
766
+ <wp:post_name>lesson-1-2</wp:post_name>
767
+ <wp:status>publish</wp:status>
768
+ <wp:post_parent>0</wp:post_parent>
769
+ <wp:menu_order>0</wp:menu_order>
770
+ <wp:post_type>lp_lesson</wp:post_type>
771
+ <wp:post_password></wp:post_password>
772
+ <wp:post_author_id>1</wp:post_author_id>
773
+ <wp:is_sticky>0</wp:is_sticky>
774
+ <wp:postmeta>
775
+ <wp:meta_key>_lp_duration</wp:meta_key>
776
+ <wp:meta_value><![CDATA[10]]></wp:meta_value>
777
+ </wp:postmeta> <wp:postmeta>
778
+ <wp:meta_key>_lp_max_students</wp:meta_key>
779
+ <wp:meta_value><![CDATA[1000]]></wp:meta_value>
780
+ </wp:postmeta> <wp:postmeta>
781
+ <wp:meta_key>_lp_students</wp:meta_key>
782
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
783
+ </wp:postmeta> <wp:postmeta>
784
+ <wp:meta_key>_lp_retake_count</wp:meta_key>
785
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
786
+ </wp:postmeta> <wp:postmeta>
787
+ <wp:meta_key>_lp_passing_condition</wp:meta_key>
788
+ <wp:meta_value><![CDATA[50]]></wp:meta_value>
789
+ </wp:postmeta> <wp:postmeta>
790
+ <wp:meta_key>_lp_enroll_requirement</wp:meta_key>
791
+ <wp:meta_value><![CDATA[yes]]></wp:meta_value>
792
+ </wp:postmeta> <wp:postmeta>
793
+ <wp:meta_key>_lp_payment</wp:meta_key>
794
+ <wp:meta_value><![CDATA[free]]></wp:meta_value>
795
+ </wp:postmeta> <wp:postmeta>
796
+ <wp:meta_key>_lp_is_previewable</wp:meta_key>
797
+ <wp:meta_value><![CDATA[yes]]></wp:meta_value>
798
+ </wp:postmeta>
799
+ </item><item>
800
+ <title>Lesson 2</title>
801
+ <link>http://localhost/foobla/learnpress/1.0/lessons/lesson-2-2/</link>
802
+ <pubDate>Fri, 04 Dec 2015 08:41:24 +0000</pubDate>
803
+ <dc:creator><![CDATA[admin]]></dc:creator>
804
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/lesson-2-2/</guid>
805
+ <description></description>
806
+ <content:encoded><![CDATA[]]></content:encoded>
807
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
808
+ <wp:post_id>1520</wp:post_id>
809
+ <wp:post_date>2015-12-04 08:41:24</wp:post_date>
810
+ <wp:post_date_gmt>2015-12-04 08:41:24</wp:post_date_gmt>
811
+ <wp:comment_status>open</wp:comment_status>
812
+ <wp:ping_status>open</wp:ping_status>
813
+ <wp:post_name>lesson-2-2</wp:post_name>
814
+ <wp:status>publish</wp:status>
815
+ <wp:post_parent>0</wp:post_parent>
816
+ <wp:menu_order>0</wp:menu_order>
817
+ <wp:post_type>lp_lesson</wp:post_type>
818
+ <wp:post_password></wp:post_password>
819
+ <wp:post_author_id>1</wp:post_author_id>
820
+ <wp:is_sticky>0</wp:is_sticky>
821
+ <wp:postmeta>
822
+ <wp:meta_key>_lp_is_previewable</wp:meta_key>
823
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
824
+ </wp:postmeta>
825
+ </item><item>
826
+ <title>Lesson 3</title>
827
+ <link>http://localhost/foobla/learnpress/1.0/lessons/lesson-3/</link>
828
+ <pubDate>Tue, 08 Dec 2015 03:58:28 +0000</pubDate>
829
+ <dc:creator><![CDATA[admin]]></dc:creator>
830
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/lesson-3/</guid>
831
+ <description></description>
832
+ <content:encoded><![CDATA[]]></content:encoded>
833
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
834
+ <wp:post_id>1521</wp:post_id>
835
+ <wp:post_date>2015-12-08 03:58:28</wp:post_date>
836
+ <wp:post_date_gmt>2015-12-08 03:58:28</wp:post_date_gmt>
837
+ <wp:comment_status>open</wp:comment_status>
838
+ <wp:ping_status>open</wp:ping_status>
839
+ <wp:post_name>lesson-3</wp:post_name>
840
+ <wp:status>publish</wp:status>
841
+ <wp:post_parent>0</wp:post_parent>
842
+ <wp:menu_order>0</wp:menu_order>
843
+ <wp:post_type>lp_lesson</wp:post_type>
844
+ <wp:post_password></wp:post_password>
845
+ <wp:post_author_id>1</wp:post_author_id>
846
+ <wp:is_sticky>0</wp:is_sticky>
847
+ <wp:postmeta>
848
+ <wp:meta_key>_lp_is_previewable</wp:meta_key>
849
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
850
+ </wp:postmeta>
851
+ </item><item>
852
+ <title>qqqqqqqqqqqqqqqqq</title>
853
+ <link>http://localhost/foobla/learnpress/1.0/lessons/qqqqqqqqqqqqqqqqq/</link>
854
+ <pubDate>Tue, 08 Dec 2015 15:15:04 +0000</pubDate>
855
+ <dc:creator><![CDATA[admin]]></dc:creator>
856
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/qqqqqqqqqqqqqqqqq/</guid>
857
+ <description></description>
858
+ <content:encoded><![CDATA[]]></content:encoded>
859
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
860
+ <wp:post_id>1522</wp:post_id>
861
+ <wp:post_date>2015-12-08 15:15:04</wp:post_date>
862
+ <wp:post_date_gmt>2015-12-08 15:15:04</wp:post_date_gmt>
863
+ <wp:comment_status>open</wp:comment_status>
864
+ <wp:ping_status>open</wp:ping_status>
865
+ <wp:post_name>qqqqqqqqqqqqqqqqq</wp:post_name>
866
+ <wp:status>publish</wp:status>
867
+ <wp:post_parent>0</wp:post_parent>
868
+ <wp:menu_order>0</wp:menu_order>
869
+ <wp:post_type>lp_lesson</wp:post_type>
870
+ <wp:post_password></wp:post_password>
871
+ <wp:post_author_id>1</wp:post_author_id>
872
+ <wp:is_sticky>0</wp:is_sticky>
873
+ <wp:postmeta>
874
+ <wp:meta_key>_edit_lock</wp:meta_key>
875
+ <wp:meta_value><![CDATA[1449589506:1]]></wp:meta_value>
876
+ </wp:postmeta>
877
+ </item><item>
878
+ <title>trau va bo</title>
879
+ <link>http://localhost/foobla/learnpress/1.0/lessons/trau-va-bo/</link>
880
+ <pubDate>Tue, 08 Dec 2015 15:16:40 +0000</pubDate>
881
+ <dc:creator><![CDATA[admin]]></dc:creator>
882
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/trau-va-bo/</guid>
883
+ <description></description>
884
+ <content:encoded><![CDATA[]]></content:encoded>
885
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
886
+ <wp:post_id>1523</wp:post_id>
887
+ <wp:post_date>2015-12-08 15:16:40</wp:post_date>
888
+ <wp:post_date_gmt>2015-12-08 15:16:40</wp:post_date_gmt>
889
+ <wp:comment_status>open</wp:comment_status>
890
+ <wp:ping_status>open</wp:ping_status>
891
+ <wp:post_name>trau-va-bo</wp:post_name>
892
+ <wp:status>publish</wp:status>
893
+ <wp:post_parent>0</wp:post_parent>
894
+ <wp:menu_order>0</wp:menu_order>
895
+ <wp:post_type>lp_lesson</wp:post_type>
896
+ <wp:post_password></wp:post_password>
897
+ <wp:post_author_id>1</wp:post_author_id>
898
+ <wp:is_sticky>0</wp:is_sticky>
899
+ <wp:postmeta>
900
+ <wp:meta_key>_lp_duration</wp:meta_key>
901
+ <wp:meta_value><![CDATA[10]]></wp:meta_value>
902
+ </wp:postmeta> <wp:postmeta>
903
+ <wp:meta_key>_lp_is_previewable</wp:meta_key>
904
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
905
+ </wp:postmeta>
906
+ </item><item>
907
+ <title>adasdasdasda asd as</title>
908
+ <link>http://localhost/foobla/learnpress/1.0/lessons/adasdasdasda-asd-as/</link>
909
+ <pubDate>Thu, 17 Dec 2015 02:29:12 +0000</pubDate>
910
+ <dc:creator><![CDATA[admin]]></dc:creator>
911
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/adasdasdasda-asd-as/</guid>
912
+ <description></description>
913
+ <content:encoded><![CDATA[]]></content:encoded>
914
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
915
+ <wp:post_id>1524</wp:post_id>
916
+ <wp:post_date>2015-12-17 02:29:12</wp:post_date>
917
+ <wp:post_date_gmt>2015-12-17 02:29:12</wp:post_date_gmt>
918
+ <wp:comment_status>open</wp:comment_status>
919
+ <wp:ping_status>open</wp:ping_status>
920
+ <wp:post_name>adasdasdasda-asd-as</wp:post_name>
921
+ <wp:status>publish</wp:status>
922
+ <wp:post_parent>0</wp:post_parent>
923
+ <wp:menu_order>0</wp:menu_order>
924
+ <wp:post_type>lp_lesson</wp:post_type>
925
+ <wp:post_password></wp:post_password>
926
+ <wp:post_author_id>1</wp:post_author_id>
927
+ <wp:is_sticky>0</wp:is_sticky>
928
+ <wp:postmeta>
929
+ <wp:meta_key>_lp_duration</wp:meta_key>
930
+ <wp:meta_value><![CDATA[10]]></wp:meta_value>
931
+ </wp:postmeta> <wp:postmeta>
932
+ <wp:meta_key>_lp_max_students</wp:meta_key>
933
+ <wp:meta_value><![CDATA[1000]]></wp:meta_value>
934
+ </wp:postmeta> <wp:postmeta>
935
+ <wp:meta_key>_lp_students</wp:meta_key>
936
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
937
+ </wp:postmeta> <wp:postmeta>
938
+ <wp:meta_key>_lp_retake_count</wp:meta_key>
939
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
940
+ </wp:postmeta> <wp:postmeta>
941
+ <wp:meta_key>_lp_passing_condition</wp:meta_key>
942
+ <wp:meta_value><![CDATA[50]]></wp:meta_value>
943
+ </wp:postmeta> <wp:postmeta>
944
+ <wp:meta_key>_lp_enroll_requirement</wp:meta_key>
945
+ <wp:meta_value><![CDATA[yes]]></wp:meta_value>
946
+ </wp:postmeta> <wp:postmeta>
947
+ <wp:meta_key>_lp_payment</wp:meta_key>
948
+ <wp:meta_value><![CDATA[free]]></wp:meta_value>
949
+ </wp:postmeta>
950
+ </item><item>
951
+ <title>asd asda sdasdas da</title>
952
+ <link>http://localhost/foobla/learnpress/1.0/lessons/asd-asda-sdasdas-da/</link>
953
+ <pubDate>Thu, 17 Dec 2015 02:29:12 +0000</pubDate>
954
+ <dc:creator><![CDATA[admin]]></dc:creator>
955
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/asd-asda-sdasdas-da/</guid>
956
+ <description></description>
957
+ <content:encoded><![CDATA[]]></content:encoded>
958
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
959
+ <wp:post_id>1525</wp:post_id>
960
+ <wp:post_date>2015-12-17 02:29:12</wp:post_date>
961
+ <wp:post_date_gmt>2015-12-17 02:29:12</wp:post_date_gmt>
962
+ <wp:comment_status>open</wp:comment_status>
963
+ <wp:ping_status>open</wp:ping_status>
964
+ <wp:post_name>asd-asda-sdasdas-da</wp:post_name>
965
+ <wp:status>publish</wp:status>
966
+ <wp:post_parent>0</wp:post_parent>
967
+ <wp:menu_order>0</wp:menu_order>
968
+ <wp:post_type>lp_lesson</wp:post_type>
969
+ <wp:post_password></wp:post_password>
970
+ <wp:post_author_id>1</wp:post_author_id>
971
+ <wp:is_sticky>0</wp:is_sticky>
972
+
973
+ </item><item>
974
+ <title>asdasdasdasdasda</title>
975
+ <link>http://localhost/foobla/learnpress/1.0/lessons/asdasdasdasdasda/</link>
976
+ <pubDate>Thu, 17 Dec 2015 02:29:12 +0000</pubDate>
977
+ <dc:creator><![CDATA[admin]]></dc:creator>
978
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/asdasdasdasdasda/</guid>
979
+ <description></description>
980
+ <content:encoded><![CDATA[]]></content:encoded>
981
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
982
+ <wp:post_id>1526</wp:post_id>
983
+ <wp:post_date>2015-12-17 02:29:12</wp:post_date>
984
+ <wp:post_date_gmt>2015-12-17 02:29:12</wp:post_date_gmt>
985
+ <wp:comment_status>open</wp:comment_status>
986
+ <wp:ping_status>open</wp:ping_status>
987
+ <wp:post_name>asdasdasdasdasda</wp:post_name>
988
+ <wp:status>publish</wp:status>
989
+ <wp:post_parent>0</wp:post_parent>
990
+ <wp:menu_order>0</wp:menu_order>
991
+ <wp:post_type>lp_lesson</wp:post_type>
992
+ <wp:post_password></wp:post_password>
993
+ <wp:post_author_id>1</wp:post_author_id>
994
+ <wp:is_sticky>0</wp:is_sticky>
995
+
996
+ </item><item>
997
+ <title>assasdasdasdasdasd</title>
998
+ <link>http://localhost/foobla/learnpress/1.0/lessons/assasdasdasdasdasd/</link>
999
+ <pubDate>Thu, 17 Dec 2015 02:29:12 +0000</pubDate>
1000
+ <dc:creator><![CDATA[admin]]></dc:creator>
1001
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/assasdasdasdasdasd/</guid>
1002
+ <description></description>
1003
+ <content:encoded><![CDATA[]]></content:encoded>
1004
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
1005
+ <wp:post_id>1527</wp:post_id>
1006
+ <wp:post_date>2015-12-17 02:29:12</wp:post_date>
1007
+ <wp:post_date_gmt>2015-12-17 02:29:12</wp:post_date_gmt>
1008
+ <wp:comment_status>open</wp:comment_status>
1009
+ <wp:ping_status>open</wp:ping_status>
1010
+ <wp:post_name>assasdasdasdasdasd</wp:post_name>
1011
+ <wp:status>publish</wp:status>
1012
+ <wp:post_parent>0</wp:post_parent>
1013
+ <wp:menu_order>0</wp:menu_order>
1014
+ <wp:post_type>lp_lesson</wp:post_type>
1015
+ <wp:post_password></wp:post_password>
1016
+ <wp:post_author_id>1</wp:post_author_id>
1017
+ <wp:is_sticky>0</wp:is_sticky>
1018
+
1019
+ </item><item>
1020
+ <title>How to create a course</title>
1021
+ <link>http://localhost/foobla/learnpress/1.0/lessons/how-to-create-a-course/</link>
1022
+ <pubDate>Thu, 17 Dec 2015 03:39:13 +0000</pubDate>
1023
+ <dc:creator><![CDATA[admin]]></dc:creator>
1024
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/how-to-create-a-course/</guid>
1025
+ <description></description>
1026
+ <content:encoded><![CDATA[]]></content:encoded>
1027
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
1028
+ <wp:post_id>1528</wp:post_id>
1029
+ <wp:post_date>2015-12-17 03:39:13</wp:post_date>
1030
+ <wp:post_date_gmt>2015-12-17 03:39:13</wp:post_date_gmt>
1031
+ <wp:comment_status>open</wp:comment_status>
1032
+ <wp:ping_status>open</wp:ping_status>
1033
+ <wp:post_name>how-to-create-a-course</wp:post_name>
1034
+ <wp:status>publish</wp:status>
1035
+ <wp:post_parent>0</wp:post_parent>
1036
+ <wp:menu_order>0</wp:menu_order>
1037
+ <wp:post_type>lp_lesson</wp:post_type>
1038
+ <wp:post_password></wp:post_password>
1039
+ <wp:post_author_id>1</wp:post_author_id>
1040
+ <wp:is_sticky>0</wp:is_sticky>
1041
+ <wp:postmeta>
1042
+ <wp:meta_key>_lp_duration</wp:meta_key>
1043
+ <wp:meta_value><![CDATA[10]]></wp:meta_value>
1044
+ </wp:postmeta> <wp:postmeta>
1045
+ <wp:meta_key>_lp_max_students</wp:meta_key>
1046
+ <wp:meta_value><![CDATA[1000]]></wp:meta_value>
1047
+ </wp:postmeta> <wp:postmeta>
1048
+ <wp:meta_key>_lp_students</wp:meta_key>
1049
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
1050
+ </wp:postmeta> <wp:postmeta>
1051
+ <wp:meta_key>_lp_retake_count</wp:meta_key>
1052
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
1053
+ </wp:postmeta> <wp:postmeta>
1054
+ <wp:meta_key>_lp_passing_condition</wp:meta_key>
1055
+ <wp:meta_value><![CDATA[50]]></wp:meta_value>
1056
+ </wp:postmeta> <wp:postmeta>
1057
+ <wp:meta_key>_lp_enroll_requirement</wp:meta_key>
1058
+ <wp:meta_value><![CDATA[yes]]></wp:meta_value>
1059
+ </wp:postmeta> <wp:postmeta>
1060
+ <wp:meta_key>_lp_payment</wp:meta_key>
1061
+ <wp:meta_value><![CDATA[free]]></wp:meta_value>
1062
+ </wp:postmeta>
1063
+ </item><item>
1064
+ <title>What is your name</title>
1065
+ <link>http://localhost/foobla/learnpress/1.0/lessons/what-is-your-name/</link>
1066
+ <pubDate>Thu, 17 Dec 2015 03:39:13 +0000</pubDate>
1067
+ <dc:creator><![CDATA[admin]]></dc:creator>
1068
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/what-is-your-name/</guid>
1069
+ <description></description>
1070
+ <content:encoded><![CDATA[]]></content:encoded>
1071
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
1072
+ <wp:post_id>1529</wp:post_id>
1073
+ <wp:post_date>2015-12-17 03:39:13</wp:post_date>
1074
+ <wp:post_date_gmt>2015-12-17 03:39:13</wp:post_date_gmt>
1075
+ <wp:comment_status>open</wp:comment_status>
1076
+ <wp:ping_status>open</wp:ping_status>
1077
+ <wp:post_name>what-is-your-name</wp:post_name>
1078
+ <wp:status>publish</wp:status>
1079
+ <wp:post_parent>0</wp:post_parent>
1080
+ <wp:menu_order>0</wp:menu_order>
1081
+ <wp:post_type>lp_lesson</wp:post_type>
1082
+ <wp:post_password></wp:post_password>
1083
+ <wp:post_author_id>1</wp:post_author_id>
1084
+ <wp:is_sticky>0</wp:is_sticky>
1085
+
1086
+ </item><item>
1087
+ <title>My name is Tu Nguyen</title>
1088
+ <link>http://localhost/foobla/learnpress/1.0/lessons/my-name-is-tu-nguyen/</link>
1089
+ <pubDate>Thu, 17 Dec 2015 03:39:13 +0000</pubDate>
1090
+ <dc:creator><![CDATA[admin]]></dc:creator>
1091
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/my-name-is-tu-nguyen/</guid>
1092
+ <description></description>
1093
+ <content:encoded><![CDATA[]]></content:encoded>
1094
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
1095
+ <wp:post_id>1530</wp:post_id>
1096
+ <wp:post_date>2015-12-17 03:39:13</wp:post_date>
1097
+ <wp:post_date_gmt>2015-12-17 03:39:13</wp:post_date_gmt>
1098
+ <wp:comment_status>open</wp:comment_status>
1099
+ <wp:ping_status>open</wp:ping_status>
1100
+ <wp:post_name>my-name-is-tu-nguyen</wp:post_name>
1101
+ <wp:status>publish</wp:status>
1102
+ <wp:post_parent>0</wp:post_parent>
1103
+ <wp:menu_order>0</wp:menu_order>
1104
+ <wp:post_type>lp_lesson</wp:post_type>
1105
+ <wp:post_password></wp:post_password>
1106
+ <wp:post_author_id>1</wp:post_author_id>
1107
+ <wp:is_sticky>0</wp:is_sticky>
1108
+
1109
+ </item><item>
1110
+ <title>sdfsdfsdf sdf sdf sdf s</title>
1111
+ <link>http://localhost/foobla/learnpress/1.0/quizzes/sdfsdfsdf-sdf-sdf-sdf-s/</link>
1112
+ <pubDate>Thu, 17 Dec 2015 03:39:07 +0000</pubDate>
1113
+ <dc:creator><![CDATA[admin]]></dc:creator>
1114
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/quizzes/sdfsdfsdf-sdf-sdf-sdf-s/</guid>
1115
+ <description></description>
1116
+ <content:encoded><![CDATA[]]></content:encoded>
1117
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
1118
+ <wp:post_id>1531</wp:post_id>
1119
+ <wp:post_date>2015-12-17 03:39:07</wp:post_date>
1120
+ <wp:post_date_gmt>2015-12-17 03:39:07</wp:post_date_gmt>
1121
+ <wp:comment_status>open</wp:comment_status>
1122
+ <wp:ping_status>open</wp:ping_status>
1123
+ <wp:post_name>sdfsdfsdf-sdf-sdf-sdf-s</wp:post_name>
1124
+ <wp:status>publish</wp:status>
1125
+ <wp:post_parent>0</wp:post_parent>
1126
+ <wp:menu_order>0</wp:menu_order>
1127
+ <wp:post_type>lp_quiz</wp:post_type>
1128
+ <wp:post_password></wp:post_password>
1129
+ <wp:post_author_id>1</wp:post_author_id>
1130
+ <wp:is_sticky>0</wp:is_sticky>
1131
+ <wp:postmeta>
1132
+ <wp:meta_key>_lp_duration</wp:meta_key>
1133
+ <wp:meta_value><![CDATA[10]]></wp:meta_value>
1134
+ </wp:postmeta> <wp:postmeta>
1135
+ <wp:meta_key>_lp_is_previewable</wp:meta_key>
1136
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
1137
+ </wp:postmeta>
1138
+ </item><item>
1139
+ <title>sdfsd fsd fsdf</title>
1140
+ <link>http://localhost/foobla/learnpress/1.0/quizzes/sdfsd-fsd-fsdf/</link>
1141
+ <pubDate>Thu, 17 Dec 2015 03:44:14 +0000</pubDate>
1142
+ <dc:creator><![CDATA[admin]]></dc:creator>
1143
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/quizzes/sdfsd-fsd-fsdf/</guid>
1144
+ <description></description>
1145
+ <content:encoded><![CDATA[]]></content:encoded>
1146
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
1147
+ <wp:post_id>1532</wp:post_id>
1148
+ <wp:post_date>2015-12-17 03:44:14</wp:post_date>
1149
+ <wp:post_date_gmt>2015-12-17 03:44:14</wp:post_date_gmt>
1150
+ <wp:comment_status>open</wp:comment_status>
1151
+ <wp:ping_status>open</wp:ping_status>
1152
+ <wp:post_name>sdfsd-fsd-fsdf</wp:post_name>
1153
+ <wp:status>publish</wp:status>
1154
+ <wp:post_parent>0</wp:post_parent>
1155
+ <wp:menu_order>0</wp:menu_order>
1156
+ <wp:post_type>lp_quiz</wp:post_type>
1157
+ <wp:post_password></wp:post_password>
1158
+ <wp:post_author_id>1</wp:post_author_id>
1159
+ <wp:is_sticky>0</wp:is_sticky>
1160
+ <wp:postmeta>
1161
+ <wp:meta_key>_lp_duration</wp:meta_key>
1162
+ <wp:meta_value><![CDATA[10]]></wp:meta_value>
1163
+ </wp:postmeta> <wp:postmeta>
1164
+ <wp:meta_key>_lp_max_students</wp:meta_key>
1165
+ <wp:meta_value><![CDATA[1000]]></wp:meta_value>
1166
+ </wp:postmeta> <wp:postmeta>
1167
+ <wp:meta_key>_lp_students</wp:meta_key>
1168
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
1169
+ </wp:postmeta> <wp:postmeta>
1170
+ <wp:meta_key>_lp_retake_count</wp:meta_key>
1171
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
1172
+ </wp:postmeta> <wp:postmeta>
1173
+ <wp:meta_key>_lp_passing_condition</wp:meta_key>
1174
+ <wp:meta_value><![CDATA[50]]></wp:meta_value>
1175
+ </wp:postmeta> <wp:postmeta>
1176
+ <wp:meta_key>_lp_enroll_requirement</wp:meta_key>
1177
+ <wp:meta_value><![CDATA[yes]]></wp:meta_value>
1178
+ </wp:postmeta> <wp:postmeta>
1179
+ <wp:meta_key>_lp_payment</wp:meta_key>
1180
+ <wp:meta_value><![CDATA[free]]></wp:meta_value>
1181
+ </wp:postmeta>
1182
+ </item><item>
1183
+ <title>sdf sdfsd fsdf sdfsd f</title>
1184
+ <link>http://localhost/foobla/learnpress/1.0/quizzes/sdf-sdfsd-fsdf-sdfsd-f/</link>
1185
+ <pubDate>Thu, 17 Dec 2015 03:44:14 +0000</pubDate>
1186
+ <dc:creator><![CDATA[admin]]></dc:creator>
1187
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/quizzes/sdf-sdfsd-fsdf-sdfsd-f/</guid>
1188
+ <description></description>
1189
+ <content:encoded><![CDATA[]]></content:encoded>
1190
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
1191
+ <wp:post_id>1533</wp:post_id>
1192
+ <wp:post_date>2015-12-17 03:44:14</wp:post_date>
1193
+ <wp:post_date_gmt>2015-12-17 03:44:14</wp:post_date_gmt>
1194
+ <wp:comment_status>open</wp:comment_status>
1195
+ <wp:ping_status>open</wp:ping_status>
1196
+ <wp:post_name>sdf-sdfsd-fsdf-sdfsd-f</wp:post_name>
1197
+ <wp:status>publish</wp:status>
1198
+ <wp:post_parent>0</wp:post_parent>
1199
+ <wp:menu_order>0</wp:menu_order>
1200
+ <wp:post_type>lp_quiz</wp:post_type>
1201
+ <wp:post_password></wp:post_password>
1202
+ <wp:post_author_id>1</wp:post_author_id>
1203
+ <wp:is_sticky>0</wp:is_sticky>
1204
+
1205
+ </item><item>
1206
+ <title>happy new year!</title>
1207
+ <link>http://localhost/foobla/learnpress/1.0/lessons/happy-new-year/</link>
1208
+ <pubDate>Tue, 29 Dec 2015 09:25:33 +0000</pubDate>
1209
+ <dc:creator><![CDATA[admin]]></dc:creator>
1210
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/happy-new-year/</guid>
1211
+ <description></description>
1212
+ <content:encoded><![CDATA[]]></content:encoded>
1213
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
1214
+ <wp:post_id>1534</wp:post_id>
1215
+ <wp:post_date>2015-12-29 09:25:33</wp:post_date>
1216
+ <wp:post_date_gmt>2015-12-29 09:25:33</wp:post_date_gmt>
1217
+ <wp:comment_status>closed</wp:comment_status>
1218
+ <wp:ping_status>closed</wp:ping_status>
1219
+ <wp:post_name>happy-new-year</wp:post_name>
1220
+ <wp:status>publish</wp:status>
1221
+ <wp:post_parent>0</wp:post_parent>
1222
+ <wp:menu_order>0</wp:menu_order>
1223
+ <wp:post_type>lp_lesson</wp:post_type>
1224
+ <wp:post_password></wp:post_password>
1225
+ <wp:post_author_id>1</wp:post_author_id>
1226
+ <wp:is_sticky>0</wp:is_sticky>
1227
+ <wp:postmeta>
1228
+ <wp:meta_key>_lp_duration</wp:meta_key>
1229
+ <wp:meta_value><![CDATA[10]]></wp:meta_value>
1230
+ </wp:postmeta> <wp:postmeta>
1231
+ <wp:meta_key>_lp_is_previewable</wp:meta_key>
1232
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
1233
+ </wp:postmeta>
1234
+ </item><item>
1235
+ <title>happy new year!</title>
1236
+ <link>http://localhost/foobla/learnpress/1.0/lessons/happy-new-year-2/</link>
1237
+ <pubDate>Tue, 29 Dec 2015 09:25:34 +0000</pubDate>
1238
+ <dc:creator><![CDATA[admin]]></dc:creator>
1239
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/happy-new-year-2/</guid>
1240
+ <description></description>
1241
+ <content:encoded><![CDATA[]]></content:encoded>
1242
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
1243
+ <wp:post_id>1535</wp:post_id>
1244
+ <wp:post_date>2015-12-29 09:25:34</wp:post_date>
1245
+ <wp:post_date_gmt>2015-12-29 09:25:34</wp:post_date_gmt>
1246
+ <wp:comment_status>closed</wp:comment_status>
1247
+ <wp:ping_status>closed</wp:ping_status>
1248
+ <wp:post_name>happy-new-year-2</wp:post_name>
1249
+ <wp:status>publish</wp:status>
1250
+ <wp:post_parent>0</wp:post_parent>
1251
+ <wp:menu_order>0</wp:menu_order>
1252
+ <wp:post_type>lp_lesson</wp:post_type>
1253
+ <wp:post_password></wp:post_password>
1254
+ <wp:post_author_id>1</wp:post_author_id>
1255
+ <wp:is_sticky>0</wp:is_sticky>
1256
+ <wp:postmeta>
1257
+ <wp:meta_key>_lp_duration</wp:meta_key>
1258
+ <wp:meta_value><![CDATA[10]]></wp:meta_value>
1259
+ </wp:postmeta> <wp:postmeta>
1260
+ <wp:meta_key>_lp_is_previewable</wp:meta_key>
1261
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
1262
+ </wp:postmeta>
1263
+ </item><item>
1264
+ <title>Lesson 1</title>
1265
+ <link>http://localhost/foobla/learnpress/1.0/lessons/lesson-1/</link>
1266
+ <pubDate>Fri, 04 Dec 2015 08:17:04 +0000</pubDate>
1267
+ <dc:creator><![CDATA[admin]]></dc:creator>
1268
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/lesson-1/</guid>
1269
+ <description></description>
1270
+ <content:encoded><![CDATA[]]></content:encoded>
1271
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
1272
+ <wp:post_id>1536</wp:post_id>
1273
+ <wp:post_date>2015-12-04 08:17:04</wp:post_date>
1274
+ <wp:post_date_gmt>2015-12-04 08:17:04</wp:post_date_gmt>
1275
+ <wp:comment_status>open</wp:comment_status>
1276
+ <wp:ping_status>open</wp:ping_status>
1277
+ <wp:post_name>lesson-1</wp:post_name>
1278
+ <wp:status>publish</wp:status>
1279
+ <wp:post_parent>0</wp:post_parent>
1280
+ <wp:menu_order>0</wp:menu_order>
1281
+ <wp:post_type>lp_lesson</wp:post_type>
1282
+ <wp:post_password></wp:post_password>
1283
+ <wp:post_author_id>1</wp:post_author_id>
1284
+ <wp:is_sticky>0</wp:is_sticky>
1285
+ <wp:postmeta>
1286
+ <wp:meta_key>_lp_duration</wp:meta_key>
1287
+ <wp:meta_value><![CDATA[10]]></wp:meta_value>
1288
+ </wp:postmeta> <wp:postmeta>
1289
+ <wp:meta_key>_lp_max_students</wp:meta_key>
1290
+ <wp:meta_value><![CDATA[1000]]></wp:meta_value>
1291
+ </wp:postmeta> <wp:postmeta>
1292
+ <wp:meta_key>_lp_students</wp:meta_key>
1293
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
1294
+ </wp:postmeta> <wp:postmeta>
1295
+ <wp:meta_key>_lp_retake_count</wp:meta_key>
1296
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
1297
+ </wp:postmeta> <wp:postmeta>
1298
+ <wp:meta_key>_lp_passing_condition</wp:meta_key>
1299
+ <wp:meta_value><![CDATA[50]]></wp:meta_value>
1300
+ </wp:postmeta> <wp:postmeta>
1301
+ <wp:meta_key>_lp_enroll_requirement</wp:meta_key>
1302
+ <wp:meta_value><![CDATA[yes]]></wp:meta_value>
1303
+ </wp:postmeta> <wp:postmeta>
1304
+ <wp:meta_key>_lp_payment</wp:meta_key>
1305
+ <wp:meta_value><![CDATA[free]]></wp:meta_value>
1306
+ </wp:postmeta> <wp:postmeta>
1307
+ <wp:meta_key>_lp_is_previewable</wp:meta_key>
1308
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
1309
+ </wp:postmeta> <wp:postmeta>
1310
+ <wp:meta_key>_edit_lock</wp:meta_key>
1311
+ <wp:meta_value><![CDATA[1451567890:1]]></wp:meta_value>
1312
+ </wp:postmeta>
1313
+ </item><item>
1314
+ <title>Lesson 2</title>
1315
+ <link>http://localhost/foobla/learnpress/1.0/lessons/lesson-2/</link>
1316
+ <pubDate>Fri, 04 Dec 2015 08:17:04 +0000</pubDate>
1317
+ <dc:creator><![CDATA[admin]]></dc:creator>
1318
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/lesson-2/</guid>
1319
+ <description></description>
1320
+ <content:encoded><![CDATA[]]></content:encoded>
1321
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
1322
+ <wp:post_id>1537</wp:post_id>
1323
+ <wp:post_date>2015-12-04 08:17:04</wp:post_date>
1324
+ <wp:post_date_gmt>2015-12-04 08:17:04</wp:post_date_gmt>
1325
+ <wp:comment_status>open</wp:comment_status>
1326
+ <wp:ping_status>open</wp:ping_status>
1327
+ <wp:post_name>lesson-2</wp:post_name>
1328
+ <wp:status>publish</wp:status>
1329
+ <wp:post_parent>0</wp:post_parent>
1330
+ <wp:menu_order>0</wp:menu_order>
1331
+ <wp:post_type>lp_lesson</wp:post_type>
1332
+ <wp:post_password></wp:post_password>
1333
+ <wp:post_author_id>1</wp:post_author_id>
1334
+ <wp:is_sticky>0</wp:is_sticky>
1335
+ <wp:postmeta>
1336
+ <wp:meta_key>_lp_is_previewable</wp:meta_key>
1337
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
1338
+ </wp:postmeta>
1339
+ </item><item>
1340
+ <title>oi troi oi la troi</title>
1341
+ <link>http://localhost/foobla/learnpress/1.0/lessons/oi-troi-oi-la-troi/</link>
1342
+ <pubDate>Tue, 29 Dec 2015 09:29:54 +0000</pubDate>
1343
+ <dc:creator><![CDATA[admin]]></dc:creator>
1344
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/oi-troi-oi-la-troi/</guid>
1345
+ <description></description>
1346
+ <content:encoded><![CDATA[]]></content:encoded>
1347
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
1348
+ <wp:post_id>1538</wp:post_id>
1349
+ <wp:post_date>2015-12-29 09:29:54</wp:post_date>
1350
+ <wp:post_date_gmt>2015-12-29 09:29:54</wp:post_date_gmt>
1351
+ <wp:comment_status>closed</wp:comment_status>
1352
+ <wp:ping_status>closed</wp:ping_status>
1353
+ <wp:post_name>oi-troi-oi-la-troi</wp:post_name>
1354
+ <wp:status>publish</wp:status>
1355
+ <wp:post_parent>0</wp:post_parent>
1356
+ <wp:menu_order>0</wp:menu_order>
1357
+ <wp:post_type>lp_lesson</wp:post_type>
1358
+ <wp:post_password></wp:post_password>
1359
+ <wp:post_author_id>1</wp:post_author_id>
1360
+ <wp:is_sticky>0</wp:is_sticky>
1361
+ <wp:postmeta>
1362
+ <wp:meta_key>_lp_duration</wp:meta_key>
1363
+ <wp:meta_value><![CDATA[10]]></wp:meta_value>
1364
+ </wp:postmeta> <wp:postmeta>
1365
+ <wp:meta_key>_lp_is_previewable</wp:meta_key>
1366
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
1367
+ </wp:postmeta>
1368
+ </item><item>
1369
+ <title>333333333333</title>
1370
+ <link>http://localhost/foobla/learnpress/1.0/lessons/333333333333-2/</link>
1371
+ <pubDate>Tue, 08 Dec 2015 04:18:47 +0000</pubDate>
1372
+ <dc:creator><![CDATA[admin]]></dc:creator>
1373
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/333333333333-2/</guid>
1374
+ <description></description>
1375
+ <content:encoded><![CDATA[]]></content:encoded>
1376
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
1377
+ <wp:post_id>1539</wp:post_id>
1378
+ <wp:post_date>2015-12-08 04:18:47</wp:post_date>
1379
+ <wp:post_date_gmt>2015-12-08 04:18:47</wp:post_date_gmt>
1380
+ <wp:comment_status>open</wp:comment_status>
1381
+ <wp:ping_status>open</wp:ping_status>
1382
+ <wp:post_name>333333333333-2</wp:post_name>
1383
+ <wp:status>publish</wp:status>
1384
+ <wp:post_parent>0</wp:post_parent>
1385
+ <wp:menu_order>0</wp:menu_order>
1386
+ <wp:post_type>lp_lesson</wp:post_type>
1387
+ <wp:post_password></wp:post_password>
1388
+ <wp:post_author_id>1</wp:post_author_id>
1389
+ <wp:is_sticky>0</wp:is_sticky>
1390
+ <wp:postmeta>
1391
+ <wp:meta_key>_lp_is_previewable</wp:meta_key>
1392
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
1393
+ </wp:postmeta>
1394
+ </item><item>
1395
+ <title>44444444</title>
1396
+ <link>http://localhost/foobla/learnpress/1.0/lessons/44444444-2/</link>
1397
+ <pubDate>Tue, 29 Dec 2015 09:02:22 +0000</pubDate>
1398
+ <dc:creator><![CDATA[admin]]></dc:creator>
1399
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/44444444-2/</guid>
1400
+ <description></description>
1401
+ <content:encoded><![CDATA[]]></content:encoded>
1402
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
1403
+ <wp:post_id>1540</wp:post_id>
1404
+ <wp:post_date>2015-12-29 09:02:22</wp:post_date>
1405
+ <wp:post_date_gmt>2015-12-29 09:02:22</wp:post_date_gmt>
1406
+ <wp:comment_status>closed</wp:comment_status>
1407
+ <wp:ping_status>closed</wp:ping_status>
1408
+ <wp:post_name>44444444-2</wp:post_name>
1409
+ <wp:status>publish</wp:status>
1410
+ <wp:post_parent>0</wp:post_parent>
1411
+ <wp:menu_order>0</wp:menu_order>
1412
+ <wp:post_type>lp_lesson</wp:post_type>
1413
+ <wp:post_password></wp:post_password>
1414
+ <wp:post_author_id>1</wp:post_author_id>
1415
+ <wp:is_sticky>0</wp:is_sticky>
1416
+ <wp:postmeta>
1417
+ <wp:meta_key>_lp_duration</wp:meta_key>
1418
+ <wp:meta_value><![CDATA[10]]></wp:meta_value>
1419
+ </wp:postmeta> <wp:postmeta>
1420
+ <wp:meta_key>_lp_is_previewable</wp:meta_key>
1421
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
1422
+ </wp:postmeta>
1423
+ </item><item>
1424
+ <title>cookie</title>
1425
+ <link>http://localhost/foobla/learnpress/1.0/lessons/cookie/</link>
1426
+ <pubDate>Tue, 29 Dec 2015 09:33:07 +0000</pubDate>
1427
+ <dc:creator><![CDATA[admin]]></dc:creator>
1428
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/cookie/</guid>
1429
+ <description></description>
1430
+ <content:encoded><![CDATA[]]></content:encoded>
1431
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
1432
+ <wp:post_id>1541</wp:post_id>
1433
+ <wp:post_date>2015-12-29 09:33:07</wp:post_date>
1434
+ <wp:post_date_gmt>2015-12-29 09:33:07</wp:post_date_gmt>
1435
+ <wp:comment_status>closed</wp:comment_status>
1436
+ <wp:ping_status>closed</wp:ping_status>
1437
+ <wp:post_name>cookie</wp:post_name>
1438
+ <wp:status>publish</wp:status>
1439
+ <wp:post_parent>0</wp:post_parent>
1440
+ <wp:menu_order>0</wp:menu_order>
1441
+ <wp:post_type>lp_lesson</wp:post_type>
1442
+ <wp:post_password></wp:post_password>
1443
+ <wp:post_author_id>1</wp:post_author_id>
1444
+ <wp:is_sticky>0</wp:is_sticky>
1445
+ <wp:postmeta>
1446
+ <wp:meta_key>_lp_duration</wp:meta_key>
1447
+ <wp:meta_value><![CDATA[10]]></wp:meta_value>
1448
+ </wp:postmeta> <wp:postmeta>
1449
+ <wp:meta_key>_lp_is_previewable</wp:meta_key>
1450
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
1451
+ </wp:postmeta>
1452
+ </item> </channel>
1453
+ </rss>
dummy-data/learnpress-how-to-use-learnpress.xml CHANGED
@@ -1,1073 +1,1373 @@
 
1
  <?xml version="1.0" encoding="UTF-8" ?>
2
  <rss version="2.0"
3
- xmlns:excerpt="http://wordpress.org/export/1.0/excerpt/"
4
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
5
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
6
  xmlns:dc="http://purl.org/dc/elements/1.1/"
7
- xmlns:wp="http://wordpress.org/export/1.0/"
8
  >
9
-
10
  <channel>
11
- <title>LearnPress Dummy Data</title>
12
- <link>http://thimpress.com/learnpress</link>
13
- <description>LearnPress Demo data</description>
14
- <pubDate>Mon, 22 Jun 2015 07:58:18 +0000</pubDate>
15
  <language>en-US</language>
16
  <wp:wxr_version>1.0</wp:wxr_version>
17
- <wp:base_site_url>http://thimpress.com</wp:base_site_url>
18
- <wp:base_blog_url>http://thimpress.com/learnpress</wp:base_blog_url>
19
-
20
-
21
- <!-- START: Authors -->
22
- <wp:author><wp:author_id>2</wp:author_id><wp:author_login>ha</wp:author_login><wp:author_email>ha@foobla.com</wp:author_email><wp:author_display_name><![CDATA[ Hoàng]]></wp:author_display_name><wp:author_first_name><![CDATA[]]></wp:author_first_name><wp:author_last_name><![CDATA[Hoàng]]></wp:author_last_name></wp:author>
23
-
24
- <!-- END: Authors -->
25
- <!-- START: Courses -->
26
-
27
- <item>
28
- <title>How to use LearnPress</title>
29
- <link>http://home.foobla.com/courses/how-to-use-learnpress/</link>
30
- <pubDate>Wed, 20 May 2015 10:43:00 +0000</pubDate>
31
- <dc:creator><![CDATA[ha]]></dc:creator>
32
- <guid isPermaLink="false">http://home.foobla.com/?post_type=lpr_course&#038;p=133</guid>
33
  <description></description>
34
- <content:encoded><![CDATA[Welcome our valued customers to LearnPress,
35
-
36
- LearnPress is perfect fit for designing a Learning Management System. Our intention in this course is to show you the way to use LearnPress to create a great Online Learning System where you can set up your own system and lessons.
37
-
38
- Thanks and regards,
39
-
40
- Ha Hoang
41
-
42
- <strong>What will this course bring to you?</strong>
43
- <ol>
44
- <li>By the end of this course you will be able to control LearnPress plugin for your own demand.</li>
45
- <li>You will understand the plugin workflow and how to extend its features via add-ons</li>
46
- </ol>
47
- <strong>Target Audience:</strong>
48
- <ol>
49
- <li>The one who wants to create  an online learning system</li>
50
- <li>Developer who wants to contribute to LearnPress</li>
51
- <li>The one who wants to become an instructor in a LearnPress system</li>
52
- </ol>]]></content:encoded>
53
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
54
- <wp:post_id>133</wp:post_id>
55
- <wp:post_date>2015-05-20 17:43:00</wp:post_date>
56
- <wp:post_date_gmt>2015-05-20 10:43:00</wp:post_date_gmt>
57
- <wp:comment_status>closed</wp:comment_status>
58
- <wp:ping_status>closed</wp:ping_status>
59
- <wp:post_name>how-to-use-learnpress</wp:post_name>
60
  <wp:status>publish</wp:status>
61
  <wp:post_parent>0</wp:post_parent>
62
  <wp:menu_order>0</wp:menu_order>
63
- <wp:post_type>lpr_course</wp:post_type>
64
  <wp:post_password></wp:post_password>
65
- <wp:post_author_id>2</wp:post_author_id>
66
  <wp:is_sticky>0</wp:is_sticky>
67
-
68
- <wp:postmeta>
69
  <wp:meta_key>_edit_lock</wp:meta_key>
70
- <wp:meta_value><![CDATA[1434959746:1]]></wp:meta_value>
71
- </wp:postmeta>
72
- <wp:postmeta>
73
  <wp:meta_key>_edit_last</wp:meta_key>
74
- <wp:meta_value><![CDATA[13]]></wp:meta_value>
75
- </wp:postmeta>
76
- <wp:postmeta>
77
- <wp:meta_key>_lpr_course_lesson_quiz</wp:meta_key>
78
- <wp:meta_value><![CDATA[a:4:{i:0;a:2:{s:4:"name";s:12:"Introduction";s:11:"lesson_quiz";a:2:{i:0;s:3:"134";i:1;s:3:"164";}}i:1;a:2:{s:4:"name";s:22:"Basic Using LearnPress";s:11:"lesson_quiz";a:6:{i:0;s:3:"135";i:1;s:3:"136";i:2;s:3:"138";i:3;s:3:"140";i:4;s:3:"148";i:5;s:3:"142";}}i:2;a:2:{s:4:"name";s:7:"Add-ons";s:11:"lesson_quiz";a:3:{i:0;s:3:"141";i:1;s:3:"143";i:2;s:3:"144";}}i:3;a:2:{s:4:"name";s:13:"For Developer";s:11:"lesson_quiz";a:2:{i:0;s:3:"145";i:1;s:3:"147";}}}]]></wp:meta_value>
79
- </wp:postmeta>
80
- <wp:postmeta>
81
- <wp:meta_key>_lpr_course_section_state</wp:meta_key>
82
- <wp:meta_value><![CDATA[a:4:{i:0;s:1:"1";i:1;s:1:"1";i:2;s:1:"1";i:3;s:1:"1";}]]></wp:meta_value>
83
- </wp:postmeta>
84
- <wp:postmeta>
85
- <wp:meta_key>_lpr_course_duration</wp:meta_key>
86
  <wp:meta_value><![CDATA[10]]></wp:meta_value>
87
- </wp:postmeta>
88
- <wp:postmeta>
89
- <wp:meta_key>_lpr_course_number_student</wp:meta_key>
90
- <wp:meta_value><![CDATA[3]]></wp:meta_value>
91
- </wp:postmeta>
92
- <wp:postmeta>
93
- <wp:meta_key>_lpr_max_course_number_student</wp:meta_key>
94
  <wp:meta_value><![CDATA[1000]]></wp:meta_value>
95
- </wp:postmeta>
96
- <wp:postmeta>
97
- <wp:meta_key>_lpr_course_condition</wp:meta_key>
 
 
 
 
 
98
  <wp:meta_value><![CDATA[50]]></wp:meta_value>
99
- </wp:postmeta>
100
- <wp:postmeta>
101
- <wp:meta_key>_lpr_course_payment</wp:meta_key>
102
- <wp:meta_value><![CDATA[free]]></wp:meta_value>
103
- </wp:postmeta>
104
- <wp:postmeta>
105
- <wp:meta_key>_lpr_course_forum</wp:meta_key>
106
  <wp:meta_value><![CDATA[yes]]></wp:meta_value>
107
- </wp:postmeta>
108
- <wp:postmeta>
109
- <wp:meta_key>_lpr_course_forum_id</wp:meta_key>
110
- <wp:meta_value><![CDATA[329]]></wp:meta_value>
111
- </wp:postmeta>
112
- </item>
113
- <!-- END: Courses -->
114
- <!-- START: Lessons and Quizzes -->
115
-
116
- <item>
117
- <title>What is LearnPress?</title>
118
- <link>http://home.foobla.com/lessons/what-is-learnpress/</link>
119
- <pubDate>Sun, 17 May 2015 01:36:00 +0000</pubDate>
120
- <dc:creator><![CDATA[ha]]></dc:creator>
121
- <guid isPermaLink="false">http://home.foobla.com/lessons/what-is-learnpress/</guid>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
122
  <description></description>
123
- <content:encoded><![CDATA[LearnPress is an extremely strong WordPress plugin which helps you create an Online Learning Management System Website.
124
-
125
- If you are an administrator who controls and manages an Online Learning System, LearnPress provides you with complete features for your work including Courses, Lessons, Quizzes and Question Management, Payment Solutions, Statistics and a lot of add-ons for you to extend your system scale.
126
-
127
- If you are a teacher who wants to create Courses and share your knowledge to everybody on the internet, LearnPress will help you create Courses, Lessons and Quizzes and manage them easily. You will find the easiest online teaching system here.
128
-
129
- If you are a student, you can access with courses, study and test with friendly user interfaces.
130
-
131
- LearnPress also provides tools for you to create forums that you can simply interact with your teacher and your peer.
132
-
133
- And LearnPress gives these advantages to you FREE OF CHARGE!!!]]></content:encoded>
134
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
135
- <wp:post_id>134</wp:post_id>
136
- <wp:post_date>2015-05-17 08:36:00</wp:post_date>
137
- <wp:post_date_gmt>2015-05-17 01:36:00</wp:post_date_gmt>
138
  <wp:comment_status>closed</wp:comment_status>
139
  <wp:ping_status>closed</wp:ping_status>
140
- <wp:post_name>what-is-learnpress</wp:post_name>
141
  <wp:status>publish</wp:status>
142
  <wp:post_parent>0</wp:post_parent>
143
  <wp:menu_order>0</wp:menu_order>
144
- <wp:post_type>lpr_lesson</wp:post_type>
145
  <wp:post_password></wp:post_password>
146
- <wp:post_author_id>2</wp:post_author_id>
147
  <wp:is_sticky>0</wp:is_sticky>
148
-
149
- <wp:postmeta>
150
  <wp:meta_key>_edit_lock</wp:meta_key>
151
- <wp:meta_value><![CDATA[1433407905:13]]></wp:meta_value>
152
- </wp:postmeta>
153
- <wp:postmeta>
154
- <wp:meta_key>_edit_last</wp:meta_key>
155
- <wp:meta_value><![CDATA[13]]></wp:meta_value>
156
- </wp:postmeta>
157
- <wp:postmeta>
158
- <wp:meta_key>_lpr_lesson_duration</wp:meta_key>
159
- <wp:meta_value><![CDATA[12]]></wp:meta_value>
160
- </wp:postmeta>
161
- <wp:postmeta>
162
- <wp:meta_key>_lpr_lesson_preview</wp:meta_key>
163
- <wp:meta_value><![CDATA[preview]]></wp:meta_value>
164
- </wp:postmeta>
165
- <wp:postmeta>
166
- <wp:meta_key>_lpr_course</wp:meta_key>
167
- <wp:meta_value><![CDATA[133]]></wp:meta_value>
168
- </wp:postmeta>
169
- </item>
170
-
171
- <item>
172
- <title>How to create a course?</title>
173
- <link>http://home.foobla.com/lessons/how-to-create-a-course/</link>
174
- <pubDate>Sun, 17 May 2015 01:36:36 +0000</pubDate>
175
- <dc:creator><![CDATA[ha]]></dc:creator>
176
- <guid isPermaLink="false">http://home.foobla.com/lessons/how-to-create-a-course/</guid>
177
  <description></description>
178
- <content:encoded><![CDATA[LearnPress is a Learning Management System (LMS) with courses. First, let study a bit about a course in LearnPress.
179
-
180
- A course in LearnPress contains sections, each section will include lessons to present your knowledge and quiz(optional) in order for you to give questions to test your students.
181
-
182
- Following these steps to create a course:
183
-
184
- 1. Give a course title
185
-
186
- 2. Describe course content.
187
-
188
- 3 - Create course curriculum
189
-
190
- -The biggest title is the section name
191
-
192
- - Here you can find 4 buttons: add lesson, add quiz, quick add lesson, quick add quiz. The first and second button are to add existing lessons and quizzes into this section. If you don't have any lesson and quiz available to add, new lessons and quizzes can be quickly created to this section with 2 other buttons.
193
-
194
- Those quickly created lessons and quizzes  just have title, therefore the edit link on the right is used to add your lesson and quiz content.
195
 
196
- After completing your curriculum, now, you can take a look to your course settings where to set your course up. Let see what LearnPress provides for your course.
197
 
198
- Course duration: The length of your course.
199
 
200
- Course time:
201
 
202
- Number of student enrolled:
203
-
204
- Maximum students an take the course:
205
-
206
- Co-instructor:
207
-
208
- Certificate:
209
-
210
- The next part is "Course assessment". Currently LearnPress supports two types of "Course assessment".
211
-
212
- The last part is for commercial course. You can set your course free or not. If it is charged, a price should be set by the administrator as he reviews the course.
213
-
214
- Congratulation ! Now, you can submit your course for review, after your LMS is published. It is now online ^_^
215
-
216
- &nbsp;]]></content:encoded>
217
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
218
- <wp:post_id>135</wp:post_id>
219
- <wp:post_date>2015-05-17 08:36:36</wp:post_date>
220
- <wp:post_date_gmt>2015-05-17 01:36:36</wp:post_date_gmt>
221
- <wp:comment_status>closed</wp:comment_status>
222
- <wp:ping_status>closed</wp:ping_status>
223
- <wp:post_name>how-to-create-a-course</wp:post_name>
224
  <wp:status>publish</wp:status>
225
  <wp:post_parent>0</wp:post_parent>
226
  <wp:menu_order>0</wp:menu_order>
227
- <wp:post_type>lpr_lesson</wp:post_type>
228
  <wp:post_password></wp:post_password>
229
- <wp:post_author_id>2</wp:post_author_id>
230
  <wp:is_sticky>0</wp:is_sticky>
231
-
232
- <wp:postmeta>
 
233
  <wp:meta_key>_edit_lock</wp:meta_key>
234
- <wp:meta_value><![CDATA[1433479017:13]]></wp:meta_value>
235
- </wp:postmeta>
236
- <wp:postmeta>
237
  <wp:meta_key>_edit_last</wp:meta_key>
238
- <wp:meta_value><![CDATA[13]]></wp:meta_value>
239
- </wp:postmeta>
240
- <wp:postmeta>
241
- <wp:meta_key>_lpr_lesson_duration</wp:meta_key>
 
 
 
 
 
 
 
 
242
  <wp:meta_value><![CDATA[10]]></wp:meta_value>
243
- </wp:postmeta>
244
- <wp:postmeta>
245
- <wp:meta_key>_lpr_lesson_preview</wp:meta_key>
246
- <wp:meta_value><![CDATA[not_preview]]></wp:meta_value>
247
- </wp:postmeta>
248
- <wp:postmeta>
249
- <wp:meta_key>_lpr_course</wp:meta_key>
250
- <wp:meta_value><![CDATA[133]]></wp:meta_value>
251
- </wp:postmeta>
252
- </item>
253
-
254
- <item>
255
- <title>How to create a lesson?</title>
256
- <link>http://home.foobla.com/lessons/how-to-create-a-lesson/</link>
257
- <pubDate>Sun, 17 May 2015 01:36:52 +0000</pubDate>
258
- <dc:creator><![CDATA[ha]]></dc:creator>
259
- <guid isPermaLink="false">http://home.foobla.com/lessons/how-to-create-a-lesson/</guid>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
260
  <description></description>
261
- <content:encoded><![CDATA[A lesson is an essential part of a course. It contains knowledge in a specific topic which teacher desires to teach students.
262
-
263
- A lesson in LearnPress can be text, video or audio.
264
-
265
- Just simply copy and paste your link of video to lesson content to show.
266
-
267
- There are 2 options in lesson settings
268
-
269
- 1-  Lesson duration: to estimate how much time do you think students should need to study that lesson,
270
-
271
- 2- Preview lesson: If your lesson is a preview, it is not necessary for your student to take course to view.
272
-
273
- &nbsp;]]></content:encoded>
274
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
275
- <wp:post_id>136</wp:post_id>
276
- <wp:post_date>2015-05-17 08:36:52</wp:post_date>
277
- <wp:post_date_gmt>2015-05-17 01:36:52</wp:post_date_gmt>
278
- <wp:comment_status>closed</wp:comment_status>
279
- <wp:ping_status>closed</wp:ping_status>
280
- <wp:post_name>how-to-create-a-lesson</wp:post_name>
281
  <wp:status>publish</wp:status>
282
  <wp:post_parent>0</wp:post_parent>
283
  <wp:menu_order>0</wp:menu_order>
284
- <wp:post_type>lpr_lesson</wp:post_type>
285
  <wp:post_password></wp:post_password>
286
- <wp:post_author_id>2</wp:post_author_id>
287
  <wp:is_sticky>0</wp:is_sticky>
288
-
289
- <wp:postmeta>
290
  <wp:meta_key>_edit_lock</wp:meta_key>
291
- <wp:meta_value><![CDATA[1433485503:13]]></wp:meta_value>
292
- </wp:postmeta>
293
- <wp:postmeta>
294
  <wp:meta_key>_edit_last</wp:meta_key>
295
- <wp:meta_value><![CDATA[13]]></wp:meta_value>
296
- </wp:postmeta>
297
- <wp:postmeta>
298
- <wp:meta_key>_lpr_lesson_duration</wp:meta_key>
299
- <wp:meta_value><![CDATA[5]]></wp:meta_value>
300
- </wp:postmeta>
301
- <wp:postmeta>
302
- <wp:meta_key>_lpr_lesson_preview</wp:meta_key>
303
- <wp:meta_value><![CDATA[not_preview]]></wp:meta_value>
304
- </wp:postmeta>
305
- <wp:postmeta>
306
- <wp:meta_key>_lpr_course</wp:meta_key>
307
- <wp:meta_value><![CDATA[133]]></wp:meta_value>
308
- </wp:postmeta>
309
- </item>
310
-
311
- <item>
312
- <title>How to create a quiz?</title>
313
- <link>http://home.foobla.com/lessons/how-to-create-a-quiz/</link>
314
- <pubDate>Sun, 17 May 2015 01:38:34 +0000</pubDate>
315
- <dc:creator><![CDATA[ha]]></dc:creator>
316
- <guid isPermaLink="false">http://home.foobla.com/lessons/how-to-create-a-quiz/</guid>
317
  <description></description>
318
- <content:encoded><![CDATA[Quiz is a part of a course which is used to testing your student's understanding of your course.
319
 
320
- There are 2 ways to create a quiz:
321
 
322
- 1. Go to "Quizzes&gt;add new" and "Add quiz" to a course later
323
 
324
- 2. Create a quiz by "Quick add quiz". There is only a title by this way therefore you need to "edit" it to add more questions to your quiz.
325
 
326
- &nbsp;]]></content:encoded>
327
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
328
- <wp:post_id>138</wp:post_id>
329
- <wp:post_date>2015-05-17 08:38:34</wp:post_date>
330
- <wp:post_date_gmt>2015-05-17 01:38:34</wp:post_date_gmt>
331
  <wp:comment_status>closed</wp:comment_status>
332
  <wp:ping_status>closed</wp:ping_status>
333
- <wp:post_name>how-to-create-a-quiz</wp:post_name>
334
  <wp:status>publish</wp:status>
335
  <wp:post_parent>0</wp:post_parent>
336
  <wp:menu_order>0</wp:menu_order>
337
- <wp:post_type>lpr_lesson</wp:post_type>
338
  <wp:post_password></wp:post_password>
339
- <wp:post_author_id>2</wp:post_author_id>
340
  <wp:is_sticky>0</wp:is_sticky>
341
-
342
- <wp:postmeta>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
343
  <wp:meta_key>_edit_lock</wp:meta_key>
344
- <wp:meta_value><![CDATA[1433489901:13]]></wp:meta_value>
345
- </wp:postmeta>
346
- <wp:postmeta>
347
  <wp:meta_key>_edit_last</wp:meta_key>
348
- <wp:meta_value><![CDATA[13]]></wp:meta_value>
349
- </wp:postmeta>
350
- <wp:postmeta>
351
- <wp:meta_key>_lpr_lesson_duration</wp:meta_key>
352
- <wp:meta_value><![CDATA[30]]></wp:meta_value>
353
- </wp:postmeta>
354
- <wp:postmeta>
355
- <wp:meta_key>_lpr_lesson_preview</wp:meta_key>
356
- <wp:meta_value><![CDATA[not_preview]]></wp:meta_value>
357
- </wp:postmeta>
358
- <wp:postmeta>
359
- <wp:meta_key>_lpr_course</wp:meta_key>
360
- <wp:meta_value><![CDATA[133]]></wp:meta_value>
361
- </wp:postmeta>
362
- </item>
363
-
364
- <item>
365
- <title>How to create a question?</title>
366
- <link>http://home.foobla.com/lessons/how-to-create-a-question/</link>
367
- <pubDate>Sun, 17 May 2015 01:38:50 +0000</pubDate>
368
- <dc:creator><![CDATA[ha]]></dc:creator>
369
- <guid isPermaLink="false">http://home.foobla.com/lessons/how-to-create-a-question/</guid>
370
  <description></description>
371
- <content:encoded><![CDATA[Question is an essential part of quiz. There are plenty types of question but in LearnPress we first support 3 types: True or False, Single Choice and Multiple Choices question.
372
-
373
- You can also create a question while creating a quiz or go to "Questions&gt;add new"
374
-
375
- ]]></content:encoded>
376
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
377
- <wp:post_id>140</wp:post_id>
378
- <wp:post_date>2015-05-17 08:38:50</wp:post_date>
379
- <wp:post_date_gmt>2015-05-17 01:38:50</wp:post_date_gmt>
380
- <wp:comment_status>closed</wp:comment_status>
381
- <wp:ping_status>closed</wp:ping_status>
382
- <wp:post_name>how-to-create-a-question</wp:post_name>
383
  <wp:status>publish</wp:status>
384
  <wp:post_parent>0</wp:post_parent>
385
  <wp:menu_order>0</wp:menu_order>
386
- <wp:post_type>lpr_lesson</wp:post_type>
387
  <wp:post_password></wp:post_password>
388
- <wp:post_author_id>2</wp:post_author_id>
389
  <wp:is_sticky>0</wp:is_sticky>
390
-
391
- <wp:postmeta>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
392
  <wp:meta_key>_edit_lock</wp:meta_key>
393
- <wp:meta_value><![CDATA[1433497632:13]]></wp:meta_value>
394
- </wp:postmeta>
395
- <wp:postmeta>
396
- <wp:meta_key>_edit_last</wp:meta_key>
397
- <wp:meta_value><![CDATA[13]]></wp:meta_value>
398
- </wp:postmeta>
399
- <wp:postmeta>
400
- <wp:meta_key>_lpr_lesson_duration</wp:meta_key>
401
- <wp:meta_value><![CDATA[30]]></wp:meta_value>
402
- </wp:postmeta>
403
- <wp:postmeta>
404
- <wp:meta_key>_lpr_lesson_preview</wp:meta_key>
405
- <wp:meta_value><![CDATA[not_preview]]></wp:meta_value>
406
- </wp:postmeta>
407
- <wp:postmeta>
408
- <wp:meta_key>_lpr_course</wp:meta_key>
409
- <wp:meta_value><![CDATA[133]]></wp:meta_value>
410
- </wp:postmeta>
411
- </item>
412
-
413
- <item>
414
- <title>Statistic</title>
415
- <link>http://home.foobla.com/lessons/statistic/</link>
416
- <pubDate>Sun, 17 May 2015 01:38:57 +0000</pubDate>
417
- <dc:creator><![CDATA[ha]]></dc:creator>
418
- <guid isPermaLink="false">http://home.foobla.com/lessons/statistic/</guid>
419
  <description></description>
420
- <content:encoded><![CDATA[This is an advance feature for instructors, administrator to see how the courses  or sites are going on.
421
-
422
- ]]></content:encoded>
423
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
424
- <wp:post_id>141</wp:post_id>
425
- <wp:post_date>2015-05-17 08:38:57</wp:post_date>
426
- <wp:post_date_gmt>2015-05-17 01:38:57</wp:post_date_gmt>
427
- <wp:comment_status>closed</wp:comment_status>
428
- <wp:ping_status>closed</wp:ping_status>
429
- <wp:post_name>statistic</wp:post_name>
430
  <wp:status>publish</wp:status>
431
  <wp:post_parent>0</wp:post_parent>
432
  <wp:menu_order>0</wp:menu_order>
433
- <wp:post_type>lpr_lesson</wp:post_type>
434
  <wp:post_password></wp:post_password>
435
- <wp:post_author_id>2</wp:post_author_id>
436
  <wp:is_sticky>0</wp:is_sticky>
437
-
438
- <wp:postmeta>
439
- <wp:meta_key>_edit_lock</wp:meta_key>
440
- <wp:meta_value><![CDATA[1433495039:13]]></wp:meta_value>
441
- </wp:postmeta>
442
- <wp:postmeta>
443
- <wp:meta_key>_edit_last</wp:meta_key>
444
- <wp:meta_value><![CDATA[13]]></wp:meta_value>
445
- </wp:postmeta>
446
- <wp:postmeta>
447
- <wp:meta_key>_lpr_lesson_duration</wp:meta_key>
448
- <wp:meta_value><![CDATA[30]]></wp:meta_value>
449
- </wp:postmeta>
450
- <wp:postmeta>
451
- <wp:meta_key>_lpr_lesson_preview</wp:meta_key>
452
- <wp:meta_value><![CDATA[not_preview]]></wp:meta_value>
453
- </wp:postmeta>
454
- <wp:postmeta>
455
  <wp:meta_key>_lpr_course</wp:meta_key>
456
- <wp:meta_value><![CDATA[133]]></wp:meta_value>
457
- </wp:postmeta>
458
- </item>
459
-
460
- <item>
461
- <title>Basic using LearnPress</title>
462
- <link>http://home.foobla.com/quizzes/basic-using-learnpress/</link>
463
- <pubDate>Sun, 17 May 2015 01:39:25 +0000</pubDate>
464
- <dc:creator><![CDATA[ha]]></dc:creator>
465
- <guid isPermaLink="false">http://home.foobla.com/blog/quiz/basic-using-learnpress/</guid>
 
466
  <description></description>
467
- <content:encoded><![CDATA[How do you understand the basic using of LearnPress. Let check it !]]></content:encoded>
468
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
469
- <wp:post_id>142</wp:post_id>
470
- <wp:post_date>2015-05-17 08:39:25</wp:post_date>
471
- <wp:post_date_gmt>2015-05-17 01:39:25</wp:post_date_gmt>
472
- <wp:comment_status>closed</wp:comment_status>
473
- <wp:ping_status>closed</wp:ping_status>
474
- <wp:post_name>basic-using-learnpress</wp:post_name>
475
  <wp:status>publish</wp:status>
476
  <wp:post_parent>0</wp:post_parent>
477
  <wp:menu_order>0</wp:menu_order>
478
- <wp:post_type>lpr_quiz</wp:post_type>
479
  <wp:post_password></wp:post_password>
480
- <wp:post_author_id>2</wp:post_author_id>
481
  <wp:is_sticky>0</wp:is_sticky>
482
-
483
- <wp:postmeta>
484
- <wp:meta_key>_edit_lock</wp:meta_key>
485
- <wp:meta_value><![CDATA[1433672874:1]]></wp:meta_value>
486
- </wp:postmeta>
487
- <wp:postmeta>
488
- <wp:meta_key>_lpr_quiz_questions</wp:meta_key>
489
- <wp:meta_value><![CDATA[a:4:{i:252;a:1:{s:6:"toggle";s:1:"1";}i:251;a:1:{s:6:"toggle";s:1:"1";}i:276;a:1:{s:6:"toggle";s:1:"1";}i:277;a:1:{s:6:"toggle";s:1:"1";}}]]></wp:meta_value>
490
- </wp:postmeta>
491
- <wp:postmeta>
492
- <wp:meta_key>_edit_last</wp:meta_key>
493
- <wp:meta_value><![CDATA[2]]></wp:meta_value>
494
- </wp:postmeta>
495
- <wp:postmeta>
496
  <wp:meta_key>_lpr_course</wp:meta_key>
497
- <wp:meta_value><![CDATA[133]]></wp:meta_value>
498
- </wp:postmeta>
499
- </item>
500
-
501
- <item>
502
- <title>What is an add-on?</title>
503
- <link>http://home.foobla.com/lessons/what-is-add-ons/</link>
504
- <pubDate>Sun, 17 May 2015 01:40:05 +0000</pubDate>
505
- <dc:creator><![CDATA[ha]]></dc:creator>
506
- <guid isPermaLink="false">http://home.foobla.com/lessons/what-is-add-ons/</guid>
 
507
  <description></description>
508
- <content:encoded><![CDATA[Add-ons are extension parts of LearnPress. Add-on provides new functions and features to add to LearnPress. If you are an administrator of a LMS, you can easily select to turn add-on on or off
509
-
510
- In case of a developer, you can create an add-on for LearnPress by yourself. LearnPress is an open source project and a full documentation of how you can create an add-on for LearnPress will be provided to you.]]></content:encoded>
511
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
512
- <wp:post_id>143</wp:post_id>
513
- <wp:post_date>2015-05-17 08:40:05</wp:post_date>
514
- <wp:post_date_gmt>2015-05-17 01:40:05</wp:post_date_gmt>
515
- <wp:comment_status>closed</wp:comment_status>
516
- <wp:ping_status>closed</wp:ping_status>
517
- <wp:post_name>what-is-add-ons</wp:post_name>
518
  <wp:status>publish</wp:status>
519
  <wp:post_parent>0</wp:post_parent>
520
  <wp:menu_order>0</wp:menu_order>
521
- <wp:post_type>lpr_lesson</wp:post_type>
522
  <wp:post_password></wp:post_password>
523
- <wp:post_author_id>2</wp:post_author_id>
524
  <wp:is_sticky>0</wp:is_sticky>
525
-
526
- <wp:postmeta>
527
- <wp:meta_key>_edit_lock</wp:meta_key>
528
- <wp:meta_value><![CDATA[1433497634:13]]></wp:meta_value>
529
- </wp:postmeta>
530
- <wp:postmeta>
531
- <wp:meta_key>_edit_last</wp:meta_key>
532
- <wp:meta_value><![CDATA[13]]></wp:meta_value>
533
- </wp:postmeta>
534
- <wp:postmeta>
535
- <wp:meta_key>_lpr_lesson_duration</wp:meta_key>
536
- <wp:meta_value><![CDATA[3]]></wp:meta_value>
537
- </wp:postmeta>
538
- <wp:postmeta>
539
- <wp:meta_key>_lpr_lesson_preview</wp:meta_key>
540
- <wp:meta_value><![CDATA[not_preview]]></wp:meta_value>
541
- </wp:postmeta>
542
- <wp:postmeta>
543
  <wp:meta_key>_lpr_course</wp:meta_key>
544
- <wp:meta_value><![CDATA[133]]></wp:meta_value>
545
- </wp:postmeta>
546
- </item>
547
-
548
- <item>
549
- <title>Add-ons</title>
550
- <link>http://home.foobla.com/quizzes/add-ons/</link>
551
- <pubDate>Sun, 17 May 2015 01:40:17 +0000</pubDate>
552
- <dc:creator><![CDATA[ha]]></dc:creator>
553
- <guid isPermaLink="false">http://home.foobla.com/blog/quiz/add-ons/</guid>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
554
  <description></description>
555
- <content:encoded><![CDATA[This quiz is used to testing your understanding about Adds-on on LearnPress. Let start !
556
-
557
- &nbsp;]]></content:encoded>
558
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
559
- <wp:post_id>144</wp:post_id>
560
- <wp:post_date>2015-05-17 08:40:17</wp:post_date>
561
- <wp:post_date_gmt>2015-05-17 01:40:17</wp:post_date_gmt>
562
- <wp:comment_status>closed</wp:comment_status>
563
- <wp:ping_status>closed</wp:ping_status>
564
- <wp:post_name>add-ons</wp:post_name>
565
  <wp:status>publish</wp:status>
566
  <wp:post_parent>0</wp:post_parent>
567
  <wp:menu_order>0</wp:menu_order>
568
- <wp:post_type>lpr_quiz</wp:post_type>
569
  <wp:post_password></wp:post_password>
570
- <wp:post_author_id>2</wp:post_author_id>
571
  <wp:is_sticky>0</wp:is_sticky>
572
-
573
- <wp:postmeta>
574
- <wp:meta_key>_edit_lock</wp:meta_key>
575
- <wp:meta_value><![CDATA[1433129466:13]]></wp:meta_value>
576
- </wp:postmeta>
577
- <wp:postmeta>
578
- <wp:meta_key>_lpr_quiz_questions</wp:meta_key>
579
- <wp:meta_value><![CDATA[a:1:{i:317;a:1:{s:6:"toggle";s:1:"1";}}]]></wp:meta_value>
580
- </wp:postmeta>
581
- <wp:postmeta>
582
- <wp:meta_key>_edit_last</wp:meta_key>
583
- <wp:meta_value><![CDATA[13]]></wp:meta_value>
584
- </wp:postmeta>
585
- <wp:postmeta>
586
- <wp:meta_key>_lpr_duration</wp:meta_key>
587
- <wp:meta_value><![CDATA[10]]></wp:meta_value>
588
- </wp:postmeta>
589
- <wp:postmeta>
590
- <wp:meta_key>_lpr_show_quiz_result</wp:meta_key>
591
- <wp:meta_value><![CDATA[0]]></wp:meta_value>
592
- </wp:postmeta>
593
- <wp:postmeta>
594
  <wp:meta_key>_lpr_course</wp:meta_key>
595
- <wp:meta_value><![CDATA[133]]></wp:meta_value>
596
- </wp:postmeta>
597
- </item>
598
-
599
- <item>
600
- <title>How to create an add-ons?</title>
601
- <link>http://home.foobla.com/lessons/how-to-create-an-add-ons/</link>
602
- <pubDate>Sun, 17 May 2015 01:40:31 +0000</pubDate>
603
- <dc:creator><![CDATA[ha]]></dc:creator>
604
- <guid isPermaLink="false">http://home.foobla.com/lessons/how-to-create-an-add-ons/</guid>
 
605
  <description></description>
606
- <content:encoded><![CDATA[This lesson will provide tutorial instruction to create an add-on for LearnPress.
607
-
608
- Coming soon.
609
-
610
- Thank you,]]></content:encoded>
611
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
612
- <wp:post_id>145</wp:post_id>
613
- <wp:post_date>2015-05-17 08:40:31</wp:post_date>
614
- <wp:post_date_gmt>2015-05-17 01:40:31</wp:post_date_gmt>
615
- <wp:comment_status>closed</wp:comment_status>
616
- <wp:ping_status>closed</wp:ping_status>
617
- <wp:post_name>how-to-create-an-add-ons</wp:post_name>
618
  <wp:status>publish</wp:status>
619
  <wp:post_parent>0</wp:post_parent>
620
  <wp:menu_order>0</wp:menu_order>
621
- <wp:post_type>lpr_lesson</wp:post_type>
622
  <wp:post_password></wp:post_password>
623
- <wp:post_author_id>2</wp:post_author_id>
624
  <wp:is_sticky>0</wp:is_sticky>
625
-
626
- <wp:postmeta>
627
- <wp:meta_key>_edit_lock</wp:meta_key>
628
- <wp:meta_value><![CDATA[1433497636:13]]></wp:meta_value>
629
- </wp:postmeta>
630
- <wp:postmeta>
631
- <wp:meta_key>_edit_last</wp:meta_key>
632
- <wp:meta_value><![CDATA[13]]></wp:meta_value>
633
- </wp:postmeta>
634
- <wp:postmeta>
635
- <wp:meta_key>_lpr_lesson_duration</wp:meta_key>
636
- <wp:meta_value><![CDATA[1]]></wp:meta_value>
637
- </wp:postmeta>
638
- <wp:postmeta>
639
- <wp:meta_key>_lpr_lesson_preview</wp:meta_key>
640
- <wp:meta_value><![CDATA[not_preview]]></wp:meta_value>
641
- </wp:postmeta>
642
- <wp:postmeta>
643
  <wp:meta_key>_lpr_course</wp:meta_key>
644
- <wp:meta_value><![CDATA[133]]></wp:meta_value>
645
- </wp:postmeta>
646
- </item>
647
-
648
- <item>
649
- <title>Developer</title>
650
- <link>http://home.foobla.com/quizzes/developer/</link>
651
- <pubDate>Sun, 17 May 2015 01:40:47 +0000</pubDate>
652
- <dc:creator><![CDATA[ha]]></dc:creator>
653
- <guid isPermaLink="false">http://home.foobla.com/blog/quiz/developer/</guid>
 
654
  <description></description>
655
  <content:encoded><![CDATA[]]></content:encoded>
656
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
657
- <wp:post_id>147</wp:post_id>
658
- <wp:post_date>2015-05-17 08:40:47</wp:post_date>
659
- <wp:post_date_gmt>2015-05-17 01:40:47</wp:post_date_gmt>
660
  <wp:comment_status>open</wp:comment_status>
661
  <wp:ping_status>open</wp:ping_status>
662
- <wp:post_name>developer</wp:post_name>
663
  <wp:status>publish</wp:status>
664
  <wp:post_parent>0</wp:post_parent>
665
  <wp:menu_order>0</wp:menu_order>
666
- <wp:post_type>lpr_quiz</wp:post_type>
667
  <wp:post_password></wp:post_password>
668
- <wp:post_author_id>2</wp:post_author_id>
669
  <wp:is_sticky>0</wp:is_sticky>
670
-
671
- <wp:postmeta>
672
  <wp:meta_key>_edit_lock</wp:meta_key>
673
- <wp:meta_value><![CDATA[1433129580:13]]></wp:meta_value>
674
- </wp:postmeta>
675
- <wp:postmeta>
676
- <wp:meta_key>_lpr_course</wp:meta_key>
677
- <wp:meta_value><![CDATA[133]]></wp:meta_value>
678
- </wp:postmeta>
679
- </item>
680
-
681
- <item>
682
- <title>Orders and Payment</title>
683
- <link>http://home.foobla.com/lessons/orders-and-payment/</link>
684
- <pubDate>Sun, 17 May 2015 01:41:08 +0000</pubDate>
685
- <dc:creator><![CDATA[ha]]></dc:creator>
686
- <guid isPermaLink="false">http://home.foobla.com/lessons/orders-and-payment/</guid>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
687
  <description></description>
688
  <content:encoded><![CDATA[]]></content:encoded>
689
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
690
- <wp:post_id>148</wp:post_id>
691
- <wp:post_date>2015-05-17 08:41:08</wp:post_date>
692
- <wp:post_date_gmt>2015-05-17 01:41:08</wp:post_date_gmt>
693
  <wp:comment_status>open</wp:comment_status>
694
  <wp:ping_status>open</wp:ping_status>
695
- <wp:post_name>orders-and-payment</wp:post_name>
696
  <wp:status>publish</wp:status>
697
  <wp:post_parent>0</wp:post_parent>
698
  <wp:menu_order>0</wp:menu_order>
699
- <wp:post_type>lpr_lesson</wp:post_type>
700
  <wp:post_password></wp:post_password>
701
- <wp:post_author_id>2</wp:post_author_id>
702
  <wp:is_sticky>0</wp:is_sticky>
703
 
704
- <wp:postmeta>
705
- <wp:meta_key>_edit_lock</wp:meta_key>
706
- <wp:meta_value><![CDATA[1433122037:13]]></wp:meta_value>
707
- </wp:postmeta>
708
- <wp:postmeta>
709
- <wp:meta_key>_lpr_course</wp:meta_key>
710
- <wp:meta_value><![CDATA[133]]></wp:meta_value>
711
- </wp:postmeta>
712
- </item>
713
-
714
- <item>
715
- <title>What is LearnPress?</title>
716
- <link>http://home.foobla.com/quizzes/what-is-learnpress/</link>
717
- <pubDate>Thu, 21 May 2015 08:37:02 +0000</pubDate>
718
- <dc:creator><![CDATA[ha]]></dc:creator>
719
- <guid isPermaLink="false">http://home.foobla.com/blog/quiz/what-is-learnpress/</guid>
720
  <description></description>
721
- <content:encoded><![CDATA[This quiz is used to testing your understanding about your previous section about "What is LearnPress?".
722
-
723
- 4 multiple choice questions will be contained]]></content:encoded>
724
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
725
- <wp:post_id>164</wp:post_id>
726
- <wp:post_date>2015-05-21 15:37:02</wp:post_date>
727
- <wp:post_date_gmt>2015-05-21 08:37:02</wp:post_date_gmt>
728
- <wp:comment_status>closed</wp:comment_status>
729
- <wp:ping_status>closed</wp:ping_status>
730
- <wp:post_name>what-is-learnpress</wp:post_name>
731
  <wp:status>publish</wp:status>
732
  <wp:post_parent>0</wp:post_parent>
733
  <wp:menu_order>0</wp:menu_order>
734
- <wp:post_type>lpr_quiz</wp:post_type>
735
  <wp:post_password></wp:post_password>
736
- <wp:post_author_id>2</wp:post_author_id>
737
  <wp:is_sticky>0</wp:is_sticky>
738
 
739
- <wp:postmeta>
740
- <wp:meta_key>_edit_lock</wp:meta_key>
741
- <wp:meta_value><![CDATA[1433488757:13]]></wp:meta_value>
742
- </wp:postmeta>
743
- <wp:postmeta>
744
- <wp:meta_key>_lpr_quiz_questions</wp:meta_key>
745
- <wp:meta_value><![CDATA[a:4:{i:167;a:1:{s:6:"toggle";s:1:"1";}i:169;a:1:{s:6:"toggle";s:1:"1";}i:170;a:1:{s:6:"toggle";s:1:"1";}i:171;a:1:{s:6:"toggle";s:1:"1";}}]]></wp:meta_value>
746
- </wp:postmeta>
747
- <wp:postmeta>
748
- <wp:meta_key>_edit_last</wp:meta_key>
749
- <wp:meta_value><![CDATA[13]]></wp:meta_value>
750
- </wp:postmeta>
751
- <wp:postmeta>
752
- <wp:meta_key>_lpr_course</wp:meta_key>
753
- <wp:meta_value><![CDATA[133]]></wp:meta_value>
754
- </wp:postmeta>
755
- </item>
756
- <!-- END: Lessons and Quizzes -->
757
- <!-- START: Questions -->
758
-
759
- <item>
760
- <title>What is LearnPress?</title>
761
- <link>http://home.foobla.com/questions/what-is-learnpress/</link>
762
- <pubDate>Thu, 21 May 2015 09:34:03 +0000</pubDate>
763
- <dc:creator><![CDATA[ha]]></dc:creator>
764
- <guid isPermaLink="false">http://home.foobla.com/questions/what-is-learnpress/</guid>
765
  <description></description>
766
  <content:encoded><![CDATA[]]></content:encoded>
767
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
768
- <wp:post_id>167</wp:post_id>
769
- <wp:post_date>2015-05-21 16:34:03</wp:post_date>
770
- <wp:post_date_gmt>2015-05-21 09:34:03</wp:post_date_gmt>
771
  <wp:comment_status>open</wp:comment_status>
772
  <wp:ping_status>open</wp:ping_status>
773
- <wp:post_name>what-is-learnpress</wp:post_name>
774
  <wp:status>publish</wp:status>
775
  <wp:post_parent>0</wp:post_parent>
776
  <wp:menu_order>0</wp:menu_order>
777
- <wp:post_type>lpr_question</wp:post_type>
778
  <wp:post_password></wp:post_password>
779
- <wp:post_author_id>2</wp:post_author_id>
780
  <wp:is_sticky>0</wp:is_sticky>
781
 
782
- <wp:postmeta>
783
- <wp:meta_key>_lpr_question</wp:meta_key>
784
- <wp:meta_value><![CDATA[a:4:{s:4:"text";s:19:"What is LearnPress?";s:6:"answer";a:3:{i:0;a:2:{s:4:"text";s:25:"an Online Learning System";s:7:"is_true";s:1:"0";}i:1;a:2:{s:4:"text";s:17:"a WordPress theme";s:7:"is_true";s:1:"0";}i:2;a:2:{s:4:"text";s:73:"a WordPress Plugin for you to create an Online Learning Management System";s:7:"is_true";s:1:"1";}}s:4:"type";s:12:"multi_choice";s:6:"toggle";s:1:"1";}]]></wp:meta_value>
785
- </wp:postmeta>
786
- <wp:postmeta>
787
- <wp:meta_key>_lpr_question_mark</wp:meta_key>
788
- <wp:meta_value><![CDATA[1]]></wp:meta_value>
789
- </wp:postmeta>
790
- <wp:postmeta>
791
- <wp:meta_key>_lpr_duration</wp:meta_key>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
792
  <wp:meta_value><![CDATA[0]]></wp:meta_value>
793
- </wp:postmeta>
794
- </item>
795
-
796
- <item>
797
- <title>Who can use LearnPress?</title>
798
- <link>http://home.foobla.com/questions/who-can-use-learnpress-2/</link>
799
- <pubDate>Thu, 21 May 2015 09:36:05 +0000</pubDate>
800
- <dc:creator><![CDATA[ha]]></dc:creator>
801
- <guid isPermaLink="false">http://home.foobla.com/questions/who-can-use-learnpress-2/</guid>
 
 
 
 
 
 
 
 
 
 
802
  <description></description>
803
  <content:encoded><![CDATA[]]></content:encoded>
804
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
805
- <wp:post_id>169</wp:post_id>
806
- <wp:post_date>2015-05-21 16:36:05</wp:post_date>
807
- <wp:post_date_gmt>2015-05-21 09:36:05</wp:post_date_gmt>
808
  <wp:comment_status>open</wp:comment_status>
809
  <wp:ping_status>open</wp:ping_status>
810
- <wp:post_name>who-can-use-learnpress-2</wp:post_name>
811
  <wp:status>publish</wp:status>
812
  <wp:post_parent>0</wp:post_parent>
813
  <wp:menu_order>0</wp:menu_order>
814
- <wp:post_type>lpr_question</wp:post_type>
815
  <wp:post_password></wp:post_password>
816
- <wp:post_author_id>2</wp:post_author_id>
817
  <wp:is_sticky>0</wp:is_sticky>
818
 
819
- <wp:postmeta>
820
- <wp:meta_key>_lpr_question</wp:meta_key>
821
- <wp:meta_value><![CDATA[a:4:{s:4:"text";s:23:"Who can use LearnPress?";s:6:"answer";a:4:{i:0;a:2:{s:4:"text";s:37:"Online Learning System administrators";s:7:"is_true";s:1:"0";}i:1;a:2:{s:4:"text";s:20:"Teachers/Instructors";s:7:"is_true";s:1:"0";}i:2;a:2:{s:4:"text";s:8:"Students";s:7:"is_true";s:1:"0";}i:3;a:2:{s:4:"text";s:61:"Anyone who want to get benefit from an Online Learning System";s:7:"is_true";s:1:"1";}}s:4:"type";s:12:"multi_choice";s:6:"toggle";s:1:"1";}]]></wp:meta_value>
822
- </wp:postmeta>
823
- <wp:postmeta>
824
- <wp:meta_key>_lpr_question_mark</wp:meta_key>
825
- <wp:meta_value><![CDATA[1]]></wp:meta_value>
826
- </wp:postmeta>
827
- </item>
828
-
829
- <item>
830
- <title>Do you have to pay to use LearnPress?</title>
831
- <link>http://home.foobla.com/questions/do-you-have-to-pay-to-use-learnpress/</link>
832
- <pubDate>Thu, 21 May 2015 09:39:24 +0000</pubDate>
833
- <dc:creator><![CDATA[ha]]></dc:creator>
834
- <guid isPermaLink="false">http://home.foobla.com/questions/do-you-have-to-pay-to-use-learnpress/</guid>
835
  <description></description>
836
  <content:encoded><![CDATA[]]></content:encoded>
837
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
838
- <wp:post_id>170</wp:post_id>
839
- <wp:post_date>2015-05-21 16:39:24</wp:post_date>
840
- <wp:post_date_gmt>2015-05-21 09:39:24</wp:post_date_gmt>
841
  <wp:comment_status>open</wp:comment_status>
842
  <wp:ping_status>open</wp:ping_status>
843
- <wp:post_name>do-you-have-to-pay-to-use-learnpress</wp:post_name>
844
  <wp:status>publish</wp:status>
845
  <wp:post_parent>0</wp:post_parent>
846
  <wp:menu_order>0</wp:menu_order>
847
- <wp:post_type>lpr_question</wp:post_type>
848
  <wp:post_password></wp:post_password>
849
- <wp:post_author_id>2</wp:post_author_id>
850
  <wp:is_sticky>0</wp:is_sticky>
851
 
852
- <wp:postmeta>
853
- <wp:meta_key>_lpr_question</wp:meta_key>
854
- <wp:meta_value><![CDATA[a:4:{s:4:"text";s:37:"Do you have to pay to use LearnPress?";s:6:"answer";a:2:{i:0;a:2:{s:4:"text";s:15:"Yes, I have to.";s:7:"is_true";s:1:"1";}i:1;a:2:{s:4:"text";s:21:"No, I can use it free";s:7:"is_true";s:1:"0";}}s:4:"type";s:13:"single_choice";s:6:"toggle";s:1:"1";}]]></wp:meta_value>
855
- </wp:postmeta>
856
- <wp:postmeta>
857
- <wp:meta_key>_lpr_question_mark</wp:meta_key>
858
- <wp:meta_value><![CDATA[1]]></wp:meta_value>
859
- </wp:postmeta>
860
- </item>
861
-
862
- <item>
863
- <title>Can you contribute directly to LearnPress?</title>
864
- <link>http://home.foobla.com/questions/can-you-contribute-directly-to-learnpress/</link>
865
- <pubDate>Thu, 21 May 2015 09:40:09 +0000</pubDate>
866
- <dc:creator><![CDATA[ha]]></dc:creator>
867
- <guid isPermaLink="false">http://home.foobla.com/questions/can-you-contribute-directly-to-learnpress/</guid>
868
  <description></description>
869
  <content:encoded><![CDATA[]]></content:encoded>
870
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
871
- <wp:post_id>171</wp:post_id>
872
- <wp:post_date>2015-05-21 16:40:09</wp:post_date>
873
- <wp:post_date_gmt>2015-05-21 09:40:09</wp:post_date_gmt>
874
  <wp:comment_status>open</wp:comment_status>
875
  <wp:ping_status>open</wp:ping_status>
876
- <wp:post_name>can-you-contribute-directly-to-learnpress</wp:post_name>
877
  <wp:status>publish</wp:status>
878
  <wp:post_parent>0</wp:post_parent>
879
  <wp:menu_order>0</wp:menu_order>
880
- <wp:post_type>lpr_question</wp:post_type>
881
  <wp:post_password></wp:post_password>
882
- <wp:post_author_id>2</wp:post_author_id>
883
  <wp:is_sticky>0</wp:is_sticky>
884
-
885
- <wp:postmeta>
886
- <wp:meta_key>_lpr_question</wp:meta_key>
887
- <wp:meta_value><![CDATA[a:4:{s:4:"text";s:42:"Can you contribute directly to LearnPress?";s:6:"answer";a:2:{i:0;a:2:{s:4:"text";s:69:"Yes, LearnPress is an open source project, so I can contribute to it.";s:7:"is_true";s:1:"1";}i:1;a:2:{s:4:"text";s:45:"No, only the owner of LearnPress can do that.";s:7:"is_true";s:1:"0";}}s:4:"type";s:13:"single_choice";s:6:"toggle";s:1:"1";}]]></wp:meta_value>
888
- </wp:postmeta>
889
- <wp:postmeta>
890
- <wp:meta_key>_lpr_question_mark</wp:meta_key>
891
- <wp:meta_value><![CDATA[1]]></wp:meta_value>
892
- </wp:postmeta>
893
- </item>
894
-
895
- <item>
896
- <title>How many type of question LearnPress supports?</title>
897
- <link>http://home.foobla.com/questions/how-many-type-of-question-learnpress-supports/</link>
898
- <pubDate>Fri, 22 May 2015 02:50:27 +0000</pubDate>
899
- <dc:creator><![CDATA[ha]]></dc:creator>
900
- <guid isPermaLink="false">http://home.foobla.com/questions/how-many-type-of-question-learnpress-supports/</guid>
901
  <description></description>
902
  <content:encoded><![CDATA[]]></content:encoded>
903
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
904
- <wp:post_id>251</wp:post_id>
905
- <wp:post_date>2015-05-22 09:50:27</wp:post_date>
906
- <wp:post_date_gmt>2015-05-22 02:50:27</wp:post_date_gmt>
907
  <wp:comment_status>open</wp:comment_status>
908
  <wp:ping_status>open</wp:ping_status>
909
- <wp:post_name>how-many-type-of-question-learnpress-supports</wp:post_name>
910
  <wp:status>publish</wp:status>
911
  <wp:post_parent>0</wp:post_parent>
912
  <wp:menu_order>0</wp:menu_order>
913
- <wp:post_type>lpr_question</wp:post_type>
914
  <wp:post_password></wp:post_password>
915
- <wp:post_author_id>2</wp:post_author_id>
916
  <wp:is_sticky>0</wp:is_sticky>
917
-
918
- <wp:postmeta>
919
- <wp:meta_key>_lpr_question</wp:meta_key>
920
- <wp:meta_value><![CDATA[a:4:{s:4:"text";s:46:"How many type of question LearnPress supports?";s:6:"answer";a:3:{i:0;a:2:{s:4:"text";s:6:"1 type";s:7:"is_true";s:1:"0";}i:1;a:2:{s:4:"text";s:7:"2 types";s:7:"is_true";s:1:"0";}i:2;a:2:{s:4:"text";s:7:"3 types";s:7:"is_true";s:1:"1";}}s:4:"type";s:13:"single_choice";s:6:"toggle";s:1:"1";}]]></wp:meta_value>
921
- </wp:postmeta>
922
- <wp:postmeta>
923
- <wp:meta_key>_lpr_question_mark</wp:meta_key>
924
- <wp:meta_value><![CDATA[1]]></wp:meta_value>
925
- </wp:postmeta>
926
- <wp:postmeta>
927
- <wp:meta_key>_lpr_duration</wp:meta_key>
928
  <wp:meta_value><![CDATA[0]]></wp:meta_value>
929
- </wp:postmeta>
930
- </item>
931
-
932
- <item>
933
- <title>Can a teacher publish a course by himself?</title>
934
- <link>http://home.foobla.com/questions/can-a-teacher-publish-a-course-by-himself/</link>
935
- <pubDate>Fri, 22 May 2015 02:51:16 +0000</pubDate>
936
- <dc:creator><![CDATA[ha]]></dc:creator>
937
- <guid isPermaLink="false">http://home.foobla.com/questions/can-a-teacher-publish-a-course-by-himself/</guid>
 
 
 
 
 
 
 
 
 
 
938
  <description></description>
939
  <content:encoded><![CDATA[]]></content:encoded>
940
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
941
- <wp:post_id>252</wp:post_id>
942
- <wp:post_date>2015-05-22 09:51:16</wp:post_date>
943
- <wp:post_date_gmt>2015-05-22 02:51:16</wp:post_date_gmt>
944
  <wp:comment_status>open</wp:comment_status>
945
  <wp:ping_status>open</wp:ping_status>
946
- <wp:post_name>can-a-teacher-publish-a-course-by-himself</wp:post_name>
947
  <wp:status>publish</wp:status>
948
  <wp:post_parent>0</wp:post_parent>
949
  <wp:menu_order>0</wp:menu_order>
950
- <wp:post_type>lpr_question</wp:post_type>
951
  <wp:post_password></wp:post_password>
952
- <wp:post_author_id>2</wp:post_author_id>
953
  <wp:is_sticky>0</wp:is_sticky>
954
 
955
- <wp:postmeta>
956
- <wp:meta_key>_lpr_question</wp:meta_key>
957
- <wp:meta_value><![CDATA[a:4:{s:4:"text";s:42:"Can a teacher publish a course by himself?";s:6:"answer";a:2:{i:0;a:2:{s:4:"text";s:69:"Yes, he can publish a course immediately after creating it completely";s:7:"is_true";s:1:"0";}i:1;a:2:{s:4:"text";s:72:"No, he just can submit for review and the administrator will publish it.";s:7:"is_true";s:1:"1";}}s:4:"type";s:13:"single_choice";s:6:"toggle";s:1:"1";}]]></wp:meta_value>
958
- </wp:postmeta>
959
- <wp:postmeta>
960
- <wp:meta_key>_lpr_question_mark</wp:meta_key>
961
- <wp:meta_value><![CDATA[1]]></wp:meta_value>
962
- </wp:postmeta>
963
- <wp:postmeta>
964
- <wp:meta_key>_lpr_duration</wp:meta_key>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
965
  <wp:meta_value><![CDATA[10]]></wp:meta_value>
966
- </wp:postmeta>
967
- </item>
968
-
969
- <item>
970
- <title>Can a teacher set price for a his course?</title>
971
- <link>http://home.foobla.com/questions/can-a-teacher-set-price-for-a-his-course/</link>
972
- <pubDate>Fri, 22 May 2015 03:49:10 +0000</pubDate>
973
- <dc:creator><![CDATA[ha]]></dc:creator>
974
- <guid isPermaLink="false">http://home.foobla.com/questions/can-a-teacher-set-price-for-a-his-course/</guid>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
975
  <description></description>
976
  <content:encoded><![CDATA[]]></content:encoded>
977
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
978
- <wp:post_id>276</wp:post_id>
979
- <wp:post_date>2015-05-22 10:49:10</wp:post_date>
980
- <wp:post_date_gmt>2015-05-22 03:49:10</wp:post_date_gmt>
981
  <wp:comment_status>open</wp:comment_status>
982
  <wp:ping_status>open</wp:ping_status>
983
- <wp:post_name>can-a-teacher-set-price-for-a-his-course</wp:post_name>
984
  <wp:status>publish</wp:status>
985
  <wp:post_parent>0</wp:post_parent>
986
  <wp:menu_order>0</wp:menu_order>
987
- <wp:post_type>lpr_question</wp:post_type>
988
  <wp:post_password></wp:post_password>
989
- <wp:post_author_id>2</wp:post_author_id>
990
  <wp:is_sticky>0</wp:is_sticky>
991
-
992
- <wp:postmeta>
993
- <wp:meta_key>_lpr_question</wp:meta_key>
994
- <wp:meta_value><![CDATA[a:4:{s:4:"text";s:41:"Can a teacher set price for a his course?";s:6:"answer";a:2:{i:0;a:2:{s:4:"text";s:12:"Yes, he can.";s:7:"is_true";s:1:"0";}i:1;a:2:{s:4:"text";s:35:"No, only administrator can do that.";s:7:"is_true";s:1:"1";}}s:4:"type";s:13:"single_choice";s:6:"toggle";s:1:"1";}]]></wp:meta_value>
995
- </wp:postmeta>
996
- <wp:postmeta>
997
- <wp:meta_key>_lpr_question_mark</wp:meta_key>
998
- <wp:meta_value><![CDATA[1]]></wp:meta_value>
999
- </wp:postmeta>
1000
- </item>
1001
-
1002
- <item>
1003
- <title>How many ways are there a course can be assessed?</title>
1004
- <link>http://home.foobla.com/questions/how-many-ways-are-there-a-course-can-be-assessed/</link>
1005
- <pubDate>Fri, 22 May 2015 03:50:18 +0000</pubDate>
1006
- <dc:creator><![CDATA[ha]]></dc:creator>
1007
- <guid isPermaLink="false">http://home.foobla.com/questions/how-many-ways-are-there-a-course-can-be-assessed/</guid>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1008
  <description></description>
1009
  <content:encoded><![CDATA[]]></content:encoded>
1010
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
1011
- <wp:post_id>277</wp:post_id>
1012
- <wp:post_date>2015-05-22 10:50:18</wp:post_date>
1013
- <wp:post_date_gmt>2015-05-22 03:50:18</wp:post_date_gmt>
1014
  <wp:comment_status>open</wp:comment_status>
1015
  <wp:ping_status>open</wp:ping_status>
1016
- <wp:post_name>how-many-ways-are-there-a-course-can-be-assessed</wp:post_name>
1017
  <wp:status>publish</wp:status>
1018
  <wp:post_parent>0</wp:post_parent>
1019
  <wp:menu_order>0</wp:menu_order>
1020
- <wp:post_type>lpr_question</wp:post_type>
1021
  <wp:post_password></wp:post_password>
1022
- <wp:post_author_id>2</wp:post_author_id>
1023
  <wp:is_sticky>0</wp:is_sticky>
1024
-
1025
- <wp:postmeta>
1026
- <wp:meta_key>_lpr_question</wp:meta_key>
1027
- <wp:meta_value><![CDATA[a:4:{s:4:"text";s:49:"How many ways are there a course can be assessed?";s:6:"answer";a:3:{i:0;a:2:{s:4:"text";s:1:"1";s:7:"is_true";s:1:"0";}i:1;a:2:{s:4:"text";s:1:"2";s:7:"is_true";s:1:"1";}i:2;a:2:{s:4:"text";s:1:"3";s:7:"is_true";s:1:"0";}}s:4:"type";s:13:"single_choice";s:6:"toggle";s:1:"1";}]]></wp:meta_value>
1028
- </wp:postmeta>
1029
- <wp:postmeta>
1030
- <wp:meta_key>_lpr_question_mark</wp:meta_key>
1031
- <wp:meta_value><![CDATA[1]]></wp:meta_value>
1032
- </wp:postmeta>
1033
- </item>
1034
-
1035
- <item>
1036
- <title>Can you create a new add-on by yourself?</title>
1037
- <link>http://home.foobla.com/questions/can-you-create-a-new-add-on-by-yourself/</link>
1038
- <pubDate>Fri, 22 May 2015 07:06:00 +0000</pubDate>
1039
- <dc:creator><![CDATA[ha]]></dc:creator>
1040
- <guid isPermaLink="false">http://home.foobla.com/questions/can-you-create-a-new-add-on-by-yourself/</guid>
1041
  <description></description>
1042
  <content:encoded><![CDATA[]]></content:encoded>
1043
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
1044
- <wp:post_id>317</wp:post_id>
1045
- <wp:post_date>2015-05-22 14:06:00</wp:post_date>
1046
- <wp:post_date_gmt>2015-05-22 07:06:00</wp:post_date_gmt>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1047
  <wp:comment_status>open</wp:comment_status>
1048
  <wp:ping_status>open</wp:ping_status>
1049
- <wp:post_name>can-you-create-a-new-add-on-by-yourself</wp:post_name>
1050
  <wp:status>publish</wp:status>
1051
  <wp:post_parent>0</wp:post_parent>
1052
  <wp:menu_order>0</wp:menu_order>
1053
- <wp:post_type>lpr_question</wp:post_type>
1054
  <wp:post_password></wp:post_password>
1055
- <wp:post_author_id>2</wp:post_author_id>
1056
  <wp:is_sticky>0</wp:is_sticky>
1057
-
1058
- <wp:postmeta>
1059
- <wp:meta_key>_lpr_question</wp:meta_key>
1060
- <wp:meta_value><![CDATA[a:4:{s:4:"type";s:13:"single_choice";s:4:"text";s:40:"Can you create a new add-on by yourself?";s:6:"answer";a:2:{i:0;a:2:{s:4:"text";s:3:"Yes";s:7:"is_true";s:1:"0";}i:1;a:2:{s:4:"text";s:2:"No";s:7:"is_true";s:1:"0";}}s:6:"toggle";s:1:"1";}]]></wp:meta_value>
1061
- </wp:postmeta>
1062
- <wp:postmeta>
1063
- <wp:meta_key>_lpr_question_mark</wp:meta_key>
1064
- <wp:meta_value><![CDATA[1]]></wp:meta_value>
1065
- </wp:postmeta>
1066
- <wp:postmeta>
1067
- <wp:meta_key>_lpr_duration</wp:meta_key>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1068
  <wp:meta_value><![CDATA[10]]></wp:meta_value>
1069
- </wp:postmeta>
1070
- </item>
1071
- <!-- END: Questions -->
1072
- </channel>
 
1073
  </rss>
1
+
2
  <?xml version="1.0" encoding="UTF-8" ?>
3
  <rss version="2.0"
4
+ xmlns:excerpt="http://wordpress.org/export/LPR_EXPORT_VER/excerpt/"
5
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
6
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
7
  xmlns:dc="http://purl.org/dc/elements/1.1/"
8
+ xmlns:wp="http://wordpress.org/export/LPR_EXPORT_VER/"
9
  >
 
10
  <channel>
11
+ <title>DEV LearnPress 1.0</title>
12
+ <link>http://localhost/foobla/learnpress/1.0</link>
13
+ <description>Just another WordPress site</description>
14
+ <pubDate>Fri, 08 Jan 2016 07:01:22 +0000</pubDate>
15
  <language>en-US</language>
16
  <wp:wxr_version>1.0</wp:wxr_version>
17
+ <wp:base_site_url>http://localhost/foobla/learnpress/1.0</wp:base_site_url>
18
+ <wp:base_blog_url>http://localhost/foobla/learnpress/1.0</wp:base_blog_url>
19
+ <wp:plugin_name>learnpress</wp:plugin_name>
20
+ <wp:plugin_version>1.0</wp:plugin_version>
21
+ <wp:author><wp:author_id>1</wp:author_id><wp:author_login>admin</wp:author_login><wp:author_email>tunnhn@gmail.com</wp:author_email><wp:author_display_name><![CDATA[admin]]></wp:author_display_name><wp:author_first_name><![CDATA[]]></wp:author_first_name><wp:author_last_name><![CDATA[]]></wp:author_last_name></wp:author>
22
+ <wp:author><wp:author_id>4</wp:author_id><wp:author_login>instructor</wp:author_login><wp:author_email>tunn@foobla.com</wp:author_email><wp:author_display_name><![CDATA[In Structor]]></wp:author_display_name><wp:author_first_name><![CDATA[In]]></wp:author_first_name><wp:author_last_name><![CDATA[Structor]]></wp:author_last_name></wp:author>
23
+ <item>
24
+ <title>This is a new course</title>
25
+ <link>http://localhost/foobla/learnpress/1.0/dao-tao-cac-khoa-hoc-onine/this-is-a-new-course/</link>
26
+ <pubDate>Wed, 11 Nov 2015 10:45:53 +0000</pubDate>
27
+ <dc:creator><![CDATA[admin]]></dc:creator>
28
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/?post_type=lp_course&#038;p=873</guid>
 
 
 
 
29
  <description></description>
30
+ <content:encoded><![CDATA[]]></content:encoded>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
32
+ <wp:post_id>873</wp:post_id>
33
+ <wp:post_date>2015-11-11 10:45:53</wp:post_date>
34
+ <wp:post_date_gmt>2015-11-11 10:45:53</wp:post_date_gmt>
35
+ <wp:comment_status>open</wp:comment_status>
36
+ <wp:ping_status>open</wp:ping_status>
37
+ <wp:post_name>this-is-a-new-course</wp:post_name>
38
  <wp:status>publish</wp:status>
39
  <wp:post_parent>0</wp:post_parent>
40
  <wp:menu_order>0</wp:menu_order>
41
+ <wp:post_type>lp_course</wp:post_type>
42
  <wp:post_password></wp:post_password>
43
+ <wp:post_author_id>1</wp:post_author_id>
44
  <wp:is_sticky>0</wp:is_sticky>
45
+ <wp:postmeta>
 
46
  <wp:meta_key>_edit_lock</wp:meta_key>
47
+ <wp:meta_value><![CDATA[1451441611:1]]></wp:meta_value>
48
+ </wp:postmeta> <wp:postmeta>
 
49
  <wp:meta_key>_edit_last</wp:meta_key>
50
+ <wp:meta_value><![CDATA[1]]></wp:meta_value>
51
+ </wp:postmeta> <wp:postmeta>
52
+ <wp:meta_key>_lp_duration</wp:meta_key>
 
 
 
 
 
 
 
 
 
53
  <wp:meta_value><![CDATA[10]]></wp:meta_value>
54
+ </wp:postmeta> <wp:postmeta>
55
+ <wp:meta_key>_lp_max_students</wp:meta_key>
 
 
 
 
 
56
  <wp:meta_value><![CDATA[1000]]></wp:meta_value>
57
+ </wp:postmeta> <wp:postmeta>
58
+ <wp:meta_key>_lp_students</wp:meta_key>
59
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
60
+ </wp:postmeta> <wp:postmeta>
61
+ <wp:meta_key>_lp_retake_count</wp:meta_key>
62
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
63
+ </wp:postmeta> <wp:postmeta>
64
+ <wp:meta_key>_lp_passing_condition</wp:meta_key>
65
  <wp:meta_value><![CDATA[50]]></wp:meta_value>
66
+ </wp:postmeta> <wp:postmeta>
67
+ <wp:meta_key>_lp_enroll_requirement</wp:meta_key>
 
 
 
 
 
68
  <wp:meta_value><![CDATA[yes]]></wp:meta_value>
69
+ </wp:postmeta> <wp:postmeta>
70
+ <wp:meta_key>_lp_payment</wp:meta_key>
71
+ <wp:meta_value><![CDATA[free]]></wp:meta_value>
72
+ </wp:postmeta> <wp:postmeta>
73
+ <wp:meta_key>_lpr_course_lesson_quiz</wp:meta_key>
74
+ <wp:meta_value><![CDATA[]]></wp:meta_value>
75
+ </wp:postmeta> <wp:postmeta>
76
+ <wp:meta_key>_lp_course_status</wp:meta_key>
77
+ <wp:meta_value><![CDATA[publish]]></wp:meta_value>
78
+ </wp:postmeta> <wp:postmeta>
79
+ <wp:meta_key>_lp_curriculum</wp:meta_key>
80
+ <wp:meta_value><![CDATA[a:1:{i:0;a:3:{s:4:"name";s:10:"Section #1";s:11:"description";s:0:"";s:5:"items";a:2:{i:614;a:5:{s:4:"name";s:18:"word wide web 2222";s:8:"old_name";s:13:"word wide web";s:7:"item_id";s:4:"1232";s:15:"section_item_id";s:3:"614";s:9:"post_type";s:9:"lp_lesson";}s:6:"item-1";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}}]]></wp:meta_value>
81
+ </wp:postmeta>
82
+ <wp:section>
83
+ <wp:section_id>144</wp:section_id>
84
+ <wp:section_name>Section #1</wp:section_name>
85
+ <wp:section_course_id>873</wp:section_course_id>
86
+ <wp:section_order>1</wp:section_order>
87
+ <wp:section_description><![CDATA[]]></wp:section_description>
88
+ <!--SELECT si.*, p.post_type FROM wp_learnpress_section_items si INNER JOIN wp_posts p ON p.ID = si.item_id WHERE section_id = 144--> <wp:section_item>
89
+ <wp:section_id>144</wp:section_id>
90
+ <wp:item_id>1232</wp:item_id>
91
+ <wp:item_order>1</wp:item_order>
92
+ <wp:item_type>lp_lesson</wp:item_type>
93
+ </wp:section_item>
94
+ </wp:section>
95
+
96
+ </item><item>
97
+ <title>word wide web 2222</title>
98
+ <link>http://localhost/foobla/learnpress/1.0/lessons/wwwwwwwwwwwwwwwwwwww/</link>
99
+ <pubDate>Wed, 30 Dec 2015 02:06:58 +0000</pubDate>
100
+ <dc:creator><![CDATA[admin]]></dc:creator>
101
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/?post_type=lp_lesson&#038;p=1232</guid>
102
  <description></description>
103
+ <content:encoded><![CDATA[]]></content:encoded>
 
 
 
 
 
 
 
 
 
 
104
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
105
+ <wp:post_id>1232</wp:post_id>
106
+ <wp:post_date>2015-12-30 02:06:58</wp:post_date>
107
+ <wp:post_date_gmt>2015-12-30 02:06:58</wp:post_date_gmt>
108
  <wp:comment_status>closed</wp:comment_status>
109
  <wp:ping_status>closed</wp:ping_status>
110
+ <wp:post_name>wwwwwwwwwwwwwwwwwwww</wp:post_name>
111
  <wp:status>publish</wp:status>
112
  <wp:post_parent>0</wp:post_parent>
113
  <wp:menu_order>0</wp:menu_order>
114
+ <wp:post_type>lp_lesson</wp:post_type>
115
  <wp:post_password></wp:post_password>
116
+ <wp:post_author_id>1</wp:post_author_id>
117
  <wp:is_sticky>0</wp:is_sticky>
118
+ <wp:postmeta>
 
119
  <wp:meta_key>_edit_lock</wp:meta_key>
120
+ <wp:meta_value><![CDATA[1451443416:1]]></wp:meta_value>
121
+ </wp:postmeta>
122
+ </item> <item>
123
+ <title>What should be here?</title>
124
+ <link>http://localhost/foobla/learnpress/1.0/dao-tao-cac-khoa-hoc-onine/what-should-be-here/</link>
125
+ <pubDate>Fri, 04 Dec 2015 07:08:08 +0000</pubDate>
126
+ <dc:creator><![CDATA[instructor]]></dc:creator>
127
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/?post_type=lp_course&#038;p=908</guid>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
  <description></description>
129
+ <content:encoded><![CDATA[Phasellus accumsan cursus velit. Phasellus nec sem in justo pellentesque facilisis. Fusce vel dui. Integer tincidunt. Quisque id odio.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
 
131
+ Sed hendrerit. Morbi mattis ullamcorper velit. Phasellus dolor. Sed libero. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem.
132
 
133
+ Sed magna purus, fermentum eu, tincidunt eu, varius ut, felis. Phasellus tempus. Donec posuere vulputate arcu. Aenean posuere, tortor sed cursus feugiat, nunc augue blandit nunc, eu sollicitudin urna dolor sagittis lacus. Sed a libero.
134
 
135
+ Nam eget dui. Quisque ut nisi. Curabitur ligula sapien, tincidunt non, euismod vitae, posuere imperdiet, leo. Nunc nec neque. Pellentesque libero tortor, tincidunt et, tincidunt eget, semper nec, quam.
136
 
137
+ Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Vestibulum suscipit nulla quis orci. Fusce ac felis sit amet ligula pharetra condimentum. Vestibulum fringilla pede sit amet augue. Etiam rhoncus.]]></content:encoded>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
139
+ <wp:post_id>908</wp:post_id>
140
+ <wp:post_date>2015-12-04 07:08:08</wp:post_date>
141
+ <wp:post_date_gmt>2015-12-04 07:08:08</wp:post_date_gmt>
142
+ <wp:comment_status>open</wp:comment_status>
143
+ <wp:ping_status>open</wp:ping_status>
144
+ <wp:post_name>what-should-be-here</wp:post_name>
145
  <wp:status>publish</wp:status>
146
  <wp:post_parent>0</wp:post_parent>
147
  <wp:menu_order>0</wp:menu_order>
148
+ <wp:post_type>lp_course</wp:post_type>
149
  <wp:post_password></wp:post_password>
150
+ <wp:post_author_id>4</wp:post_author_id>
151
  <wp:is_sticky>0</wp:is_sticky>
152
+ <category domain="course_category" nicename="it" id="18" parent="0" description=" "><![CDATA[IT]]></category>
153
+ <category domain="course_category" nicename="software" id="19" parent="18" description=" "><![CDATA[Software]]></category>
154
+ <wp:postmeta>
155
  <wp:meta_key>_edit_lock</wp:meta_key>
156
+ <wp:meta_value><![CDATA[1452156731:1]]></wp:meta_value>
157
+ </wp:postmeta> <wp:postmeta>
 
158
  <wp:meta_key>_edit_last</wp:meta_key>
159
+ <wp:meta_value><![CDATA[1]]></wp:meta_value>
160
+ </wp:postmeta> <wp:postmeta>
161
+ <wp:meta_key>_admin_hidden_sections</wp:meta_key>
162
+ <wp:meta_value><![CDATA[a:5:{i:0;s:3:"132";i:1;s:3:"133";i:2;s:3:"134";i:3;s:3:"135";i:4;s:0:"";}]]></wp:meta_value>
163
+ </wp:postmeta> <wp:postmeta>
164
+ <wp:meta_key>_lpr_course_lesson_quiz</wp:meta_key>
165
+ <wp:meta_value><![CDATA[]]></wp:meta_value>
166
+ </wp:postmeta> <wp:postmeta>
167
+ <wp:meta_key>_lp_curriculum</wp:meta_key>
168
+ <wp:meta_value><![CDATA[a:6:{i:0;a:3:{s:4:"name";s:10:"Section #1";s:11:"description";s:33:"asd asd asdasd asdasd asdasd asda";s:5:"items";a:15:{i:615;a:5:{s:4:"name";s:12:"333333333333";s:8:"old_name";s:12:"333333333333";s:7:"item_id";s:4:"1146";s:15:"section_item_id";s:3:"615";s:9:"post_type";s:7:"lp_quiz";}i:616;a:5:{s:4:"name";s:18:"where are you now?";s:8:"old_name";s:18:"where are you now?";s:7:"item_id";s:4:"1148";s:15:"section_item_id";s:3:"616";s:9:"post_type";s:9:"lp_lesson";}i:617;a:5:{s:4:"name";s:21:"I am here, beside you";s:8:"old_name";s:21:"I am here, beside you";s:7:"item_id";s:4:"1149";s:15:"section_item_id";s:3:"617";s:9:"post_type";s:7:"lp_quiz";}i:618;a:5:{s:4:"name";s:9:"asdasdasd";s:8:"old_name";s:9:"asdasdasd";s:7:"item_id";s:4:"1143";s:15:"section_item_id";s:3:"618";s:9:"post_type";s:9:"lp_lesson";}i:619;a:5:{s:4:"name";s:9:"dsfsdfsdf";s:8:"old_name";s:9:"dsfsdfsdf";s:7:"item_id";s:4:"1144";s:15:"section_item_id";s:3:"619";s:9:"post_type";s:9:"lp_lesson";}i:620;a:5:{s:4:"name";s:8:"Lesson 1";s:8:"old_name";s:8:"Lesson 1";s:7:"item_id";s:4:"1139";s:15:"section_item_id";s:3:"620";s:9:"post_type";s:9:"lp_lesson";}i:621;a:5:{s:4:"name";s:8:"Lesson 2";s:8:"old_name";s:8:"Lesson 2";s:7:"item_id";s:4:"1140";s:15:"section_item_id";s:3:"621";s:9:"post_type";s:9:"lp_lesson";}i:622;a:5:{s:4:"name";s:8:"Lesson 3";s:8:"old_name";s:8:"Lesson 3";s:7:"item_id";s:4:"1142";s:15:"section_item_id";s:3:"622";s:9:"post_type";s:9:"lp_lesson";}i:623;a:5:{s:4:"name";s:17:"qqqqqqqqqqqqqqqqq";s:8:"old_name";s:17:"qqqqqqqqqqqqqqqqq";s:7:"item_id";s:4:"1153";s:15:"section_item_id";s:3:"623";s:9:"post_type";s:9:"lp_lesson";}i:624;a:5:{s:4:"name";s:10:"trau va bo";s:8:"old_name";s:10:"trau va bo";s:7:"item_id";s:4:"1154";s:15:"section_item_id";s:3:"624";s:9:"post_type";s:9:"lp_lesson";}i:625;a:5:{s:4:"name";s:19:"adasdasdasda asd as";s:8:"old_name";s:19:"adasdasdasda asd as";s:7:"item_id";s:4:"1164";s:15:"section_item_id";s:3:"625";s:9:"post_type";s:9:"lp_lesson";}i:626;a:5:{s:4:"name";s:19:"asd asda sdasdas da";s:8:"old_name";s:19:"asd asda sdasdas da";s:7:"item_id";s:4:"1165";s:15:"section_item_id";s:3:"626";s:9:"post_type";s:9:"lp_lesson";}i:627;a:5:{s:4:"name";s:16:"asdasdasdasdasda";s:8:"old_name";s:16:"asdasdasdasdasda";s:7:"item_id";s:4:"1166";s:15:"section_item_id";s:3:"627";s:9:"post_type";s:9:"lp_lesson";}i:628;a:5:{s:4:"name";s:18:"assasdasdasdasdasd";s:8:"old_name";s:18:"assasdasdasdasdasd";s:7:"item_id";s:4:"1167";s:15:"section_item_id";s:3:"628";s:9:"post_type";s:9:"lp_lesson";}s:7:"item-14";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}i:1;a:3:{s:4:"name";s:10:"Section #2";s:11:"description";s:49:"asdas das d asdas das asdasd asdas dasdas dasdasd";s:5:"items";a:5:{i:629;a:5:{s:4:"name";s:22:"How to create a course";s:8:"old_name";s:22:"How to create a course";s:7:"item_id";s:4:"1169";s:15:"section_item_id";s:3:"629";s:9:"post_type";s:9:"lp_lesson";}i:630;a:5:{s:4:"name";s:17:"What is your name";s:8:"old_name";s:17:"What is your name";s:7:"item_id";s:4:"1170";s:15:"section_item_id";s:3:"630";s:9:"post_type";s:9:"lp_lesson";}i:631;a:5:{s:4:"name";s:20:"My name is Tu Nguyen";s:8:"old_name";s:20:"My name is Tu Nguyen";s:7:"item_id";s:4:"1171";s:15:"section_item_id";s:3:"631";s:9:"post_type";s:9:"lp_lesson";}i:632;a:5:{s:4:"name";s:23:"sdfsdfsdf sdf sdf sdf s";s:8:"old_name";s:23:"sdfsdfsdf sdf sdf sdf s";s:7:"item_id";s:4:"1168";s:15:"section_item_id";s:3:"632";s:9:"post_type";s:7:"lp_quiz";}s:6:"item-4";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}i:2;a:3:{s:4:"name";s:10:"Section #3";s:11:"description";s:0:"";s:5:"items";a:2:{i:633;a:5:{s:4:"name";s:14:"sdfsd fsd fsdf";s:8:"old_name";s:14:"sdfsd fsd fsdf";s:7:"item_id";s:4:"1172";s:15:"section_item_id";s:3:"633";s:9:"post_type";s:7:"lp_quiz";}s:6:"item-1";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}i:3;a:3:{s:4:"name";s:10:"Section #4";s:11:"description";s:0:"";s:5:"items";a:2:{i:634;a:5:{s:4:"name";s:22:"sdf sdfsd fsdf sdfsd f";s:8:"old_name";s:22:"sdf sdfsd fsdf sdfsd f";s:7:"item_id";s:4:"1173";s:15:"section_item_id";s:3:"634";s:9:"post_type";s:7:"lp_quiz";}s:6:"item-1";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}i:4;a:3:{s:4:"name";s:10:"Section #5";s:11:"description";s:0:"";s:5:"items";a:6:{i:635;a:5:{s:4:"name";s:15:"happy new year!";s:8:"old_name";s:15:"happy new year!";s:7:"item_id";s:4:"1228";s:15:"section_item_id";s:3:"635";s:9:"post_type";s:9:"lp_lesson";}i:636;a:5:{s:4:"name";s:15:"happy new year!";s:8:"old_name";s:15:"happy new year!";s:7:"item_id";s:4:"1229";s:15:"section_item_id";s:3:"636";s:9:"post_type";s:9:"lp_lesson";}i:637;a:5:{s:4:"name";s:8:"Lesson 1";s:8:"old_name";s:8:"Lesson 1";s:7:"item_id";s:4:"1136";s:15:"section_item_id";s:3:"637";s:9:"post_type";s:9:"lp_lesson";}i:638;a:5:{s:4:"name";s:8:"Lesson 2";s:8:"old_name";s:8:"Lesson 2";s:7:"item_id";s:4:"1137";s:15:"section_item_id";s:3:"638";s:9:"post_type";s:9:"lp_lesson";}i:639;a:5:{s:4:"name";s:18:"oi troi oi la troi";s:8:"old_name";s:18:"oi troi oi la troi";s:7:"item_id";s:4:"1230";s:15:"section_item_id";s:3:"639";s:9:"post_type";s:9:"lp_lesson";}s:6:"item-5";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}i:5;a:3:{s:4:"name";s:10:"Section #6";s:11:"description";s:0:"";s:5:"items";a:4:{i:640;a:5:{s:4:"name";s:12:"333333333333";s:8:"old_name";s:12:"333333333333";s:7:"item_id";s:4:"1145";s:15:"section_item_id";s:3:"640";s:9:"post_type";s:9:"lp_lesson";}i:641;a:5:{s:4:"name";s:8:"44444444";s:8:"old_name";s:8:"44444444";s:7:"item_id";s:4:"1227";s:15:"section_item_id";s:3:"641";s:9:"post_type";s:9:"lp_lesson";}i:642;a:5:{s:4:"name";s:6:"cookie";s:8:"old_name";s:6:"cookie";s:7:"item_id";s:4:"1231";s:15:"section_item_id";s:3:"642";s:9:"post_type";s:9:"lp_lesson";}s:6:"item-3";a:5:{s:4:"name";s:0:"";s:8:"old_name";s:0:"";s:7:"item_id";s:0:"";s:15:"section_item_id";s:0:"";s:9:"post_type";s:9:"lp_lesson";}}}}]]></wp:meta_value>
169
+ </wp:postmeta> <wp:postmeta>
170
+ <wp:meta_key>_lp_duration</wp:meta_key>
171
  <wp:meta_value><![CDATA[10]]></wp:meta_value>
172
+ </wp:postmeta> <wp:postmeta>
173
+ <wp:meta_key>_lp_max_students</wp:meta_key>
174
+ <wp:meta_value><![CDATA[1000]]></wp:meta_value>
175
+ </wp:postmeta> <wp:postmeta>
176
+ <wp:meta_key>_lp_students</wp:meta_key>
177
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
178
+ </wp:postmeta> <wp:postmeta>
179
+ <wp:meta_key>_lp_retake_count</wp:meta_key>
180
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
181
+ </wp:postmeta> <wp:postmeta>
182
+ <wp:meta_key>_lp_passing_condition</wp:meta_key>
183
+ <wp:meta_value><![CDATA[50]]></wp:meta_value>
184
+ </wp:postmeta> <wp:postmeta>
185
+ <wp:meta_key>_lp_enroll_requirement</wp:meta_key>
186
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
187
+ </wp:postmeta> <wp:postmeta>
188
+ <wp:meta_key>_lp_payment</wp:meta_key>
189
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
190
+ </wp:postmeta> <wp:postmeta>
191
+ <wp:meta_key>_lp_course_status</wp:meta_key>
192
+ <wp:meta_value><![CDATA[publish]]></wp:meta_value>
193
+ </wp:postmeta> <wp:postmeta>
194
+ <wp:meta_key>_lp_course_result</wp:meta_key>
195
+ <wp:meta_value><![CDATA[evaluate_lesson]]></wp:meta_value>
196
+ </wp:postmeta> <wp:postmeta>
197
+ <wp:meta_key>_lp_required_enroll</wp:meta_key>
198
+ <wp:meta_value><![CDATA[yes]]></wp:meta_value>
199
+ </wp:postmeta>
200
+ <wp:section>
201
+ <wp:section_id>145</wp:section_id>
202
+ <wp:section_name>Section #1</wp:section_name>
203
+ <wp:section_course_id>908</wp:section_course_id>
204
+ <wp:section_order>1</wp:section_order>
205
+ <wp:section_description><![CDATA[asd asd asdasd asdasd asdasd asda]]></wp:section_description>
206
+ <!--SELECT si.*, p.post_type FROM wp_learnpress_section_items si INNER JOIN wp_posts p ON p.ID = si.item_id WHERE section_id = 145--> <wp:section_item>
207
+ <wp:section_id>145</wp:section_id>
208
+ <wp:item_id>1146</wp:item_id>
209
+ <wp:item_order>1</wp:item_order>
210
+ <wp:item_type>lp_quiz</wp:item_type>
211
+ </wp:section_item>
212
+ <wp:section_item>
213
+ <wp:section_id>145</wp:section_id>
214
+ <wp:item_id>1148</wp:item_id>
215
+ <wp:item_order>2</wp:item_order>
216
+ <wp:item_type>lp_lesson</wp:item_type>
217
+ </wp:section_item>
218
+ <wp:section_item>
219
+ <wp:section_id>145</wp:section_id>
220
+ <wp:item_id>1149</wp:item_id>
221
+ <wp:item_order>3</wp:item_order>
222
+ <wp:item_type>lp_quiz</wp:item_type>
223
+ </wp:section_item>
224
+ <wp:section_item>
225
+ <wp:section_id>145</wp:section_id>
226
+ <wp:item_id>1143</wp:item_id>
227
+ <wp:item_order>4</wp:item_order>
228
+ <wp:item_type>lp_lesson</wp:item_type>
229
+ </wp:section_item>
230
+ <wp:section_item>
231
+ <wp:section_id>145</wp:section_id>
232
+ <wp:item_id>1144</wp:item_id>
233
+ <wp:item_order>5</wp:item_order>
234
+ <wp:item_type>lp_lesson</wp:item_type>
235
+ </wp:section_item>
236
+ <wp:section_item>
237
+ <wp:section_id>145</wp:section_id>
238
+ <wp:item_id>1139</wp:item_id>
239
+ <wp:item_order>6</wp:item_order>
240
+ <wp:item_type>lp_lesson</wp:item_type>
241
+ </wp:section_item>
242
+ <wp:section_item>
243
+ <wp:section_id>145</wp:section_id>
244
+ <wp:item_id>1140</wp:item_id>
245
+ <wp:item_order>7</wp:item_order>
246
+ <wp:item_type>lp_lesson</wp:item_type>
247
+ </wp:section_item>
248
+ <wp:section_item>
249
+ <wp:section_id>145</wp:section_id>
250
+ <wp:item_id>1142</wp:item_id>
251
+ <wp:item_order>8</wp:item_order>
252
+ <wp:item_type>lp_lesson</wp:item_type>
253
+ </wp:section_item>
254
+ <wp:section_item>
255
+ <wp:section_id>145</wp:section_id>
256
+ <wp:item_id>1153</wp:item_id>
257
+ <wp:item_order>9</wp:item_order>
258
+ <wp:item_type>lp_lesson</wp:item_type>
259
+ </wp:section_item>
260
+ <wp:section_item>
261
+ <wp:section_id>145</wp:section_id>
262
+ <wp:item_id>1154</wp:item_id>
263
+ <wp:item_order>10</wp:item_order>
264
+ <wp:item_type>lp_lesson</wp:item_type>
265
+ </wp:section_item>
266
+ <wp:section_item>
267
+ <wp:section_id>145</wp:section_id>
268
+ <wp:item_id>1164</wp:item_id>
269
+ <wp:item_order>11</wp:item_order>
270
+ <wp:item_type>lp_lesson</wp:item_type>
271
+ </wp:section_item>
272
+ <wp:section_item>
273
+ <wp:section_id>145</wp:section_id>
274
+ <wp:item_id>1165</wp:item_id>
275
+ <wp:item_order>12</wp:item_order>
276
+ <wp:item_type>lp_lesson</wp:item_type>
277
+ </wp:section_item>
278
+ <wp:section_item>
279
+ <wp:section_id>145</wp:section_id>
280
+ <wp:item_id>1166</wp:item_id>
281
+ <wp:item_order>13</wp:item_order>
282
+ <wp:item_type>lp_lesson</wp:item_type>
283
+ </wp:section_item>
284
+ <wp:section_item>
285
+ <wp:section_id>145</wp:section_id>
286
+ <wp:item_id>1167</wp:item_id>
287
+ <wp:item_order>14</wp:item_order>
288
+ <wp:item_type>lp_lesson</wp:item_type>
289
+ </wp:section_item>
290
+ </wp:section>
291
+
292
+ <wp:section>
293
+ <wp:section_id>146</wp:section_id>
294
+ <wp:section_name>Section #2</wp:section_name>
295
+ <wp:section_course_id>908</wp:section_course_id>
296
+ <wp:section_order>2</wp:section_order>
297
+ <wp:section_description><![CDATA[asdas das d asdas das asdasd asdas dasdas dasdasd]]></wp:section_description>
298
+ <!--SELECT si.*, p.post_type FROM wp_learnpress_section_items si INNER JOIN wp_posts p ON p.ID = si.item_id WHERE section_id = 146--> <wp:section_item>
299
+ <wp:section_id>146</wp:section_id>
300
+ <wp:item_id>1169</wp:item_id>
301
+ <wp:item_order>1</wp:item_order>
302
+ <wp:item_type>lp_lesson</wp:item_type>
303
+ </wp:section_item>
304
+ <wp:section_item>
305
+ <wp:section_id>146</wp:section_id>
306
+ <wp:item_id>1170</wp:item_id>
307
+ <wp:item_order>2</wp:item_order>
308
+ <wp:item_type>lp_lesson</wp:item_type>
309
+ </wp:section_item>
310
+ <wp:section_item>
311
+ <wp:section_id>146</wp:section_id>
312
+ <wp:item_id>1171</wp:item_id>
313
+ <wp:item_order>3</wp:item_order>
314
+ <wp:item_type>lp_lesson</wp:item_type>
315
+ </wp:section_item>
316
+ <wp:section_item>
317
+ <wp:section_id>146</wp:section_id>
318
+ <wp:item_id>1168</wp:item_id>
319
+ <wp:item_order>4</wp:item_order>
320
+ <wp:item_type>lp_quiz</wp:item_type>
321
+ </wp:section_item>
322
+ </wp:section>
323
+
324
+ <wp:section>
325
+ <wp:section_id>147</wp:section_id>
326
+ <wp:section_name>Section #3</wp:section_name>
327
+ <wp:section_course_id>908</wp:section_course_id>
328
+ <wp:section_order>3</wp:section_order>
329
+ <wp:section_description><![CDATA[]]></wp:section_description>
330
+ <!--SELECT si.*, p.post_type FROM wp_learnpress_section_items si INNER JOIN wp_posts p ON p.ID = si.item_id WHERE section_id = 147--> <wp:section_item>
331
+ <wp:section_id>147</wp:section_id>
332
+ <wp:item_id>1172</wp:item_id>
333
+ <wp:item_order>1</wp:item_order>
334
+ <wp:item_type>lp_quiz</wp:item_type>
335
+ </wp:section_item>
336
+ </wp:section>
337
+
338
+ <wp:section>
339
+ <wp:section_id>148</wp:section_id>
340
+ <wp:section_name>Section #4</wp:section_name>
341
+ <wp:section_course_id>908</wp:section_course_id>
342
+ <wp:section_order>4</wp:section_order>
343
+ <wp:section_description><![CDATA[]]></wp:section_description>
344
+ <!--SELECT si.*, p.post_type FROM wp_learnpress_section_items si INNER JOIN wp_posts p ON p.ID = si.item_id WHERE section_id = 148--> <wp:section_item>
345
+ <wp:section_id>148</wp:section_id>
346
+ <wp:item_id>1173</wp:item_id>
347
+ <wp:item_order>1</wp:item_order>
348
+ <wp:item_type>lp_quiz</wp:item_type>
349
+ </wp:section_item>
350
+ </wp:section>
351
+
352
+ <wp:section>
353
+ <wp:section_id>149</wp:section_id>
354
+ <wp:section_name>Section #5</wp:section_name>
355
+ <wp:section_course_id>908</wp:section_course_id>
356
+ <wp:section_order>5</wp:section_order>
357
+ <wp:section_description><![CDATA[]]></wp:section_description>
358
+ <!--SELECT si.*, p.post_type FROM wp_learnpress_section_items si INNER JOIN wp_posts p ON p.ID = si.item_id WHERE section_id = 149--> <wp:section_item>
359
+ <wp:section_id>149</wp:section_id>
360
+ <wp:item_id>1228</wp:item_id>
361
+ <wp:item_order>1</wp:item_order>
362
+ <wp:item_type>lp_lesson</wp:item_type>
363
+ </wp:section_item>
364
+ <wp:section_item>
365
+ <wp:section_id>149</wp:section_id>
366
+ <wp:item_id>1229</wp:item_id>
367
+ <wp:item_order>2</wp:item_order>
368
+ <wp:item_type>lp_lesson</wp:item_type>
369
+ </wp:section_item>
370
+ <wp:section_item>
371
+ <wp:section_id>149</wp:section_id>
372
+ <wp:item_id>1136</wp:item_id>
373
+ <wp:item_order>3</wp:item_order>
374
+ <wp:item_type>lp_lesson</wp:item_type>
375
+ </wp:section_item>
376
+ <wp:section_item>
377
+ <wp:section_id>149</wp:section_id>
378
+ <wp:item_id>1137</wp:item_id>
379
+ <wp:item_order>4</wp:item_order>
380
+ <wp:item_type>lp_lesson</wp:item_type>
381
+ </wp:section_item>
382
+ <wp:section_item>
383
+ <wp:section_id>149</wp:section_id>
384
+ <wp:item_id>1230</wp:item_id>
385
+ <wp:item_order>5</wp:item_order>
386
+ <wp:item_type>lp_lesson</wp:item_type>
387
+ </wp:section_item>
388
+ </wp:section>
389
+
390
+ <wp:section>
391
+ <wp:section_id>150</wp:section_id>
392
+ <wp:section_name>Section #6</wp:section_name>
393
+ <wp:section_course_id>908</wp:section_course_id>
394
+ <wp:section_order>6</wp:section_order>
395
+ <wp:section_description><![CDATA[]]></wp:section_description>
396
+ <!--SELECT si.*, p.post_type FROM wp_learnpress_section_items si INNER JOIN wp_posts p ON p.ID = si.item_id WHERE section_id = 150--> <wp:section_item>
397
+ <wp:section_id>150</wp:section_id>
398
+ <wp:item_id>1145</wp:item_id>
399
+ <wp:item_order>1</wp:item_order>
400
+ <wp:item_type>lp_lesson</wp:item_type>
401
+ </wp:section_item>
402
+ <wp:section_item>
403
+ <wp:section_id>150</wp:section_id>
404
+ <wp:item_id>1227</wp:item_id>
405
+ <wp:item_order>2</wp:item_order>
406
+ <wp:item_type>lp_lesson</wp:item_type>
407
+ </wp:section_item>
408
+ <wp:section_item>
409
+ <wp:section_id>150</wp:section_id>
410
+ <wp:item_id>1231</wp:item_id>
411
+ <wp:item_order>3</wp:item_order>
412
+ <wp:item_type>lp_lesson</wp:item_type>
413
+ </wp:section_item>
414
+ </wp:section>
415
+
416
+ <wp:comment>
417
+ <wp:comment_id>89</wp:comment_id>
418
+ <wp:comment_author><![CDATA[admin]]></wp:comment_author>
419
+ <wp:comment_author_email>tunnhn@gmail.com</wp:comment_author_email>
420
+ <wp:comment_author_url></wp:comment_author_url>
421
+ <wp:comment_author_IP>::1</wp:comment_author_IP>
422
+ <wp:comment_date>2016-01-07 03:50:26</wp:comment_date>
423
+ <wp:comment_date_gmt>2016-01-07 03:50:26</wp:comment_date_gmt>
424
+ <wp:comment_content><![CDATA[How create a course with LearnPress]]></wp:comment_content>
425
+ <wp:comment_approved>1</wp:comment_approved>
426
+ <wp:comment_type></wp:comment_type>
427
+ <wp:comment_parent>0</wp:comment_parent>
428
+ <wp:comment_user_id>1</wp:comment_user_id>
429
+ </wp:comment>
430
+ <wp:comment>
431
+ <wp:comment_id>90</wp:comment_id>
432
+ <wp:comment_author><![CDATA[admin]]></wp:comment_author>
433
+ <wp:comment_author_email>tunnhn@gmail.com</wp:comment_author_email>
434
+ <wp:comment_author_url></wp:comment_author_url>
435
+ <wp:comment_author_IP>::1</wp:comment_author_IP>
436
+ <wp:comment_date>2016-01-07 03:50:56</wp:comment_date>
437
+ <wp:comment_date_gmt>2016-01-07 03:50:56</wp:comment_date_gmt>
438
+ <wp:comment_content><![CDATA[Nam quam nunc blandit]]></wp:comment_content>
439
+ <wp:comment_approved>1</wp:comment_approved>
440
+ <wp:comment_type></wp:comment_type>
441
+ <wp:comment_parent>89</wp:comment_parent>
442
+ <wp:comment_user_id>1</wp:comment_user_id>
443
+ </wp:comment>
444
+ </item><item>
445
+ <title>333333333333</title>
446
+ <link>http://localhost/foobla/learnpress/1.0/quizzes/333333333333-2/</link>
447
+ <pubDate>Tue, 08 Dec 2015 04:19:22 +0000</pubDate>
448
+ <dc:creator><![CDATA[admin]]></dc:creator>
449
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/quizzes/333333333333-2/</guid>
450
  <description></description>
451
+ <content:encoded><![CDATA[]]></content:encoded>
 
 
 
 
 
 
 
 
 
 
 
 
452
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
453
+ <wp:post_id>1146</wp:post_id>
454
+ <wp:post_date>2015-12-08 04:19:22</wp:post_date>
455
+ <wp:post_date_gmt>2015-12-08 04:19:22</wp:post_date_gmt>
456
+ <wp:comment_status>open</wp:comment_status>
457
+ <wp:ping_status>open</wp:ping_status>
458
+ <wp:post_name>333333333333-2</wp:post_name>
459
  <wp:status>publish</wp:status>
460
  <wp:post_parent>0</wp:post_parent>
461
  <wp:menu_order>0</wp:menu_order>
462
+ <wp:post_type>lp_quiz</wp:post_type>
463
  <wp:post_password></wp:post_password>
464
+ <wp:post_author_id>1</wp:post_author_id>
465
  <wp:is_sticky>0</wp:is_sticky>
466
+ <wp:postmeta>
 
467
  <wp:meta_key>_edit_lock</wp:meta_key>
468
+ <wp:meta_value><![CDATA[1451469598:1]]></wp:meta_value>
469
+ </wp:postmeta> <wp:postmeta>
 
470
  <wp:meta_key>_edit_last</wp:meta_key>
471
+ <wp:meta_value><![CDATA[1]]></wp:meta_value>
472
+ </wp:postmeta> <wp:postmeta>
473
+ <wp:meta_key>_lp_duration</wp:meta_key>
474
+ <wp:meta_value><![CDATA[10]]></wp:meta_value>
475
+ </wp:postmeta> <wp:postmeta>
476
+ <wp:meta_key>_lp_show_result</wp:meta_key>
477
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
478
+ </wp:postmeta> <wp:postmeta>
479
+ <wp:meta_key>_lp_show_question_answer</wp:meta_key>
480
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
481
+ </wp:postmeta> <wp:postmeta>
482
+ <wp:meta_key>_lp_type</wp:meta_key>
483
+ <wp:meta_value><![CDATA[true_or_false]]></wp:meta_value>
484
+ </wp:postmeta>
485
+ </item><item>
486
+ <title>where are you now?</title>
487
+ <link>http://localhost/foobla/learnpress/1.0/lessons/where-are-you-now/</link>
488
+ <pubDate>Tue, 08 Dec 2015 08:20:59 +0000</pubDate>
489
+ <dc:creator><![CDATA[admin]]></dc:creator>
490
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/where-are-you-now/</guid>
 
 
491
  <description></description>
492
+ <content:encoded><![CDATA[Nulla porta dolor. Ut varius tincidunt libero. Sed augue ipsum, egestas nec, vestibulum et, malesuada adipiscing, dui. Fusce egestas elit eget lorem. Vivamus aliquet elit ac nisl.
493
 
494
+ Cras ultricies mi eu turpis hendrerit fringilla. Quisque id mi. Fusce ac felis sit amet ligula pharetra condimentum. Maecenas malesuada. Praesent nec nisl a purus blandit viverra.
495
 
496
+ In auctor lobortis lacus. Phasellus leo dolor, tempus non, auctor et, hendrerit quis, nisi. Nam adipiscing. Pellentesque libero tortor, tincidunt et, tincidunt eget, semper nec, quam. Nam commodo suscipit quam.
497
 
498
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nullam accumsan lorem in dui. Cras varius. Nunc egestas, augue at pellentesque laoreet, felis eros vehicula leo, at malesuada velit leo quis pede. Suspendisse non nisl sit amet velit hendrerit rutrum.
499
 
500
+ Morbi ac felis. Etiam rhoncus. Praesent ac massa at ligula laoreet iaculis. Nunc nulla. In turpis.]]></content:encoded>
501
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
502
+ <wp:post_id>1148</wp:post_id>
503
+ <wp:post_date>2015-12-08 08:20:59</wp:post_date>
504
+ <wp:post_date_gmt>2015-12-08 08:20:59</wp:post_date_gmt>
505
  <wp:comment_status>closed</wp:comment_status>
506
  <wp:ping_status>closed</wp:ping_status>
507
+ <wp:post_name>where-are-you-now</wp:post_name>
508
  <wp:status>publish</wp:status>
509
  <wp:post_parent>0</wp:post_parent>
510
  <wp:menu_order>0</wp:menu_order>
511
+ <wp:post_type>lp_lesson</wp:post_type>
512
  <wp:post_password></wp:post_password>
513
+ <wp:post_author_id>1</wp:post_author_id>
514
  <wp:is_sticky>0</wp:is_sticky>
515
+ <wp:postmeta>
516
+ <wp:meta_key>_lpr_course</wp:meta_key>
517
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
518
+ </wp:postmeta> <wp:postmeta>
519
+ <wp:meta_key>_lp_duration</wp:meta_key>
520
+ <wp:meta_value><![CDATA[10]]></wp:meta_value>
521
+ </wp:postmeta> <wp:postmeta>
522
+ <wp:meta_key>_lp_max_students</wp:meta_key>
523
+ <wp:meta_value><![CDATA[1000]]></wp:meta_value>
524
+ </wp:postmeta> <wp:postmeta>
525
+ <wp:meta_key>_lp_students</wp:meta_key>
526
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
527
+ </wp:postmeta> <wp:postmeta>
528
+ <wp:meta_key>_lp_retake_count</wp:meta_key>
529
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
530
+ </wp:postmeta> <wp:postmeta>
531
+ <wp:meta_key>_lp_passing_condition</wp:meta_key>
532
+ <wp:meta_value><![CDATA[50]]></wp:meta_value>
533
+ </wp:postmeta> <wp:postmeta>
534
+ <wp:meta_key>_lp_enroll_requirement</wp:meta_key>
535
+ <wp:meta_value><![CDATA[yes]]></wp:meta_value>
536
+ </wp:postmeta> <wp:postmeta>
537
+ <wp:meta_key>_lp_payment</wp:meta_key>
538
+ <wp:meta_value><![CDATA[free]]></wp:meta_value>
539
+ </wp:postmeta> <wp:postmeta>
540
+ <wp:meta_key>_lp_is_previewable</wp:meta_key>
541
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
542
+ </wp:postmeta> <wp:postmeta>
543
  <wp:meta_key>_edit_lock</wp:meta_key>
544
+ <wp:meta_value><![CDATA[1451449804:1]]></wp:meta_value>
545
+ </wp:postmeta> <wp:postmeta>
 
546
  <wp:meta_key>_edit_last</wp:meta_key>
547
+ <wp:meta_value><![CDATA[1]]></wp:meta_value>
548
+ </wp:postmeta>
549
+ </item><item>
550
+ <title>I am here, beside you</title>
551
+ <link>http://localhost/foobla/learnpress/1.0/quizzes/i-am-here-beside-you/</link>
552
+ <pubDate>Tue, 08 Dec 2015 08:26:07 +0000</pubDate>
553
+ <dc:creator><![CDATA[admin]]></dc:creator>
554
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/quizzes/i-am-here-beside-you/</guid>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
555
  <description></description>
556
+ <content:encoded><![CDATA[]]></content:encoded>
 
 
 
 
557
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
558
+ <wp:post_id>1149</wp:post_id>
559
+ <wp:post_date>2015-12-08 08:26:07</wp:post_date>
560
+ <wp:post_date_gmt>2015-12-08 08:26:07</wp:post_date_gmt>
561
+ <wp:comment_status>open</wp:comment_status>
562
+ <wp:ping_status>open</wp:ping_status>
563
+ <wp:post_name>i-am-here-beside-you</wp:post_name>
564
  <wp:status>publish</wp:status>
565
  <wp:post_parent>0</wp:post_parent>
566
  <wp:menu_order>0</wp:menu_order>
567
+ <wp:post_type>lp_quiz</wp:post_type>
568
  <wp:post_password></wp:post_password>
569
+ <wp:post_author_id>1</wp:post_author_id>
570
  <wp:is_sticky>0</wp:is_sticky>
571
+ <wp:postmeta>
572
+ <wp:meta_key>_lp_duration</wp:meta_key>
573
+ <wp:meta_value><![CDATA[10]]></wp:meta_value>
574
+ </wp:postmeta> <wp:postmeta>
575
+ <wp:meta_key>_lp_max_students</wp:meta_key>
576
+ <wp:meta_value><![CDATA[1000]]></wp:meta_value>
577
+ </wp:postmeta> <wp:postmeta>
578
+ <wp:meta_key>_lp_students</wp:meta_key>
579
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
580
+ </wp:postmeta> <wp:postmeta>
581
+ <wp:meta_key>_lp_retake_count</wp:meta_key>
582
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
583
+ </wp:postmeta> <wp:postmeta>
584
+ <wp:meta_key>_lp_passing_condition</wp:meta_key>
585
+ <wp:meta_value><![CDATA[50]]></wp:meta_value>
586
+ </wp:postmeta> <wp:postmeta>
587
+ <wp:meta_key>_lp_enroll_requirement</wp:meta_key>
588
+ <wp:meta_value><![CDATA[yes]]></wp:meta_value>
589
+ </wp:postmeta> <wp:postmeta>
590
+ <wp:meta_key>_lp_payment</wp:meta_key>
591
+ <wp:meta_value><![CDATA[free]]></wp:meta_value>
592
+ </wp:postmeta> <wp:postmeta>
593
  <wp:meta_key>_edit_lock</wp:meta_key>
594
+ <wp:meta_value><![CDATA[1450973326:1]]></wp:meta_value>
595
+ </wp:postmeta>
596
+ </item><item>
597
+ <title>asdasdasd</title>
598
+ <link>http://localhost/foobla/learnpress/1.0/lessons/asdasdasd/</link>
599
+ <pubDate>Tue, 08 Dec 2015 03:58:51 +0000</pubDate>
600
+ <dc:creator><![CDATA[admin]]></dc:creator>
601
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/asdasdasd/</guid>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
602
  <description></description>
603
+ <content:encoded><![CDATA[]]></content:encoded>
 
 
604
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
605
+ <wp:post_id>1143</wp:post_id>
606
+ <wp:post_date>2015-12-08 03:58:51</wp:post_date>
607
+ <wp:post_date_gmt>2015-12-08 03:58:51</wp:post_date_gmt>
608
+ <wp:comment_status>open</wp:comment_status>
609
+ <wp:ping_status>open</wp:ping_status>
610
+ <wp:post_name>asdasdasd</wp:post_name>
611
  <wp:status>publish</wp:status>
612
  <wp:post_parent>0</wp:post_parent>
613
  <wp:menu_order>0</wp:menu_order>
614
+ <wp:post_type>lp_lesson</wp:post_type>
615
  <wp:post_password></wp:post_password>
616
+ <wp:post_author_id>1</wp:post_author_id>
617
  <wp:is_sticky>0</wp:is_sticky>
618
+ <wp:postmeta>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
619
  <wp:meta_key>_lpr_course</wp:meta_key>
620
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
621
+ </wp:postmeta> <wp:postmeta>
622
+ <wp:meta_key>_lp_is_previewable</wp:meta_key>
623
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
624
+ </wp:postmeta>
625
+ </item><item>
626
+ <title>dsfsdfsdf</title>
627
+ <link>http://localhost/foobla/learnpress/1.0/lessons/dsfsdfsdf/</link>
628
+ <pubDate>Tue, 08 Dec 2015 03:59:33 +0000</pubDate>
629
+ <dc:creator><![CDATA[admin]]></dc:creator>
630
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/dsfsdfsdf/</guid>
631
  <description></description>
632
+ <content:encoded><![CDATA[]]></content:encoded>
633
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
634
+ <wp:post_id>1144</wp:post_id>
635
+ <wp:post_date>2015-12-08 03:59:33</wp:post_date>
636
+ <wp:post_date_gmt>2015-12-08 03:59:33</wp:post_date_gmt>
637
+ <wp:comment_status>open</wp:comment_status>
638
+ <wp:ping_status>open</wp:ping_status>
639
+ <wp:post_name>dsfsdfsdf</wp:post_name>
640
  <wp:status>publish</wp:status>
641
  <wp:post_parent>0</wp:post_parent>
642
  <wp:menu_order>0</wp:menu_order>
643
+ <wp:post_type>lp_lesson</wp:post_type>
644
  <wp:post_password></wp:post_password>
645
+ <wp:post_author_id>1</wp:post_author_id>
646
  <wp:is_sticky>0</wp:is_sticky>
647
+ <wp:postmeta>
 
 
 
 
 
 
 
 
 
 
 
 
 
648
  <wp:meta_key>_lpr_course</wp:meta_key>
649
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
650
+ </wp:postmeta> <wp:postmeta>
651
+ <wp:meta_key>_lp_is_previewable</wp:meta_key>
652
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
653
+ </wp:postmeta>
654
+ </item><item>
655
+ <title>Lesson 1</title>
656
+ <link>http://localhost/foobla/learnpress/1.0/lessons/lesson-1-2/</link>
657
+ <pubDate>Fri, 04 Dec 2015 08:41:24 +0000</pubDate>
658
+ <dc:creator><![CDATA[admin]]></dc:creator>
659
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/lesson-1-2/</guid>
660
  <description></description>
661
+ <content:encoded><![CDATA[]]></content:encoded>
 
 
662
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
663
+ <wp:post_id>1139</wp:post_id>
664
+ <wp:post_date>2015-12-04 08:41:24</wp:post_date>
665
+ <wp:post_date_gmt>2015-12-04 08:41:24</wp:post_date_gmt>
666
+ <wp:comment_status>open</wp:comment_status>
667
+ <wp:ping_status>open</wp:ping_status>
668
+ <wp:post_name>lesson-1-2</wp:post_name>
669
  <wp:status>publish</wp:status>
670
  <wp:post_parent>0</wp:post_parent>
671
  <wp:menu_order>0</wp:menu_order>
672
+ <wp:post_type>lp_lesson</wp:post_type>
673
  <wp:post_password></wp:post_password>
674
+ <wp:post_author_id>1</wp:post_author_id>
675
  <wp:is_sticky>0</wp:is_sticky>
676
+ <wp:postmeta>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
677
  <wp:meta_key>_lpr_course</wp:meta_key>
678
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
679
+ </wp:postmeta> <wp:postmeta>
680
+ <wp:meta_key>_lp_duration</wp:meta_key>
681
+ <wp:meta_value><![CDATA[10]]></wp:meta_value>
682
+ </wp:postmeta> <wp:postmeta>
683
+ <wp:meta_key>_lp_max_students</wp:meta_key>
684
+ <wp:meta_value><![CDATA[1000]]></wp:meta_value>
685
+ </wp:postmeta> <wp:postmeta>
686
+ <wp:meta_key>_lp_students</wp:meta_key>
687
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
688
+ </wp:postmeta> <wp:postmeta>
689
+ <wp:meta_key>_lp_retake_count</wp:meta_key>
690
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
691
+ </wp:postmeta> <wp:postmeta>
692
+ <wp:meta_key>_lp_passing_condition</wp:meta_key>
693
+ <wp:meta_value><![CDATA[50]]></wp:meta_value>
694
+ </wp:postmeta> <wp:postmeta>
695
+ <wp:meta_key>_lp_enroll_requirement</wp:meta_key>
696
+ <wp:meta_value><![CDATA[yes]]></wp:meta_value>
697
+ </wp:postmeta> <wp:postmeta>
698
+ <wp:meta_key>_lp_payment</wp:meta_key>
699
+ <wp:meta_value><![CDATA[free]]></wp:meta_value>
700
+ </wp:postmeta> <wp:postmeta>
701
+ <wp:meta_key>_lp_is_previewable</wp:meta_key>
702
+ <wp:meta_value><![CDATA[yes]]></wp:meta_value>
703
+ </wp:postmeta>
704
+ </item><item>
705
+ <title>Lesson 2</title>
706
+ <link>http://localhost/foobla/learnpress/1.0/lessons/lesson-2-2/</link>
707
+ <pubDate>Fri, 04 Dec 2015 08:41:24 +0000</pubDate>
708
+ <dc:creator><![CDATA[admin]]></dc:creator>
709
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/lesson-2-2/</guid>
710
  <description></description>
711
+ <content:encoded><![CDATA[]]></content:encoded>
 
 
712
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
713
+ <wp:post_id>1140</wp:post_id>
714
+ <wp:post_date>2015-12-04 08:41:24</wp:post_date>
715
+ <wp:post_date_gmt>2015-12-04 08:41:24</wp:post_date_gmt>
716
+ <wp:comment_status>open</wp:comment_status>
717
+ <wp:ping_status>open</wp:ping_status>
718
+ <wp:post_name>lesson-2-2</wp:post_name>
719
  <wp:status>publish</wp:status>
720
  <wp:post_parent>0</wp:post_parent>
721
  <wp:menu_order>0</wp:menu_order>
722
+ <wp:post_type>lp_lesson</wp:post_type>
723
  <wp:post_password></wp:post_password>
724
+ <wp:post_author_id>1</wp:post_author_id>
725
  <wp:is_sticky>0</wp:is_sticky>
726
+ <wp:postmeta>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
727
  <wp:meta_key>_lpr_course</wp:meta_key>
728
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
729
+ </wp:postmeta> <wp:postmeta>
730
+ <wp:meta_key>_lp_is_previewable</wp:meta_key>
731
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
732
+ </wp:postmeta>
733
+ </item><item>
734
+ <title>Lesson 3</title>
735
+ <link>http://localhost/foobla/learnpress/1.0/lessons/lesson-3/</link>
736
+ <pubDate>Tue, 08 Dec 2015 03:58:28 +0000</pubDate>
737
+ <dc:creator><![CDATA[admin]]></dc:creator>
738
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/lesson-3/</guid>
739
  <description></description>
740
+ <content:encoded><![CDATA[]]></content:encoded>
 
 
 
 
741
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
742
+ <wp:post_id>1142</wp:post_id>
743
+ <wp:post_date>2015-12-08 03:58:28</wp:post_date>
744
+ <wp:post_date_gmt>2015-12-08 03:58:28</wp:post_date_gmt>
745
+ <wp:comment_status>open</wp:comment_status>
746
+ <wp:ping_status>open</wp:ping_status>
747
+ <wp:post_name>lesson-3</wp:post_name>
748
  <wp:status>publish</wp:status>
749
  <wp:post_parent>0</wp:post_parent>
750
  <wp:menu_order>0</wp:menu_order>
751
+ <wp:post_type>lp_lesson</wp:post_type>
752
  <wp:post_password></wp:post_password>
753
+ <wp:post_author_id>1</wp:post_author_id>
754
  <wp:is_sticky>0</wp:is_sticky>
755
+ <wp:postmeta>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
756
  <wp:meta_key>_lpr_course</wp:meta_key>
757
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
758
+ </wp:postmeta> <wp:postmeta>
759
+ <wp:meta_key>_lp_is_previewable</wp:meta_key>
760
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
761
+ </wp:postmeta>
762
+ </item><item>
763
+ <title>qqqqqqqqqqqqqqqqq</title>
764
+ <link>http://localhost/foobla/learnpress/1.0/lessons/qqqqqqqqqqqqqqqqq/</link>
765
+ <pubDate>Tue, 08 Dec 2015 15:15:04 +0000</pubDate>
766
+ <dc:creator><![CDATA[admin]]></dc:creator>
767
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/qqqqqqqqqqqqqqqqq/</guid>
768
  <description></description>
769
  <content:encoded><![CDATA[]]></content:encoded>
770
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
771
+ <wp:post_id>1153</wp:post_id>
772
+ <wp:post_date>2015-12-08 15:15:04</wp:post_date>
773
+ <wp:post_date_gmt>2015-12-08 15:15:04</wp:post_date_gmt>
774
  <wp:comment_status>open</wp:comment_status>
775
  <wp:ping_status>open</wp:ping_status>
776
+ <wp:post_name>qqqqqqqqqqqqqqqqq</wp:post_name>
777
  <wp:status>publish</wp:status>
778
  <wp:post_parent>0</wp:post_parent>
779
  <wp:menu_order>0</wp:menu_order>
780
+ <wp:post_type>lp_lesson</wp:post_type>
781
  <wp:post_password></wp:post_password>
782
+ <wp:post_author_id>1</wp:post_author_id>
783
  <wp:is_sticky>0</wp:is_sticky>
784
+ <wp:postmeta>
 
785
  <wp:meta_key>_edit_lock</wp:meta_key>
786
+ <wp:meta_value><![CDATA[1449589506:1]]></wp:meta_value>
787
+ </wp:postmeta>
788
+ </item><item>
789
+ <title>trau va bo</title>
790
+ <link>http://localhost/foobla/learnpress/1.0/lessons/trau-va-bo/</link>
791
+ <pubDate>Tue, 08 Dec 2015 15:16:40 +0000</pubDate>
792
+ <dc:creator><![CDATA[admin]]></dc:creator>
793
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/trau-va-bo/</guid>
794
+ <description></description>
795
+ <content:encoded><![CDATA[]]></content:encoded>
796
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
797
+ <wp:post_id>1154</wp:post_id>
798
+ <wp:post_date>2015-12-08 15:16:40</wp:post_date>
799
+ <wp:post_date_gmt>2015-12-08 15:16:40</wp:post_date_gmt>
800
+ <wp:comment_status>open</wp:comment_status>
801
+ <wp:ping_status>open</wp:ping_status>
802
+ <wp:post_name>trau-va-bo</wp:post_name>
803
+ <wp:status>publish</wp:status>
804
+ <wp:post_parent>0</wp:post_parent>
805
+ <wp:menu_order>0</wp:menu_order>
806
+ <wp:post_type>lp_lesson</wp:post_type>
807
+ <wp:post_password></wp:post_password>
808
+ <wp:post_author_id>1</wp:post_author_id>
809
+ <wp:is_sticky>0</wp:is_sticky>
810
+ <wp:postmeta>
811
+ <wp:meta_key>_lp_duration</wp:meta_key>
812
+ <wp:meta_value><![CDATA[10]]></wp:meta_value>
813
+ </wp:postmeta> <wp:postmeta>
814
+ <wp:meta_key>_lp_is_previewable</wp:meta_key>
815
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
816
+ </wp:postmeta>
817
+ </item><item>
818
+ <title>adasdasdasda asd as</title>
819
+ <link>http://localhost/foobla/learnpress/1.0/lessons/adasdasdasda-asd-as/</link>
820
+ <pubDate>Thu, 17 Dec 2015 02:29:12 +0000</pubDate>
821
+ <dc:creator><![CDATA[admin]]></dc:creator>
822
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/adasdasdasda-asd-as/</guid>
823
+ <description></description>
824
+ <content:encoded><![CDATA[]]></content:encoded>
825
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
826
+ <wp:post_id>1164</wp:post_id>
827
+ <wp:post_date>2015-12-17 02:29:12</wp:post_date>
828
+ <wp:post_date_gmt>2015-12-17 02:29:12</wp:post_date_gmt>
829
+ <wp:comment_status>open</wp:comment_status>
830
+ <wp:ping_status>open</wp:ping_status>
831
+ <wp:post_name>adasdasdasda-asd-as</wp:post_name>
832
+ <wp:status>publish</wp:status>
833
+ <wp:post_parent>0</wp:post_parent>
834
+ <wp:menu_order>0</wp:menu_order>
835
+ <wp:post_type>lp_lesson</wp:post_type>
836
+ <wp:post_password></wp:post_password>
837
+ <wp:post_author_id>1</wp:post_author_id>
838
+ <wp:is_sticky>0</wp:is_sticky>
839
+ <wp:postmeta>
840
+ <wp:meta_key>_lp_duration</wp:meta_key>
841
+ <wp:meta_value><![CDATA[10]]></wp:meta_value>
842
+ </wp:postmeta> <wp:postmeta>
843
+ <wp:meta_key>_lp_max_students</wp:meta_key>
844
+ <wp:meta_value><![CDATA[1000]]></wp:meta_value>
845
+ </wp:postmeta> <wp:postmeta>
846
+ <wp:meta_key>_lp_students</wp:meta_key>
847
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
848
+ </wp:postmeta> <wp:postmeta>
849
+ <wp:meta_key>_lp_retake_count</wp:meta_key>
850
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
851
+ </wp:postmeta> <wp:postmeta>
852
+ <wp:meta_key>_lp_passing_condition</wp:meta_key>
853
+ <wp:meta_value><![CDATA[50]]></wp:meta_value>
854
+ </wp:postmeta> <wp:postmeta>
855
+ <wp:meta_key>_lp_enroll_requirement</wp:meta_key>
856
+ <wp:meta_value><![CDATA[yes]]></wp:meta_value>
857
+ </wp:postmeta> <wp:postmeta>
858
+ <wp:meta_key>_lp_payment</wp:meta_key>
859
+ <wp:meta_value><![CDATA[free]]></wp:meta_value>
860
+ </wp:postmeta>
861
+ </item><item>
862
+ <title>asd asda sdasdas da</title>
863
+ <link>http://localhost/foobla/learnpress/1.0/lessons/asd-asda-sdasdas-da/</link>
864
+ <pubDate>Thu, 17 Dec 2015 02:29:12 +0000</pubDate>
865
+ <dc:creator><![CDATA[admin]]></dc:creator>
866
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/asd-asda-sdasdas-da/</guid>
867
  <description></description>
868
  <content:encoded><![CDATA[]]></content:encoded>
869
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
870
+ <wp:post_id>1165</wp:post_id>
871
+ <wp:post_date>2015-12-17 02:29:12</wp:post_date>
872
+ <wp:post_date_gmt>2015-12-17 02:29:12</wp:post_date_gmt>
873
  <wp:comment_status>open</wp:comment_status>
874
  <wp:ping_status>open</wp:ping_status>
875
+ <wp:post_name>asd-asda-sdasdas-da</wp:post_name>
876
  <wp:status>publish</wp:status>
877
  <wp:post_parent>0</wp:post_parent>
878
  <wp:menu_order>0</wp:menu_order>
879
+ <wp:post_type>lp_lesson</wp:post_type>
880
  <wp:post_password></wp:post_password>
881
+ <wp:post_author_id>1</wp:post_author_id>
882
  <wp:is_sticky>0</wp:is_sticky>
883
 
884
+ </item><item>
885
+ <title>asdasdasdasdasda</title>
886
+ <link>http://localhost/foobla/learnpress/1.0/lessons/asdasdasdasdasda/</link>
887
+ <pubDate>Thu, 17 Dec 2015 02:29:12 +0000</pubDate>
888
+ <dc:creator><![CDATA[admin]]></dc:creator>
889
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/asdasdasdasdasda/</guid>
 
 
 
 
 
 
 
 
 
 
890
  <description></description>
891
+ <content:encoded><![CDATA[]]></content:encoded>
 
 
892
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
893
+ <wp:post_id>1166</wp:post_id>
894
+ <wp:post_date>2015-12-17 02:29:12</wp:post_date>
895
+ <wp:post_date_gmt>2015-12-17 02:29:12</wp:post_date_gmt>
896
+ <wp:comment_status>open</wp:comment_status>
897
+ <wp:ping_status>open</wp:ping_status>
898
+ <wp:post_name>asdasdasdasdasda</wp:post_name>
899
  <wp:status>publish</wp:status>
900
  <wp:post_parent>0</wp:post_parent>
901
  <wp:menu_order>0</wp:menu_order>
902
+ <wp:post_type>lp_lesson</wp:post_type>
903
  <wp:post_password></wp:post_password>
904
+ <wp:post_author_id>1</wp:post_author_id>
905
  <wp:is_sticky>0</wp:is_sticky>
906
 
907
+ </item><item>
908
+ <title>assasdasdasdasdasd</title>
909
+ <link>http://localhost/foobla/learnpress/1.0/lessons/assasdasdasdasdasd/</link>
910
+ <pubDate>Thu, 17 Dec 2015 02:29:12 +0000</pubDate>
911
+ <dc:creator><![CDATA[admin]]></dc:creator>
912
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/assasdasdasdasdasd/</guid>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
913
  <description></description>
914
  <content:encoded><![CDATA[]]></content:encoded>
915
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
916
+ <wp:post_id>1167</wp:post_id>
917
+ <wp:post_date>2015-12-17 02:29:12</wp:post_date>
918
+ <wp:post_date_gmt>2015-12-17 02:29:12</wp:post_date_gmt>
919
  <wp:comment_status>open</wp:comment_status>
920
  <wp:ping_status>open</wp:ping_status>
921
+ <wp:post_name>assasdasdasdasdasd</wp:post_name>
922
  <wp:status>publish</wp:status>
923
  <wp:post_parent>0</wp:post_parent>
924
  <wp:menu_order>0</wp:menu_order>
925
+ <wp:post_type>lp_lesson</wp:post_type>
926
  <wp:post_password></wp:post_password>
927
+ <wp:post_author_id>1</wp:post_author_id>
928
  <wp:is_sticky>0</wp:is_sticky>
929
 
930
+ </item><item>
931
+ <title>How to create a course</title>
932
+ <link>http://localhost/foobla/learnpress/1.0/lessons/how-to-create-a-course/</link>
933
+ <pubDate>Thu, 17 Dec 2015 03:39:13 +0000</pubDate>
934
+ <dc:creator><![CDATA[admin]]></dc:creator>
935
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/how-to-create-a-course/</guid>
936
+ <description></description>
937
+ <content:encoded><![CDATA[]]></content:encoded>
938
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
939
+ <wp:post_id>1169</wp:post_id>
940
+ <wp:post_date>2015-12-17 03:39:13</wp:post_date>
941
+ <wp:post_date_gmt>2015-12-17 03:39:13</wp:post_date_gmt>
942
+ <wp:comment_status>open</wp:comment_status>
943
+ <wp:ping_status>open</wp:ping_status>
944
+ <wp:post_name>how-to-create-a-course</wp:post_name>
945
+ <wp:status>publish</wp:status>
946
+ <wp:post_parent>0</wp:post_parent>
947
+ <wp:menu_order>0</wp:menu_order>
948
+ <wp:post_type>lp_lesson</wp:post_type>
949
+ <wp:post_password></wp:post_password>
950
+ <wp:post_author_id>1</wp:post_author_id>
951
+ <wp:is_sticky>0</wp:is_sticky>
952
+ <wp:postmeta>
953
+ <wp:meta_key>_lp_duration</wp:meta_key>
954
+ <wp:meta_value><![CDATA[10]]></wp:meta_value>
955
+ </wp:postmeta> <wp:postmeta>
956
+ <wp:meta_key>_lp_max_students</wp:meta_key>
957
+ <wp:meta_value><![CDATA[1000]]></wp:meta_value>
958
+ </wp:postmeta> <wp:postmeta>
959
+ <wp:meta_key>_lp_students</wp:meta_key>
960
  <wp:meta_value><![CDATA[0]]></wp:meta_value>
961
+ </wp:postmeta> <wp:postmeta>
962
+ <wp:meta_key>_lp_retake_count</wp:meta_key>
963
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
964
+ </wp:postmeta> <wp:postmeta>
965
+ <wp:meta_key>_lp_passing_condition</wp:meta_key>
966
+ <wp:meta_value><![CDATA[50]]></wp:meta_value>
967
+ </wp:postmeta> <wp:postmeta>
968
+ <wp:meta_key>_lp_enroll_requirement</wp:meta_key>
969
+ <wp:meta_value><![CDATA[yes]]></wp:meta_value>
970
+ </wp:postmeta> <wp:postmeta>
971
+ <wp:meta_key>_lp_payment</wp:meta_key>
972
+ <wp:meta_value><![CDATA[free]]></wp:meta_value>
973
+ </wp:postmeta>
974
+ </item><item>
975
+ <title>What is your name</title>
976
+ <link>http://localhost/foobla/learnpress/1.0/lessons/what-is-your-name/</link>
977
+ <pubDate>Thu, 17 Dec 2015 03:39:13 +0000</pubDate>
978
+ <dc:creator><![CDATA[admin]]></dc:creator>
979
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/what-is-your-name/</guid>
980
  <description></description>
981
  <content:encoded><![CDATA[]]></content:encoded>
982
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
983
+ <wp:post_id>1170</wp:post_id>
984
+ <wp:post_date>2015-12-17 03:39:13</wp:post_date>
985
+ <wp:post_date_gmt>2015-12-17 03:39:13</wp:post_date_gmt>
986
  <wp:comment_status>open</wp:comment_status>
987
  <wp:ping_status>open</wp:ping_status>
988
+ <wp:post_name>what-is-your-name</wp:post_name>
989
  <wp:status>publish</wp:status>
990
  <wp:post_parent>0</wp:post_parent>
991
  <wp:menu_order>0</wp:menu_order>
992
+ <wp:post_type>lp_lesson</wp:post_type>
993
  <wp:post_password></wp:post_password>
994
+ <wp:post_author_id>1</wp:post_author_id>
995
  <wp:is_sticky>0</wp:is_sticky>
996
 
997
+ </item><item>
998
+ <title>My name is Tu Nguyen</title>
999
+ <link>http://localhost/foobla/learnpress/1.0/lessons/my-name-is-tu-nguyen/</link>
1000
+ <pubDate>Thu, 17 Dec 2015 03:39:13 +0000</pubDate>
1001
+ <dc:creator><![CDATA[admin]]></dc:creator>
1002
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/my-name-is-tu-nguyen/</guid>
 
 
 
 
 
 
 
 
 
 
1003
  <description></description>
1004
  <content:encoded><![CDATA[]]></content:encoded>
1005
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
1006
+ <wp:post_id>1171</wp:post_id>
1007
+ <wp:post_date>2015-12-17 03:39:13</wp:post_date>
1008
+ <wp:post_date_gmt>2015-12-17 03:39:13</wp:post_date_gmt>
1009
  <wp:comment_status>open</wp:comment_status>
1010
  <wp:ping_status>open</wp:ping_status>
1011
+ <wp:post_name>my-name-is-tu-nguyen</wp:post_name>
1012
  <wp:status>publish</wp:status>
1013
  <wp:post_parent>0</wp:post_parent>
1014
  <wp:menu_order>0</wp:menu_order>
1015
+ <wp:post_type>lp_lesson</wp:post_type>
1016
  <wp:post_password></wp:post_password>
1017
+ <wp:post_author_id>1</wp:post_author_id>
1018
  <wp:is_sticky>0</wp:is_sticky>
1019
 
1020
+ </item><item>
1021
+ <title>sdfsdfsdf sdf sdf sdf s</title>
1022
+ <link>http://localhost/foobla/learnpress/1.0/quizzes/sdfsdfsdf-sdf-sdf-sdf-s/</link>
1023
+ <pubDate>Thu, 17 Dec 2015 03:39:07 +0000</pubDate>
1024
+ <dc:creator><![CDATA[admin]]></dc:creator>
1025
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/quizzes/sdfsdfsdf-sdf-sdf-sdf-s/</guid>
 
 
 
 
 
 
 
 
 
 
1026
  <description></description>
1027
  <content:encoded><![CDATA[]]></content:encoded>
1028
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
1029
+ <wp:post_id>1168</wp:post_id>
1030
+ <wp:post_date>2015-12-17 03:39:07</wp:post_date>
1031
+ <wp:post_date_gmt>2015-12-17 03:39:07</wp:post_date_gmt>
1032
  <wp:comment_status>open</wp:comment_status>
1033
  <wp:ping_status>open</wp:ping_status>
1034
+ <wp:post_name>sdfsdfsdf-sdf-sdf-sdf-s</wp:post_name>
1035
  <wp:status>publish</wp:status>
1036
  <wp:post_parent>0</wp:post_parent>
1037
  <wp:menu_order>0</wp:menu_order>
1038
+ <wp:post_type>lp_quiz</wp:post_type>
1039
  <wp:post_password></wp:post_password>
1040
+ <wp:post_author_id>1</wp:post_author_id>
1041
  <wp:is_sticky>0</wp:is_sticky>
1042
+ <wp:postmeta>
1043
+ <wp:meta_key>_lp_duration</wp:meta_key>
1044
+ <wp:meta_value><![CDATA[10]]></wp:meta_value>
1045
+ </wp:postmeta> <wp:postmeta>
1046
+ <wp:meta_key>_lp_is_previewable</wp:meta_key>
1047
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
1048
+ </wp:postmeta>
1049
+ </item><item>
1050
+ <title>sdfsd fsd fsdf</title>
1051
+ <link>http://localhost/foobla/learnpress/1.0/quizzes/sdfsd-fsd-fsdf/</link>
1052
+ <pubDate>Thu, 17 Dec 2015 03:44:14 +0000</pubDate>
1053
+ <dc:creator><![CDATA[admin]]></dc:creator>
1054
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/quizzes/sdfsd-fsd-fsdf/</guid>
 
 
 
 
1055
  <description></description>
1056
  <content:encoded><![CDATA[]]></content:encoded>
1057
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
1058
+ <wp:post_id>1172</wp:post_id>
1059
+ <wp:post_date>2015-12-17 03:44:14</wp:post_date>
1060
+ <wp:post_date_gmt>2015-12-17 03:44:14</wp:post_date_gmt>
1061
  <wp:comment_status>open</wp:comment_status>
1062
  <wp:ping_status>open</wp:ping_status>
1063
+ <wp:post_name>sdfsd-fsd-fsdf</wp:post_name>
1064
  <wp:status>publish</wp:status>
1065
  <wp:post_parent>0</wp:post_parent>
1066
  <wp:menu_order>0</wp:menu_order>
1067
+ <wp:post_type>lp_quiz</wp:post_type>
1068
  <wp:post_password></wp:post_password>
1069
+ <wp:post_author_id>1</wp:post_author_id>
1070
  <wp:is_sticky>0</wp:is_sticky>
1071
+ <wp:postmeta>
1072
+ <wp:meta_key>_lp_duration</wp:meta_key>
1073
+ <wp:meta_value><![CDATA[10]]></wp:meta_value>
1074
+ </wp:postmeta> <wp:postmeta>
1075
+ <wp:meta_key>_lp_max_students</wp:meta_key>
1076
+ <wp:meta_value><![CDATA[1000]]></wp:meta_value>
1077
+ </wp:postmeta> <wp:postmeta>
1078
+ <wp:meta_key>_lp_students</wp:meta_key>
 
 
 
1079
  <wp:meta_value><![CDATA[0]]></wp:meta_value>
1080
+ </wp:postmeta> <wp:postmeta>
1081
+ <wp:meta_key>_lp_retake_count</wp:meta_key>
1082
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
1083
+ </wp:postmeta> <wp:postmeta>
1084
+ <wp:meta_key>_lp_passing_condition</wp:meta_key>
1085
+ <wp:meta_value><![CDATA[50]]></wp:meta_value>
1086
+ </wp:postmeta> <wp:postmeta>
1087
+ <wp:meta_key>_lp_enroll_requirement</wp:meta_key>
1088
+ <wp:meta_value><![CDATA[yes]]></wp:meta_value>
1089
+ </wp:postmeta> <wp:postmeta>
1090
+ <wp:meta_key>_lp_payment</wp:meta_key>
1091
+ <wp:meta_value><![CDATA[free]]></wp:meta_value>
1092
+ </wp:postmeta>
1093
+ </item><item>
1094
+ <title>sdf sdfsd fsdf sdfsd f</title>
1095
+ <link>http://localhost/foobla/learnpress/1.0/quizzes/sdf-sdfsd-fsdf-sdfsd-f/</link>
1096
+ <pubDate>Thu, 17 Dec 2015 03:44:14 +0000</pubDate>
1097
+ <dc:creator><![CDATA[admin]]></dc:creator>
1098
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/quizzes/sdf-sdfsd-fsdf-sdfsd-f/</guid>
1099
  <description></description>
1100
  <content:encoded><![CDATA[]]></content:encoded>
1101
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
1102
+ <wp:post_id>1173</wp:post_id>
1103
+ <wp:post_date>2015-12-17 03:44:14</wp:post_date>
1104
+ <wp:post_date_gmt>2015-12-17 03:44:14</wp:post_date_gmt>
1105
  <wp:comment_status>open</wp:comment_status>
1106
  <wp:ping_status>open</wp:ping_status>
1107
+ <wp:post_name>sdf-sdfsd-fsdf-sdfsd-f</wp:post_name>
1108
  <wp:status>publish</wp:status>
1109
  <wp:post_parent>0</wp:post_parent>
1110
  <wp:menu_order>0</wp:menu_order>
1111
+ <wp:post_type>lp_quiz</wp:post_type>
1112
  <wp:post_password></wp:post_password>
1113
+ <wp:post_author_id>1</wp:post_author_id>
1114
  <wp:is_sticky>0</wp:is_sticky>
1115
 
1116
+ </item><item>
1117
+ <title>happy new year!</title>
1118
+ <link>http://localhost/foobla/learnpress/1.0/lessons/happy-new-year/</link>
1119
+ <pubDate>Tue, 29 Dec 2015 09:25:33 +0000</pubDate>
1120
+ <dc:creator><![CDATA[admin]]></dc:creator>
1121
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/happy-new-year/</guid>
1122
+ <description></description>
1123
+ <content:encoded><![CDATA[]]></content:encoded>
1124
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
1125
+ <wp:post_id>1228</wp:post_id>
1126
+ <wp:post_date>2015-12-29 09:25:33</wp:post_date>
1127
+ <wp:post_date_gmt>2015-12-29 09:25:33</wp:post_date_gmt>
1128
+ <wp:comment_status>closed</wp:comment_status>
1129
+ <wp:ping_status>closed</wp:ping_status>
1130
+ <wp:post_name>happy-new-year</wp:post_name>
1131
+ <wp:status>publish</wp:status>
1132
+ <wp:post_parent>0</wp:post_parent>
1133
+ <wp:menu_order>0</wp:menu_order>
1134
+ <wp:post_type>lp_lesson</wp:post_type>
1135
+ <wp:post_password></wp:post_password>
1136
+ <wp:post_author_id>1</wp:post_author_id>
1137
+ <wp:is_sticky>0</wp:is_sticky>
1138
+ <wp:postmeta>
1139
+ <wp:meta_key>_lp_duration</wp:meta_key>
1140
  <wp:meta_value><![CDATA[10]]></wp:meta_value>
1141
+ </wp:postmeta> <wp:postmeta>
1142
+ <wp:meta_key>_lp_is_previewable</wp:meta_key>
1143
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
1144
+ </wp:postmeta>
1145
+ </item><item>
1146
+ <title>happy new year!</title>
1147
+ <link>http://localhost/foobla/learnpress/1.0/lessons/happy-new-year-2/</link>
1148
+ <pubDate>Tue, 29 Dec 2015 09:25:34 +0000</pubDate>
1149
+ <dc:creator><![CDATA[admin]]></dc:creator>
1150
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/happy-new-year-2/</guid>
1151
+ <description></description>
1152
+ <content:encoded><![CDATA[]]></content:encoded>
1153
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
1154
+ <wp:post_id>1229</wp:post_id>
1155
+ <wp:post_date>2015-12-29 09:25:34</wp:post_date>
1156
+ <wp:post_date_gmt>2015-12-29 09:25:34</wp:post_date_gmt>
1157
+ <wp:comment_status>closed</wp:comment_status>
1158
+ <wp:ping_status>closed</wp:ping_status>
1159
+ <wp:post_name>happy-new-year-2</wp:post_name>
1160
+ <wp:status>publish</wp:status>
1161
+ <wp:post_parent>0</wp:post_parent>
1162
+ <wp:menu_order>0</wp:menu_order>
1163
+ <wp:post_type>lp_lesson</wp:post_type>
1164
+ <wp:post_password></wp:post_password>
1165
+ <wp:post_author_id>1</wp:post_author_id>
1166
+ <wp:is_sticky>0</wp:is_sticky>
1167
+ <wp:postmeta>
1168
+ <wp:meta_key>_lp_duration</wp:meta_key>
1169
+ <wp:meta_value><![CDATA[10]]></wp:meta_value>
1170
+ </wp:postmeta> <wp:postmeta>
1171
+ <wp:meta_key>_lp_is_previewable</wp:meta_key>
1172
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
1173
+ </wp:postmeta>
1174
+ </item><item>
1175
+ <title>Lesson 1</title>
1176
+ <link>http://localhost/foobla/learnpress/1.0/lessons/lesson-1/</link>
1177
+ <pubDate>Fri, 04 Dec 2015 08:17:04 +0000</pubDate>
1178
+ <dc:creator><![CDATA[admin]]></dc:creator>
1179
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/lesson-1/</guid>
1180
  <description></description>
1181
  <content:encoded><![CDATA[]]></content:encoded>
1182
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
1183
+ <wp:post_id>1136</wp:post_id>
1184
+ <wp:post_date>2015-12-04 08:17:04</wp:post_date>
1185
+ <wp:post_date_gmt>2015-12-04 08:17:04</wp:post_date_gmt>
1186
  <wp:comment_status>open</wp:comment_status>
1187
  <wp:ping_status>open</wp:ping_status>
1188
+ <wp:post_name>lesson-1</wp:post_name>
1189
  <wp:status>publish</wp:status>
1190
  <wp:post_parent>0</wp:post_parent>
1191
  <wp:menu_order>0</wp:menu_order>
1192
+ <wp:post_type>lp_lesson</wp:post_type>
1193
  <wp:post_password></wp:post_password>
1194
+ <wp:post_author_id>1</wp:post_author_id>
1195
  <wp:is_sticky>0</wp:is_sticky>
1196
+ <wp:postmeta>
1197
+ <wp:meta_key>_lpr_course</wp:meta_key>
1198
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
1199
+ </wp:postmeta> <wp:postmeta>
1200
+ <wp:meta_key>_lp_duration</wp:meta_key>
1201
+ <wp:meta_value><![CDATA[10]]></wp:meta_value>
1202
+ </wp:postmeta> <wp:postmeta>
1203
+ <wp:meta_key>_lp_max_students</wp:meta_key>
1204
+ <wp:meta_value><![CDATA[1000]]></wp:meta_value>
1205
+ </wp:postmeta> <wp:postmeta>
1206
+ <wp:meta_key>_lp_students</wp:meta_key>
1207
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
1208
+ </wp:postmeta> <wp:postmeta>
1209
+ <wp:meta_key>_lp_retake_count</wp:meta_key>
1210
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
1211
+ </wp:postmeta> <wp:postmeta>
1212
+ <wp:meta_key>_lp_passing_condition</wp:meta_key>
1213
+ <wp:meta_value><![CDATA[50]]></wp:meta_value>
1214
+ </wp:postmeta> <wp:postmeta>
1215
+ <wp:meta_key>_lp_enroll_requirement</wp:meta_key>
1216
+ <wp:meta_value><![CDATA[yes]]></wp:meta_value>
1217
+ </wp:postmeta> <wp:postmeta>
1218
+ <wp:meta_key>_lp_payment</wp:meta_key>
1219
+ <wp:meta_value><![CDATA[free]]></wp:meta_value>
1220
+ </wp:postmeta> <wp:postmeta>
1221
+ <wp:meta_key>_lp_is_previewable</wp:meta_key>
1222
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
1223
+ </wp:postmeta> <wp:postmeta>
1224
+ <wp:meta_key>_edit_lock</wp:meta_key>
1225
+ <wp:meta_value><![CDATA[1451567890:1]]></wp:meta_value>
1226
+ </wp:postmeta>
1227
+ </item><item>
1228
+ <title>Lesson 2</title>
1229
+ <link>http://localhost/foobla/learnpress/1.0/lessons/lesson-2/</link>
1230
+ <pubDate>Fri, 04 Dec 2015 08:17:04 +0000</pubDate>
1231
+ <dc:creator><![CDATA[admin]]></dc:creator>
1232
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/lesson-2/</guid>
1233
  <description></description>
1234
  <content:encoded><![CDATA[]]></content:encoded>
1235
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
1236
+ <wp:post_id>1137</wp:post_id>
1237
+ <wp:post_date>2015-12-04 08:17:04</wp:post_date>
1238
+ <wp:post_date_gmt>2015-12-04 08:17:04</wp:post_date_gmt>
1239
  <wp:comment_status>open</wp:comment_status>
1240
  <wp:ping_status>open</wp:ping_status>
1241
+ <wp:post_name>lesson-2</wp:post_name>
1242
  <wp:status>publish</wp:status>
1243
  <wp:post_parent>0</wp:post_parent>
1244
  <wp:menu_order>0</wp:menu_order>
1245
+ <wp:post_type>lp_lesson</wp:post_type>
1246
  <wp:post_password></wp:post_password>
1247
+ <wp:post_author_id>1</wp:post_author_id>
1248
  <wp:is_sticky>0</wp:is_sticky>
1249
+ <wp:postmeta>
1250
+ <wp:meta_key>_lpr_course</wp:meta_key>
1251
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
1252
+ </wp:postmeta> <wp:postmeta>
1253
+ <wp:meta_key>_lp_is_previewable</wp:meta_key>
1254
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
1255
+ </wp:postmeta>
1256
+ </item><item>
1257
+ <title>oi troi oi la troi</title>
1258
+ <link>http://localhost/foobla/learnpress/1.0/lessons/oi-troi-oi-la-troi/</link>
1259
+ <pubDate>Tue, 29 Dec 2015 09:29:54 +0000</pubDate>
1260
+ <dc:creator><![CDATA[admin]]></dc:creator>
1261
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/oi-troi-oi-la-troi/</guid>
 
 
 
 
1262
  <description></description>
1263
  <content:encoded><![CDATA[]]></content:encoded>
1264
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
1265
+ <wp:post_id>1230</wp:post_id>
1266
+ <wp:post_date>2015-12-29 09:29:54</wp:post_date>
1267
+ <wp:post_date_gmt>2015-12-29 09:29:54</wp:post_date_gmt>
1268
+ <wp:comment_status>closed</wp:comment_status>
1269
+ <wp:ping_status>closed</wp:ping_status>
1270
+ <wp:post_name>oi-troi-oi-la-troi</wp:post_name>
1271
+ <wp:status>publish</wp:status>
1272
+ <wp:post_parent>0</wp:post_parent>
1273
+ <wp:menu_order>0</wp:menu_order>
1274
+ <wp:post_type>lp_lesson</wp:post_type>
1275
+ <wp:post_password></wp:post_password>
1276
+ <wp:post_author_id>1</wp:post_author_id>
1277
+ <wp:is_sticky>0</wp:is_sticky>
1278
+ <wp:postmeta>
1279
+ <wp:meta_key>_lp_duration</wp:meta_key>
1280
+ <wp:meta_value><![CDATA[10]]></wp:meta_value>
1281
+ </wp:postmeta> <wp:postmeta>
1282
+ <wp:meta_key>_lp_is_previewable</wp:meta_key>
1283
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
1284
+ </wp:postmeta>
1285
+ </item><item>
1286
+ <title>333333333333</title>
1287
+ <link>http://localhost/foobla/learnpress/1.0/lessons/333333333333-2/</link>
1288
+ <pubDate>Tue, 08 Dec 2015 04:18:47 +0000</pubDate>
1289
+ <dc:creator><![CDATA[admin]]></dc:creator>
1290
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/333333333333-2/</guid>
1291
+ <description></description>
1292
+ <content:encoded><![CDATA[]]></content:encoded>
1293
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
1294
+ <wp:post_id>1145</wp:post_id>
1295
+ <wp:post_date>2015-12-08 04:18:47</wp:post_date>
1296
+ <wp:post_date_gmt>2015-12-08 04:18:47</wp:post_date_gmt>
1297
  <wp:comment_status>open</wp:comment_status>
1298
  <wp:ping_status>open</wp:ping_status>
1299
+ <wp:post_name>333333333333-2</wp:post_name>
1300
  <wp:status>publish</wp:status>
1301
  <wp:post_parent>0</wp:post_parent>
1302
  <wp:menu_order>0</wp:menu_order>
1303
+ <wp:post_type>lp_lesson</wp:post_type>
1304
  <wp:post_password></wp:post_password>
1305
+ <wp:post_author_id>1</wp:post_author_id>
1306
  <wp:is_sticky>0</wp:is_sticky>
1307
+ <wp:postmeta>
1308
+ <wp:meta_key>_lpr_course</wp:meta_key>
1309
+ <wp:meta_value><![CDATA[0]]></wp:meta_value>
1310
+ </wp:postmeta> <wp:postmeta>
1311
+ <wp:meta_key>_lp_is_previewable</wp:meta_key>
1312
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
1313
+ </wp:postmeta>
1314
+ </item><item>
1315
+ <title>44444444</title>
1316
+ <link>http://localhost/foobla/learnpress/1.0/lessons/44444444-2/</link>
1317
+ <pubDate>Tue, 29 Dec 2015 09:02:22 +0000</pubDate>
1318
+ <dc:creator><![CDATA[admin]]></dc:creator>
1319
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/44444444-2/</guid>
1320
+ <description></description>
1321
+ <content:encoded><![CDATA[]]></content:encoded>
1322
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
1323
+ <wp:post_id>1227</wp:post_id>
1324
+ <wp:post_date>2015-12-29 09:02:22</wp:post_date>
1325
+ <wp:post_date_gmt>2015-12-29 09:02:22</wp:post_date_gmt>
1326
+ <wp:comment_status>closed</wp:comment_status>
1327
+ <wp:ping_status>closed</wp:ping_status>
1328
+ <wp:post_name>44444444-2</wp:post_name>
1329
+ <wp:status>publish</wp:status>
1330
+ <wp:post_parent>0</wp:post_parent>
1331
+ <wp:menu_order>0</wp:menu_order>
1332
+ <wp:post_type>lp_lesson</wp:post_type>
1333
+ <wp:post_password></wp:post_password>
1334
+ <wp:post_author_id>1</wp:post_author_id>
1335
+ <wp:is_sticky>0</wp:is_sticky>
1336
+ <wp:postmeta>
1337
+ <wp:meta_key>_lp_duration</wp:meta_key>
1338
+ <wp:meta_value><![CDATA[10]]></wp:meta_value>
1339
+ </wp:postmeta> <wp:postmeta>
1340
+ <wp:meta_key>_lp_is_previewable</wp:meta_key>
1341
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
1342
+ </wp:postmeta>
1343
+ </item><item>
1344
+ <title>cookie</title>
1345
+ <link>http://localhost/foobla/learnpress/1.0/lessons/cookie/</link>
1346
+ <pubDate>Tue, 29 Dec 2015 09:33:07 +0000</pubDate>
1347
+ <dc:creator><![CDATA[admin]]></dc:creator>
1348
+ <guid isPermaLink="false">http://localhost/foobla/learnpress/1.0/lessons/cookie/</guid>
1349
+ <description></description>
1350
+ <content:encoded><![CDATA[]]></content:encoded>
1351
+ <excerpt:encoded><![CDATA[]]></excerpt:encoded>
1352
+ <wp:post_id>1231</wp:post_id>
1353
+ <wp:post_date>2015-12-29 09:33:07</wp:post_date>
1354
+ <wp:post_date_gmt>2015-12-29 09:33:07</wp:post_date_gmt>
1355
+ <wp:comment_status>closed</wp:comment_status>
1356
+ <wp:ping_status>closed</wp:ping_status>
1357
+ <wp:post_name>cookie</wp:post_name>
1358
+ <wp:status>publish</wp:status>
1359
+ <wp:post_parent>0</wp:post_parent>
1360
+ <wp:menu_order>0</wp:menu_order>
1361
+ <wp:post_type>lp_lesson</wp:post_type>
1362
+ <wp:post_password></wp:post_password>
1363
+ <wp:post_author_id>1</wp:post_author_id>
1364
+ <wp:is_sticky>0</wp:is_sticky>
1365
+ <wp:postmeta>
1366
+ <wp:meta_key>_lp_duration</wp:meta_key>
1367
  <wp:meta_value><![CDATA[10]]></wp:meta_value>
1368
+ </wp:postmeta> <wp:postmeta>
1369
+ <wp:meta_key>_lp_is_previewable</wp:meta_key>
1370
+ <wp:meta_value><![CDATA[no]]></wp:meta_value>
1371
+ </wp:postmeta>
1372
+ </item> </channel>
1373
  </rss>
inc/abstracts/abstract-lp-assets.php ADDED
@@ -0,0 +1,262 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class LP_Abstract_Assets
5
+ *
6
+ * @author ThimPress
7
+ * @package LearnPress/Classes
8
+ * @version 1.0
9
+ */
10
+
11
+ if ( !defined( 'ABSPATH' ) ) {
12
+ exit; // Exit if accessed directly
13
+ }
14
+
15
+ abstract class LP_Abstract_Assets {
16
+
17
+ /**
18
+ * Styles
19
+ *
20
+ * @var array
21
+ */
22
+ protected static $styles = array();
23
+
24
+ /**
25
+ * Scripts
26
+ *
27
+ * @var array
28
+ */
29
+ protected static $scripts = array();
30
+
31
+ /**
32
+ * Localize scripts
33
+ *
34
+ * @var array
35
+ */
36
+ protected static $wp_localize_scripts = array();
37
+
38
+ /**
39
+ * Params
40
+ *
41
+ * @var array
42
+ */
43
+ protected static $wp_params = array();
44
+
45
+ protected static $wp_script_codes = array();
46
+
47
+ /**
48
+ * Localized flag
49
+ *
50
+ * @var bool
51
+ */
52
+ protected static $localized = false;
53
+
54
+ /**
55
+ * @var int
56
+ */
57
+ protected static $id = 0;
58
+
59
+ protected static $caller = '';
60
+
61
+ /**
62
+ * Constructor
63
+ */
64
+ public function __construct() {
65
+
66
+ }
67
+
68
+ /**
69
+ * Init Asset
70
+ */
71
+ public static function init() {
72
+ if ( !self::$caller ) {
73
+ return;
74
+ }
75
+ self::$id = is_admin() ? 0 : 1;
76
+
77
+ $class = self::$caller;
78
+ if ( self::$id ) {
79
+ add_action( 'wp_enqueue_scripts', array( $class, 'load_scripts' ) );
80
+ add_action( 'wp_enqueue_scripts', array( $class, 'wp_assets' ) );
81
+ add_action( 'wp_print_scripts', array( $class, 'localize_printed_scripts' ), 5 );
82
+ add_action( 'wp_print_footer_scripts', array( $class, 'localize_printed_scripts' ), 5 );
83
+ } else {
84
+ add_action( 'admin_enqueue_scripts', array( $class, 'load_scripts' ) );
85
+ add_action( 'admin_enqueue_scripts', array( $class, 'wp_assets' ) );
86
+ add_action( 'admin_print_scripts', array( $class, 'localize_printed_scripts' ), 5 );
87
+ add_action( 'admin_print_footer_scripts', array( $class, 'localize_printed_scripts' ), 5 );
88
+ }
89
+
90
+ add_filter( 'script_loader_src', array( $class, 'script_params' ), 999, 2 );
91
+ }
92
+
93
+ /**
94
+ * register script
95
+ *
96
+ * @param string $handle
97
+ * @param string $src
98
+ * @param array $deps
99
+ * @param string $version
100
+ * @param boolean $in_footer
101
+ */
102
+ public static function add_script( $handle, $src, $deps = array( 'jquery' ), $version = LEARNPRESS_VERSION, $in_footer = true ) {
103
+ self::$scripts[] = $handle;
104
+ wp_register_script( $handle, $src, $deps, $version, $in_footer );
105
+ }
106
+
107
+ /**
108
+ * register style
109
+ *
110
+ * @param string $handle
111
+ * @param string $src
112
+ * @param array $deps
113
+ * @param string $version
114
+ * @param string $media
115
+ */
116
+ public static function add_style( $handle, $src, $deps = array(), $version = LEARNPRESS_VERSION, $media = 'all' ) {
117
+ self::$styles[] = $handle;
118
+ wp_register_style( $handle, $src, $deps, $version, $media );
119
+ }
120
+
121
+ /**
122
+ * enqueue script
123
+ *
124
+ * @param string $handle
125
+ * @param string $src
126
+ * @param array $deps
127
+ * @param string $version
128
+ * @param boolean $in_footer
129
+ */
130
+ public static function enqueue_script( $handle, $src = '', $deps = array( 'jquery' ), $version = LEARNPRESS_VERSION, $in_footer = true ) {
131
+ if ( !in_array( $handle, self::$scripts ) && $src ) {
132
+ self::add_script( $handle, $src, $deps, $version, $in_footer );
133
+ }
134
+ wp_enqueue_script( $handle );
135
+ }
136
+
137
+ /**
138
+ * enqueue style
139
+ *
140
+ * @param string $handle
141
+ * @param string $src
142
+ * @param array $deps
143
+ * @param string $version
144
+ * @param string $media
145
+ */
146
+ public static function enqueue_style( $handle, $src = '', $deps = array(), $version = LEARNPRESS_VERSION, $media = 'all' ) {
147
+ if ( !in_array( $handle, self::$styles ) && $src ) {
148
+ self::add_style( $handle, $src, $deps, $version, $media );
149
+ }
150
+ wp_enqueue_style( $handle );
151
+ }
152
+
153
+ /**
154
+ * add translate text
155
+ *
156
+ * @param string
157
+ * @param array $localize
158
+ * @param string
159
+ */
160
+ public static function add_localize( $key, $localize = null, $handle = 'learn-press-js' ) {
161
+ if ( is_array( $key ) ) {
162
+ foreach ( $key as $k => $v ) {
163
+ self::add_localize( $k, $v, $handle );
164
+ }
165
+ } elseif ( is_string( $key ) && strlen( $key ) ) {
166
+ if ( !$handle ) $handle = 'learn-press-js';
167
+ if ( empty( self::$wp_localize_scripts[$handle] ) ) self::$wp_localize_scripts[$handle] = array();
168
+ self::$wp_localize_scripts[$handle][$key] = $localize;
169
+ }
170
+ }
171
+
172
+ /**
173
+ * Add js param
174
+ *
175
+ * @param string
176
+ * @param array
177
+ * @param string
178
+ */
179
+ public static function add_param( $key, $param = null, $handle = 'learn-press-js' ) {
180
+ if ( is_array( $key ) ) {
181
+ foreach ( $key as $k => $v ) {
182
+ self::add_param( $k, $v, $handle );
183
+ }
184
+ } elseif ( is_string( $key ) && strlen( $key ) ) {
185
+ if ( !$handle ) $handle = 'learn-press-js';
186
+ if ( empty( self::$wp_params[$handle] ) ) self::$wp_params[$handle] = array();
187
+ self::$wp_params[$handle][$key] = $param;
188
+ }
189
+ }
190
+
191
+ /**
192
+ * Localize script
193
+ *
194
+ * @param mixed $handle
195
+ */
196
+ private static function localize_script( $handle ) {
197
+ $data = !empty( self::$wp_localize_scripts[$handle] ) ? self::$wp_localize_scripts[$handle] : false;
198
+ if ( wp_script_is( $handle ) && $data ) {
199
+ $name = str_replace( '-', '_', $handle ) . '_localize';
200
+ unset( self::$wp_localize_scripts[$handle] );
201
+ wp_localize_script( $handle, $name, apply_filters( $name, $data ) );
202
+ }
203
+ }
204
+
205
+ /**
206
+ * Print script params
207
+ *
208
+ * @param mixed $handle
209
+ */
210
+ private static function script_paramsx( $handle ) {
211
+ $data = !empty( self::$wp_params[$handle] ) ? self::$wp_params[$handle] : false;
212
+ if ( wp_script_is( $handle ) && $data ) {
213
+ $name = str_replace( '-', '_', $handle ) . '_params';
214
+ unset( self::$wp_params[$handle] );
215
+ //$data = learn_press_sanitize_json( $data );
216
+ //wp_localize_script( $handle, $name, apply_filters( $name, $data ) );
217
+ }
218
+ }
219
+
220
+ public static function add_script_tag( $code, $handle = '' ) {
221
+ if ( empty( self::$wp_script_codes[$handle] ) ) {
222
+ self::$wp_script_codes[$handle] = '';
223
+ }
224
+ self::$wp_script_codes[$handle] .= preg_replace( '!</?script(.*)>!', '', $code );
225
+ }
226
+
227
+ public static function wp_assets() {
228
+ do_action( 'learn_press_print_assets', is_admin() );
229
+ }
230
+
231
+ public static function script_params( $src, $handle ) {
232
+ $data = !empty( self::$wp_params[$handle] ) ? self::$wp_params[$handle] : false;
233
+ if ( wp_script_is( $handle ) && $data ) {
234
+ $name = str_replace( '-', '_', $handle ) . '_params';
235
+ echo "<script type='text/javascript'>\n"; // CDATA and type='text/javascript' is not needed for HTML 5
236
+ echo "/* <![CDATA[ */\n";
237
+ echo "var {$name}=" . wp_json_encode( $data ) . "\n";
238
+ echo "/* ]]> */\n";
239
+ echo "</script>\n";
240
+ unset( self::$wp_params[$handle] );
241
+ }
242
+ return $src;
243
+ }
244
+
245
+ /**
246
+ * Load Script
247
+ */
248
+ public static function load_scripts() {
249
+ }
250
+
251
+ public static function localize_printed_scripts() {
252
+ if ( self::$scripts ) foreach ( self::$scripts as $handle ) {
253
+ self::localize_script( $handle );
254
+ //self::script_params( $handle );
255
+ if ( !empty( self::$wp_script_codes[$handle] ) ) {
256
+ learn_press_get_template( 'global/scripts.php', array( 'code' => self::$wp_script_codes[$handle] ) );
257
+ unset( self::$wp_script_codes[$handle] );
258
+ }
259
+ }
260
+
261
+ }
262
+ }
inc/abstracts/abstract-lp-course.php DELETED
@@ -1,155 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Class LP_Abstract_Course
5
- */
6
- abstract class LP_Abstract_Course{
7
- /**
8
- * The course (post) ID.
9
- *
10
- * @var int
11
- */
12
- public $id = 0;
13
-
14
- /**
15
- * $post Stores post data
16
- *
17
- * @var $post WP_Post
18
- */
19
- public $post = null;
20
-
21
- /**
22
- *
23
- * @var string
24
- */
25
- public $course_type = null;
26
-
27
- /**
28
- * Constructor gets the post object and sets the ID for the loaded course.
29
- *
30
- * @param int|LP_Course|object $course Course ID, post object, or course object
31
- */
32
- public function __construct( $course ) {
33
- if ( is_numeric( $course ) ) {
34
- $this->id = absint( $course );
35
- $this->post = get_post( $this->id );
36
- } elseif ( $course instanceof LP_Course ) {
37
- $this->id = absint( $course->id );
38
- $this->post = $course->post;
39
- } elseif ( isset( $course->ID ) ) {
40
- $this->id = absint( $course->ID );
41
- $this->post = $course;
42
- }
43
- }
44
-
45
- /**
46
- * __isset function.
47
- *
48
- * @param mixed $key
49
- * @return bool
50
- */
51
- public function __isset( $key ) {
52
- return metadata_exists( 'post', $this->id, '_' . $key );
53
- }
54
-
55
- /**
56
- * __get function.
57
- *
58
- * @param string $key
59
- * @return mixed
60
- */
61
- public function __get( $key ) {
62
- $value = get_post_meta( $this->id, '_lpr_' . $key, true );
63
- if ( ! empty( $value ) ) {
64
- $this->$key = $value;
65
- }
66
-
67
- return $value;
68
- }
69
-
70
- /**
71
- * Get the course's post data.
72
- *
73
- * @return object
74
- */
75
- public function get_course_data() {
76
- return $this->post;
77
- }
78
-
79
- /**
80
- *
81
- * @return mixed
82
- */
83
- public function is_enrollable(){
84
- $enrollable = true;
85
-
86
- // Products must exist of course
87
- if ( ! $this->exists() ) {
88
- $enrollable = false;
89
- // Check the product is published
90
- } elseif ( $this->post->post_status !== 'publish' && ! current_user_can( 'edit_post', $this->id ) ) {
91
- $enrollable = false;
92
- }
93
-
94
- return apply_filters( 'learn_press_is_enrollable', $enrollable, $this );
95
- }
96
-
97
- /**
98
- * Course is exists if the post is not empty
99
- *
100
- * @return bool
101
- */
102
- public function exists() {
103
- return empty( $this->post ) ? false : true;
104
- }
105
-
106
- /**
107
- * The course is require enrollment or not
108
- *
109
- * @return bool
110
- */
111
- public function is_require_enrollment() {
112
- $is_require = $this->course_enrolled_require;
113
- $is_require = empty( $is_require ) || ( $is_require == 'yes' ) ? true : false;
114
- return apply_filters( 'learn_press_is_require_enrollment', $is_require, $this );
115
- }
116
-
117
- /**
118
- * Get all curriculum of this course
119
- *
120
- * @return mixed
121
- */
122
- public function get_curriculum(){
123
- return apply_filters( 'learn_press_course_curriculum', $this->course_lesson_quiz, $this );
124
- }
125
-
126
- /**
127
- * Count the total of students has enrolled course
128
- *
129
- * @return mixed
130
- */
131
- public function count_users_enrolled(){
132
- $count = 0;
133
- $users = $this->course_user;
134
- if( is_array( $users ) ){
135
- $users = array_unique( $users );
136
- $count = sizeof( $users );
137
- }
138
- return apply_filters( 'learn_press_count_users_enrolled', $count, $this );
139
- }
140
-
141
- public function is_free(){
142
- $is_free = ( 'free' == $this->course_payment ) || ( 0 >= $this->get_price() ) ;
143
- return apply_filters( 'learn_press_is_free_course', $is_free, $this );
144
- }
145
-
146
- public function get_price(){
147
- $price = $this->course_price;
148
- if( ! $price ){
149
- $price = 0;
150
- }else{
151
- $price = floatval( $price );
152
- }
153
- return apply_filters( 'learn_press_course_price', $price, $this );
154
- }
155
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/abstracts/abstract-lp-user.php DELETED
@@ -1,298 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Class LP_Abstract_User
5
- */
6
- class LP_Abstract_User {
7
- /**
8
- * @var array
9
- */
10
- static protected $_users = array();
11
-
12
- /**
13
- * @var int
14
- */
15
- public $id = 0;
16
-
17
- /**
18
- * @var WP_User object
19
- */
20
- public $user = false;
21
-
22
- /**
23
- * @var LP_Quiz object
24
- */
25
- public $quiz = false;
26
-
27
- /**
28
- * Constructor
29
- *
30
- * @param int $the_user
31
- *
32
- * @throws Exception
33
- */
34
- function __construct( $the_user = 0 ) {
35
- if ( $user = get_user_by( 'id', $the_user ) ) {
36
- $this->user = get_user_by( 'id', $the_user );
37
- $this->id = $the_user;
38
- } else {
39
- throw new Exception( sprintf( __( 'The user with ID = %d is not exists', 'learn_press' ), $the_user ) );
40
- }
41
- }
42
-
43
- /**
44
- * Magic function to setup user data
45
- *
46
- * @param $key
47
- * @param $value
48
- */
49
- function __set( $key, $value ) {
50
- $this->user->data->{$key} = $value;
51
- }
52
-
53
- /**
54
- * Magic function to get user data
55
- *
56
- * @param $key
57
- *
58
- * @return bool
59
- */
60
- function __get( $key ) {
61
- $return = false;
62
- if ( !empty( $this->user->data->{$key} ) ) {
63
- $return = $this->user->data->{$key};
64
- }else{
65
- if ( isset( $this->{$key} ) ) {
66
- $return = $this->{$key};
67
- }elseif ( strpos( $key, '_lpr_' ) === false ) {
68
- $key = '_lpr_' . $key;
69
- $return = get_user_meta( $this->id, $key, true );
70
- if ( !empty( $value ) ) {
71
- $this->$key = $return;
72
- }
73
- }
74
- }
75
- return $return;
76
- }
77
-
78
- /**
79
- * Set current quiz for user
80
- *
81
- * @param $quiz
82
- */
83
- function set_quiz( $quiz ) {
84
- $this->quiz = $quiz;
85
- }
86
-
87
- /**
88
- * Get quiz field
89
- *
90
- * @param $field
91
- *
92
- * @return bool
93
- */
94
- function get_quiz_field( $field ) {
95
- if ( !empty( $this->quiz->{$field} ) ) {
96
- return $this->quiz->{$field};
97
- }
98
- return false;
99
- }
100
-
101
- /**
102
- * Start quiz for the user
103
- *
104
- * @param null $quiz_id
105
- *
106
- * @return array|void
107
- */
108
- function start_quiz( $quiz_id = null ) {
109
- if ( !$quiz_id ) $quiz_id = $this->get_quiz_field( 'id' );
110
- $user_id = $this->id;
111
- $location_time = current_time( 'timestamp' );
112
-
113
- // @since 0.9.5
114
- if ( !apply_filters( 'learn_press_before_user_start_quiz', true, $quiz_id, $user_id ) ) {
115
- return;
116
- }
117
-
118
- // update start time, this is the time user begin the quiz
119
- $meta = get_user_meta( $user_id, '_lpr_quiz_start_time', true );
120
- if ( !is_array( $meta ) ) $meta = array( $quiz_id => $location_time );
121
- else $meta[$quiz_id] = $location_time;
122
- update_user_meta( $user_id, '_lpr_quiz_start_time', $meta );
123
-
124
- // update questions
125
- if ( $questions = learn_press_get_quiz_questions( $quiz_id ) ) {
126
- // stores the questions
127
- $question_ids = array_keys( $questions );
128
- $question_ids = apply_filters( 'learn_press_update_user_quiz_questions', $question_ids, $quiz_id, $user_id );
129
- $meta = get_user_meta( $user_id, '_lpr_quiz_questions', true );
130
- if ( !is_array( $meta ) ) $meta = array( $quiz_id => $question_ids );
131
- else $meta[$quiz_id] = $question_ids;
132
- update_user_meta( $user_id, '_lpr_quiz_questions', $meta );
133
-
134
- // stores current question
135
- $meta = get_user_meta( $user_id, '_lpr_quiz_current_question', true );
136
- if ( !is_array( $meta ) ) $meta = array( $quiz_id => $question_ids[0] );
137
- else $meta[$quiz_id] = $question_ids[0];
138
- update_user_meta( $user_id, '_lpr_quiz_current_question', $meta );
139
-
140
- }
141
- $course_id = learn_press_get_course_by_quiz( $quiz_id );
142
- $course_time = get_user_meta( $user_id, '_lpr_course_time', true );
143
- if ( empty( $course_time[$course_id] ) ) {
144
- $course_time[$course_id] = array(
145
- 'start' => $location_time,
146
- 'end' => null
147
- );
148
- update_user_meta( $user_id, '_lpr_course_time', $course_time );
149
- }
150
-
151
-
152
- // update answers
153
- $quizzes = get_user_meta( $user_id, '_lpr_quiz_question_answer', true );
154
- if ( !is_array( $quizzes ) ) $quizzes = array();
155
- $quizzes[$quiz_id] = array();
156
- update_user_meta( $user_id, '_lpr_quiz_question_answer', $quizzes );
157
-
158
- // @since 0.9.5
159
- do_action( 'learn_press_user_start_quiz', $quiz_id, $user_id );
160
-
161
- return array(
162
- 'start' => $location_time,
163
- 'end' => null
164
- );
165
- }
166
-
167
- function get_current_question_id( $quiz_id = 0 ){
168
- $current = false;
169
- $quiz_current_question = $this->quiz_current_question;
170
- if( is_array( $quiz_current_question ) && ! empty( $quiz_current_question[ $quiz_id ] ) ) {
171
- $current = $quiz_current_question[ $quiz_id ];
172
- }else{
173
- $quiz_questions = $this->quiz_questions;
174
- if( is_array( $quiz_questions ) && ! empty( $quiz_questions[ $quiz_id ] ) ){
175
- $current = $quiz_questions[ $quiz_id ];
176
- }
177
- }
178
- if( !$current && ( $questions = learn_press_get_quiz_questions( $quiz_id ) ) ){
179
- $question_ids = array_keys( $questions );
180
- $current = $question_ids[0];
181
- }
182
- return $current;
183
- }
184
-
185
- function get_current_question( $quiz_id, $what = '' ){
186
- $current = $this->get_current_question_id( $quiz_id );
187
- if( $what == 'id' ){
188
- return $current;
189
- }else{
190
- $question = LPR_Question_Factory::instance()->get_question( $current );
191
- switch( $what ){
192
- case 'html':
193
- if( $question ){
194
- ob_start();
195
- $question->render();
196
- $current = ob_get_clean();
197
- }
198
- }
199
- }
200
- return $current;
201
- }
202
-
203
- /**
204
- * Get mark of a quiz for an user
205
- *
206
- * @param $quiz_id
207
- *
208
- * @return int
209
- */
210
- function get_quiz_mark( $quiz_id ){
211
- $quiz_questions = get_post_meta( $quiz_id, '_lpr_quiz_questions', true );
212
- $mark = 0;
213
- if ( ! $quiz_questions ) {
214
- foreach ( $quiz_questions as $question ) {
215
- $correct_answer = get_post_meta( $question, '_lpr_question_correct_answer', true );
216
- $question_mark = get_post_meta( $question, '_lpr_question_mark', true );
217
- $student_answer = learn_press_get_question_answer( $quiz_id, $question );
218
-
219
- if ( array_key_exists( $question, $student_answer ) ) {
220
- if ( $correct_answer == $student_answer ) {
221
- $mark += $question_mark;
222
- }
223
- }
224
- }
225
- }
226
- return $mark;
227
- }
228
-
229
- function finish_quiz( $quiz_id ) {
230
- $quiz = LP_Quiz::get_quiz( $quiz_id );
231
- if( ! $quiz ){
232
- return;
233
- }
234
- $user_id = $this->id;
235
- $time = current_time( 'timestamp' );
236
- $quiz_start = get_user_meta( $user_id, '_lpr_quiz_start_time', true );
237
- $quiz_completed = get_user_meta( $user_id, '_lpr_quiz_completed', true );
238
- $quiz_duration = absint( get_post_meta( $quiz_id, '_lpr_duration', true ) ) * 60;
239
-
240
- if( $time - $quiz_start[ $quiz_id ] > $quiz_duration ){
241
- $time = $quiz_start[ $quiz_id ] - $quiz_duration;
242
- }
243
-
244
- $quiz_completed[ $quiz_id ] = $time;
245
-
246
- update_user_meta( $user_id, '_lpr_quiz_completed', $quiz_completed );
247
- $course_id = learn_press_get_course_by_quiz( $quiz_id );
248
- if( ! learn_press_user_has_finished_course( $course_id ) ) {
249
- if( learn_press_user_has_completed_all_parts( $course_id, $user_id ) ){
250
- learn_press_finish_course($course_id, $user_id);
251
- }
252
- }
253
-
254
- do_action( 'learn_press_finish_quiz', $quiz_id, $user_id );
255
-
256
- }
257
-
258
- function retake_quiz() {
259
-
260
- }
261
-
262
- /**
263
- * Get quiz status for the user
264
- *
265
- * @param null $quiz_id
266
- *
267
- * @return mixed
268
- */
269
- function get_quiz_status( $quiz_id = null ) {
270
- if ( !$quiz_id ) $quiz_id = $this->get_quiz_field( 'id' );
271
-
272
- $status = '';
273
- if ( learn_press_user_has_started_quiz( $this->id, $quiz_id ) ) {
274
- $status = 'started';
275
- }
276
-
277
- if ( learn_press_user_has_completed_quiz( $this->id, $quiz_id ) ) {
278
- $status = 'completed';
279
- }
280
- return apply_filters( 'learn_press_user_quiz_status', $status, $this, $quiz_id );
281
- }
282
-
283
- function save_quiz_question( $question_id, $answer ){
284
-
285
- }
286
-
287
- /**
288
- * Detect the type of user
289
- *
290
- * @param $type
291
- *
292
- * @return bool
293
- */
294
- function is( $type ) {
295
- $name = preg_replace( '!LP_User(_?)!', '', get_class( $this ) );
296
- return strtolower( $name ) == strtolower( $type );
297
- }
298
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/abstracts/abstract-lpr-question-type.php DELETED
@@ -1,577 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Base class for type of question
5
- *
6
- * @author TuNN
7
- * @created 27 Mar 2015
8
- * @since Beta
9
- */
10
- class LPR_Question_Type {
11
- /**
12
- * @var array
13
- */
14
- protected $instances = array();
15
-
16
- /**
17
- * @var null
18
- */
19
- protected $options = null;
20
-
21
- /**
22
- * @var int
23
- */
24
- public $id = 0;
25
-
26
- /**
27
- * @var null
28
- */
29
- public $post = null;
30
-
31
- /**
32
- * @param null $the_question
33
- * @param null $options
34
- */
35
- function __construct( $the_question = null, $options = null ) {
36
- if ( is_numeric( $the_question ) ) {
37
- $this->id = absint( $the_question );
38
- $this->post = get_post( $this->id );
39
- } elseif ( $the_question instanceof LP_Question ) {
40
- $this->id = absint( $the_question->id );
41
- $this->post = $the_question->post;
42
- } elseif ( isset( $the_question->ID ) ) {
43
- $this->id = absint( $the_question->ID );
44
- $this->post = $the_question;
45
- }
46
-
47
- $this->_options = $options;
48
- if ( is_admin() ) {
49
- add_action( 'admin_print_scripts', array( $this, 'admin_script' ) );
50
- add_action( 'admin_enqueue_styles', array( $this, 'admin_style' ) );
51
-
52
- } else {
53
- add_action( 'wp_enqueue_scripts', array( $this, 'wp_script' ) );
54
- add_action( 'wp_enqueue_styles', array( $this, 'wp_style' ) );
55
-
56
- }
57
-
58
- $this->options = (array) $options;
59
-
60
- $this->_parse();
61
- //print_r($this);
62
- }
63
-
64
- function __get( $key ){
65
- $return = null;
66
- if( strtolower( $key ) == 'id' ){
67
- $key = 'id';
68
- }
69
- if( property_exists( $this, $key ) ){
70
- $return = $this->{$key};
71
- }else {
72
- switch ( $key ) {
73
- case 'answers':
74
- $question_meta = (array)get_post_meta( $this->id, '_lpr_question', true );
75
- $return = !empty( $question_meta['answer'] ) ? $question_meta['answer'] : '';
76
- break;
77
- }
78
- }
79
- return $return;
80
- }
81
-
82
- function submit_answer( $quiz_id, $answer ) {
83
- print_r( $_POST );
84
- die();
85
- }
86
-
87
- /**
88
- * Parse the content of the post if the ID is passed to $options
89
- * or try to find $post if it set
90
- */
91
- private function _parse() {
92
- $this->options = array_merge( $this->options, (array) get_post_meta( $this->ID, '_lpr_question', true ) );
93
- }
94
-
95
- function admin_script() {
96
- global $wp_query, $post, $post_type;
97
- if ( !in_array( $post_type, array( 'lpr_question', 'lpr_quiz', 'lpr_lesson' ) ) ) return;
98
- if ( empty( $post->ID ) || $wp_query->is_archive ) return;
99
-
100
- }
101
-
102
- function admin_style() {
103
-
104
- }
105
-
106
- function wp_script() {
107
-
108
- }
109
-
110
- function wp_style() {
111
-
112
- }
113
-
114
- /**
115
- * Prints the header of a question in admin mode
116
- * should call this function before in the top of admin_interface in extends class
117
- *
118
- * @param array $args
119
- *
120
- * @reutrn void
121
- */
122
- function admin_interface_head( $args = array() ) {
123
- $post_id = $this->get( 'ID' );
124
- settype( $args, 'array' );
125
- $is_collapse = array_key_exists( 'toggle', $args ) && !$args['toggle'];
126
-
127
- $questions = learn_press_get_question_types();
128
- ?>
129
- <div class="lpr-question lpr-question-<?php echo preg_replace( '!_!', '-', $this->get_type() ); ?>" data-type="<?php echo preg_replace( '!_!', '-', $this->get_type() ); ?>" data-id="<?php echo $this->get( 'ID' ); ?>" id="learn-press-question-<?php echo $this->id;?>">
130
- <div class="lpr-question-head">
131
- <p>
132
- <a href="<?php echo get_edit_post_link( $post_id ); ?>"><?php _e( 'Edit', 'learn_press' ); ?></a>
133
- <a href="" data-action="remove"><?php _e( 'Remove', 'learn_press' ); ?></a>
134
- <a href="" data-action="expand" class="<?php echo !$is_collapse ? "hide-if-js" : ""; ?>"><?php _e( 'Expand', 'learn_press' ); ?></a>
135
- <a href="" data-action="collapse" class="<?php echo $is_collapse ? "hide-if-js" : ""; ?>"><?php _e( 'Collapse', 'learn_press' ); ?></a>
136
- </p>
137
- <!--<select name="lpr_question[<?php echo $post_id; ?>][type]" data-type="<?php echo $this->get_type(); ?>">
138
- <?php if ( $questions ) foreach ( $questions as $type ): ?>
139
- <?php $question = LPR_Question_Factory::instance()->get_question( $type ); ?>
140
- <?php if ( $question ) { ?>
141
- <option value="<?php echo $type; ?>" <?php selected( $this->get_type() == $type ? 1 : 0, 1 ); ?>>
142
- <?php echo $question->get_name(); ?>
143
- </option>
144
- <?php } ?>
145
- <?php endforeach; ?>
146
- </select>-->
147
- <span class="lpr-question-title"><input class="inactive" type="text" name="lpr_question[<?php echo $this->get( 'ID' ); ?>][text]" value="<?php echo esc_attr( $this->post->post_title ); ?>" /></span>
148
- </div>
149
- <div class="lpr-question-content<?php echo $is_collapse ? " hide-if-js" : ""; ?>">
150
- <?php //do_action( 'learn_press_admin_before_question_answer', $this );
151
- ?>
152
- <p class="lpr-question-option-label"><?php _e( 'Answer', 'learn_press' ); ?></p>
153
- <?php
154
- }
155
-
156
- /**
157
- * Prints the header of a question in admin mode
158
- * should call this function before in the bottom of admin_interface in extends class
159
- *
160
- * @param array $args
161
- *
162
- * @return void
163
- */
164
- function admin_interface_foot( $args = array() ) {
165
- settype( $args, 'array' );
166
- $is_collapse = array_key_exists( 'toggle', $args ) && !$args['toggle'];
167
- //print_r($args);
168
- $question_types = LPR_Question_Factory::get_types();
169
- $question_meta = (array) get_post_meta( $this->id, '_lpr_question', true );
170
- $question_type = LPR_Question_Factory::instance()->get_question_type( $question_meta );
171
- ?>
172
- <p class="lpr-change-question-type">
173
- <span><?php _e( 'Change type of this question to', 'learn_press' );?></span>
174
- <select class="lpr-question-types" name="lpr_question[type]" id="lpr_question-type" data-type="<?php echo $question_type; ?>">
175
- <option value=""><?php _e( '--Select type--', 'learn_press' ); ?></option>
176
- <?php if ( $question_types ): foreach ( $question_types as $type ): ?>
177
- <option value="<?php echo $type; ?>" <?php selected( $type == $question_type ); ?>><?php echo learn_press_question_slug_to_title( $type );?></option>
178
- <?php endforeach; endif; ?>
179
- </select>
180
- </p>
181
- <input class="lpr-question-toggle" type="hidden" name="lpr_question[<?php echo $this->get( 'ID' ); ?>][toggle]" value="<?php echo $is_collapse ? 0 : 1; ?>" />
182
- </div>
183
- </div>
184
- <?php
185
- }
186
-
187
- /**
188
- * Prints the content of a question in admin mode
189
- * This function should be overridden from extends class
190
- *
191
- * @param array $args
192
- *
193
- * @return void
194
- */
195
- function admin_interface( $args = array() ) {
196
- printf( __( 'Function %s should override from its child', 'learn_press' ), __FUNCTION__ );
197
- }
198
-
199
- /**
200
- * Prints the question in frontend user
201
- *
202
- * @param unknown
203
- *
204
- * @return void
205
- */
206
- function render() {
207
- printf( __( 'Function %s should override from its child', 'learn_press' ), __FUNCTION__ );
208
- }
209
-
210
- function get_type( $slug = false ) {
211
- $type = strtolower( preg_replace( '!LPR_Question_Type_!', '', get_class( $this ) ) );
212
- if ( $slug ) $type = preg_replace( '!_!', '-', $type );
213
- return $type;
214
- }
215
-
216
- function get_name() {
217
- return
218
- isset( $this->options['name'] ) ? $this->options['name'] : ucfirst( preg_replace_callback( '!_([a-z])!', create_function( '$matches', 'return " " . strtoupper($matches[1]);' ), $this->get_type() ) );
219
- }
220
-
221
- protected function _get_option_value( $value = null ) {
222
- if ( !$value ) {
223
- $value = $this->id . uniqid();
224
- }
225
- return $value;
226
- }
227
-
228
- /**
229
- * Sets the value for a variable of this class
230
- *
231
- * @param $key string The name of a variable of this class
232
- * @param $value any The value to set
233
- *
234
- * @return void
235
- */
236
- function set( $key, $value ) {
237
- $this->$key = $value;
238
- }
239
-
240
- /**
241
- * Gets the value of a variable of this class with multiple level of an object or array
242
- * example: $obj->get('a.b') -> like this :
243
- * - $obj->a->b
244
- * - or $obj->a['b']
245
- *
246
- * @param null $key string Single or multiple level such as a.b.c
247
- * @param null $default mixed Return a default value if the key does not exists or is empty
248
- * @param null $func string The function to apply the result before return
249
- *
250
- * @return mixed|null
251
- */
252
- function get( $key = null, $default = null, $func = null ) {
253
- if( is_string( $key ) && strpos( $key, '.' ) === false ){
254
- return $this->{$key};
255
- }
256
- $val = $this->_get( $this, $key, $default );
257
- return is_callable( $func ) ? call_user_func_array( $func, array( $val ) ) : $val;
258
- }
259
-
260
-
261
- protected function _get( $prop, $key, $default = null, $type = null ) {
262
- $return = $default;
263
-
264
- if ( $key === false || $key == null ) {
265
- return $return;
266
- }
267
- $deep = explode( '.', $key );
268
-
269
- if ( is_array( $prop ) ) {
270
- if ( isset( $prop[$deep[0]] ) ) {
271
- $return = $prop[$deep[0]];
272
- if ( count( $deep ) > 1 ) {
273
- unset( $deep[0] );
274
- $return = $this->_get( $return, implode( '.', $deep ), $default, $type );
275
- }
276
- }
277
- } elseif ( is_object( $prop ) ) {
278
- if ( isset( $prop->{$deep[0]} ) ) {
279
- $return = $prop->{$deep[0]};
280
- if ( count( $deep ) > 1 ) {
281
- unset( $deep[0] );
282
- $return = $this->_get( $return, implode( '.', $deep ), $default, $type );
283
- }
284
- }
285
- }
286
-
287
-
288
- if ( $type == 'object' ) settype( $return, 'object' );
289
- elseif ( $type == 'array' ) settype( $return, 'array' );
290
-
291
- // return;
292
- return $return;
293
- }
294
-
295
- /**
296
- * Save question data on POST action
297
- */
298
- function save_post_action() {
299
- }
300
-
301
- /**
302
- * Store question data
303
- */
304
- function store() {
305
- $post_id = $this->get( 'ID' );
306
- $is_new = false;
307
- if ( $post_id ) {
308
- $post_id = wp_update_post(
309
- array(
310
- 'ID' => $post_id,
311
- 'post_title' => $this->get( 'post_title' ),
312
- 'post_type' => 'lpr_question',
313
- 'post_status' => 'publish'
314
-
315
- )
316
- );
317
- } else {
318
- $post_id = wp_insert_post(
319
- array(
320
- 'post_title' => $this->get( 'post_title' ),
321
- 'post_type' => 'lpr_question',
322
- 'post_status' => 'publish'
323
- )
324
- );
325
- $is_new = true;
326
- }
327
- if ( $post_id ) {
328
- $options = $this->get( 'options' );
329
- $options['type'] = $this->get_type();
330
-
331
- $this->set( 'options', $options );
332
-
333
- update_post_meta( $post_id, '_lpr_question', $this->get( 'options' ) );
334
-
335
- // update default mark
336
- if ( $is_new ) update_post_meta( $post_id, '_lpr_question_mark', 1 );
337
-
338
- $this->ID = $post_id;
339
- }
340
- return $post_id;
341
- }
342
-
343
- /**
344
- * Gets an instance of a question by type or ID
345
- * If the first param is a string ( type of question such as true_or_false ) then return the instance of class LPR_Question_Type_True_Or_False
346
- * If the first param is a number ( ID of the post ) then find a post in the database with the type store in meta_key to return class corresponding
347
- *
348
- * @param null $id_or_type Type or ID of an question in database
349
- * @param null $options
350
- *
351
- * @return bool
352
- */
353
- static function instance( $id_or_type = null, $options = null ) {
354
- $type = $id_or_type;
355
- if ( is_numeric( $id_or_type ) ) {
356
- $question = get_post( $id_or_type );
357
- if ( $question ) {
358
- $meta = (array) get_post_meta( $id_or_type, '_lpr_question', true );
359
- if ( isset( $meta['type'] ) ) {
360
- $type = $meta['type'];
361
- $options = array_merge( (array) $options, array( 'ID' => $id_or_type ) );
362
- }
363
- //print_r($meta);
364
- }
365
- } else {
366
-
367
- }
368
- $class_name = 'LPR_Question_Type_' . ucfirst( preg_replace_callback( '!(_[a-z])!', create_function( '$matches', 'return strtolower($matches[1]);' ), $type ) );
369
- $class_instance = false;
370
-
371
- if ( !class_exists( $class_name ) ) {
372
- $paths = array(
373
- LPR_PLUGIN_PATH . '/inc/question-type'
374
- );
375
- $paths = apply_filters( 'lpr_question_type_path', $paths );
376
- if ( $paths ) foreach ( $paths as $path ) {
377
- if ( is_file( $path ) ) {
378
- $file = $path;
379
- } else {
380
- $file = $path . '/class.lpr-question-type-' . preg_replace( '!_!', '-', $type ) . '.php';
381
- }
382
- if ( file_exists( $file ) ) {
383
- require_once( $file );
384
- }
385
- }
386
- }
387
- if ( class_exists( $class_name ) ) {
388
- $class_instance = new $class_name( $id_or_type, $options );
389
- } else {
390
- $class_instance = new LPR_Question_Type_None();
391
- }
392
- return $class_instance;
393
- }
394
-
395
- function check( $args = null ) {
396
- $return = array(
397
- 'correct' => false,
398
- 'mark' => 0
399
- );
400
- return $return;
401
- }
402
- }
403
-
404
- function learn_press_get_question_types() {
405
- /*_deprecated_function( __FUNCTION__, '0.9.20', 'LPR_Question_Factory::get_types()' );*/
406
- return LPR_Question_Factory::get_types();
407
- }
408
-
409
- /**
410
- *
411
- * @param $type
412
- * @param array $options
413
- *
414
- * @return bool
415
- */
416
- function learn_press_get_question( $type, $options = array() ) {
417
- return LPR_Question_Factory::instance()->get_question( $type, $options );
418
- }
419
-
420
- /**
421
- * Because metabox is rendered after the enqueue scripts/styles function
422
- * so we must load all type of questions and call admin_script to
423
- * enqueue scripts/styles in admin_enqueue_scripts action
424
- */
425
- function learn_press_question_scripts() {
426
- if ( !in_array( get_post_type(), array( 'lpr_question', 'lpr_quiz' ) ) ) return;
427
- $question_types = learn_press_get_question_types();
428
- if ( $question_types ) foreach ( $question_types as $type ) {
429
- $ques = learn_press_get_question( $type );
430
- if ( $ques ) {
431
- is_admin() ? $ques->admin_script() : '';
432
- }
433
- }
434
- }
435
-
436
- add_action( 'admin_enqueue_scripts', 'learn_press_question_scripts' );
437
- add_action( 'wp_enqueue_scripts', 'learn_press_question_scripts' );
438
-
439
- function learn_press_submit_answer() {
440
-
441
- /*_deprecated_function( 'learn_press_submit_answer', '0.9.15', false );*/
442
-
443
- $quiz_id = !empty( $_REQUEST['quiz_id'] ) ? intval( $_REQUEST['quiz_id'] ) : 0;
444
- $question_id = !empty( $_REQUEST['question_id'] ) ? intval( $_REQUEST['question_id'] ) : 0;
445
- $next_id = !empty( $_REQUEST['next_id'] ) ? intval( $_REQUEST['next_id'] ) : learn_press_get_next_question( $quiz_id, $question_id );
446
- $question_answer = isset( $_REQUEST['question_answer'] ) ? $_REQUEST['question_answer'] : null;
447
- $finish = isset( $_REQUEST['finish'] ) ? $_REQUEST['finish'] : null;
448
-
449
- $user_id = get_current_user_id();
450
- $json = array();
451
-
452
- $ques = learn_press_get_question( $question_id );
453
- if ( $ques ) {
454
- $ques->submit_answer( $quiz_id, $question_answer );
455
- }
456
- ob_start();
457
- if ( $next_id ) {
458
- do_action( 'learn_press_submit_answer', $question_answer, $question_id, $quiz_id, $user_id, false );
459
- learn_press_get_template( 'quiz/form-question.php', array( 'question_id' => $next_id, 'course_id' => learn_press_get_course_by_quiz( $quiz_id ) ) );
460
- } else {
461
- $question_ids = learn_press_get_user_quiz_questions( $quiz_id, $user_id );
462
- $quiz_completed = get_user_meta( $user_id, '_lpr_quiz_completed', true );
463
- $quiz_completed[$quiz_id] = current_time( 'timestamp' );
464
- update_user_meta( $user_id, '_lpr_quiz_completed', $quiz_completed );
465
- $course_id = learn_press_get_course_by_quiz( $quiz_id );
466
- if ( !learn_press_user_has_finished_course( $course_id ) ) {
467
- if ( learn_press_user_has_completed_all_parts( $course_id, $user_id ) ) {
468
- learn_press_finish_course( $course_id, $user_id );
469
- }
470
- }
471
- learn_press_get_template( 'quiz/result.php' );
472
- $json['quiz_completed'] = true;
473
- do_action( 'learn_press_submit_answer', $question_answer, $question_id, $quiz_id, $user_id, true );
474
- }
475
- $output = ob_get_clean();
476
- if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
477
- $json['html'] = $output;
478
- $json['redirect'] = apply_filters( 'learn_press_submit_answer_redirect_url', get_the_permalink( $quiz_id ), $question_answer, $question_id, $quiz_id, $user_id );
479
- learn_press_send_json( $json );
480
- }
481
- }
482
-
483
- add_action( 'wp_ajax_learn_press_submit_answer', 'learn_press_submit_answer' );
484
- add_action( 'wp_ajax_nopriv_learn_press_submit_answer', 'learn_press_submit_answer' );
485
-
486
- add_action( 'learn_press_frontend_action_submit_answer', 'learn_press_submit_answer' );
487
-
488
- function learn_press_load_question() {
489
- $question_id = !empty( $_REQUEST['question_id'] ) ? intval( $_REQUEST['question_id'] ) : 0;
490
- $quiz_id = !empty( $_REQUEST['quiz_id'] ) ? intval( $_REQUEST['quiz_id'] ) : 0;
491
- /*$ques = learn_press_get_question( $question_id );
492
- if( $ques ){
493
- $quiz_answers = learn_press_get_question_answers(null, $quiz_id );
494
- $ques->render( array(
495
- 'answer' => isset( $quiz_answers[$question_id] ) ? $quiz_answers[$question_id] : null
496
- ));
497
- }*/
498
- learn_press_get_template( 'quiz/form-question.php', array( 'question_id' => $question_id, 'course_id' => learn_press_get_course_by_quiz( $quiz_id ) ) );
499
-
500
- die();
501
- }
502
-
503
- add_action( 'wp_ajax_learn_press_load_question', 'learn_press_load_question' );
504
- add_action( 'wp_ajax_nopriv_learn_press_load_question', 'learn_press_load_question' );
505
-
506
- function learn_press_show_answer() {
507
-
508
- $user_id = learn_press_get_current_user_id();
509
- $quiz_id = !empty( $_REQUEST['quiz_id'] ) ? intval( $_REQUEST['quiz_id'] ) : 0;
510
- $question_id = !empty( $_REQUEST['question_id'] ) ? intval( $_REQUEST['question_id'] ) : 0;
511
- $question_answer = isset( $_REQUEST['question_answer'] ) ? $_REQUEST['question_answer'] : null;
512
- $ques = learn_press_get_question( $question_id );
513
-
514
- if ( $ques ) {
515
- $ques->submit_answer( $quiz_id, $question_answer );
516
- }
517
-
518
- $json = array(
519
- 'html' => learn_press_get_question_hint( $quiz_id, $question_id, $user_id )
520
- );
521
-
522
- learn_press_send_json( $json );
523
- }
524
-
525
- add_action( 'wp_ajax_learn_press_show_answer', 'learn_press_show_answer' );
526
- add_action( 'wp_ajax_nopriv_learn_press_show_answer', 'learn_press_show_answer' );
527
-
528
- function learn_press_load_quiz_question_result_for_hint( $content, $answer, $question ){
529
- /*$result = array(
530
- 'result' => 'success',
531
- 'content' => $content,
532
- 'permalink' => learn_press_get_user_question_url( $quiz_id, $question_id )
533
- );*/
534
- $user_id = learn_press_get_current_user_id();
535
- $quiz_id = null;
536
- if( learn_press_user_has_checked_answer( $question->get( 'ID' ), $user_id, $quiz_id ) ){
537
- $content = learn_press_get_question_hint( $quiz_id, $question->get( 'ID' ), $user_id );
538
- }
539
-
540
- return $content;
541
- }
542
- add_filter( 'learn_press_question_content', 'learn_press_load_quiz_question_result_for_hint', 10, 3 );
543
-
544
- function learn_press_load_quiz_question_result( $result, $question_id, $quiz_id ) {
545
- $user_id = get_current_user_id();
546
- $quizzes = (array) get_user_meta( $user_id, '_lpr_quiz_question_hint', true );
547
- if ( isset( $quizzes[$quiz_id] ) && isset( $quizzes[$quiz_id][$question_id] ) ) {
548
- $result['hint'] = 1;
549
- }
550
- return $result;
551
- }
552
-
553
- add_filter( 'learn_press_load_quiz_question_result', 'learn_press_load_quiz_question_result', 10, 3 );
554
-
555
- function learn_press_before_submit_user_answer( $question_answer, $user_id, $question_id, $quiz_id ) {
556
- if ( learn_press_user_is_used_hint( $user_id, $question_id, $quiz_id ) ) {
557
- $quizzes = (array) get_user_meta( $user_id, '_lpr_quiz_question_answer', true );
558
- if ( isset( $quizzes[$quiz_id] ) && isset( $quizzes[$quiz_id][$question_id] ) ) {
559
- $question_answer = $quizzes[$quiz_id][$question_id];
560
- }
561
- }
562
- return $question_answer;
563
- }
564
-
565
- add_filter( 'learn_press_submit_user_answer', 'learn_press_before_submit_user_answer', 10, 4 );
566
-
567
- function learn_press_single_quiz_params( $params, $quiz_id, $user_id = null ) {
568
- $quizzes = (array) get_user_meta( $user_id, '_lpr_quiz_question_hint', true );
569
- if ( isset( $quizzes[$quiz_id] ) ) {
570
- $params['hint'] = array_keys( $quizzes[$quiz_id] );
571
- } else {
572
- $params['hint'] = array();
573
- }
574
- return $params;
575
- }
576
-
577
- add_filter( 'learn_press_single_quiz_params', 'learn_press_single_quiz_params', 10, 3 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/admin/class-lp-admin-ajax.php ADDED
@@ -0,0 +1,963 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( !defined( 'ABSPATH' ) ) {
4
+ exit; // Exit if accessed directly
5
+ }
6
+ if ( !class_exists( 'LP_Admin_Ajax' ) ) {
7
+
8
+ /**
9
+ * Class LP_Admin_Ajax
10
+ */
11
+ class LP_Admin_Ajax {
12
+ /**
13
+ * Add action ajax
14
+ */
15
+ public static function init() {
16
+ $ajaxEvents = array(
17
+ 'create_page' => false,
18
+ 'add_quiz_question' => false,
19
+ 'convert_question_type' => false,
20
+ 'update_quiz_question_state' => false,
21
+ 'update_editor_hidden' => false,
22
+ 'update_curriculum_section_state' => false,
23
+ 'quick_add_item' => false,
24
+ 'add_new_item' => false,
25
+ 'toggle_lesson_preview' => false,
26
+ 'remove_course_items' => false,
27
+ 'search_courses' => false,
28
+ 'add_item_to_order' => false,
29
+ 'remove_order_item' => false,
30
+ 'plugin_action' => false,
31
+ 'search_questions' => false,
32
+ 'remove_quiz_question' => false,
33
+ 'modal_search_items' => false,
34
+ 'add_item_to_section' => false,
35
+ 'remove_course_section' => false,
36
+ 'dismiss_notice' => false,
37
+ 'search_users' => false,
38
+ 'load_chart' => false,
39
+ /////////////
40
+ 'quick_add_lesson' => false,
41
+ 'quick_add_quiz' => false,
42
+ 'be_teacher' => false,
43
+ 'custom_stats' => false,
44
+ 'ignore_setting_up' => false,
45
+ 'get_page_permalink' => false,
46
+ 'dummy_image' => false,
47
+ 'update_add_on_status' => false,
48
+ 'plugin_install' => false,
49
+ 'bundle_activate_add_ons' => false,
50
+ 'install_sample_data' => false
51
+ );
52
+ foreach ( $ajaxEvents as $ajaxEvent => $nopriv ) {
53
+ add_action( 'wp_ajax_learnpress_' . $ajaxEvent, array( __CLASS__, $ajaxEvent ) );
54
+ // enable for non-logged in users
55
+ if ( $nopriv ) {
56
+ add_action( 'wp_ajax_nopriv_learnpress_' . $ajaxEvent, array( __CLASS__, $ajaxEvent ) );
57
+ }
58
+ }
59
+ add_filter( 'learn_press_modal_search_items_exclude', array( __CLASS__, '_modal_search_items_exclude' ), 10, 4 );
60
+ add_filter( 'learn_press_modal_search_items_not_found', array( __CLASS__, '_modal_search_items_not_found' ), 10, 2 );
61
+ do_action( 'learn_press_admin_ajax_load', __CLASS__ );
62
+ }
63
+
64
+ public static function load_chart() {
65
+ if ( !class_exists( '' ) ) {
66
+ require_once LP_PLUGIN_PATH . '/inc/admin/sub-menus/statistics.php';
67
+ }
68
+ LP_Admin_Submenu_Statistic::instance()->load_chart();
69
+ }
70
+
71
+ public static function remove_course_items() {
72
+ $id = learn_press_get_request( 'id' );
73
+ if ( $id ) {
74
+ global $wpdb;
75
+ $in_clause = array_fill( 0, sizeof( $id ), '%d' );
76
+ $in_clause = "IN(" . join( ",", $in_clause ) . ")";
77
+ echo $wpdb->prepare( "
78
+ DELETE FROM {$wpdb->prefix}learnpress_section_items
79
+ WHERE section_item_id $in_clause
80
+ ", $id );
81
+ $wpdb->query(
82
+ $wpdb->prepare( "
83
+ DELETE FROM {$wpdb->prefix}learnpress_section_items
84
+ WHERE section_item_id $in_clause
85
+ ", $id )
86
+ );
87
+ }
88
+ die();
89
+ }
90
+
91
+ public static function search_users() {
92
+ if ( !current_user_can( 'edit_lp_orders' ) ) {
93
+ die( - 1 );
94
+ }
95
+
96
+ $term = stripslashes( $_GET['term'] );
97
+
98
+ if ( empty( $term ) ) {
99
+ die();
100
+ }
101
+
102
+ $found_customers = array();
103
+
104
+ add_action( 'pre_user_query', array( __CLASS__, 'json_search_customer_name' ) );
105
+
106
+ $customers_query = new WP_User_Query( apply_filters( 'learn_press_search_customers_query', array(
107
+ 'fields' => 'all',
108
+ 'orderby' => 'display_name',
109
+ 'search' => '*' . $term . '*',
110
+ 'search_columns' => array( 'ID', 'user_login', 'user_email', 'user_nicename' )
111
+ ) ) );
112
+
113
+ remove_action( 'pre_user_query', array( __CLASS__, 'json_search_customer_name' ) );
114
+
115
+ $customers = $customers_query->get_results();
116
+
117
+ if ( !empty( $customers ) ) {
118
+ foreach ( $customers as $customer ) {
119
+ $found_customers[] = array(
120
+ 'label' => $customer->display_name . ' (#' . $customer->ID . ' &ndash; ' . sanitize_email( $customer->user_email ) . ')',
121
+ 'value' => $customer->ID
122
+ );
123
+ }
124
+ }
125
+
126
+ echo json_encode( $found_customers );
127
+ die();
128
+ }
129
+
130
+ public static function json_search_customer_name( $query ) {
131
+ global $wpdb;
132
+
133
+ $term = wc_clean( stripslashes( $_GET['term'] ) );
134
+ if ( method_exists( $wpdb, 'esc_like' ) ) {
135
+ $term = $wpdb->esc_like( $term );
136
+ } else {
137
+ $term = like_escape( $term );
138
+ }
139
+
140
+ $query->query_from .= " INNER JOIN {$wpdb->usermeta} AS user_name ON {$wpdb->users}.ID = user_name.user_id AND ( user_name.meta_key = 'first_name' OR user_name.meta_key = 'last_name' ) ";
141
+ $query->query_where .= $wpdb->prepare( " OR user_name.meta_value LIKE %s ", '%' . $term . '%' );
142
+ }
143
+
144
+ public static function dismiss_notice() {
145
+ $context = learn_press_get_request( 'context' );
146
+ $transient = learn_press_get_request( 'transient' );
147
+
148
+ if ( $context ) {
149
+ if ( $transient >= 0 ) {
150
+ set_transient( 'learn_press_dismiss_notice_' . $context, 'off', $transient ? $transient : DAY_IN_SECONDS * 7 );
151
+ } else {
152
+ update_option( 'learn_press_dismiss_notice_' . $context, 'off' );
153
+ }
154
+ }
155
+ die();
156
+ }
157
+
158
+ public static function _modal_search_items_not_found( $message, $type ) {
159
+ switch ( $type ) {
160
+ case 'lp_lesson':
161
+ $message = __( 'No lessons found', 'learnpress' );
162
+ break;
163
+ case 'lp_quiz':
164
+ $message = __( 'No quizzes found', 'learnpress' );
165
+ break;
166
+ case 'lp_question':
167
+ $message = __( 'No questions found', 'learnpress' );
168
+ break;
169
+ }
170
+ return $message;
171
+ }
172
+
173
+ public static function _modal_search_items_exclude( $exclude, $type, $context = '', $context_id = null ) {
174
+ global $wpdb;
175
+ $exclude2 = array();
176
+ $user = learn_press_get_current_user();
177
+ switch ( $type ) {
178
+ case 'lp_lesson':
179
+ case 'lp_quiz':
180
+ $query = $wpdb->prepare( "
181
+ SELECT item_id
182
+ FROM {$wpdb->prefix}learnpress_section_items
183
+ WHERE %d
184
+ ", 1 );
185
+ $exclude2 = $wpdb->get_col( $query );
186
+ if ( ( $context == 'course' ) && ( get_post_type( $context_id ) == 'lp_course' ) ) {
187
+ $course_author = get_post_field( 'post_author', $context_id );
188
+ }
189
+ break;
190
+ case 'lp_question':
191
+
192
+ }
193
+ if ( $exclude2 && $exclude ) {
194
+ $exclude = array_merge( $exclude, $exclude2 );
195
+ } else if ( $exclude2 ) {
196
+ $exclude = $exclude2;
197
+ }
198
+ return $exclude;
199
+ }
200
+
201
+ public static function add_item_to_section() {
202
+ global $wpdb;
203
+ $section = learn_press_get_request( 'section' );
204
+ if ( !$section ) {
205
+ wp_die( __( 'Error', 'learnpress' ) );
206
+ }
207
+ $items = (array) learn_press_get_request( 'item' );
208
+ if ( !$items ) {
209
+ $max_order = $wpdb->get_var( $wpdb->prepare( "SELECT max() FROM {$wpdb}learnpress_section_items WHERE section_id = %d", $section ) );
210
+ foreach ( $items as $item ) {
211
+
212
+ }
213
+ }
214
+ }
215
+
216
+ public static function modal_search_items() {
217
+ global $wpdb;
218
+
219
+ $user = learn_press_get_current_user();
220
+ $term = (string) ( stripslashes( learn_press_get_request( 'term' ) ) );
221
+ $type = (string) ( stripslashes( learn_press_get_request( 'type' ) ) );
222
+ $context = (string) ( stripslashes( learn_press_get_request( 'context' ) ) );
223
+ $context_id = (string) ( stripslashes( learn_press_get_request( 'context_id' ) ) );
224
+ $exclude = array();
225
+
226
+ if ( !empty( $_GET['exclude'] ) ) {
227
+ $exclude = array_map( 'intval', $_GET['exclude'] );
228
+ }
229
+ $exclude = array_unique( (array) apply_filters( 'learn_press_modal_search_items_exclude', $exclude, $type, $context, $context_id ) );
230
+ $exclude = array_map( 'intval', $exclude );
231
+ $args = array(
232
+ 'post_type' => array( $type ),
233
+ 'posts_per_page' => - 1,
234
+ 'post_status' => 'publish',
235
+ 'order' => 'ASC',
236
+ 'orderby' => 'parent title',
237
+ 'exclude' => $exclude
238
+ );
239
+ if ( !$user->is_admin() ) {
240
+ $args['author'] = $user->id;
241
+ }
242
+
243
+ if ( $context && $context_id ) {
244
+ switch ( $context ) {
245
+ /**
246
+ * If is search lesson/quiz for course only search the items of course's author
247
+ */
248
+ case 'course-items':
249
+ if ( get_post_type( $context_id ) == 'lp_course' ) {
250
+ $args['author'] = get_post_field( 'post_author', $context_id );
251
+ }
252
+ break;
253
+ /**
254
+ * If is search question for quiz only search the items of course's author
255
+ */
256
+ case 'quiz-items':
257
+ if ( get_post_type( $context_id ) == 'lp_quiz' ) {
258
+ $args['author'] = get_post_field( 'post_author', $context_id );
259
+ }
260
+ break;
261
+ }
262
+ }
263
+ if ( $term ) {
264
+ $args['s'] = $term;
265
+ }
266
+
267
+ $posts = get_posts( $args );
268
+ $found_items = array();
269
+
270
+ if ( !empty( $posts ) ) {
271
+ foreach ( $posts as $post ) {
272
+ $found_items[$post->ID] = $post;
273
+ $found_items[$post->ID]->post_title = !empty( $post->post_title ) ? $post->post_title : sprintf( '(%s)', __( 'Untitled', 'learnpress' ) );
274
+ }
275
+ }
276
+
277
+ ob_start();
278
+ if ( $found_items ) {
279
+ foreach ( $found_items as $id => $item ) {
280
+ printf( '
281
+ <li class="" data-id="%1$d" data-type="%3$s" data-text="%2$s">
282
+ <label>
283
+ <input type="checkbox" value="%1$d">
284
+ <span class="lp-item-text">%2$s</span>
285
+ </label>
286
+ </li>
287
+ ', $id, esc_attr( $item->post_title ), $item->post_type );
288
+ }
289
+ } else {
290
+ echo '<li>' . apply_filters( 'learn_press_modal_search_items_not_found', __( 'No item found', 'learnpress' ), $type ) . '</li>';
291
+ }
292
+
293
+ $response = array(
294
+ 'html' => ob_get_clean(),
295
+ 'data' => $found_items,
296
+ 'args' => $args
297
+ );
298
+ learn_press_send_json( $response );
299
+ }
300
+
301
+ public static function remove_quiz_question() {
302
+ global $wpdb;
303
+ $quiz_id = learn_press_get_request( 'quiz_id' );
304
+ $question_id = learn_press_get_request( 'question_id' );
305
+ if ( !wp_verify_nonce( learn_press_get_request( 'remove-nonce' ), 'remove_quiz_question' ) ) {
306
+ wp_die( __( 'Error', 'learnpress' ) );
307
+ }
308
+ $query = $wpdb->prepare( "
309
+ DELETE FROM {$wpdb->prefix}learnpress_quiz_questions
310
+ WHERE quiz_id = %d
311
+ AND question_id = %d
312
+ ", $quiz_id, $question_id );
313
+ $wpdb->query( $query );
314
+ die();
315
+ }
316
+
317
+ public static function search_questions() {
318
+ global $wpdb;
319
+
320
+ $quiz_id = learn_press_get_request( 'quiz_id' );
321
+ $user = learn_press_get_current_user();
322
+ if ( !$user->is_admin() && get_post_field( 'post_author', $quiz_id ) != get_current_user_id() ) {
323
+ wp_die( __( 'You have not permission to access this section', 'learnpress' ) );
324
+ }
325
+ $term = (string) ( stripslashes( learn_press_get_request( 'term' ) ) );
326
+ $exclude = array();
327
+
328
+ if ( !empty( $_GET['exclude'] ) ) {
329
+ $exclude = array_map( 'intval', $_GET['exclude'] );
330
+ }
331
+
332
+ $added = $wpdb->get_col(
333
+ $wpdb->prepare( "
334
+ SELECT question_id
335
+ FROM {$wpdb->prefix}learnpress_quiz_questions
336
+ WHERE %d
337
+ ", 1 )
338
+ );
339
+ if ( $added ) {
340
+ $exclude = array_merge( $exclude, $added );
341
+ $exclude = array_unique( $exclude );
342
+ }
343
+
344
+ $args = array(
345
+ 'post_type' => array( 'lp_question' ),
346
+ 'posts_per_page' => - 1,
347
+ 'post_status' => 'publish',
348
+ 'order' => 'ASC',
349
+ 'orderby' => 'parent title',
350
+ 'exclude' => $exclude
351
+ );
352
+ if ( !$user->is_admin() ) {
353
+ $args['author'] = $user->id;
354
+ }
355
+ if ( $term ) {
356
+ $args['s'] = $term;
357
+ }
358
+ $posts = get_posts( $args );
359
+ $found_questions = array();
360
+
361
+ if ( !empty( $posts ) ) {
362
+ foreach ( $posts as $post ) {
363
+ $found_questions[$post->ID] = !empty( $post->post_title ) ? $post->post_title : sprintf( '(%s)', __( 'Untitled', 'learnpress' ) );
364
+ }
365
+ }
366
+
367
+ ob_start();
368
+ if ( $found_questions ) {
369
+ foreach ( $found_questions as $id => $question ) {
370
+ printf( '
371
+ <li class="" data-id="%1$d" data-type="" data-text="%2$s">
372
+ <label>
373
+ <input type="checkbox" value="%1$d">
374
+ <span class="lp-item-text">%2$s</span>
375
+ </label>
376
+ </li>
377
+ ', $id, $question );
378
+ }
379
+ } else {
380
+ echo '<li>' . __( 'No question found', 'learnpress' ) . '</li>';
381
+ }
382
+
383
+ $response = array(
384
+ 'html' => ob_get_clean(),
385
+ 'data' => $found_questions,
386
+ 'args' => $args
387
+ );
388
+ learn_press_send_json( $response );
389
+ }
390
+
391
+ public static function plugin_action() {
392
+ $url = learn_press_get_request( 'url' );
393
+ ob_start();
394
+ wp_remote_get( $url );
395
+ ob_get_clean();
396
+ echo wp_remote_get( admin_url( 'admin.php?page=learn_press_add_ons&tab=installed' ) );
397
+ die();
398
+ }
399
+
400
+ /**
401
+ * Remove an item from order
402
+ */
403
+ public static function remove_order_item() {
404
+ // ensure that user has permission
405
+ if ( !current_user_can( 'edit_lp_orders' ) ) {
406
+ die( __( 'Permission denied', 'learnpress' ) );
407
+ }
408
+
409
+ // verify nonce
410
+ $nonce = learn_press_get_request( 'remove_nonce' );
411
+ if ( !wp_verify_nonce( $nonce, 'remove_order_item' ) ) {
412
+ die( __( 'Check nonce failed', 'learnpress' ) );
413
+ }
414
+
415
+ // validate order
416
+ $order_id = learn_press_get_request( 'order_id' );
417
+ if ( !is_numeric( $order_id ) || get_post_type( $order_id ) != 'lp_order' ) {
418
+ die( __( 'Order invalid', 'learnpress' ) );
419
+ }
420
+
421
+ // validate item
422
+ $item_id = learn_press_get_request( 'item_id' );
423
+ $post = get_post( learn_press_get_order_item_meta( $item_id, '_course_id' ) );
424
+ if ( !$post || ( 'lp_course' !== $post->post_type ) ) {
425
+ die( __( 'Course invalid', 'learnpress' ) );
426
+ }
427
+
428
+ learn_press_remove_order_item( $item_id );
429
+
430
+ $order_data = learn_press_update_order_items( $order_id );
431
+ $currency_symbol = learn_press_get_currency_symbol( $order_data['currency'] );
432
+ $order_data['subtotal_html'] = learn_press_format_price( $order_data['subtotal'], $currency_symbol );
433
+ $order_data['total_html'] = learn_press_format_price( $order_data['total'], $currency_symbol );
434
+
435
+
436
+ learn_press_send_json(
437
+ array(
438
+ 'result' => 'success',
439
+ 'order_data' => $order_data
440
+ )
441
+ );
442
+ }
443
+
444
+ /**
445
+ * Add new course to order
446
+ */
447
+ public static function add_item_to_order() {
448
+
449
+ // ensure that user has permission
450
+ if ( !current_user_can( 'edit_lp_orders' ) ) {
451
+ die( __( 'Permission denied', 'learnpress' ) );
452
+ }
453
+
454
+ // verify nonce
455
+ $nonce = learn_press_get_request( 'nonce' );
456
+ if ( !wp_verify_nonce( $nonce, 'add_item_to_order' ) ) {
457
+ die( __( 'Check nonce failed', 'learnpress' ) );
458
+ }
459
+
460
+ // validate order
461
+ $order_id = learn_press_get_request( 'order_id' );
462
+ if ( !is_numeric( $order_id ) || get_post_type( $order_id ) != 'lp_order' ) {
463
+ die( __( 'Order invalid', 'learnpress' ) );
464
+ }
465
+
466
+ // validate item
467
+ $item_id = learn_press_get_request( 'item_id' );
468
+ $post = get_post( $item_id );
469
+ if ( !$post || ( 'lp_course' !== $post->post_type ) ) {
470
+ die( __( 'Course invalid', 'learnpress' ) );
471
+ }
472
+
473
+
474
+ $course = learn_press_get_course( $post->ID );
475
+ $order = learn_press_get_order( $order_id );
476
+
477
+ $item = array(
478
+ 'course_id' => $course->id,
479
+ 'name' => $course->get_title(),
480
+ 'quantity' => 1,
481
+ 'subtotal' => $course->get_price(),
482
+ 'total' => $course->get_price()
483
+ );
484
+
485
+ // Add item
486
+ $item_id = learn_press_add_order_item( $order_id, array(
487
+ 'order_item_name' => $item['name']
488
+ ) );
489
+
490
+ $item['id'] = $item_id;
491
+
492
+ // Add item meta
493
+ if ( $item_id ) {
494
+ $item = apply_filters( 'learn_press_ajax_order_item', $item );
495
+
496
+ learn_press_add_order_item_meta( $item_id, '_course_id', $item['course_id'] );
497
+ learn_press_add_order_item_meta( $item_id, '_quantity', $item['quantity'] );
498
+ learn_press_add_order_item_meta( $item_id, '_subtotal', $item['subtotal'] );
499
+ learn_press_add_order_item_meta( $item_id, '_total', $item['total'] );
500
+
501
+ do_action( 'learn_press_ajax_add_order_item_meta', $item );
502
+ }
503
+
504
+ $order_data = learn_press_update_order_items( $order_id );
505
+ $currency_symbol = learn_press_get_currency_symbol( $order_data['currency'] );
506
+ $order_data['subtotal_html'] = learn_press_format_price( $order_data['subtotal'], $currency_symbol );
507
+ $order_data['total_html'] = learn_press_format_price( $order_data['total'], $currency_symbol );
508
+
509
+ ob_start();
510
+ include learn_press_get_admin_view( 'meta-boxes/order/order-item.php' );
511
+ $item_html = ob_get_clean();
512
+
513
+ learn_press_send_json(
514
+ array(
515
+ 'result' => 'success',
516
+ 'item_html' => $item_html,
517
+ 'order_data' => $order_data
518
+ )
519
+ );
520
+ }
521
+
522
+ public static function search_courses() {
523
+ $nonce = learn_press_get_request( 'nonce' );
524
+ if ( !wp_verify_nonce( $nonce, 'search_item_term' ) ) {
525
+ LP_Debug::exception( __( 'Verify nonce failed', 'learnpress' ) );
526
+ }
527
+
528
+ $term = learn_press_get_request( 'term' );
529
+ $exclude = learn_press_get_request( 'exclude' );
530
+
531
+ $posts = learn_press_get_all_courses(
532
+ array(
533
+ 'term' => $term,
534
+ 'exclude' => $exclude
535
+ )
536
+ );
537
+ $found_courses = array();
538
+ if ( !empty( $posts ) ) {
539
+ foreach ( $posts as $post ) {
540
+ $found_courses[$post] = array(
541
+ 'title' => get_the_title( $post ),
542
+ 'permalink' => get_the_permalink( $post )
543
+ );
544
+ }
545
+ }
546
+
547
+ $found_courses = apply_filters( 'learn_press_json_search_found_courses', $found_courses );
548
+
549
+ learn_press_send_json( $found_courses );
550
+ }
551
+
552
+ public static function remove_course_section() {
553
+ $id = learn_press_get_request( 'id' );
554
+ if ( $id ) {
555
+ global $wpdb;
556
+ $query = $wpdb->prepare( "
557
+ DELETE FROM {$wpdb->prefix}learnpress_section_items
558
+ WHERE section_id = %d
559
+ ", $id );
560
+ $wpdb->query( $query );
561
+ learn_press_reset_auto_increment( 'learnpress_section_items' );
562
+ $query = $wpdb->prepare( "
563
+ DELETE FROM {$wpdb->prefix}learnpress_sections
564
+ WHERE section_id = %d
565
+ ", $id );
566
+ $wpdb->query( $query );
567
+ learn_press_reset_auto_increment( 'learnpress_sections' );
568
+ }
569
+ die();
570
+ }
571
+
572
+ public static function toggle_lesson_preview() {
573
+ $id = learn_press_get_request( 'lesson_id' );
574
+ if ( get_post_type( $id ) == 'lp_lesson' && wp_verify_nonce( learn_press_get_request( 'nonce' ), 'learn-press-toggle-lesson-preview' ) ) {
575
+ update_post_meta( $id, '_lp_preview', learn_press_get_request( 'previewable' ) );
576
+ }
577
+ die();
578
+ }
579
+
580
+ public static function add_new_item() {
581
+ $post_type = learn_press_get_request( 'type' );
582
+ $post_title = learn_press_get_request( 'name' );
583
+ $response = array();
584
+ if ( $post_type && $post_title ) {
585
+ $args = compact( 'post_title', 'post_type' );
586
+ $args['post_status'] = 'publish';
587
+ $item_id = wp_insert_post( $args );
588
+ if ( $item_id ) {
589
+ LP_Lesson_Post_Type::create_default_meta( $item_id );
590
+ $item = get_post( $item_id );
591
+ $response['post'] = $item;
592
+ $response['post']->edit_link = get_edit_post_link( $item_id );
593
+ }
594
+ }
595
+ learn_press_send_json( $response );
596
+ }
597
+
598
+ public static function quick_add_item() {
599
+ $post_type = learn_press_get_request( 'type' );
600
+ $post_title = learn_press_get_request( 'name' );
601
+ $response = array();
602
+ if ( $post_type && $post_title ) {
603
+ $args = compact( 'post_title', 'post_type' );
604
+ $args['post_status'] = 'publish';
605
+ $item_id = wp_insert_post( $args );
606
+ if ( $item_id ) {
607
+ $item = get_post( $item_id );
608
+ $response['post'] = $item;
609
+ $response['html'] = sprintf( '<li class="" data-id="%1$d" data-type="%2$s" data-text="%3$s">
610
+ <label>
611
+ <input type="checkbox" value="%1$d">
612
+ <span class="lp-item-text">%3$s</span>
613
+ </label>
614
+ </li>', $item->ID, $item->post_type, $item->post_title );
615
+ }
616
+ }
617
+ learn_press_send_json( $response );
618
+ }
619
+
620
+ public static function update_editor_hidden() {
621
+ if ( $id = learn_press_get_request( 'course_id' ) ) {
622
+ if ( learn_press_get_request( 'is_hidden' ) ) {
623
+ update_post_meta( $id, '_lp_editor_hidden', 'yes' );
624
+ } else {
625
+ delete_post_meta( $id, '_lp_editor_hidden' );
626
+ }
627
+ }
628
+ learn_press_send_json( $_POST );
629
+ }
630
+
631
+ public static function update_quiz_question_state() {
632
+ $hidden = learn_press_get_request( 'hidden' );
633
+ $post = learn_press_get_request( 'quiz_id' );
634
+ update_post_meta( $post, '_admin_hidden_questions', $hidden );
635
+ die();
636
+ }
637
+
638
+ public static function update_curriculum_section_state() {
639
+ $hidden = learn_press_get_request( 'hidden' );
640
+ $post = learn_press_get_request( 'course_id' );
641
+ update_post_meta( $post, '_admin_hidden_sections', $hidden );
642
+ die();
643
+ }
644
+
645
+ /**
646
+ * Create a new page with the title passed via $_REQUEST
647
+ */
648
+ public static function create_page() {
649
+ $page_name = !empty( $_REQUEST['page_name'] ) ? $_REQUEST['page_name'] : '';
650
+ $response = array();
651
+ if ( $page_name ) {
652
+ $args = array(
653
+ 'post_type' => 'page',
654
+ 'post_title' => $page_name,
655
+ 'post_status' => 'publish'
656
+ );
657
+ $page_id = wp_insert_post( $args );
658
+
659
+ if ( $page_id ) {
660
+ $response['page'] = get_page( $page_id );
661
+ $html = learn_press_pages_dropdown( '', '', array( 'echo' => false ) );
662
+ preg_match_all( '!value=\"([0-9]+)\"!', $html, $matches );
663
+ $response['positions'] = $matches[1];
664
+ $response['html'] = '<a href="' . get_edit_post_link( $page_id ) . '" target="_blank">' . __( 'Edit Page', 'learnpress' ) . '</a>&nbsp;';
665
+ $response['html'] .= '<a href="' . get_permalink( $page_id ) . '" target="_blank">' . __( 'View Page', 'learnpress' ) . '</a>';
666
+ } else {
667
+ $response['error'] = __( 'Error! Can not create page. Please try again!', 'learnpress' );
668
+ }
669
+ } else {
670
+ $response['error'] = __( 'Page name is empty!', 'learnpress' );
671
+ }
672
+ learn_press_send_json( $response );
673
+ die();
674
+ }
675
+
676
+ public static function add_quiz_question() {
677
+ global $post;
678
+ $id = learn_press_get_request( 'id' );
679
+ $quiz_id = learn_press_get_request( 'quiz_id' );
680
+ $type = learn_press_get_request( 'type' );
681
+ $name = learn_press_get_request( 'name' );
682
+ $response = array(
683
+ 'id' => $id
684
+ );
685
+ $post = get_post( $quiz_id );
686
+ setup_postdata( $post );
687
+ if ( !$id ) {
688
+ $id = wp_insert_post(
689
+ array(
690
+ 'post_title' => $name,
691
+ 'post_type' => LP()->question_post_type,
692
+ 'post_status' => 'publish'
693
+ )
694
+ );
695
+ if ( $id ) {
696
+ add_post_meta( $id, '_lp_type', $type );
697
+ }
698
+ $response['id'] = $id;
699
+ }
700
+ if ( $id && $quiz_id ) {
701
+ global $wpdb;
702
+ $max_order = $wpdb->get_var( $wpdb->prepare( "SELECT max(question_order) FROM {$wpdb->prefix}learnpress_quiz_questions WHERE quiz_id = %d", $quiz_id ) );
703
+ $wpdb->insert(
704
+ $wpdb->prefix . 'learnpress_quiz_questions',
705
+ array(
706
+ 'quiz_id' => $quiz_id,
707
+ 'question_id' => $id,
708
+ 'question_order' => $max_order + 1
709
+ ),
710
+ array( '%d', '%d', '%d' )
711
+ );
712
+ ob_start();
713
+ $question = LP_Question_Factory::get_question( $id );
714
+ learn_press_admin_view( 'meta-boxes/quiz/question.php', array( 'question' => $question ) );
715
+ $response['html'] = ob_get_clean();
716
+ }
717
+ learn_press_send_json( $response );
718
+ die();
719
+ }
720
+
721
+ public static function convert_question_type() {
722
+ if ( ( $from = learn_press_get_request( 'from' ) ) && ( $to = learn_press_get_request( 'to' ) ) && $question_id = learn_press_get_request( 'question_id' ) ) {
723
+ $data = array();
724
+ parse_str( $_POST['data'], $data );
725
+
726
+ do_action( 'learn_press_convert_question_type', $question_id, $from, $to, $data );
727
+ $question = LP_Question_Factory::get_question( $question_id, array( 'type' => $to ) );
728
+ learn_press_send_json(
729
+ array(
730
+ 'html' => $question->admin_interface( array( 'echo' => false ) ),
731
+ 'icon' => $question->get_icon()
732
+ )
733
+ );
734
+ } else {
735
+ throw new Exception( __( 'Convert question type must be specify the id, source and destination type', 'learnpress' ) );
736
+ }
737
+ die();
738
+ }
739
+
740
+ /*******************************************************************************************************/
741
+
742
+ /**
743
+ * Install sample data or dismiss the notice depending on user's option
744
+ */
745
+ public static function install_sample_data() {
746
+ $yes = !empty( $_REQUEST['yes'] ) ? $_REQUEST['yes'] : '';
747
+ $response = array( 'result' => 'fail' );
748
+ $retry_button = sprintf( '<a href="" class="button yes" data-action="yes">%s</a>', __( 'Try again!', 'learnpress' ) );
749
+ $dismiss_button = sprintf( '<a href="" class="button disabled no" data-action="no">%s</a>', __( 'Cancel', 'learnpress' ) );
750
+ $buttons = sprintf( '<p>%s %s</p>', $retry_button, $dismiss_button );
751
+ if ( 'no' == $yes ) {
752
+ set_transient( 'learn_press_install_sample_data', 'off', 12 * HOUR_IN_SECONDS );
753
+ } else {
754
+ $result = array( 'status' => 'activate' );//learn_press_install_and_active_add_on( 'learnpress-import-export' );
755
+ if ( 'activate' == $result['status'] ) {
756
+ // copy dummy-data.xml to import folder of the add-on
757
+ lpie_mkdir( lpie_import_path() );
758
+ if ( file_exists( lpie_import_path() ) ) {
759
+ $import_source = LP_PLUGIN_PATH . '/dummy-data/dummy-data.xml';
760
+ $file = 'dummy-data-' . time() . '.xml';
761
+ $copy = lpie_import_path() . '/' . $file;
762
+ copy( $import_source, $copy );
763
+ if ( file_exists( $copy ) ) {
764
+ $url = admin_url( 'admin-ajax.php?page=learn_press_import_export&tab=import-course' );
765
+ $postdata = array(
766
+ 'step' => 2,
767
+ 'action' => 'learn_press_import',
768
+ 'import-file' => 'import/' . $file,
769
+ 'nonce' => wp_create_nonce( 'lpie-import-file' ),
770
+ 'x' => 1
771
+ );
772
+ $response['url'] = $url = $url . '&' . http_build_query( $postdata ) . "\n";
773
+ $response['result'] = 'success';
774
+ $response['message'] = sprintf( '<p>%s <a href="edit.php?post_type=lp_course">%s</a> </p>', __( 'Import sample data successfully.', 'learnpress' ), __( 'View courses', 'learnpress' ) );
775
+ }
776
+ }
777
+ if ( $response['result'] == 'fail' ) {
778
+ $response['message'] = sprintf( '<p>%s</p>%s', __( 'Import sample data failed. Please try again!.', 'learnpress' ), $buttons );
779
+ }
780
+ } else {
781
+ $response['result'] = 'fail';
782
+ $response['message'] = sprintf( '<p>%s</p>', __( 'Unknown error when installing/activating Import/Export addon. Please try again!', 'learnpress' ) ) . $buttons;
783
+ }
784
+ }
785
+ learn_press_send_json( $response );
786
+ die();
787
+ }
788
+
789
+ /**
790
+ * Activate a bundle of add-ons, if an add-on is not installed then install it first
791
+ */
792
+ public static function bundle_activate_add_ons() {
793
+ global $learn_press_add_ons;
794
+ include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' ); //for plugins_api..
795
+ $response = array( 'addons' => array() );
796
+
797
+ if ( !current_user_can( 'activate_plugins' ) ) {
798
+ $response['error'] = __( 'You do not have sufficient permissions to deactivate plugins for this site.', 'learnpress' );
799
+ } else {
800
+
801
+ $add_ons = $learn_press_add_ons['bundle_activate'];
802
+
803
+ if ( $add_ons ) {
804
+ foreach ( $add_ons as $slug ) {
805
+ $response['addons'][$slug] = learn_press_install_and_active_add_on( $slug );
806
+ }
807
+ }
808
+ }
809
+ learn_press_send_json( $response );
810
+ }
811
+
812
+ /**
813
+ * Activate a bundle of add-ons, if an add-on is not installed then install it first
814
+ */
815
+ public static function bundle_activate_add_on() {
816
+ $response = array();
817
+ include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' ); //for plugins_api..
818
+ if ( !current_user_can( 'activate_plugins' ) ) {
819
+ $response['error'] = __( 'You do not have sufficient permissions to deactivate plugins for this site.', 'learnpress' );
820
+ } else {
821
+ $slug = !empty( $_REQUEST['plugin'] ) ? $_REQUEST['plugin'] : null;
822
+ $response[$slug] = learn_press_install_and_active_add_on( $slug );
823
+ }
824
+ learn_press_send_json( $response );
825
+ }
826
+
827
+ public static function plugin_install() {
828
+ $plugin_name = !empty( $_REQUEST['plugin'] ) ? $_REQUEST['plugin'] : '';
829
+ $response = learn_press_install_add_on( $plugin_name );
830
+ learn_press_send_json( $response );
831
+ die();
832
+ }
833
+
834
+ public static function update_add_on_status() {
835
+ $plugin = !empty( $_REQUEST['plugin'] ) ? $_REQUEST['plugin'] : '';
836
+ $t = !empty( $_REQUEST['t'] ) ? $_REQUEST['t'] : '';
837
+ $response = array();
838
+ if ( !current_user_can( 'activate_plugins' ) ) {
839
+ $response['error'] = __( 'You do not have sufficient permissions to deactivate plugins for this site.', 'learnpress' );
840
+ }
841
+ if ( $plugin && $t ) {
842
+ if ( $t == 'activate' ) {
843
+ activate_plugin( $plugin, false, is_network_admin() );
844
+ } else {
845
+ deactivate_plugins( $plugin, false, is_network_admin() );
846
+ }
847
+ $is_activate = is_plugin_active( $plugin );
848
+ $response['status'] = $is_activate ? 'activate' : 'deactivate';
849
+
850
+ }
851
+ wp_send_json( $response );
852
+ die();
853
+ }
854
+
855
+ /**
856
+ * Output the image to browser with text and params passed via $_GET
857
+ */
858
+ public static function dummy_image() {
859
+ $text = !empty( $_REQUEST['text'] ) ? $_REQUEST['text'] : '';
860
+ learn_press_text_image( $text, $_GET );
861
+ die();
862
+ }
863
+
864
+ /**
865
+ * Get edit|view link of a page
866
+ */
867
+ public static function get_page_permalink() {
868
+ $page_id = !empty( $_REQUEST['page_id'] ) ? $_REQUEST['page_id'] : '';
869
+ ?>
870
+ <a href="<?php echo get_edit_post_link( $page_id ); ?>" target="_blank"><?php _e( 'Edit Page', 'learnpress' ); ?></a>
871
+ <a href="<?php echo get_permalink( $page_id ); ?>" target="_blank"><?php _e( 'View Page', 'learnpress' ); ?></a>
872
+ <?php
873
+ die();
874
+ }
875
+
876
+
877
+ /**
878
+ *
879
+ */
880
+ public function custom_stats() {
881
+ $from = !empty( $_REQUEST['from'] ) ? $_REQUEST['from'] : 0;
882
+ $to = !empty( $_REQUEST['to'] ) ? $_REQUEST['to'] : 0;
883
+ $date_diff = strtotime( $to ) - strtotime( $from );
884
+ if ( $date_diff <= 0 || $from == 0 || $to == 0 ) {
885
+ die();
886
+ }
887
+ learn_press_process_chart( learn_press_get_chart_students( $to, 'days', floor( $date_diff / ( 60 * 60 * 24 ) ) + 1 ) );
888
+ die();
889
+ }
890
+
891
+ /**
892
+ * Quick add lesson with only title
893
+ */
894
+ public static function quick_add_lesson() {
895
+
896
+ $lesson_title = $_POST['lesson_title'];
897
+
898
+ $new_lesson = array(
899
+ 'post_title' => wp_strip_all_tags( $lesson_title ),
900
+ 'post_type' => LP()->lesson_post_type,
901
+ 'post_status' => 'publish'
902
+ );
903
+
904
+ wp_insert_post( $new_lesson );
905
+
906
+ $args = array(
907
+ 'numberposts' => 1,
908
+ 'post_type' => LP()->lesson_post_type,
909
+ 'post_status' => 'publish'
910
+ );
911
+ $lesson = wp_get_recent_posts( $args );
912
+ $lesson_id = $lesson[0]['ID'];
913
+ $data = array(
914
+ 'id' => $lesson_id,
915
+ 'title' => $lesson_title
916
+ );
917
+ wp_send_json( $data );
918
+ die;
919
+ }
920
+
921
+ /**
922
+ * Add a new quiz with the title only
923
+ */
924
+ public static function quick_add_quiz() {
925
+ $quiz_title = $_POST['quiz_title'];
926
+
927
+ $new_quiz = array(
928
+ 'post_title' => wp_strip_all_tags( $quiz_title ),
929
+ 'post_type' => LP()->quiz_post_type,
930
+ 'post_status' => 'publish'
931
+ );
932
+
933
+ wp_insert_post( $new_quiz );
934
+
935
+ $args = array(
936
+ 'numberposts' => 1,
937
+ 'post_type' => LP()->quiz_post_type,
938
+ 'post_status' => 'publish'
939
+ );
940
+ $quiz = wp_get_recent_posts( $args );
941
+ $quiz_id = $quiz[0]['ID'];
942
+ $data = array(
943
+ 'id' => $quiz_id,
944
+ 'title' => $quiz_title
945
+ );
946
+ wp_send_json( $data );
947
+ die;
948
+ }
949
+
950
+ public static function be_teacher() {
951
+ $user_id = get_current_user_id();
952
+ $be_teacher = new WP_User( $user_id );
953
+ $be_teacher->set_role( LP()->teacher_role );
954
+ die;
955
+ }
956
+
957
+ public static function ignore_setting_up() {
958
+ update_option( '_lpr_ignore_setting_up', 1, true );
959
+ die;
960
+ }
961
+ }
962
+ }
963
+ LP_Admin_Ajax::init();
inc/admin/class-lp-admin-assets.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class LP_Assets
4
+ *
5
+ * @author ThimPress
6
+ * @package LearnPress/Classes
7
+ * @version 1.0
8
+ * @extends LP_Abstract_Assets
9
+ */
10
+
11
+ if ( !defined( 'ABSPATH' ) ) {
12
+ exit; // Exit if accessed directly
13
+ }
14
+
15
+ learn_press_include( 'abstracts/abstract-lp-assets.php' );
16
+ class LP_Admin_Assets extends LP_Abstract_Assets {
17
+
18
+ public static function init() {
19
+ parent::$caller = __CLASS__;
20
+ add_action( 'learn_press_print_assets', array( __CLASS__, '_print_assets' ) );
21
+ parent::init();
22
+ }
23
+ /**
24
+ * Load assets for admin
25
+ */
26
+ public static function load_scripts() {
27
+ $screen = get_current_screen();
28
+ $screen_id = $screen->id;
29
+ $page_id = !empty( $_REQUEST['page'] ) ? $_REQUEST['page'] : '';
30
+ if( in_array( $screen_id, learn_press_get_screens() ) || in_array( $page_id, learn_press_get_admin_pages() ) ) {
31
+ self::add_style( 'learn-press-global', learn_press_plugin_url( 'assets/css/global-style.css' ) );
32
+ self::add_style( 'learn-press-admin', learn_press_plugin_url( 'assets/css/admin/admin.css' ), array( 'learn-press-global' ) );
33
+ self::add_style( 'learn-press-icons', learn_press_plugin_url( 'assets/css/icons.css' ) );
34
+
35
+ //self::add_script( 'learn-press-ui', learn_press_plugin_url( 'assets/js/ui.js' ) );
36
+ self::add_script( 'learn-press-admin', learn_press_plugin_url( 'assets/js/admin/admin.js' ) );
37
+ self::add_script( 'modal-search-items', learn_press_plugin_url( 'assets/js/admin/modal-search-items.js' ), array( 'jquery' ) );
38
+ }
39
+ if( in_array( $screen_id, array( 'lp_order', 'order', 'edit-lp_order' ) ) ){
40
+ self::add_style( 'learn-press-order', learn_press_plugin_url( 'assets/css/admin/meta-box-order.css' ) );
41
+ self::add_script( 'learn-press-order', learn_press_plugin_url( 'assets/js/admin/meta-box-order.js' ), array( 'backbone', 'wp-util' ) );
42
+ }
43
+ }
44
+
45
+ public static function _print_assets() {
46
+ self::enqueue_style( 'learn-press-icons' );
47
+ self::enqueue_style( 'learn-press-admin' );
48
+
49
+ self::enqueue_style( 'learn-press-order' );
50
+ self::enqueue_script( 'learn-press-order' );
51
+
52
+ self::enqueue_script( 'learn-press-admin' );
53
+ }
54
+ }
55
+ LP_Admin_Assets::init();
inc/admin/class-lp-admin-menu.php ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Setup menus in WP admin.
4
+ *
5
+ * @author ThimPress
6
+ * @package LearnPress
7
+ * @version 1.0
8
+ */
9
+
10
+ if ( !defined( 'ABSPATH' ) ) {
11
+ exit; // Exit if accessed directly
12
+ }
13
+
14
+ /**
15
+ * Class LP_Admin_Menu
16
+ */
17
+ class LP_Admin_Menu {
18
+ protected $_submenu = null;
19
+
20
+ /**
21
+ * LP_Admin_Menu Construct
22
+ */
23
+ public function __construct() {
24
+ // admin menu
25
+ add_action( 'admin_menu', array( $this, 'admin_menu' ) );
26
+ add_action( 'admin_menu', array( $this, 'notify_new_course' ) );
27
+ add_action( 'init', array( $this, 'menu_content' ) );
28
+ add_action( 'init', 'learn_press_admin_update_settings', 1000 );
29
+
30
+ // auto include file for admin page
31
+ // example: slug = learn_press_settings -> file = inc/admin/sub-menus/settings.php
32
+ $page = !empty ( $_REQUEST['page'] ) ? $_REQUEST['page'] : null;
33
+ if ( $page ) {
34
+
35
+ if ( strpos( $page, 'learn_press_' ) !== false ) {
36
+ $file = preg_replace( '!^learn_press_!', '', $page );
37
+ $file = str_replace( '_', '-', $file );
38
+ if ( file_exists( $file = LP_PLUGIN_PATH . "/inc/admin/sub-menus/{$file}.php" ) ) {
39
+ $this->_submenu = require_once $file;
40
+ }
41
+ }
42
+ }
43
+ }
44
+
45
+ /**
46
+ * Register for menu for admin
47
+ */
48
+ public function admin_menu() {
49
+ $capacity = 'edit_' . LP()->course_post_type . 's';
50
+ add_menu_page(
51
+ __( 'Learning Management System', 'learnpress' ),
52
+ __( 'LearnPress', 'learnpress' ),
53
+ $capacity,
54
+ 'learn_press',
55
+ '',
56
+ 'dashicons-welcome-learn-more',
57
+ '3.14'
58
+ );
59
+
60
+ $menu_items = array(
61
+ 'statistics' => array(
62
+ 'learn_press',
63
+ __( 'Statistics', 'learnpress' ),
64
+ __( 'Statistics', 'learnpress' ),
65
+ $capacity,
66
+ 'learn_press_statistics',
67
+ array( $this, 'menu_page' )
68
+ ),
69
+ 'settings' => array(
70
+ 'options-general.php',
71
+ __( 'LearnPress Settings', 'learnpress' ),
72
+ __( 'LearnPress', 'learnpress' ),
73
+ 'manage_options',
74
+ 'learn_press_settings',
75
+ 'learn_press_settings_page'
76
+ ),
77
+ 'addons' => array(
78
+ 'learn_press',
79
+ __( 'Add-ons', 'learnpress' ),
80
+ __( 'Add-ons', 'learnpress' ),
81
+ 'manage_options',
82
+ 'learn_press_add_ons',
83
+ 'learn_press_add_ons_page'
84
+ )
85
+ );
86
+
87
+ // Third-party can be add more items
88
+ $menu_items = apply_filters( 'learn_press_menu_items', $menu_items );
89
+
90
+ if ( $menu_items ) foreach ( $menu_items as $item ) {
91
+ call_user_func_array( 'add_submenu_page', $item );
92
+ }
93
+
94
+ add_submenu_page( 'tools.php', __( 'Database tools', 'learnpress' ), __( 'LearnPress', 'learnpress' ), 'manage_options', 'learn_press_tools', 'learn_press_tools_page' );
95
+ }
96
+
97
+ /*
98
+ * Notify an administrator with pending courses
99
+ */
100
+ public function notify_new_course() {
101
+ global $menu;
102
+ $current_user = wp_get_current_user();
103
+ if ( !in_array( 'administrator', $current_user->roles ) ) {
104
+ return;
105
+ }
106
+ $count_courses = wp_count_posts( LP()->course_post_type );
107
+ $awaiting_mod = $count_courses->pending;
108
+ $menu['3.14'][0] .= " <span class='awaiting-mod count-$awaiting_mod'><span class='pending-count'>" . number_format_i18n( $awaiting_mod ) . "</span></span>";
109
+ }
110
+
111
+ public function menu_page() {
112
+ if ( $this->_submenu ) {
113
+ $this->_submenu->display();
114
+ }
115
+ }
116
+
117
+ public function menu_content() {
118
+ if ( !function_exists( 'learn_press_admin_update_settings' ) ) {
119
+ remove_action( 'init', 'learn_press_admin_update_settings', 1000 );
120
+ }
121
+ }
122
+ }
123
+
124
+ return new LP_Admin_Menu();
inc/admin/class-lp-admin-notice.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Manage the admin notices and display them in admin
4
+ *
5
+ * @package LearnPress
6
+ * @author ThimPress
7
+ * @version 1.0
8
+ */
9
+ if ( !defined( 'ABSPATH' ) ) {
10
+ exit; // Exit if accessed directly
11
+ }
12
+
13
+ /**
14
+ * Class LP_Admin_Notice
15
+ */
16
+ class LP_Admin_Notice {
17
+ /**
18
+ * Store all notices which added anywhere before show
19
+ * @var array
20
+ */
21
+ protected static $_notices = array();
22
+
23
+ /**
24
+ * LP_Admin_Notice construct
25
+ */
26
+ public function __construct() {
27
+ add_action( 'admin_notices', array( __CLASS__, 'show_notices' ), 100000 );
28
+ }
29
+
30
+ /**
31
+ * Add new notice to queue
32
+ *
33
+ * @param string $message The message want to display
34
+ * @param string $type The class name of WP message type updated|update-nag|error
35
+ * @param string $id Custom id for html element's ID
36
+ * @param bool
37
+ */
38
+ public static function add( $message, $type = 'updated', $id = '', $redirect = false ) {
39
+ if ( $redirect ) {
40
+ $notices = get_transient( 'learn_press_redirect_notices' );
41
+ if ( empty( $notices ) ) {
42
+ $notices = array();
43
+ }
44
+ $notices[] = array(
45
+ 'type' => $type,
46
+ 'message' => $message,
47
+ 'id' => $id
48
+ );
49
+ set_transient( 'learn_press_redirect_notices', $notices );
50
+ } else {
51
+ self::$_notices[] = array(
52
+ 'type' => $type,
53
+ 'message' => $message,
54
+ 'id' => $id
55
+ );
56
+ }
57
+ }
58
+
59
+ public static function add_redirect( $message, $type = 'updated', $id = '' ) {
60
+ self::add( $message, $type, $id, true );
61
+ }
62
+
63
+ /**
64
+ * Show all notices has registered
65
+ */
66
+ public static function show_notices() {
67
+ if ( self::$_notices ) {
68
+ foreach ( self::$_notices as $notice ) {
69
+ if ( empty( $notice ) ) {
70
+ continue;
71
+ }
72
+ learn_press_admin_view( 'admin-notice.php', $notice );
73
+ }
74
+ }
75
+ if ( $notices = get_transient( 'learn_press_redirect_notices' ) ) {
76
+ foreach ( $notices as $notice ) {
77
+ if ( empty( $notice ) ) {
78
+ continue;
79
+ }
80
+ learn_press_admin_view( 'admin-notice.php', $notice );
81
+ }
82
+ delete_transient( 'learn_press_redirect_notices' );
83
+ }
84
+ }
85
+ }
86
+
87
+ new LP_Admin_Notice();
inc/admin/class-lp-admin-settings.php ADDED
@@ -0,0 +1,204 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ wp_die( __FILE__ );
3
+ if ( !defined( 'ABSPATH' ) ) {
4
+ exit; // Exit if accessed directly
5
+ }
6
+
7
+ /**
8
+ * Class LP_Admin_Settings
9
+ */
10
+ class LP_Admin_Settings {
11
+ /**
12
+ * The option key stored in database
13
+ *
14
+ * @var string
15
+ * @access protected
16
+ */
17
+ protected $_key = '';
18
+
19
+ /**
20
+ * Store value of the options stored in database
21
+ *
22
+ * @var array|bool
23
+ */
24
+ public $_options = false;
25
+
26
+ /**
27
+ * Constructor
28
+ *
29
+ * @param $key
30
+ */
31
+ public function __construct( $key ) {
32
+ if ( !$key ) {
33
+ wp_die( __FILE__ . '::' . __FUNCTION__ );
34
+ }
35
+ $this->_key = $key;
36
+ $this->_options = (array) get_option( $this->_key );
37
+ }
38
+
39
+ /**
40
+ * Set new value for a key of $_options
41
+ *
42
+ * @param $name
43
+ * @param $value
44
+ */
45
+ public function set( $name, $value ) {
46
+ $this->_set_option( $this->_options, $name, $value, true );
47
+ }
48
+
49
+ /**
50
+ * Set value for an object|array by key
51
+ *
52
+ * @param $obj
53
+ * @param $var
54
+ * @param $value
55
+ * @param bool $recurse
56
+ */
57
+ private function _set_option( &$obj, $var, $value, $recurse = false ) {
58
+ $var = (array) explode( '.', $var );
59
+ $current_var = array_shift( $var );
60
+ if ( is_object( $obj ) ) {
61
+ $obj_vars = get_object_vars( $obj );
62
+ if ( array_key_exists( $current_var, $obj_vars ) ) { // isset( $obj->{$current_var} ) ){
63
+ if ( count( $var ) ) {
64
+ if ( is_object( $obj->$current_var ) ) {
65
+ $obj->$current_var = new stdClass();
66
+ } else {
67
+ $obj->$current_var = array();
68
+ }
69
+ $this->_set_option( $obj->$current_var, join( '.', $var ), $value, $recurse );
70
+ } else {
71
+ $obj->$current_var = $value;
72
+ }
73
+ } else {
74
+ if ( $recurse ) {
75
+ if ( count( $var ) ) {
76
+ $next_var = reset( $var );
77
+ if ( is_object( $obj->$current_var ) ) {
78
+ $obj->$current_var = new stdClass();
79
+ } else {
80
+ $obj->$current_var = array();
81
+ }
82
+ $this->_set_option( $obj->$current_var, join( '.', $var ), $value, $recurse );
83
+ } else {
84
+ $obj->$current_var = $value;
85
+ }
86
+ } else {
87
+ $obj->$current_var = $value;
88
+ }
89
+ }
90
+ } else if ( is_array( $obj ) ) {
91
+ if ( array_key_exists( $current_var, $obj ) ) {
92
+ if ( count( $var ) ) {
93
+ $obj[$current_var] = array();
94
+ $this->_set_option( $obj[$current_var], join( '.', $var ), $value, $recurse );
95
+ } else {
96
+ $obj[$current_var] = $value;
97
+ }
98
+ } else {
99
+ if ( $recurse ) {
100
+ if ( count( $var ) ) {
101
+ $next_var = reset( $var );
102
+ $obj[$current_var] = array();
103
+ $this->_set_option( $obj[$current_var], join( '.', $var ), $value, $recurse );
104
+ } else {
105
+ $obj[$current_var] = $value;
106
+ }
107
+ } else {
108
+ $obj[$current_var] = $value;
109
+ }
110
+ }
111
+ }
112
+ }
113
+
114
+ /**
115
+ * Get value from a key of $_options
116
+ *
117
+ * @param $var
118
+ * @param null $default
119
+ *
120
+ * @return null
121
+ */
122
+ public function get( $var, $default = null ) {
123
+ return $this->_get_option( $this->_options, $var, $default );
124
+ }
125
+
126
+ /**
127
+ * Get value from a key of an object|array
128
+ *
129
+ * @param $obj
130
+ * @param $var
131
+ * @param null $default
132
+ *
133
+ * @return null
134
+ */
135
+ public function _get_option( $obj, $var, $default = null ) {
136
+ $var = (array) explode( '.', $var );
137
+ $current_var = array_shift( $var );
138
+ if ( is_object( $obj ) ) {
139
+ if ( isset( $obj->{$current_var} ) ) {
140
+ if ( count( $var ) ) {
141
+ return $this->_get_option( $obj->{$current_var}, join( '.', $var ), $default );
142
+ } else {
143
+ return $obj->{$current_var};
144
+ }
145
+ } else {
146
+ return $default;
147
+ }
148
+ } else {
149
+ if ( isset( $obj[$current_var] ) ) {
150
+ if ( count( $var ) ) {
151
+ return $this->_get_option( $obj[$current_var], join( '.', $var ), $default );
152
+ } else {
153
+ return $obj[$current_var];
154
+ }
155
+ } else {
156
+ return $default;
157
+ }
158
+ }
159
+ return $default;
160
+ }
161
+
162
+ /**
163
+ * Combine an array|object to current options
164
+ *
165
+ * @param $new
166
+ */
167
+ public function bind( $new ) {
168
+ if ( is_object( $new ) ) $new = (array) $new;
169
+ if ( is_array( $new ) ) {
170
+ foreach ( $new as $k => $v ) {
171
+ $this->set( $k, $v );
172
+ }
173
+ }
174
+ }
175
+
176
+ /**
177
+ * Store options into database
178
+ */
179
+ public function update() {
180
+ update_option( $this->_key, $this->_options );
181
+ }
182
+
183
+ /**
184
+ * Unique an instance of the class by the key of the options want to initial
185
+ *
186
+ * @param $key
187
+ *
188
+ * @return mixed
189
+ */
190
+ public static function instance( $key ) {
191
+ static $instances = array();
192
+ $key = '_lpr_settings_' . $key;
193
+ if ( empty( $instances[$key] ) ) {
194
+ $instances[$key] = new LP_Admin_Settings( $key );
195
+ }
196
+ return $instances[$key];
197
+ }
198
+ }
199
+
200
+ if ( !function_exists( 'learn_press_admin_settings' ) ) {
201
+ function learn_press_admin_settings( $key ) {
202
+ return LP_Admin_Settings::instance( $key );
203
+ }
204
+ }
inc/admin/class-lp-admin.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author ThimPress
4
+ * @package LearnPress/Admin/Classes
5
+ * @version 1.0
6
+ */
7
+ if ( !defined( 'ABSPATH' ) ) {
8
+ exit; // Exit if accessed directly
9
+ }
10
+
11
+ if ( !class_exists( 'LP_Admin' ) ) {
12
+ /**
13
+ * Class LP_Admin
14
+ */
15
+ class LP_Admin {
16
+ /**
17
+ * Constructor
18
+ */
19
+ public function __construct() {
20
+ $this->includes();
21
+ add_action( 'admin_print_scripts', array( $this, 'plugin_js_settings' ) );
22
+ //add_action( 'init', array( $this, 'include_update' ) );
23
+ add_action( 'template_redirect', array( $this, '_redirect' ) );
24
+ }
25
+
26
+ /**
27
+ * Output common js settings in admin
28
+ *
29
+ * @since 0.9.4
30
+ */
31
+ public function plugin_js_settings() {
32
+ static $did = false;
33
+ if ( $did || !is_admin() ) return;
34
+ $js = array(
35
+ 'ajax' => admin_url( 'admin-ajax.php' ),
36
+ 'plugin_url' => learn_press_plugin_url(),
37
+ 'siteurl' => home_url(),
38
+ 'localize' => array(
39
+ 'button_ok' => __( 'OK', 'learnpress' ),
40
+ 'button_cancel' => __( 'Cancel', 'learnpress' ),
41
+ 'button_yes' => __( 'Yes', 'learnpress' ),
42
+ 'button_no' => __( 'No', 'learnpress' )
43
+ )
44
+ );
45
+ echo '<script type="text/javascript">var LearnPress_Settings = ' . json_encode( $js ) . '</script>';
46
+ if( LP_Settings::instance()->get('debug') == 'yes' ){
47
+ echo '<script type="text/javascript">var LEARN_PRESS_DEBUG = true;</script>';
48
+ }
49
+ $did = true;
50
+ }
51
+
52
+ /**
53
+ * Redirect to admin settings page
54
+ */
55
+ public function _redirect() {
56
+ $page = isset( $_GET['page'] ) ? $_GET['page'] : '';
57
+ if ( 'learn_press_settings' == $page ) {
58
+ $current_tab = isset( $_GET['tab'] ) ? $_GET['tab'] : '';
59
+ $tabs = learn_press_settings_tabs_array();
60
+
61
+ if ( !$current_tab || ( $tabs && empty( $tabs[$current_tab] ) ) ) {
62
+ if ( $tabs ) {
63
+ $tab_keys = array_keys( $tabs );
64
+ $current_tab = reset( $tab_keys );
65
+ wp_redirect( admin_url( 'options-general.php?page=learn_press_settings&tab=' . $current_tab ) );
66
+ exit();
67
+ }
68
+ }
69
+ }
70
+ }
71
+
72
+ /**
73
+ * Include all classes and functions used for admin
74
+ */
75
+ public function includes() {
76
+ // Common function used in admin
77
+ include_once( 'lp-admin-functions.php' );
78
+ //Ajax Class
79
+ include_once( 'class-lp-admin-ajax.php' );
80
+ // Admin menu
81
+ include_once( 'class-lp-admin-menu.php' );
82
+
83
+
84
+ }
85
+ }
86
+ new LP_Admin();
87
+ }
inc/admin/class-lp-email.php ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class LP_Email
5
+ */
6
+ class LP_Email_bakup {
7
+
8
+ /**
9
+ * @var array
10
+ */
11
+ protected $to = array();
12
+
13
+ /**
14
+ * @var string
15
+ */
16
+ protected $subject = '';
17
+
18
+ /**
19
+ * @var string
20
+ */
21
+ protected $message = '';
22
+
23
+ /**
24
+ * Constructor.
25
+ */
26
+ public function __construct() {
27
+ }
28
+
29
+ /**
30
+ * Filter headers.
31
+ * Replaces new lines.
32
+ *
33
+ * @param string $value
34
+ *
35
+ * @return string
36
+ */
37
+ public function filter( $value ) {
38
+ return str_ireplace( array( "\r", "\n", '%0A', '%0D', '<CR>', '<LF>' ), '', $value );
39
+ }
40
+
41
+ /**
42
+ * Set email template.
43
+ *
44
+ * @param $action
45
+ */
46
+ public function set_action( $action ) {
47
+ $emails_settings = get_option( '_lpr_settings_emails' );
48
+
49
+ $this->subject = isset( $emails_settings[$action]['subject'] ) ? $emails_settings[$action]['subject'] : '';
50
+ $this->message = isset( $emails_settings[$action]['message'] ) ? $emails_settings[$action]['message'] : '';
51
+ }
52
+
53
+ /**
54
+ * Parse subject placeholders.
55
+ *
56
+ * @param array $vars
57
+ */
58
+ public function parse_email( $vars ) {
59
+ if ( empty( $vars ) ) {
60
+ return;
61
+ }
62
+
63
+ foreach ( $vars as $key => $value ) {
64
+ $this->subject = str_replace( '{' . $key . '}', $value, $this->subject );
65
+ $this->message = str_replace( '{' . $key . '}', $value, $this->message );
66
+ }
67
+ }
68
+
69
+ /**
70
+ * Add email recipient.
71
+ *
72
+ * @param string $email
73
+ */
74
+ public function add_recipient( $email ) {
75
+ $this->to[] = $email;
76
+ }
77
+
78
+ /**
79
+ * Send email.
80
+ *
81
+ * @return boolean
82
+ */
83
+ public function send() {
84
+ $email_settings = get_option( '_lpr_settings_emails' );
85
+ $headers[] = 'Content-Type: text/html; charset=UTF-8';
86
+ $headers['from'] = '';
87
+
88
+ if ( is_array( $email_settings['general'] ) && !empty( $email_settings['general']['from_email'] ) ) {
89
+ $headers['from'] .= 'From:';
90
+
91
+ if ( !empty( $email_settings['general']['from_name'] ) ) {
92
+ $headers['from'] .= ' ' . $this->filter( $email_settings['general']['from_name'] );
93
+ }
94
+
95
+ $headers['from'] .= ' <' . sanitize_email( $email_settings['general']['from_email'] ) . ">\r\n";
96
+ }
97
+
98
+ return wp_mail( $this->to, $this->filter( $this->subject ), stripslashes( $this->message ), $headers );
99
+ }
100
+ }
inc/admin/class-lp-plugin-install-list-table.php ADDED
@@ -0,0 +1,489 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Plugin Installer List Table class.
4
+ *
5
+ * @package WordPress
6
+ * @subpackage List_Table
7
+ * @since 3.1.0
8
+ * @access private
9
+ */
10
+ die();
11
+ class LP_Plugin_Install_List_Table extends WP_List_Table {
12
+
13
+ public $order = 'ASC';
14
+ public $orderby = null;
15
+ public $groups = array();
16
+
17
+ private $error;
18
+ private $test_mode = false;
19
+ private $repo_url = 'http://thimpress.com/lprepo/';
20
+ private $upgrader = false;
21
+ public $items; // extended from it parent
22
+ public function ajax_user_can() {
23
+ return current_user_can('install_plugins');
24
+ }
25
+
26
+ /**
27
+ * Return a list of slugs of installed plugins, if known.
28
+ *
29
+ * Uses the transient data from the updates API to determine the slugs of
30
+ * known installed plugins. This might be better elsewhere, perhaps even
31
+ * within get_plugins().
32
+ *
33
+ * @since 4.0.0
34
+ * @access protected
35
+ */
36
+ protected function get_installed_plugin_slugs() {
37
+ $slugs = array();
38
+
39
+ $plugin_info = get_site_transient( 'update_plugins' );
40
+ if ( isset( $plugin_info->no_update ) ) {
41
+ foreach ( $plugin_info->no_update as $plugin ) {
42
+ $slugs[] = $plugin->slug;
43
+ }
44
+ }
45
+
46
+ if ( isset( $plugin_info->response ) ) {
47
+ foreach ( $plugin_info->response as $plugin ) {
48
+ $slugs[] = $plugin->slug;
49
+ }
50
+ }
51
+
52
+ return $slugs;
53
+ }
54
+
55
+ private function _get_items_from_wp( $args = array() ){
56
+ $tab = ! empty( $_REQUEST['tab'] ) ? $_REQUEST['tab'] : '';
57
+ if( ! $tab ) return;
58
+ global $learn_press_add_ons;
59
+ $plugins = learn_press_get_add_ons_from_wp( $args );
60
+ if( ( $tab == 'bundle_activate' ) && sizeof( $plugins ) ) {
61
+
62
+ $_plugins = array_values( $plugins );
63
+ $plugins = array();
64
+ $bundle_activate = $learn_press_add_ons['bundle_activate'];
65
+ for( $n = sizeof( $_plugins ), $i = $n - 1; $i >= 0; $i-- ){
66
+ foreach( $bundle_activate as $slug ){
67
+ if( ( false !== strpos( $slug, $_plugins[$i]->slug ) ) || ( false !== strpos( $_plugins[$i]->slug, $slug ) ) ){
68
+ $plugins[] = $_plugins[ $i ];
69
+ }
70
+ }
71
+ }
72
+ }
73
+ $this->items = $plugins;
74
+ }
75
+
76
+ private function _get_items_from_thimpress( $add_ons ){
77
+ $cache = WP_CONTENT_DIR . '/upgrade/' . md5( serialize( $add_ons ) ) . '.cache';
78
+ $timeover = HOUR_IN_SECONDS * 24;
79
+ if( file_exists( $cache ) && ( time() - filemtime( $cache ) ) < $timeover ){
80
+ $items = maybe_unserialize( file_get_contents( $cache ) );
81
+ }else {
82
+ $repo_url = 'http://thimpress.com/lprepo/';
83
+
84
+ foreach ($add_ons as $slug) {
85
+ if( false !== strpos( $slug, '.php' ) ){
86
+ $filename = basename( $slug );
87
+ $slug = dirname( $slug );
88
+ }else{
89
+ $filename = "{$slug}.php";
90
+ }
91
+ $item = array(
92
+ 'name' => '',
93
+ 'slug' => '',
94
+ 'version' => '0.0',
95
+ 'author' => '<a href="http://profiles.wordpress.org/thimpress">thimpress</a>',
96
+ 'author_profile' => 'http://profiles.wordpress.org/thimpress',
97
+ 'contributors' => array(),
98
+ 'requires' => '4.0',
99
+ 'tested' => '4.2.2',
100
+ 'rating' => 0,
101
+ 'num_ratings' => 0,
102
+ 'ratings' => array(
103
+ '5' => 0,
104
+ '4' => 0,
105
+ '3' => 0,
106
+ '2' => 0,
107
+ '1' => 0
108
+ ),
109
+
110
+ 'active_installs' => 0,
111
+ 'last_updated' => gmdate('Y-m-d h:iA', strtotime('last Friday', time())) . ' GMT',
112
+ 'homepage' => 'http://thimpress.com/learnpress',
113
+ 'short_description' => '',
114
+ 'icons' => array(
115
+ '2x' => LP_PLUGIN_URL . '/assets/images/icon-128x128.png',
116
+ '1x' => LP_PLUGIN_URL . '/assets/images/icon-128x128.png'
117
+ )
118
+ );
119
+ $readme = $this->upgrader->get_plugin_info($repo_url . "/{$slug}.zip", $filename );
120
+ $item['name'] = $readme['name'];
121
+ $item['slug'] = $slug;
122
+ if (preg_match('!<h4>(.*)<\/h4>!', $readme['sections']['changelog'], $matches)) {
123
+ $item['version'] = $matches[1];
124
+ }
125
+ $item['requires'] = $readme['requires_at_least'];
126
+ $item['tested'] = $readme['tested_up_to'];
127
+
128
+ $items["{$slug}/{$filename}"] = (object)$item;
129
+ }
130
+ file_put_contents( $cache, serialize($items));
131
+ }
132
+ $this->items = $items;
133
+ }
134
+
135
+ /**
136
+ * Get list of add ons
137
+ *
138
+ * @param array
139
+ */
140
+ public function prepare_items( $args = array() ) {
141
+ global $learn_press_add_ons;
142
+ $this->upgrader = new LP_Upgrader();
143
+
144
+ $page = ! empty( $_REQUEST['page'] ) ? $_REQUEST['page'] : '';
145
+ $tab = ! empty( $_REQUEST['tab'] ) ? $_REQUEST['tab'] : '';
146
+ if( 'learn_press_add_ons' != $page ) return;
147
+
148
+ if( 'more' == $tab ){
149
+ $add_ons = $learn_press_add_ons['more'];
150
+ }elseif( 'bundle_activate' == $tab ){
151
+ $add_ons = $learn_press_add_ons['bundle_activate'];
152
+ }
153
+ if( ! $this->test_mode ){
154
+ $this->_get_items_from_wp( $args );
155
+ }else{
156
+ $this->_get_items_from_thimpress( $add_ons );
157
+ }
158
+ }
159
+
160
+
161
+ public function no_items() {
162
+ $message = __( 'No plugins found.', 'learnpress' );
163
+
164
+ echo '<div class="no-plugin-results">' . $message . '</div>';
165
+ }
166
+
167
+ protected function get_views() {
168
+ global $tabs, $tab;
169
+
170
+ $display_tabs = array();
171
+ foreach ( (array) $tabs as $action => $text ) {
172
+ $class = ( $action == $tab ) ? ' current' : '';
173
+ $href = self_admin_url('plugin-install.php?tab=' . $action);
174
+ $display_tabs['plugin-install-'.$action] = "<a href='$href' class='$class'>$text</a>";
175
+ }
176
+ // No longer a real tab.
177
+ unset( $display_tabs['plugin-install-upload'] );
178
+
179
+ return $display_tabs;
180
+ }
181
+
182
+ /**
183
+ * Override parent views so we can use the filter bar display.
184
+ */
185
+ public function views() {
186
+ $views = $this->get_views();
187
+
188
+ /** This filter is documented in wp-admin/inclues/class-wp-list-table.php */
189
+ $views = apply_filters( "views_{$this->screen->id}", $views );
190
+
191
+ ?>
192
+ <div class="wp-filter">
193
+ <ul class="filter-links">
194
+ <?php
195
+ if ( ! empty( $views ) ) {
196
+ foreach ( $views as $class => $view ) {
197
+ $views[ $class ] = "\t<li class='$class'>$view";
198
+ }
199
+ echo implode( " </li>\n", $views ) . "</li>\n";
200
+ }
201
+ ?>
202
+ </ul>
203
+
204
+ <?php install_search_form( isset( $views['plugin-install-search'] ) ); ?>
205
+ </div>
206
+ <?php
207
+ }
208
+
209
+ /**
210
+ * Override the parent display() so we can provide a different container.
211
+ */
212
+ public function display() {
213
+ $data_attr = '';
214
+ ?>
215
+ <div class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
216
+
217
+ <div id="the-list"<?php echo $data_attr; ?>>
218
+ <?php $this->display_rows_or_placeholder(); ?>
219
+ </div>
220
+ </div>
221
+ <?php
222
+ $this->display_tablenav( 'bottom' );
223
+ }
224
+
225
+ /**
226
+ * @param string $which
227
+ */
228
+ protected function display_tablenav( $which ) {
229
+ if ( 'top' == $which ) {
230
+ wp_referer_field();
231
+ ?>
232
+ <div class="tablenav top">
233
+ <div class="alignleft actions">
234
+ <?php
235
+ /**
236
+ * Fires before the Plugin Install table header pagination is displayed.
237
+ *
238
+ * @since 2.7.0
239
+ */
240
+ do_action( 'install_plugins_table_header' ); ?>
241
+ </div>
242
+ <?php $this->pagination( $which ); ?>
243
+ <br class="clear" />
244
+ </div>
245
+ <?php } else { ?>
246
+ <div class="tablenav bottom">
247
+ <?php $this->pagination( $which ); ?>
248
+ <br class="clear" />
249
+ </div>
250
+ <?php
251
+ }
252
+ }
253
+
254
+ protected function get_table_classes() {
255
+ return array( 'widefat', $this->_args['plural'] );
256
+ }
257
+
258
+ public function get_columns() {
259
+ return array();
260
+ }
261
+
262
+ /**
263
+ * @param object $plugin_a
264
+ * @param object $plugin_b
265
+ * @return int
266
+ */
267
+ private function order_callback( $plugin_a, $plugin_b ) {
268
+ $orderby = $this->orderby;
269
+ if ( ! isset( $plugin_a->$orderby, $plugin_b->$orderby ) ) {
270
+ return 0;
271
+ }
272
+
273
+ $a = $plugin_a->$orderby;
274
+ $b = $plugin_b->$orderby;
275
+
276
+ if ( $a == $b ) {
277
+ return 0;
278
+ }
279
+
280
+ if ( 'DESC' == $this->order ) {
281
+ return ( $a < $b ) ? 1 : -1;
282
+ } else {
283
+ return ( $a < $b ) ? -1 : 1;
284
+ }
285
+ }
286
+
287
+ public function display_rows() {
288
+ $plugins_allowedtags = array(
289
+ 'a' => array( 'href' => array(),'title' => array(), 'target' => array() ),
290
+ 'abbr' => array( 'title' => array() ),'acronym' => array( 'title' => array() ),
291
+ 'code' => array(), 'pre' => array(), 'em' => array(),'strong' => array(),
292
+ 'ul' => array(), 'ol' => array(), 'li' => array(), 'p' => array(), 'br' => array()
293
+ );
294
+
295
+ $plugins_group_titles = array(
296
+ 'Performance' => _x( 'Performance', 'Plugin installer group title' ),
297
+ 'Social' => _x( 'Social', 'Plugin installer group title' ),
298
+ 'Tools' => _x( 'Tools', 'Plugin installer group title' ),
299
+ );
300
+
301
+ $tab = ! empty( $_REQUEST['tab'] ) ? $_REQUEST['tab'] : '';
302
+ $group = null;
303
+
304
+ foreach ( (array) $this->items as $kk => $plugin ) {
305
+ if ( is_object( $plugin ) ) {
306
+ $plugin = (array) $plugin;
307
+ }
308
+
309
+ // Display the group heading if there is one
310
+ if ( isset( $plugin['group'] ) && $plugin['group'] != $group ) {
311
+ if ( isset( $this->groups[ $plugin['group'] ] ) ) {
312
+ $group_name = $this->groups[ $plugin['group'] ];
313
+ if ( isset( $plugins_group_titles[ $group_name ] ) ) {
314
+ $group_name = $plugins_group_titles[ $group_name ];
315
+ }
316
+ } else {
317
+ $group_name = $plugin['group'];
318
+ }
319
+
320
+ // Starting a new group, close off the divs of the last one
321
+ if ( ! empty( $group ) ) {
322
+ echo '</div></div>';
323
+ }
324
+
325
+ echo '<div class="plugin-group"><h3>' . esc_html( $group_name ) . '</h3>';
326
+ // needs an extra wrapping div for nth-child selectors to work
327
+ echo '<div class="plugin-items">';
328
+
329
+ $group = $plugin['group'];
330
+ }
331
+ $title = wp_kses( $plugin['name'], $plugins_allowedtags );
332
+
333
+ // Remove any HTML from the description.
334
+ $description = strip_tags( $plugin['short_description'] );
335
+ $version = wp_kses( $plugin['version'], $plugins_allowedtags );
336
+
337
+ $name = strip_tags( $title . ' ' . $version );
338
+
339
+ $author = wp_kses( $plugin['author'], $plugins_allowedtags );
340
+ if ( ! empty( $author ) ) {
341
+ $author = ' <cite>' . sprintf( __( 'By %s', 'learnpress' ), $author ) . '</cite>';
342
+ }
343
+
344
+ $action_links = array();
345
+ $plugin_file = learn_press_plugin_basename_from_slug( $plugin['slug'] );
346
+
347
+ if ( current_user_can( 'install_plugins' ) || current_user_can( 'update_plugins' ) ) {
348
+
349
+ if( $this->test_mode ){
350
+ $status = array(
351
+ 'status' => file_exists( WP_PLUGIN_DIR . '/' . $plugin['slug'] ) ? 'newer_installed' : 'install' ,
352
+ 'url' => admin_url( 'admin-ajax.php?action=learnpress_plugin_install&plugin=' . $plugin['slug'] )
353
+ );
354
+ }else{
355
+ $status = install_plugin_install_status( $plugin );
356
+ }
357
+
358
+ switch ( $status['status'] ) {
359
+ case 'install':
360
+ if ( $status['url'] ) {
361
+ /* translators: 1: Plugin name and version. */
362
+ $action_links[] = '<a class="install-now button thimpress" data-action="install-now" data-slug="' . esc_attr( $plugin['slug'] ) . '" href="' . esc_url( $status['url'] ) . '&learnpress=active" aria-label="' . esc_attr( sprintf( __( 'Install %s now', 'learnpress' ), $name ) ) . '" data-name="' . esc_attr( $name ) . '">' . __( 'Install and Active', 'learnpress' ) . '</a>';
363
+ }
364
+
365
+ break;
366
+ case 'update_available':
367
+ if ( $status['url'] ) {
368
+ /* translators: 1: Plugin name and version */
369
+ $action_links[] = '<a class="update-now button thimpress" data-action="update-now" data-plugin="' . esc_attr( $status['file'] ) . '" data-slug="' . esc_attr( $plugin['slug'] ) . '" href="' . esc_url( $status['url'] ) . '&learnpress=active" aria-label="' . esc_attr( sprintf( __( 'Update %s now', 'learnpress' ), $name ) ) . '" data-name="' . esc_attr( $name ) . '">' . __( 'Update Now', 'learnpress' ) . '</a>';
370
+ }
371
+
372
+ break;
373
+ case 'latest_installed':
374
+ case 'newer_installed':
375
+ if( is_plugin_active( $plugin_file ) ){
376
+ $action_links[] = '<span class="button button-disabled" title="">' . _x('Enabled', 'plugin') . '</span>';
377
+ }else {
378
+ $action_links[] = '<a class="active-now button thimpress" data-action="active-now" href="'.wp_nonce_url( 'plugins.php?action=activate&learnpress=active&plugin='.$plugin_file, 'activate-plugin_' . $plugin_file ) . '" >' . _x('Enable', 'plugin') . '</a>';
379
+ }
380
+ break;
381
+ }
382
+ }
383
+
384
+ /*$details_link = self_admin_url( 'plugin-install.php?tab=plugin-information&amp;plugin=' . $plugin['slug'] .
385
+ '&amp;TB_iframe=true&amp;width=600&amp;height=550' );
386
+
387
+
388
+ $action_links[] = '<a href="' . esc_url( $details_link ) . '" class="thickbox" aria-label="' . esc_attr( sprintf( __( 'More information about %s' ), $name ) ) . '" data-title="' . esc_attr( $name ) . '">' . __( 'More Details' ) . '</a>';
389
+ */
390
+ if ( !empty( $plugin['icons']['svg'] ) ) {
391
+ $plugin_icon_url = $plugin['icons']['svg'];
392
+ } elseif ( !empty( $plugin['icons']['2x'] ) ) {
393
+ $plugin_icon_url = $plugin['icons']['2x'];
394
+ } elseif ( !empty( $plugin['icons']['1x'] ) ) {
395
+ $plugin_icon_url = $plugin['icons']['1x'];
396
+ } else {
397
+ $plugin_icon_url = $plugin['icons']['default'];
398
+ }
399
+
400
+ /**
401
+ * Filter the install action links for a plugin.
402
+ *
403
+ * @since 2.7.0
404
+ *
405
+ * @param array $action_links An array of plugin action hyperlinks. Defaults are links to Details and Install Now.
406
+ * @param array $plugin The plugin currently being listed.
407
+ */
408
+ $action_links = apply_filters( 'plugin_install_action_links', $action_links, $plugin );
409
+
410
+ $date_format = 'M j, Y @ H:i';
411
+ $last_updated_timestamp = strtotime( $plugin['last_updated'] );
412
+ $details_link = "";
413
+ $message = null;
414
+
415
+ if( 'bundle_activate' == $tab ){
416
+
417
+ if( learn_press_is_plugin_install( $plugin_file ) ) {
418
+
419
+ if (is_plugin_active( $plugin_file )) {
420
+ $message = sprintf('<span class="addon-status enabled">%s</span>', __( 'Enabled', 'learnpress' ));
421
+ } else {
422
+ $message = sprintf('<span class="addon-status disabled">%s</span>', __( 'Disabled', 'learnpress' ));
423
+ }
424
+ }else{
425
+ $message = sprintf('<span class="addon-status not_install">%s</span>', __( 'Not Install', 'learnpress' ));
426
+ }
427
+ }
428
+ ?>
429
+ <div class="plugin-card plugin-card-<?php echo sanitize_html_class( $plugin['slug'] ); ?>">
430
+ <div class="plugin-card-top">
431
+ <a href="<?php echo esc_url( $details_link ); ?>" class="thickbox plugin-icon"><img src="<?php echo esc_attr( $plugin_icon_url ) ?>" /></a>
432
+ <div class="name column-name">
433
+ <h3><a href="<?php echo esc_url( $details_link ); ?>" class="thickbox"><?php echo $title; ?></a></h3>
434
+ </div>
435
+ <div class="action-links">
436
+ <?php
437
+ if ( $action_links ) {
438
+ echo '<ul class="plugin-action-buttons"><li>' . implode( '</li><li>', $action_links ) . '</li></ul>';
439
+ }
440
+ //echo $message;
441
+ ?>
442
+ </div>
443
+ <div class="desc column-description">
444
+ <p><?php echo $description; ?></p>
445
+ <p class="authors"><?php echo $author; ?></p>
446
+ </div>
447
+ </div>
448
+ <div class="plugin-card-bottom">
449
+ <div class="vers column-rating">
450
+ <?php wp_star_rating( array( 'rating' => $plugin['rating'], 'type' => 'percent', 'number' => $plugin['num_ratings'] ) ); ?>
451
+ <span class="num-ratings">(<?php echo number_format_i18n( $plugin['num_ratings'] ); ?>)</span>
452
+ </div>
453
+ <div class="column-updated">
454
+ <strong><?php _e( 'Last Updated:', 'learnpress' ); ?></strong> <span title="<?php echo esc_attr( date_i18n( $date_format, $last_updated_timestamp ) ); ?>">
455
+ <?php printf( __( '%s ago', 'learnpress' ), human_time_diff( $last_updated_timestamp ) ); ?>
456
+ </span>
457
+ </div>
458
+ <div class="column-downloaded">
459
+ <?php
460
+ if ( $plugin['active_installs'] >= 1000000 ) {
461
+ $active_installs_text = _x( '1+ Million', 'Active plugin installs' );
462
+ } else {
463
+ $active_installs_text = number_format_i18n( $plugin['active_installs'] ) . '+';
464
+ }
465
+ printf( __( '%s Active Installs', 'learnpress' ), $active_installs_text );
466
+ ?>
467
+ </div>
468
+ <div class="column-compatibility">
469
+ <?php
470
+ if ( ! empty( $plugin['tested'] ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $plugin['tested'] ) ), $plugin['tested'], '>' ) ) {
471
+ echo '<span class="compatibility-untested">' . __( 'Untested with your version of WordPress', 'learnpress' ) . '</span>';
472
+ } elseif ( ! empty( $plugin['requires'] ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $plugin['requires'] ) ), $plugin['requires'], '<' ) ) {
473
+ echo '<span class="compatibility-incompatible">' . __( '<strong>Incompatible</strong> with your version of WordPress', 'learnpress' ) . '</span>';
474
+ } else {
475
+ echo '<span class="compatibility-compatible">' . __( '<strong>Compatible</strong> with your version of WordPress', 'learnpress' ) . '</span>';
476
+ }
477
+ ?>
478
+ </div>
479
+ </div>
480
+ </div>
481
+ <?php
482
+ }
483
+
484
+ // Close off the group divs of the last one
485
+ if ( ! empty( $group ) ) {
486
+ echo '</div></div>';
487
+ }
488
+ }
489
+ }
inc/admin/class-lp-profile.php ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit; // Exit if accessed directly
4
+ }
5
+
6
+ if ( ! class_exists( 'LP_Profile' ) ) {
7
+ /**
8
+ * Class LP_Profile
9
+ */
10
+ class LP_Profile {
11
+ /**
12
+ * Constructor
13
+ */
14
+ public function __construct() {
15
+ add_filter( 'learn_press_profile_methods', array( $this, 'learn_press_profile_method' ) );
16
+ // add_action( 'wp_loaded', array( $this, 'learn_press_process_profile' ) );
17
+ add_action( 'learn_press_before_profile_content', array( $this, 'learn_press_add_tabs_scripts' ) );
18
+ add_action( 'learn_press_add_profile_tab', array( $this, 'learn_press_add_profile_tab' ) );
19
+ add_filter( 'learn_press_user_info_tab_content', array( $this, 'learn_press_user_info_tab_content' ), 10, 2 );
20
+ add_filter( 'learn_press_user_courses_tab_content', array( $this, 'learn_press_user_courses_tab_content' ), 10, 2 );
21
+ add_filter( 'learn_press_user_quizzes_tab_content', array( $this, 'learn_press_user_quizzes_tab_content' ), 10, 2 );
22
+ add_action( 'learn_press_enrolled_course_after_title', array( $this, 'end_title_content' ), 10, 2 );
23
+ }
24
+
25
+ /**
26
+ * Process profile
27
+ */
28
+ public function learn_press_process_profile() {
29
+ if ( learn_press_has_profile_method() ) {
30
+ if ( learn_press_get_profile_page_id() == 0 ) {
31
+ $profile = array(
32
+ 'post_title' => 'Profile',
33
+ 'post_content' => '[learn_press_profile]',
34
+ 'post_type' => 'page',
35
+ 'post_status' => 'publish',
36
+ );
37
+ $profile_page_id = wp_insert_post( $profile );
38
+ update_post_meta( $profile_page_id, '_lpr_is_profile_page', 1 );
39
+ }
40
+ } else {
41
+ wp_delete_post( learn_press_get_profile_page_id(), true );
42
+ }
43
+ }
44
+
45
+ /*
46
+ * Profile methods
47
+ */
48
+ public function learn_press_profile_method( $methods ) {
49
+ $methods['lpr_profile'] = __( 'LearnPress Profile', 'learnpress' );
50
+
51
+ return $methods;
52
+ }
53
+
54
+ /*
55
+ * Enqueue jquery ui scripts
56
+ */
57
+ public function learn_press_add_tabs_scripts() {
58
+ /*wp_enqueue_style( 'lpr-jquery-ui-css', LP_CSS_URL . 'jquery-ui.css' );
59
+ wp_enqueue_script( 'lpr-jquery-ui-js', LP_JS_URL . 'jquery-ui.js', array( 'jquery' ), '', false );*/
60
+ }
61
+
62
+ /*
63
+ * Add profile tab
64
+ */
65
+ public function learn_press_add_profile_tab( $user ) {
66
+ $content = '';
67
+ $tabs = apply_filters(
68
+ 'learn_press_profile_tabs',
69
+ array(
70
+ 10 => array(
71
+ 'tab_id' => 'user_info',
72
+ 'tab_name' => __( 'User Information', 'learnpress' ),
73
+ 'tab_content' => apply_filters( 'learn_press_user_info_tab_content', $content, $user )
74
+ ),
75
+ 20 => array(
76
+ 'tab_id' => 'user_courses',
77
+ 'tab_name' => __( 'Courses', 'learnpress' ),
78
+ 'tab_content' => apply_filters( 'learn_press_user_courses_tab_content', $content, $user )
79
+ ),
80
+ 30 => array(
81
+ 'tab_id' => 'user_quizzes',
82
+ 'tab_name' => __( 'Quiz Results', 'learnpress' ),
83
+ 'tab_content' => apply_filters( 'learn_press_user_quizzes_tab_content', $content, $user )
84
+ )
85
+ ),
86
+ $user
87
+ );
88
+ ksort( $tabs );
89
+ echo '<ul>';
90
+ foreach ( $tabs as $tab ) {
91
+ echo '<li><a href="#' . $tab['tab_id'] . '">' . $tab['tab_name'] . '</a></li>';
92
+ }
93
+ echo '</ul>';
94
+ foreach ( $tabs as $tab ) {
95
+ echo '<div id="' . $tab['tab_id'] . '">' . $tab['tab_content'] . '</div>';
96
+ }
97
+ }
98
+
99
+ /*
100
+ * Add content for user information tab
101
+ */
102
+ public function learn_press_user_info_tab_content( $content, $user ) {
103
+ ob_start();
104
+ learn_press_get_template( 'profile/user-info.php', array( 'user' => $user ) );
105
+ $content .= ob_get_clean();
106
+ return $content;
107
+ }
108
+
109
+ /*
110
+ * Add content for user courses tab
111
+ */
112
+ public function learn_press_user_courses_tab_content( $content, $user ) {
113
+ ob_start();
114
+ learn_press_get_template( 'profile/user-courses.php', array( 'user' => $user ) );
115
+ $content .= ob_get_clean();
116
+ return $content;
117
+ }
118
+
119
+
120
+ /*
121
+ * Add content for user quiz results tab
122
+ */
123
+ public function learn_press_user_quizzes_tab_content( $content, $user ) {
124
+ ob_start();
125
+ learn_press_get_template( 'profile/user-quizzes.php', array( 'content' => $content, 'user' => $user ) );
126
+ $content .= ob_get_clean();
127
+ return $content;
128
+ }
129
+
130
+ public function end_title_content( $course, $user ) {
131
+ if ( learn_press_user_has_passed_course( $course->ID, $user->ID ) ) {
132
+ _e( '<span class="course-status passed">Passed</span>', 'learnpress' );
133
+ } else {
134
+
135
+ }
136
+ }
137
+ }
138
+ new LP_Profile;
139
+ }
inc/admin/class-lp-upgrader.php ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class LP_Upgrader{
3
+ private $strings;
4
+ function __construct( $directories = array() ){
5
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
6
+ require_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
7
+ if( ! class_exists( 'WP_Upgrader_Skin' ) ){
8
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader-skins.php' );
9
+
10
+ }
11
+
12
+ $this->strings['bad_request'] = __( 'Invalid Data provided.', 'learnpress' );
13
+ $this->strings['fs_unavailable'] = __( 'Could not access filesystem.', 'learnpress' );
14
+ $this->strings['fs_error'] = __( 'Filesystem error.', 'learnpress' );
15
+ $this->strings['fs_no_root_dir'] = __( 'Unable to locate WordPress Root directory.', 'learnpress' );
16
+ $this->strings['fs_no_content_dir'] = __( 'Unable to locate WordPress Content directory (wp-content).', 'learnpress' );
17
+ $this->strings['fs_no_plugins_dir'] = __( 'Unable to locate WordPress Plugin directory.', 'learnpress' );
18
+ $this->strings['fs_no_themes_dir'] = __( 'Unable to locate WordPress Theme directory.', 'learnpress' );
19
+ /* translators: %s: directory name */
20
+ $this->strings['fs_no_folder'] = __( 'Unable to locate needed folder (%s).', 'learnpress' );
21
+
22
+ $this->strings['download_failed'] = __( 'Download failed.', 'learnpress' );
23
+ $this->strings['installing_package'] = __( 'Installing the latest version&#8230;', 'learnpress' );
24
+ $this->strings['no_files'] = __( 'The package contains no files.', 'learnpress' );
25
+ $this->strings['folder_exists'] = __( 'Destination folder already exists.', 'learnpress' );
26
+ $this->strings['mkdir_failed'] = __( 'Could not create directory.', 'learnpress' );
27
+ $this->strings['incompatible_archive'] = __( 'The package could not be installed.', 'learnpress' );
28
+
29
+ $this->strings['maintenance_start'] = __( 'Enabling Maintenance mode&#8230;', 'learnpress' );
30
+ $this->strings['maintenance_end'] = __( 'Disabling Maintenance mode&#8230;', 'learnpress' );
31
+
32
+ $directories = wp_parse_args( $directories, array( WP_CONTENT_DIR ) );
33
+
34
+ $this->fs_connect( $directories );
35
+ }
36
+ public function download_package( $package ) {
37
+
38
+ if ( ! preg_match('!^(http|https|ftp)://!i', $package) && file_exists($package) ) //Local file or remote?
39
+ return $package; //must be a local file..
40
+
41
+ if ( empty($package) )
42
+ return new WP_Error('no_package', $this->strings['no_package']);
43
+
44
+ $download_file = download_url($package);
45
+
46
+ if ( is_wp_error($download_file) )
47
+ return new WP_Error('download_failed', $this->strings['download_failed'], $download_file->get_error_message());
48
+
49
+ return $download_file;
50
+ }
51
+
52
+ public function unpack_package( $package, $delete_package = true, $name = '' ) {
53
+ global $wp_filesystem;
54
+
55
+ $upgrade_folder = $wp_filesystem->wp_content_dir() . 'upgrade/learnpress/';
56
+
57
+ //Clean up contents of upgrade directory beforehand.
58
+ $upgrade_files = $wp_filesystem->dirlist($upgrade_folder);
59
+ if ( !empty($upgrade_files) ) {
60
+ foreach ( $upgrade_files as $file )
61
+ $wp_filesystem->delete($upgrade_folder . $file['name'], true);
62
+ }
63
+
64
+ // We need a working directory - Strip off any .tmp or .zip suffixes
65
+ $working_dir = $upgrade_folder . ( $name ? $name : basename( basename( $package, '.tmp' ), '.zip' ) );
66
+
67
+ // Clean up working directory
68
+ if ( $wp_filesystem->is_dir($working_dir) )
69
+ $wp_filesystem->delete($working_dir, true);
70
+
71
+ // Unzip package to working directory
72
+ $result = unzip_file( $package, $working_dir );
73
+
74
+ // Once extracted, delete the package if required.
75
+ if ( $delete_package )
76
+ unlink($package);
77
+
78
+ if ( is_wp_error($result) ) {
79
+ $wp_filesystem->delete($working_dir, true);
80
+ if ( 'incompatible_archive' == $result->get_error_code() ) {
81
+ return new WP_Error( 'incompatible_archive', '', $result->get_error_data() );
82
+ }
83
+ return $result;
84
+ }
85
+
86
+ return $working_dir;
87
+ }
88
+
89
+ function get_plugin_info( $path, $filename = '' ){
90
+ global $wp_filesystem;
91
+
92
+ $plugin_file = $filename ? basename( $path ) : $filename;
93
+ $basename = basename( basename( $plugin_file, '.tmp' ), '.zip' );
94
+
95
+ $download_path = WP_CONTENT_DIR . '/upgrade';
96
+ $download_file = $download_path . '/' . $plugin_file;
97
+ $working_dir = $download_path . '/' . $basename;
98
+ $readme = $working_dir . '/readme.txt';
99
+ if( ! file_exists( $download_file ) && ! file_exists( $readme ) ){
100
+ //$res = $this->fs_connect( array( $download_path ) );
101
+
102
+ $download_file = download_url( $path );
103
+ if( ! is_wp_error( $download_file ) ){
104
+
105
+ // Unzip package to working directory
106
+ $result = unzip_file( $download_file, $working_dir );
107
+ if( $result ) $readme = $working_dir . '/readme.txt';
108
+ unlink( $download_file );
109
+ }
110
+ }
111
+ $info = false;
112
+ if( file_exists( $readme ) ){
113
+ require_once( dirname( __FILE__ ) . '/includes/class-readme-parse.php' );
114
+ $parse = new WordPress_Readme_Parser( $readme );
115
+ $info = @$parse->parse_readme_contents( file_get_contents( $readme ) );
116
+
117
+ if( file_exists( $file = $working_dir . '/' . $basename . '.php' ) ) {
118
+ $headers = get_plugin_data( $file );
119
+ $info['name'] = $headers['Name'];
120
+ }
121
+ }
122
+ @$wp_filesystem->delete( $working_dir, true );
123
+ return $info;
124
+ }
125
+
126
+ public function fs_connect( $directories = array(), $allow_relaxed_file_ownership = false ) {
127
+ $skin = new WP_Upgrader_Skin();
128
+
129
+ global $wp_filesystem;
130
+
131
+ if ( false === ( $credentials = $skin->request_filesystem_credentials( false, $directories[0], $allow_relaxed_file_ownership ) ) ) {
132
+ return false;
133
+ }
134
+
135
+ if ( ! WP_Filesystem( $credentials, $directories[0], $allow_relaxed_file_ownership ) ) {
136
+ $error = true;
137
+ if ( is_object($wp_filesystem) && $wp_filesystem->errors->get_error_code() )
138
+ $error = $wp_filesystem->errors;
139
+ // Failed to connect, Error and request again
140
+ //$this->skin->request_filesystem_credentials( $error, $directories[0], $allow_relaxed_file_ownership );
141
+ return false;
142
+ }
143
+
144
+ if ( ! is_object($wp_filesystem) )
145
+ return new WP_Error('fs_unavailable', $this->strings['fs_unavailable'] );
146
+
147
+ if ( is_wp_error($wp_filesystem->errors) && $wp_filesystem->errors->get_error_code() )
148
+ return new WP_Error('fs_error', $this->strings['fs_error'], $wp_filesystem->errors);
149
+
150
+ foreach ( (array)$directories as $dir ) {
151
+ switch ( $dir ) {
152
+ case ABSPATH:
153
+ if ( ! $wp_filesystem->abspath() )
154
+ return new WP_Error('fs_no_root_dir', $this->strings['fs_no_root_dir']);
155
+ break;
156
+ case WP_CONTENT_DIR:
157
+ if ( ! $wp_filesystem->wp_content_dir() )
158
+ return new WP_Error('fs_no_content_dir', $this->strings['fs_no_content_dir']);
159
+ break;
160
+ case WP_PLUGIN_DIR:
161
+ if ( ! $wp_filesystem->wp_plugins_dir() )
162
+ return new WP_Error('fs_no_plugins_dir', $this->strings['fs_no_plugins_dir']);
163
+ break;
164
+ case get_theme_root():
165
+ if ( ! $wp_filesystem->wp_themes_dir() )
166
+ return new WP_Error('fs_no_themes_dir', $this->strings['fs_no_themes_dir']);
167
+ break;
168
+ default:
169
+ if ( ! $wp_filesystem->find_folder($dir) )
170
+ return new WP_Error( 'fs_no_folder', sprintf( $this->strings['fs_no_folder'], esc_html( basename( $dir ) ) ) );
171
+ break;
172
+ }
173
+ }
174
+ return true;
175
+ } //end fs_connect();
176
+ }
inc/admin/class-lpr-plugin-install-list-table.php DELETED
@@ -1,421 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Plugin Installer List Table class.
5
- *
6
- * @package WordPress
7
- * @subpackage List_Table
8
- * @since 3.1.0
9
- * @access private
10
- */
11
- class LPR_Plugin_Install_List_Table extends WP_List_Table {
12
-
13
- public $order = 'ASC';
14
- public $orderby = null;
15
- public $groups = array();
16
-
17
- private $test_mode = false;
18
- private $upgrader = false;
19
- public $items; // extended from it parent
20
-
21
- public function ajax_user_can() {
22
- return current_user_can( 'install_plugins' );
23
- }
24
-
25
- /**
26
- * Return a list of slugs of installed plugins, if known.
27
- *
28
- * Uses the transient data from the updates API to determine the slugs of
29
- * known installed plugins. This might be better elsewhere, perhaps even
30
- * within get_plugins().
31
- *
32
- * @since 4.0.0
33
- * @access protected
34
- */
35
- protected function get_installed_plugin_slugs() {
36
- $slugs = array();
37
-
38
- $plugin_info = get_site_transient( 'update_plugins' );
39
- if ( isset( $plugin_info->no_update ) ) {
40
- foreach ( $plugin_info->no_update as $plugin ) {
41
- $slugs[] = $plugin->slug;
42
- }
43
- }
44
-
45
- if ( isset( $plugin_info->response ) ) {
46
- foreach ( $plugin_info->response as $plugin ) {
47
- $slugs[] = $plugin->slug;
48
- }
49
- }
50
-
51
- return $slugs;
52
- }
53
-
54
- private function _get_items_from_wp( $args = array() ) {
55
- $tab = !empty( $_REQUEST['tab'] ) ? $_REQUEST['tab'] : '';
56
- if ( !$tab ) return;
57
- global $learn_press_add_ons;
58
- $plugins = learn_press_get_add_ons_from_wp( $args );
59
- if ( ( $tab == 'bundle_activate' ) && sizeof( $plugins ) ) {
60
-
61
- $_plugins = array_values( $plugins );
62
- $plugins = array();
63
- $bundle_activate = $learn_press_add_ons['bundle_activate'];
64
- for ( $n = sizeof( $_plugins ), $i = $n - 1; $i >= 0; $i -- ) {
65
- foreach ( $bundle_activate as $slug ) {
66
- if ( ( false !== strpos( $slug, $_plugins[$i]->slug ) ) || ( false !== strpos( $_plugins[$i]->slug, $slug ) ) ) {
67
- $plugins[] = $_plugins[$i];
68
- }
69
- }
70
- }
71
- }
72
- $this->items = $plugins;
73
- }
74
-
75
- private function _get_items_from_thimpress( $add_ons ) {
76
- return false;
77
- }
78
-
79
- /**
80
- * Get list of add ons
81
- *
82
- * @param array
83
- */
84
- public function prepare_items( $args = array() ) {
85
- global $learn_press_add_ons;
86
- $this->upgrader = new LPR_Upgrader();
87
-
88
- $page = !empty( $_REQUEST['page'] ) ? $_REQUEST['page'] : '';
89
- $tab = !empty( $_REQUEST['tab'] ) ? $_REQUEST['tab'] : '';
90
- if ( 'learn_press_add_ons' != $page ) return;
91
-
92
- if ( 'more' == $tab ) {
93
- $add_ons = $learn_press_add_ons['more'];
94
- } elseif ( 'bundle_activate' == $tab ) {
95
- $add_ons = $learn_press_add_ons['bundle_activate'];
96
- }
97
- if ( !$this->test_mode ) {
98
- $this->_get_items_from_wp( $args );
99
- } else {
100
- $this->_get_items_from_thimpress( $add_ons );
101
- }
102
- }
103
-
104
-
105
- public function no_items() {
106
- $message = __( 'No plugins found.', 'learn_press' );
107
-
108
- echo '<div class="no-plugin-results">' . $message . '</div>';
109
- }
110
-
111
- protected function get_views() {
112
- global $tabs, $tab;
113
-
114
- $display_tabs = array();
115
- foreach ( (array) $tabs as $action => $text ) {
116
- $class = ( $action == $tab ) ? ' current' : '';
117
- $href = self_admin_url( 'plugin-install.php?tab=' . $action );
118
- $display_tabs['plugin-install-' . $action] = "<a href='$href' class='$class'>$text</a>";
119
- }
120
- // No longer a real tab.
121
- unset( $display_tabs['plugin-install-upload'] );
122
-
123
- return $display_tabs;
124
- }
125
-
126
- /**
127
- * Override parent views so we can use the filter bar display.
128
- */
129
- public function views() {
130
- $views = $this->get_views();
131
-
132
- /** This filter is documented in wp-admin/inclues/class-wp-list-table.php */
133
- $views = apply_filters( "views_{$this->screen->id}", $views );
134
-
135
- ?>
136
- <div class="wp-filter">
137
- <ul class="filter-links">
138
- <?php
139
- if ( !empty( $views ) ) {
140
- foreach ( $views as $class => $view ) {
141
- $views[$class] = "\t<li class='$class'>$view";
142
- }
143
- echo implode( " </li>\n", $views ) . "</li>\n";
144
- }
145
- ?>
146
- </ul>
147
-
148
- <?php install_search_form( isset( $views['plugin-install-search'] ) ); ?>
149
- </div>
150
- <?php
151
- }
152
-
153
- /**
154
- * Override the parent display() so we can provide a different container.
155
- */
156
- public function display() {
157
- $data_attr = '';
158
- ?>
159
- <div class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
160
-
161
- <div id="the-list"<?php echo $data_attr; ?>>
162
- <?php $this->display_rows_or_placeholder(); ?>
163
- </div>
164
- </div>
165
- <?php
166
- $this->display_tablenav( 'bottom' );
167
- }
168
-
169
- /**
170
- * @param string $which
171
- */
172
- protected function display_tablenav( $which ) {
173
- if ( 'top' == $which ) {
174
- wp_referer_field();
175
- ?>
176
- <div class="tablenav top">
177
- <div class="alignleft actions">
178
- <?php
179
- /**
180
- * Fires before the Plugin Install table header pagination is displayed.
181
- *
182
- * @since 2.7.0
183
- */
184
- do_action( 'install_plugins_table_header' ); ?>
185
- </div>
186
- <?php $this->pagination( $which ); ?>
187
- <br class="clear" />
188
- </div>
189
- <?php } else { ?>
190
- <div class="tablenav bottom">
191
- <?php $this->pagination( $which ); ?>
192
- <br class="clear" />
193
- </div>
194
- <?php
195
- }
196
- }
197
-
198
- protected function get_table_classes() {
199
- return array( 'widefat', $this->_args['plural'] );
200
- }
201
-
202
- public function get_columns() {
203
- return array();
204
- }
205
-
206
- /**
207
- * @param object $plugin_a
208
- * @param object $plugin_b
209
- *
210
- * @return int
211
- */
212
- private function order_callback( $plugin_a, $plugin_b ) {
213
- $orderby = $this->orderby;
214
- if ( !isset( $plugin_a->$orderby, $plugin_b->$orderby ) ) {
215
- return 0;
216
- }
217
-
218
- $a = $plugin_a->$orderby;
219
- $b = $plugin_b->$orderby;
220
-
221
- if ( $a == $b ) {
222
- return 0;
223
- }
224
-
225
- if ( 'DESC' == $this->order ) {
226
- return ( $a < $b ) ? 1 : - 1;
227
- } else {
228
- return ( $a < $b ) ? - 1 : 1;
229
- }
230
- }
231
-
232
- public function display_rows() {
233
- $plugins_allowedtags = array(
234
- 'a' => array( 'href' => array(), 'title' => array(), 'target' => array() ),
235
- 'abbr' => array( 'title' => array() ), 'acronym' => array( 'title' => array() ),
236
- 'code' => array(), 'pre' => array(), 'em' => array(), 'strong' => array(),
237
- 'ul' => array(), 'ol' => array(), 'li' => array(), 'p' => array(), 'br' => array()
238
- );
239
-
240
- $plugins_group_titles = array(
241
- 'Performance' => _x( 'Performance', 'Plugin installer group title' ),
242
- 'Social' => _x( 'Social', 'Plugin installer group title' ),
243
- 'Tools' => _x( 'Tools', 'Plugin installer group title' ),
244
- );
245
-
246
- $tab = !empty( $_REQUEST['tab'] ) ? $_REQUEST['tab'] : '';
247
- $group = null;
248
-
249
- foreach ( (array) $this->items as $kk => $plugin ) {
250
- if ( is_object( $plugin ) ) {
251
- $plugin = (array) $plugin;
252
- }
253
-
254
- // Display the group heading if there is one
255
- if ( isset( $plugin['group'] ) && $plugin['group'] != $group ) {
256
- if ( isset( $this->groups[$plugin['group']] ) ) {
257
- $group_name = $this->groups[$plugin['group']];
258
- if ( isset( $plugins_group_titles[$group_name] ) ) {
259
- $group_name = $plugins_group_titles[$group_name];
260
- }
261
- } else {
262
- $group_name = $plugin['group'];
263
- }
264
-
265
- // Starting a new group, close off the divs of the last one
266
- if ( !empty( $group ) ) {
267
- echo '</div></div>';
268
- }
269
-
270
- echo '<div class="plugin-group"><h3>' . esc_html( $group_name ) . '</h3>';
271
- // needs an extra wrapping div for nth-child selectors to work
272
- echo '<div class="plugin-items">';
273
-
274
- $group = $plugin['group'];
275
- }
276
- $title = wp_kses( $plugin['name'], $plugins_allowedtags );
277
-
278
- // Remove any HTML from the description.
279
- $description = strip_tags( $plugin['short_description'] );
280
- $version = wp_kses( $plugin['version'], $plugins_allowedtags );
281
-
282
- $name = strip_tags( $title . ' ' . $version );
283
-
284
- $author = wp_kses( $plugin['author'], $plugins_allowedtags );
285
- if ( !empty( $author ) ) {
286
- $author = ' <cite>' . sprintf( __( 'By %s', 'learn_press' ), $author ) . '</cite>';
287
- }
288
-
289
- $action_links = array();
290
- $plugin_file = learn_press_plugin_basename_from_slug( $plugin['slug'] );
291
-
292
- if ( current_user_can( 'install_plugins' ) || current_user_can( 'update_plugins' ) ) {
293
- $status = install_plugin_install_status( $plugin );
294
- switch ( $status['status'] ) {
295
- case 'install':
296
- if ( $status['url'] ) {
297
- /* translators: 1: Plugin name and version. */
298
- $action_links[] = '<a class="install-now button thimpress" data-action="install-now" data-slug="' . esc_attr( $plugin['slug'] ) . '" href="' . esc_url( $status['url'] ) . '&learnpress=active" aria-label="' . esc_attr( sprintf( __( 'Install %s now', 'learn_press' ), $name ) ) . '" data-name="' . esc_attr( $name ) . '">' . __( 'Install and Active', 'learn_press' ) . '</a>';
299
- }
300
-
301
- break;
302
- case 'update_available':
303
- if ( $status['url'] ) {
304
- /* translators: 1: Plugin name and version */
305
- $action_links[] = '<a class="update-now button thimpress" data-action="update-now" data-plugin="' . esc_attr( $status['file'] ) . '" data-slug="' . esc_attr( $plugin['slug'] ) . '" href="' . esc_url( $status['url'] ) . '&learnpress=active" aria-label="' . esc_attr( sprintf( __( 'Update %s now', 'learn_press' ), $name ) ) . '" data-name="' . esc_attr( $name ) . '">' . __( 'Update Now', 'learn_press' ) . '</a>';
306
- }
307
-
308
- break;
309
- case 'latest_installed':
310
- case 'newer_installed':
311
- if ( is_plugin_active( $plugin_file ) ) {
312
- $action_links[] = '<span class="button button-disabled" title="">' . _x( 'Enabled', 'plugin' ) . '</span>';
313
- } else {
314
- $action_links[] = '<a class="active-now button thimpress" data-action="active-now" href="' . wp_nonce_url( 'plugins.php?action=activate&learnpress=active&plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file ) . '" >' . _x( 'Enable', 'plugin' ) . '</a>';
315
- }
316
- break;
317
- }
318
- }
319
- if ( !empty( $plugin['icons']['svg'] ) ) {
320
- $plugin_icon_url = $plugin['icons']['svg'];
321
- } elseif ( !empty( $plugin['icons']['2x'] ) ) {
322
- $plugin_icon_url = $plugin['icons']['2x'];
323
- } elseif ( !empty( $plugin['icons']['1x'] ) ) {
324
- $plugin_icon_url = $plugin['icons']['1x'];
325
- } else {
326
- $plugin_icon_url = $plugin['icons']['default'];
327
- }
328
-
329
- /**
330
- * Filter the install action links for a plugin.
331
- *
332
- * @since 2.7.0
333
- *
334
- * @param array $action_links An array of plugin action hyperlinks. Defaults are links to Details and Install Now.
335
- * @param array $plugin The plugin currently being listed.
336
- */
337
- $action_links = apply_filters( 'plugin_install_action_links', $action_links, $plugin );
338
-
339
- $date_format = 'M j, Y @ H:i';
340
- $last_updated_timestamp = strtotime( $plugin['last_updated'] );
341
- $details_link = "";
342
- $message = null;
343
-
344
- if ( 'bundle_activate' == $tab ) {
345
-
346
- if ( learn_press_is_plugin_install( $plugin_file ) ) {
347
-
348
- if ( is_plugin_active( $plugin_file ) ) {
349
- $message = sprintf( '<span class="addon-status enabled">%s</span>', __( 'Enabled', 'learn_press' ) );
350
- } else {
351
- $message = sprintf( '<span class="addon-status disabled">%s</span>', __( 'Disabled', 'learn_press' ) );
352
- }
353
- } else {
354
- $message = sprintf( '<span class="addon-status not_install">%s</span>', __( 'Not Install', 'learn_press' ) );
355
- }
356
- }
357
- ?>
358
- <div class="plugin-card plugin-card-<?php echo sanitize_html_class( $plugin['slug'] ); ?>">
359
- <div class="plugin-card-top">
360
- <a href="<?php echo esc_url( $details_link ); ?>" class="thickbox plugin-icon"><img src="<?php echo esc_attr( $plugin_icon_url ) ?>" /></a>
361
-
362
- <div class="name column-name">
363
- <h4><a href="<?php echo esc_url( $details_link ); ?>" class="thickbox"><?php echo $title; ?></a>
364
- </h4>
365
- </div>
366
- <div class="action-links">
367
- <?php
368
- if ( $action_links ) {
369
- echo '<ul class="plugin-action-buttons"><li>' . implode( '</li><li>', $action_links ) . '</li></ul>';
370
- }
371
- //echo $message;
372
- ?>
373
- </div>
374
- <div class="desc column-description">
375
- <p><?php echo $description; ?></p>
376
-
377
- <p class="authors"><?php echo $author; ?></p>
378
- </div>
379
- </div>
380
- <div class="plugin-card-bottom">
381
- <div class="vers column-rating">
382
- <?php wp_star_rating( array( 'rating' => $plugin['rating'], 'type' => 'percent', 'number' => $plugin['num_ratings'] ) ); ?>
383
- <span class="num-ratings">(<?php echo number_format_i18n( $plugin['num_ratings'] ); ?>)</span>
384
- </div>
385
- <div class="column-updated">
386
- <strong><?php _e( 'Last Updated:', 'learn_press' ); ?></strong> <span title="<?php echo esc_attr( date_i18n( $date_format, $last_updated_timestamp ) ); ?>">
387
- <?php printf( __( '%s ago', 'learn_press' ), human_time_diff( $last_updated_timestamp ) ); ?>
388
- </span>
389
- </div>
390
- <div class="column-downloaded">
391
- <?php
392
- if ( $plugin['active_installs'] >= 1000000 ) {
393
- $active_installs_text = _x( '1+ Million', 'Active plugin installs' );
394
- } else {
395
- $active_installs_text = number_format_i18n( $plugin['active_installs'] ) . '+';
396
- }
397
- printf( __( '%s Active Installs', 'learn_press' ), $active_installs_text );
398
- ?>
399
- </div>
400
- <div class="column-compatibility">
401
- <?php
402
- if ( !empty( $plugin['tested'] ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $plugin['tested'] ) ), $plugin['tested'], '>' ) ) {
403
- echo '<span class="compatibility-untested">' . __( 'Untested with your version of WordPress', 'learn_press' ) . '</span>';
404
- } elseif ( !empty( $plugin['requires'] ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $plugin['requires'] ) ), $plugin['requires'], '<' ) ) {
405
- echo '<span class="compatibility-incompatible">' . __( '<strong>Incompatible</strong> with your version of WordPress', 'learn_press' ) . '</span>';
406
- } else {
407
- echo '<span class="compatibility-compatible">' . __( '<strong>Compatible</strong> with your version of WordPress', 'learn_press' ) . '</span>';
408
- }
409
- ?>
410
- </div>
411
- </div>
412
- </div>
413
- <?php
414
- }
415
-
416
- // Close off the group divs of the last one
417
- if ( !empty( $group ) ) {
418
- echo '</div></div>';
419
- }
420
- }
421
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/admin/class-lpr-upgrader.php DELETED
@@ -1,176 +0,0 @@
1
- <?php
2
- class LPR_Upgrader{
3
- private $strings;
4
- function __construct( $directories = array() ){
5
- require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
6
- require_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
7
- if( ! class_exists( 'WP_Upgrader_Skin' ) ){
8
- require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader-skins.php' );
9
-
10
- }
11
-
12
- $this->strings['bad_request'] = __('Invalid Data provided.', 'learn_press' );
13
- $this->strings['fs_unavailable'] = __('Could not access filesystem.', 'learn_press' );
14
- $this->strings['fs_error'] = __('Filesystem error.', 'learn_press' );
15
- $this->strings['fs_no_root_dir'] = __('Unable to locate WordPress Root directory.', 'learn_press' );
16
- $this->strings['fs_no_content_dir'] = __('Unable to locate WordPress Content directory (wp-content).', 'learn_press' );
17
- $this->strings['fs_no_plugins_dir'] = __('Unable to locate WordPress Plugin directory.', 'learn_press' );
18
- $this->strings['fs_no_themes_dir'] = __('Unable to locate WordPress Theme directory.', 'learn_press' );
19
- /* translators: %s: directory name */
20
- $this->strings['fs_no_folder'] = __('Unable to locate needed folder (%s).', 'learn_press' );
21
-
22
- $this->strings['download_failed'] = __('Download failed.', 'learn_press' );
23
- $this->strings['installing_package'] = __('Installing the latest version&#8230;', 'learn_press' );
24
- $this->strings['no_files'] = __('The package contains no files.', 'learn_press' );
25
- $this->strings['folder_exists'] = __('Destination folder already exists.', 'learn_press' );
26
- $this->strings['mkdir_failed'] = __('Could not create directory.', 'learn_press' );
27
- $this->strings['incompatible_archive'] = __('The package could not be installed.', 'learn_press' );
28
-
29
- $this->strings['maintenance_start'] = __('Enabling Maintenance mode&#8230;', 'learn_press' );
30
- $this->strings['maintenance_end'] = __('Disabling Maintenance mode&#8230;', 'learn_press' );
31
-
32
- $directories = wp_parse_args( $directories, array( WP_CONTENT_DIR ) );
33
-
34
- $this->fs_connect( $directories );
35
- }
36
- public function download_package( $package ) {
37
-
38
- if ( ! preg_match('!^(http|https|ftp)://!i', $package) && file_exists($package) ) //Local file or remote?
39
- return $package; //must be a local file..
40
-
41
- if ( empty($package) )
42
- return new WP_Error('no_package', $this->strings['no_package']);
43
-
44
- $download_file = download_url($package);
45
-
46
- if ( is_wp_error($download_file) )
47
- return new WP_Error('download_failed', $this->strings['download_failed'], $download_file->get_error_message());
48
-
49
- return $download_file;
50
- }
51
-
52
- public function unpack_package( $package, $delete_package = true, $name = '' ) {
53
- global $wp_filesystem;
54
-
55
- $upgrade_folder = $wp_filesystem->wp_content_dir() . 'upgrade/learnpress/';
56
-
57
- //Clean up contents of upgrade directory beforehand.
58
- $upgrade_files = $wp_filesystem->dirlist($upgrade_folder);
59
- if ( !empty($upgrade_files) ) {
60
- foreach ( $upgrade_files as $file )
61
- $wp_filesystem->delete($upgrade_folder . $file['name'], true);
62
- }
63
-
64
- // We need a working directory - Strip off any .tmp or .zip suffixes
65
- $working_dir = $upgrade_folder . ( $name ? $name : basename( basename( $package, '.tmp' ), '.zip' ) );
66
-
67
- // Clean up working directory
68
- if ( $wp_filesystem->is_dir($working_dir) )
69
- $wp_filesystem->delete($working_dir, true);
70
-
71
- // Unzip package to working directory
72
- $result = unzip_file( $package, $working_dir );
73
-
74
- // Once extracted, delete the package if required.
75
- if ( $delete_package )
76
- unlink($package);
77
-
78
- if ( is_wp_error($result) ) {
79
- $wp_filesystem->delete($working_dir, true);
80
- if ( 'incompatible_archive' == $result->get_error_code() ) {
81
- return new WP_Error( 'incompatible_archive', '', $result->get_error_data() );
82
- }
83
- return $result;
84
- }
85
-
86
- return $working_dir;
87
- }
88
-
89
- function get_plugin_info( $path, $filename = '' ){
90
- global $wp_filesystem;
91
-
92
- $plugin_file = $filename ? basename( $path ) : $filename;
93
- $basename = basename( basename( $plugin_file, '.tmp' ), '.zip' );
94
-
95
- $download_path = WP_CONTENT_DIR . '/upgrade';
96
- $download_file = $download_path . '/' . $plugin_file;
97
- $working_dir = $download_path . '/' . $basename;
98
- $readme = $working_dir . '/readme.txt';
99
- if( ! file_exists( $download_file ) && ! file_exists( $readme ) ){
100
- //$res = $this->fs_connect( array( $download_path ) );
101
-
102
- $download_file = download_url( $path );
103
- if( ! is_wp_error( $download_file ) ){
104
-
105
- // Unzip package to working directory
106
- $result = unzip_file( $download_file, $working_dir );
107
- if( $result ) $readme = $working_dir . '/readme.txt';
108
- unlink( $download_file );
109
- }
110
- }
111
- $info = false;
112
- if( file_exists( $readme ) ){
113
- require_once( dirname( __FILE__ ) . '/includes/class-readme-parse.php' );
114
- $parse = new WordPress_Readme_Parser( $readme );
115
- $info = @$parse->parse_readme_contents( file_get_contents( $readme ) );
116
-
117
- if( file_exists( $file = $working_dir . '/' . $basename . '.php' ) ) {
118
- $headers = get_plugin_data( $file );
119
- $info['name'] = $headers['Name'];
120
- }
121
- }
122
- @$wp_filesystem->delete( $working_dir, true );
123
- return $info;
124
- }
125
-
126
- public function fs_connect( $directories = array(), $allow_relaxed_file_ownership = false ) {
127
- $skin = new WP_Upgrader_Skin();
128
-
129
- global $wp_filesystem;
130
-
131
- if ( false === ( $credentials = $skin->request_filesystem_credentials( false, $directories[0], $allow_relaxed_file_ownership ) ) ) {
132
- return false;
133
- }
134
-
135
- if ( ! WP_Filesystem( $credentials, $directories[0], $allow_relaxed_file_ownership ) ) {
136
- $error = true;
137
- if ( is_object($wp_filesystem) && $wp_filesystem->errors->get_error_code() )
138
- $error = $wp_filesystem->errors;
139
- // Failed to connect, Error and request again
140
- //$this->skin->request_filesystem_credentials( $error, $directories[0], $allow_relaxed_file_ownership );
141
- return false;
142
- }
143
-
144
- if ( ! is_object($wp_filesystem) )
145
- return new WP_Error('fs_unavailable', $this->strings['fs_unavailable'] );
146
-
147
- if ( is_wp_error($wp_filesystem->errors) && $wp_filesystem->errors->get_error_code() )
148
- return new WP_Error('fs_error', $this->strings['fs_error'], $wp_filesystem->errors);
149
-
150
- foreach ( (array)$directories as $dir ) {
151
- switch ( $dir ) {
152
- case ABSPATH:
153
- if ( ! $wp_filesystem->abspath() )
154
- return new WP_Error('fs_no_root_dir', $this->strings['fs_no_root_dir']);
155
- break;
156
- case WP_CONTENT_DIR:
157
- if ( ! $wp_filesystem->wp_content_dir() )
158
- return new WP_Error('fs_no_content_dir', $this->strings['fs_no_content_dir']);
159
- break;
160
- case WP_PLUGIN_DIR:
161
- if ( ! $wp_filesystem->wp_plugins_dir() )
162
- return new WP_Error('fs_no_plugins_dir', $this->strings['fs_no_plugins_dir']);
163
- break;
164
- case get_theme_root():
165
- if ( ! $wp_filesystem->wp_themes_dir() )
166
- return new WP_Error('fs_no_themes_dir', $this->strings['fs_no_themes_dir']);
167
- break;
168
- default:
169
- if ( ! $wp_filesystem->find_folder($dir) )
170
- return new WP_Error( 'fs_no_folder', sprintf( $this->strings['fs_no_folder'], esc_html( basename( $dir ) ) ) );
171
- break;
172
- }
173
- }
174
- return true;
175
- } //end fs_connect();
176
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/admin/class.lpr-admin-ajax.php DELETED
@@ -1,311 +0,0 @@
1
- <?php
2
-
3
- if ( !defined( 'ABSPATH' ) ) {
4
- exit; // Exit if accessed directly
5
- }
6
-
7
- if ( !class_exists( 'LPR_Admin_Ajax' ) ) {
8
-
9
- /**
10
- * Class LPR_Admin_Ajax
11
- */
12
- class LPR_Admin_Ajax {
13
- /**
14
- * Add action ajax
15
- */
16
- public static function init() {
17
- $ajaxEvents = array(
18
- 'quick_add_lesson' => false,
19
- 'quick_add_quiz' => false,
20
- 'be_teacher' => false,
21
- 'custom_stats' => false,
22
- 'ignore_setting_up' => false,
23
- 'create_page' => false,
24
- 'get_page_permalink' => false,
25
- 'dummy_image' => false,
26
- 'update_add_on_status' => false,
27
- 'plugin_install' => false,
28
- 'bundle_activate_add_ons' => false,
29
- 'install_sample_data' => false,
30
- 'convert_question_type' => false
31
- );
32
- foreach ( $ajaxEvents as $ajaxEvent => $nopriv ) {
33
- add_action( 'wp_ajax_learnpress_' . $ajaxEvent, array( __CLASS__, $ajaxEvent ) );
34
-
35
- // enable for non-logged in users
36
- if ( $nopriv ) {
37
- add_action( 'wp_ajax_nopriv_learnpress_' . $ajaxEvent, array( __CLASS__, $ajaxEvent ) );
38
- }
39
- }
40
- }
41
-
42
- public static function convert_question_type(){
43
- if( ( $from = learn_press_get_request( 'from' ) ) && ( $to = learn_press_get_request( 'to' ) ) && $question_id = learn_press_get_request( 'question_id' ) ){
44
- do_action( 'learn_press_convert_question_type', $question_id, $from, $to );
45
- $question = LPR_Question_Factory::instance()->get_question( $question_id );
46
- ob_start();
47
- $question->admin_interface();
48
- $output = ob_get_clean();
49
- learn_press_send_json(
50
- $output
51
- );
52
- }else{
53
- throw new Exception( __( 'Convert question type must be specify the id, source and destination type', 'learn_press' ) );
54
- }
55
- die();
56
- }
57
-
58
- /**
59
- * Install sample data or dismiss the notice depending on user's option
60
- */
61
- static function install_sample_data() {
62
-
63
- $yes = !empty( $_REQUEST['yes'] ) ? $_REQUEST['yes'] : '';
64
- $response = array();
65
- if ( 'false' == $yes ) {
66
- set_transient( 'learn_press_install_sample_data', 'off', 12 * HOUR_IN_SECONDS );
67
- $response['hide_notice'] = true;
68
- } else {
69
- $result = learn_press_install_and_active_add_on( 'learnpress-import-export' );
70
- if ( 'activate' == $result['status'] ) {
71
- if ( !class_exists( 'LPR_Import' ) ) {
72
- $import_file_lib = WP_PLUGIN_DIR . "/learnpress-import-export/incs/lpr-import.php";
73
- if ( file_exists( $import_file_lib ) ) {
74
- include_once WP_PLUGIN_DIR . "/learnpress-import-export/incs/lpr-import.php";
75
- }
76
- }
77
- if ( !class_exists( 'LPR_Import' ) ) {
78
- $response['error'] = __( 'Import/Export addon not found', 'learn_press' );
79
- } else {
80
- global $wp_filesystem;
81
- if( !$wp_filesystem && function_exists( 'WP_Filesystem' ) ){
82
- WP_Filesystem();
83
- }
84
- $import_source = LPR_PLUGIN_PATH . '/dummy-data/learnpress-how-to-use-learnpress.xml';
85
- $upload_dir = wp_upload_dir();
86
- $copy = $upload_dir['path'] . '/learnpress-how-to-use-learnpress-copy.xml';
87
- $xml = $wp_filesystem->get_contents( $import_source );
88
- $xml = preg_replace( '#(wp-content\/plugins\/learnpress\/dummy-data)#', get_site_url() . '/$1', $xml );
89
- $wp_filesystem->put_contents( $copy, $xml );
90
- //@copy( $import_source, $copy );
91
- if ( file_exists( $copy ) ) {
92
- $importer = new LPR_Import();
93
- $result = $importer->import( $copy );
94
- if ( $result == 1 ) {
95
- $response['success'] = __( 'Import sample data successfully. The page will reload now!', 'learn_press' );
96
- $response['redirect'] = admin_url( 'edit.php?post_type=lpr_course' );
97
- } else {
98
- $response['error'] = __( 'Unknown error when importing sample data. Please try again!', 'learn_press' );
99
- }
100
- } else {
101
- $response['error'] = __( 'Dummy sample data not found. Please try again!', 'learn_press' );
102
- }
103
- }
104
- } else {
105
- $response['error'] = __( 'Unknown error when installing/activating Import/Export addon. Please try again!', 'learn_press' );
106
- }
107
- }
108
- learn_press_send_json( $response );
109
- die();
110
- }
111
-
112
- /**
113
- * Activate a bundle of add-ons, if an add-on is not installed then install it first
114
- */
115
- static function bundle_activate_add_ons() {
116
- global $learn_press_add_ons;
117
- include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' ); //for plugins_api..
118
- $response = array( 'addons' => array() );
119
-
120
- if ( !current_user_can( 'activate_plugins' ) ) {
121
- $response['error'] = __( 'You do not have sufficient permissions to deactivate plugins for this site.', 'learn_press' );
122
- } else {
123
-
124
- $add_ons = $learn_press_add_ons['bundle_activate'];
125
-
126
- if ( $add_ons ) {
127
- foreach ( $add_ons as $slug ) {
128
- $response['addons'][$slug] = learn_press_install_and_active_add_on( $slug );
129
- }
130
- }
131
- }
132
- learn_press_send_json( $response );
133
- }
134
-
135
- /**
136
- * Activate a bundle of add-ons, if an add-on is not installed then install it first
137
- */
138
- static function bundle_activate_add_on() {
139
- $response = array();
140
- include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' ); //for plugins_api..
141
- if ( !current_user_can( 'activate_plugins' ) ) {
142
- $response['error'] = __( 'You do not have sufficient permissions to deactivate plugins for this site.', 'learn_press' );
143
- } else {
144
- $slug = !empty( $_REQUEST['plugin'] ) ? $_REQUEST['plugin'] : null;
145
- $response[$slug] = learn_press_install_and_active_add_on( $slug );
146
- }
147
- learn_press_send_json( $response );
148
- }
149
-
150
- static function plugin_install() {
151
- $plugin_name = !empty( $_REQUEST['plugin'] ) ? $_REQUEST['plugin'] : '';
152
- $response = learn_press_install_add_on( $plugin_name );
153
- learn_press_send_json( $response );
154
- die();
155
- }
156
-
157
- static function update_add_on_status() {
158
- $plugin = !empty( $_REQUEST['plugin'] ) ? $_REQUEST['plugin'] : '';
159
- $t = !empty( $_REQUEST['t'] ) ? $_REQUEST['t'] : '';
160
- $response = array();
161
- if ( !current_user_can( 'activate_plugins' ) ) {
162
- $response['error'] = __( 'You do not have sufficient permissions to deactivate plugins for this site.', 'learn_press' );
163
- }
164
- if ( $plugin && $t ) {
165
- if ( $t == 'activate' ) {
166
- activate_plugin( $plugin, false, is_network_admin() );
167
- } else {
168
- deactivate_plugins( $plugin, false, is_network_admin() );
169
- }
170
- $is_activate = is_plugin_active( $plugin );
171
- $response['status'] = $is_activate ? 'activate' : 'deactivate';
172
-
173
- }
174
- wp_send_json( $response );
175
- die();
176
- }
177
-
178
- /**
179
- * Output the image to browser with text and params passed via $_GET
180
- */
181
- public static function dummy_image() {
182
- $text = !empty( $_REQUEST['text'] ) ? $_REQUEST['text'] : '';
183
- learn_press_text_image( $text, $_GET );
184
- die();
185
- }
186
-
187
- /**
188
- * Get edit|view link of a page
189
- */
190
- public static function get_page_permalink() {
191
- $page_id = !empty( $_REQUEST['page_id'] ) ? $_REQUEST['page_id'] : '';
192
- ?>
193
- <a href="<?php echo get_edit_post_link( $page_id ); ?>" target="_blank"><?php _e( 'Edit Page', 'learn_press' ); ?></a>
194
- <a href="<?php echo get_permalink( $page_id ); ?>" target="_blank"><?php _e( 'View Page', 'learn_press' ); ?></a>
195
- <?php
196
- die();
197
- }
198
-
199
- /**
200
- * Create a new page with the title passed via $_REQUEST
201
- */
202
- public static function create_page() {
203
- $title = !empty( $_REQUEST['title'] ) ? $_REQUEST['title'] : '';
204
- $response = array();
205
- if ( $title ) {
206
- $args = array(
207
- 'post_type' => 'page',
208
- 'post_title' => $title,
209
- 'post_status' => 'publish'
210
- );
211
- $page_id = wp_insert_post( $args );
212
- $response['page'] = get_page( $page_id );
213
- $html = learn_press_pages_dropdown( '', '', array( 'echo' => false ) );
214
- preg_match_all( '!value=\"([0-9]+)\"!', $html, $matches );
215
- $response['ordering'] = $matches[1];
216
- $response['html'] = '<a href="' . get_edit_post_link( $page_id ) . '" target="_blank">' . __( 'Edit Page', 'learn_press' ) . '</a>&nbsp;';
217
- $response['html'] .= '<a href="' . get_permalink( $page_id ) . '" target="_blank">' . __( 'View Page', 'learn_press' ) . '</a>';
218
- } else {
219
- $response['error'] = __( 'Page name is empty!', 'learn_press' );
220
- }
221
- wp_send_json( $response );
222
- die();
223
- }
224
-
225
- /**
226
- *
227
- */
228
- public function custom_stats() {
229
- $from = !empty( $_REQUEST['from'] ) ? $_REQUEST['from'] : 0;
230
- $to = !empty( $_REQUEST['to'] ) ? $_REQUEST['to'] : 0;
231
- $date_diff = strtotime( $to ) - strtotime( $from );
232
- if ( $date_diff <= 0 || $from == 0 || $to == 0 ) {
233
- die();
234
- }
235
- learn_press_process_chart( learn_press_get_chart_students( $to, 'days', floor( $date_diff / ( 60 * 60 * 24 ) ) + 1 ) );
236
- die();
237
- }
238
-
239
- /**
240
- * Quick add lesson with only title
241
- */
242
- public static function quick_add_lesson() {
243
-
244
- $lesson_title = $_POST['lesson_title'];
245
-
246
- $new_lesson = array(
247
- 'post_title' => wp_strip_all_tags( $lesson_title ),
248
- 'post_type' => 'lpr_lesson',
249
- 'post_status' => 'publish'
250
- );
251
-
252
- wp_insert_post( $new_lesson );
253
-
254
- $args = array(
255
- 'numberposts' => 1,
256
- 'post_type' => 'lpr_lesson',
257
- 'post_status' => 'publish'
258
- );
259
- $lesson = wp_get_recent_posts( $args );
260
- $lesson_id = $lesson[0]['ID'];
261
- $data = array(
262
- 'id' => $lesson_id,
263
- 'title' => $lesson_title
264
- );
265
- wp_send_json( $data );
266
- die;
267
- }
268
-
269
- /**
270
- * Add a new quiz with the title only
271
- */
272
- public static function quick_add_quiz() {
273
- $quiz_title = $_POST['quiz_title'];
274
-
275
- $new_quiz = array(
276
- 'post_title' => wp_strip_all_tags( $quiz_title ),
277
- 'post_type' => 'lpr_quiz',
278
- 'post_status' => 'publish'
279
- );
280
-
281
- wp_insert_post( $new_quiz );
282
-
283
- $args = array(
284
- 'numberposts' => 1,
285
- 'post_type' => 'lpr_quiz',
286
- 'post_status' => 'publish'
287
- );
288
- $quiz = wp_get_recent_posts( $args );
289
- $quiz_id = $quiz[0]['ID'];
290
- $data = array(
291
- 'id' => $quiz_id,
292
- 'title' => $quiz_title
293
- );
294
- wp_send_json( $data );
295
- die;
296
- }
297
-
298
- public static function be_teacher() {
299
- $user_id = get_current_user_id();
300
- $be_teacher = new WP_User( $user_id );
301
- $be_teacher->set_role( 'lpr_teacher' );
302
- die;
303
- }
304
-
305
- public static function ignore_setting_up() {
306
- update_option( '_lpr_ignore_setting_up', 1, true );
307
- die;
308
- }
309
- }
310
- }
311
- LPR_Admin_Ajax::init();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/admin/class.lpr-admin-assets.php DELETED
@@ -1,146 +0,0 @@
1
- <?php
2
- if ( !defined( 'ABSPATH' ) ) {
3
- exit; // Exit if accessed directly
4
- }
5
- if ( !class_exists( 'LPR_Admin_Assets' ) ) {
6
- /**
7
- * Class LPR_Admin_Assets
8
- */
9
- class LPR_Admin_Assets {
10
-
11
- // styles
12
- private static $styles = array();
13
-
14
- // scripts
15
- private static $scripts = array();
16
-
17
- // localize
18
- private static $wp_localize_scripts = array();
19
-
20
- static function init() {
21
- add_action( 'admin_enqueue_scripts', array( __CLASS__, 'load_scripts' ) );
22
- add_action( 'admin_print_scripts', array( __CLASS__, 'localize_printed_scripts' ), 5 );
23
- add_action( 'admin_print_footer_scripts', array( __CLASS__, 'localize_printed_scripts' ), 5 );
24
-
25
- self::add_localize(
26
- array(
27
- 'confirm_delete' => __( 'Delete?', 'learn_press' )
28
- )
29
- );
30
- }
31
-
32
- /**
33
- * register script
34
- *
35
- * @param string $handle
36
- * @param string $src
37
- * @param array $deps
38
- * @param string $version
39
- * @param boolean $in_footer
40
- */
41
- static function add_script( $handle, $src, $deps = array( 'jquery' ), $version = LEARNPRESS_VERSION, $in_footer = true ) {
42
- self::$scripts[] = $handle;
43
- wp_register_script( $handle, $src, $deps, $version, $in_footer );
44
- }
45
-
46
- /**
47
- * register style
48
- *
49
- * @param string $handle
50
- * @param string $src
51
- * @param array $deps
52
- * @param string $version
53
- * @param string $media
54
- */
55
- static function add_style( $handle, $src, $deps = array(), $version = LEARNPRESS_VERSION, $media = 'all' ) {
56
- self::$styles[] = $handle;
57
- wp_register_style( $handle, $src, $deps, $version, $media );
58
- }
59
-
60
- /**
61
- * enqueue script
62
- *
63
- * @param string $handle
64
- * @param string $src
65
- * @param array $deps
66
- * @param string $version
67
- * @param boolean $in_footer
68
- */
69
- static function enqueue_script( $handle, $src = '', $deps = array( 'jquery' ), $version = LEARNPRESS_VERSION, $in_footer = true ) {
70
- if ( !in_array( $handle, self::$scripts ) && $src ) {
71
- self::add_script( $handle, $src, $deps, $version, $in_footer );
72
- }
73
- wp_enqueue_script( $handle );
74
- }
75
-
76
- /**
77
- * enqueue style
78
- *
79
- * @param string $handle
80
- * @param string $src
81
- * @param array $deps
82
- * @param string $version
83
- * @param string $media
84
- */
85
- static function enqueue_style( $handle, $src, $deps = array(), $version = LEARNPRESS_VERSION, $media = 'all' ) {
86
- if ( !in_array( $handle, self::$styles ) && $src ) {
87
- self::add_style( $handle, $src, $deps, $version, $media );
88
- }
89
- wp_enqueue_style( $handle );
90
- }
91
-
92
- /**
93
- * add translate text
94
- *
95
- * @param array $localize
96
- */
97
- static function add_localize( $key, $localize = null, $handle = 'learnpress-admin-js' ) {
98
- if ( is_array( $key ) ) {
99
- foreach ( $key as $k => $v ) {
100
- self::add_localize( $k, $v, $handle );
101
- }
102
- } elseif ( is_string( $key ) && strlen( $key ) ) {
103
-
104
- if ( !$handle ) $handle = 'learnpress-admin-js';
105
-
106
- if ( empty( self::$wp_localize_scripts[$handle] ) ) self::$wp_localize_scripts[$handle] = array();
107
-
108
- self::$wp_localize_scripts[$handle][$key] = $localize;
109
-
110
- //self::$wp_localize_scripts[$key] = $localize;
111
- }
112
- }
113
-
114
- private static function localize_script( $handle ) {
115
- $data = !empty( self::$wp_localize_scripts[$handle] ) ? self::$wp_localize_scripts[$handle] : false;
116
- if ( wp_script_is( $handle ) && $data ) {
117
- $name = str_replace( '-', '_', $handle ) . '_localize';
118
- unset( self::$wp_localize_scripts[$handle] );
119
- wp_localize_script( $handle, $name, apply_filters( $name, $data ) );
120
- }
121
- }
122
-
123
- /**
124
- * Load necessary styles + scripts for admin
125
- */
126
- static function load_scripts() {
127
- global $wp_version;
128
- self::enqueue_style( 'learnpress-admin-css', LPR_CSS_URL . 'learnpress-admin.css' );
129
- version_compare($wp_version, '4.0', '<') && self::enqueue_style( 'learnpress-admin-compat-css', LPR_CSS_URL . 'learnpress-admin-compat.css' );
130
- self::enqueue_script( 'learnpress-admin-js', LPR_JS_URL . 'learnpress-admin.js' );
131
- self::enqueue_script( 'learnpress-block-ui', LPR_JS_URL . 'jquery.block-ui.js' );
132
-
133
- }
134
-
135
- /**
136
- * Translate the text if needed
137
- */
138
- static function localize_printed_scripts() {
139
- if ( self::$scripts ) foreach ( self::$scripts as $handle ) {
140
- self::localize_script( $handle );
141
- }
142
- }
143
- }
144
-
145
- }
146
- LPR_Admin_Assets::init();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/admin/class.lpr-admin-settings.php DELETED
@@ -1,196 +0,0 @@
1
- <?php
2
- if ( !defined( 'ABSPATH' ) ) {
3
- exit; // Exit if accessed directly
4
- }
5
- /**
6
- * Class LPR_Admin_Settings
7
- */
8
- class LPR_Admin_Settings{
9
- /**
10
- * The option key stored in database
11
- *
12
- * @var string
13
- * @access protected
14
- */
15
- protected $_key = '';
16
-
17
- /**
18
- * Store value of the options stored in database
19
- *
20
- * @var array|bool
21
- */
22
- public $_options = false;
23
-
24
- /**
25
- * Constructor
26
- *
27
- * @param $key
28
- */
29
- function __construct( $key ){
30
- if( !$key ){
31
- wp_die();
32
- }
33
- $this->_key = $key;
34
- $this->_options = (array) get_option( $this->_key );
35
- }
36
-
37
- /**
38
- * Set new value for a key of $_options
39
- *
40
- * @param $name
41
- * @param $value
42
- */
43
- function set( $name, $value ){
44
- $this->_set_option( $this->_options, $name, $value, true );
45
- }
46
-
47
- /**
48
- * Set value for an object|array by key
49
- *
50
- * @param $obj
51
- * @param $var
52
- * @param $value
53
- * @param bool $recurse
54
- */
55
- private function _set_option( &$obj, $var, $value, $recurse = false ){
56
- $var = (array)explode('.', $var);
57
- $current_var = array_shift( $var );
58
- if( is_object( $obj ) ){
59
- $obj_vars = get_object_vars( $obj );
60
- if( array_key_exists( $current_var, $obj_vars ) ){ // isset( $obj->{$current_var} ) ){
61
- if( count( $var ) ){
62
- if( is_object( $obj->$current_var ) ){
63
- $obj->$current_var = new stdClass();
64
- }else{
65
- $obj->$current_var = array();
66
- }
67
- $this->_set_option( $obj->$current_var, join('.', $var ), $value, $recurse );
68
- }else{
69
- $obj->$current_var = $value;
70
- }
71
- }else{
72
- if( $recurse ){
73
- if( count( $var ) ){
74
- $next_var = reset($var);
75
- if( is_object( $obj->$current_var ) ){
76
- $obj->$current_var = new stdClass();
77
- }else{
78
- $obj->$current_var = array();
79
- }
80
- $this->_set_option( $obj->$current_var, join('.', $var ), $value, $recurse );
81
- }else{
82
- $obj->$current_var = $value;
83
- }
84
- }else{
85
- $obj->$current_var = $value;
86
- }
87
- }
88
- }else if( is_array( $obj ) ){
89
- if( array_key_exists( $current_var, $obj ) ){
90
- if( count( $var ) ){
91
- $obj[$current_var] = array();
92
- $this->_set_option( $obj[$current_var], join('.', $var ), $value, $recurse );
93
- }else{
94
- $obj[$current_var] = $value;
95
- }
96
- }else{
97
- if( $recurse ){
98
- if( count( $var ) ){
99
- $next_var = reset($var);
100
- $obj[$current_var] = array();
101
- $this->_set_option( $obj[$current_var], join('.', $var ), $value, $recurse );
102
- }else{
103
- $obj[$current_var] = $value;
104
- }
105
- }else{
106
- $obj[$current_var] = $value;
107
- }
108
- }
109
- }
110
- }
111
-
112
- /**
113
- * Get value from a key of $_options
114
- * @param $var
115
- * @param null $default
116
- * @return null
117
- */
118
- function get( $var, $default = null ){
119
- return $this->_get_option( $this->_options, $var, $default );
120
- }
121
-
122
- /**
123
- * Get value from a key of an object|array
124
- * @param $obj
125
- * @param $var
126
- * @param null $default
127
- * @return null
128
- */
129
- function _get_option( $obj, $var, $default = null ){
130
- $var = (array)explode('.', $var);
131
- $current_var = array_shift( $var );
132
- if( is_object( $obj ) ){
133
- if( isset( $obj->{$current_var} ) ){
134
- if( count( $var ) ){
135
- return $this->_get_option( $obj->{$current_var}, join('.', $var ), $default );
136
- }else{
137
- return $obj->{$current_var};
138
- }
139
- }else{
140
- return $default;
141
- }
142
- }else{
143
- if( isset( $obj[$current_var] ) ){
144
- if( count( $var ) ){
145
- return $this->_get_option( $obj[$current_var], join('.', $var ), $default );
146
- }else{
147
- return $obj[$current_var];
148
- }
149
- }else{
150
- return $default;
151
- }
152
- }
153
- return $default;
154
- }
155
-
156
- /**
157
- * Combine an array|object to current options
158
- * @param $new
159
- */
160
- function bind( $new ){
161
- if( is_object( $new ) ) $new = (array)$new;
162
- if( is_array( $new ) ){
163
- foreach( $new as $k => $v ){
164
- $this->set( $k, $v );
165
- }
166
- }
167
- }
168
-
169
- /**
170
- * Store options into database
171
- */
172
- function update(){
173
- update_option( $this->_key, $this->_options );
174
- }
175
-
176
- /**
177
- * Unique an instance of the class by the key of the options want to initial
178
- *
179
- * @param $key
180
- * @return mixed
181
- */
182
- static function instance( $key ){
183
- static $instances = array();
184
- $key = '_lpr_settings_' . $key;
185
- if( empty( $instances[$key] ) ){
186
- $instances[$key] = new LPR_Admin_Settings( $key );
187
- }
188
- return $instances[$key];
189
- }
190
- }
191
-
192
- if( !function_exists( 'learn_press_admin_settings' ) ){
193
- function learn_press_admin_settings( $key ){
194
- return LPR_Admin_Settings::instance( $key );
195
- }
196
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/admin/class.lpr-admin.php DELETED
@@ -1,83 +0,0 @@
1
- <?php
2
-
3
- if ( !defined( 'ABSPATH' ) ) {
4
- exit; // Exit if accessed directly
5
- }
6
-
7
- if ( !class_exists( 'LPR_Admin' ) ) {
8
- /**
9
- * Class LPR_Admin
10
- */
11
- class LPR_Admin {
12
- /**
13
- * Constructor
14
- */
15
- public function __construct() {
16
- // Common function used in admin
17
- require_once( dirname( __FILE__ ) . '/lpr-admin-functions.php' );
18
-
19
- add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );
20
- add_action( 'admin_print_scripts', array( $this, 'plugin_js_settings' ) );
21
- add_action( 'init', array( $this, '_redirect' ) );
22
- }
23
-
24
- /**
25
- * Output common js settings in admin
26
- *
27
- * @since 0.9.4
28
- */
29
- function plugin_js_settings(){
30
- static $did = false;
31
- if( $did ) return;
32
- $js = array(
33
- 'ajax' => admin_url( 'admin-ajax.php'),
34
- 'plugin_url' => LearnPress()->plugin_url()
35
- );
36
- echo '<script type="text/javascript">var LearnPress_Settings = ' . json_encode( $js ) . '</script>';
37
- $did = true;
38
- }
39
-
40
- /**
41
- * Redirect to admin settings page
42
- */
43
- public function _redirect(){
44
- $page = isset( $_GET['page'] ) ? $_GET['page'] : '';
45
- if( 'learn_press_settings' == $page ) {
46
- $current_tab = isset($_GET['tab']) ? $_GET['tab'] : '';
47
- $tabs = learn_press_settings_tabs_array();
48
-
49
- if (!$current_tab || ($tabs && empty($tabs[$current_tab]))) {
50
- if ($tabs) {
51
- $tab_keys = array_keys($tabs);
52
- $current_tab = reset($tab_keys);
53
- wp_redirect(admin_url('options-general.php?page=learn_press_settings&tab=' . $current_tab));
54
- exit();
55
- }
56
- }
57
- }
58
- }
59
-
60
- /**
61
- * Include any classes, functions we need within admin
62
- */
63
- public function includes() {
64
- //Ajax Class
65
- include_once( 'class-admin-ajax.php' );
66
- }
67
-
68
- /**
69
- * Enqueue admin scripts
70
- */
71
- public function admin_scripts() {
72
-
73
- /**
74
- * Tipsy tooltip assets
75
- */
76
- LPR_Admin_Assets::enqueue_style('jquery-tipsy', LPR_CSS_URL . 'tipsy.css' );
77
- LPR_Admin_Assets::enqueue_script('jquery-tipsy', LPR_JS_URL . 'jquery.tipsy.js' );
78
- }
79
-
80
- }
81
-
82
- new LPR_Admin();
83
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/admin/class.lpr-email.php DELETED
@@ -1,100 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Class LPR_Email
5
- */
6
- class LPR_Email {
7
-
8
- /**
9
- * @var array
10
- */
11
- protected $to = array();
12
-
13
- /**
14
- * @var string
15
- */
16
- protected $subject = '';
17
-
18
- /**
19
- * @var string
20
- */
21
- protected $message = '';
22
-
23
- /**
24
- * Constructor.
25
- */
26
- public function __construct() {
27
- }
28
-
29
- /**
30
- * Filter headers.
31
- * Replaces new lines.
32
- *
33
- * @param string $value
34
- *
35
- * @return string
36
- */
37
- public function filter( $value ) {
38
- return str_ireplace( array( "\r", "\n", '%0A', '%0D', '<CR>', '<LF>' ), '', $value );
39
- }
40
-
41
- /**
42
- * Set email template.
43
- *
44
- * @param $action
45
- */
46
- public function set_action( $action ) {
47
- $emails_settings = get_option( '_lpr_settings_emails' );
48
-
49
- $this->subject = isset( $emails_settings[$action]['subject'] ) ? $emails_settings[$action]['subject'] : '';
50
- $this->message = isset( $emails_settings[$action]['message'] ) ? $emails_settings[$action]['message'] : '';
51
- }
52
-
53
- /**
54
- * Parse subject placeholders.
55
- *
56
- * @param array $vars
57
- */
58
- public function parse_email( $vars ) {
59
- if ( empty( $vars ) ) {
60
- return;
61
- }
62
-
63
- foreach ( $vars as $key => $value ) {
64
- $this->subject = str_replace( '{' . $key . '}', $value, $this->subject );
65
- $this->message = str_replace( '{' . $key . '}', $value, $this->message );
66
- }
67
- }
68
-
69
- /**
70
- * Add email recipient.
71
- *
72
- * @param string $email
73
- */
74
- public function add_recipient( $email ) {
75
- $this->to[] = $email;
76
- }
77
-
78
- /**
79
- * Send email.
80
- *
81
- * @return boolean
82
- */
83
- public function send() {
84
- $email_settings = get_option( '_lpr_settings_emails' );
85
- $headers[] = 'Content-Type: text/html; charset=UTF-8';
86
- $headers['from'] = '';
87
-
88
- if ( is_array( $email_settings['general'] ) && !empty( $email_settings['general']['from_email'] ) ) {
89
- $headers['from'] .= 'From:';
90
-
91
- if ( !empty( $email_settings['general']['from_name'] ) ) {
92
- $headers['from'] .= ' ' . $this->filter( $email_settings['general']['from_name'] );
93
- }
94
-
95
- $headers['from'] .= ' <' . sanitize_email( $email_settings['general']['from_email'] ) . ">\r\n";
96
- }
97
-
98
- return wp_mail( $this->to, $this->filter( $this->subject ), stripslashes( $this->message ), $headers );
99
- }
100
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/admin/class.lpr-profile.php DELETED
@@ -1,154 +0,0 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit; // Exit if accessed directly
4
- }
5
-
6
- if ( ! class_exists( 'LPR_Profile' ) ) {
7
- /**
8
- * Class LPR_Profile
9
- */
10
- class LPR_Profile {
11
- /**
12
- * Constructor
13
- */
14
- public function __construct() {
15
- add_filter( 'learn_press_profile_methods', array( $this, 'learn_press_profile_method' ) );
16
- add_action( 'wp_loaded', array( $this, 'learn_press_process_profile' ) );
17
- add_action( 'learn_press_add_profile_tab', array( $this, 'learn_press_add_tabs_scripts' ) );
18
- add_action( 'learn_press_add_profile_tab', array( $this, 'learn_press_add_profile_tab' ) );
19
- add_filter( 'learn_press_user_info_tab_content', array( $this, 'learn_press_user_info_tab_content' ), 10, 2 );
20
- add_filter( 'learn_press_user_courses_tab_content', array( $this, 'learn_press_user_courses_tab_content' ), 10, 2 );
21
- add_filter( 'learn_press_user_quizzes_tab_content', array( $this, 'learn_press_user_quizzes_tab_content' ), 10, 2 );
22
- add_action( 'learn_press_enrolled_course_after_title', array( $this, 'end_title_content' ), 10, 2 );
23
- }
24
-
25
- /**
26
- * Process profile
27
- */
28
- public function learn_press_process_profile() {
29
- if ( learn_press_has_profile_method() ) {
30
- if ( learn_press_get_profile_page_id() == 0 ) {
31
- $profile = array(
32
- 'post_title' => 'Profile',
33
- 'post_content' => '[learn_press_profile]',
34
- 'post_type' => 'page',
35
- 'post_status' => 'publish',
36
- );
37
- $profile_page_id = wp_insert_post( $profile );
38
- update_post_meta( $profile_page_id, '_lpr_is_profile_page', 1 );
39
- }
40
- } else {
41
- wp_delete_post( learn_press_get_profile_page_id(), true );
42
- }
43
- }
44
-
45
- /*
46
- * Profile methods
47
- */
48
- public function learn_press_profile_method( $methods ) {
49
- $methods['lpr_profile'] = __( 'LearnPress Profile', 'learn_press' );
50
-
51
- return $methods;
52
- }
53
-
54
- /*
55
- * Enqueue jquery ui scripts
56
- */
57
- public function learn_press_add_tabs_scripts() {
58
- wp_enqueue_style( 'lpr-learnpress-css' );
59
- wp_enqueue_script( array( 'jquery-ui-core', 'jquery-ui-tabs', 'jquery-ui-accordion' ) );
60
- }
61
-
62
- /*
63
- * Add profile tab
64
- */
65
- public function learn_press_add_profile_tab( $user ) {
66
- $content = '';
67
- $tabs = apply_filters(
68
- 'learn_press_profile_tabs',
69
- array(
70
- 10 => array(
71
- 'tab_id' => 'user_info',
72
- 'tab_name' => __( 'User Information', 'learn_press' ),
73
- 'tab_content' => apply_filters( 'learn_press_user_info_tab_content', $content, $user )
74
- ),
75
- 20 => array(
76
- 'tab_id' => 'user_courses',
77
- 'tab_name' => __( 'Courses', 'learn_press' ),
78
- 'tab_content' => apply_filters( 'learn_press_user_courses_tab_content', $content, $user )
79
- ),
80
- 30 => array(
81
- 'tab_id' => 'user_quizzes',
82
- 'tab_name' => __( 'Quiz Results', 'learn_press' ),
83
- 'tab_content' => apply_filters( 'learn_press_user_quizzes_tab_content', $content, $user )
84
- )
85
- ),
86
- $user
87
- );
88
- ksort( $tabs );
89
-
90
- if ( !$user ) {
91
- echo '<strong>' . __( 'This user in not available!', 'learn_press' ) . '</strong>';
92
- } else {
93
- echo '<div id="profile-tabs">';
94
- echo '<ul>';
95
- foreach ( $tabs as $tab ) {
96
- echo '<li><a href="#' . $tab['tab_id'] . '">' . $tab['tab_name'] . '</a></li>';
97
- }
98
- echo '</ul>';
99
- foreach ( $tabs as $tab ) {
100
- echo '<div id="' . $tab['tab_id'] . '">' . $tab['tab_content'] . '</div>';
101
- }
102
- echo '</div>';
103
- ?>
104
- <script>
105
- jQuery(document).ready(function ($) {
106
- $("#profile-tabs").tabs();
107
- $( "#quiz-accordion" ).accordion();
108
- });
109
- </script>
110
- <?php
111
- }
112
- }
113
-
114
- /*
115
- * Add content for user information tab
116
- */
117
- public function learn_press_user_info_tab_content( $content, $user ) {
118
- ob_start();
119
- learn_press_get_template( 'profile/user-info.php', array( 'user' => $user ) );
120
- $content .= ob_get_clean();
121
- return $content;
122
- }
123
-
124
- /*
125
- * Add content for user courses tab
126
- */
127
- public function learn_press_user_courses_tab_content( $content, $user ) {
128
- ob_start();
129
- learn_press_get_template( 'profile/user-courses.php', array( 'user' => $user ) );
130
- $content .= ob_get_clean();
131
- return $content;
132
- }
133
-
134
-
135
- /*
136
- * Add content for user quiz results tab
137
- */
138
- public function learn_press_user_quizzes_tab_content( $content, $user ) {
139
- ob_start();
140
- learn_press_get_template( 'profile/user-quizzes.php', array( 'content' => $content, 'user' => $user ) );
141
- $content .= ob_get_clean();
142
- return $content;
143
- }
144
-
145
- public function end_title_content( $course, $user ) {
146
- if ( learn_press_user_has_passed_course( $course->ID, $user->ID ) ) {
147
- _e( '<span class="course-status passed">Passed</span>', 'learn_press' );
148
- } else {
149
-
150
- }
151
- }
152
- }
153
- new LPR_Profile;
154
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/admin/lp-admin-functions.php ADDED
@@ -0,0 +1,1292 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Common functions used for admin
4
+ *
5
+ * @package LearnPress
6
+ * @author ThimPress
7
+ * @version 1.0
8
+ */
9
+
10
+ if ( !defined( 'ABSPATH' ) ) {
11
+ exit;
12
+ }
13
+ /**
14
+ * Get html view path for admin to display
15
+ *
16
+ * @param $name
17
+ * @param $plugin_file
18
+ *
19
+ * @return mixed
20
+ */
21
+ function learn_press_get_admin_view( $name, $plugin_file = null ) {
22
+ if ( !preg_match( '/\.(.*)$/', $name ) ) {
23
+ $name .= '.php';
24
+ }
25
+ if ( $plugin_file ) {
26
+ $view = dirname( $plugin_file ) . '/inc/admin/views/' . $name;
27
+ } else {
28
+ $view = LP()->plugin_path( 'inc/admin/views/' . $name );
29
+ }
30
+ return apply_filters( 'learn_press_admin_view', $view, $name );
31
+ }
32
+
33
+ /**
34
+ * Find a full path of a view and display the content in admin
35
+ *
36
+ * @param $name
37
+ * @param array $args
38
+ * @param bool|false $include_once
39
+ *
40
+ * @return bool
41
+ */
42
+ function learn_press_admin_view( $name, $args = array(), $include_once = false ) {
43
+ $view = learn_press_get_admin_view( $name, !empty( $args['plugin_file'] ) ? $args['plugin_file'] : null );
44
+ if ( file_exists( $view ) ) {
45
+ // extract parameters as local variables if passed
46
+ is_array( $args ) && extract( $args );
47
+ do_action( 'learn_press_before_display_admin_view', $name, $args );
48
+ if ( $include_once ) {
49
+ include_once $view;
50
+ } else {
51
+ include $view;
52
+ }
53
+ do_action( 'learn_press_after_display_admin_view', $name, $args );
54
+ return true;
55
+ }
56
+ return false;
57
+ }
58
+
59
+ /**
60
+ * List all pages as a dropdown with "Add New Page" option
61
+ *
62
+ * @param $name
63
+ * @param bool|false $selected
64
+ * @param array $args
65
+ *
66
+ * @return mixed|string
67
+ */
68
+ function learn_press_pages_dropdown( $name, $selected = false, $args = array() ) {
69
+ $id = null;
70
+ $class = null;
71
+ $css = null;
72
+ $before = array(
73
+ 'add_new_page' => __( '[ Add a new page ]', 'learnpress' )
74
+ );
75
+ $after = null;
76
+ $echo = true;
77
+ $allow_create = true;
78
+ is_array( $args ) && extract( $args );
79
+
80
+ if ( empty( $id ) ) {
81
+ $id = $name;
82
+ }
83
+ $args = array(
84
+ 'name' => $name,
85
+ 'id' => $id,
86
+ 'sort_column' => 'menu_order',
87
+ 'sort_order' => 'ASC',
88
+ 'show_option_none' => __( 'Select Page', 'learnpress' ),
89
+ 'class' => $class,
90
+ 'echo' => false,
91
+ 'selected' => $selected,
92
+ 'allow_create' => true
93
+ );
94
+ $output = wp_dropdown_pages( $args );
95
+ $replace = "";
96
+
97
+ $class .= 'learn-press-dropdown-pages';
98
+
99
+ if ( $class ) {
100
+ $replace .= ' class="' . $class . '"';
101
+ }
102
+ if ( $css ) {
103
+ $replace .= ' style="' . $css . '"';
104
+ }
105
+
106
+ $replace .= ' data-selected="' . $selected . '"';
107
+ $replace .= " data-placeholder='" . __( 'Select a page&hellip;', 'learnpress' ) . "' id=";
108
+ $output = str_replace( ' id=', $replace, $output );
109
+ if ( $before ) {
110
+ $before_output = array();
111
+ foreach ( $before as $v => $l ) {
112
+ $before_output[] = sprintf( '<option value="%s">%s</option>', $v, $l );
113
+ }
114
+ $before_output = join( "\n", $before_output );
115
+ $output = preg_replace( '!(<option class=".*" value="[0-9]+".*>.*</option>)!', $before_output . "\n$1", $output, 1 );
116
+ }
117
+ if ( $allow_create ) {
118
+ ob_start(); ?>
119
+ <button class="button button-quick-add-page" data-id="<?php echo $id; ?>" type="button"><?php _e( 'Create', 'learnpress' ); ?></button>
120
+ <p class="learn-press-quick-add-page-inline <?php echo $id; ?> hide-if-js">
121
+ <input type="text" placeholder="<?php esc_attr_e( 'New page title', 'learnpress' ); ?>" />
122
+ <button class="button" type="button"><?php esc_html_e( 'Ok [Enter]', 'learnpress' ); ?></button>
123
+ <a href=""><?php _e( 'Cancel [ESC]', 'learnpress' ); ?></a>
124
+ </p>
125
+ <p class="learn-press-quick-add-page-actions <?php echo $id; ?><?php echo $selected ? '' : ' hide-if-js'; ?>">
126
+ <a class="edit-page" href="<?php echo get_edit_post_link( $selected ); ?>" target="_blank"><?php _e( 'Edit Page', 'learnpress' ); ?></a>
127
+ <a class="view-page" href="<?php echo get_permalink( $selected ); ?>" target="_blank"><?php _e( 'View Page', 'learnpress' ); ?></a>
128
+ </p>
129
+ <?php $output .= ob_get_clean();
130
+ }
131
+ if ( $echo ) {
132
+ echo $output;
133
+ }
134
+
135
+ return $output;
136
+ }
137
+
138
+
139
+ /**************************************************/
140
+ /**************************************************/
141
+ /**************************************************/
142
+
143
+ /**
144
+ * Translate javascript text
145
+ */
146
+ function learn_press_admin_localize_script() {
147
+ if ( defined( 'DOING_AJAX' ) || !is_admin() ) return;
148
+ $translate = array(
149
+ 'quizzes_is_not_available' => __( 'Quiz is not available', 'learnpress' ),
150
+ 'lessons_is_not_available' => __( 'Lesson is not available', 'learnpress' )
151
+ );
152
+ LP_Admin_Assets::add_localize( $translate );
153
+ }
154
+
155
+ add_action( 'init', 'learn_press_admin_localize_script' );
156
+
157
+ /**
158
+ * Default admin settings pages
159
+ *
160
+ * @return mixed
161
+ */
162
+ function learn_press_settings_tabs_array() {
163
+ $tabs = array(
164
+ 'general' => __( 'General', 'learnpress' ),
165
+ 'courses' => __( 'Courses', 'learnpress' ),
166
+ 'pages' => __( 'Pages', 'learnpress' ),
167
+ 'payments' => __( 'Payments', 'learnpress' ),
168
+ 'checkout' => __( 'Checkout', 'learnpress' ),
169
+ //'profile' => __( 'Profile', 'learnpress' ),
170
+ 'emails' => __( 'Emails', 'learnpress' )
171
+ );
172
+ return apply_filters( 'learn_press_settings_tabs_array', $tabs );
173
+ }
174
+
175
+ /**
176
+ * Count number of orders between to dates
177
+ *
178
+ * @param string
179
+ * @param int
180
+ *
181
+ * @return int
182
+ */
183
+ function learn_press_get_order_by_time( $by, $time ) {
184
+ global $wpdb;
185
+ $user_id = get_current_user_id();
186
+
187
+ $y = date( 'Y', $time );
188
+ $m = date( 'm', $time );
189
+ $d = date( 'd', $time );
190
+ switch ( $by ) {
191
+ case 'days':
192
+ $orders = $wpdb->get_var(
193
+ $wpdb->prepare(
194
+ "SELECT COUNT(*)
195
+ FROM $wpdb->posts AS p
196
+ INNER JOIN $wpdb->postmeta AS m ON p.ID = m.post_id
197
+ WHERE p.post_author = %d
198
+ AND p.post_type = %s
199
+ AND p.post_status = %s
200
+ AND m.meta_key = %s
201
+ AND m.meta_value = %s
202
+ AND YEAR(p.post_date) = %s AND MONTH(p.post_date) = %s AND DAY(p.post_date) = %s",
203
+ $user_id, LP()->order_post_type, 'publish', '_learn_press_transaction_status', 'completed', $y, $m, $d
204
+ )
205
+ );
206
+ break;
207
+ case 'months':
208
+ $orders = $wpdb->get_var(
209
+ $wpdb->prepare(
210
+ "SELECT COUNT(*)
211
+ FROM $wpdb->posts AS p
212
+ INNER JOIN $wpdb->postmeta AS m ON p.ID = m.post_id
213
+ WHERE p.post_author = %d
214
+ AND p.post_type = %s
215
+ AND p.post_status = %s
216
+ AND m.meta_key = %s
217
+ AND m.meta_value = %s
218
+ AND YEAR(p.post_date) = %s AND MONTH(p.post_date) = %s",
219
+ $user_id, LP()->order_post_type, 'publish', '_learn_press_transaction_status', 'completed', $y, $m
220
+ )
221
+ );
222
+ break;
223
+ }
224
+ return $orders;
225
+ }
226
+
227
+ /**
228
+ * Count number of orders by status
229
+ *
230
+ * @param string Status of the orders
231
+ *
232
+ * @return int
233
+ */
234
+ function learn_press_get_courses_by_status( $status ) {
235
+ global $wpdb;
236
+ $user_id = get_current_user_id();
237
+ $courses = $wpdb->get_var(
238
+ $wpdb->prepare(
239
+ "SELECT COUNT(*)
240
+ FROM $wpdb->posts
241
+ WHERE post_author = %d
242
+ AND post_type = %s
243
+ AND post_status = %s",
244
+ $user_id, LP()->course_post_type, $status
245
+ )
246
+ );
247
+ return $courses;
248
+ }
249
+
250
+ /**
251
+ * Count number of orders by price
252
+ *
253
+ * @param string
254
+ *
255
+ * @return int
256
+ */
257
+ function learn_press_get_courses_by_price( $fee ) {
258
+ global $wpdb;
259
+ $user_id = get_current_user_id();
260
+ $courses = $wpdb->get_var(
261
+ $wpdb->prepare(
262
+ "SELECT COUNT(*)
263
+ FROM $wpdb->posts AS p
264
+ INNER JOIN $wpdb->postmeta AS m ON p.ID = m.post_id
265
+ WHERE p.post_author = %d
266
+ AND p.post_type = %s
267
+ AND p.post_status IN (%s, %s)
268
+ AND m.meta_key = %s
269
+ AND m.meta_value = %s",
270
+ $user_id, LP()->course_post_type, 'publish', 'pending', '_lpr_course_payment', $fee
271
+ )
272
+ );
273
+ return $courses;
274
+ }
275
+
276
+ /**
277
+ * Get data about students to render in chart
278
+ *
279
+ * @param null $from
280
+ * @param null $by
281
+ * @param $time_ago
282
+ *
283
+ * @return array
284
+ */
285
+ function learn_press_get_chart_students( $from = null, $by = null, $time_ago ) {
286
+ $labels = array();
287
+ $datasets = array();
288
+ if ( is_null( $from ) ) {
289
+ $from = current_time( 'mysql' );
290
+ }
291
+ // $by: days, months or years
292
+ if ( is_null( $by ) ) {
293
+ $by = 'days';
294
+ }
295
+ switch ( $by ) {
296
+ case 'days':
297
+ $date_format = 'M d';
298
+ break;
299
+ case 'months':
300
+ $date_format = 'M Y';
301
+ break;
302
+ case 'years':
303
+ $date_format = 'Y';
304
+ break;
305
+ }
306
+
307
+ for ( $i = - $time_ago + 1; $i <= 0; $i ++ ) {
308
+ $labels[] = date( $date_format, strtotime( "$i $by", strtotime( $from ) ) );
309
+ $datasets[0]['data'][] = learn_press_get_order_by_time( $by, strtotime( "$i $by", strtotime( $from ) ) );
310
+ }
311
+ $colors = learn_press_get_admin_colors();
312
+ $datasets[0]['fillColor'] = 'rgba(255,255,255,0.1)';
313
+ $datasets[0]['strokeColor'] = $colors[0];
314
+ $datasets[0]['pointColor'] = $colors[0];
315
+ $datasets[0]['pointStrokeColor'] = $colors[2];
316
+ $datasets[0]['pointHighlightFill'] = $colors[2];
317
+ $datasets[0]['pointHighlightStroke'] = $colors[0];
318
+ return array(
319
+ 'labels' => $labels,
320
+ 'datasets' => $datasets
321
+ );
322
+ }
323
+
324
+ /**
325
+ * Get data about students to render in chart
326
+ *
327
+ * @param null $from
328
+ * @param null $by
329
+ * @param $time_ago
330
+ *
331
+ * @return array
332
+ */
333
+ function learn_press_get_chart_users( $from = null, $by = null, $time_ago ) {
334
+ global $wpdb;
335
+
336
+ $labels = array();
337
+ $datasets = array();
338
+ if ( is_null( $from ) ) {
339
+ $from = current_time( 'mysql' );
340
+ }
341
+ if ( is_null( $by ) ) {
342
+ $by = 'days';
343
+ }
344
+ $results = array(
345
+ 'all' => array(),
346
+ 'instructors' => array()
347
+ );
348
+ $from_time = is_numeric( $from ) ? $from : strtotime( $from );
349
+
350
+ switch ( $by ) {
351
+ case 'days':
352
+ $date_format = 'M d Y';
353
+ $_from = - $time_ago + 1;
354
+ $_from = date( 'Y-m-d', strtotime( "{$_from} {$by}", $from_time ) );
355
+ $_to = date( 'Y-m-d', $from_time );
356
+ $_sql_format = '%Y-%m-%d';
357
+ $_key_format = 'Y-m-d';
358
+ break;
359
+ case 'months':
360
+ $date_format = 'M Y';
361
+ $_from = - $time_ago + 1;
362
+ $_from = date( 'Y-m-01', strtotime( "{$_from} {$by}", $from_time ) );
363
+ $days = date( 't', mktime( 0, 0, 0, date( 'm', $from_time ), 1, date( 'Y', $from_time ) ) );
364
+ $_to = date( 'Y-m-' . $days, $from_time );
365
+ $_sql_format = '%Y-%m';
366
+ $_key_format = 'Y-m';
367
+ break;
368
+ case 'years':
369
+ $date_format = 'Y';
370
+ $_from = - $time_ago + 1;
371
+ $_from = date( 'Y-01-01', strtotime( "{$_from} {$by}", $from_time ) );
372
+ $days = date( 't', mktime( 0, 0, 0, date( 'm', $from_time ), 1, date( 'Y', $from_time ) ) );
373
+ $_to = date( 'Y-12-' . $days, $from_time );
374
+ $_sql_format = '%Y';
375
+ $_key_format = 'Y';
376
+
377
+ break;
378
+ }
379
+ $query = $wpdb->prepare( "
380
+ SELECT count(u.ID) as c, DATE_FORMAT( u.user_registered, %s) as d
381
+ FROM {$wpdb->users} u
382
+ WHERE 1
383
+ GROUP BY d
384
+ HAVING d BETWEEN %s AND %s
385
+ ORDER BY d ASC
386
+ ", $_sql_format, $_from, $_to );
387
+ if ( $_results = $wpdb->get_results( $query ) ) {
388
+ foreach ( $_results as $k => $v ) {
389
+ $results['all'][$v->d] = $v;
390
+ }
391
+ }
392
+ $query = $wpdb->prepare( "
393
+ SELECT count(u.ID) as c, DATE_FORMAT( u.user_registered, %s) as d
394
+ FROM {$wpdb->users} u
395
+ INNER JOIN {$wpdb->usermeta} um ON um.user_id = u.ID AND um.meta_key = %s AND ( um.meta_value LIKE %s OR um.meta_value LIKE %s )
396
+ WHERE 1
397
+ GROUP BY d
398
+ HAVING d BETWEEN %s AND %s
399
+ ORDER BY d ASC
400
+ ", $_sql_format, 'wp_capabilities', '%' . $wpdb->esc_like( 's:13:"administrator"' ) . '%', '%' . $wpdb->esc_like( 's:10:"lp_teacher"' ) . '%', $_from, $_to );
401
+
402
+ if ( $_results = $wpdb->get_results( $query ) ) {
403
+ foreach ( $_results as $k => $v ) {
404
+ $results['instructors'][$v->d] = $v;
405
+ }
406
+ }
407
+ for ( $i = - $time_ago + 1; $i <= 0; $i ++ ) {
408
+ $date = strtotime( "$i $by", $from_time );
409
+ $labels[] = date( $date_format, $date );
410
+ $key = date( $_key_format, $date );
411
+
412
+ $all = !empty( $results['all'][$key] ) ? $results['all'][$key]->c : 0;
413
+ $instructors = !empty( $results['instructors'][$key] ) ? $results['instructors'][$key]->c : 0;
414
+
415
+ $datasets[0]['data'][] = $all;
416
+ $datasets[1]['data'][] = $instructors;
417
+ $datasets[2]['data'][] = $all - $instructors;
418
+ }
419
+
420
+ $dataset_params = array(
421
+ array(
422
+ 'color1' => 'rgba(47, 167, 255, %s)',
423
+ 'color2' => '#FFF',
424
+ 'label' => __( 'All', 'learnpress' )
425
+ ),
426
+ array(
427
+ 'color1' => 'rgba(212, 208, 203, %s)',
428
+ 'color2' => '#FFF',
429
+ 'label' => __( 'Instructors', 'learnpress' )
430
+ ),
431
+ array(
432
+ 'color1' => 'rgba(234, 199, 155, %s)',
433
+ 'color2' => '#FFF',
434
+ 'label' => __( 'Students', 'learnpress' )
435
+ )
436
+ );
437
+
438
+ foreach ( $dataset_params as $k => $v ) {
439
+ $datasets[$k]['fillColor'] = sprintf( $v['color1'], '0.2' );
440
+ $datasets[$k]['strokeColor'] = sprintf( $v['color1'], '1' );
441
+ $datasets[$k]['pointColor'] = sprintf( $v['color1'], '1' );
442
+ $datasets[$k]['pointStrokeColor'] = $v['color2'];
443
+ $datasets[$k]['pointHighlightFill'] = $v['color2'];
444
+ $datasets[$k]['pointHighlightStroke'] = sprintf( $v['color1'], '1' );
445
+ $datasets[$k]['label'] = $v['label'];
446
+ }
447
+
448
+ return array(
449
+ 'labels' => $labels,
450
+ 'datasets' => $datasets,
451
+ 'sql' => $query
452
+ );
453
+ }
454
+
455
+
456
+ /**
457
+ * Get data about students to render in chart
458
+ *
459
+ * @param null $from
460
+ * @param null $by
461
+ * @param $time_ago
462
+ *
463
+ * @return array
464
+ */
465
+ function learn_press_get_chart_courses( $from = null, $by = null, $time_ago ) {
466
+ global $wpdb;
467
+
468
+ $labels = array();
469
+ $datasets = array();
470
+ if ( is_null( $from ) ) {
471
+ $from = current_time( 'mysql' );
472
+ }
473
+ if ( is_null( $by ) ) {
474
+ $by = 'days';
475
+ }
476
+ $results = array(
477
+ 'all' => array(),
478
+ 'public' => array(),
479
+ 'pending' => array(),
480
+ 'free' => array(),
481
+ 'paid' => array()
482
+ );
483
+ $from_time = is_numeric( $from ) ? $from : strtotime( $from );
484
+
485
+ switch ( $by ) {
486
+ case 'days':
487
+ $date_format = 'M d Y';
488
+ $_from = - $time_ago + 1;
489
+ $_from = date( 'Y-m-d', strtotime( "{$_from} {$by}", $from_time ) );
490
+ $_to = date( 'Y-m-d', $from_time );
491
+ $_sql_format = '%Y-%m-%d';
492
+ $_key_format = 'Y-m-d';
493
+ break;
494
+ case 'months':
495
+ $date_format = 'M Y';
496
+ $_from = - $time_ago + 1;
497
+ $_from = date( 'Y-m-01', strtotime( "{$_from} {$by}", $from_time ) );
498
+ $days = date( 't', mktime( 0, 0, 0, date( 'm', $from_time ), 1, date( 'Y', $from_time ) ) );
499
+ $_to = date( 'Y-m-' . $days, $from_time );
500
+ $_sql_format = '%Y-%m';
501
+ $_key_format = 'Y-m';
502
+ break;
503
+ case 'years':
504
+ $date_format = 'Y';
505
+ $_from = - $time_ago + 1;
506
+ $_from = date( 'Y-01-01', strtotime( "{$_from} {$by}", $from_time ) );
507
+ $days = date( 't', mktime( 0, 0, 0, date( 'm', $from_time ), 1, date( 'Y', $from_time ) ) );
508
+ $_to = date( 'Y-12-' . $days, $from_time );
509
+ $_sql_format = '%Y';
510
+ $_key_format = 'Y';
511
+
512
+ break;
513
+ }
514
+
515
+ $query = $wpdb->prepare( "
516
+ SELECT count(c.ID) as c, DATE_FORMAT( c.post_date, %s) as d
517
+ FROM {$wpdb->posts} c
518
+ WHERE 1
519
+ AND c.post_status IN('publish', 'pending') AND c.post_type = %s
520
+ GROUP BY d
521
+ HAVING d BETWEEN %s AND %s
522
+ ORDER BY d ASC
523
+ ", $_sql_format, 'lp_course', $_from, $_to );
524
+ if ( $_results = $wpdb->get_results( $query ) ) {
525
+ foreach ( $_results as $k => $v ) {
526
+ $results['all'][$v->d] = $v;
527
+ }
528
+ }
529
+ $query = $wpdb->prepare( "
530
+ SELECT count(c.ID) as c, DATE_FORMAT( c.post_date, %s) as d
531
+ FROM {$wpdb->posts} c
532
+ WHERE 1
533
+ AND c.post_status = %s AND c.post_type = %s
534
+ GROUP BY d
535
+ HAVING d BETWEEN %s AND %s
536
+ ORDER BY d ASC
537
+ ", $_sql_format, 'publish', 'lp_course', $_from, $_to );
538
+ if ( $_results = $wpdb->get_results( $query ) ) {
539
+ foreach ( $_results as $k => $v ) {
540
+ $results['publish'][$v->d] = $v;
541
+ }
542
+ }
543
+
544
+ $query = $wpdb->prepare( "
545
+ SELECT count(c.ID) as c, DATE_FORMAT( c.post_date, %s) as d
546
+ FROM {$wpdb->posts} c
547
+ INNER JOIN {$wpdb->postmeta} cm ON cm.post_id = c.ID AND cm.meta_key = %s AND cm.meta_value = %s
548
+ WHERE 1
549
+ AND c.post_status = %s AND c.post_type = %s
550
+ GROUP BY d
551
+ HAVING d BETWEEN %s AND %s
552
+ ORDER BY d ASC
553
+ ", $_sql_format, '_lp_payment', 'yes', 'publish', 'lp_course', $_from, $_to );
554
+ if ( $_results = $wpdb->get_results( $query ) ) {
555
+ foreach ( $_results as $k => $v ) {
556
+ $results['paid'][$v->d] = $v;
557
+ }
558
+ }
559
+
560
+ for ( $i = - $time_ago + 1; $i <= 0; $i ++ ) {
561
+ $date = strtotime( "$i $by", $from_time );
562
+ $labels[] = date( $date_format, $date );
563
+ $key = date( $_key_format, $date );
564
+
565
+ $all = !empty( $results['all'][$key] ) ? $results['all'][$key]->c : 0;
566
+ $publish = !empty( $results['publish'][$key] ) ? $results['publish'][$key]->c : 0;
567
+ $paid = !empty( $results['paid'][$key] ) ? $results['paid'][$key]->c : 0;
568
+
569
+ $datasets[0]['data'][] = $all;
570
+ $datasets[1]['data'][] = $publish;
571
+ $datasets[2]['data'][] = $all - $publish;
572
+ $datasets[3]['data'][] = $paid;
573
+ $datasets[4]['data'][] = $all - $paid;
574
+ }
575
+
576
+ $dataset_params = array(
577
+ array(
578
+ 'color1' => 'rgba(47, 167, 255, %s)',
579
+ 'color2' => '#FFF',
580
+ 'label' => __( 'All', 'learnpress' )
581
+ ),
582
+ array(
583
+ 'color1' => 'rgba(212, 208, 203, %s)',
584
+ 'color2' => '#FFF',
585
+ 'label' => __( 'Publish', 'learnpress' )
586
+ ),
587
+ array(
588
+ 'color1' => 'rgba(234, 199, 155, %s)',
589
+ 'color2' => '#FFF',
590
+ 'label' => __( 'Pending', 'learnpress' )
591
+ ),
592
+ array(
593
+ 'color1' => 'rgba(234, 199, 155, %s)',
594
+ 'color2' => '#FFF',
595
+ 'label' => __( 'Paid', 'learnpress' )
596
+ ),
597
+ array(
598
+ 'color1' => 'rgba(234, 199, 155, %s)',
599
+ 'color2' => '#FFF',
600
+ 'label' => __( 'Free', 'learnpress' )
601
+ )
602
+ );
603
+
604
+ foreach ( $dataset_params as $k => $v ) {
605
+ $datasets[$k]['fillColor'] = sprintf( $v['color1'], '0.2' );
606
+ $datasets[$k]['strokeColor'] = sprintf( $v['color1'], '1' );
607
+ $datasets[$k]['pointColor'] = sprintf( $v['color1'], '1' );
608
+ $datasets[$k]['pointStrokeColor'] = $v['color2'];
609
+ $datasets[$k]['pointHighlightFill'] = $v['color2'];
610
+ $datasets[$k]['pointHighlightStroke'] = sprintf( $v['color1'], '1' );
611
+ $datasets[$k]['label'] = $v['label'];
612
+ }
613
+
614
+ return array(
615
+ 'labels' => $labels,
616
+ 'datasets' => $datasets,
617
+ 'sql' => $query
618
+ );
619
+ }
620
+
621
+
622
+ /**
623
+ * Get data about students to render in chart
624
+ *
625
+ * @param null $from
626
+ * @param null $by
627
+ * @param $time_ago
628
+ *
629
+ * @return array
630
+ */
631
+ function learn_press_get_chart_orders( $from = null, $by = null, $time_ago ) {
632
+ global $wpdb;
633
+
634
+ $labels = array();
635
+ $datasets = array();
636
+ if ( is_null( $from ) ) {
637
+ $from = current_time( 'mysql' );
638
+ }
639
+ if ( is_null( $by ) ) {
640
+ $by = 'days';
641
+ }
642
+ $results = array(
643
+ 'all' => array(),
644
+ 'completed' => array(),
645
+ 'pending' => array()
646
+ );
647
+ $from_time = is_numeric( $from ) ? $from : strtotime( $from );
648
+
649
+ switch ( $by ) {
650
+ case 'days':
651
+ $date_format = 'M d Y';
652
+ $_from = - $time_ago + 1;
653
+ $_from = date( 'Y-m-d', strtotime( "{$_from} {$by}", $from_time ) );
654
+ $_to = date( 'Y-m-d', $from_time );
655
+ $_sql_format = '%Y-%m-%d';
656
+ $_key_format = 'Y-m-d';
657
+ break;
658
+ case 'months':
659
+ $date_format = 'M Y';
660
+ $_from = - $time_ago + 1;
661
+ $_from = date( 'Y-m-01', strtotime( "{$_from} {$by}", $from_time ) );
662
+ $days = date( 't', mktime( 0, 0, 0, date( 'm', $from_time ), 1, date( 'Y', $from_time ) ) );
663
+ $_to = date( 'Y-m-' . $days, $from_time );
664
+ $_sql_format = '%Y-%m';
665
+ $_key_format = 'Y-m';
666
+ break;
667
+ case 'years':
668
+ $date_format = 'Y';
669
+ $_from = - $time_ago + 1;
670
+ $_from = date( 'Y-01-01', strtotime( "{$_from} {$by}", $from_time ) );
671
+ $days = date( 't', mktime( 0, 0, 0, date( 'm', $from_time ), 1, date( 'Y', $from_time ) ) );
672
+ $_to = date( 'Y-12-' . $days, $from_time );
673
+ $_sql_format = '%Y';
674
+ $_key_format = 'Y';
675
+
676
+ break;
677
+ }
678
+
679
+ $query = $wpdb->prepare( "
680
+ SELECT count(o.ID) as c, DATE_FORMAT( o.post_date, %s) as d
681
+ FROM {$wpdb->posts} o
682
+ WHERE 1
683
+ AND o.post_status IN('lp-completed') AND o.post_type = %s
684
+ GROUP BY d
685
+ HAVING d BETWEEN %s AND %s
686
+ ORDER BY d ASC
687
+ ", $_sql_format, 'lp_order', $_from, $_to );
688
+ if ( $_results = $wpdb->get_results( $query ) ) {
689
+ foreach ( $_results as $k => $v ) {
690
+ $results['all'][$v->d] = $v;
691
+ }
692
+ }
693
+ $query = $wpdb->prepare( "
694
+ SELECT count(o.ID) as c, DATE_FORMAT( o.post_date, %s) as d
695
+ FROM {$wpdb->posts} o
696
+ WHERE 1
697
+ AND o.post_status IN('lp-pending', 'lp-processing') AND o.post_type = %s
698
+ GROUP BY d
699
+ HAVING d BETWEEN %s AND %s
700
+ ORDER BY d ASC
701
+ ", $_sql_format, 'lp_order', $_from, $_to );
702
+ if ( $_results = $wpdb->get_results( $query ) ) {
703
+ foreach ( $_results as $k => $v ) {
704
+ $results['completed'][$v->d] = $v;
705
+ }
706
+ }
707
+
708
+
709
+ for ( $i = - $time_ago + 1; $i <= 0; $i ++ ) {
710
+ $date = strtotime( "$i $by", $from_time );
711
+ $labels[] = date( $date_format, $date );
712
+ $key = date( $_key_format, $date );
713
+
714
+ $all = !empty( $results['all'][$key] ) ? $results['all'][$key]->c : 0;
715
+ $completed = !empty( $results['completed'][$key] ) ? $results['completed'][$key]->c : 0;
716
+
717
+ $datasets[0]['data'][] = $all;
718
+ $datasets[1]['data'][] = $completed;
719
+ $datasets[2]['data'][] = $all - $completed;
720
+ }
721
+
722
+ $dataset_params = array(
723
+ array(
724
+ 'color1' => 'rgba(47, 167, 255, %s)',
725
+ 'color2' => '#FFF',
726
+ 'label' => __( 'All', 'learnpress' )
727
+ ),
728
+ array(
729
+ 'color1' => 'rgba(212, 208, 203, %s)',
730
+ 'color2' => '#FFF',
731
+ 'label' => __( 'Completed', 'learnpress' )
732
+ ),
733
+ array(
734
+ 'color1' => 'rgba(234, 199, 155, %s)',
735
+ 'color2' => '#FFF',
736
+ 'label' => __( 'Pending', 'learnpress' )
737
+ )
738
+ );
739
+
740
+ foreach ( $dataset_params as $k => $v ) {
741
+ $datasets[$k]['fillColor'] = sprintf( $v['color1'], '0.2' );
742
+ $datasets[$k]['strokeColor'] = sprintf( $v['color1'], '1' );
743
+ $datasets[$k]['pointColor'] = sprintf( $v['color1'], '1' );
744
+ $datasets[$k]['pointStrokeColor'] = $v['color2'];
745
+ $datasets[$k]['pointHighlightFill'] = $v['color2'];
746
+ $datasets[$k]['pointHighlightStroke'] = sprintf( $v['color1'], '1' );
747
+ $datasets[$k]['label'] = $v['label'];
748
+ }
749
+
750
+ return array(
751
+ 'labels' => $labels,
752
+ 'datasets' => $datasets,
753
+ 'sql' => $query
754
+ );
755
+ }
756
+
757
+ /**
758
+ * Get data about courses to render in the chart
759
+ * @return array
760
+ */
761
+ function learn_press_get_chart_courses2() {
762
+ $labels = array( __( 'Pending Courses / Publish Courses', 'learnpress' ), __( 'Free Courses / Priced Courses', 'learnpress' ) );
763
+ $datasets = array();
764
+ $datasets[0]['data'] = array( learn_press_get_courses_by_status( 'pending' ), learn_press_get_courses_by_price( 'free' ) );
765
+ $datasets[1]['data'] = array( learn_press_get_courses_by_status( 'publish' ), learn_press_get_courses_by_price( 'not_free' ) );
766
+
767
+ $colors = learn_press_get_admin_colors();
768
+ $datasets[0]['fillColor'] = $colors[1];
769
+ $datasets[0]['strokeColor'] = $colors[1];
770
+ $datasets[1]['fillColor'] = $colors[3];
771
+ $datasets[1]['strokeColor'] = $colors[3];
772
+ return array(
773
+ 'labels' => $labels,
774
+ 'datasets' => $datasets
775
+ );
776
+ }
777
+
778
+ /**
779
+ * Get colors setting up by admin user
780
+ * @return array
781
+ */
782
+ function learn_press_get_admin_colors() {
783
+ $admin_color = get_user_meta( get_current_user_id(), 'admin_color', true );
784
+ global $_wp_admin_css_colors;
785
+ $colors = array();
786
+ if ( !empty( $_wp_admin_css_colors[$admin_color]->colors ) ) {
787
+ $colors = $_wp_admin_css_colors[$admin_color]->colors;
788
+ }
789
+ if ( empty ( $colors[0] ) ) {
790
+ $colors[0] = '#000000';
791
+ }
792
+ if ( empty ( $colors[2] ) ) {
793
+ $colors[2] = '#00FF00';
794
+ }
795
+ return $colors;
796
+ }
797
+
798
+ /**
799
+ * Convert an array to json format and print out to browser
800
+ *
801
+ * @param array $chart
802
+ */
803
+ function learn_press_process_chart( $chart = array() ) {
804
+ $data = json_encode(
805
+ array(
806
+ 'labels' => $chart['labels'],
807
+ 'datasets' => $chart['datasets']
808
+ )
809
+ );
810
+ echo $data;
811
+ }
812
+
813
+ /**
814
+ * Print out the configuration for admin chart
815
+ */
816
+ function learn_press_config_chart() {
817
+ $colors = learn_press_get_admin_colors();
818
+ $config = array(
819
+ 'scaleShowGridLines' => true,
820
+ 'scaleGridLineColor' => "#777",
821
+ 'scaleGridLineWidth' => 0.3,
822
+ 'scaleFontColor' => "#444",
823
+ 'scaleLineColor' => $colors[0],
824
+ 'bezierCurve' => true,
825
+ 'bezierCurveTension' => 0.2,
826
+ 'pointDotRadius' => 5,
827
+ 'pointDotStrokeWidth' => 5,
828
+ 'pointHitDetectionRadius' => 20,
829
+ 'datasetStroke' => true,
830
+ 'responsive' => true,
831
+ 'tooltipFillColor' => $colors[2],
832
+ 'tooltipFontColor' => "#eee",
833
+ 'tooltipCornerRadius' => 0,
834
+ 'tooltipYPadding' => 10,
835
+ 'tooltipXPadding' => 10,
836
+ 'barDatasetSpacing' => 10,
837
+ 'barValueSpacing' => 200
838
+
839
+ );
840
+ echo json_encode( $config );
841
+ }
842
+
843
+ function set_post_order_in_admin( $wp_query ) {
844
+ global $pagenow;
845
+ if ( isset( $_GET['post_type'] ) ) {
846
+ $post_type = $_GET['post_type'];
847
+ } else $post_type = '';
848
+ if ( is_admin() && 'edit.php' == $pagenow && $post_type == LP()->course_post_type && !isset( $_GET['orderby'] ) ) {
849
+ $wp_query->set( 'orderby', 'date' );
850
+ $wp_query->set( 'order', 'DSC' );
851
+ }
852
+ }
853
+
854
+ add_filter( 'pre_get_posts', 'set_post_order_in_admin' );
855
+ /**
856
+ * Add actions to the list of the course. e.g: Duplicate link
857
+ *
858
+ * @param $actions
859
+ *
860
+ * @return mixed
861
+ */
862
+ function learn_press_add_row_action_link( $actions ) {
863
+ global $post;
864
+ if ( LP()->course_post_type == $post->post_type ) {
865
+ $duplicate_link = admin_url( 'edit.php?post_type=lp_course&action=lp-duplicate-course&post=' . $post->ID . '&nonce=' . wp_create_nonce( 'lp-duplicate-' . $post->ID ) );
866
+ $duplicate_link = array(
867
+ array(
868
+ 'link' => $duplicate_link,
869
+ 'title' => __( 'Duplicate this course', 'learnpress' ),
870
+ 'class' => ''
871
+ )
872
+ );
873
+ $links = apply_filters( 'learn_press_row_action_links', $duplicate_link );
874
+ if ( count( $links ) > 1 ) {
875
+ $drop_down = array( '<ul class="lpr-row-action-dropdown">' );
876
+ foreach ( $links as $link ) {
877
+ $drop_down[] = '<li>' . sprintf( '<a href="%s" class="%s">%s</a>', $link['link'], $link['class'], $link['title'] ) . '</li>';
878
+ };
879
+ $drop_down[] = '</ul>';
880
+ $link = sprintf( '<div class="lpr-row-actions"><a href="%s">%s</a>%s</div>', 'javascript: void(0);', __( 'Course', 'learnpress' ), join( "\n", $drop_down ) );
881
+ } else {
882
+ $link = array_shift( $links );
883
+ $link = sprintf( '<a href="%s" class="%s">%s</a>', $link['link'], $link['class'], $link['title'] );
884
+ }
885
+ $actions['lpr-course-row-action'] = $link;
886
+ }
887
+ return $actions;
888
+ }
889
+
890
+ add_filter( 'page_row_actions', 'learn_press_add_row_action_link' );
891
+
892
+ function learn_press_copy_post_meta( $from_id, $to_id ) {
893
+ global $wpdb;
894
+ $course_meta = $wpdb->get_results(
895
+ $wpdb->prepare( "SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id = %d", $from_id )
896
+ );
897
+ if ( count( $course_meta ) != 0 ) {
898
+ $sql_query = "INSERT INTO $wpdb->postmeta (post_id, meta_key, meta_value) ";
899
+ $sql_query_sel = array();
900
+
901
+ foreach ( $course_meta as $meta ) {
902
+ $meta_key = $meta->meta_key;
903
+ $meta_value = addslashes( $meta->meta_value );
904
+
905
+ $sql_query_sel[] = "SELECT {$to_id}, '$meta_key', '$meta_value'";
906
+ }
907
+
908
+ $sql_query .= implode( " UNION ALL ", $sql_query_sel );
909
+ $wpdb->query( $sql_query );
910
+ }
911
+ }
912
+
913
+ /**
914
+ * Duplicate a course when user hit "Duplicate" button
915
+ *
916
+ * @author TuNN
917
+ */
918
+ function learn_press_process_duplicate_action() {
919
+
920
+ $wp_list_table = _get_list_table( 'WP_Posts_List_Table' );
921
+ $action = $wp_list_table->current_action();
922
+
923
+ if ( isset( $_REQUEST['action'] ) && ( $action = $_REQUEST['action'] ) == 'lp-duplicate-course' ) {
924
+ $post_id = isset( $_REQUEST['post'] ) ? $_REQUEST['post'] : 0;
925
+ $nonce = !empty( $_REQUEST['nonce'] ) ? $_REQUEST['nonce'] : '';
926
+ if ( !wp_verify_nonce( $nonce, 'lp-duplicate-' . $post_id ) ) {
927
+ wp_die( __( 'Error', 'learnpress' ) );
928
+ }
929
+ if ( $post_id && is_array( $post_id ) ) {
930
+ $post_id = array_shift( $post_id );
931
+ }
932
+ // check for post is exists
933
+ if ( !( $post_id && $post = get_post( $post_id ) ) ) {
934
+ wp_die( __( 'Op! The course does not exists', 'learnpress' ) );
935
+ }
936
+ // ensure that user can create course
937
+ if ( !current_user_can( 'edit_posts' ) ) {
938
+ wp_die( __( 'Sorry! You have not permission to duplicate this course', 'learnpress' ) );
939
+ }
940
+
941
+ // assign course to current user
942
+ $current_user = wp_get_current_user();
943
+ $new_course_author = $current_user->ID;
944
+
945
+ // setup course data
946
+ $new_course_title = $post->post_title . ' - Copy';
947
+ $args = array(
948
+ 'comment_status' => $post->comment_status,
949
+ 'ping_status' => $post->ping_status,
950
+ 'post_author' => $new_course_author,
951
+ 'post_content' => $post->post_content,
952
+ 'post_excerpt' => $post->post_excerpt,
953
+ 'post_name' => $post->post_name,
954
+ 'post_parent' => $post->post_parent,
955
+ 'post_password' => $post->post_password,
956
+ 'post_status' => 'draft',
957
+ 'post_title' => $new_course_title,
958
+ 'post_type' => $post->post_type,
959
+ 'to_ping' => $post->to_ping,
960
+ 'menu_order' => $post->menu_order
961
+ );
962
+
963
+ // insert new course and get it ID
964
+ $new_post_id = wp_insert_post( $args );
965
+
966
+ if ( !$new_post_id ) {
967
+ LP_Admin_Notice::add_redirect( __( '<p>Sorry! Duplicate the course failed!</p>', 'learnpress' ) );
968
+ wp_redirect( admin_url( 'edit.php?post_type=lp_course' ) );
969
+ exit();
970
+ }
971
+ // assign related tags/categories to new course
972
+ $taxonomies = get_object_taxonomies( $post->post_type );
973
+ foreach ( $taxonomies as $taxonomy ) {
974
+ $post_terms = wp_get_object_terms( $post_id, $taxonomy, array( 'fields' => 'slugs' ) );
975
+ wp_set_object_terms( $new_post_id, $post_terms, $taxonomy, false );
976
+ }
977
+
978
+ // duplicate course data
979
+ global $wpdb;
980
+ //learn_press_copy_post_meta( $post_id, $new_post_id );
981
+
982
+ $query = $wpdb->prepare( "
983
+ SELECT *
984
+ FROM {$wpdb->prefix}learnpress_sections s
985
+ INNER JOIN {$wpdb->posts} c ON c.ID = s.section_course_id
986
+ WHERE c.ID = %d
987
+ ", $post->ID );
988
+ if ( $sections = $wpdb->get_results( $query ) ) {
989
+ foreach ( $sections as $section ) {
990
+ $new_section_id = $wpdb->insert(
991
+ $wpdb->prefix . 'learnpress_sections',
992
+ array(
993
+ 'section_name' => $section->section_name,
994
+ 'section_course_id' => $new_post_id,
995
+ 'section_order' => $section->section_order,
996
+ 'section_description' => $section->section_description
997
+ ),
998
+ array( '%s', '%d', '%d', '%s' )
999
+ );
1000
+ if ( $new_section_id ) {
1001
+ $query = $wpdb->prepare( "
1002
+ SELECT i.*
1003
+ FROM {$wpdb->posts} i
1004
+ INNER JOIN {$wpdb->prefix}learnpress_sections s ON i.item_id = i.ID
1005
+ WHERE s.section_id = %d
1006
+ ", $section->section_id );
1007
+ if ( $items = $wpdb->get_results( $query ) ) {
1008
+ foreach ( $items as $item ) {
1009
+ $item_args = (array) $item;
1010
+ unset(
1011
+ $item_args['ID'],
1012
+ $item_args['post_author'],
1013
+ $item_args['post_date'],
1014
+ $item_args['post_date_gmt'],
1015
+ $item_args['post_modified'],
1016
+ $item_args['post_modified_gmt'],
1017
+ $item_args['comment_count']
1018
+ );
1019
+ $new_item_id = $wpdb->insert(
1020
+ $wpdb->posts,
1021
+ $item_args
1022
+ );
1023
+ }
1024
+ }
1025
+ }
1026
+ }
1027
+ }
1028
+ LP_Admin_Notice::add_redirect( __( '<p>Course duplicated.</p>', 'learnpress' ) );
1029
+ wp_redirect( admin_url( "post.php?post={$new_post_id}&action=edit" ) );
1030
+ die();
1031
+ }
1032
+ }
1033
+
1034
+ add_action( 'load-edit.php', 'learn_press_process_duplicate_action' );
1035
+
1036
+ function learn_press_admin_notice_bundle_activation() {
1037
+ if ( !empty( $_REQUEST['tab'] ) && ( 'bundle_activate' != $_REQUEST['tab'] ) && learn_press_get_notice_dismiss( 'bundle-addon-install', '' ) != 'off' ) {
1038
+ ?>
1039
+ <div class="updated">
1040
+ <p>
1041
+ <?php printf( __( 'Want full free features? Click <a href="%s">here</a> to install LearnPress Add-ons Bundle for free!', 'learnpress' ), admin_url( 'admin.php?page=learn_press_add_ons&tab=bundle_activate' ) ); ?>
1042
+ <?php printf( '<a href="" class="learn-press-admin-notice-dismiss" data-context="bundle-addon-install" data-transient="-1"></a>' ); ?>
1043
+ </p>
1044
+ </div>
1045
+ <?php
1046
+ }
1047
+ }
1048
+
1049
+ add_action( 'admin_notices', 'learn_press_admin_notice_bundle_activation' );
1050
+
1051
+ /**
1052
+ * Install a plugin
1053
+ *
1054
+ * @param string $plugin_name
1055
+ *
1056
+ * @return array
1057
+ */
1058
+ function learn_press_install_add_on( $plugin_name ) {
1059
+ require_once( LP_PLUGIN_PATH . '/inc/admin/class-lp-upgrader.php' );
1060
+ $upgrader = new LP_Upgrader();
1061
+ global $wp_filesystem;
1062
+ $response = array();
1063
+
1064
+ $package = 'http://thimpress.com/lprepo/' . $plugin_name . '.zip';
1065
+
1066
+ $package = $upgrader->download_package( $package );
1067
+ if ( is_wp_error( $package ) ) {
1068
+ $response['error'] = $package;
1069
+ } else {
1070
+ $working_dir = $upgrader->unpack_package( $package, true, $plugin_name );
1071
+ if ( is_wp_error( $working_dir ) ) {
1072
+ $response['error'] = $working_dir;
1073
+ } else {
1074
+
1075
+ $wp_upgrader = new WP_Upgrader();
1076
+ $options = array(
1077
+ 'source' => $working_dir,
1078
+ 'destination' => WP_PLUGIN_DIR,
1079
+ 'clear_destination' => false, // Do not overwrite files.
1080
+ 'clear_working' => true,
1081
+ 'hook_extra' => array(
1082
+ 'type' => 'plugin',
1083
+ 'action' => 'install'
1084
+ )
1085
+ );
1086
+ //$response = array();
1087
+ $result = $wp_upgrader->install_package( $options );
1088
+
1089
+ if ( is_wp_error( $result ) ) {
1090
+ $response['error'] = $result;
1091
+ } else {
1092
+ $response = $result;
1093
+ $response['text'] = __( 'Installed', 'learnpress' );
1094
+ }
1095
+ }
1096
+ }
1097
+ return $response;
1098
+ }
1099
+
1100
+ function learn_press_accept_become_a_teacher() {
1101
+ $action = !empty( $_REQUEST['action'] ) ? $_REQUEST['action'] : '';
1102
+ $user_id = !empty( $_REQUEST['user_id'] ) ? $_REQUEST['user_id'] : '';
1103
+ if ( !$action || !$user_id || ( $action != 'accept-to-be-teacher' ) ) return;
1104
+
1105
+ if ( !learn_press_user_maybe_is_a_teacher( $user_id ) ) {
1106
+ $be_teacher = new WP_User( $user_id );
1107
+ $be_teacher->set_role( LP()->teacher_role );
1108
+ delete_transient( 'learn_press_become_teacher_sent_' . $user_id );
1109
+ do_action( 'learn_press_user_become_a_teacher', $user_id );
1110
+ $redirect = add_query_arg( 'become-a-teacher-accepted', 'yes' );
1111
+ $redirect = remove_query_arg( 'action', $redirect );
1112
+ wp_redirect( $redirect );
1113
+ }
1114
+ }
1115
+
1116
+ add_action( 'plugins_loaded', 'learn_press_accept_become_a_teacher' );
1117
+
1118
+ function learn_press_user_become_a_teacher_notice() {
1119
+ if ( $user_id = learn_press_get_request( 'user_id' ) && learn_press_get_request( 'become-a-teacher-accepted' ) == 'yes' ) {
1120
+ $user = new WP_User( $user_id );
1121
+ ?>
1122
+ <div class="updated">
1123
+ <p><?php printf( __( 'The user %s has become a teacher', 'learnpress' ), $user->user_login ); ?></p>
1124
+ </div>
1125
+ <?php
1126
+ }
1127
+ }
1128
+
1129
+ add_action( 'admin_notices', 'learn_press_user_become_a_teacher_notice' );
1130
+
1131
+ /**
1132
+ * Check to see if a plugin is already installed or not
1133
+ *
1134
+ * @param $plugin
1135
+ *
1136
+ * @return bool
1137
+ */
1138
+ function learn_press_is_plugin_install( $plugin ) {
1139
+ $installed_plugins = get_plugins();
1140
+ return isset( $installed_plugins[$plugin] );
1141
+ }
1142
+
1143
+ /**
1144
+ * Get plugin file that contains the information from slug
1145
+ *
1146
+ * @param $slug
1147
+ *
1148
+ * @return mixed
1149
+ */
1150
+ function learn_press_plugin_basename_from_slug( $slug ) {
1151
+ $keys = array_keys( get_plugins() );
1152
+ foreach ( $keys as $key ) {
1153
+ if ( preg_match( '|^' . $slug . '/|', $key ) ) {
1154
+ return $key;
1155
+ }
1156
+ }
1157
+ return $slug;
1158
+ }
1159
+
1160
+ function learn_press_one_click_install_sample_data_notice() {
1161
+ $courses = get_posts(
1162
+ array(
1163
+ 'post_type' => LP()->course_post_type,
1164
+ 'post_status' => 'any'
1165
+ )
1166
+ );
1167
+ if ( ( 0 == sizeof( $courses ) ) && ( 'off' != get_transient( 'learn_press_install_sample_data' ) ) ) {
1168
+ printf(
1169
+ '<div class="updated" id="learn-press-install-sample-data-notice">
1170
+ <div class="install-sample-data-notice">
1171
+ <p>%s</p>
1172
+ <p>%s <strong>%s</strong> %s
1173
+ <p><a href="" class="button yes" data-action="yes">%s</a> <a href="" class="button disabled no" data-action="no">%s</a></p>
1174
+ </div>
1175
+ <div class="install-sample-data-loading">
1176
+ <p>Importing...</p>
1177
+ </div>
1178
+ </div>',
1179
+ __( 'You haven\'t got any courses yet! Would you like to import sample data?', 'learnpress' ),
1180
+ __( 'If yes, it requires to install addon named', 'learnpress' ),
1181
+ __( 'LearnPress Import/Export', 'learnpress' ),
1182
+ __( 'but don\'t worry because it is completely automated.', 'learnpress' ),
1183
+ __( 'Import now', 'learnpress' ),
1184
+ __( 'No, thanks!', 'learnpress' )
1185
+ );
1186
+ }
1187
+ }
1188
+
1189
+ //add_action( 'admin_notices', 'learn_press_one_click_install_sample_data_notice' );
1190
+
1191
+ function learn_press_request_query( $vars = array() ) {
1192
+ global $typenow, $wp_query, $wp_post_statuses;
1193
+ if ( LP()->order_post_type === $typenow ) {
1194
+ // Status
1195
+ if ( !isset( $vars['post_status'] ) ) {
1196
+ $post_statuses = learn_press_get_order_statuses();
1197
+
1198
+ foreach ( $post_statuses as $status => $value ) {
1199
+ if ( isset( $wp_post_statuses[$status] ) && false === $wp_post_statuses[$status]->show_in_admin_all_list ) {
1200
+ unset( $post_statuses[$status] );
1201
+ }
1202
+ }
1203
+
1204
+ $vars['post_status'] = array_keys( $post_statuses );
1205
+
1206
+ }
1207
+ }
1208
+ return $vars;
1209
+ }
1210
+
1211
+ add_filter( 'request', 'learn_press_request_query' );
1212
+
1213
+ function _learn_press_reset_course_data() {
1214
+ if ( empty( $_REQUEST['reset-course-data'] ) ) {
1215
+ return false;
1216
+ }
1217
+ learn_press_reset_course_data( intval( $_REQUEST['reset-course-data'] ) );
1218
+ wp_redirect( remove_query_arg( 'reset-course-data' ) );
1219
+ }
1220
+
1221
+ add_action( 'init', '_learn_press_reset_course_data' );
1222
+
1223
+ /***********************/
1224
+ function learn_press_admin_section_loop_item_class( $item, $section ) {
1225
+ $classes = array(
1226
+ 'lp-section-item'
1227
+ );
1228
+ $classes[] = 'lp-item-' . $item->post_type;
1229
+ if ( !absint( $item->ID ) ) {
1230
+ $classes[] = 'lp-item-empty lp-item-new focus';
1231
+ }
1232
+ $classes = apply_filters( 'learn_press_section_loop_item_class', $classes, $item, $section );
1233
+ if ( $classes ) echo 'class="' . join( ' ', $classes ) . '"';
1234
+ return $classes;
1235
+ }
1236
+
1237
+ function learn_press_disable_checked_ontop( $args ) {
1238
+
1239
+ if ( 'course_category' == $args['taxonomy'] ) {
1240
+ $args['checked_ontop'] = false;
1241
+ }
1242
+
1243
+ return $args;
1244
+ }
1245
+
1246
+ add_filter( 'wp_terms_checklist_args', 'learn_press_disable_checked_ontop' );
1247
+
1248
+ function learn_press_output_admin_template() {
1249
+ learn_press_admin_view( 'admin-template.php' );
1250
+ }
1251
+
1252
+ add_action( 'admin_print_scripts', 'learn_press_output_admin_template' );
1253
+
1254
+ function learn_press_output_screen_id() {
1255
+ $screen = get_current_screen();
1256
+ if ( $screen ) {
1257
+ echo "<div style=\"position:fixed;top: 0; left:0; z-index: 99999999; background-color:#FFF;padding:4px;\">" . $screen->id . "</div>";
1258
+ }
1259
+ }
1260
+
1261
+ //add_action( 'admin_head', 'learn_press_output_screen_id' );
1262
+
1263
+ function learn_press_get_screens() {
1264
+ $screen_id = sanitize_title( __( 'LearnPress', 'learnpress' ) );
1265
+ $screens = array(
1266
+ 'toplevel_page_' . $screen_id,
1267
+ $screen_id . '_page_learn_press_statistics',
1268
+ $screen_id . '_page_learn_press_add_ons'
1269
+ );
1270
+ foreach ( array( 'lp_course', 'lp_lesson', 'lp_quiz', 'lp_lesson', 'lp_order' ) as $post_type ) {
1271
+ $screens[] = 'edit-' . $post_type;
1272
+ $screens[] = $post_type;
1273
+ }
1274
+
1275
+ return apply_filters( 'learn_press_screen_ids', $screens );
1276
+ }
1277
+
1278
+ function learn_press_get_admin_pages() {
1279
+ return apply_filters(
1280
+ 'learn_press_admin_pages',
1281
+ array(
1282
+ 'learn_press_settings'
1283
+ )
1284
+ );
1285
+ }
1286
+
1287
+ function learn_press_get_notice_dismiss( $context, $type = 'transient' ) {
1288
+ if ( $type == 'transient' ) {
1289
+ return get_transient( 'learn_press_dismiss_notice_' . $context );
1290
+ }
1291
+ return get_option( 'learn_press_dismiss_notice_' . $context );
1292
+ }
inc/admin/lpr-admin-functions.php DELETED
@@ -1,598 +0,0 @@
1
- <?php
2
- /**
3
- * @file
4
- * Common functions used for admin
5
- */
6
-
7
- /**
8
- * Translate javascript text
9
- */
10
- function learn_press_admin_localize_script() {
11
- if ( defined( 'DOING_AJAX' ) || !is_admin() ) return;
12
- $translate = array(
13
- 'quizzes_is_not_available' => __( 'Quiz is not available', 'learn_press' ),
14
- 'lessons_is_not_available' => __( 'Lesson is not available', 'learn_press' )
15
- );
16
- LPR_Admin_Assets::add_localize( $translate );
17
- }
18
-
19
- add_action( 'init', 'learn_press_admin_localize_script' );
20
-
21
- /**
22
- * Default admin settings pages
23
- *
24
- * @return mixed
25
- */
26
- function learn_press_settings_tabs_array() {
27
- $tabs = array(
28
- 'general' => __( 'General', 'learn_press' ),
29
- 'pages' => __( 'Pages', 'learn_press' ),
30
- 'payment' => __( 'Payments', 'learn_press' ),
31
- 'emails' => __( 'Emails', 'learn_press' )
32
- );
33
- return apply_filters( 'learn_press_settings_tabs_array', $tabs );
34
- }
35
-
36
- /**
37
- * Count number of orders between to dates
38
- *
39
- * @param string
40
- * @param int
41
- *
42
- * @return int
43
- */
44
- function learn_press_get_order_by_time( $by, $time ) {
45
- global $wpdb;
46
- $user_id = get_current_user_id();
47
-
48
- $y = date( 'Y', $time );
49
- $m = date( 'm', $time );
50
- $d = date( 'd', $time );
51
- switch ( $by ) {
52
- case 'days':
53
- $orders = $wpdb->get_var(
54
- $wpdb->prepare(
55
- "SELECT COUNT(*)
56
- FROM $wpdb->posts AS p
57
- INNER JOIN $wpdb->postmeta AS m ON p.ID = m.post_id
58
- WHERE p.post_author = %d
59
- AND p.post_type = %s
60
- AND m.meta_key = %s
61
- AND m.meta_value = %s
62
- AND YEAR(p.post_date) = %s AND MONTH(p.post_date) = %s AND DAY(p.post_date) = %s",
63
- $user_id, 'lpr_order', '_learn_press_transaction_status', 'completed', $y, $m, $d
64
- )
65
- );
66
-
67
- break;
68
- case 'months':
69
- $orders = $wpdb->get_var(
70
- $wpdb->prepare(
71
- "SELECT COUNT(*)
72
- FROM $wpdb->posts AS p
73
- INNER JOIN $wpdb->postmeta AS m ON p.ID = m.post_id
74
- WHERE p.post_author = %d
75
- AND p.post_type = %s
76
- AND m.meta_key = %s
77
- AND m.meta_value = %s
78
- AND YEAR(p.post_date) = %s AND MONTH(p.post_date) = %s",
79
- $user_id, 'lpr_order', '_learn_press_transaction_status', 'completed', $y, $m
80
- )
81
- );
82
- break;
83
- }
84
- return $orders;
85
- }
86
-
87
- /**
88
- * Count number of orders by status
89
- *
90
- * @param string Status of the orders
91
- *
92
- * @return int
93
- */
94
- function learn_press_get_courses_by_status( $status ) {
95
- global $wpdb;
96
- $user_id = get_current_user_id();
97
- $courses = $wpdb->get_var(
98
- $wpdb->prepare(
99
- "SELECT COUNT(*)
100
- FROM $wpdb->posts
101
- WHERE post_author = %d
102
- AND post_type = %s
103
- AND post_status = %s",
104
- $user_id, 'lpr_course', $status
105
- )
106
- );
107
- return $courses;
108
- }
109
-
110
- /**
111
- * Count number of orders by price
112
- *
113
- * @param string
114
- *
115
- * @return int
116
- */
117
- function learn_press_get_courses_by_price( $fee ) {
118
- global $wpdb;
119
- $user_id = get_current_user_id();
120
- $courses = $wpdb->get_var(
121
- $wpdb->prepare(
122
- "SELECT COUNT(*)
123
- FROM $wpdb->posts AS p
124
- INNER JOIN $wpdb->postmeta AS m ON p.ID = m.post_id
125
- WHERE p.post_author = %d
126
- AND p.post_type = %s
127
- AND p.post_status IN (%s, %s)
128
- AND m.meta_key = %s
129
- AND m.meta_value = %s",
130
- $user_id, 'lpr_course', 'publish', 'pending', '_lpr_course_payment', $fee
131
- )
132
- );
133
- return $courses;
134
- }
135
-
136
- /**
137
- * Get data about students to render in chart
138
- *
139
- * @param null $from
140
- * @param null $by
141
- * @param $time_ago
142
- *
143
- * @return array
144
- */
145
- function learn_press_get_chart_students( $from = null, $by = null, $time_ago ) {
146
- $labels = array();
147
- $datasets = array();
148
- if ( is_null( $from ) ) {
149
- $from = current_time( 'mysql' );
150
- }
151
-
152
- // $by: days, months or years
153
- if ( is_null( $by ) ) {
154
- $by = 'days';
155
- }
156
- switch ( $by ) {
157
- case 'days':
158
- $date_format = 'M d';
159
- break;
160
- case 'months':
161
- $date_format = 'M Y';
162
- break;
163
- case 'years':
164
- $date_format = 'Y';
165
- break;
166
- }
167
-
168
- for ( $i = - $time_ago + 1; $i <= 0; $i ++ ) {
169
- $labels[] = date( $date_format, strtotime( "$i $by", strtotime( $from ) ) );
170
- $datasets[0]['data'][] = learn_press_get_order_by_time( $by, strtotime( "$i $by", strtotime( $from ) ) );
171
- }
172
- $colors = learn_press_get_admin_colors();
173
- $datasets[0]['fillColor'] = 'rgba(255,255,255,0.1)';
174
- $datasets[0]['strokeColor'] = $colors[0];
175
- $datasets[0]['pointColor'] = $colors[0];
176
- $datasets[0]['pointStrokeColor'] = $colors[2];
177
- $datasets[0]['pointHighlightFill'] = $colors[2];
178
- $datasets[0]['pointHighlightStroke'] = $colors[0];
179
- return array(
180
- 'labels' => $labels,
181
- 'datasets' => $datasets
182
- );
183
- }
184
-
185
- /**
186
- * Get data about courses to render in the chart
187
- * @return array
188
- */
189
- function learn_press_get_chart_courses() {
190
- $labels = array( __( 'Pending Courses / Publish Courses', 'learn_press' ), __( 'Free Courses / Paid Courses', 'learn_press' ) );
191
- $datasets = array();
192
- $datasets[0]['data'] = array( learn_press_get_courses_by_status( 'pending' ), learn_press_get_courses_by_price( 'free' ) );
193
- $datasets[1]['data'] = array( learn_press_get_courses_by_status( 'publish' ), learn_press_get_courses_by_price( 'not_free' ) );
194
-
195
- $colors = learn_press_get_admin_colors();
196
- $datasets[0]['fillColor'] = $colors[1];
197
- $datasets[0]['strokeColor'] = $colors[1];
198
- $datasets[1]['fillColor'] = $colors[3];
199
- $datasets[1]['strokeColor'] = $colors[3];
200
- return array(
201
- 'labels' => $labels,
202
- 'datasets' => $datasets
203
- );
204
- }
205
-
206
- /**
207
- * Get colors setting up by admin user
208
- * @return array
209
- */
210
- function learn_press_get_admin_colors() {
211
- $admin_color = get_user_meta( get_current_user_id(), 'admin_color', true );
212
- global $_wp_admin_css_colors;
213
- $colors = array();
214
- if ( !empty( $_wp_admin_css_colors[$admin_color]->colors ) ) {
215
- $colors = $_wp_admin_css_colors[$admin_color]->colors;
216
- }
217
- if ( empty ( $colors[0] ) ) {
218
- $colors[0] = '#000000';
219
- }
220
- if ( empty ( $colors[2] ) ) {
221
- $colors[2] = '#00FF00';
222
- }
223
- return $colors;
224
- }
225
-
226
- /**
227
- * Convert an array to json format and print out to browser
228
- *
229
- * @param array $chart
230
- */
231
- function learn_press_process_chart( $chart = array() ) {
232
- $data = json_encode(
233
- array(
234
- 'labels' => $chart['labels'],
235
- 'datasets' => $chart['datasets']
236
- )
237
- );
238
- echo $data;
239
- }
240
-
241
- /**
242
- * Print out the configuration for admin chart
243
- */
244
- function learn_press_config_chart() {
245
- $colors = learn_press_get_admin_colors();
246
- $config = array(
247
- 'scaleShowGridLines' => true,
248
- 'scaleGridLineColor' => "#777",
249
- 'scaleGridLineWidth' => 0.3,
250
- 'scaleFontColor' => "#444",
251
- 'scaleLineColor' => $colors[0],
252
- 'bezierCurve' => true,
253
- 'bezierCurveTension' => 0.2,
254
- 'pointDotRadius' => 5,
255
- 'pointDotStrokeWidth' => 5,
256
- 'pointHitDetectionRadius' => 20,
257
- 'datasetStroke' => true,
258
- 'responsive' => true,
259
- 'tooltipFillColor' => $colors[2],
260
- 'tooltipFontColor' => "#eee",
261
- 'tooltipCornerRadius' => 0,
262
- 'tooltipYPadding' => 10,
263
- 'tooltipXPadding' => 10,
264
- 'barDatasetSpacing' => 10,
265
- 'barValueSpacing' => 200
266
-
267
- );
268
- echo json_encode( $config );
269
- }
270
-
271
- function set_post_order_in_admin( $wp_query ) {
272
- global $pagenow;
273
- if ( isset( $_GET['post_type'] ) ) {
274
- $post_type = $_GET['post_type'];
275
- } else $post_type = '';
276
- if ( is_admin() && 'edit.php' == $pagenow && $post_type == 'lpr_course' && !isset( $_GET['orderby'] ) ) {
277
- $wp_query->set( 'orderby', 'date' );
278
- $wp_query->set( 'order', 'DSC' );
279
- }
280
- }
281
-
282
- add_filter( 'pre_get_posts', 'set_post_order_in_admin' );
283
-
284
- /**
285
- * Add actions to the list of the course. e.g: Duplicate link
286
- *
287
- * @param $actions
288
- *
289
- * @return mixed
290
- */
291
- function learn_press_add_row_action_link( $actions ) {
292
- global $post;
293
- if ( 'lpr_course' == $post->post_type ) {
294
- $duplicate_link = admin_url( 'edit.php?post_type=lpr_course&action=lpr-duplicate-course&post=' . $post->ID );
295
- $duplicate_link = array(
296
- array(
297
- 'link' => $duplicate_link,
298
- 'title' => __( 'Duplicate this course', 'learn_press' ),
299
- 'class' => ''
300
- )
301
- );
302
- $links = apply_filters( 'learn_press_row_action_links', $duplicate_link );
303
- if ( count( $links ) > 1 ) {
304
- $drop_down = array( '<ul class="lpr-row-action-dropdown">' );
305
- foreach ( $links as $link ) {
306
- $drop_down[] = '<li>' . sprintf( '<a href="%s" class="%s">%s</a>', $link['link'], $link['class'], $link['title'] ) . '</li>';
307
- };
308
- $drop_down[] = '</ul>';
309
- $link = sprintf( '<div class="lpr-row-actions"><a href="%s">%s</a>%s</div>', 'javascript: void(0);', __( 'Course', 'learn_press' ), join( "\n", $drop_down ) );
310
- } else {
311
- $link = array_shift( $links );
312
- $link = sprintf( '<a href="%s" class="%s">%s</a>', $link['link'], $link['class'], $link['title'] );
313
- }
314
- $actions['lpr-course-row-action'] = $link;
315
- }
316
- return $actions;
317
- }
318
-
319
- add_filter( 'page_row_actions', 'learn_press_add_row_action_link' );
320
-
321
- /**
322
- * Duplicate a course when user hit "Duplicate" button
323
- *
324
- * @author TuNN
325
- */
326
- function learn_press_process_duplicate_action() {
327
-
328
- $wp_list_table = _get_list_table( 'WP_Posts_List_Table' );
329
- $action = $wp_list_table->current_action();
330
-
331
- if ( isset( $_REQUEST['action'] ) && ( $action = $_REQUEST['action'] ) == 'lpr-duplicate-course' ) {
332
- $post_id = isset( $_REQUEST['post'] ) ? $_REQUEST['post'] : 0;
333
- if ( $post_id && is_array( $post_id ) ) {
334
- $post_id = array_shift( $post_id );
335
- }
336
- // check for post is exists
337
- if ( !( $post_id && $post = get_post( $post_id ) ) ) {
338
- wp_die( __( 'Op! The course does not exists', 'learn_press' ) );
339
- }
340
- // ensure that user can create course
341
- if ( !current_user_can( 'edit_posts' ) ) {
342
- wp_die( __( 'Sorry! You have not permission to duplicate this course', 'learn_press' ) );
343
- }
344
-
345
- // assign course to current user
346
- $current_user = wp_get_current_user();
347
- $new_course_author = $current_user->ID;
348
-
349
- // setup course data
350
- $new_course_title = $post->post_title . ' - Copy';
351
- $args = array(
352
- 'comment_status' => $post->comment_status,
353
- 'ping_status' => $post->ping_status,
354
- 'post_author' => $new_course_author,
355
- 'post_content' => $post->post_content,
356
- 'post_excerpt' => $post->post_excerpt,
357
- 'post_name' => $post->post_name,
358
- 'post_parent' => $post->post_parent,
359
- 'post_password' => $post->post_password,
360
- 'post_status' => 'draft',
361
- 'post_title' => $new_course_title,
362
- 'post_type' => $post->post_t