displaying poll data on ExpressionEngine site - module

I'm using the eeHarbor polls module and need help with the following:
As the code is currently configured, the poll question displays on my homepage. If the user either selects an option and casts a vote, or clicks on the "view results" option, the results are then displayed within the same area on the homepage (replacing the poll questions and options).
I would like to have the results (either after a vote is cast or after the user selects "view results") displayed on a different page, where I can add related content. Does anyone know how I may edit the poll module's parameters to make this happen?
Also, the poll module creates all new polls with 2 possible voting options/answers. There is a link to click that should allow the admin to "add options" or "add other option" but clicking this link doesn't dork, leaving me with only 2 options for every poll.
I have uninstalled and reinstalled the module with no change.
Any ideas why this is happening and how it may be resolved?

Check the FAQ page here: http://eeharbor.com/polls/faq
Can I change the return URL for a given poll?
Yes, as of version 1.4 you can add a hidden form element with the name of "return_url" to specify the url you would like a user to be sent to after submitting a poll.
<input type="hidden" name="return_url" value="" />

Related

Make The Different Register Page Url Stable and Get Rid of Double Click Logout On Woocommerce

I am using one of the woodmart built-in themes and have 2 issues (I think they are so easy to do but couldn’t find any solution on internet which works well) one is about register page link on the sidebar login are and the logout confirmation.
When you go to our website which is http://www.fitovision.com and click on Login/Register button on the right top of the page a sidebar widget comes out. I have changed the Create An Account link to my custom page but because I did this on the integration page of woocommerce to the theme, when I get any update it goes back. So looking for a hook or function codes to add to the child theme functions page to keep it there forever even if I get any update. Could you please tell me how to do that? I have asked this to the theme editors support page but they said it belongs to woocommerce so asked me to open a ticket here.
Second one is when you login to the page we have an dropdown menu on the top on the place of Login/Register link. And there is Log Out link on the at dropdown menu. When I click it it goes to My Account page and when I click there again it logs out. I have read and applied too many ways to bypass the logout confirmation on first click but none of them worked as I realised that they were all old dated posts. So I thought after some time and your updates it should be forced by the wocoommerce to do it. But my clients definitely do not want it. Is there again anything else I can do for that to log out on the first click? And keep it there with adding to the child theme functions page?
Thank you for replies instead.
Emre GOKTEPE

Prevent browser caching form values in .NET Core 2.2

ASP.net Core 2.2 MVC Web Application
I have a number of forms where I do NOT want the browser to cache/show any previous entered data when the user return to the page. I want the elements/form to NOT cache any information. I do not simply want the browser not to show previously entered information, I want it not to be cached for security reasons.
I tried decorating the controller method with:
[ResponseCache(NoStore = true, Location = ResponseCacheLocation.None)]
to no avail, when I again navigate to the page/form and start typing, previously entered values keep showing up as autocomplete options.
I've tried playing with every nuance of this as well:
Response Caching Middleware in ASP.NET Core
How is this done for all browsers nowadays?
Sounds like it is caused by the autocompletion feature of browser:
By default, browsers remember information that the user submits through fields on websites. This enables the browser to offer autocompletion (that is, suggest possible completions for fields that the user has started typing in) or autofill (that is, pre-populate certain fields upon load).
To disable this feature for a form:
<form autocomplete="off">
...
</form>
Or disable a field :
<input ... autocomplete="off">
Here's a detailed explanation on off
The "off" keyword indicates either that the control’s input data is particularly sensitive (for example the activation code for a nuclear weapon); or that it is a value that will never be reused (for example a one-time-key for a bank login) and the user will therefore have to explicitly enter the data each time, instead of being able to rely on the user agent to prefill the value for him; or that the document provides its own autocomplete mechanism and does not want the user agent to provide autocompletion values.
For more details, see how to disable autocompletion on MDN and w3c.org
Hope it helps.
You can use autocomplete="off" for html elements but chrome prevent this for some names like "name", "address" etc.
This topic was discussed earlier. Chrome ignores autocomplete="off"

Mechanical Turk externalquestion error when submitting hit

I have managed to create a HIT with an external question that calls an html file hosted in an S3 server. I have worked in the sandbox environment. When I create the hit, I get the following error when I try to submit the hit as a worker:
There was a problem submitting your results for this HIT.
This HIT is still assigned to you. To try this HIT again, click "HITs Assigned To You" in the navigation bar, then click "Continue work on this HIT" for the HIT. If this problem persists, you can contact the Requester for this HIT using the "Contact" link above.
To return this HIT and continue working on other HITs, click the "Return HIT" button.
I have already read multiple forums trying to figure out the problem. When I check out the source in the developer tools, it seems to have all the necessary parameters set:
</style><iframe height="400" scrolling="auto" frameborder="0" align="center" src="https://BUCKET.s3.amazonaws.com/index.html?assignmentId=34J10VATJGBKANG4MDCHRA6ME53QIH&hitId=3N2YPY1GI6BYD6C5MRBYOYBJJSEEVE&workerId=A1YJU5SNGQQP00&turkSubmitTo=https%3A%2F%2Fworkersandbox.mturk.com" name="ExternalQuestionIFrame"></iframe>
Also, I made sure I don't have any button named 'submit'. Any ideas of how I could debug this thing?
The issue here is usually that you're not submitting the appropriate information back to MTurk. You need to send the assignmentId parameter in addition to at least one other named field. I often just add a &foo=bar (or similar) to the end of the submit URL. So you should be submitting to something like:
https://workersandbox.mturk.com/mturk/externalSubmit?assignmentId=34J10VATJGBKANG4MDCHRA6ME53QIH&foo=bar
That's for the sandbox. For the live server, switch the base URL to https://www.mturk.com.
Amazon MT HITs seems to be printing a generic error message for a wide range of issues. This causes the problem to be particularity hard to debug.
For me, the error occurred since I was not assigning "name" attribute to my input elements in the form.
You must include the HTML name attribute in the input field definition. Make your name attributes descriptive because they are used as the column headings in the Results table.
If you are using the GUI to build and deploy your tasks, I recommend giving this document a good read and see if you have missed something.
MT Requestor UI guide
Hope this helps.

Amazon Mechanical Turk submit button not working

The following is a snippet of a survey I would like to do on Amazon Mechanical Turk.
${offer_text1} : ${offer_text2}
I'm aware of the product
I'm NOT aware of the product
1
2
3
It shows up as two radio buttons to choose from and a drop down to choose a value from.
I used a survey template. However, when I actually tried publishing it, a "submit" button
showed up in the survey (notice I have not inserted it here) and the golden "submit hit" button from amazon is greyed out. Am I missing something obvious?
Do I need to call GET/POST somewhere to post the results to amazon. Per the documentation, mturk should automatically get it for me. (I could be wrong here).
Any help much appreciated.
The MTurk Requester User Interface automatically wraps everything in a set of <form></form> tags. Undoubtedly, you've put an additional set of such tags nested in the HIT as well, which then causes the HIT to fail (i.e., to gray-out the submit button and make it impossible to submit).

How to detect if user has switched Rails 3

A user logs into my application in a tab in a browser
They get an email and click a link which opens a new tab in the same browser and logs them in under a different email say.
If they go back to the first tab they are no longer the same user and I want the page to automatically detect this and then reload or redirect them if they are unauthorized to view the page.
Anyway to do this?
Or, if you really want to know when user is switched the tab, try this library:
visibility.js
As stated by #Hck:
add javascript code to reload page periodically (for example once per 30 seconds) – Hck
JavaScript is pretty much the only way to make pages do stuff after they're loaded. Note that in pretty much any user authentication system, a given browser will only be logged in as one user at a time, so as soon as the second tab opens, that browser will be acting as the second user - they can still see the current content of the first tab, but links (for instance) will no longer work unless the second user was also authorized to use them.
There are some JQuery plugins that do this sort of thing, like PeriodicalUpdater, or you can write your own (an example).