An English version of Logres: Japanese RPG, the smartphone game with over 8 million downloads in Japan, is being released in five countries! Get a head start by checking out the characters below to find the perfect job for your adventure!
.z-depth-1 {
margin: 0 auto;
width: 150px;
overflow: hidden;
}.quiz-u-img--round {
height: 150px;
display: block;
}.checkbox {
display: block;
float: left;
}#result {
margin: 10px auto;
}.c-social-buttons {
display: inline-block;
}.c-social-buttons ul {
margin-bottom: 0;
text-align: center;
}.c-social-buttons ul li {
display: inline;
margin: 0 1px;
}.c-social-buttons__link {
-webkit-border-radius: 100px;
border-radius: 100px;
color: #fff;
width: 3rem;
line-height: 3rem;
display: inline-block;
-webkit-transition: opacity 0.2s ease;
-moz-transition: opacity 0.2s ease;
-o-transition: opacity 0.2s ease;
-ms-transition: opacity 0.2s ease;
transition: opacity 0.2s ease;
}.c-social-buttons__link:active,
.c-social-buttons__link:focus,
.c-social-buttons__link:hover {
color: #fff;
opacity: 0.7;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";
filter: alpha(opacity=70);
}.c-social-buttons__link[class^='icon-'] {
position: relative;
top: 1px;
vertical-align: middle;
}.c-social-buttons__link--facebook {
background: #3b5998;
}.c-social-buttons__link--twitter {
background: #55acee;
}.c-social-buttons__link--tumblr {
background: #36465d;
}.c-social-buttons__link--pinterest {
background: #cc2127;
}.c-social-buttons__link--google-plus {
background: #cc3732;
}.c-social-buttons__link--reddit {
background: #ff5700;
}.c-social-buttons--lg .c-social-buttons__link {
width: 4.8rem;
line-height: 4.8rem;
}.c-social-buttons--lg .c-social-buttons__link[class^='icon-'] {
font-size: 24px;
font-size: 2.4rem;
}.u-pull-center {
display: block;
margin: 0 auto;
}.col::after {
content: '';
display: block;
height: 1px;
width: 100%;
}
.img--center {
margin-left: auto;
margin-right: auto;
}
.img--responsive {
display: block;
height: auto;
max-width: 100%;
}
.quiz__choice__figure {
position: relative;
margin: 0;
}
.quiz__choice__icon {
background: #fff;
border-radius: 100%;
bottom: 0.25em;
box-shadow: 0 0 0 0.125em #fff;
font-size: 3em;
line-height: 0.875;
opacity: 100%;
position: absolute;
transition: 0.125s linear;
transition-property: opacity transform;
right: 0.25em;
will-change: opacity transform;
transform: scale(1);
}
.quiz__choice__icon--hidden {
opacity: 0;
transform: scale(1.25);
}
section.u-mbm {
margin-top:0;
}
tomQuiz = {"conclusion":"Here’s the job for you! Level up even more and aim for the highest job classes!\n","introduction":"","_id":"592275c5152eaa9d53f3ce9d","button_result":"See the Result!","button_subscribe":"Subscribe!","button_visit":"Play Now!","kind":"assessment","outcomes":[{"body":"","_id":"59227665152eaa9d53f3ce9e","heading":"Fighter","image":{"_id":"59227665152eaa9d53f3ce9f","large":"https://d3ieicw58ybon5.cloudfront.net/resize/800/quizzes/121a02642b1a41bfba93a6db73c422e2.jpg","medium":"https://d3ieicw58ybon5.cloudfront.net/resize/400/quizzes/121a02642b1a41bfba93a6db73c422e2.jpg"}},{"body":"","_id":"59227665152eaa9d53f3cea0","heading":"Knight","image":{"_id":"59227665152eaa9d53f3cea1","large":"https://d3ieicw58ybon5.cloudfront.net/resize/800/quizzes/162648ac124345aca03fb729226810d0.jpg","medium":"https://d3ieicw58ybon5.cloudfront.net/resize/400/quizzes/162648ac124345aca03fb729226810d0.jpg"}},{"body":"","_id":"59227665152eaa9d53f3cea2","heading":"Magician","image":{"_id":"59227665152eaa9d53f3cea3","large":"https://d3ieicw58ybon5.cloudfront.net/resize/800/quizzes/90504cf3d460419ba1cc9b251a5b5859.jpg","medium":"https://d3ieicw58ybon5.cloudfront.net/resize/400/quizzes/90504cf3d460419ba1cc9b251a5b5859.jpg"}},{"body":"","_id":"59227690152eaa9d53f3cea4","heading":"Priest","image":{"_id":"59227690152eaa9d53f3cea5","large":"https://d3ieicw58ybon5.cloudfront.net/resize/800/quizzes/622e5c5d2b02415bbc1bdfc6daef7d16.jpg","medium":"https://d3ieicw58ybon5.cloudfront.net/resize/400/quizzes/622e5c5d2b02415bbc1bdfc6daef7d16.jpg"}},{"body":"","_id":"59227690152eaa9d53f3cea6","heading":"Ranger","image":{"_id":"59227690152eaa9d53f3cea7","large":"https://d3ieicw58ybon5.cloudfront.net/resize/800/quizzes/08437c1e820644ebb2f83b8357cf5f88.jpg","medium":"https://d3ieicw58ybon5.cloudfront.net/resize/400/quizzes/08437c1e820644ebb2f83b8357cf5f88.jpg"}}],"post_prompt":"visit","questions":[{"_id":"5922e9fe152eaa9d53f3cf42","choices":[{"_id":"5922ea34152eaa9d53f3cf43","correct":false,"image":{"_id":"5922ea34152eaa9d53f3cf44","large":"https://d3ieicw58ybon5.cloudfront.net/resize/800/quizzes/b0c19c7845ed4d90b5c6d8788dbef54a.jpg","medium":"https://d3ieicw58ybon5.cloudfront.net/resize/400/quizzes/b0c19c7845ed4d90b5c6d8788dbef54a.jpg"},"outcomeIds":["59227665152eaa9d53f3ce9e"],"text":"Red","weight":0},{"_id":"5922ea34152eaa9d53f3cf45","correct":false,"image":{"_id":"5922ea34152eaa9d53f3cf46","large":"https://d3ieicw58ybon5.cloudfront.net/resize/800/quizzes/dd3aca22e62e47fb81b74a3a80086bb1.jpg","medium":"https://d3ieicw58ybon5.cloudfront.net/resize/400/quizzes/dd3aca22e62e47fb81b74a3a80086bb1.jpg"},"outcomeIds":["59227665152eaa9d53f3cea0"],"text":"Blue","weight":1},{"_id":"5922ea34152eaa9d53f3cf47","correct":false,"image":{"_id":"5922ea34152eaa9d53f3cf48","large":"https://d3ieicw58ybon5.cloudfront.net/resize/800/quizzes/8632edc6ac004b45be9d86e0b548b6c9.jpg","medium":"https://d3ieicw58ybon5.cloudfront.net/resize/400/quizzes/8632edc6ac004b45be9d86e0b548b6c9.jpg"},"outcomeIds":["59227665152eaa9d53f3cea2"],"text":"Purple","weight":2},{"_id":"5922ea34152eaa9d53f3cf49","correct":false,"image":{"_id":"5922ea34152eaa9d53f3cf4a","large":"https://d3ieicw58ybon5.cloudfront.net/resize/800/quizzes/caeb70fbd37c4a40ae4972c9e6d7b38a.jpg","medium":"https://d3ieicw58ybon5.cloudfront.net/resize/400/quizzes/caeb70fbd37c4a40ae4972c9e6d7b38a.jpg"},"outcomeIds":["59227690152eaa9d53f3cea4"],"text":"Pink","weight":3},{"_id":"5922ea34152eaa9d53f3cf4b","correct":false,"image":{"_id":"5922ea34152eaa9d53f3cf4c","large":"https://d3ieicw58ybon5.cloudfront.net/resize/800/quizzes/137aea822d104990bd738307c57f8c12.jpg","medium":"https://d3ieicw58ybon5.cloudfront.net/resize/400/quizzes/137aea822d104990bd738307c57f8c12.jpg"},"outcomeIds":["59227690152eaa9d53f3cea6"],"text":"Green","weight":4}],"selectedChoiceId":null,"text":"What color outfit will you wear when setting out on your adventure?","weight":0},{"_id":"5922d6aa152eaa9d53f3cf14","choices":[{"_id":"5922e013152eaa9d53f3cf33","correct":false,"image":{"_id":"5922e013152eaa9d53f3cf34","large":"https://d3ieicw58ybon5.cloudfront.net/resize/800/quizzes/7a6150bdf4444f6092d691e0895ef63e.jpg","medium":"https://d3ieicw58ybon5.cloudfront.net/resize/400/quizzes/7a6150bdf4444f6092d691e0895ef63e.jpg"},"outcomeIds":["59227665152eaa9d53f3cea0","59227665152eaa9d53f3cea2","59227690152eaa9d53f3cea4"],"text":"Samurai","weight":0},{"_id":"5922e013152eaa9d53f3cf35","correct":false,"image":{"_id":"5922e013152eaa9d53f3cf36","large":"https://d3ieicw58ybon5.cloudfront.net/resize/800/quizzes/e138e4c49b4e44dba671738bf25ccfdc.jpg","medium":"https://d3ieicw58ybon5.cloudfront.net/resize/400/quizzes/e138e4c49b4e44dba671738bf25ccfdc.jpg"},"outcomeIds":["59227665152eaa9d53f3ce9e","59227665152eaa9d53f3cea2","59227690152eaa9d53f3cea6"],"text":"Crusader","weight":1},{"_id":"5922e09e152eaa9d53f3cf37","correct":false,"image":{"_id":"5922e09e152eaa9d53f3cf38","large":"https://d3ieicw58ybon5.cloudfront.net/resize/800/quizzes/e0c3c2aea1a34ff68ab491c872cc878c.jpg","medium":"https://d3ieicw58ybon5.cloudfront.net/resize/400/quizzes/e0c3c2aea1a34ff68ab491c872cc878c.jpg"},"outcomeIds":["59227665152eaa9d53f3ce9e","59227665152eaa9d53f3cea0","59227690152eaa9d53f3cea6"],"text":"Bishop","weight":2},{"_id":"5922e109152eaa9d53f3cf39","correct":false,"image":{"_id":"5922e109152eaa9d53f3cf3a","large":"https://d3ieicw58ybon5.cloudfront.net/resize/800/quizzes/c8145580ad034d5e803d6d27bdf0a610.jpg","medium":"https://d3ieicw58ybon5.cloudfront.net/resize/400/quizzes/c8145580ad034d5e803d6d27bdf0a610.jpg"},"outcomeIds":["59227665152eaa9d53f3cea2","59227690152eaa9d53f3cea4"],"text":"Rook","weight":3},{"_id":"5922e1ed152eaa9d53f3cf3b","correct":false,"image":{"_id":"5922e1ed152eaa9d53f3cf3c","large":"https://d3ieicw58ybon5.cloudfront.net/resize/800/quizzes/f1cbb4838fb74db6b3b540ee63bd5ecb.jpg","medium":"https://d3ieicw58ybon5.cloudfront.net/resize/400/quizzes/f1cbb4838fb74db6b3b540ee63bd5ecb.jpg"},"outcomeIds":["59227665152eaa9d53f3ce9e","59227665152eaa9d53f3cea0","59227690152eaa9d53f3cea4"],"text":"Necromancer","weight":4}],"selectedChoiceId":null,"text":"Which ally will you have in your party?","weight":1},{"_id":"5922772f152eaa9d53f3ceaa","choices":[{"_id":"592278a0152eaa9d53f3cead","correct":false,"image":{"_id":"592278a0152eaa9d53f3ceae","large":"https://d3ieicw58ybon5.cloudfront.net/resize/800/quizzes/2ecd8824b804436ea6cb272cdc694a73.jpg","medium":"https://d3ieicw58ybon5.cloudfront.net/resize/400/quizzes/2ecd8824b804436ea6cb272cdc694a73.jpg"},"outcomeIds":["59227665152eaa9d53f3ce9e","59227665152eaa9d53f3cea2"],"text":"Plain","weight":0},{"_id":"592278a0152eaa9d53f3ceaf","correct":false,"image":{"_id":"592278a0152eaa9d53f3ceb0","large":"https://d3ieicw58ybon5.cloudfront.net/resize/800/quizzes/ca0ac19956424a0886a4d610c38f0cd1.jpg","medium":"https://d3ieicw58ybon5.cloudfront.net/resize/400/quizzes/ca0ac19956424a0886a4d610c38f0cd1.jpg"},"outcomeIds":["59227665152eaa9d53f3cea0","59227690152eaa9d53f3cea6"],"text":"Forest","weight":1},{"_id":"592278a0152eaa9d53f3ceb1","correct":false,"image":{"_id":"592278a0152eaa9d53f3ceb2","large":"https://d3ieicw58ybon5.cloudfront.net/resize/800/quizzes/599387ad6b834521bc14a66defcfa7a5.jpg","medium":"https://d3ieicw58ybon5.cloudfront.net/resize/400/quizzes/599387ad6b834521bc14a66defcfa7a5.jpg"},"outcomeIds":["59227665152eaa9d53f3cea2","59227690152eaa9d53f3cea4","59227690152eaa9d53f3cea6"],"text":"Mountain","weight":2},{"_id":"592278a0152eaa9d53f3ceb3","correct":false,"image":{"_id":"592278a0152eaa9d53f3ceb4","large":"https://d3ieicw58ybon5.cloudfront.net/resize/800/quizzes/ea82e202fc064539bfe8986034570e3e.jpg","medium":"https://d3ieicw58ybon5.cloudfront.net/resize/400/quizzes/ea82e202fc064539bfe8986034570e3e.jpg"},"outcomeIds":["59227665152eaa9d53f3ce9e","59227665152eaa9d53f3cea2"],"text":"River","weight":3},{"_id":"592278a0152eaa9d53f3ceab","correct":false,"image":{"_id":"592278a0152eaa9d53f3ceac","large":"https://d3ieicw58ybon5.cloudfront.net/resize/800/quizzes/596592efebb04c2ab5e705572f55a235.jpg","medium":"https://d3ieicw58ybon5.cloudfront.net/resize/400/quizzes/596592efebb04c2ab5e705572f55a235.jpg"},"outcomeIds":["59227665152eaa9d53f3cea0","59227690152eaa9d53f3cea4"],"text":"Cave","weight":4}],"selectedChoiceId":null,"text":"So, time to set out! Where are you off to?","weight":2},{"_id":"5922a0c8152eaa9d53f3ceb5","choices":[{"_id":"5922d7e6152eaa9d53f3cf15","correct":false,"image":{"_id":"5922d7e6152eaa9d53f3cf16","large":"https://d3ieicw58ybon5.cloudfront.net/resize/800/quizzes/c6f9a4fa6d504df08dc91688d35b89a0.jpg","medium":"https://d3ieicw58ybon5.cloudfront.net/resize/400/quizzes/c6f9a4fa6d504df08dc91688d35b89a0.jpg"},"outcomeIds":["59227665152eaa9d53f3ce9e"],"text":"Slash it","weight":0},{"_id":"5922d7e6152eaa9d53f3cf17","correct":false,"image":{"_id":"5922d7e6152eaa9d53f3cf18","large":"https://d3ieicw58ybon5.cloudfront.net/resize/800/quizzes/7f3b8136ad4e45e1a64cb89b62d3e984.jpg","medium":"https://d3ieicw58ybon5.cloudfront.net/resize/400/quizzes/7f3b8136ad4e45e1a64cb89b62d3e984.jpg"},"outcomeIds":["59227665152eaa9d53f3cea0"],"text":"Defend","weight":1},{"_id":"5922d7e6152eaa9d53f3cf19","correct":false,"image":{"_id":"5922d7e6152eaa9d53f3cf1a","large":"https://d3ieicw58ybon5.cloudfront.net/resize/800/quizzes/37344ce018324d06afff81cadaa57431.jpg","medium":"https://d3ieicw58ybon5.cloudfront.net/resize/400/quizzes/37344ce018324d06afff81cadaa57431.jpg"},"outcomeIds":["59227665152eaa9d53f3cea2"],"text":"Use magic","weight":2},{"_id":"5922d7e6152eaa9d53f3cf1b","correct":false,"image":{"_id":"5922d7e6152eaa9d53f3cf1c","large":"https://d3ieicw58ybon5.cloudfront.net/resize/800/quizzes/ee12469a498849d0aad24642898ac1ff.jpg","medium":"https://d3ieicw58ybon5.cloudfront.net/resize/400/quizzes/ee12469a498849d0aad24642898ac1ff.jpg"},"outcomeIds":["59227690152eaa9d53f3cea4"],"text":"Recover health","weight":3},{"_id":"5922d7e6152eaa9d53f3cf1d","correct":false,"image":{"_id":"5922d7e6152eaa9d53f3cf1e","large":"https://d3ieicw58ybon5.cloudfront.net/resize/800/quizzes/c4c92d8d540f4c15b85b819a546f0233.jpg","medium":"https://d3ieicw58ybon5.cloudfront.net/resize/400/quizzes/c4c92d8d540f4c15b85b819a546f0233.jpg"},"outcomeIds":["59227690152eaa9d53f3cea6"],"text":"Support an ally","weight":4}],"selectedChoiceId":null,"text":"A monster suddenly appears! What do you do?","weight":3},{"_id":"5922e5d5152eaa9d53f3cf3d","choices":[{"_id":"5922e608152eaa9d53f3cf3e","correct":false,"image":{"_id":"5922e608152eaa9d53f3cf3f","large":"https://d3ieicw58ybon5.cloudfront.net/resize/800/quizzes/cc5a529bdb864a658a344b5a1ea80741.jpg","medium":"https://d3ieicw58ybon5.cloudfront.net/resize/400/quizzes/cc5a529bdb864a658a344b5a1ea80741.jpg"},"outcomeIds":["59227665152eaa9d53f3ce9e","59227690152eaa9d53f3cea6"],"text":"Mandra","weight":0},{"_id":"5922e608152eaa9d53f3cf40","correct":false,"image":{"_id":"5922e608152eaa9d53f3cf41","large":"https://d3ieicw58ybon5.cloudfront.net/resize/800/quizzes/f4915321bbe04cd2b602c5631a61d435.jpg","medium":"https://d3ieicw58ybon5.cloudfront.net/resize/400/quizzes/f4915321bbe04cd2b602c5631a61d435.jpg"},"outcomeIds":["59227665152eaa9d53f3cea0","59227665152eaa9d53f3cea2","59227690152eaa9d53f3cea4"],"text":"Kinopo","weight":1}],"selectedChoiceId":null,"text":"What creatures do you meet during your adventure?","weight":4}],"title":"Logres Quiz","visit_url":"https://otakumode.com/fb/8na"};
tomFbAppId = "212720585514421";
(function() {
var question;
Vue.component('q-question', {
props: ['quiz', 'question', 'questionIndex', 'resultShown'],
template: '#qQuestion',
computed: {
choiceText: function() {
return this.selectedChoice.text;
},
choiceWasMade: function() {
return !!this.selectedChoiceId;
},
correctAnswer: function() {
return this.choices.find(function(c) {
return c != null ? c.correct : void 0;
});
},
quizIsKnowledgeTest: function() {
return this.quiz.kind === 'knowledge_test';
},
lastQuestion: function() {
return this.quiz.questions[this.quiz.questions.length - 1];
},
nextQuestionEl: function() {
return this.$el.nextElementSibling;
},
selectedChoiceId: function() {
return this.question.selectedChoiceId;
},
isLast: function() {
if (this.lastQuestion) {
return this.lastQuestion === this.question;
} else {
return false;
}
},
selectedChoice: function() {
return this.question.choices.find((function(_this) {
return function(choice) {
return choice._id === _this.selectedChoiceId;
};
})(this));
}
},
methods: {
goToNext: function() {
if (!this.choiceWasMade) {
return;
}
self.zenscroll.to(this.nextQuestionEl);
},
trackChoice: function() {
return tom.helper.ga.push(['event', 'Quiz', 'Chosen', this.quiz._id + "-" + this.question._id + "-" + this.choiceText, 1]);
}
},
watch: {
choiceWasMade: function(val) {
if (this.quizIsKnowledgeTest || !val) {
return;
}
if (!this.quizIsKnowledgeTest) {
this.goToNext();
}
},
selectedChoiceId: function(val) {
if (!val) {
return;
}
return this.trackChoice();
}
}
});
Vue.component('q-choice', {
template: '#qChoice',
props: ['choice', 'question', 'quiz', 'resultShown'],
computed: {
choiceWasMade: function() {
return !!this.question.selectedChoiceId;
},
quizIsKnowledgeTest: function() {
return this.quiz.kind === 'knowledge_test';
},
showCorrectness: function() {
return this.choiceWasMade && this.quizIsKnowledgeTest;
},
correctnessClass: function() {
if (!this.showCorrectness) {
return '';
}
if (this.choice.correct) {
return 'u-color-green';
}
return 'u-color-red';
},
disabled: function() {
if (this.quizIsKnowledgeTest && this.choiceWasMade) {
return true;
}
return this.resultShown;
},
correctnessIconClass: function() {
if (!this.showCorrectness) {
return 'quiz__choice__icon--hidden';
}
if (this.choice.correct) {
return 'icon-ok-sign';
}
return 'icon-remove-sign';
}
}
});
Vue.component('q-share', {
template: '#qShare',
props: ['networks', 'pageInFrame', 'parentIsAccessible'],
data: function() {
return {
twitterSite: 'TokyoOtakuMode',
facebookAppId: self.tomFbAppId
};
},
computed: {
networkSet: function() {
return this.networks.split(' ');
},
description: function() {
var ref;
return (ref = self.document.getElementById('quiz_introduction')) != null ? ref.innerText : void 0;
},
pageTitle: function() {
if (this.parentIsAccessible) {
return parent.document.title;
} else {
return document.title;
}
},
pageUrl: function() {
if (this.parentIsAccessible) {
return parent.document.location.href;
} else {
return (this.pageInFrame ? document.referrer : void 0) || document.location.href;
}
}
},
methods: {
buttonClassFor: function(network) {
return "c-social-buttons__link--" + network;
},
encode: function(val) {
return encodeURIComponent(val);
},
iconClassFor: function(network) {
return "icon-" + (this.iconFor(network));
},
iconFor: function(network) {
switch (network) {
case 'pinterest':
return 'pinterest-p';
case 'reddit':
return 'reddit-alien';
default:
return network;
}
},
shareUrlFor: function(network) {
switch (network) {
case 'facebook':
return "https://www.facebook.com/dialog/share?app_id=" + (this.encode(this.facebookAppId)) + "&display=page&href=" + (this.encode(this.pageUrl)) + "&redirect_uri=" + (this.encode(this.pageUrl));
case 'google-plus':
return "https://plus.google.com/share?url=" + (this.encode(this.pageUrl));
case 'pinterest':
return "https://pinterest.com/pin/create/bookmarklet/?url=" + (this.encode(this.pageUrl)) + "&description=" + (this.encode(this.pageTitle));
case 'reddit':
return "https://reddit.com/submit?url=" + (this.encode(this.pageUrl)) + "&title=" + (this.encode(this.pageTitle));
case 'tumblr':
return "https://www.tumblr.com/widgets/share/tool?canonicalUrl=" + (this.encode(this.pageUrl)) + "&title=" + (this.encode(this.pageTitle)) + "&caption=" + (this.encode(this.description));
case 'twitter':
return "https://twitter.com/intent/tweet?url=" + (this.encode(this.pageUrl)) + "&text=" + (this.encode(this.pageTitle)) + "&via=" + (this.encode(this.twitterSite));
}
},
titleFor: function(network) {
switch (network) {
case 'facebook':
return 'Share on Facebook';
case 'google-plus':
return 'Share on Google+';
case 'pinterest':
return 'Share on Pinterest';
case 'reddit':
return 'Share on Reddit';
case 'tumblr':
return 'Share on Tumblr';
case 'twitter':
return 'Share on Twitter';
}
}
}
});
Vue.component('q-subscribe', {
template: '#qSubscribe',
props: ['quiz'],
data: function() {
return {
email: '',
error: false,
success: false
};
},
methods: {
resetMessage: function() {
return this.error = this.success = false;
},
subscribe: function() {
this.resetMessage();
return $.ajax('/quizzes/emails/', {
data: $(this.$el).serialize(),
method: 'POST',
error: (function(_this) {
return function($xhr, status, error) {
return _this.error = true;
};
})(this),
success: (function(_this) {
return function(data, status) {
return _this.success = true;
};
})(this)
});
}
}
});
Vue.component('q-visit', {
template: '#qVisit',
props: ['quiz']
});
question = new Vue({
el: '#quiz',
mounted: function() {
return this.resizeFrame();
},
computed: {
isAssessment: function() {
return this.quiz.kind === 'assessment';
},
isKnowledgeTest: function() {
return this.quiz.kind === 'knowledge_test';
},
correctAnswersCount: function() {
return this.correctAnswers.length;
},
questionsCount: function() {
return this.quiz.questions.length;
},
pageInFrame: function() {
return self !== parent;
},
showResult: function() {
return this.areAllChoicesMade && this.resultRequested;
},
answeredQuestions: function() {
return this.quiz.questions.filter(function(question) {
return !!question.selectedChoiceId;
});
},
areAllChoicesMade: function() {
return this.quiz.questions.length === this.answeredQuestions.length;
},
correctAnswers: function() {
return this.answeredQuestions.filter(function(question) {
var correctAnswer;
correctAnswer = question.choices.find(function(choice) {
return choice.correct;
});
return question.selectedChoiceId === correctAnswer._id;
});
},
mostPopularChoiceId: function() {
var arr, counts, max, res, v;
arr = this.relatedOutcomeIds;
counts = {};
max = 0;
res = void 0;
for (v in arr) {
if (!v) {
v = this.quiz.questions[0].choices[0]._id;
}
counts[arr[v]] = (counts[arr[v]] || 0) + 1;
if (counts[arr[v]] > max) {
max = counts[arr[v]];
res = arr[v];
}
}
return res;
},
relatedOutcomeIds: function() {
var outcomeIds;
outcomeIds = [];
this.quiz.questions.forEach(function(question) {
var choice;
choice = question.choices.find(function(choice) {
return choice._id === question.selectedChoiceId;
});
if (!choice) {
return;
}
outcomeIds.push.apply(outcomeIds, choice.outcomeIds);
});
return outcomeIds;
},
parentIsAccessible: function() {
var error1;
try {
return !!parent.document.location;
} catch (error1) {
return false;
}
},
resultOutcome: function() {
if (!(this.isAssessment && this.showResult)) {
return null;
}
return this.quiz.outcomes.find((function(_this) {
return function(outcome) {
return outcome._id === _this.mostPopularChoiceId;
};
})(this));
},
totalPoints: function() {
return this.choicesPoints.reduce(function(acc, val) {
return acc + val;
}, 0);
}
},
data: {
resultRequested: false,
quiz: self.tomQuiz
},
methods: {
resizeFrame: function() {
var iframe;
if (!this.pageInFrame || !this.parentIsAccessible) {
return;
}
iframe = [].slice.call(parent.document.getElementsByTagName('iframe')).find(function(el) {
return el.contentDocument === self.document;
});
if (!iframe) {
return;
}
return $(iframe).height($(document).innerHeight());
},
revealResult: function() {
this.trackSubmit();
this.resultRequested = true;
},
scrollToResult: function() {
this.resizeFrame();
return self.zenscroll.to(document.getElementById('result'));
},
trackSubmit: function() {
return tom.helper.ga.push(['event', 'Quiz', 'Done', this.quiz._id, 1]);
}
},
watch: {
showResult: function(val) {
if (!val) {
return;
}
return self.setTimeout(((function(_this) {
return function() {
return _this.scrollToResult();
};
})(this)), 10);
}
}
});
}).call(this);
The English version is releasing in the U.S., Canada, U.K., Australia, and New Zealand. Keep your eyes on the official channels for news on even more countries to be added too.
・Title: Logres: Japanese RPG
・Category: MMORPG
・OS: Android/iOS
・© Marvelous Inc. Aiming Inc.
This is a Tokyo Otaku Mode original article sponsored by Logres.