diff --git a/app/assets/v2/js/pages/quests.quest.quiz_style.js b/app/assets/v2/js/pages/quests.quest.quiz_style.js
index 74779df2846..230ec83ef63 100644
--- a/app/assets/v2/js/pages/quests.quest.quiz_style.js
+++ b/app/assets/v2/js/pages/quests.quest.quiz_style.js
@@ -56,21 +56,23 @@ var start_quiz = async function() {
var prefix = '(' + question_number + '/' + question_count + ') - ';
var question = prefix + response['question']['question'];
var possible_answers = response['question']['responses'];
- var html = '';
+ var $safe_html = $('
');
for (var i = 0; i < possible_answers.length; i += 1) {
var ele = possible_answers[i]['answer'];
+ var $a = $('').attr('href', '#').text(ele);
+ var $li = $('').attr('class', 'answer').append($a);
- html += '(' + (i + 1) + ') ' + ele + '';
+ $safe_html.append($li);
}
$('#enemy .attack').removeClass('hidden');
setTimeout(function() {
$('#enemy .attack').addClass('hidden');
}, 2000);
$('#enemy').effect('bounce');
- await $('#cta_button a').html('Submit Response 📨');
- await $('#header').html(question);
- await $('#desc').html(html);
+ await $('#cta_button a').text('Submit Response 📨');
+ await $('#header').text(question);
+ await $('#desc').html($safe_html.html());
await $('#header').removeClass('hidden').fadeIn();
await $('#desc').removeClass('hidden').fadeIn();
await $('#cta_button').removeClass('hidden').fadeIn();
@@ -179,13 +181,20 @@ var advance_to_state = async function(new_state) {
typeWriter();
await wait_for_typewriter();
- var reward_html = "
If you're successful in this quest, you'll earn this limited edition " + document.kudos_reward['name'] + " Kudos:
If you're successful in this quest, you'll earn this limited edition ");
+
+ safe_reward.append($('').text(document.kudos_reward['name']));
+ safe_reward.append(' Kudos:
');
+ safe_reward.append($('").attr("style", "height: 250px;width: 220px;').attr('src', document.kudos_reward['img']));
+
if (document.reward_tip['token']) {
- reward_html = "
If you're successful in this quest, you'll earn " + document.reward_tip['token_amount'] + ' ' + document.reward_tip['token'] + '';
+ safe_reward.append("
If you're successful in this quest, you'll earn ");
+ safe_reward.append($('').text(document.reward_tip['token_amount'] + ' ' + document.reward_tip['token']));
}
- $('#desc').html($('#desc').html() + reward_html);
+ $('#desc').html($('#desc').html() + safe_reward.html());
await $('#desc').removeClass('hidden').fadeIn();
await sleep(1000);
@@ -221,15 +230,20 @@ var advance_to_state = async function(new_state) {
await sleep(1000);
await $('#desc').html('');
var text = 'You will be given the following links to prepare for your journey (est read time: ' + document.quest.game_schema.est_read_time_mins + ' mins ).*';
- var html = '';
+ var $safe_html = $('');
var iterate_me = document.quest.game_schema.prep_materials;
for (var i = 0; i < iterate_me.length; i += 1) {
var ele = iterate_me[i];
+ var $a = $('').text(ele.title).attr('href', ele.url);
+ var $li = $('').append($a);
- html += '' + ele.title + '';
+ $safe_html.append($li);
}
- html += '
Take a moment and read through them. You will have limited time to look things up when the quest starts.';
+
+ var safe_html = $safe_html.html();
+
+ safe_html += '
Take a moment and read through them. You will have limited time to look things up when the quest starts.';
document.typewriter_id = 'desc';
document.typewriter_i = 0;
@@ -238,7 +252,7 @@ var advance_to_state = async function(new_state) {
typeWriter();
await $('#desc').removeClass('hidden').fadeIn();
await wait_for_typewriter();
- $('#desc').html($('#desc').html() + html);
+ $('#desc').html($('#desc').html() + safe_html);
await sleep(100);
await $('#cta_button a').html('Got It 🤙');
await $('#cta_button').removeClass('hidden').fadeIn();
@@ -299,9 +313,12 @@ var winner = async function(prize_url) {
start_music_midi('secret-discovery');
if (document.reward_tip['token_amount']) {
- $('#desc').html('' + document.reward_tip['token_amount'] + ' ' + document.reward_tip['token'] + '');
+ $('#desc').html($('').text(document.reward_tip['token_amount'] + ' ' + document.reward_tip['token']));
} else {
- $('#desc').html(span + "