WikiLerni/views/wikilerni/quiz-group.pug

94 lines
7.9 KiB
Plaintext

extends layout.pug
block append scripts
script(src="/JS/polyfill.app.js" defer)
script(src="/JS/quiz.app.js" defer)
block content
-
if(group.Questionnaires.length !==0)
{
const imgAttributes = { alt: txtIllustration.defaultAlt, style: "opacity: 0.0;" };
if(group.Questionnaires[0].Illustrations!=undefined && group.Questionnaires[0].Illustrations.length!==0)
{
if (tool.isEmpty(group.Questionnaires[0].Illustrations[0].alt)===false)
imgAttributes.alt=group.Questionnaires[0].Illustrations[0].alt;
if(tool.isEmpty(group.Questionnaires[0].Illustrations[0].title)===false)
imgAttributes.title=group.Questionnaires[0].Illustrations[0].title;
}
}
const publishedAtTxt=tool.dateFormat(group.Group.publishingAt, group.Group.language);
const updatedAtTxt=tool.dateFormat(group.Group.updatedAt, group.Group.language);
if(group.Questionnaires.length !==0 && group.Questionnaires[0].Illustrations!=undefined && group.Questionnaires[0].Illustrations.length!==0)
div(id="content-picture" class="cardboard")
div(style="background-image: url('/img/quizs/"+group.Questionnaires[0].Illustrations[0].url+"');")
img(src="/img/quizs/"+group.Questionnaires[0].Illustrations[0].url)&attributes(imgAttributes)
if(group.Questionnaires[0].Illustrations[0].caption)
p !{group.Questionnaires[0].Illustrations[0].caption}
div(id="content-side")
div(id="content-title")
h1(class="cardboard")
img(id="required-time-icon" src="/themes/wikilerni/img/time-required-medium.png")
span #{group.Group.title}
if(group.Questionnaires.length !==0 && group.Questionnaires[0].Illustrations!=undefined && group.Questionnaires[0].Illustrations.length!==0)
a(href="/img/quizs/"+group.Questionnaires[0].Illustrations[0].url target="_blank" rel="noopener")
img(src="/img/quizs/min/"+group.Questionnaires[0].Illustrations[0].url class="thumb")&attributes(imgAttributes)
div(id="content-title-corner")
div(id="content" class="cardboard")
p(id="author-date") #{txtGroups.publishedBy} #{author} #{txtGroups.publishedAt} #{publishedAtTxt}. #{txtGroups.lastUpdated} #{updatedAtTxt}.
div#introduction
if(group.Group.introduction)
div !{group.Group.introduction}
noscript
div
strong #{configTpl.noJSNotification}
form(id="quiz" method="POST" data-title=group.Group.title)
h2 #{group.Group.title}
div#response
div(id="propose2Save" class="needJS")
span(class="input_wrapper")
input(class="button cardboard" id="want2Save" type="button" value=txtQuestionnaire.btnProposeSave)
for questionnaire in group.Questionnaires
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=config.siteUrl+"/"+configQuestionnaires.dirWebQuestionnaires+"/"+questionnaire.Questionnaire.slug+".html")
span #{txtexplanationBeforeTxt} #{question.Question.explanation+" "}
a(href=config.siteUrl+"/"+configQuestionnaires.dirWebQuestionnaires+"/"+questionnaire.Questionnaire.slug+".html") #{configTpl.answersExplanationsLinkText}
ul(class="checkbox_li")
for response in question.Choices
li(class="checkbox_li")
label(class="check" for="response_"+response.id)
input(type="checkbox" name="response_"+response.id id="response_"+response.id)
div(class="checkbox_override")
span(class="wrongResponse")
img(src="/themes/wikilerni/img/wrong-min.png" title=txtGroups.wrongAnswerTxt)
span(class="rightResponse")
img(src="/themes/wikilerni/img/correct-min.png" title=txtGroups.correctAnswerTxt)
em #{response.text}
input(type="hidden" name="isCorrect_response_"+response.id id="isCorrect_response_"+response.id value=""+response.isCorrect)
input(type="hidden" name="question_id_response_"+response.id id="question_id_response_"+response.id value=question.Question.id)
input(name="questionnaireId" id="questionnaireId" value="0" type="hidden")
input(name="groupId" id="groupId" value=group.Group.id type="hidden")
p
span(class="input_wrapper")
input(id="checkResponses" type="submit" value=txtGroups.btnSendResponse class="cardboard needJS" title=txtGroups.btnSendResponse)
div#licence
p !{configTpl.licenceTxt}
div#zerozozio
a(href="mailto:?to=&subject="+group.Group.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="+group.Group.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="+group.Group.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="+group.Group.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}
p.info !{txtGroups.commonIntroTxt}
div#explanationsContent
if(group.Questionnaires.length !==0)
div#links
a(href="/"+configQuestionnaires.dirWebQuestionnaires+"/"+group.Questionnaires[0].Questionnaire.slug+".html" class="button cardboard" title=group.Questionnaires[0].Questionnaire.title) !{"← "+txtGroups.linkFirstElementGroup}