<commit_before><?php
/**
 * Form class
 *
 * @package     Webenq
 * @subpackage  Forms
 * @author      <NAME> <<EMAIL>>
 */
class Webenq_Form_Questionnaire_Collect extends Zend_Form
{
    /**
     * Array with questions
     *
     * @var Doctrine_Collection
     */
    protected $_questions;

    /**
     *
     * @param Doctrine_Collection $questions
     * @param array $options
     */
    public function __construct(Doctrine_Collection $questions, $options = null)
    {
        $this->_questions = $questions;
        parent::__construct($options);
    }

    public function init()
    {
        // add questions
        foreach ($this->_questions as $question) {
            $name = "qq_$question->id";
            $elm = $question->getFormElement();
            if ($elm instanceof Zend_Form_Element) {
                $this->addElement($elm, $name);
            } elseif ($elm instanceof Zend_Form_SubForm) {
                $this->addSubform($elm, $name);
            }
        }

        // add submit button
        $this->addElement($this->createElement('submit', 'submit', array(
            'label' => 'verder',
        )));
    }

    /**
     * Retrieve a single element
     *
     * @param  string $name<commit_msg>[4849] bij opnieuw weergeven zelfde pagina vragen vullen met reeds bekende antwoorden<commit_after><?php
/**
 * Form class
 *
 * @package     Webenq
 * @subpackage  Forms
 * @author      <NAME> <<EMAIL>>
 */
class Webenq_Form_Questionnaire_Collect extends Zend_Form
{
    /**
     * Array with questions
     *
     * @var Doctrine_Collection
     */
    protected $_questions;

    /**
     *
     * @param Doctrine_Collection $questions
     * @param array $options
     */
    public function __construct(Doctrine_Collection $questions, $options = null)
    {
        $this->_questions = $questions;
        parent::__construct($options);
    }

    public function init()
    {
        // add questions
        foreach ($this->_questions as $question) {
            $name = "qq_$question->id";
            $elm = $question->getFormElement();
            if ($elm instanceof Zend_Form_Element) {
                if ($elm instanceof Zend_Form_Element_Multi) {
                    $elm->setValue($question->answerPossibilityGroup_id);
                } else {
                    $elm->setValue($question->Answer[0]->text);
                }
                $this->addElement($elm, $name);
            } elseif ($elm instanceof Zend_Form_SubForm) {
                $this->addSubform($elm, $name);
            }
        }

        // add submit button
        $this->addElement($this->createElement('submit', 'submit', array(
            'label' => 'verder',
        )));
    }

    /**
     * Retrieve a single element
     *
     * @param  string $name
{'fraction_non_alphanumeric': 0.12714899713467048, 'fraction_numerical': 0.0017908309455587394, 'mean_word_length': 1.9338235294117647, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 32, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4928516', 'n_tokens_mistral': 809, 'n_tokens_neox': 771, 'n_words': 169}