test quiz

<div class=”x-quizzes-list-widget” data-limit=”10″ data-stream=”latest”></div>

<script>
(function(){
var objectName = ‘quizcacticoorg-quizzesWidget’;
window[objectName] = {
showQuizzesList: function (container) {
var containerId = ‘quizWidget-‘ + (new Date()).getTime();
container.setAttribute(‘id’, containerId);
container.innerHTML = ‘<iframe style=”width:100%;” src=”http://quiz.cactico.org/quizzes-iframe?elm=’ + encodeURIComponent(‘#’ + containerId) + ‘&limit=’ + container.getAttribute(‘data-limit’) + ‘&stream=’ + container.getAttribute(‘data-stream’) + ‘” frameborder=”0″></iframe>’;
window.addEventListener(‘message’, function(e){
var data = e.data;
try{
data = JSON.parse(data);
if(data.type == “quizzes-iframe-height-change”) {
var containerElement = document.querySelector(data.element);
var iframe = containerElement.children[0];
iframe.style.height = parseInt(data.height) + “px”;
}
} catch (ex){
console.log(ex.message);
}
});
}
};
var widgets = document.querySelectorAll(‘.x-quizzes-list-widget’);
for(var i = 0; i < widgets.length; i++){
window[objectName].showQuizzesList(widgets[i]);
}
})();
</script>