You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
2.0 KiB
41 lines
2.0 KiB
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | Niucloud-admin 企业快速开发的多应用管理平台
|
|
// +----------------------------------------------------------------------
|
|
// | 官方网址:https://www.niucloud.com
|
|
// +----------------------------------------------------------------------
|
|
// | niucloud团队 版权所有 开源版本可自由商用
|
|
// +----------------------------------------------------------------------
|
|
// | Author: Niucloud Team
|
|
// +----------------------------------------------------------------------
|
|
|
|
namespace app\validate\exam_questions;
|
|
use core\base\BaseValidate;
|
|
/**
|
|
* 试题验证器
|
|
* Class ExamQuestions
|
|
* @package addon\app\validate\exam_questions
|
|
*/
|
|
class ExamQuestions extends BaseValidate
|
|
{
|
|
|
|
protected $rule = [
|
|
'question_type' => 'require',
|
|
'question_content_type' => 'require',
|
|
'question_content' => 'require',
|
|
'correct_answer' => 'require',
|
|
];
|
|
|
|
protected $message = [
|
|
'question_type.require' => ['common_validate.require', ['question_type']],
|
|
'question_content_type.require' => ['common_validate.require', ['question_content_type']],
|
|
'question_content.require' => ['common_validate.require', ['question_content']],
|
|
'correct_answer.require' => ['common_validate.require', ['correct_answer']],
|
|
];
|
|
|
|
protected $scene = [
|
|
"add" => ['question_type', 'question_content_type', 'question_content', 'option_a_content_type', 'option_a_content', 'option_b_content_type', 'option_b_content', 'option_c_content_type', 'option_c_content', 'option_d_content_type', 'option_d_content', 'correct_answer'],
|
|
"edit" => ['question_type', 'question_content_type', 'question_content', 'option_a_content_type', 'option_a_content', 'option_b_content_type', 'option_b_content', 'option_c_content_type', 'option_c_content', 'option_d_content_type', 'option_d_content', 'correct_answer']
|
|
];
|
|
|
|
}
|
|
|