diff --git a/assets/addons_themes.png b/assets/addons_themes.png new file mode 100644 index 000000000..63550cf1e Binary files /dev/null and b/assets/addons_themes.png differ diff --git a/assets/arrow-up-down-fill.png b/assets/arrow-up-down-fill.png new file mode 100644 index 000000000..1167f3a2a Binary files /dev/null and b/assets/arrow-up-down-fill.png differ diff --git a/assets/copy.png b/assets/copy.png new file mode 100644 index 000000000..256a50623 Binary files /dev/null and b/assets/copy.png differ diff --git a/assets/create_quiz.png b/assets/create_quiz.png new file mode 100644 index 000000000..e63d5a296 Binary files /dev/null and b/assets/create_quiz.png differ diff --git a/assets/create_survey.png b/assets/create_survey.png new file mode 100644 index 000000000..3762801a1 Binary files /dev/null and b/assets/create_survey.png differ diff --git a/assets/edit-pencil.png b/assets/edit-pencil.png new file mode 100644 index 000000000..c4bd31f61 Binary files /dev/null and b/assets/edit-pencil.png differ diff --git a/assets/eye-line.png b/assets/eye-line.png new file mode 100644 index 000000000..4073bc892 Binary files /dev/null and b/assets/eye-line.png differ diff --git a/assets/gear.png b/assets/gear.png new file mode 100644 index 000000000..e62618112 Binary files /dev/null and b/assets/gear.png differ diff --git a/assets/logo.png b/assets/logo.png new file mode 100644 index 000000000..ee7763033 Binary files /dev/null and b/assets/logo.png differ diff --git a/assets/qsm-upgrade.png b/assets/qsm-upgrade.png new file mode 100644 index 000000000..e94ef99d4 Binary files /dev/null and b/assets/qsm-upgrade.png differ diff --git a/assets/services.png b/assets/services.png new file mode 100644 index 000000000..c5a2ab0d9 Binary files /dev/null and b/assets/services.png differ diff --git a/assets/setup.png b/assets/setup.png new file mode 100644 index 000000000..f172863d4 Binary files /dev/null and b/assets/setup.png differ diff --git a/assets/support.png b/assets/support.png new file mode 100644 index 000000000..309d4bf77 Binary files /dev/null and b/assets/support.png differ diff --git a/assets/trash.png b/assets/trash.png new file mode 100644 index 000000000..224a8cb50 Binary files /dev/null and b/assets/trash.png differ diff --git a/assets/upgrade.png b/assets/upgrade.png new file mode 100644 index 000000000..39b5ad2fc Binary files /dev/null and b/assets/upgrade.png differ diff --git a/css/admin-dashboard-rtl.css b/css/admin-dashboard-rtl.css index c415610ac..bd0583132 100644 --- a/css/admin-dashboard-rtl.css +++ b/css/admin-dashboard-rtl.css @@ -1,11 +1,3 @@ -.welcome-panel-column .dashicons { - color: #606a73; - font-size: 23px; - margin-left: 5px; - position: relative; - top: unset!important; -} - .welcome-panel .qsm-welcome-panel-close { position: absolute; top: -20px; diff --git a/css/admin-dashboard.css b/css/admin-dashboard.css index 778431760..5dcfd44af 100644 --- a/css/admin-dashboard.css +++ b/css/admin-dashboard.css @@ -1,15 +1,5 @@ -.welcome-panel-column .dashicons { - color: #606a73; - font-size: 23px; - margin-right: 5px; - position: relative; - top: unset!important; -} - .welcome-panel .qsm-welcome-panel-close { - position: absolute; - top: -20px; - right: 10px; + position: relative; padding: 10px 15px 10px 21px; font-size: 13px; line-height: 1.23076923; @@ -58,14 +48,11 @@ } .welcome-panel .current_version { - color: #111827; text-align: center; - font-size: 16px; - font-weight: bold; + font-size: 14px; margin: 0; padding: 0; position: relative; - top: -30px; } .welcome-panel .welcome-icon { @@ -976,10 +963,6 @@ h2.hndle.ui-sortable-handle { box-shadow: 0 0 3px rgba(10, 10, 10, 0.2); } -.qsm_dashboard_page .welcome-panel-column{ - display: block; -} - .qsm_dashboard_page.welcome-panel h2 { margin: 0; font-size: 21px; @@ -993,18 +976,152 @@ h2.hndle.ui-sortable-handle { } .qsm_dashboard_page.postbox { - padding: 23px 10px 0; + padding: 10px 10px 10px 40px; + display: flex; + flex-direction: column; + background: #1D4ED8; +} + +.qsm_dashboard_page.postbox h1, +.qsm_dashboard_page.postbox h2, +.qsm_dashboard_page.postbox h3, +.qsm_dashboard_page.postbox h4, +.qsm_dashboard_page.postbox h5, +.qsm_dashboard_page.postbox h6, +.qsm_dashboard_page.postbox p, +.qsm_dashboard_page.postbox a{ + color: #fff; } +.qsm_dashboard_page .welcome-panel-menu { + display: flex; + flex-direction: row; + justify-content: space-between; + min-width: 360px; + align-self: flex-end; + margin: 0; +} +.qsm_dashboard_page .welcome-panel-menu li { + position: relative; +} +.qsm_dashboard_page .welcome-panel-menu li a { + text-decoration: underline; +} +.qsm_dashboard_page .welcome-panel-menu li:not(:first-child)::before { + content: '.'; + color: #fff; + text-decoration: none; + position: absolute; + bottom: 4px; + left: -15px; +} .qsm_dashboard_page .welcome-panel-content { - margin-left: 13px; - min-height: auto; - display: block; + min-height: 180px; + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + padding: 20px 0 45px 0; + box-sizing: border-box; +} +.qsm-welcome-panel-content { + display: flex; + flex-direction: column; + justify-content: space-between; + padding: 0 0 0 25px; +} +.qsm-welcome-panel-content img { + height: 40px; +} +.qsm-welcome-panel-content p { + margin: 7px 0; + font-size: 14px; + line-height: 28px; + font-weight: 400; +} +.qsm-welcome-panel-content h3 { + font-size: 24px; + font-weight: 600; + line-height: 31.92px; + letter-spacing: -0.01em; + text-align: left; + text-underline-position: from-font; + text-decoration-skip-ink: none; +} +.qsm-dashboard-cards-container { + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: space-between; + align-items: center; + padding: 15px 0; +} + +.qsm-dashboard-cards-container .qsm-dashboard-card { + min-width: 400px; + width: 400px; + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: flex-start; + background: #fff; + box-sizing: border-box; + padding: 25px; +} + +@media (max-width: 768px) { + .qsm-dashboard-cards-container .qsm-dashboard-card { + width: 100%; + } + .qsm-dashboard-cards-container .qsm-dashboard-card:not(:last-child) { + margin-bottom: 10px; + } +} + +@media (min-width: 770px) and (max-width: 1280px) { + .qsm-dashboard-cards-container .qsm-dashboard-card { + width: calc(50% - 20px); + } + .qsm-dashboard-cards-container .qsm-dashboard-card:not(:last-child) { + margin-bottom: 10px; + } } -.qsm_dashboard_page .welcome-panel-column-container { - padding: 0 !important; - margin: 1.33em 0 0 !important; +@media (min-width: 1441px) { + .qsm-dashboard-cards-container .qsm-dashboard-card { + width: 32%; + } +} + +.qsm-dashboard-cards-container .qsm-dashboard-card .qsm-dashboard-card-content { + display: flex; + flex-direction: column; + justify-content: space-between; + align-items: flex-start; + padding: 0 0 0 20px; +} + +.qsm-dashboard-cards-container .qsm-dashboard-card .qsm-dashboard-card-content .qsm-dashboard-card-buttons { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: flex-start; + padding: 10px 0; + width: 80%; +} + +.qsm-dashboard-cards-container .qsm-dashboard-card .qsm-dashboard-card-content a { + color: #1e1e1e; +} + +.qsm-dashboard-cards-container .qsm-dashboard-card .qsm-dashboard-card-content .button-secondary { + border: 2px solid #1e1e1e; + border-radius: 5px; + background: transparent; +} + +.qsm-dashboard-cards-container .qsm-dashboard-card .qsm-dashboard-card-content h4 { + margin: 0; } .qsm_dashboard_page p.about-description { diff --git a/css/qsm-admin.css b/css/qsm-admin.css index 6dc4748ba..f185f3dfd 100644 --- a/css/qsm-admin.css +++ b/css/qsm-admin.css @@ -1,3 +1,6 @@ +:root { + --qsm-primary-button: #2272B1; +} /******************** Quizzes/Surveys Page *********************/ @-moz-keyframes qsm-spinner-loader { 0% { @@ -240,6 +243,7 @@ span.qsm-quiz-name { margin-bottom: 15px; font-size: 14px; font-style: normal; + border: 1px solid #555555; } .qsm_popular_addons div.popuar-addon-ul>div img { max-width: 100%; @@ -456,11 +460,29 @@ span.qsm-quiz-name { box-shadow: 0px 0px 5px 1px rgba(0, 0, 0, 0.06); } .results-page .results-page-content, #qsm_emails .qsm-email .qsm-email-content { - background: #f8f9f9; - padding-right: 15px; - padding-left: 15px; - width: 100%; - box-sizing: border-box; + background: #fff; + padding-right: 10px; + padding-left: 5px; + width: 100%; + box-sizing: border-box; +} + +.results-page-condition .qsm-condition-collection-wrap p, .email-condition .qsm-condition-collection-wrap p { + margin-top: 0; + font-weight: 600; +} + +.results-page-header .qsm-settings-box-details, +.qsm-email-header .qsm-settings-box-details { + display: none; + position: absolute; + padding: 10px; + border-radius: 5px; + background: #fff; + border: 1px solid #dfd4d4; + margin: 3px 0 0px 25px; + max-width: 200px; + right: 45px; } .results-page-header, #qsm_emails .qsm-email-header { display: flex; @@ -485,11 +507,11 @@ span.qsm-quiz-name { display: flex; flex-direction: column; } -.results-page-when, .results-page-show, .email-when, .email-show { +.results-page-when, .results-page-show, .qsm-email-when, .email-show { padding: 15px; min-width: 60%; } -.results-page-when, .email-when { +.results-page-when, .qsm-email-when { margin-right: 15px; border-right: 1px solid #dfd4d4; } @@ -504,20 +526,20 @@ span.qsm-quiz-name { .email-content-header h4{ font-size: 20px; margin: 5px 0 15px; - font-weight: 400; + font-weight: 600; + color: #1E1E1E; } .results-page-condition, .email-condition { margin-bottom: 15px; - border-radius: 2px; - background: #fff; + background: #F8F9F9; padding: 25px 20px; position: relative; - border: 1px solid #dfd4d4; + border-radius: 10px; } .qsm-result-condition-title, .qsm-email-condition-title { font-size: 14px; - display: block; + display: none; font-weight: 500; margin-bottom: 3px; color: #959494; @@ -526,22 +548,43 @@ span.qsm-quiz-name { .qsm-email-condition-mode { margin-bottom: 25px; } -.results-page-condition select, .qsm_tab_content .results-page-condition .qsm-result-condition-container input[type="text"], .email-condition select, .qsm_tab_content .email-condition .qsm-email-condition-container input[type="text"] { +.results-page-condition select, +.qsm_tab_content .results-page-condition .qsm-result-condition-container input[type="text"], +.email-condition select, +.qsm_tab_content .email-condition .qsm-email-condition-container input[type="text"], +.results-page-show .qsm-result-page-common-section select, +.results-page-show .qsm-result-page-common-section input[type="text"], +.qsm-email-content .qsm-email-page-common-section select, +.qsm-email-content .qsm-email-page-common-section input[type="text"] + { min-width: auto; width: 100%; - border-radius: 4px; + border-radius: 5px; border-color: #ccc; + padding-top: 2px; + padding-bottom: 2px; } .results-page-condition .qsm-result-condition-container, .email-condition .qsm-email-condition-container, .qsm-result-condition-mode, .qsm-email-condition-mode { display: flex; flex-wrap: wrap; - gap: 5px; + gap: 10px; align-items: flex-end; } + +.email-show .ms-options-wrap>button, .email-show .ms-options-wrap>button:focus, +.results-page-show .ms-options-wrap>button, .results-page-show .ms-options-wrap>button:focus{ + width: 100%; +} + .qsm-email-condition-container-inner, .qsm-result-condition-container-inner{ - width: 33.33%; + width: 50%; } + +.results-page-content label, .results-page-content p, .qsm-email-content label, .qsm-email-content p { + color: #1E1E1E; +} + .delete-condition-button { background: none; cursor: pointer; @@ -571,7 +614,7 @@ span.qsm-quiz-name { flex-direction: row; justify-content: space-around; } - .results-page-when, .results-page-show, .email-when, .email-show { + .results-page-when, .results-page-show, .qsm-email-when, .email-show { width: calc(50% - 15px); min-width: unset; } @@ -588,8 +631,7 @@ span.qsm-quiz-name { flex-direction: column; } .qsm_featured_image_preview { - max-height: 200px; - max-width: 300px; + max-width: 80%; margin: 5px 0; border-radius: 3px; } @@ -608,9 +650,8 @@ span.qsm-quiz-name { /******************** About/Credits Page *********************/ div.qsm_icon_wrap { position: absolute; - top: -20px; - right: 0; - background-color: rgba(54, 58, 66, 1); + top: -24px; + left: -30px; color: #111827; background-position: center 24px; background-size: 85px 85px; @@ -622,12 +663,11 @@ div.qsm_icon_wrap { height: 40px; display: inline-block; width: 150px; - text-rendering: optimizeLegibility; - border: 5px solid #106daa; - -moz-border-radius: 20px; - -webkit-border-radius: 20px; - -khtml-border-radius: 20px; - border-radius: 20px; +} +.qsm-about-heading img{ + width: 100px; + margin-left: -5px; + margin-top: 13px; } .qsm-tab-content .feature { margin-bottom: 20px; @@ -833,13 +873,16 @@ ul.changelog li.update div.two:before { .qsm_tab_content label { margin-right: 5px; } +.qsm-upgrade-box .qsm-upgrade-tabs, .qsm-sub-text-tab-menu, .qsm-sub-tab-menu { display: flex; flex-direction: row; flex-wrap: wrap; align-items: stretch; - border-bottom: 1px solid #cecece; + border-bottom: 1px solid #E5E7EB; + margin: 20px 0; + min-height: 44px; } .save-text-changes { display: flex; @@ -915,12 +958,20 @@ ul.changelog li.update div.two:before { .currentli_general, .currentli_variable { border-left:4px solid #2271b1; - background-color: #a1cef3; + background-color: #E9F1F7; } .qsm-custom-label-left-menu a { color:black; - padding: 10px 6px; + padding: 10px 6px 10px 8px; width: 100%; + font-size: 14px; + font-weight: 400; + line-height: 19px; +} +.qsm-custom-label-left-menu.currentli_general a, +.qsm-custom-label-left-menu.currentli_variable a, +.qsm-custom-label-left-menu.currentli a { + color: #2271b1; } .qsm-sub-tab-menu a, .qsm-sub-text-tab-menu a, @@ -931,16 +982,24 @@ ul.changelog li.update div.two:before { display: inline-block; box-sizing: border-box; } +.qsm-upgrade-box .subsubsub li:first-child, .qsm-sub-text-tab-menu .subsubsub li:first-child, .qsm-sub-tab-menu .subsubsub li:first-child { border-left: 0; padding-left: 0; } +.qsm-upgrade-box .subsubsub li a, .qsm-sub-text-tab-menu .subsubsub li a, .qsm-sub-tab-menu .subsubsub li a { font-size: 14px; - line-height: 1.2; - padding: 10px; + line-height: 20px; + padding: 0 4px 16px 4px; + color: #1E1E1E; +} +.qsm-upgrade-box .subsubsub li, +.qsm-sub-text-tab-menu .subsubsub li, +.qsm-sub-tab-menu .subsubsub li { + padding: 0 8px; } .qsm_tab_content a:hover, .qsm_tab_content a:focus { @@ -948,9 +1007,11 @@ ul.changelog li.update div.two:before { text-decoration: none; box-shadow: none; } +.qsm-upgrade-box .subsubsub li a.current, .qsm-sub-text-tab-menu .subsubsub li a.current, .qsm-sub-tab-menu .subsubsub li a.current{ - border-bottom: 3px solid #00BEE9; + border-bottom: 3px solid #2271B1; + color: #2271B1; } /* Popup */ .qsm-popup { @@ -1244,20 +1305,24 @@ h3.addon_category_name { margin-left: 15px; } /* The switch - the box around the slider */ -.switch { +.qsm-checkbox-switch { position: relative; display: inline-block; width: 60px; height: 34px; } +.qsm-checkbox-switch.small-switch { + width: 50px; + height: 22px; +} /* Hide default HTML checkbox */ -.switch input[type="checkbox"] { +.qsm-checkbox-switch input[type="checkbox"] { opacity: 0; width: 0; height: 0; } /* The slider */ -.slider { +.qsm-switch-slider { position: absolute; cursor: pointer; top: 0; @@ -1268,7 +1333,7 @@ h3.addon_category_name { -webkit-transition: 0.4s; transition: 0.4s; } -.slider:before { +.qsm-switch-slider:before { position: absolute; content: ""; height: 26px; @@ -1279,22 +1344,27 @@ h3.addon_category_name { -webkit-transition: 0.4s; transition: 0.4s; } -input:checked+.slider { +.qsm-checkbox-switch.small-switch .qsm-switch-slider:before { + height: 14px; + width: 15px; + left: 5px; +} +input:checked+.qsm-switch-slider { background-color: #2196f3; } -input:focus+.slider { +input:focus+.qsm-switch-slider { box-shadow: 0 0 1px #2196f3; } -input:checked+.slider:before { +input:checked+.qsm-switch-slider:before { -webkit-transform: translateX(26px); -ms-transform: translateX(26px); transform: translateX(26px); } /* Rounded sliders */ -.slider.round { +.qsm-switch-slider.round { border-radius: 34px; } -.slider.round:before { +.qsm-switch-slider.round:before { border-radius: 50%; } input#sc-shortcode-model-text, input#sc-shortcode-model-text-link { @@ -1450,6 +1520,93 @@ td.scheduled_time_start { margin: 0 10px; width: auto; } + + +#post-body-content .qsm-popup-upgrade-warning img { + width: auto; + height: 15px; + margin-right: 8px; +} + +.qsm-linked-list-div-block { + padding: 4px; + margin: 5px 0; + margin-top: -20px; + width: max-content; + background-color: #ffe684; + border-radius: 2px; +} + +span.qsm-linked-list-view-button { + cursor: pointer; + color: #135e96; + text-decoration: underline; + font-weight: 500; +} + +span.qsm-linked-list-item { + margin: 0 0 5px 0; + padding: 5px; + background: #f0f0f1; +} + +div.qsm-linked-list-inside span.qsm-unlink-the-question { + color: #DC3232; + font-weight: 500; + max-width: 60px; + cursor: pointer; +} + +.qsm-linked-list-div-block p { + margin: 0; + font-size: 13px; + color: #856404; +} + +.qsm-linked-list-container { + position: absolute; +} + +.qsm-linked-list-div-block .qsm-linked-list-inside { + position: relative; + right: -155px; + top: 20px; + z-index: 999; + width: 350px; + padding: 10px; + box-sizing: border-box; + border-radius: 4px; + background: #ffffff; + border: 1px solid #dfd4d4; + box-shadow: 0 0 6px 2px #ddd; + display: grid; + grid-template-columns: 1fr; +} + +.qsm-linked-list-div-block .qsm-linked-list-inside:before { + content: " "; + position: absolute; + top: -24px; + left: 28%; + margin-left: -12px; + border-width: 12px; + border-style: solid; + border-color: transparent transparent #ffffff transparent; + z-index: 1; +} + +.qsm-linked-list-div-block .qsm-linked-list-inside:after { + content: " "; + position: absolute; + top: -26px; + left: 28%; + margin-left: -12px; + border-width: 12px; + border-style: solid; + border-color: transparent transparent #dfd4d4 transparent; + z-index: 0; +} + /** * Text Tab design */ .qsm-text-main-wrap { display: inline-block; @@ -1468,14 +1625,18 @@ td.scheduled_time_start { border: 1px solid #dfd4d4; } .qsm-text-main-wrap #postbox-container-1 .qsm-text-header h5 { - font-size: 14px; - margin: 0; - font-weight: bold; + font-size: 15px; + margin: 0; + font-weight: 600; + line-height: 30px; + color: #1E1E1E; } .qsm-text-main-wrap #postbox-container-1 .qsm-text-header .description { - color: #666; - display: block; - font-weight: 400; + color: #555555; + display: block; + font-weight: 400; + font-size: 14px; + line-height: 19px; } .qsm-text-main-wrap .qsm-text-header { display: flex; @@ -1879,14 +2040,18 @@ td.scheduled_time_start { .qsm-theme-color-settings .qsm-popup__header .qsm-popup__close { position: relative; font-size: 22px; - border: 1px solid #ddd; padding: 15px; cursor: pointer; } +.qsm-theme-color-settings .qsm-popup__header .qsm-popup__close { + border: 1px solid #ddd; +} .qsm-standard-popup .qsm-popup__content, .qsm-theme-color-settings .qsm-popup__content { padding: 20px; margin: 0; +} +.qsm-theme-color-settings .qsm-popup__content { box-shadow: inset 0 0 10px 1px #ddd; } .qsm-standard-popup .qsm-popup__content a { @@ -1917,7 +2082,7 @@ td.scheduled_time_start { align-items: center; } .qsm-popup-upgrade .qsm-popup__container { - max-width: 500px; + max-width: 600px; max-height: 90vh; } .qsm-popup-upgrade .qsm-popup__container .qsm-popup__content { @@ -1953,10 +2118,123 @@ td.scheduled_time_start { display: inline-block; width: 100%; box-sizing: border-box; - padding: 10px; + padding: 40px; max-width: 800px; + background: #fff; +} +.qsm-upgrade-box-base { + display: flex; + flex-direction: row; + justify-content: space-between; + margin-top: 25px; + align-items: center; + max-width: 100%; + width: 671px; + background: #EFF6FF; + padding: 16px; + border-radius: 6px; + box-sizing: border-box; +} +.qsm-upgrade-box-base-title { + display: flex; + flex-direction: row; + align-items: center; +} +.qsm-upgrade-box-base p { + font-weight: 500; + font-size: 14px; + line-height: 20px; + color: #1E1E1E; + position: relative; + right: 20px; + left: 15px; +} +.qsm-upgrade-box-base a { + text-decoration: none; + color: #1E1E1E; + outline: none; + box-shadow: none; +} +.qsm-upgrade-box-base a span { + margin-left: 10px; +} +.qsm-upgrade-box-base a.button { + color: #fff; + box-shadow: 0px 0px 0px 4px #6366F1; + border: 2px solid #FFFFFF; + background: #1D4ED8; + font-size: 14px; + font-weight: 500; + line-height: 16px; + text-align: left; + text-decoration-skip-ink: none; + border-radius: 4px; + padding: 4px 8px; + position: relative; + left: 60px; +} +.qsm-upgrade-box-base img { + height: 16px; + width: 16px; +} +.qsm-upgrade-box .qsm-upgrade-list-item, +.qsm-upgrade-box .qsm-upgrade-briefing, +.qsm-upgrade-box .qsm-upgrade-description { + display: flex; + flex-direction: row; + align-items: center; + font-size: 16px; + font-weight: 400; + line-height: 30px; + text-align: left; + text-underline-position: from-font; + text-decoration-skip-ink: none; + color: #555555; +} +.qsm-upgrade-box .qsm-upgrade-list-item span { + margin-right: 10px; + background: #D7E1FF; + color: #1D4ED8; + border-radius: 50%; + font-size: 22px; + width: 22px; + height: 22px; +} +.qsm-upgrade-box a, +.qsm-upgrade-box a:focus { + outline: none; + box-shadow: none; +} +.qsm-upgrade-box .qsm-upgrade-tab-content { + padding: 0 0 15px; +} +.qsm-upgrade-box-title { + display: flex; + flex-direction: row; + align-items: center; + justify-content: space-between; +} +.qsm-popup__title.qsm-upgrade-box-title { + position: relative; + top: 10px; + left: 15px; + color: #000; + font-size: 24px; + font-weight: 500; + line-height: 31.92px; + letter-spacing: -0.01em; + text-align: left; + text-decoration-skip-ink: none; +} +.qsm-upgrade-box-title img { + margin-right: 10px; + height: 20px; + position: relative; + top: 1px; +} +.qsm-popup-upgrade .qsm-upgrade-box { + padding: 0 20px 30px; } -.qsm-popup-upgrade .qsm-upgrade-box {padding: 0;} .qsm-popup-upgrade-close { border:none; padding:0px; @@ -1966,6 +2244,7 @@ td.scheduled_time_start { line-height: normal; margin: 15px 0 10px; letter-spacing: 1px; + width: 100%; } .qsm-upgrade-box .qsm-upgrade-text { @@ -1976,7 +2255,7 @@ td.scheduled_time_start { .qsm-upgrade-box .qsm-upgrade-read-icon { display: flex; flex-direction: row; - margin: 10px 0; + margin: 10px 0 35px; flex-wrap: nowrap; align-items: center; font-size: 14px; @@ -1991,9 +2270,6 @@ td.scheduled_time_start { align-items: center; margin: 2px 6px 0; } -.qsm-upgrade-box .qsm-upgrade-read-icon img { - height: 15px; -} .qsm-upgrade-box .qsm-upgrade-right-arrow { font-size: 16px; color: inherit; @@ -2144,12 +2420,20 @@ td.scheduled_time_start { align-content: center; align-items: center; } +.qsm-popup__container .qsm-popup__content .qsm-upgrade-box .qsm-upgrade-buttons a, .qsm-upgrade-box .qsm-upgrade-buttons.qsm-page-upgrade-buttons a { - width: auto; - margin-right: 10px; - font-weight: 500; - font-size: 14px; padding: 10px 20px; + min-width: 450px; + min-height: 46px; + border-radius: 5px; + background: #1D4ED8; + color: #fff; + box-sizing: border-box; + font-size: 18px; + font-weight: 600; + line-height: 23.94px; + text-align: center; + text-decoration-skip-ink: none; } #modal-6 .sc-shortcode-input { padding: 5px; @@ -2224,6 +2508,12 @@ td.scheduled_time_start { display: inline-block; margin-bottom: 30px; } + .tablenav .tablenav-pages { + text-align: right; + position: relative; + top: 1px; + left: 140px + } } @media screen and (max-width: 782px) { .form-table td fieldset label { @@ -2240,6 +2530,11 @@ td.scheduled_time_start { left: auto; right: -3px; } + .tablenav .tablenav-pages { + top: 61px; + width: 45%; + text-align: left; + } } @media screen and (max-width: 767px) { .qsm-upgrade-box .qsm-upgrade-buttons.qsm-page-upgrade-buttons a { @@ -2291,9 +2586,6 @@ td.scheduled_time_start { overflow: scroll; width: 100%; } - p.search-box { - bottom: -30px; - } .quizzes-surveys_page_qsm_quiz_help .hndle { padding-left: 15px; padding-bottom: 15px; @@ -2322,11 +2614,21 @@ td.scheduled_time_start { min-width: 100px; } .qsm-text-template-span .button { - padding: 0px; - border: none; - min-height: unset; - font-size: 12px; - background: unset; + padding: 5px 10px; + border: 1px solid #2271B1; + min-height: unset; + font-size: 12px; + background: unset; + line-height: 16px; + font-weight: 400; +} +.qsm-theme-featured-image-description { + font-size: 16px; + font-weight: 400; + line-height: 30px; + text-align: left; + color: #555555; + margin: 5px 0 30px 0; } .qsm-text-template-span .template-variable:hover { background: unset; @@ -2560,9 +2862,9 @@ input#duplicate_questions { display: inline-flex; align-items: center; flex-wrap: nowrap; - box-shadow: 0 0 5px 0px #ddd; border-radius: 5px; margin: 0 5px; + border: 1px solid #dfd4d4; } .qsm-actions-link-box a:first-child { border-radius: 5px 0 0 5px; @@ -2571,9 +2873,8 @@ input#duplicate_questions { border-radius: 0 5px 5px 0; } .qsm-actions-link-box a { - padding: 9px; + padding: 4px 8px; color: #3c434a; - border: 1px solid #ddd; cursor: pointer; } .qsm-actions-link-box a.disabled { @@ -2584,6 +2885,22 @@ input#duplicate_questions { box-shadow: none; background: #eee; } +.qsm-actions-link-box a:not(:first-child) { + border-left: 1px solid #d6d6d6; +} +a.qsm-toggle-result-page-button, a.qsm-toggle-email-template-button { + height: 35px; + display: flex; + align-items: center; + justify-content: center; +} +.qsm-actions-link-box a.qsm-settings-box-result-button:focus { + background-color: #ebf4fc; +} +.results-page-when .qsm-new-condition, .qsm-email-when .qsm-new-condition{ + width: 121px; + font-weight: 600; +} .qsm-actions-link-box a span { font-size: 16px; height: auto; @@ -3316,6 +3633,15 @@ input#duplicate_questions { position: relative; top: 10px; } + p.search-box{ + display: inline-grid; + width: auto; + } + .tablenav .tablenav-pages { + position: relative; + top: 80px; + width: 140px; + } } body .qsm_tab_content .qsm-small-input-field input[type="number"], body .qsm_tab_content .qsm-small-input-field input[type="text"] { @@ -3384,7 +3710,7 @@ input#preferred-date-format-custom { position: absolute !important; z-index: 1000; background-color: #ffffff; - border: 1px solid #cccccc; + border: 1px solid #dfd4d4; width: 100%; max-height: 270px; border-radius: 6px; @@ -3412,7 +3738,7 @@ input#preferred-date-format-custom { } .mce-container .qsm-autocomplete .qsm-autocomplete-item:hover, .mce-container .qsm-autocomplete .qsm-autocomplete-item-active { - background-color: #f0f0f0; + background-color: #E8E8E8; } .mce-container .qsm-autocomplete .qsm-autocomplete-item .qsm-autocomplete-item-description { color: #808992; @@ -3428,15 +3754,16 @@ input#preferred-date-format-custom { } .qsm-hightlight-text, .mce-qsm-variables-editor-btn button{ - background: #187FFA; + background: #DCEDFA; border-radius: 2px; display: inline-block; text-align: center; border: none; + color: #1E1E1E; } .qsm-hightlight-text, .mce-qsm-variables-editor-btn button span.mce-txt{ - color: #ffffff; + color: #1E1E1E; padding: 0px 7px; } /*TinyMCE Text-editor : end */ @@ -3476,17 +3803,180 @@ button.button.qsm-extra-shortcode-popup { z-index: 10; } -button.button.qsm-slashcommand-variables-button { - display: flex; - align-items: center; - position: relative; - top: 30px; - left: 110px; - z-index: 10; - margin: -30px 0; -} - button.button.qsm-slashcommand-variables-button .qsm-slash-inside { margin: 0 4px 0 -1px; font-weight: 1000; +} + +@media screen and (max-width: 782px) { + button.button.qsm-extra-shortcode-resultpage-button { + display: flex; + align-items: center; + position: relative; + top: 3px; + left: 0px; + z-index: 10; + } + + .qsm-email-condition-container-inner, .qsm-result-condition-container-inner { + width: 100%; + } +} + +.mce-container .qsm-autocomplete .qsm-autocomplete-item-title{ + color: #1E1E1E; + background: #DCEDFA; + padding: 7px; + font-size: 12px; +} + +.mce-container .qsm-autocomplete .qsm-autocomplete-item:hover .qsm-autocomplete-item-title, +.mce-container .qsm-autocomplete .qsm-autocomplete-item-active .qsm-autocomplete-item-title { + background-color: #FFFFFF; +} + +.mce-container .qsm-autocomplete .qsm-autocomplete-no-item { + color: #1E1E1E; + padding: 10px 8px; + font-size: 12px; +} +.mce-container .qsm-autocomplete .qsm-autocomplete-input-container { + display: flex; + align-items: center; + padding: 5px 15px; +} +.mce-container .qsm-autocomplete input.qsm-autocomplete-search-input{ + width: calc(100% - 85px); + margin-left: 15px; +} + +.qsm_page_mlw_quiz_results .widefat tbody td input[type="checkbox"], +.qsm_page_mlw_quiz_results .widefat thead th input[type="checkbox"] { + margin: 0 auto; + display: block; +} + +.qsm_page_mlw_quiz_results .result-page-wrapper .pagination-links{ + border: 1px solid #8c8f94; + background-color: #fff; + padding: 6px 0; + border-radius: 3px; +} + +.qsm_page_mlw_quiz_results .result-page-wrapper .pagination-links .next-page, +.qsm_page_mlw_quiz_results .pagination-links .prev-page{ + border: none; + background: none; + color: #000; + border-radius: none; +} +.qsm_page_mlw_quiz_results .result-page-wrapper .pagination-links .next-page{ + border-left: 1px solid #b3aeae; +} +.qsm_page_mlw_quiz_results .result-page-wrapper .pagination-links .prev-page{ + border-right: 1px solid #b3aeae; +} +.qsm_page_mlw_quiz_results .tablenav-pages .paging-input { + display: inline-flex; + align-items: center; +} + +.qsm_page_mlw_quiz_results .tablenav-pages .total-pages { + margin-left: 5px; + font-size: 0.9em; + color: #666; +} +.qsm_page_mlw_quiz_results .tablenav .tablenav-pages .button{ + padding: 0; + line-height: 28px; +} +.qsm_page_mlw_quiz_results .result-page-wrapper .pagination-links a.button:hover, +.qsm_page_mlw_quiz_results .result-page-wrapper .pagination-links a.button:focus, +.qsm_page_mlw_quiz_results .result-page-wrapper .pagination-links a.button:active { + background: none; + box-shadow: none; + color: inherit; +} +.qsm_page_mlw_quiz_results .result-page-wrapper .tablenav-pages .pagination-links .disable{ + background-color: #f0f0f1; +} +.qsm_page_mlw_quiz_results .result-page-wrapper .pagination-links .prev-page.disable:hover, +.qsm_page_mlw_quiz_results .result-page-wrapper .pagination-links .next-page.disable:hover{ + background-color: #f0f0f1; +} +.qsm_page_qsm_quiz_about .about-wrap{ + margin: 10px 0 0; +} +.qsm_page_qsm_quiz_about .about-wrap .wp-person .gravatar{ + border-radius: 30px; +} +.qsm_page_qsm_quiz_about .qsm-about-heading h1{ + font-size: 18px; + display: inline-block; + position: absolute; + font-weight: 400; + line-height: 28px; + top: 37px; +} +.qsm_page_qsm_quiz_about .about-wrap h2{ + font-size: 18px; + font-weight: 600; + line-height: 28px; + text-align: left; +} +.qsm_page_qsm_quiz_about .about-wrap div h2{ + margin: 50px 0 30px; +} +.qsm_page_qsm_quiz_about .about-wrap .wp-person .web{ + color: #000; + line-height: 3.5; +} +.qsm_page_qsm_quiz_about .about-wrap .wp-person{ + width: 250px; +} +.qsm_page_qsm_quiz_about .help-slide{ + display: flex; + margin: 10px; + flex-wrap: wrap; +} +.qsm_page_qsm_quiz_about .help-slide div{ + width: 400px; + height: 250px; + border: 1px solid #E6E6E6; + margin: 20px; + flex-direction: column; + display: flex; + padding: 20px; + justify-content: center; +} + +.qsm_page_qsm_quiz_about .help-slide div img{ + width: 44px; + height: 44px; + padding: 5.5px 3.67px 2.75px 3.67px; +} +.qsm_page_qsm_quiz_about .help-slide div a{ + border: 2px solid #000; + padding: 5px 10px; + border-radius: 3px; + width: fit-content; + text-decoration: none; + font-size: 14px; + font-weight: 600; + color: #000; + margin-top: 10px; +} +.qsm_page_qsm_quiz_about .qsm-system-info-page{ + margin-right: 0; + margin-top: 0; +} +.qsm_page_qsm_quiz_about .qsm-system-info-page .hide-if-no-js{ + display: none; +} +.qsm-popup #theme-color-settings-content select, +.qsm-popup #theme-color-settings-content input { + border-radius: 5px; + border-color: #ccc; + padding-top: 2px; + padding-bottom: 2px; } \ No newline at end of file diff --git a/js/qsm-admin.js b/js/qsm-admin.js index 277e3378e..fd244c93d 100644 --- a/js/qsm-admin.js +++ b/js/qsm-admin.js @@ -229,6 +229,9 @@ var QSMAdmin; jQuery('.load-quiz-wizard').click(function (e) { e.preventDefault(); MicroModal.show('model-wizard'); + if ( jQuery(this).attr('data-formType') == 1 ) { + jQuery(document).find('.qsm-popup input[name="form_type"][value="1"]').prop('checked', true).change(); + } var height = jQuery(".qsm-wizard-template-section").css("height"); jQuery(".qsm-wizard-setting-section").css("height", height); if (jQuery("#accordion").length > 0) { @@ -788,6 +791,15 @@ jQuery('.quiz_text_tab').click(function (e) { jQuery('#' + current_id).show(); jQuery(document).trigger('qsm_quiz_text_tab_after', [current_id]); }); +jQuery('.qsm-upgrade-tab').click(function (e) { + e.preventDefault(); + let current_id = jQuery(this).attr('data-id'); + jQuery('.qsm-upgrade-tab').removeClass('current'); + jQuery(this).addClass('current'); + jQuery('.qsm-upgrade-tab-content').hide(); + jQuery('#' + current_id).show(); + jQuery(document).trigger('qsm_upgrade_tab_after', [current_id]); +}); if (jQuery('body').hasClass('admin_page_mlw_quiz_options')) { var current_id = jQuery(this).attr('data-id'); if(current_id == 'qsm_general_text'){ jQuery(".current_general")[0].click();} if(current_id == 'qsm_variable_text'){ jQuery(".current_variable")[0].click();} if (window.location.href.indexOf('tab=style') > 0) { @@ -804,7 +816,10 @@ if(current_id == 'qsm_variable_text'){ jQuery(".current_variable")[0].click();} jQuery(document).on('input', '.quiz_featured_image', function () { jQuery('.qsm_featured_image_preview').attr('src', jQuery(this).val()); }); - + jQuery(document).on('click', '.qsm-theme-featured-image-change', function (e) { + e.preventDefault(); + jQuery('.qsm-theme-featured-image-update').toggle(); + }); jQuery(document).on('click', '.filter-links a', function () { let current_id = jQuery(this).attr('data-id'); jQuery(this).parents('.filter-links').find('li a').each(function () { @@ -843,6 +858,11 @@ if(current_id == 'qsm_variable_text'){ jQuery(".current_variable")[0].click();} //QSM - Quizzes/Surveys Page (function ($) { + $('#qsm-upgrade-popup-opener').on( 'click', function (event) { + event.preventDefault(); + let modalName = $(this).data('popup'); + MicroModal.show( modalName ); + }); if (jQuery('body').hasClass('post-type-qsm_quiz')) { $('#new_quiz_button_two').on('click', function (event) { @@ -1176,7 +1196,7 @@ function qsm_is_substring_in_array( text, array ) { //Add stylesheet editor.settings.extended_valid_elements = 'qsmvariabletag'; editor.settings.custom_elements = '~qsmvariabletag'; - editor.settings.content_style = 'qsmvariabletag { color: #ffffff; background: #187FFA; padding: 5px 8px; border-radius: 2px;font-family: Arial, Helvetica, sans-serif;font-size: 12px; font-weight: 600; }'; + editor.settings.content_style = 'qsmvariabletag { color: #1E1E1E; background: #DCEDFA; margin: 0 3px; padding: 5px 8px; font-family: Arial, Helvetica, sans-serif;font-size: 12px;border-top: 1px solid #fff; line-height: 2.3; } qsmvariabletag:hover{ border: 1px solid #2271B1; background-color: #fff; box-shadow: 0px 4px 4px 0px #00000033; }'; editor.addButton('qsm_slash_command', { text: '/ ' +qsm_admin_messages.variables, tooltip: qsm_admin_messages.insert_variable, @@ -1227,6 +1247,29 @@ function qsm_is_substring_in_array( text, array ) { qsm_search = ''; } + // Create a container div for the input and label + let inputContainer = document.createElement('div'); + inputContainer.className = 'qsm-autocomplete-input-container'; // Add a class for styling if needed + + // Create a label element + let inputLabel = document.createElement('label'); + inputLabel.for = 'searchInput'; + inputLabel.textContent = 'Search:'; + + // Create the input element + let searchInput = document.createElement('input'); + searchInput.type = 'text'; + searchInput.id = 'searchInput'; // Link this id with the label + searchInput.placeholder = 'Type to search...'; + searchInput.className = 'qsm-autocomplete-search-input'; // Add a class for styling if needed + + // Append the label and input to the container + inputContainer.appendChild(inputLabel); + inputContainer.appendChild(searchInput); + + // Append the container to the autocomplete div + autocomplete.appendChild(inputContainer); + if ( 0 < newCommand.length ) { let var_group = []; newCommand.forEach(function (command, key) { @@ -1246,7 +1289,8 @@ function qsm_is_substring_in_array( text, array ) { } item.classList.add('qsm-autocomplete-item'); item.setAttribute('title', command.description); - item.innerHTML = "/" + command.name + "" + command.description + ""; + item.setAttribute('variable', command.name); + item.innerHTML = "%" + command.name + "%" + command.description + ""; item.onclick = function() { for (let i = 0; i <= qsm_search.length; i++) { editor.execCommand('Delete'); @@ -1384,6 +1428,35 @@ function qsm_is_substring_in_array( text, array ) { editor.selection.setContent(contentToInsert); showAutocomplete(editor, true); }); + + $(document).off('input', '.qsm-autocomplete-search-input').on('input', '.qsm-autocomplete-search-input', function () { + let query = $(this).val().toLowerCase(); // Get the current input value and convert to lowercase + let hasResults = false; + + $('.qsm-autocomplete-item').each(function () { + let title = $(this).attr('variable').toLowerCase(); // Get the title attribute of the current item + if (title.includes(query)) { + $(this).show(); // Show items that match the query + hasResults = true; // At least one item matches + } else { + $(this).hide(); // Hide items that don't match + } + }); + + // Check for the "no items" message + let noItemElement = $(this).parents('.qsm-autocomplete').find('.qsm-autocomplete-no-item'); + + if (hasResults) { + noItemElement.remove(); // Remove the "no items" message if results are found + $(this).parents('.qsm-autocomplete').find('.qsm-autocomplete-item-group').show(); + } else if (noItemElement.length === 0) { // Append only if it doesn't already exist + let item_group = document.createElement('div'); + item_group.className = 'qsm-autocomplete-no-item'; + item_group.textContent = qsm_admin_messages.no_variables; + $(this).parents('.qsm-autocomplete').append(item_group); + $(this).parents('.qsm-autocomplete').find('.qsm-autocomplete-item-group').hide(); + } + }); }); } } @@ -1764,7 +1837,7 @@ var QSMContact; }, addCondition: function ($email, category, extra_condition, criteria, operator, value) { var template = wp.template('email-condition'); - $email.find('.email-when-conditions').append(template({ + $email.find('.qsm-email-when-conditions').append(template({ 'category': category, 'extra_condition': extra_condition, 'criteria': criteria, @@ -1792,6 +1865,11 @@ var QSMContact; newCondition: function ($email) { QSMAdminEmails.addCondition($email, 'quiz', '', 'score', 'equal', 0); }, + updateEmailConditonCount: function ( $parent ) { + $parent.find('.email-condition').each(function (index) { + jQuery(this).find('.qsm-condition-collection-count').text(index + 1); + }); + }, addEmail: function (conditions, to, subject, content, replyTo, default_mark = false) { QSMAdminEmails.total += 1; var template = wp.template('email'); @@ -1877,6 +1955,7 @@ var QSMContact; event.preventDefault(); $page = $(this).closest('.qsm-email'); QSMAdminEmails.newCondition($page); + QSMAdminEmails.updateEmailConditonCount($(this).parents('.qsm-email-when')); }); $('#qsm_emails').on('click', '.qsm-delete-email-button', function (event) { event.preventDefault(); @@ -1887,7 +1966,9 @@ var QSMContact; }); $('#qsm_emails').on('click', '.delete-condition-button', function (event) { event.preventDefault(); + let $parent = $(this).parents('.qsm-email-when'); $(this).closest('.email-condition').remove(); + QSMAdminEmails.updateEmailConditonCount($parent); }); }); } @@ -1899,6 +1980,8 @@ var QSMContact; */ var QSMQuestion; var import_button; +var qsm_link_button; +var QSM_Quiz_Broadcast_Channel; (function ($) { if (jQuery('body').hasClass('admin_page_mlw_quiz_options')) { if (window.location.href.indexOf('&tab') == -1 || window.location.href.indexOf('tab=questions') > 0) { @@ -1906,6 +1989,142 @@ var import_button; $.QSMSanitize = function (input) { return input.replace(/<(|\/|[^>\/bi]|\/[^>bi]|[^\/>][^>]+|\/[^>][^>]+)>/g, ''); }; + QSM_Quiz_Broadcast_Channel = { + channel: new BroadcastChannel('qsm_quiz_data_channel'), + questionData: [], // Initialize as an array + + // Initialize the event listeners and set up channel + init: function () { + this.setupChannelListener(); + }, + + // Listen for messages on the channel + setupChannelListener: function () { + this.channel.onmessage = (event) => { + const receivedData = event.data; + const { requestType, ...questions } = receivedData; + if (requestType == 'update') { + this.updateQuestionData(questions); + } else if (requestType == 'unlink') { + this.afterUpdateUnlinkedQuestion(questions); + } + }; + }, + + insertQuestionToChannel: function (question) { + let linkQuizzesArray = Object.values(question.get('link_quizzes')); + + let sendDataObject = { + [question.id]: { + merged_question: question.get('merged_question'), + link_quizzes: linkQuizzesArray + } + }; + this.questionData.push(sendDataObject); + }, + + // Function to send the linked question data to other tabs + sendQuestionData: function (questionID, mergedQuestion, linkedQuizzes = []) { + let sendDataObject = { + [questionID]: { + merged_question: mergedQuestion, + link_quizzes: linkedQuizzes + }, + requestType: 'update' + }; + // update channel with new question + this.questionData.push(sendDataObject); + this.channel.postMessage(sendDataObject); + }, + + updateQuestionData: function (data){ + const receivedData = data; + for (let questonId in receivedData) { + const mergedQuestions = receivedData[questonId].merged_question; + const receivedQuizzes = receivedData[questonId].link_quizzes; + if (mergedQuestions && typeof mergedQuestions == 'string') { + // Check if there's a colon and extract the part after it + let idsArray = []; + if (mergedQuestions && mergedQuestions != '') { + idsArray = mergedQuestions.split(',').map(id => id.trim()); + } + if (idsArray.length > 0) { + // Loop through each ID in idsArray + idsArray.forEach(eachId => { + // Loop through this.questionData to find matches + let currentquestionData = this.questionData; + currentquestionData.forEach((item, index) => { + // Check if the current item's key matches the current eachId + if (item[eachId]) { + let quizNamesToCheck = this.questionData[index][eachId].link_quizzes; + receivedQuizzes.forEach(quizName => { + if (!quizNamesToCheck.includes(quizName)) { + quizNamesToCheck.push(quizName); // Add the quiz name to the array + } + }); + quizNamesToCheck = quizNamesToCheck.filter(function(quizName) { + return quizName !== jQuery(document).find('#edit_quiz_name').val(); + }); + // Update channel data + this.questionData[index][eachId].link_quizzes = quizNamesToCheck; + this.questionData[index][eachId].merged_question = mergedQuestions; + // Update current quiz question data + let currentInQuizQuestion = QSMQuestion.questions.get(eachId); + currentInQuizQuestion.set('merged_question', mergedQuestions); + currentInQuizQuestion.set('link_quizzes', quizNamesToCheck); + } + }); + }); + } + } + } + // Console log updated questionData + console.log("Updated quiz data:", this.questionData); + }, + + unlinkQuestionData: function (model, currentQuestionId) { + let mergedQuestionIdString = model.get('merged_question'); + let mergedQuestionIdArray = mergedQuestionIdString ? mergedQuestionIdString.split(',') : []; + // Filter out the questionId + let removedDeletedQuestionArray = mergedQuestionIdArray.filter(id => id !== String(currentQuestionId)); + // Create a new string from the filtered array + let removedDeletedQuestionString = removedDeletedQuestionArray.join(','); + // console.log(mergedQuestionIdString, mergedQuestionIdArray, removedDeletedQuestionArray, removedDeletedQuestionString); + let sendDataObject = { + [currentQuestionId]: { + merged_question: removedDeletedQuestionString, + link_quizzes: jQuery(document).find('#edit_quiz_name').val(), + }, + requestType: 'unlink' + }; + this.channel.postMessage(sendDataObject); + model.set('merged_question', ''); + model.set('link_quizzes', []); + }, + + afterUpdateUnlinkedQuestion: function (data) { + const receivedData = data; + for (let questonId in receivedData) { + const mergedQuestions = receivedData[questonId].merged_question; + const singleQuizName = receivedData[questonId].link_quizzes; + this.questionData.forEach((item) => { + Object.keys(item).forEach(key => { + if (item[key] && item[key].merged_question && item[key].link_quizzes) { + if (mergedQuestions.split(',').includes(key)) { + item[key].merged_question = mergedQuestions; + item[key].link_quizzes = item[key].link_quizzes.filter(quiz => quiz != singleQuizName); + // Update current quiz question data + let currentInQuizQuestion = QSMQuestion.questions.get(key); + currentInQuizQuestion.set('merged_question', mergedQuestions); + currentInQuizQuestion.set('link_quizzes', item[key].link_quizzes.filter(quiz => quiz != singleQuizName)); + } + } + }); + }); + } + }, + }; + QSMQuestion = { question: Backbone.Model.extend({ defaults: { @@ -2028,6 +2247,26 @@ var import_button; } if ( 1 > questions.length ) { $('#question-bank').append('
' + qsm_admin_messages.questions_not_found + '
'); + } else { + $('.question-bank-question').each(function () { + let questionId = $(this).data('question-id'); + if (QSMQuestion.questions.some(q => q.get('id') == questionId)) { + let $linkButton = $(this).find('.link-question'); + if ($linkButton.length) { + $linkButton.prop('disabled', true).addClass('disabled'); + } + } + QSMQuestion.questions.each(function (question) { + let merged_questions = question.get('merged_question'); + let questionsArray = merged_questions ? merged_questions.split(',').map(q => q.trim()) : []; + questionsArray.forEach(function (id) { + let parentElement = $('.question-bank-question[data-question-id="' + id + '"]'); + if (parentElement.length) { + parentElement.remove(); // Remove the element if it exists + } + }); + }); + }); } }, addQuestionToQuestionBank: function (question) { @@ -2041,19 +2280,22 @@ var import_button; type: question.type, question: questionText, category: question.category, - quiz_name: question.quiz_name + quiz_name: question.quiz_name, + linked_question: question.linked_question.join(',') })); }, - addQuestionFromQuestionBank: function (questionID) { + addQuestionFromQuestionBank: function (questionID, is_linking = 0) { QSMAdmin.displayAlert(qsm_admin_messages.adding_question, 'info'); + let isLinkingData = is_linking == 1 ? questionID : 0; var model = new QSMQuestion.question({ - id: questionID + id: questionID, + is_linking: isLinkingData }); model.fetch({ headers: { 'X-WP-Nonce': qsmQuestionSettings.nonce }, - url: wpApiSettings.root + 'quiz-survey-master/v1/questions/' + questionID, + url: wpApiSettings.root + 'quiz-survey-master/v1/questions/' + questionID + '?is_linking=' + isLinkingData, success: QSMQuestion.questionBankSuccess, error: QSMAdmin.displayError }); @@ -2120,6 +2362,7 @@ var import_button; question = QSMQuestion.questions.get(qsmQuestionSettings.pages[i][j]); if ('undefined' !== typeof question) { QSMQuestion.addQuestionToPage(question); + QSM_Quiz_Broadcast_Channel.insertQuestionToChannel(question); } } } @@ -2236,6 +2479,26 @@ var import_button; addNewQuestionFromQuestionBank: function (model) { var page = parseInt($('#add-question-bank-page').val(), 10); model.set('page', page); + if (qsm_link_button && !model.get('merged_question').split(',').includes(model.id)) { + // Retrieve the current value + let mergedQuestion = model.get('merged_question'); + // Update the merged question by adding the new ID + mergedQuestion += `,${model.id}`; + // Set the updated value back to the model + model.set('merged_question', mergedQuestion); + + let quizId = model.get('quizID'); + let quizName = ''; + + for (const record of qsm_admin_messages.qsmQuizzesObject) { + if (record.quiz_id == quizId) { quizName = record.quiz_name; break; } + } + const linkQuizzes = [...model.get('link_quizzes')]; // Created a shallow copy of the array + if (quizName !== '') { + linkQuizzes.push(quizName); + } + QSM_Quiz_Broadcast_Channel.sendQuestionData(model.id, model.get('merged_question'), linkQuizzes); + } QSMQuestion.questions.add(model); QSMQuestion.addQuestionToPage(model); QSMQuestion.savePages(); @@ -2245,10 +2508,17 @@ var import_button; if(import_button){ import_button.html(qsm_admin_messages.add_question); } + if(qsm_link_button) { + qsm_link_button.html(qsm_admin_messages.link_question); + } if(import_button){ import_button.attr("onclick", "return confirm('" + qsm_admin_messages.confirm_message + " " + qsm_admin_messages.import_question_again + "');"); } QSMQuestion.openEditPopup(model.id, $('.question[data-question-id=' + model.id + ']').find('.edit-question-button')); + if(qsm_link_button == ''){ + $(document).find('.qsm-linked-list-inside').hide().empty(); + $(document).find('.qsm-linked-list-div-block').hide(); + } // $('#save-popup-button').trigger('click'); }, addNewQuestion: function (model) { @@ -2316,6 +2586,8 @@ var import_button; var model = QSMQuestion.questions.get(questionID); var newModel = _.clone(model.attributes); newModel.id = null; + newModel.merged_question = ''; + newModel.link_quizzes = ''; QSMQuestion.questions.create( newModel, { headers: { @@ -2346,6 +2618,7 @@ var import_button; var type = $("#question_type").val(); var comments = $("#comments").val(); let required = $(".questionElements input[name='required']").is(":checked") ? 0 : 1; + let isPublished = $(".questionElements input[name='question_status']").is(":checked") ? 1 : 0; advanced_option['required'] = required; var category = $(".category-radio:checked").val(); var type_arr = []; @@ -2434,6 +2707,7 @@ var import_button; }); model.set('answers', answers); model.set('required', required); + model.set('is_published', isPublished); jQuery(document).trigger('qsm_save_question_before', [questionID, CurrentElement, model, advanced_option]); $('.questionElements .advanced-content > .qsm-row:not(.core-option)').each(function () { if ($(this).find('input[type="text"]').length > 0) { @@ -2748,6 +3022,9 @@ var import_button; } //Append extra settings var all_setting = question.get('settings'); + if ((typeof all_setting === 'undefined') || (all_setting && typeof all_setting.isPublished === 'undefined')) { + $('#qsm-question-status').prop('checked', true).trigger('change'); + } if (all_setting === null || typeof all_setting === "undefined") { } else { $.each(all_setting, function (index, value) { if ($('#' + index + '_area').length > 0) { @@ -2765,6 +3042,13 @@ var import_button; if (index == 'matchAnswer') { $('#match-answer').val(value); } + if (index == 'isPublished') { + if ( all_setting.isPublished == 1 ) { + $('#qsm-question-status').prop('checked', true).trigger('change'); + } else { + $('#qsm-question-status').prop('checked', false).trigger('change'); + } + } }); jQuery(document).trigger('qsm_all_question_setting_after', [all_setting]); } @@ -2784,6 +3068,31 @@ var import_button; $('#image_size_area').show(); } + let link_quizzes_object = question.get('link_quizzes'); + + $('.qsm-linked-list-inside').hide().empty(); + $('.qsm-linked-list-div-block').hide(); + if (typeof link_quizzes_object == 'object' && link_quizzes_object != null && Object.keys(link_quizzes_object).length > 0) { + Object.values(link_quizzes_object).forEach(function(quizName) { + // Ensure each quizName is a valid non-empty string + if (quizName && typeof quizName == 'string' && quizName.trim().length > 0) { + let link = $('') + .attr('class', 'qsm-linked-list-item') + .attr('title', quizName) + .text(quizName.length > 25 ? quizName.substring(0, 25) + '...' : quizName); + + $('.qsm-linked-list-div-block').show(); + $('.qsm-linked-list-inside').append(link); + } + }); + + // Add an "Unlink" link at the end + let unlink = $('') + .attr('class', 'qsm-unlink-the-question button button-danger') + .attr('data-question-id', questionID) + .text(qsm_admin_messages.unlink_question); + $('.qsm-linked-list-inside').append(unlink); + } jQuery(document).trigger('qsm_open_edit_popup', [questionID, CurrentElement]); }, openEditPagePopup: function (pageID) { @@ -3059,6 +3368,8 @@ var import_button; if (response.success) { checkedValues.forEach(function (questionId) { $('.question[data-question-id="' + questionId + '"]').remove(); + let model = QSMQuestion.questions.get(questionId); + QSM_Quiz_Broadcast_Channel.unlinkQuestionData(model, questionId); }); jQuery('.qsm-admin-select-page-question').prop('checked',false); QSMQuestion.countTotal(); @@ -3081,6 +3392,8 @@ var import_button; success: function (response) { if (response.success) { remove.parents('.question').remove(); + let model = QSMQuestion.questions.get(question_id); + QSM_Quiz_Broadcast_Channel.unlinkQuestionData(model, question_id); QSMQuestion.countTotal(); $('.save-page-button').trigger('click'); } else { @@ -3202,6 +3515,14 @@ var import_button; event.preventDefault(); $(this).parents('.questionElements').slideUp('slow'); }); + $(document).on('change', '#qsm-question-status', function (event) { + event.preventDefault(); + if($(this).is(':checked')){ + $(document).find('#qsm-question-status-text').html('Published'); + } else { + $(document).find('#qsm-question-status-text').html('Draft'); + } + }); $(document).on('click', '#save-popup-button', function (event) { event.preventDefault(); questionElements = $(this).parents('.questionElements'); @@ -3260,6 +3581,7 @@ var import_button; $(document).on('click', '.qsm-popup-bank .import-button', function (event) { event.preventDefault(); + qsm_link_button = ''; $(this).text(qsm_admin_messages.adding_question); import_button = $(this); $('.import-button').addClass('disable_import'); @@ -3267,9 +3589,45 @@ var import_button; MicroModal.close('modal-2'); }); + + $(document).on('click', '.qsm-popup-bank .link-question', function (event) { + event.preventDefault(); + $(this).text(qsm_admin_messages.linking_question); + qsm_link_button = $(this); + $('.link-question').addClass('disable_import'); + // 1 for the linking the questions default is 0 + QSMQuestion.addQuestionFromQuestionBank($(this).data('question-id'), 1); + MicroModal.close('modal-2'); + }); + + jQuery(document).on('click', '.qsm-linked-list-div-block .qsm-linked-list-view-button', function () { + let $this = jQuery(this); + let $inside = $this.parents('.qsm-linked-list-div-block').find('.qsm-linked-list-inside'); + $inside.toggle(); + $inside.is(':visible') ? $this.text(qsmQuestionSettings.linked_close) : $this.text(qsmQuestionSettings.linked_view); + }); + + jQuery(document).on('click', '.qsm-linked-list-div-block .qsm-unlink-the-question', function () { + var questionIdToUnlink = jQuery(this).data('question-id'); + $.ajax({ + url: ajaxurl, + method: 'POST', + data: { + action: 'qsm_unlink_question_from_list', + question_id: jQuery(this).data('question-id'), + nonce: qsmQuestionSettings.unlinkNonce + }, + success: function (response) { + $(document).find('.qsm-linked-list-div-block').remove(); + let model = QSMQuestion.questions.get(questionIdToUnlink); + QSM_Quiz_Broadcast_Channel.unlinkQuestionData(model, questionIdToUnlink); + } + }); + }); //Click on selected question button. $('.qsm-popup-bank').on('click', '#qsm-import-selected-question', function (event) { var $total_selction = $('#question-bank').find('[name="qsm-question-checkbox[]"]:checked').length; + qsm_link_button = ''; if ($total_selction === 0) { alert(qsm_admin_messages.no_question_selected); } else { @@ -3413,6 +3771,9 @@ var import_button; if (qsmQuestionSettings.qsm_user_ve === 'true') { QSMQuestion.prepareEditor(); } + + // Initialize the QSM_Quiz_Broadcast_Channel + QSM_Quiz_Broadcast_Channel.init(); QSMQuestion.loadQuestions(); /** @@ -3795,6 +4156,7 @@ var import_button; $('#results-pages').find('.qsm-spinner-loader').remove(); pages.forEach(function (page, i, pages) { QSMAdminResults.addResultsPage(page.conditions, page.page, page.redirect, page.default_mark, page); + QSMAdminResults.updateResultConditonCount(jQuery('.results-page-when').eq(i)); }); QSMAdmin.clearAlerts(); }) @@ -3830,6 +4192,11 @@ var import_button; newCondition: function ($page) { QSMAdminResults.addCondition($page, 'quiz', '', 'score', 'equal', 0); }, + updateResultConditonCount: function ( $parent ) { + $parent.find('.results-page-condition').each(function (index) { + jQuery(this).find('.qsm-condition-collection-count').text(index + 1); + }); + }, addResultsPage: function (conditions, page, redirect, default_mark = false, singlePage = {}) { const parser = new DOMParser(); let parseRedirect = parser.parseFromString(redirect, 'text/html'); @@ -3860,6 +4227,9 @@ var import_button; jQuery(document).trigger('qsm_tinyMCE_settings_after', [settings]); wp.editor.initialize('results-page-' + QSMAdminResults.total, settings); jQuery(document).trigger('qsm_after_add_result_block', [conditions, page, redirect, QSMAdminResults.total, singlePage]); + const $resultsPage = jQuery(`#results-page-${QSMAdminResults.total}`).closest('.results-page-show'); + const $slashCommandButton = $resultsPage.find('.qsm-slashcommand-variables-button'); + $resultsPage.find('.wp-media-buttons .insert-media').after($slashCommandButton); }, newResultsPage: function () { var conditions = [{ @@ -3879,6 +4249,7 @@ var import_button; $('.add-new-page').on('click', function (event) { event.preventDefault(); QSMAdminResults.newResultsPage(); + QSMAdminResults.updateResultConditonCount(jQuery('.results-page-when').last()); }); jQuery(document).on('click', '.qsm-duplicate-result-page-button', function () { let result_page = jQuery(this).closest("header").next("main"); @@ -3896,6 +4267,7 @@ var import_button; }); QSMAdminResults.addResultsPage(conditions, page, redirect_value); jQuery('html, body').animate({ scrollTop: jQuery('.results-page:last-child').offset().top - 150 }, 1000); + QSMAdminResults.updateResultConditonCount(jQuery('.results-page-when').last()); }); $('.save-pages').on('click', function (event) { event.preventDefault(); @@ -3905,6 +4277,7 @@ var import_button; event.preventDefault(); $page = $(this).closest('.results-page'); QSMAdminResults.newCondition($page); + QSMAdminResults.updateResultConditonCount($(this).parents('.results-page-when')); }); $('#results-pages').on('click', '.qsm-delete-result-button', function (event) { event.preventDefault(); @@ -3912,12 +4285,25 @@ var import_button; }); $('#results-pages').on('click', '.delete-condition-button', function (event) { event.preventDefault(); + let $parent = $(this).parents('.results-page-when'); + console.log($parent); $(this).closest('.results-page-condition').remove(); + QSMAdminResults.updateResultConditonCount($parent); }); jQuery(document).on('click', '.qsm-toggle-result-page-button', function () { jQuery(this).closest("header").next("main").slideToggle(); jQuery(this).find('.dashicons-arrow-up-alt2, .dashicons-arrow-down-alt2').toggleClass('dashicons-arrow-up-alt2 dashicons-arrow-down-alt2'); }); + jQuery(document).on('click', '.qsm-settings-box-result-button', function () { + jQuery('.qsm-settings-box-details').not(jQuery(this).parents('.qsm-template-btn-group').find('.qsm-settings-box-details')).hide(); + jQuery(this).parents('.qsm-template-btn-group').find('.qsm-settings-box-details').toggle(); + }); + jQuery(document).on('click', function (e) { + // Check if the click was outside .qsm-template-btn-group + if (!jQuery(e.target).closest('.qsm-template-btn-group').length) { + jQuery('.qsm-settings-box-details').hide(); + } + }); }); } } @@ -4177,4 +4563,30 @@ var import_button; event.stopPropagation(); }); }); -}(jQuery)); \ No newline at end of file +}(jQuery)); + +jQuery(document).ready(function() { + const bulkActionSelect = jQuery('#qsm_bulk_action_select'); + const applyBulkActionButton = jQuery('#qsm_apply_bulk_action'); + + applyBulkActionButton.on('click', function() { + const action = bulkActionSelect.val(); + + // Handle bulk delete action + if (action === 'bulk_delete') { + if (confirm(qsm_result_page.delete_confirm)) { + jQuery('form[name="bulk_delete_form"]').submit(); + } + } + // Handle permanent delete action + else if (action === 'bulk_permanent_delete') { + if (confirm(qsm_result_page.delete_confirm)) { + jQuery('#bulk_permanent_delete').val('1'); + jQuery('form[name="bulk_delete_form"]').submit(); + } + } + else { + alert(qsm_result_page.delete_alert); + } + }); +}); diff --git a/js/qsm-quiz.js b/js/qsm-quiz.js index 735aa5090..eea3325f7 100644 --- a/js/qsm-quiz.js +++ b/js/qsm-quiz.js @@ -52,6 +52,8 @@ var qsmTimerInterval = []; if (quiz.hasOwnProperty('timer_limit') && 0 != quiz.timer_limit) { QSM.initTimer(quizID); quizType = 'timer'; + } else if (jQuery('.qsm-quiz-container-' + quizID + ' #timer').val() == 0) { + qsmTimerInterval[quizID] = setInterval(function () { qmnTimeTakenTimer(quizID) }, 1000); } if (jQuery('.qsm-quiz-container-' + quizID + ' .qsm-submit-btn').is(':visible') && !jQuery('.qsm-quiz-container-' + quizID).hasClass('qsm_auto_pagination_enabled') ) { jQuery('.qsm-quiz-container-' + quizID + ' .qsm-quiz-comment-section').fadeIn(); @@ -168,13 +170,12 @@ var qsmTimerInterval = []; } var secondsRemaining = qmn_quiz_data[quizID].timerRemaning; var secondsConsumed = qmn_quiz_data[quizID].timerConsumed; - jQuery(document).trigger('qmn_timer_consumed_seconds', [quizID, qmn_quiz_data, qsm_timer_consumed_obj]); if (localStorage.getItem('mlw_time_quiz' + quizID) != null ) { secondsRemaining = (parseFloat(qmn_quiz_data[quizID].timer_limit) * 60) - secondsConsumed + 1; if(qsm_timer_consumed_obj.qmn_count_upward_status){ - secondsConsumed = qmn_quiz_data[quizID].timerConsumed - 1; - secondsRemaining = (parseFloat(qmn_quiz_data[quizID].timer_limit) * 60) - secondsConsumed; - } + secondsConsumed = qmn_quiz_data[quizID].timerConsumed - 1; + secondsRemaining = (parseFloat(qmn_quiz_data[quizID].timer_limit) * 60) - secondsConsumed; + } if(secondsRemaining < 0) { secondsRemaining = 0; } diff --git a/mlw_quizmaster2.php b/mlw_quizmaster2.php index 57364677d..d164893e5 100644 --- a/mlw_quizmaster2.php +++ b/mlw_quizmaster2.php @@ -2,7 +2,7 @@ /** * Plugin Name: Quiz And Survey Master * Description: Easily and quickly add quizzes and surveys to your website. - * Version: 9.2.2 + * Version: 9.3.0 * Author: ExpressTech * Author URI: https://quizandsurveymaster.com/ * Plugin URI: https://expresstech.io/ @@ -43,7 +43,7 @@ class MLWQuizMasterNext { * @var string * @since 4.0.0 */ - public $version = '9.2.2'; + public $version = '9.3.0'; /** * QSM Alert Manager Object @@ -390,7 +390,7 @@ public function qsm_load_textdomain() { * @since 7.3.5 admin scripts consolidated */ public function qsm_admin_scripts_style( $hook ) { - global $mlwQuizMasterNext; + global $mlwQuizMasterNext, $wpdb; // admin styles wp_enqueue_style( 'qsm_admin_style', plugins_url( 'css/qsm-admin.css', __FILE__ ), array(), $this->version ); @@ -484,6 +484,7 @@ public function qsm_admin_scripts_style( $hook ) { wp_enqueue_script( 'micromodal_script', plugins_url( 'js/micromodal.min.js', __FILE__ ), array( 'jquery', 'qsm_admin_js' ), $this->version, true ); $qsm_variables = function_exists( 'qsm_text_template_variable_list' ) ? qsm_text_template_variable_list() : array(); $qsm_variables_name = array(); + $qsm_quizzes = $wpdb->get_results("SELECT quiz_id, quiz_name FROM {$wpdb->prefix}mlw_quizzes"); foreach ( $qsm_variables as $key => $value ) { // Iterate over each key of the nested object if ( is_array( $value ) && ! empty($value) ) { @@ -528,7 +529,11 @@ public function qsm_admin_scripts_style( $hook ) { 'question_created' => __('Question created!', 'quiz-master-next'), 'new_question' => __('Your new question!', 'quiz-master-next'), 'creating_question' => __('Creating question...', 'quiz-master-next'), + 'unlink_question' => __('Unlink', 'quiz-master-next'), 'duplicating_question' => __('Duplicating question...', 'quiz-master-next'), + 'linking_question' => __('Linking...', 'quiz-master-next'), + 'link_question' => __('Link', 'quiz-master-next'), + 'creating_question' => __('Creating question...', 'quiz-master-next'), 'saving_question' => __('Saving question...', 'quiz-master-next'), 'question_saved' => __('Question was saved!', 'quiz-master-next'), 'load_more_quetions' => __('Load more questions', 'quiz-master-next'), @@ -578,6 +583,7 @@ public function qsm_admin_scripts_style( $hook ) { 'insert_variable' => __("Insert QSM variables", 'quiz-master-next'), 'select_all' => __("Select All", 'quiz-master-next'), 'select' => __("Select", 'quiz-master-next'), + 'qsmQuizzesObject' => $qsm_quizzes, ); $qsm_admin_messages = apply_filters( 'qsm_admin_messages_after', $qsm_admin_messages ); wp_localize_script( 'qsm_admin_js', 'qsm_admin_messages', $qsm_admin_messages ); diff --git a/php/admin/about-page.php b/php/admin/about-page.php index 60fd79854..edc8ad174 100644 --- a/php/admin/about-page.php +++ b/php/admin/about-page.php @@ -18,6 +18,7 @@ function qsm_generate_about_page() { global $mlwQuizMasterNext; $version = $mlwQuizMasterNext->version; + wp_enqueue_style( 'qsm_result_page_style', plugins_url( '../css/qsm-admin.css', __FILE__ ), array(), $mlwQuizMasterNext->version ); if ( ! current_user_can( 'delete_others_qsm_quizzes' ) ) { return; } @@ -30,6 +31,10 @@ function qsm_generate_about_page() { 'slug' => 'help', 'title' => 'Help', ], + [ + 'slug' => 'system_info', + 'title' => 'System Info', + ], ]; $active_tab = isset($_GET['tab']) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : 'about'; @@ -37,23 +42,19 @@ function qsm_generate_about_page() { add_meta_box( 'wpss_mrts', __( 'Need Help?', 'quiz-master-next' ), 'qsm_documentation_meta_box_content', 'meta_box_help' ); add_meta_box( 'wpss_mrts', __( 'System Info', 'quiz-master-next' ), 'qsm_system_meta_box_content', 'meta_box_sys_info' ); ?> +
+ +

+
+
-

-
-

-

-
- - + +
+
- -
- -
+
+

+

+

GitHub Contributors

" rel="noopener" target="_blank" class="button-primary">View GitHub Repo
+ } elseif ( 'system_info' === $active_tab ) { ?> +
+
+ +
+
version ); ?> -

- +
+
+ +

+

+ +
+
+ +

+

+ +
+
+ +

+

+ +
+

-
- Welcome Logo -

version ); ?>

-
- + + +
-

-

-
-
-

- -
-

- or, -

+
+ Welcome Logo +

version ) ); ?>

+
+
+

+

+
+
+ +
+ +
+
+
+ Create Quiz +
+
+

+

+
+
- +
+
+
+ Create Survey +
+
+

+

+
+
-
-

- +
+
+
+
+ Addons and Themes +
+
+

+

+ + + + + +

+
+ +
-
version ); + wp_enqueue_script( 'qsm_result_page_script', plugins_url( 'js/qsm-admin.js', __FILE__ ), array( 'jquery'), $mlwQuizMasterNext->version ); + wp_localize_script( 'qsm_result_page_script', 'qsm_result_page', array( + 'delete_confirm' => esc_html__( 'Are you sure you want to delete?', 'quiz-master-next' ), + 'delete_alert' => esc_html__( 'Please select a valid bulk action.', 'quiz-master-next' ), + )); // If nonce is correct, delete results. if ( isset( $_POST['delete_results_nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['delete_results_nonce'] ) ), 'delete_results' ) ) { @@ -206,21 +211,19 @@ function qsm_results_overview_tab_content() { ?>
- Bulk Delete    - Bulk Permanent Delete + +
- - - ">< - of $table_limit ) { - ?> - ">> - $table_limit ) { - ?> - of - ">> - - "><< /a> - of - ">> - < + + -   + of + + $table_limit ) { ?> + ">> + + > +
@@ -276,9 +278,7 @@ function qsm_results_overview_tab_content() { $qmn_order_by = ( isset( $_GET['qmn_order_by'] ) && ! empty( $_GET['qmn_order_by'] ) ) ? sanitize_text_field( wp_unslash( $_GET['qmn_order_by'] ) ) : 'default'; ?> - -
+
"> - + $v ) { @@ -523,7 +525,9 @@ function qsm_results_overview_tab_content() { for ( $x = 0; $x < $co; $x++ ) { ?> - + + + quiz_name ); ?>
@@ -640,8 +644,8 @@ function qsm_results_overview_tab_content() { function qsm_export_results_tabs_content() { $args = array( "id" => 'export-results', - "title" => __( 'Export Results', 'quiz-master-next' ), - "description" => __( 'As the quiz creator, you will want to export your quiz results in order to keep track of responses and provide an accurate record of who has completed the quiz. The Export Results addon provides an intuitive and flexible interface for exporting just the right results.', 'quiz-master-next' ), + "title" => __( 'Export Results Addon', 'quiz-master-next' ), + "description" => __( 'The QSM Export Results Addon enables quiz administrators to export quiz results quickly and easily. You can download results as a CSV file for further analysis in Excel or other tools, and provide respondents with a downloadable PDF copy of their results. Perfect for sharing quiz/exam data with colleagues or moderators without database access, this addon streamlines result management and analysis.', 'quiz-master-next' ), "chart_image" => plugins_url( '', dirname( __FILE__ ) ) . '/images/export_results.png', "warning" => __( 'Export Results Addon required', 'quiz-master-next' ), "information" => __( 'QSM Addon Bundle is the best way to get all our add-ons at a discount. Upgrade to save 95% today. OR you can buy Export Results Addon separately.', 'quiz-master-next' ), @@ -649,13 +653,36 @@ function qsm_export_results_tabs_content() { "doc_link" => qsm_get_plugin_link( 'docs/add-ons/export-results', 'result_page', 'export_results', 'result-exportresults-upsell_read_documentation', 'qsm_plugin_upsell' ), "upgrade_link" => qsm_get_plugin_link( 'pricing', 'result_page', 'export_results', 'result-exportresults-upsell_upgrade', 'qsm_plugin_upsell' ), "addon_link" => qsm_get_plugin_link( 'downloads/export-results', 'result_page', 'export_results', 'result-exportresults-upsell_buy_addon', 'qsm_plugin_upsell' ), + "benefits" => array( + 'briefing' => '', + 'list_items' => array( + __( 'Export quiz results to CSV for detailed analysis.', 'quiz-master-next' ), + __( 'Generate personalized PDF reports for users.', 'quiz-master-next' ), + __( 'Filter exports by quizzes, dates, or data fields.', 'quiz-master-next' ), + __( 'Save time with quick, multi-quiz exports.', 'quiz-master-next' ), + __( 'Share results easily without database access.', 'quiz-master-next' ), + __( 'Analyze responses, scores, and timestamps.', 'quiz-master-next' ), + __( 'Ideal for diverse needs like education, training, and research.', 'quiz-master-next' ), + ), + ), + "use_cases" => array( + 'briefing' => '', + 'list_items' => array( + __( 'Track student performance in educational settings.', 'quiz-master-next' ), + __( 'Measure training effectiveness for employees.', 'quiz-master-next' ), + __( 'Gather insights from consumer surveys.', 'quiz-master-next' ), + __( 'Collect feedback to improve future events.', 'quiz-master-next' ), + __( 'Evaluate candidates through recruitment quizzes.', 'quiz-master-next' ), + __( 'Analyze usability data for product improvement.', 'quiz-master-next' ), + ), + ), ); - qsm_admin_upgrade_content( $args, 'page' ); + qsm_admin_upgrade_popup( $args, 'page' ); } function qsm_reporting_analysis_tabs_content() { $args = array( "id" => 'reporting-analysis', - "title" => __( 'Reporting & Analysis', 'quiz-master-next' ), + "title" => __( 'Reporting & Analysis Addon', 'quiz-master-next' ), "description" => __( 'Transform your quiz/survey results into numbers with QSM Reporting & Analysis! Implement simple & advanced data analysis techniques to measure questions effectiveness and show the user results in the form of Pie Charts. Reporting & Analysis addon by QSM will make your life easier as a question designer by using a variety of charts and graphs and exporting the results in bulk.', 'quiz-master-next' ), "chart_image" => plugins_url( '', dirname( __FILE__ ) ) . '/images/report_analysis_chart.png', "warning" => __( 'Reporting & Analysis Addon required', 'quiz-master-next' ), @@ -665,14 +692,14 @@ function qsm_reporting_analysis_tabs_content() { "upgrade_link" => qsm_get_plugin_link( 'pricing', 'result_page', 'result_analysis', 'result-reportanalysis-upsell_upgrade', 'qsm_plugin_upsell' ), "addon_link" => qsm_get_plugin_link( 'downloads/results-analysis', 'result_page', 'result_analysis', 'result-reportanalysis-ups_buy_addon', 'qsm_plugin_upsell' ), ); - qsm_admin_upgrade_content( $args, 'page' ); + qsm_admin_upgrade_popup( $args, 'page' ); } function qsm_proctor_quiz_tabs_content() { $args = array( "id" => 'proctoring-quiz', - "title" => __( 'Quiz Proctor', 'quiz-master-next' ), - "description" => __( 'Enhance exam fairness using Quiz Proctor: Capture images, monitor tab shifts, and prevent cheating by restricting copy/paste within the quiz. Ensure focus and equity with full-screen mode.', 'quiz-master-next' ), + "title" => __( 'Quiz Proctor Addon', 'quiz-master-next' ), + "description" => __( 'The Quiz Proctor Addon is your essential tool for ensuring fairness and security in online assessments. Acting as your virtual proctor, it prevents cheating by capturing images of quiz takers, tracking tab shifts, and enabling full-screen quiz mode. With Quiz Proctor, maintain trust in your quizzes by eliminating distractions and promoting integrity in every online test you conduct.', 'quiz-master-next' ), "chart_image" => plugins_url( '', dirname( __FILE__ ) ) . '/images/proctor_quiz_chart.png', "warning" => __( 'Missing Feature - Quiz Proctor Add-on required', 'quiz-master-next' ), "information" => __( 'QSM Addon Bundle is the best way to get all our add-ons at a discount. Upgrade to save 95% today. OR you can buy Proctoring Quiz Addon separately.', 'quiz-master-next' ), @@ -680,6 +707,27 @@ function qsm_proctor_quiz_tabs_content() { "doc_link" => qsm_get_plugin_link( 'docs/add-ons/quiz-proctor', 'quiz-documentation', 'plugin', 'quiz-proctor', 'qsm_plugin_upsell' ), "upgrade_link" => qsm_get_plugin_link( 'pricing', 'quiz-documentation', 'plugin', 'quiz-proctor', 'qsm_plugin_upsell' ), "addon_link" => qsm_get_plugin_link( 'downloads/quiz-proctor', 'quiz-documentation', 'plugin', 'quiz-proctor', 'qsm_plugin_upsell' ), + "benefits" => array( + 'briefing' => '', + 'list_items' => array( + __( 'Provides feedback using violation reports.', 'quiz-master-next' ), + __( 'Ensures fair results with controlled retakes.', 'quiz-master-next' ), + __( 'Improves quiz design by analyzing violations.', 'quiz-master-next' ), + __( 'Automates monitoring to save time.', 'quiz-master-next' ), + __( 'Enhances fairness in online assessments.', 'quiz-master-next' ), + ), + ), + "use_cases" => array( + 'briefing' => '', + 'list_items' => array( + __( 'Ensures fair testing in online exams.', 'quiz-master-next' ), + __( 'Validates employee training assessments.', 'quiz-master-next' ), + __( 'Maintains credibility in certification tests.', 'quiz-master-next' ), + __( 'Supports students with violation feedback.', 'quiz-master-next' ), + __( 'Enforces honesty in compliance quizzes.', 'quiz-master-next' ), + __( 'Detects unusual patterns in surveys.', 'quiz-master-next' ), + ), + ), ); - qsm_admin_upgrade_content( $args, 'page' ); + qsm_admin_upgrade_popup( $args, 'page' ); } diff --git a/php/admin/functions.php b/php/admin/functions.php index 1d8334605..10a324855 100644 --- a/php/admin/functions.php +++ b/php/admin/functions.php @@ -251,9 +251,6 @@ function qsm_add_author_column_in_db() { $success = false; $mlwQuizMasterNext->log_manager->add( 'Error updating column charset utf8mb4_unicode_ci', "Tried $query but got {$wpdb->last_error}.", 0, 'error' ); } - } - - if ( $success ) { update_option( 'qsm_update_db_column_charset_utf8mb4_unicode_ci', 1 ); } } @@ -1343,15 +1340,27 @@ function qsm_advance_question_type_upgrade_popup() { qsm_admin_upgrade_popup($qsm_pop_up_arguments); } -function qsm_admin_upgrade_popup( $args = array() ) { +function qsm_admin_upgrade_popup( $args = array(), $type = 'popup' ) { + if ( 'page' == $type ) { + ?> +
+
+ +

+ +
+ +
+