Drupal 7 custom voting solution - drupal-7

I need to create a voting system which will essentially consist of several forms each with a list of radio buttons, of which a single choice can be made. Submission of the form loads the next one, this will go on for about 10 pages, before finally sending the user to a generic data capture form where they will submit their credentials for inclusion in a prize draw.
Several approaches spring to mind:
Create a clone of the core poll module and modify it to achieve the required functionality
Modify the drupal quiz module to allow anonymous recording of votes (the fact that it doesn't is the only thing stopping me approaching it this way, it works almost exactly as I want it to otherwise)
Create something completely custom using the webform module.
I just wondered if anyone had come across this same problem/dilemma and could share any knowledge???

Can you accomplish this with a multi-page webform? You can build the webform by adding a "select options" field, followed by a "page break", then another "select options" field, and another "page break", etc, etc.
You can limit the select options field to 1 answer. Then when you want to gather their information, just add simple text fields at the end.

Related

Create a from builder using Django

I am fairly new to programming and start my career with Python Django. I already build some basic application and recently came across to use google forms and decided to create application like this.
Where any user can come to certain page and can able to create his own form as per his requirement.
I though of some new features like drag and drop. I wanted to ask if that's somehow possible to drag drop input fields or something like that using Django template system where I can use some simple JS library or if its possible using React as fronted.
So my requirements are quite simple, but I am confused with Django models that what will be the structure of models.
UI should be drag n drop thing. User can select the list of fields available in the inventory. And create his own form.
And on post submission. From django you need to capture and store the data.
Here in this case the data will be the form fields as well as its values.
Ex form fields which are available in the inventory.
Test field
Email Field
Multi select field and
Drop Down Field=
I hope someone can help me so that I can get started and came up with some methodology.

Temporary Database for Form Recovery in a Multi Step Form

I'm an api developer who works at a company looking to move from a large CMS to a React web front end framework.
I've been given a new requirement that all multi page forms on our website should be restartable going forward and I have to solution design something for this.
Lets take the following example...
Form 1 - Select your product
Form 2 - Enter your details
Form 3 - Enter Payment details
The way I see it working is that the the first field on the form would be your email address. From there one for every next button click in the multi step form (i.e. after submission of each step) I'm thinking maybe the form fields get added to the session and maybe on session timeout if the form has not been submitted an api is called to persist those bits of the form that have already been submitted into DynamoDB using email address as an identifier.
That means if I had an incomplete form and come back, when I enter me email address it might be able to pick up my persisted data from DynamoDB.
I'd like to get some thoughts on this solution from the Reactjs developers. And if this has been done previously by others I'd love to hear your ideas on alternatives.
thanks

Database search field database

I'm looking for a way to create a search box in wordpress, where visitors can search a number from the database. Is this possible? I have several package numbers in my database. I want to give my visitors the ability to search for their package number and request the information that comes with the number.
What you want to do can be done.
I suggest a different approach than using wp-exec. (I just looked at wp-exec website, and that plugin was created for WordPress 1.5, which means it hasn't been updated in about 5 years).
The content you want to display exists entirely outside of WordPress. I suggest you use a custom page template - see
http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates
In this case you would not use WordPress posts or pages or custom post types. On the custom page template you would write (or have written if you don't have the knowhow to do it yourself) PHP code to extract the info from the database and display it on a page.
For pages like that you would be using WordPress only as a container within which to display the results - they custom page would appear in the site Nav, The page of results would use the site's theme to display so it looks like the rest of the site.
But the code to display from the database would not use the WordPress loop. It would be PHP / MySQL data retrieval and display code.
I really doubt you will find a plugin that lets you display results from an external database, formatted the way you want them to appear. The reason is every external database is different, has different tables and table structures. And no two sites will want the external data visually displayed in the same way. So there is little generalization to encapsulate in a plugin as everyone wants it different.
I've created pages on some sites along the lines of what you want to do thus I know it can be done. But it requires writing custom code.

Best way to implement custom search form

Firstly, I am a Drupal newbie and am still alien to many of Drupal's core concepts. My questions probably seem lame but .... I am trying my best.
I want to implement a custom search form like in the picture attached.
Hotel, flight, etc. are taxonomy terms.
Depending on the taxonomy term selected, the parameters below will also change, like in the picture below:
I came across Drupal Search API. I saw the Munich DrupalCon screencast on search api.
http://www.youtube.com/watch?v=rArRwp_1h8Q
From what I have seen so far, I am not sure whether this can be implemented using Search API.
I know this can be implemted using Forms API (I will create the form manually).
I want to know which way will be faster, Forms API or Search API.
I am using : Drupal 7.26
A simple way is to build a regular view with exposed filters.
To add and configure a views exposed filter:
Go to your views edit page.
Create the filter criteria that we want our users to be able to control, by clicking the "Add" button, in the filter criteria box.
Choose the fields that you want your users to be able to filter through them and click "Add".
In Configure filter criterion, check the option Expose this filter to visitors, to allow them to change it.
Configure the rest of the settings to your liking and click "Next".
After saving the view, this filter should be exposed to your users and they are able to search your view.
For a demo with screenshots; Check this tutorial.

Drupal 7: Add duplicates for form fields on the fly

I've got a form that's being generated using the Form API. There is a fieldset that contains several text fields. What I need to do is have a link or button that a user clicks if they want to add a duplicate of that fieldset to the form so they can add another set of similar information to the form. This is to essentially allow them to add multiple records without having to add each record individually. Is there a good way to go about adding this kind of functionality using the Forms API in Drupal 7?
There's a good example of this in the examples module package:
http://api.drupal.org/api/examples/ajax_example%21ajax_example_graceful_degradation.inc/function/ajax_example_add_more/7
It's a little complex, but that is very well documented, so you should be able to follow along.
You'll want to look at the entire ajax_example module (part of http://drupal.org/project/examples) for the relevant menu callbacks as well.

Resources