0 votes
in SoSci Survey (English) by s293159 (160 points)

Hi Online Support,

  1. Please I have a couple of questions.
    First I want to implement a survey in which the selection options disappear after a given amount of time. What i have done till now is that given that each question in my questionnaire has an image, to each image a countdown has been added in the php-code to make it disappear. But right now, i will like the selection options to disappear woth the labels included. I tried something but it made the whole page to disappear and there was no possibility anymore to be redirected to the next page. How can it be done please? Or is there a possibility to disable the labeö seöection options? Actually I want that after the time is up, the participant can not have the possibility to answer anymore and has to go to the next page.

  2. I also want to add at conditional statement in such a way that if someone refuses to accept the condition (the condition is for the protection of data), then the particiapant is directed to the end of the survey.

  3. Also, there is an age factor. Is it possible to limit the age within a certain limit? like if someone is less than 18 years old, the person is redirected to the end of the survey.

Thanks in advance.

1 Answer

0 votes
by SoSci Survey (327k points)

the selection options disappear after a given amount of time

The answer depends a bit on what question type you're using. Usually, the browser developer tools are quite helpful to get the HTML ID of the element that you want to hide. As soon as you have the ID or IDs, you can simply run your timers, e.g.

window.setTimeout(function() {
  document.getElementById("AB01_01").style.display = "none";
}, 2000);

This makes sense, if you want to hide single options.

Actually I want that after the time is up, the participant can not have the possibility to answer anymore and has to go to the next page.

Why not simply sending them to the next page automatically?

if someone refuses to accept the condition (the condition is for the protection of data), then the particiapant is directed to the end of the survey.

Sounds like a traditional screenout. You can either add a filter in the question, or use some PHP code to achive that: Obtaining the Participant's Consent

if someone is less than 18 years old, the person is redirected to the end of the survey.

If you ask for the age open-ended, then you'll need a little PHP screenout filter.

by s293159 (160 points)
Thanks very much for the responses. Worked greatly but one did not.

You said "The answer depends a bit on what question type you're using. Usually, the browser developer tools are quite helpful to get the HTML ID of the element that you want to hide. As soon as you have the ID or IDs, you can simply run your timers, e.g." I could not find it though and my question is: is it possible to make the Add/edit section disappear when response items have been entered ? I am using the Type selection.
by SoSci Survey (327k points)
Maybe, you want to give the selection sequence a chance? This will hide the options automatically when selected.

> is it possible to make the Add/edit section disappear

What "Add/edit" section do you mean? In the "selection" type, you usually have only the title and the options?!

If you want, creat and post a pretest URL directly (!) to the respective page.
by s293159 (160 points)
Thanks for your reply. By  "Add/edit" I mean the selection options under the Response options.

Here's the Link: https://www.soscisurvey.de/Humanperceptioneval/?act=gL82IoLi13bpCcCypDoDWNG5

I hope you can understand it better.(PS. I'm still working on it though) So actually there are 3 options given which are to be answered within 10 secs. If this is not the case, just as the image disappears, I will like that all the selection options too disappear or are hidden. The last one is hidden though but someone can still select it and thats not what is wanted. I don't know if it's possible...thanks in advance.
by SoSci Survey (327k points)
The HTML ID that you're lookg for (for the first selection) is "A001_tab". Make this disappear after 3 seconds.

Or - as I wrote - give the selection sequence a try. Or maybe also the assignment task. Both questions types have a time limit included, I think.

And one more thing: Showing German and English at the same time usually confuses respondents. Consider this solution instead: https://www.soscisurvey.de/help/doku.php/en:create:multilang
by s293159 (160 points)
oh thanks. It worked but i'll like it to be done for all pages please. how can i do it please?

also thanks for the selection sequence but my lecturer does not want it like that actually, nevertheless thanks.

Concerning the language, thanks, i did not know. I 'll post my survey later on prolific. Will this be an issue?

Also, let me provide you with the html code i'm using. I will like to do it for my whole questionnaire and not just for one question. Any idea how i could get the HTML IDs automatically or so please?

<script>
    document.addEventListener('DOMContentLoaded', (event) => {
        
        function hideElements() {
            var image = document.getElementById('imageToDisappear');
           // var answers = document.getElementById('questionAnswers'); // Assuming the answers have this ID
           
            var questionContainer = document.getElementById('questionAnswers');
           
            var tabElement = document.getElementById('s2tabs_items_sheet_items_quick');

            if (image) {
                image.style.display = 'none';
            }
            if (answers) {
                answers.style.display = 'none';
            }
            if (questionContainer) {
                questionContainer.style.display = 'none';
            }
        
             if (tabElement) {
                tabElement.style.display = 'none'; // Hide the entire div
            }
        
        }
        // Define countdown after 10 seconds
        setTimeout(hideElements, 11*1000);
        
        window.setTimeout(function() {
  document.getElementById("A001_tab").style.display = "none";
}, 10*1000);
    });
</script>


Thanks in advance.
by SoSci Survey (327k points)
> Any idea how i could get the HTML IDs automatically or so please?

I recommend using placeholders:
https://www.soscisurvey.de/help/doku.php/en:create:placeholders

> I 'll post my survey later on prolific. Will this be an issue?

In my opinion, doubling the reading effort for respondenst will always be an issue.

Willkommen im Online-Support von SoSci Survey.

Hier bekommen Sie schnelle und fundierte Antworten von anderen Projektleitern und direkt von SoSci Survey.

→ Eine Frage stellen


Welcome to the SoSci Survey online support.

Simply ask a question to quickly get answers from other professionals, and directly from SoSci Survey.

→ Ask a Question

...