WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Minimum multiple answers to a poll

[Resolved] Minimum multiple answers to a poll

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author YOP
    Participant

    @yourownprogrammer

    Hello

    To get this to work, you will need to do some edits to the code.

    First, update your poll to allow multiple answers and also define the number of answers you want.

    Then on inc/yop_poll_model.php on line 2437 replace

    if ( count( $request['yop_poll_answer'] ) <= intval( $poll_options['allow_multiple_answers_number'] ) ) {

    with

    if ( count( $request['yop_poll_answer'] ) == intval( $poll_options['allow_multiple_answers_number'] ) ) {

    In the same file, on line 2468 you need to change the error given.

    Replace

    $this->error = __( 'To many answers! Only ', 'yop_poll' ) . $poll_options['allow_multiple_answers_number'] . __(' answers allowed!', 'yop_poll' );

    with

    $this->error = __( 'At least ', 'yop_poll' ) . $poll_options['allow_multiple_answers_number'] . __(' answers needed!', 'yop_poll' );

    Give it a try and let us know if this does what you need.

    Best Regards,
    YOP Team

    Hi!

    I had figured this solution just after I posted the question.
    It works just as expected. Thanks for the prompt reply and a wonderful plugin.

    Cheers.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Minimum multiple answers to a poll’ is closed to new replies.