Skip to content

Commit

Permalink
Merge pull request #2378 from QuizandSurveyMaster/dev
Browse files Browse the repository at this point in the history
Release 8.1.17
  • Loading branch information
etvarun authored Oct 11, 2023
2 parents 7c69ea7 + eef3bdb commit 44f8aa8
Show file tree
Hide file tree
Showing 18 changed files with 345 additions and 59 deletions.
11 changes: 10 additions & 1 deletion css/qsm-admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,9 @@ ul.changelog li.update div.two:before {
box-sizing: border-box;
border-left: 1px solid #dfd4d4;
}
.quiz_text_tab_content .right-bar .quiz_style_tab_content .form-table th {
width: 250px;
}
.quiz_text_tab_content .left-bar ul {
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -1914,7 +1917,7 @@ td.scheduled_time_start {
.qsm-upgrade-box .qsm-upgrade-text {
font-size: 16px;
line-height: 22px;
text-align: justify;
text-align: left;
}
.qsm-upgrade-box .qsm-upgrade-read-icon {
display: flex;
Expand Down Expand Up @@ -1945,7 +1948,13 @@ td.scheduled_time_start {
}
.qsm-upgrade-chart img {
max-width: 100%;
width: 100%;
}

.admin_page_mlw_quiz_options .nav-tab-active:focus, .admin_page_mlw_quiz_options .nav-tab-active:focus:active, .admin_page_mlw_quiz_options .nav-tab-active:hover {
border: 1px solid #c3c4c7;
}

.qsm-popup-upgrade-warning,
.qsm-popup-upgrade-info {
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion data/parsing_script.json

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion js/qsm-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,11 @@ var QSMAdmin;
deleteResults(qid, qname);
});

$(document).on('click', '#the-list .qsm-quiz-proctor-addon', function (e) {
e.preventDefault();
MicroModal.show('modal-proctor-quiz');
});

jQuery(document).on('click', '#btn_export', function (e) {
e.preventDefault();
jQuery.ajax({
Expand Down Expand Up @@ -2063,7 +2068,8 @@ var import_button;
var quizID = parseInt(qsmTextTabObject.quiz_id);
var type = $("#question_type").val();
var comments = $("#comments").val();
advanced_option['required'] = $(".questionElements input[name='required']").is(":checked") ? 0 : 1;
let required = $(".questionElements input[name='required']").is(":checked") ? 0 : 1;
advanced_option['required'] = required;
var category = $(".category-radio:checked").val();
var type_arr = [];
$.each($("input[name='file_upload_type[]']:checked"), function () {
Expand Down Expand Up @@ -2150,6 +2156,7 @@ var import_button;
intcnt++
});
model.set('answers', answers);
model.set('required', required);

$('.questionElements .advanced-content > .qsm-row:not(.core-option)').each(function () {
if ($(this).find('input[type="text"]').length > 0) {
Expand Down
14 changes: 8 additions & 6 deletions js/qsm-quiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ function qmnInit() {
let $this = jQuery(this);
let value = $this.val();
let question_id = $this.attr('name').replace(/question/i, '');
let data = qsm_question_quick_result_js(question_id, value, '', qmn_quiz_data[key].enable_quick_correct_answer_info);
let data = qsm_question_quick_result_js(question_id, value, '', qmn_quiz_data[key].enable_quick_correct_answer_info,key);
if (data.success == 'correct') {
$this.parent().addClass("qmn_correct_answer");
} else if (data.success == 'incorrect') {
Expand Down Expand Up @@ -1612,7 +1612,7 @@ jQuery(function () {
function qsm_show_inline_result(quizID, question_id, value, $this, answer_type, $i_this, index = null) {
jQuery('.qsm-spinner-loader').remove();
addSpinnerLoader($this,$i_this);
let data = qsm_question_quick_result_js(question_id, value, answer_type, qmn_quiz_data[quizID].enable_quick_correct_answer_info);
let data = qsm_question_quick_result_js(question_id, value, answer_type, qmn_quiz_data[quizID].enable_quick_correct_answer_info,quizID);
$this.find('.quick-question-res-p').remove();
$this.find('.qsm-inline-correct-info').remove();
$this.find('.qmn_radio_answers').children().removeClass('data-correct-answer');
Expand Down Expand Up @@ -1826,7 +1826,7 @@ function checkMaxLength(obj){
let submit_status = true;
function qsm_submit_quiz_if_answer_wrong(question_id, value, $this, $quizForm, answer_type = '') {
let quiz_id = $quizForm.closest('.qmn_quiz_container').find('.qmn_quiz_id').val();
let data = qsm_question_quick_result_js(question_id, value, answer_type, qmn_quiz_data[quiz_id].enable_quick_correct_answer_info);
let data = qsm_question_quick_result_js(question_id, value, answer_type, qmn_quiz_data[quiz_id].enable_quick_correct_answer_info,quiz_id);
QSM.changes(data, question_id.replace(/\D/g, ""), quiz_id);
if (data.success == 'incorrect' && submit_status) {
$quizForm.closest('.qmn_quiz_container').find('[class*="Required"]').removeClass();
Expand All @@ -1837,9 +1837,11 @@ function qsm_submit_quiz_if_answer_wrong(question_id, value, $this, $quizForm, a
}
}

function qsm_question_quick_result_js(question_id, answer, answer_type = '', show_correct_info = '') {
if (typeof encryptedData !== 'undefined') {
let decryptedBytes = CryptoJS.AES.decrypt(encryptedData, encryptionKey);
function qsm_question_quick_result_js(question_id, answer, answer_type = '', show_correct_info = '',quiz_id='') {

if (typeof encryptedData[quiz_id] !== 'undefined') {

let decryptedBytes = CryptoJS.AES.decrypt(encryptedData[quiz_id], encryptionKey[quiz_id]);
let decryptedData = decryptedBytes.toString(CryptoJS.enc.Utf8);
let decrypt = JSON.parse(decryptedData);
question_id = typeof question_id !== 'undefined' ? parseInt(question_id) : 0;
Expand Down
4 changes: 2 additions & 2 deletions mlw_quizmaster2.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Plugin Name: Quiz And Survey Master
* Description: Easily and quickly add quizzes and surveys to your website.
* Version: 8.1.16
* Version: 8.1.17
* Author: ExpressTech
* Author URI: https://quizandsurveymaster.com/
* Plugin URI: https://expresstech.io/
Expand Down Expand Up @@ -43,7 +43,7 @@ class MLWQuizMasterNext {
* @var string
* @since 4.0.0
*/
public $version = '8.1.16';
public $version = '8.1.17';

/**
* QSM Alert Manager Object
Expand Down
2 changes: 1 addition & 1 deletion php/admin/admin-dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ function qsm_dashboard_popular_addon( $widget_id ) {
<?php
if ( $all_addons ) {
foreach ( $all_addons as $key => $single_arr ) {
if ( in_array( $single_arr['name'], array( "Export & Import", "Reporting & Analysis", "Export Results", "Advanced Question Types" ), true ) ) {
if ( in_array( $single_arr['name'], array( "Export & Import", "Reporting and Analysis", "Export Results", "Advanced Question Types" ), true ) ) {
?>
<li>
<a href="<?php echo esc_url( qsm_get_utm_link( $single_arr['link'], 'dashboard', 'all_addon', sanitize_title( $single_arr['name'] ) ) ); ?>" target="_blank" rel="noopener">
Expand Down
47 changes: 45 additions & 2 deletions php/admin/admin-results-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ function qsm_results_overview_tab() {
if ( ! class_exists( 'QSM_Analysis' ) ) {
$mlwQuizMasterNext->pluginHelper->register_admin_results_tab( __( 'Reporting And Analysis', 'quiz-master-next' ), 'qsm_reporting_analysis_tabs_content', 10 );
}
if ( ! class_exists( 'QSM_Proctoring_Quiz' ) ) {
$mlwQuizMasterNext->pluginHelper->register_admin_results_tab( __( 'Proctor Reports', 'quiz-master-next' ), 'qsm_proctor_quiz_tabs_content', 12 );
}
}

add_action( 'plugins_loaded', 'qsm_results_overview_tab' );
Expand Down Expand Up @@ -371,9 +374,19 @@ function qsm_results_overview_tab_content() {
if ( "0" === $results_screen_option['time_taken'] ) {
$values['time_taken']['style'] = $display_none;
}

if ( ! class_exists( 'QSM_Proctoring_Quiz' ) ) {
$proctor_class = "qsm-quiz-proctor-addon";
}else {
$proctor_class = "";
}
if ( $mlw_quiz_data ) {
foreach ( $mlw_quiz_data as $mlw_quiz_info ) {
$mlw_quiz_info->proctor_report_class = $proctor_class;
if ( "" == $proctor_class ) {
$mlw_quiz_info->proctor_report_link = "admin.php?page=qsm_quiz_result_details&tab=proctor-results&quiz_id=$mlw_quiz_info->quiz_id&result_id=$mlw_quiz_info->result_id";
}else {
$mlw_quiz_info->proctor_report_link = "#";
}
$quiz_infos[] = $mlw_quiz_info;
$mlw_complete_time = '';
$mlw_qmn_results_array = maybe_unserialize( $mlw_quiz_info->quiz_results );
Expand Down Expand Up @@ -501,7 +514,7 @@ function qsm_results_overview_tab_content() {
?>
<tr>
<td><input type="checkbox" class="qmn_delete_checkbox" name="delete_results[]" value="<?php echo esc_attr( $quiz_infos[ $x ]->result_id ); ?>" /></td>
<td class="<?php echo apply_filters( 'qsm_results_quiz_name_class','', $quiz_infos[ $x ]->result_id ); ?>"><span style="font-size:16px;"><?php echo esc_html( $quiz_infos[ $x ]->quiz_name ); ?></span><div class="row-actions"><span style="color:green;font-size:16px;"><a href="admin.php?page=qsm_quiz_result_details&result_id=<?php echo esc_attr( $quiz_infos[ $x ]->result_id ); ?>"><?php esc_html_e( 'View', 'quiz-master-next' ); ?></a> | <a style="color: red;" class="delete_table_quiz_results_item" data-quiz-id="<?php echo esc_attr( $quiz_infos[ $x ]->result_id ); ?>" data-quiz-name="<?php echo esc_attr( $quiz_infos[ $x ]->quiz_name ); ?>" href='#'><?php esc_html_e( 'Delete', 'quiz-master-next' ); ?></a></span></div></td>
<td class="<?php echo apply_filters( 'qsm_results_quiz_name_class','', $quiz_infos[ $x ]->result_id ); ?>"><span style="font-size:16px;"><?php echo esc_html( $quiz_infos[ $x ]->quiz_name ); ?></span><div class="row-actions"><span style="color:green;font-size:16px;"><a href="admin.php?page=qsm_quiz_result_details&result_id=<?php echo esc_attr( $quiz_infos[ $x ]->result_id ); ?>"><?php esc_html_e( 'View Results', 'quiz-master-next' ); ?></a> | <a style="color: red;" class="delete_table_quiz_results_item" data-quiz-id="<?php echo esc_attr( $quiz_infos[ $x ]->result_id ); ?>" data-quiz-name="<?php echo esc_attr( $quiz_infos[ $x ]->quiz_name ); ?>" href='#'><?php esc_html_e( 'Delete', 'quiz-master-next' ); ?></a> | <a class="<?php echo esc_attr( $quiz_infos[ $x ]->proctor_report_class ); ?>" href='<?php echo esc_attr( $quiz_infos[ $x ]->proctor_report_link ); ?>'><?php esc_html_e( 'Proctor Reports', 'quiz-master-next' ); ?></a></span></div></td>
<?php
foreach ( $values as $k => $v ) {
if ( isset( $v['content'][ $x ] ) ) {
Expand Down Expand Up @@ -581,6 +594,20 @@ function qsm_results_overview_tab_content() {
</div>

<?php
if ( ! class_exists( 'QSM_Proctoring_Quiz' ) ) {
$qsm_pop_up_arguments = array(
"id" => 'modal-proctor-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'),
"chart_image" => plugins_url('', dirname(__FILE__)) . '/images/proctor_quiz_chart.png',
"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 Quiz Proctor Addon separately.', 'quiz-master-next'),
"buy_btn_text" => __('Buy Quiz Proctor Addon', 'quiz-master-next'),
"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' ),
);
qsm_admin_upgrade_popup($qsm_pop_up_arguments);
}
}

function qsm_export_results_tabs_content() {
Expand Down Expand Up @@ -613,3 +640,19 @@ function qsm_reporting_analysis_tabs_content() {
);
qsm_admin_upgrade_content( $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' ),
"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' ),
"buy_btn_text" => __( 'Buy Quiz Proctor Addon', 'quiz-master-next' ),
"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' ),
);
qsm_admin_upgrade_content( $args, 'page' );
}
5 changes: 2 additions & 3 deletions php/admin/options-page-contact-tab.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,14 @@ function qsm_options_contact_tab_template() {
<option value="checkbox" <# if (data.type == 'checkbox') { #>selected<# } #> ><?php esc_html_e('Checkbox', 'quiz-master-next');?></option>
<option value="radio" <# if (data.type == 'radio') { #>selected<# } #> ><?php esc_html_e('Radio', 'quiz-master-next');?></option>
<option value="select" <# if (data.type == 'select') { #>selected<# } #> ><?php esc_html_e('Select', 'quiz-master-next');?></option>
<?php do_action('qsm_extra_contact_form_field_type'); ?>
<?php do_action('qsm_extra_contact_form_field_type'); ?>
</select>
</div>
<div class="contact-form-group contact-form-inputs">
<label class="contact-form-label"><?php esc_html_e('Label', 'quiz-master-next');?></label>
<input type="text" class="contact-form-control label-control" value="{{data.label}}">
<input type="hidden" class="use-control" value="{{data.use}}">
</div>
</div>
<div class="contact-form-group contact-form-actions">
<div class="qsm-actions-link-box contact-form-actions-box">
<a href="javascript:void(0)" class="settings-field" title="<?php esc_html_e('Settings', 'quiz-master-next');?>"><span class="dashicons dashicons-admin-generic"></span></a>
Expand Down Expand Up @@ -195,4 +195,3 @@ function qsm_options_contact_tab_template() {
</script>
<?php
}

1 change: 1 addition & 0 deletions php/classes/class-qmn-plugin-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ public static function get_default_texts() {
'quick_result_correct_answer_text' => __('Correct! You have selected correct answer.', 'quiz-master-next'),
'quick_result_wrong_answer_text' => __('Wrong! You have selected wrong answer.', 'quiz-master-next'),
'quiz_processing_message' => '',
'quiz_limit_choice' => __('Limit of choice is reached.', 'quiz-master-next'),
'name_field_text' => __('Name', 'quiz-master-next'),
'business_field_text' => __('Business', 'quiz-master-next'),
'email_field_text' => __('Email', 'quiz-master-next'),
Expand Down
Loading

0 comments on commit 44f8aa8

Please sign in to comment.