Skip to content

Commit

Permalink
Merge branch 'release/0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
garex committed Oct 1, 2014
2 parents 5251a0b + dcb1ec4 commit 527c3cb
Show file tree
Hide file tree
Showing 55 changed files with 3,632 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/db/log/*.log
/db/sql/*.bak
/vendor/
/ruckusing.conf.local.php
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Changelog ##


### 0.0 ###
* Init repo and files


### 0.1 ###
Initial release

* Add shortcode for tests lists: wptlist
* Edit tests, answers (global), scales, results and categories through admin
* Edit tests questions and scores (question -> answer -> scale -> score value)
* Show test page, allowing to redefine it's template if needed
* Allow to send test form only when all questions selected
* Show test results by scales totals
* Add eysenck personality inventory example

595 changes: 595 additions & 0 deletions LICENSE.md

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions README-DEV.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Wp-testing for developer

## To regenerate README.md

Changes should be in readme.txt, which then generates README.md by this:

vendor/bin/wp2md convert < readme.txt > README.md

* Validator is at http://wordpress.org/plugins/about/validator/
* Template is at https://wordpress.org/plugins/about/readme.txt
* Good howto is at http://www.smashingmagazine.com/2011/11/23/improve-wordpress-plugins-readme-txt/
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Wp-testing #

**Contributors:** ustimenko
**Donate link:** http://ustimen.co/
**Tags:** psychological, testing, test, quiz
**Requires at least:** 3.2
**Tested up to:** 3.9
**Stable tag:** 0.1
**License:** GPLv3
**License URI:** http://www.gnu.org/licenses/gpl-3.0.html

Helps to create psychological tests.

## Installation ##

1. Download plugin archive.
1. Unzip it.
1. Upload it to your plugins directory. It will create a 'wp-content/plugins/wp-testing/' directory.
1. Activate the plugin through the 'Plugins' menu in WordPress.

## Requirements ##

* WordPress version **3.2** or higher.
* PHP version **5.2.4** or higher.
* MySQL version **5.0** or higher.
35 changes: 35 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "garex/wp-testing",
"description": "Helps to create psychological tests",
"type": "wordpress-plugin",
"license": "GPLv3",
"authors": [{
"name": "Ustimenko Alexander",
"email": "a@ustimen.co"
}
],
"require": {
"composer/installers": "~1.0.0"
, "xrstf/composer-php52": "1.*"
, "ruckusing/ruckusing-migrations": "~1.0"
, "flourish/flourish": "0.9.*@dev"
},
"require-dev": {
},
"scripts": {
"post-install-cmd": [
"xrstf\\Composer52\\Generator::onPostInstallCmd"
],
"post-update-cmd": [
"xrstf\\Composer52\\Generator::onPostInstallCmd"
],
"post-autoload-dump": [
"xrstf\\Composer52\\Generator::onPostInstallCmd"
]
},
"autoload": {
"classmap": [
"src/"
]
}
}
21 changes: 21 additions & 0 deletions css/admin.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
table.wpt_questions {
width: 100%;
}

.wpt_questions .wpt_title input {
width: 100%;
}

.wpt_questions .wpt_number {
width: 1em;
text-align: right;
}

.wpt_questions .wpt_scale {
text-align: center;
}

.wpt_questions .wpt_scale input {
text-align: center;
width: 100%;
}
69 changes: 69 additions & 0 deletions css/public.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
.wpt_test .question {
margin-bottom: 1.25em;
}

.wpt_test .question .title {
font-weight: bold;
}

.wpt_test .question .title .number {
font-weight: normal;
display: inline-block;
width: 3em;
margin-left: -3.5em;
padding-right: 0.5em;
text-align: right;
}

.wpt_test .answer {
padding-top: 0.25em;
padding-left: 0.5em;
}

.wpt_test .answer label {
margin-left: 0.25em;
}

.wpt_test .answer input {
margin-top: -2px;
vertical-align: middle;
}

.wpt_test .button {
margin-top: 0.75em;
}

.wpt_test .button.disabled {
opacity: 0.5;
}

.wpt_test .get_results .meter,
.wpt_test .get_results .meter > span {
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;
position: relative;
}
.wpt_test .get_results .meter {
height: 1.5em;
margin-bottom: 1em;
padding: 2px 1px;
border: 1px solid highlight;
}
.wpt_test .get_results .meter > span {
display: block;
height: 100%;
background: highlight;
overflow: hidden;
}
.wpt_test .get_results .scale.scores {
padding-left: 7px;
padding-top: 2px;
font-weight: bold;
position: absolute;
z-index: 1;
}

.wpt_test .get_results .content {
color: gray;
}
83 changes: 83 additions & 0 deletions db/log/empty
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
Aug 31 09:20:56 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:20:56 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:20:56 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:20:56 [info] CREATE TABLE `wp_t_tests` (
`id` int(11) UNSIGNED auto_increment NOT NULL,
`title` varchar(255),
PRIMARY KEY (`id`)) DEFAULT CHARSET=utf8;
Aug 31 09:20:56 [info] INSERT INTO wp_t_schema_migrations (version) VALUES ('20140831002425')
Aug 31 09:21:27 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:21:27 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:21:27 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:21:27 [info] DROP TABLE IF EXISTS `wp_t_tests`
Aug 31 09:21:27 [info] DELETE FROM wp_t_schema_migrations WHERE version = '20140831002425'
Aug 31 09:21:28 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:21:28 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:21:28 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:21:28 [info] CREATE TABLE `wp_t_tests` (
`id` int(11) UNSIGNED auto_increment NOT NULL,
`title` varchar(255),
PRIMARY KEY (`id`)) DEFAULT CHARSET=utf8;
Aug 31 09:21:28 [info] INSERT INTO wp_t_schema_migrations (version) VALUES ('20140831002425')
Aug 31 09:21:30 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:21:30 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:21:30 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:21:30 [info] DROP TABLE IF EXISTS `wp_t_tests`
Aug 31 09:21:30 [info] DELETE FROM wp_t_schema_migrations WHERE version = '20140831002425'
Aug 31 09:24:43 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:24:43 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:24:43 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:24:43 [info] CREATE TABLE `wp_t_tests` (
`id` int(11) UNSIGNED auto_increment NOT NULL,
`title` varchar(255),
PRIMARY KEY (`id`)) DEFAULT CHARSET=utf8;
Aug 31 09:24:43 [info] INSERT INTO wp_t_schema_migrations (version) VALUES ('20140831002425')
Aug 31 09:24:45 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:24:45 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:24:45 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:24:45 [info] DROP TABLE IF EXISTS `wp_t_tests`
Aug 31 09:24:45 [info] DELETE FROM wp_t_schema_migrations WHERE version = '20140831002425'
Aug 31 09:28:12 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:28:12 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:28:12 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:28:12 [info] CREATE TABLE `wp_t_tests` (
`id` int(11) UNSIGNED auto_increment NOT NULL,
`title` varchar(255),
PRIMARY KEY (`id`)) DEFAULT CHARSET=utf8;
Aug 31 09:28:12 [info] INSERT INTO wp_t_schema_migrations (version) VALUES ('20140831002425')
Aug 31 09:29:50 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:29:50 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:29:50 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:29:50 [info] DROP TABLE IF EXISTS `wp_t_tests`
Aug 31 09:29:50 [info] DELETE FROM wp_t_schema_migrations WHERE version = '20140831002425'
Aug 31 09:30:01 [info] CREATE TABLE `wp_t_schema_migrations` (
`version` varchar(255)) DEFAULT CHARSET=utf8;
Aug 31 09:30:01 [info] CREATE UNIQUE INDEX idx_wp_t_schema_migrations_version ON `wp_t_schema_migrations`(`version`)
Aug 31 09:30:01 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:30:01 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:30:01 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:30:01 [info] CREATE TABLE `wp_t_tests` (
`id` int(11) UNSIGNED auto_increment NOT NULL,
`title` varchar(255),
PRIMARY KEY (`id`)) DEFAULT CHARSET=utf8;
Aug 31 09:30:01 [info] INSERT INTO wp_t_schema_migrations (version) VALUES ('20140831002425')
Aug 31 09:32:59 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:32:59 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:32:59 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:32:59 [info] DROP TABLE IF EXISTS `wp_t_tests`
Aug 31 09:32:59 [info] DELETE FROM wp_t_schema_migrations WHERE version = '20140831002425'
Aug 31 09:32:59 [info] DROP TABLE IF EXISTS `wp_t_schema_migrations`
Aug 31 09:33:08 [info] CREATE TABLE `wp_t_schema_migrations` (
`version` varchar(255)) DEFAULT CHARSET=utf8;
Aug 31 09:33:08 [info] CREATE UNIQUE INDEX idx_wp_t_schema_migrations_version ON `wp_t_schema_migrations`(`version`)
Aug 31 09:33:08 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:33:08 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:33:08 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:33:08 [info] CREATE TABLE `wp_t_tests` (
`id` int(11) UNSIGNED auto_increment NOT NULL,
`title` varchar(255),
PRIMARY KEY (`id`)) DEFAULT CHARSET=utf8;
Aug 31 09:33:08 [info] INSERT INTO wp_t_schema_migrations (version) VALUES ('20140831002425')
Aug 31 09:35:46 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:35:46 [info] SELECT version FROM wp_t_schema_migrations
Aug 31 09:35:46 [info] SELECT version FROM wp_t_schema_migrations
16 changes: 16 additions & 0 deletions db/migrations/wp_testing/20140831002425_CreateTestsTable.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

class CreateTestsTable extends Ruckusing_Migration_Base
{
public function up()
{
$t = $this->create_table(WPT_DB_PREFIX . 'tests');
$t->column('title', 'string');
$t->finish();
}

public function down()
{
$this->drop_table(WPT_DB_PREFIX . 'tests');
}
}
Loading

0 comments on commit 527c3cb

Please sign in to comment.