复选框不工作PHP


Checkboxes not working PHP

我在WordPress的WP-Pro-Quiz插件中有一个问题。有"单一答案选项"是可见的,但不是可选择的。我需要这些选项,我在想我也许可以让复选框发挥作用,然后得到我在测验中需要的结果。

是什么导致这些复选框"变灰"?

       <?php
}
private function singleChoiceOptions($data)
 {
    $single = $data[0];
    ?>
    <div class="postbox" id="singleChoiceOptions">
        <h3 class="hndle"><?php _e('Single choice options', 'wp-pro-quiz'); ?></h3>
        <div class="inside">
            <p class="description">
                <?php _e('If "Different points for each answer" is activated, you can activate a special mode.<br> This changes the calculation of the points',
                    'wp-pro-quiz'); ?>
            </p>
            <label>
                <input type="checkbox" name="answerswerPointsDiffModusActivated"
                       value="1" <?php $this->checked($this->question->isAnswerPointsDiffModusActivated()); ?>>
                <?php _e('Different points - modus 2 activate', 'wp-pro-quiz'); ?>
            </label>
            <br><br>
            <p class="description">
                <?php _e('Disables the distinction between correct and incorrect.', 'wp-pro-quiz'); ?><br>
            </p>
            <label>
                <input type="checkbox" name="disableCorrect" 
                       value="1" <?php $this->checked($this->question->isDisableCorrect()); ?>>
                <?php _e('Disable correct and incorrect.', 'wp-pro-quiz'); ?>
            </label>
            <div style="padding-top: 20px;">
                <a href="#" id="clickPointDia"><?php _e('Explanation of points calculation', 'wp-pro-quiz'); ?></a>
                <?php $this->answerPointDia(); ?>
            </div>
        </div>
    </div>
    <?php
}

是灰色的,因为被disabled="enabled"禁用,即使值是enabled,输入也被禁用,任何值都将禁用输入,事实上,您可以只放置disable,它将被禁用,最新的浏览器只是读取disabled并禁用输入。删除disabled="enabled",输入将被启用

我发现了,名称值与$this值不匹配,大写字母。插件作者一定错过了。希望这个函数能起作用。

        <div class="inside">
            <p class="description">
                <?php _e('If "Different points for each answer" is activated, you can activate a special mode.<br> This changes the calculation of the points',
                    'wp-pro-quiz'); ?>
            </p>
            <label>
                <input type="checkbox" name="AnswerPointsDiffModusActivated" value="1" <?php $this->checked($this->question->isAnswerPointsDiffModusActivated()); ?>> 
                <?php _e('Different points - modus 2 activate', 'wp-pro-quiz'); ?>
            </label>
            <br><br>
            <p class="description">
                <?php _e('Disables the distinction between correct and incorrect.', 'wp-pro-quiz'); ?><br>
            </p>
            <label>
                <input type="checkbox" name="DisableCorrect" 
                value="1" <?php $this->checked($this->question->isDisableCorrect()); ?>>
                <?php _e('Do not show correct and incorrect.', 'wp-pro-quiz'); ?>
            </label>
            <div style="padding-top: 20px;">
                <a href="#" id="clickPointDia"><?php _e('Explanation of points calculation', 'wp-pro-quiz'); ?></a>
                <?php $this->answerPointDia(); ?>
            </div>
        </div>
    </div>
    <?php