Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed inline result issue and fix phpcs issues #2455

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion php/admin/options-page-questions-tab.php
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ class="save-page-button button button-primary"><?php esc_html_e( 'Save Questions
'show' => '3, 5, 7, 14' . $show_limit_text,
'documentation_link' => qsm_get_plugin_link( 'docs/creating-quizzes-and-surveys/adding-and-editing-questions/', 'quiz_editor', 'limit_text', 'quizsurvey-limit_text_doc' ),
),
'min_text_length' => array(
'min_text_length' => array(
'heading' => __( 'Minimum Characters', 'quiz-master-next' ),
'label' => __( 'Minimum number of characters required', 'quiz-master-next' ),
'type' => 'text',
Expand Down
3 changes: 3 additions & 0 deletions php/classes/class-qmn-quiz-creator.php
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ public function duplicate_quiz( $quiz_id, $quiz_name, $is_duplicating_questions
// Update quiz settings
$update_quiz_settings = maybe_unserialize( $mlw_qmn_duplicate_data->quiz_settings );
$update_pages = maybe_unserialize( $update_quiz_settings['pages'] );
$update_q_pages = maybe_unserialize( $update_quiz_settings['qpages'] );
// get logic data from logic table first or else from quiz_settings
if ( ! is_null( $logic_table_exists ) ) {
$query = $wpdb->prepare( "SELECT * FROM $logic_table WHERE quiz_id = %d", $quiz_id );
Expand Down Expand Up @@ -633,6 +634,7 @@ public function duplicate_quiz( $quiz_id, $quiz_name, $is_duplicating_questions
foreach ( $pages_value as $pages_k_q => $page_q_id ) {
if ( intval($page_q_id) === intval($mlw_question->question_id) ) {
$update_pages[ $pages_key ][ $pages_k_q ] = $wpdb->insert_id;
$update_q_pages[ $pages_key ]['questions'][ $pages_k_q ] = $wpdb->insert_id;
}
}
}
Expand Down Expand Up @@ -681,6 +683,7 @@ public function duplicate_quiz( $quiz_id, $quiz_name, $is_duplicating_questions
}
}
$update_quiz_settings['pages'] = maybe_serialize( $update_pages );
$update_quiz_settings['qpages'] = maybe_serialize( $update_q_pages );
// saves data in logic table first or else in quiz_settings.
$value_array = array();
if ( is_array( $logic_rules ) && ! empty( $logic_rules ) ) {
Expand Down
4 changes: 2 additions & 2 deletions php/question-types/qsm-question-type-fill-in-the-blanks.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ function qmn_fill_blank_display( $id, $question, $answers ) {
$required = $mlwQuizMasterNext->pluginHelper->get_question_setting( $id, 'required' );
$autofill = $mlwQuizMasterNext->pluginHelper->get_question_setting( $id, 'autofill' );
$limit_text = $mlwQuizMasterNext->pluginHelper->get_question_setting( $id, 'limit_text' );
$min_fill_text = $mlwQuizMasterNext->pluginHelper->get_question_setting( $id, 'min_text_length' );
$min_fill_text = $mlwQuizMasterNext->pluginHelper->get_question_setting( $id, 'min_text_length' );
$autofill_att = $autofill ? "autocomplete='off' " : '';
$limit_text_att = $limit_text ? "maxlength='" . $limit_text . "' " : '';
$min_fill_text_att = $min_fill_text ? "minlength='" . $min_fill_text . "' " : '';
$min_fill_text_att = $min_fill_text ? "minlength='" . $min_fill_text . "' " : '';
if ( 0 == $required ) {
$mlw_require_class = 'mlwRequiredText';
} else {
Expand Down
8 changes: 4 additions & 4 deletions php/question-types/qsm-question-type-number.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
*/
function qmn_number_display( $id, $question, $answers ) {
global $mlwQuizMasterNext;
$required = $mlwQuizMasterNext->pluginHelper->get_question_setting( $id, 'required' );
$limit_text = $mlwQuizMasterNext->pluginHelper->get_question_setting( $id, 'limit_text' );
$min_num_text = $mlwQuizMasterNext->pluginHelper->get_question_setting( $id, 'min_text_length' );
$min_num_attr = $min_num_text ? "minlength=" . $min_num_text . "" : '';
$required = $mlwQuizMasterNext->pluginHelper->get_question_setting( $id, 'required' );
$limit_text = $mlwQuizMasterNext->pluginHelper->get_question_setting( $id, 'limit_text' );
$min_num_text = $mlwQuizMasterNext->pluginHelper->get_question_setting( $id, 'min_text_length' );
$min_num_attr = $min_num_text ? "minlength=" . $min_num_text . "" : '';
if ( 0 == $required ) {
$mlw_require_class = 'mlwRequiredNumber';
} else {
Expand Down
4 changes: 2 additions & 2 deletions php/question-types/qsm-question-type-paragraph.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ function qmn_large_open_display( $id, $question, $answers ) {
global $mlwQuizMasterNext;
$required = $mlwQuizMasterNext->pluginHelper->get_question_setting( $id, 'required' );
$limit_text = $mlwQuizMasterNext->pluginHelper->get_question_setting( $id, 'limit_text' );
$min_length = $mlwQuizMasterNext->pluginHelper->get_question_setting( $id, 'min_text_length' );
$min_length_attr = $min_length ? "minlength=" . $min_length . "" : '';
$min_length = $mlwQuizMasterNext->pluginHelper->get_question_setting( $id, 'min_text_length' );
$min_length_attr = $min_length ? "minlength=" . $min_length . "" : '';
if ( 0 == $required ) {
$mlw_require_class = 'mlwRequiredText';
} else {
Expand Down
10 changes: 5 additions & 5 deletions php/question-types/qsm-question-type-short-answer.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
*/
function qmn_small_open_display( $id, $question, $answers ) {
global $mlwQuizMasterNext;
$required = $mlwQuizMasterNext->pluginHelper->get_question_setting( $id, 'required' );
$autofill = $mlwQuizMasterNext->pluginHelper->get_question_setting( $id, 'autofill' );
$limit_text = $mlwQuizMasterNext->pluginHelper->get_question_setting( $id, 'limit_text' );
$min_text_length = $mlwQuizMasterNext->pluginHelper->get_question_setting( $id, 'min_text_length' );
$required = $mlwQuizMasterNext->pluginHelper->get_question_setting( $id, 'required' );
$autofill = $mlwQuizMasterNext->pluginHelper->get_question_setting( $id, 'autofill' );
$limit_text = $mlwQuizMasterNext->pluginHelper->get_question_setting( $id, 'limit_text' );
$min_text_length = $mlwQuizMasterNext->pluginHelper->get_question_setting( $id, 'min_text_length' );
$autofill_att = $autofill ? "autocomplete='off' " : '';
$min_text_attr = $min_text_length ? "minlength=" . $min_text_length . "" : '';
$min_text_attr = $min_text_length ? "minlength=" . $min_text_length . "" : '';
if ( 0 == $required ) {
$mlw_require_class = 'mlwRequiredText';
} else {
Expand Down
Loading