How can I add questions about demographics once in Crowdflower? - crowdflower

Hi,
I am creating a Crowdflower task but I am having some problems.
Contributors need to describe the image that they see with one or two words. I also need additional information, such as gender, age and education. I added these questions but these comes with every displayed image. So the contributor needs to answer this 10 times, but he/she only needs to answer this once. How can I change this?
Thanks! Hope someone can help me.

After trying a lot, I couldn't find a better solution than asking the contributor for the demographic data once per assignment and give him/her the option to skip the form if already filled.
The code for this looks as follows:
CML
<cml:group class="demographics" label="Demographics">
<p>Please give us some demographic background of you.</p>
<cml:checkbox label="I already submitted this data successfully" name="demographics_filled" />
<cml:group only-if="!demographics_filled">
<!-- TODO: Costomize the content of this groups as needed -->
<!-- Don't include these questions in the test questions! -->
<cml:text label="Mother tongue" gold="false" validates="required"></cml:text>
<cml:radios label="Gender" gold="false" validates="required">
<cml:radio label="Male" value="male"></cml:radio>
<cml:radio label="Female" value="female"></cml:radio>
</cml:radios>
</cml:group>
<hr />
</cml:group>
<!-- TODO: here goes the actual task -->
<cml:text label="Enter {{id}}:" validates="required"></cml:text>
JavaScript
require( [ "jquery-noconflict" ], function($) {
$('.demographics').hide();
$('.demographics').first().show();
});

Related

html/liquid <label> not working in a form, can't figure out why

I'm completely new to liquid and almost completely new to HTML so I expect this to be an easy one.
I have a shopify website I'm editing for a friend; his delivery capability is limited so he wants to find out roughly where customers are before their account is fully registered.
So, as per some online tutorials (which I admit looked slightly different) I added an extra field into the customers/register.liquid template asking for location.
<div id = "location" class="clearfix large form"
<label for="custloc_check" class="login">Delivery</label>
<input
type="text"
id="custloc_check"
name="customer[note][Location]"
placeholder="Please indicate rough delivery location"
/>
</div>
I can't actually see anything wrong with it, but the line beginning <label is all red (where elsewhere on the form the label lines are in varying colours) so that would indicate that's where the problem is? And of course there's no evidence whatsoever of it in the form on the website.
Expect it's a really basic error, but any help much appreciated, thank you!!

How to deliver data to other page in Framework7?

How to deliver the data to the detail page ?
You see the below demo I write, I am studying Framework7, but I am puzzle about to deliver data to the detail page.
Such as I click the first item, I want to deliver the index = 0 to the detail page, if I click the second item, I want to deliver index = 1 to the detail page.
My code is below:
<ul>
<li class="item-content">
<div class="item-media"><img src="http://up.qqjia.com/z/25/tu32695_9.jpg" width="44"></div>
<div class="item-inner">
<div class="item-title-row">
<div class="item-title">Daniel</div>
</div>
<div class="item-subtitle">CEO</div>
</div>
</li>
...
</ul>
You see,I goto the about page is use <a> label, so, How can I deliver the index number, and so I can dynamic set the about page's data.
If there get a demo, maybe that explain more detail.
I opted for an easier way.
Set the data attribute on the 'a' tag:
<a href="#nextpage" data-myfieldname="myfieldvalue">
Then retrieve the data from the Javascript's click event handler:
mydata = $(this).data('myfieldname');
My friend, please use Template7, Framework7 already support what you are asking for, check "Pass Custom Context" section in Template7 documentation page:
http://framework7.io/docs/template7-pages.html#pass-custom-context
It is very simple and the documentation covers all the scenarios, more info and demos here:
http://idangero.us/template7/
EDIT
As some links are dead, referring to new links:
http://framework7.io/docs/template7.html
you can use localstorage concept. When the user click the particular list item like below
save localstorage :
localStorage.setItem("listitem", "1");
get localstorage :
alert(localStorage.listeitem)

Generate different pages on the basis of different contents

Let me assume that I have the following architecture
_components (folders)
x1.html
x2.html
x3.html
I have a first page where I got the information from the YAM section for every component.
At this point I would like to add a link for every component to another page where I will display the component in a bigger manner.
So, let me assume I have, in the first page :
<div class="col-md-1">
<span id= "logos" class="material-icons"></span>
</div>
and In the componentbig.html I would like to open the right component on the basis of the link.
Do you have any suggestions for me ?
If I understand You correctly, then collections might be the feature You are looking for. For example, I'm usually using collections to generate a list of products and then have a specific page for each product also. Also make sure You check the easy tutorial by Ben Balter.

Simple html5 voting system

Some time ago I created a simple Cocoa (OSX) app with 5 buttons allowing the user to vote for one of 5 options. When a button is clicked, the app gives some feedback about what button is clicked, thanks the user for his/her vote and goes back to the initial state to allow for the next voter. The votes were written to a simple text file to be retrieved after all the votes were cast. Very simple but OK for its purposes (a fancy way to vote for a class representative at my daughters school).
Now I'm asked to develop the same system for a web browser using html5. The school wants the setup to run on more than one computer at the same time. So we have a local server and two or three computers connected to it. The data from the votes needs to be written to the server.
Can someone point me in the right direction of an example that already does this? I found some voting systems but they all work with radio buttons or checkboxes, I need 5 large graphics (animated if possible) on an (also animated) background. I assume it's all very simple to the seasoned HTML5 editor, but I'm a beginner.
Okay, you mentioned you are a 'beginner' (FYI, I'm not a professional developer either), but I assume you know what forms are and how they work. The below is super-simple, I won't even use AJAX. (Explanation in comments.)
The code is going to be in one file. You mentioned PHP, so I assume you can use that. It's what I am using below:
<?
if (isset($_POST['vote'])) { // Check if there is a vote POSTed to our page
// Store the vote. I don't know how you did it the previous time, I'm just going to write it to a text file
$file = fopen("votes.txt", "w");
fwrite($file, $_POST['vote']);
fclose($file);
}
?>
<!-- the voting page -->
<HTML>
<HEAD>
<title>Vote</title>
</HEAD>
<BODY>
<!-- Create a form to be able to send the vote to the server in the simplest way, but don't display it -->
<form action="thispage.html" method="post" style="display:none;">
<!-- I don't know what possible values there are. I'll just take 'foo' and 'bar'. Of course you can add more. -->
<input type="radio" name="vote" value="foo" />
<input type="radio" name="vote" value="bar" />
</form>
<!-- The images representing the (invisible) radio button -->
<!-- I use the data-value attribute to store to which radio button this image corresponds -->
<img src="path/to/foo/image" data-value="foo" />Vote FOO<br />
<img src="path/to/bar/image" data-value="bar" />Vote BAR<br />
<!-- Import jQuery for the sake of simplicity. -->
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<!-- The trickiest part. The script. -->
<script>
$("img").click(function() {
var value = $(this).data('value'); // Get the value
$("input[value='" + value + "']").click();// Click the corresponding radio button
$("form").submit(); // Submit the form.
});
</script>
</BODY>
</HTML>
NOT TESTED.

post html form fields to google map and get back result page

I'm not an expert but i know a little about HTML forms, here is my problem
i want to create a simple html page with form for my customers to enter a gps values to maps.google.com and get back the result page embedded in the same html
here is the exact format of my string
as an example : 32 06 12.66N, 20 12 22.65E notes that there is spaces between values
that should be post to ( maps.google.com/?q=32 06 12.66N, 20 12 22.65E ) and take the result page and embed it back in the same html page
i want to create a from with separated input fields for every value (drop down menu for the "N" "W" and "S" "E")
would you plz tell me what is exactly the html code for that , appreciate any help guys
You'll need to combine multiple elements into one form element. Use a hidden and some javascript to populate it before submitting.
Something along these lines
<form id="myForm" method="post" action="http://maps.google.com">
<input id="q" type="hidden" name="q" />
<!-- all your other inputs -->
</form>
Then some javascript:
<script type="text/javascript">
function Bind()
{
// bind FillQ to the submit event of the form
}
function FillQ()
{
var q = document.getElementById("q");
q.value = ... // the combination of your other form fields
}
Bind();
</script>
You need to do some scripting to achieve this. Either server side or client side. Consider either hiring someone out or doing some research and learning some coding. I'd recommend your local junior college, or a free online web programming course.
If you have a specific problem with your implementation, post your question here and we will be happy to help, don't expect us to do all the work for you though ;)
Here are some hints to get you started:
Use javascript to collect the drop down fields, and create the google maps url string.
You can search google maps developer site to find code on embending this into your page.