Skip to content

Commit

Permalink
Merge branch 'hotfix/0.9.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
garex committed Feb 28, 2015
2 parents ffc51fd + e73ad0b commit a94a790
Show file tree
Hide file tree
Showing 32 changed files with 417 additions and 150 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ script:
- mocha-casperjs --grep=Plugin_activation --timeout=360000
- mocha-casperjs --grep=Answers1
- mocha-casperjs --grep=Answers2
- mocha-casperjs --grep=Multiple
- mocha-casperjs --grep=Page
- mocha-casperjs --grep=Questions
- mocha-casperjs --grep=Quick
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
## Changelog ##


### 0.9.1 ###

Allow respondent to select multiple answers per question on test page


### 0.9 ###

Scales chart, progress percentage, sorting and respondents' results
Expand Down
7 changes: 4 additions & 3 deletions 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:** 4.1.1
**Stable tag:** 0.9
**Stable tag:** 0.9.1
**License:** GPLv3
**License URI:** http://www.gnu.org/licenses/gpl-3.0.html

Expand All @@ -31,12 +31,12 @@ To minimize author's time we have **Quick Fill** for questions and scores. You c

Respondent will get **results** on it's own individual passing page, which will allow share it. **Passings** are saved in DB with respondent's ip and device unique identifier. They are shown at "Respondents' results" table under "Tests" menu. It allow to see if someone will have many passings from same computer/smartphone/another device, which scales/results respondent have for concrete passing and ability to open it from there.

**Test** page can be customized: reset answers on "Back" button, use your own caption for "Get Test Result" button and show percentage of answered questions.
**Test** page can be customized: reset answers on "Back" button, use your own caption for "Get Test Result" button. allow multiple answers per question and show percentage of answered questions.
**Results** page also can be customized: when you need to show/hide scales or test description on it; when you want to show scales chart or sort scales by scores sum.

Wp-testing localized into nine languages: English, Russian (native speaker), German, French, Dutch (native speaker), Swedish, Bulgarian (native speaker), Italian (native speaker) and Turkish (native speaker). English, Russian, Bulgarian, Italian, Turkish and Dutch have good quality — others need review. You can easily add your language through excellent [Transifiex](https://www.transifex.com/projects/p/wp-testing/) service. **Translators** and *reviewers* are kindly welcome! See http://wp-translations.org/join/ for instructions.

**Quality** and **compatibility** are taken really seriously. Plugin tested on [37 combinations](https://travis-ci.org/garex/wp-testing) of WordPress (from 3.2 to 4.0) and PHP (from 5.2 to 5.5) plus two custom combinations for old MySQL storage engine (MyISAM) and with few popular plugins. So you can be sure, that it will just work, even if you don't have the latest WordPress or your hosting doesn't have the latest versions of PHP/MySQL. [Build status image](https://travis-ci.org/garex/wp-testing.svg?branch=develop) is available.
**Quality** and **compatibility** are taken really seriously. Plugin tested on [40 combinations](https://travis-ci.org/garex/wp-testing) of WordPress (from 3.2 to 4.1.1) and PHP (from 5.2 to 5.5) plus two custom combinations for old MySQL storage engine (MyISAM) and with few popular plugins. So you can be sure, that it will just work, even if you don't have the latest WordPress or your hosting doesn't have the latest versions of PHP/MySQL. [Build status image](https://travis-ci.org/garex/wp-testing.svg?branch=develop) is available.

[![Build Status](https://travis-ci.org/garex/wp-testing.svg?branch=develop)](https://travis-ci.org/garex/wp-testing)

Expand Down Expand Up @@ -85,3 +85,4 @@ PS: **If something broken or doesn't work**, pls create new topic in ["Support"
15. Scale description with "more..." text opened (after clicking on "more" link)
16. A test without scores is shown like a "Test is under construction". Answers titles are those that was entered
17. Test results with scales chart when scales are hidden. Hovered scale shows it`s value and title in dynamic tag
18. Multiple answers per question are also possible
Binary file added assets-wp-repo/screenshot-18.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . '_BaseMigration.php';

class AddMultipleAnswersOption extends BaseMigration
{

public function up()
{
$this->add_meta('wpt_test_page_multiple_answers', 0);
}

public function down()
{
$this->remove_meta('wpt_test_page_multiple_answers');
}

}
27 changes: 22 additions & 5 deletions js/test-pass-fill-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@ jQuery(document).ready(function($) {
var form = $('#wpt-test-form');

var button = form.find('.button');
button.addClass('disabled').attr('disabled', 'disabled');

form.bind('test_filled.wpt', function() {
button.removeAttr('disabled').removeClass('disabled');
}).bind('test_unfilled.wpt', function() {
button.addClass('disabled').attr('disabled', 'disabled');
});

form.bind('question_answered_initially.wpt', function(event, question) {
question.addClass('answered');
}).bind('question_unanswered_initially.wpt', function(event, question) {
question.removeClass('answered');
});

var ec = new evercookie({
Expand Down Expand Up @@ -58,8 +62,9 @@ jQuery(document).ready(function ($) {
questions = form.find('.question'),
questionsTotal = questions.length;

var answersInputs = form.find('input:radio');
form.trigger('init_answers.wpt', [answersInputs]);
var answersInputs = form.find('input:radio,input:checkbox');
form.trigger('init_answers.wpt', [answersInputs])
.trigger('test_unfilled.wpt');

form.find('.question').each(function () {
var question = $(this),
Expand All @@ -69,10 +74,18 @@ jQuery(document).ready(function ($) {
var placeholder = title.find('.placeholder');

question.data('isAnswered', false);
var questionAnswersInputs = question.find('.answer input');
question.find('.answer').each(function () {
var answer = $(this);
answer.find('input').bind('change', function () {
if (!$(this).attr('checked')) {
var isAllCheckboxesEmpty = (0 == questionAnswersInputs.filter(':checked').length);
if (isAllCheckboxesEmpty) {
question.data('isAnswered', false);
questionsAnswered--;
form.trigger('question_unanswered_initially.wpt', [question, questionsAnswered, questionsTotal]);
form.trigger('question_unanswered.wpt', [question, answer, placeholder]);
}
return;
}
if (!question.data('isAnswered')) {
Expand All @@ -85,13 +98,17 @@ jQuery(document).ready(function ($) {
});
});

form.bind('question_answered_initially.wpt', function(event, question, answered, total) {
function calculateAnswersPercentage(event, question, answered, total) {
var percent = Math.round(100 * (answered / total));
$(document).trigger('percentage_change.wpt', [percent]);
if (answered == total) {
form.trigger('test_filled.wpt');
} else {
form.trigger('test_unfilled.wpt');
}
});
};
form.bind('question_answered_initially.wpt', calculateAnswersPercentage)
.bind('question_unanswered_initially.wpt', calculateAnswersPercentage);

answersInputs.filter(':checked').change();
});
Binary file modified languages/wp-testing-bg_BG.mo
Binary file not shown.
32 changes: 18 additions & 14 deletions languages/wp-testing-bg_BG.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ msgid ""
msgstr ""
"Project-Id-Version: WP testing\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-02-23 12:23+0700\n"
"PO-Revision-Date: 2015-02-27 12:20+0000\n"
"Last-Translator: Borry Semerdzhieva <borry.semerdzhieva@gmail.com>\n"
"POT-Creation-Date: 2015-02-28 21:00+0700\n"
"PO-Revision-Date: 2015-02-28 15:06+0000\n"
"Last-Translator: Alexander Ustimenko <ustimenko.alexander@gmail.com>\n"
"Language-Team: Bulgarian (Bulgaria) (http://www.transifex.com/projects/p/wp-testing/language/bg_BG/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand All @@ -22,11 +22,11 @@ msgstr ""
"X-Poedit-SourceCharset: UTF-8\n"
"X-Textdomain-Support: yesX-Generator: Poedit 1.6.4\n"

#: Facade.php:122
#: Facade.php:123
msgid "Respondents’ test results"
msgstr "Резултати от тестовете на отговарящите"

#: Facade.php:123
#: Facade.php:124
msgid "Respondents’ results"
msgstr "Резултати на отговарящите"

Expand Down Expand Up @@ -83,16 +83,16 @@ msgstr "Не е намерен тестови резултат"
msgid "You can not get anything from nothing."
msgstr "Не можете да получите нещо от нищо."

#: Doer/TestPasser.php:132
#: Doer/TestPasser.php:135
#, php-format
msgid "Sorry but your browser %s is not compatible to display the chart"
msgstr "Съжаляваме, но вашият браузър е %s несъвместим за показване на диаграма"

#: Doer/TestPasser.php:204 Doer/TestEditor.php:188
#: Doer/TestPasser.php:206 Doer/TestEditor.php:192
msgid "Get Test Results"
msgstr "Виж резултатите"

#: Doer/TestPasser.php:210
#: Doer/TestPasser.php:213
msgid "{percentage}% answered"
msgstr "{percentage}% отговорено"

Expand Down Expand Up @@ -121,30 +121,34 @@ msgid "Show in title percentage of questions that respondent already answered"
msgstr "Покажи в проценти въпросите, на които отговарящият е дал вече отговор"

#: Doer/TestEditor.php:182
msgid "Allow multiple answers per question"
msgstr "Позволява множество отговори на въпрос"

#: Doer/TestEditor.php:186
msgid "Reset respondent answers when \"Back\" button pressed"
msgstr "Възстановяване на ответните отговори, когато бутонът «Назад» е натиснат."

#: Doer/TestEditor.php:186
#: Doer/TestEditor.php:190
msgid "Button caption"
msgstr "Надпис на бутона"

#: Doer/TestEditor.php:203
#: Doer/TestEditor.php:207
msgid "Show scales chart"
msgstr "Покажи диаграма на скалите"

#: Doer/TestEditor.php:207
#: Doer/TestEditor.php:211
msgid "Show scales"
msgstr "Покажи скали"

#: Doer/TestEditor.php:211
#: Doer/TestEditor.php:215
msgid "Sort scales by score"
msgstr "Сортирай скалите по точки"

#: Doer/TestEditor.php:215
#: Doer/TestEditor.php:219
msgid "Show test description"
msgstr "Покажи описание на теста"

#: Doer/TestEditor.php:304
#: Doer/TestEditor.php:309
msgid "Test data not saved"
msgstr "Тестовите данни не са запазени"

Expand Down
Binary file modified languages/wp-testing-de_DE.mo
Binary file not shown.
30 changes: 17 additions & 13 deletions languages/wp-testing-de_DE.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WP testing\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-02-23 12:23+0700\n"
"PO-Revision-Date: 2015-02-23 07:42+0000\n"
"POT-Creation-Date: 2015-02-28 21:00+0700\n"
"PO-Revision-Date: 2015-02-28 15:08+0000\n"
"Last-Translator: Alexander Ustimenko <ustimenko.alexander@gmail.com>\n"
"Language-Team: German (Germany) (http://www.transifex.com/projects/p/wp-testing/language/de_DE/)\n"
"MIME-Version: 1.0\n"
Expand All @@ -23,11 +23,11 @@ msgstr ""
"X-Poedit-SourceCharset: UTF-8\n"
"X-Textdomain-Support: yesX-Generator: Poedit 1.6.4\n"

#: Facade.php:122
#: Facade.php:123
msgid "Respondents’ test results"
msgstr "Befragten Testergebnisse"

#: Facade.php:123
#: Facade.php:124
msgid "Respondents’ results"
msgstr "Ergebnisse der Befragten"

Expand Down Expand Up @@ -84,16 +84,16 @@ msgstr "Kein Testergebnis gefunden"
msgid "You can not get anything from nothing."
msgstr "Sie können nicht alles aus dem nichts bekommen."

#: Doer/TestPasser.php:132
#: Doer/TestPasser.php:135
#, php-format
msgid "Sorry but your browser %s is not compatible to display the chart"
msgstr "Sorry, aber Ihr Browser %s ist nicht kompatibel zum Anzeigen des Diagramms"

#: Doer/TestPasser.php:204 Doer/TestEditor.php:188
#: Doer/TestPasser.php:206 Doer/TestEditor.php:192
msgid "Get Test Results"
msgstr "Testergebnisse anzeigen"

#: Doer/TestPasser.php:210
#: Doer/TestPasser.php:213
msgid "{percentage}% answered"
msgstr "{percentage}% beantwortet"

Expand Down Expand Up @@ -122,30 +122,34 @@ msgid "Show in title percentage of questions that respondent already answered"
msgstr "Karte Titel prozentual Fragen d. Beklagten bereits beantwortet"

#: Doer/TestEditor.php:182
msgid "Allow multiple answers per question"
msgstr "Können Sie mehrere Antworten pro Frage"

#: Doer/TestEditor.php:186
msgid "Reset respondent answers when \"Back\" button pressed"
msgstr "Zurücksetzen Befragten Antworten, wenn Sie \"Zurück\" Taste gedrückt"

#: Doer/TestEditor.php:186
#: Doer/TestEditor.php:190
msgid "Button caption"
msgstr "Button Beschriftung"

#: Doer/TestEditor.php:203
#: Doer/TestEditor.php:207
msgid "Show scales chart"
msgstr "Waage-Chart anzeigen"

#: Doer/TestEditor.php:207
#: Doer/TestEditor.php:211
msgid "Show scales"
msgstr "Zeige Skalen"

#: Doer/TestEditor.php:211
#: Doer/TestEditor.php:215
msgid "Sort scales by score"
msgstr "Art-Scales von score"

#: Doer/TestEditor.php:215
#: Doer/TestEditor.php:219
msgid "Show test description"
msgstr "Testbeschreibung anzeigen"

#: Doer/TestEditor.php:304
#: Doer/TestEditor.php:309
msgid "Test data not saved"
msgstr "Testdaten nicht gespeichert"

Expand Down
Binary file modified languages/wp-testing-en_US.mo
Binary file not shown.
30 changes: 17 additions & 13 deletions languages/wp-testing-en_US.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WP testing\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-02-23 12:23+0700\n"
"PO-Revision-Date: 2015-02-23 06:51+0000\n"
"POT-Creation-Date: 2015-02-28 21:00+0700\n"
"PO-Revision-Date: 2015-02-28 15:01+0000\n"
"Last-Translator: Alexander Ustimenko <ustimenko.alexander@gmail.com>\n"
"Language-Team: English (United States) (http://www.transifex.com/projects/p/wp-testing/language/en_US/)\n"
"MIME-Version: 1.0\n"
Expand All @@ -20,11 +20,11 @@ msgstr ""
"X-Poedit-SourceCharset: UTF-8\n"
"X-Textdomain-Support: yesX-Generator: Poedit 1.6.4\n"

#: Facade.php:122
#: Facade.php:123
msgid "Respondents’ test results"
msgstr "Respondents’ test results"

#: Facade.php:123
#: Facade.php:124
msgid "Respondents’ results"
msgstr "Respondents’ results"

Expand Down Expand Up @@ -81,16 +81,16 @@ msgstr "Test result not found"
msgid "You can not get anything from nothing."
msgstr "You can not get anything from nothing."

#: Doer/TestPasser.php:132
#: Doer/TestPasser.php:135
#, php-format
msgid "Sorry but your browser %s is not compatible to display the chart"
msgstr "Sorry but your browser %s is not compatible to display the chart"

#: Doer/TestPasser.php:204 Doer/TestEditor.php:188
#: Doer/TestPasser.php:206 Doer/TestEditor.php:192
msgid "Get Test Results"
msgstr "Get Test Results"

#: Doer/TestPasser.php:210
#: Doer/TestPasser.php:213
msgid "{percentage}% answered"
msgstr "{percentage}% answered"

Expand Down Expand Up @@ -119,30 +119,34 @@ msgid "Show in title percentage of questions that respondent already answered"
msgstr "Show in title percentage of questions that respondent already answered"

#: Doer/TestEditor.php:182
msgid "Allow multiple answers per question"
msgstr "Allow multiple answers per question"

#: Doer/TestEditor.php:186
msgid "Reset respondent answers when \"Back\" button pressed"
msgstr "Reset respondent answers when \"Back\" button pressed"

#: Doer/TestEditor.php:186
#: Doer/TestEditor.php:190
msgid "Button caption"
msgstr "Button caption"

#: Doer/TestEditor.php:203
#: Doer/TestEditor.php:207
msgid "Show scales chart"
msgstr "Show scales chart"

#: Doer/TestEditor.php:207
#: Doer/TestEditor.php:211
msgid "Show scales"
msgstr "Show scales"

#: Doer/TestEditor.php:211
#: Doer/TestEditor.php:215
msgid "Sort scales by score"
msgstr "Sort scales by score"

#: Doer/TestEditor.php:215
#: Doer/TestEditor.php:219
msgid "Show test description"
msgstr "Show test description"

#: Doer/TestEditor.php:304
#: Doer/TestEditor.php:309
msgid "Test data not saved"
msgstr "Test data not saved"

Expand Down
Binary file modified languages/wp-testing-fr_FR.mo
Binary file not shown.
Loading

0 comments on commit a94a790

Please sign in to comment.