Download the PHP package vphantom/nanosurvey without Composer

On this page you can find all versions of the php package vphantom/nanosurvey. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package nanosurvey

nanosurvey

[license]() [GitHub release]()

Barebones PHP survey framework with zero client and server side dependencies.

Multi-page, branching survey framework that doesn't require JavaScript nor cookies client-side, and also doesn't need sessions or an SQL back-end server-side.

At each page, hidden form variables persist answers previously given, until the form is completed where results are saved sequentially in a plain CSV file.

See the included example pages and the NanoSurvey class' documentation below for usage.

Installation

You can just include NanoSurvey.php directly in your project or use Composer:

Usage

Instantiate the NanoSurvey class, which will process $_REQUEST's a, p and x CGI variables to situate itself. Invoke page() to display the current page inside a <form> block.

class NanoSurvey

NanoSurvey class

public function __construct($filename, $savePartial = false)

Initialize a survey

The first CSV column is the timestamp when the responses are saved, the rest are each response in order.

If $savePartial is set true, each time a participant submits a page, a new CSV line is appended with all answers obtained so far. In this mode, 2 extra columns are prepended after the timestamp: a unique participant ID and a page number. This makes it easy to keep only the most complete response from each participant, including those who did not reach the end of the survey.

If $savePartial is omitted or false, only complete surveys will be saved.

Parameters:

public function previousAnswer($id)

Get previous answer, if one was given

Answers count from 1, radios share the same ID, other types increment it each time.

The safest way to refer to a previous page's answer is to build those pages first and view their HTML source client-side.

Parameters:

Returns: mixed — Contents of answer

public function progressVars()

Save current progress in hidden FORM variables

Returns: string — HTML with hidden inputs

public function newQuestion($type = 'normal')

Begin a new question

Initializes internal data. Every question MUST start with a call to this function.

Parameters:

Returns: void

public function endQuestion()

End current question

Finalizes internal data. Every question MUST end with a call to this function.

Returns: void

public function radioCheckbox($value, $default = false)

Radio (one of many) checkbox

Parameters:

Returns: string — HTML checkbox

public function checkbox($value)

Checkbox (multiple possible)

Parameters:

Returns: string — HTML checkbox

public function textbox($placeholder = "please specify", $size = 0)

Single line text input box

Parameters:

Returns: string — HTML input box

public function beginSelectOne()

Select one within many

Differs from radio buttons in that a single drop-down is displayed.

Returns: string — HTML select initialization

public function endSelectOne($first, $last)

Close select one within many

If optional arguments $first and $last are specified, numeric options are automatically created and appended for each possibility. You may still wish to create one "none selected" option with an empty value if you'd like before calling this.

Parameters:

Returns: string — HTML select finalization

public function placeholder()

Placeholder answer

When only a specific question or answer choice should be skipped conditionally, instead of an entire page, display these placeholders where the skipped answers would've been. This preserves the integrity of the answer count at all times.

Returns: string — HTML hidden input

public function submitButton($label = "Continue")

Create submit button for next page

Parameters:

Returns: string — HTML

public function page()

Display the current/next page

Pages are expected to be sequential, from "page-0.inc", "page-1.inc", etc. until the final page which invokes endSurvey().

Variable $survey is available in these pages, representing $this instance of NanoSurvey.

Returns: string — HTML of the page

public function skipPage()

Skip the current page, display next one instead

If, in a page, you assess that it should be skipped (i.e. based on prior answers), call this method.

Returns: void

public function endSurvey()

Terminate survey, saving to CSV if necessary

Returns: void

MIT License

MIT License

Copyright (c) 2017 Stéphane Lavergne https://github.com/vphantom

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


All versions of nanosurvey with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5
ext-mcrypt Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package vphantom/nanosurvey contains the following files

Loading the files please wait ....