- Posts: 2
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
give variable to css/ show random video and know order
- lolas7
- Topic Author
- Offline
- New Member
Less
More
3 years 9 months ago - 3 years 9 months ago #202506
by lolas7
give variable to css/ show random video and know order was created by lolas7
I want to show videos in a random order and ask questions about those afterwards. I know I can make the videos random with the Randomised Group but then I don't know later on in which order they were and can't know which video the questions where answered about.
I tried to fix it with a java script that randomly chooses a video to show based on a random number an equation question gives me. I want to give a path to the random chosen video to the css to show in my text question but I don't know how.
I have tried this:
$(this.val(videoname1);
});
</script>
<div class="ckeditor-html5-video" style="text-align: center;">
<video controls="controls" src="{videoname1}" width="450"> </video>
</div>
and this:
$('#question{QID} input[type="text"]'.val(videoname1);
});
</script>
<div class="ckeditor-html5-video" style="text-align: center;">
<video controls="controls" src="{videoname1}" width="450"> </video>
</div>
I tried to fix it with a java script that randomly chooses a video to show based on a random number an equation question gives me. I want to give a path to the random chosen video to the css to show in my text question but I don't know how.
I have tried this:
$(this.val(videoname1);
});
</script>
<div class="ckeditor-html5-video" style="text-align: center;">
<video controls="controls" src="{videoname1}" width="450"> </video>
</div>
and this:
$('#question{QID} input[type="text"]'.val(videoname1);
});
</script>
<div class="ckeditor-html5-video" style="text-align: center;">
<video controls="controls" src="{videoname1}" width="450"> </video>
</div>
Last edit: 3 years 9 months ago by lolas7.
The topic has been locked.
- Joffm
- Away
- LimeSurvey Community Team
Less
More
- Posts: 12932
- Thank you received: 3978
3 years 9 months ago #202509
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic give variable to css/ show random video and know order
Hi,
so you want to show the videos first and afterwards ask questions to them?
Otherwise it would be sufficient to have groups with video and following question with the same randomization name.
Well, add a hidden question of type equation to each video group , like "order1", "order2", ...
In the question text of "order1", "order2" you only have
{Q1.gseq} with Q1 the question of the first video,
{Q2.gseq} with Q2 the question of the second video
...
At the end you see for each video the order.
Remember, groups start counting at "0", and all groups of the survey are taken into account.
Joffm
so you want to show the videos first and afterwards ask questions to them?
Otherwise it would be sufficient to have groups with video and following question with the same randomization name.
Well, add a hidden question of type equation to each video group , like "order1", "order2", ...
In the question text of "order1", "order2" you only have
{Q1.gseq} with Q1 the question of the first video,
{Q2.gseq} with Q2 the question of the second video
...
At the end you see for each video the order.
Remember, groups start counting at "0", and all groups of the survey are taken into account.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: lolas7
The topic has been locked.
- lolas7
- Topic Author
- Offline
- New Member
Less
More
- Posts: 2
- Thank you received: 0
3 years 9 months ago - 3 years 9 months ago #202514
by lolas7
Replied by lolas7 on topic give variable to css/ show random video and know order
Thank you, that's working
Last edit: 3 years 9 months ago by lolas7.
The topic has been locked.