WikiLerni/views/wikilerni/quiz.pug

101 lines
8.3 KiB
Plaintext

extends layout.pug
block append scripts
script(src="/JS/polyfill.app.js" defer)
script(src="/JS/quiz.app.js" defer)
block content
div(id="tags" class="cardboard")
ul
li
a(href="/") #{config.siteName}
for tag in questionnaire.Tags
li
a(href="/quizs/"+tag.slug+".html") #{tag.name}
-
const imgAttributes = { alt: txtIllustration.defaultAlt, style: "opacity: 0.0;" };
if(questionnaire.Illustrations!=undefined && questionnaire.Illustrations.length!==0)
{
if (tool.isEmpty(questionnaire.Illustrations[0].alt)===false)
imgAttributes.alt=questionnaire.Illustrations[0].alt;
if(tool.isEmpty(questionnaire.Illustrations[0].title)===false)
imgAttributes.title=questionnaire.Illustrations[0].title;
}
const publishedAtTxt=tool.dateFormat(questionnaire.Questionnaire.publishingAt, questionnaire.Questionnaire.language);
const updatedAtTxt=tool.dateFormat(questionnaire.Questionnaire.updatedAt, questionnaire.Questionnaire.language);
if(questionnaire.Illustrations!=undefined && questionnaire.Illustrations.length!==0)
div(id="content-picture" class="cardboard")
div(style="background-image: url('"+"/img/quizs/"+questionnaire.Illustrations[0].url+"');")
img(src="/img/quizs/"+questionnaire.Illustrations[0].url)&attributes(imgAttributes)
if(questionnaire.Illustrations[0].caption)
p !{questionnaire.Illustrations[0].caption}
div(id="content-side")
div(id="content-top-decoration" class="cardboard") #{txtQuestionnaire.estimatedTime} #{txtQuestionnaire.estimatedTimeOption[questionnaire.Questionnaire.estimatedTime]}.
div(id="content-title")
h1(class="cardboard")
img(id="required-time-icon" src="/themes/wikilerni/img/time-required-"+questionnaire.Questionnaire.estimatedTime+".png" title=txtQuestionnaire.estimatedTime+" "+txtQuestionnaire.estimatedTimeOption[questionnaire.Questionnaire.estimatedTime])
span #{questionnaire.Questionnaire.title}
if(questionnaire.Illustrations!=undefined && questionnaire.Illustrations.length!==0)
a(href="/img/quizs/"+questionnaire.Illustrations[0].url target="_blank" rel="noopener")
img(src="/img/quizs/min/"+questionnaire.Illustrations[0].url class="thumb")&attributes(imgAttributes)
div(id="content-title-corner")
div(id="content" class="cardboard")
p(id="author-date") #{txtQuestionnaire.publishedBy} #{author}#{txtQuestionnaire.publishedAt} #{publishedAtTxt}. #{txtQuestionnaire.lastUpdated}#{updatedAtTxt}.
if(questionnaire.Questionnaire.introduction)
div#introduction !{questionnaire.Questionnaire.introduction}
div#links
for link in questionnaire.Links
p
a(href=link.url class="button cardboard" target="_blank" rel="noopener" title=link.anchor+" ("+txtGeneral.alertNewWindow+")") #{link.anchor}
div#show
p
a(class="button cardboard" href="#questionnaire" id="showQuestionnaire" title=txtQuestionnaire.btnShowQuestionnaire) #{txtQuestionnaire.btnShowQuestionnaire}
noscript
div
strong #{configTpl.noJSNotification}
form(id="quiz" method="POST" class="needJS" data-title=questionnaire.Questionnaire.title)
h2 #{questionnaire.Questionnaire.title}
div#response
div(id="propose2Save" class="needJS")
span(class="input_wrapper")
input(class="button cardboard" id="want2Save" type="button" value=txtQuestionnaire.btnProposeSave)
for question in questionnaire.Questions
p(id="question_"+question.Question.id) #{question.Question.text}
if(question.Question.explanation)
blockquote(class="help" id="help_"+question.Question.id cite=questionnaire.Links[0].url) #{txtQuestionnaire.explanationBeforeTxt} #{question.Question.explanation}
ul(class="checkbox_li")
for reponse in question.Choices
li(class="checkbox_li")
label(class="check" for="response_"+reponse.id)
input(type="checkbox" name="response_"+reponse.id id="response_"+reponse.id)
div(class="checkbox_override")
span(class="wrongResponse")
img(src="/themes/wikilerni/img/wrong-min.png" title=txtQuestionnaire.wrongAnswerTxt)
span(class="rightResponse")
img(src="/themes/wikilerni/img/correct-min.png" title=txtQuestionnaire.correctAnswerTxt)
em #{reponse.text}
input(type="hidden" name="isCorrect_response_"+reponse.id id="isCorrect_response_"+reponse.id value=""+reponse.isCorrect)
input(type="hidden" name="question_id_response_"+reponse.id id="question_id_response_"+reponse.id value=question.Question.id)
input(name="questionnaireId" id="questionnaireId" value=questionnaire.Questionnaire.id type="hidden")
input(name="groupId" id="groupId" value="0" type="hidden")
p
span(class="input_wrapper")
input(id="checkResponses" type="submit" value=txtQuestionnaire.btnSendResponse class="cardboard")
div#licence
p !{configTpl.licenceTxt}
div#zerozozio
a(href="mailto:?to=&subject="+questionnaire.Questionnaire.title+"&body="+txtQuestionnaire.btnShareQuizMailBody+linkCanonical rel="nofollow noopener" title=txtQuestionnaire.btnShareQuizTxt+"e-mail* ("+txtGeneral.alertNewWindow+")" target="_blank")
img(src="/themes/wikilerni/img/email.png" alt=txtQuestionnaire.btnShareQuizTxt+"mail")
a(href="http://sharetodiaspora.github.io/?url="+linkCanonical+"&title="+questionnaire.Questionnaire.title rel="nofollow noopener" title=txtQuestionnaire.btnShareQuizTxt+"diaspora* ("+txtGeneral.alertNewWindow+")" target="_blank")
img(src="/themes/wikilerni/img/diaspora.png" alt=txtQuestionnaire.btnShareQuizTxt+"diaspora*")
a(href="https://www.facebook.com/sharer.php?u="+linkCanonical rel="nofollow noopener" title=txtQuestionnaire.btnShareQuizTxt+"facebook ("+txtGeneral.alertNewWindow+")" target="_blank")
img(src="/themes/wikilerni/img/facebook.png" alt=txtQuestionnaire.btnShareQuizTxt+"facebook")
a(href="https://www.linkedin.com/shareArticle?mini=true&url="+linkCanonical+";title="+questionnaire.Questionnaire.title rel="nofollow noopener" title=txtQuestionnaire.btnShareQuizTxt+"LinkedIn ("+txtGeneral.alertNewWindow+")" target="_blank")
img(src="/themes/wikilerni/img/linkedin.png" alt=txtQuestionnaire.btnShareQuizTxt+"LinkedIn")
a(href="https://twitter.com/intent/tweet?url="+linkCanonical+"&text="+questionnaire.Questionnaire.title+" via @"+configTpl.twitterAccount rel="nofollow noopener" title=txtQuestionnaire.btnShareQuizTxt+"twitter ("+txtGeneral.alertNewWindow+")" target="_blank")
img(src="/themes/wikilerni/img/twitter.png" alt=txtQuestionnaire.btnShareQuizTxt+"twitter")
div#explanations(class="engraved framed")
h3#explanationsTitle #{configTpl.explanationTitle}
div#explanationsContent
p !{configTpl.explanationTxt}
p
a(href="/"+configTpl.aboutPage class="button cardboard" title=configTpl.homeBtnAboutTxt) #{configTpl.homeBtnAboutTxt}