Skip to content

Commit

Permalink
Merge branch 'hotfix/0.4.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
garex committed Nov 15, 2014
2 parents f727512 + 5019d3d commit 9b641d9
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 8 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
## Changelog ##


### 0.4.2 ###
Fix pages disapperance and form formatting

* Fix pages disapperance
* Fix fill form (public) formatting conflict with wpautop (for example under Monaco theme)


### 0.4.1 ###
Fix tests preview mode

Expand Down Expand Up @@ -118,6 +125,9 @@ Initial release

== Upgrade Notice ==

### 0.4.2 ###
Fix page disppearance and fill form broken formatting

### 0.4.1 ###
Fix tests preview mode

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
**Tags:** psychological, testing, test, quiz
**Requires at least:** 3.2
**Tested up to:** 3.9
**Stable tag:** 0.4.1
**Stable tag:** 0.4.2
**License:** GPLv3
**License URI:** http://www.gnu.org/licenses/gpl-3.0.html

Expand Down
2 changes: 0 additions & 2 deletions css/public.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
.wpt_test .question .title .number {
font-weight: normal;
display: inline-block;
width: 3em;
margin-left: -3.5em;
padding-right: 0.5em;
text-align: right;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Doer/PostBrowser.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private function addTestToPostTypes($query)
return $postTypes;
}
if (empty($postTypes)) {
$postTypes[] = 'post';
$postTypes[] = $query->is_page ? 'page' : 'post';
}
$postTypes[] = 'wpt_test';

Expand Down
7 changes: 6 additions & 1 deletion src/Doer/TestPasser.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ public function renderTestContent($content)
);
}

return $this->render($template, $params);
return preg_replace_callback('|<form.+</form>|s', array($this, 'stripNewLines'), $this->render($template, $params));
}

private function stripNewLines($matches)
{
return str_replace('> <', '><', preg_replace('/[\n\r\s]+/s', ' ', $matches[0]));
}

private function getTestPassingAction()
Expand Down
4 changes: 2 additions & 2 deletions src/Template/Test/Passer/fill-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

<div class="title">
<span class="number"><?php echo $q+1 ?>.</span><span class="title"><?php echo $question->getTitle() ?></span>
<input type="hidden" name="wp_testing_model_passing_answers::answer_id[<?php echo $q ?>]" value="" />
</div>

<input type="hidden" name="wp_testing_model_passing_answers::answer_id[<?php echo $q ?>]" value="" />
<?php foreach($question->getAnswers() as $answer): /* @var $answer WpTesting_Model_Answer */ ?>
<?php $answerId = 'wpt-test-question-' . $question->getId() . '-answer-' . $answer->getId() ?>

Expand All @@ -40,7 +40,7 @@

<?php endforeach ?>

<input type="submit" class="button" value="<?php echo 'Get Test Results' ?>" />
<p><input type="submit" class="button" value="<?php echo 'Get Test Results' ?>" /></p>

</form>

Expand Down
2 changes: 1 addition & 1 deletion wp-testing.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Wp-testing
* Plugin URI: http://wordpress.org/extend/plugins/wp-testing/
* Description: Helps to create psychological tests.
* Version: 0.4.1
* Version: 0.4.2
* Author: Alexander Ustimenko
* Author URI: http://ustimen.co
* License: GPL3
Expand Down

0 comments on commit 9b641d9

Please sign in to comment.