I found a very werid and headache issue in V3.25.4.
That is, once I opened the questions (in English version)which have iframe videos, even if I didn't change anything and just click 'save'. All codes inserted before changed and can't work porperly.
e.g. the correct code for randomly show video No.2
Code:
<iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" frameborder="0" height="600" src="https://www.youtube.com/embed/{Scene2}?rel=0&amp;autoplay=1" width="1100"></iframe>
Changed into
Code:
{Scene2}?rel=0&autoplay=1" width="1100">
after I click 'save'.
I tried to import these questions again and it works well, as long as I did't edit and save them.
See attached my quetsion groups
But the Dutch version still need to be add so I must edit these questions.
To figure out what's going on. I also tried the 'insert youtube video' button in my editor and add a new video. Once I clicked save. The same issue appeard ( all codes changed and crashed).
Even worse,
Sourcecode in Question'Q0' for generating random numbers also crashed. The original code is,
Code:
<script type="text/javascript" charset="utf-8">
function shuffle(array) {
var currentIndex = array.length, temporaryValue, randomIndex;
// While there remain elements to shuffle...
while (0 !== currentIndex) {
// Pick a remaining element...
randomIndex = Math.floor(Math.random() * currentIndex);
currentIndex -= 1;
// And swap it with the current element.
temporaryValue = array[currentIndex];
array[currentIndex] = array[randomIndex];
array[randomIndex] = temporaryValue;
}
return array;
}
$(document).on('ready pjax:scriptcomplete',function(){
// Fill the array
var arr = [1,2,3,4,5,6,7,8];
arr = shuffle(arr);
anumbers = arr.slice(0,4).join('');
$('#question{QID} input[type="text"]').val(anumbers);
$('#question{QID}').hide();
});
</script>
Now it looks like,
Code:
QID input[type="text"]').val(anumbers); $('#questionQID').hide(); });
I tried to fix it by inserting the correct code again many times. But once I clicked 'save'. it will change into the short and wrong code....
Another survey with exactly the same code works just fine 3 weeks ago. (V3.23.3)
Same PC, same browser, but a higher version of Limesurvey.( V3.25.4.)
I think it is something to do with the Lime editor or iframe update since it never happened before.
I'll be very appriciated if anybody know the answers....
Best,
Yuwen.