addElement( 'select', 'languageId', [ 'label' => 'Language', 'required' => true, 'multiOptions' => array('' => 'Select One') + (array) LanguageModel::get4Select(), ] ); $this->addElement('text', 'title', ['label' => 'Title', 'required' => true]); $this->addElement( 'select', 'certificateId', [ 'label' => 'Certificate', 'required' => true, 'multiOptions' => ['' => 'Select One'] + (array) (new Qs_Db_Table('Certificate'))->get4Select(), ] ); $this->addElement( 'numeric', 'minPoints', [ 'label' => 'Minimal Points', 'required' => true, 'negative' => false, 'precision' => 0, ] ); $this->addElement( 'numeric', 'maxPoints', [ 'label' => 'Maximum Points', 'required' => true, 'negative' => false, 'precision' => 0, 'description' => 'Maximum points for test. ' . 'The points for each question will be scored as "Maximum Points/Questions Quantity".', 'validators' => [ ['Compare', true, [ 'operator' => '>=', 'callback' => [$this->getElement('minPoints'), 'getValue'], 'messages' => 'Maximum Points should be greater or equal Minimum Points' ]] ], ] ); $this->addElement('textarea', 'successMessage', ['label' => 'Successful Test Message']); $this->addElement('textarea', 'failedMessage', ['label' => 'Failed Test Message']); $this->addElement('textarea', 'prematurelyFailedMessage', ['label' => 'Prematurely Failed Test Message']); $this->addElement('text', 'estimatedTime', ['label' => 'Estimated Time']); $this->addElement('ExtendedImage', 'image', ['label' => 'Image', 'resize' => $this->getConfigArray('image')]); $this->addElement('textarea', 'description', ['label' => 'Description']); $this->addElement( 'checkbox', 'enabled', [ 'label' => 'Show on user end', 'decoration' => 'simple', 'value' => 'y' ] ); return parent::_initElements(); } }