diff --git a/mlw_quizmaster2.php b/mlw_quizmaster2.php index 572f2a1f..d9427197 100644 --- a/mlw_quizmaster2.php +++ b/mlw_quizmaster2.php @@ -657,24 +657,24 @@ public function register_quiz_post_types() { 'map_meta_cap' => true, ); $quiz_args['capabilities'] = array( - 'edit_post' => 'edit_qsm_quiz', - 'edit_post' => 'duplicate_qsm_quiz', - 'read_post' => 'read_qsm_quiz', - 'delete_post' => 'delete_qsm_quiz', - 'edit_posts' => 'edit_qsm_quizzes', - 'edit_others_posts' => 'edit_others_qsm_quizzes', - 'publish_posts' => 'publish_qsm_quizzes', - 'read_private_posts' => 'read_private_qsm_quizzes', - 'delete_posts' => 'delete_qsm_quizzes', - 'delete_private_posts' => 'delete_private_qsm_quizzes', - 'delete_published_posts'=> 'delete_published_qsm_quizzes', - 'delete_others_posts' => 'delete_others_qsm_quizzes', - 'edit_private_posts' => 'edit_private_qsm_quizzes', - 'edit_published_posts' => 'edit_published_qsm_quizzes', - 'create_posts' => 'create_qsm_quizzes', - 'manage_categories' => 'manage_qsm_quiz_categories', - 'manage_categories' => 'manage_qsm_quiz_answer_label', - 'moderate_comments' => 'view_qsm_quiz_result', + 'edit_post' => 'edit_qsm_quiz', + 'edit_post' => 'duplicate_qsm_quiz', + 'read_post' => 'read_qsm_quiz', + 'delete_post' => 'delete_qsm_quiz', + 'edit_posts' => 'edit_qsm_quizzes', + 'edit_others_posts' => 'edit_others_qsm_quizzes', + 'publish_posts' => 'publish_qsm_quizzes', + 'read_private_posts' => 'read_private_qsm_quizzes', + 'delete_posts' => 'delete_qsm_quizzes', + 'delete_private_posts' => 'delete_private_qsm_quizzes', + 'delete_published_posts' => 'delete_published_qsm_quizzes', + 'delete_others_posts' => 'delete_others_qsm_quizzes', + 'edit_private_posts' => 'edit_private_qsm_quizzes', + 'edit_published_posts' => 'edit_published_qsm_quizzes', + 'create_posts' => 'create_qsm_quizzes', + 'manage_categories' => 'manage_qsm_quiz_categories', + 'manage_categories' => 'manage_qsm_quiz_answer_label', + 'moderate_comments' => 'view_qsm_quiz_result', ); // Registers post type. @@ -825,7 +825,7 @@ public function setup_admin_menu() { 'delete_others_qsm_quizzes', 'manage_qsm_quiz_categories', 'manage_qsm_quiz_answer_label', - 'view_qsm_quiz_result' + 'view_qsm_quiz_result', ); add_menu_page( 'Quiz And Survey Master', __( 'QSM', 'quiz-master-next' ), $capabilities[1], 'qsm_dashboard', 'qsm_generate_dashboard_page', 'dashicons-feedback', $menu_position ); diff --git a/php/classes/class-qmn-quiz-manager.php b/php/classes/class-qmn-quiz-manager.php index 7ffcadd2..8432fd69 100644 --- a/php/classes/class-qmn-quiz-manager.php +++ b/php/classes/class-qmn-quiz-manager.php @@ -2566,7 +2566,7 @@ public static function qsm_max_min_points( $options, $question ) { $question_required = ( 0 === maybe_unserialize( $question['question_settings'] )['required'] ); $multi_response = ( '4' === $question_type || '10' === $question_type || '14' === $question_type ); - return self::qsm_max_min_points_conditions( $max_value_array, $min_value_array, $question_required, $multi_response ); + return self::qsm_max_min_points_conditions( $max_value_array, $min_value_array, $question_required, $multi_response, $question ); } /** @@ -2579,7 +2579,7 @@ public static function qsm_max_min_points( $options, $question ) { * @param array $multi_response * @return string $max_min_result */ - public static function qsm_max_min_points_conditions( $max_value_array, $min_value_array, $question_required, $multi_response ) { + public static function qsm_max_min_points_conditions( $max_value_array, $min_value_array, $question_required, $multi_response, $question ) { $max_min_result = array( 'max_point' => 0, 'min_point' => 0, @@ -2627,7 +2627,7 @@ public static function qsm_max_min_points_conditions( $max_value_array, $min_val $max_min_result['max_point'] = max( $max_value_array ); $max_min_result['min_point'] = min( $min_value_array ); } - return $max_min_result; + return apply_filters( 'qsm_max_min_points_conditions_result', $max_min_result, $question_required, $question ); } /**