Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: Saving to LS, but submitting to an external site

Re: Saving to LS, but submitting to an external site 2 Jahre 4 Monate her #79739

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 6334
  • Dank erhalten: 818
  • Karma: 243
hrshdhgd schrieb:
and it is in 'startpage.pstpl'
Think it's best to put it directly in group description.

First:
- remove all hide function
- With the real question number, test with:
$('#question13732 input.text').val(workerId);
$('#question13733 input.text').val(assignmentId);
$('#question13734 input.text').val(hitId);

If it don't work, test with:
$('#question13732 input.text').val("TEST");
$('#question13733 input.text').val("TESTassignmentId");
$('#question13734 input.text').val("TESThitId");

Denis
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Saving to LS, but submitting to an external site 2 Jahre 4 Monate her #79743

  • hrshdhgd
  • hrshdhgds Avatar
  • OFFLINE
  • Junior Lime
  • Beiträge: 29
  • Karma: 0
I tried both codes. No difference noticed. I have attached a screenshot of my database. Nothing gets populated in the three fields for the IDs using both codes.
Thanks,
H.
Anhang:
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Saving to LS, but submitting to an external site 2 Jahre 4 Monate her #79781

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 6334
  • Dank erhalten: 818
  • Karma: 243
There are some problem with your javascript then.

It's very difficult to help you without an access on the server.

You can see the real id for inout with Firebug for example.

Denis
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Saving to LS, but submitting to an external site 2 Jahre 4 Monate her #79805

  • hrshdhgd
  • hrshdhgds Avatar
  • OFFLINE
  • Junior Lime
  • Beiträge: 29
  • Karma: 0
I have sent you a private message with the details to access the survey. Hope it helps,

Thanks,
H.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Saving to LS, but submitting to an external site 2 Jahre 4 Monate her #79815

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 6334
  • Dank erhalten: 818
  • Karma: 243
Hello,

You use "allways hide this question", don't use it: the answer aren't in DOM if this question is hidden like that.

Denis
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Saving to LS, but submitting to an external site 2 Jahre 4 Monate her #79816

  • hrshdhgd
  • hrshdhgds Avatar
  • OFFLINE
  • Junior Lime
  • Beiträge: 29
  • Karma: 0
Ok. So what should I do next?

I was asked to save the info (Ids) into a hidden question (if you refer the thread) and I thought thats how it should be done! Is there anything I am missing?

Thanks,
H.
Letzte Änderung: 2 Jahre 4 Monate her von hrshdhgd.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Saving to LS, but submitting to an external site 2 Jahre 4 Monate her #79817

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 6334
  • Dank erhalten: 818
  • Karma: 243
hrshdhgd schrieb:
Ok. So what should I do next?
Did it work ? If you show the answer, you see the answer filled ?

If yes, i think you can hide the question with relevance to 0. But you hide oit to in javascript with $("#question100").hide();
The question are hide in CSS not in HTML source, the javascript can access it.
I was asked to save the info (Ids) into a hidden question (if you refer the thread)
Saving to LS, but submitting to an external site ;) and there are more than one solution in the topic :).
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Saving to LS, but submitting to an external site 2 Jahre 4 Monate her #79819

  • hrshdhgd
  • hrshdhgds Avatar
  • OFFLINE
  • Junior Lime
  • Beiträge: 29
  • Karma: 0
Did it work ? If you show the answer, you see the answer filled ?

Nope, unfortunately that did not work! I tried both:
$('input#answer78151X412X13732').val(workerId);
and
$('#question13732 input.text').val(workerId);

by making the questions visible, neither of them worked.


Any other suggestions?

Thanks,
H
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Saving to LS, but submitting to an external site 2 Jahre 4 Monate her #79841

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 6334
  • Dank erhalten: 818
  • Karma: 243
Hello,

Remove all script from startpage.pstpl or endpage.pstpl.

Put the script in template.js.
function getURLParameter(name) {
    return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null;
}
 
 
$(document).ready(function(){
  var assignmentId = getURLParameter('assignmentId');
  var hitId = getURLParameter('hitId');
  var workerId = getURLParameter('workerId');
 
  $('#question13732 input.text').val(workerId);
  $('#question13733 input.text').val(assignmentId);
  $('#question13734 input.text').val(hitId);	
});

tested and working for me.

Denis
Letzte Änderung: 2 Jahre 4 Monate her von DenisChenu.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Saving to LS, but submitting to an external site 2 Jahre 4 Monate her #79845

  • hrshdhgd
  • hrshdhgds Avatar
  • OFFLINE
  • Junior Lime
  • Beiträge: 29
  • Karma: 0
Remove all script from startpage.pstpl or endpage.pstpl.

Put the script in template.js.
function getURLParameter(name) {
    return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null;
}
 
 
$(document).ready(function(){
  var assignmentId = getURLParameter('assignmentId');
  var hitId = getURLParameter('hitId');
  var workerId = getURLParameter('workerId');
 
  $('#question13732 input.text').val(workerId);
  $('#question13733 input.text').val(assignmentId);
  $('#question13734 input.text').val(hitId);	
});

tested and working for me.

Denis
I did exactly as you instructed, deactivated and reactivated both Amazon Mechanical Turk and LimeSurvey. It still does not show as answers to the questions (which are visible) and the responses in the database is blank. I really appreciate all your patience and help so far but I still don't understand why is it not working for me.

Thanks,
H
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Moderatoren: ITEd
Ladezeit der Seite: 0.199 Sekunden
Donation Image