Skip to content

Commit

Permalink
Merge pull request #2361 from QuizandSurveyMaster/CU-85ztzq7vh-wporg-…
Browse files Browse the repository at this point in the history
…customize-message-when-user-exceeds-answer-limit

added the meessage for the limit
  • Loading branch information
zubairraeen authored Sep 21, 2023
2 parents 12c2c7b + 841337e commit 3074c6d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
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
5 changes: 4 additions & 1 deletion php/classes/class-qmn-quiz-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ public function display_shortcode( $atts ) {
$wrong_answer_text = sanitize_text_field( $qmn_quiz_options->quick_result_wrong_answer_text );
$wrong_answer_text = $mlwQuizMasterNext->pluginHelper->qsm_language_support( $wrong_answer_text, "quiz_quick_result_wrong_answer_text-{$qmn_array_for_variables['quiz_id']}" );
$quiz_processing_message = $mlwQuizMasterNext->pluginHelper->qsm_language_support( $qmn_quiz_options->quiz_processing_message, "quiz_quiz_processing_message-{$qmn_array_for_variables['quiz_id']}" );
$quiz_limit_choice = $mlwQuizMasterNext->pluginHelper->qsm_language_support( $qmn_quiz_options->quiz_limit_choice, "quiz_quiz_limit_choice-{$qmn_array_for_variables['quiz_id']}" );
$qmn_json_data = array(
'quiz_id' => $qmn_array_for_variables['quiz_id'],
'quiz_name' => $qmn_array_for_variables['quiz_name'],
Expand All @@ -456,6 +457,7 @@ public function display_shortcode( $atts ) {
'quick_result_correct_answer_text' => $correct_answer_text,
'quick_result_wrong_answer_text' => $wrong_answer_text,
'quiz_processing_message' => $quiz_processing_message,
'quiz_limit_choice' => $quiz_limit_choice,
'not_allow_after_expired_time' => $qmn_quiz_options->not_allow_after_expired_time,
'scheduled_time_end' => strtotime( $qmn_quiz_options->scheduled_time_end ),
);
Expand Down Expand Up @@ -879,13 +881,14 @@ public function display_quiz( $options, $quiz_data, $question_amount, $shortcode
'qmn_ajax_object',
array(
'ajaxurl' => admin_url( 'admin-ajax.php' ),
'multicheckbox_limit_reach' => __( 'Limit of choice is reached.', 'quiz-master-next' ),
'multicheckbox_limit_reach' => $mlwQuizMasterNext->pluginHelper->qsm_language_support( $options->quiz_limit_choice, "quiz_quiz_limit_choice-{$options->quiz_id}" ),
'out_of_text' => __( ' out of ', 'quiz-master-next' ),
'quiz_time_over' => __( 'Quiz time is over.', 'quiz-master-next' ),
'security' => wp_create_nonce( 'qsm_submit_quiz' ),
'start_date' => current_time( 'h:i:s A m/d/Y' ),
)
);

$disable_mathjax = isset( $options->disable_mathjax ) ? $options->disable_mathjax : '';
if ( 1 != $disable_mathjax ) {
wp_enqueue_script( 'math_jax', $this->mathjax_url, array(), $this->mathjax_version, true );
Expand Down
11 changes: 10 additions & 1 deletion php/classes/class-qsm-install.php
Original file line number Diff line number Diff line change
Expand Up @@ -1446,7 +1446,16 @@ public function register_default_settings() {
'option_tab' => 'text-other',
);
$mlwQuizMasterNext->pluginHelper->register_quiz_setting( $field_array, 'quiz_text' );

// Registers limit the number of choices
$field_array = array(
'id' => 'quiz_limit_choice',
'label' => __( 'Limit of choice is reached.', 'quiz-master-next' ),
'type' => 'text',
'default' => __( 'Limit of choice is reached.', 'quiz-master-next' ),
'tooltip' => __( 'Limit of choice is reached.', 'quiz-master-next' ),
'option_tab' => 'text-other',
);
$mlwQuizMasterNext->pluginHelper->register_quiz_setting( $field_array, 'quiz_text' );
// Registers name_field_text setting
$field_array = array(
'id' => 'name_field_text',
Expand Down

0 comments on commit 3074c6d

Please sign in to comment.