Ejemplo n.º 1
0
 public function beforeRender(WpTesting_Model_Test $test, WpTesting_Model_Passing $passing = null)
 {
     $this->test = $test;
     $this->passing = $passing;
     if ($this->test->isOneQuestionPerStep()) {
         $stepStrategy = new WpTesting_Component_StepStrategy_OneToOne($test, $passing->buildAnswers());
     } else {
         $stepStrategy = new WpTesting_Component_StepStrategy_AllInOne($test, $passing->buildAnswers());
     }
     $stepStrategy = $this->wp->applyFilters('wp_testing_passer_step_strategy', $stepStrategy);
     $this->passing->setStepStrategy($stepStrategy);
     $this->upgradeJqueryForOldWordPress()->addJsData('evercookieBaseurl', $this->wp->getPluginUrl('vendor/samyk/evercookie'))->enqueueScript('test-pass-fill-form', array('jquery', 'pnegri_uuid', 'samyk_evercookie', 'webshim'));
     $this->wp->addFilter('wp_title', array($this, 'extractTitleSeparator'), 10, 2)->doAction('wp_testing_passer_fill_form_before_render', $this->passing, $this->test);
 }