Skip to content

Commit

Permalink
Merge et fix quelques menus problèmes
Browse files Browse the repository at this point in the history
  • Loading branch information
artragis committed Jun 5, 2021
1 parent 11c9e65 commit 3ae006b
Show file tree
Hide file tree
Showing 11 changed files with 73 additions and 1,011 deletions.
4 changes: 1 addition & 3 deletions assets/js/content-quizz.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ function injectForms(quizz, answers) {
heading.setAttribute('id', `quizz-form-${idBias}`)
idBias++
}
console.log(headings)
console.log(heading.getAttribute('id'))
if (heading && !headings[heading.getAttribute('id')]) {
const wrapper = document.createElement('div')

Expand Down Expand Up @@ -172,7 +170,7 @@ function injectForms(quizz, answers) {
wrapper.appendChild(form)
if (heading.nextSibling) {
wrapper.appendChild(heading.nextSibling.cloneNode(true))
quizz.removeChild(heading.nextSibling)
heading.parentNode.removeChild(heading.nextSibling)
}
}
}
Expand Down
28 changes: 10 additions & 18 deletions assets/scss/base/_content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -116,24 +116,6 @@ h6 {


.quizz .custom-block {
.custom-block {
display: none;
}
&.quizz-bad {
background-color: $color-danger !important;
.custom-block {
display: block;
}
}
&.quizz-good {
background:$color-success !important;
.custom-block {
display: block;
}
}

}

.custom-block {
display: none;
}
Expand Down Expand Up @@ -163,6 +145,7 @@ h6 {

}


.custom-block {
margin: $length-24 0;
}
Expand Down Expand Up @@ -286,6 +269,15 @@ h6 {
&:after {
display: none;
}

.custom-block {
display: none;
/* hide the correction while not answered */
&.quizz-good, &.quizz-bad, &.quizz-missing {
display: block;
}
}

}
}

Expand Down
6 changes: 3 additions & 3 deletions assets/scss/pages/_stats.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@
max-width: 50%;
li.quizz-stats {
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-template-columns: 3fr 3fr 1fr;
grid-gap: 1px;
/* .over-progress {
.over-progress {
display: block;
position: relative;
left: -50%;
}*/
}
}
}
8 changes: 4 additions & 4 deletions templates/misc/quizz.graph.part.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{% load i18n %}
{% load dict_get %}


<div id="{{ tab_name }}" class="tabcontent">
{% for url, questions in quizz.items %}
Expand All @@ -14,9 +12,11 @@ <h4>{% trans graph_title %} {{ question }}</h4>
{% for answer_name, answer_stats in stats.responses.items %}
<li class="{% if answer_stats.good %}quizz-forget{% endif %} quizz-stats">
<span>{{ answer_name }}</span>
<span><progress aria-label="{% trans 'Résultat pour' %} {{ answer_name }}" max="{{ stats.total }}" value="{{ answer_stats.nb }}"/>
<span>
<progress aria-label="{% trans 'Résultat pour' %} {{ answer_name }}"
max="{{ stats.total }}" value="{{ answer_stats.nb }}"/>
</span>
<span class="over-progress">{{answer_stats.nb}}</span>
<span class="over-progress">{{answer_stats.nb}} / {{ stats.total }}</span>
</li>
{% endfor %}
</ul>
Expand Down
3 changes: 1 addition & 2 deletions templates/tutorialv2/export/chapter.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{% load emarkdown %}
{% load i18n %}

{# this template will be used to generate the HTML file for each container ! #}
Expand Down Expand Up @@ -28,7 +27,7 @@ <h2 id="{{ model_extract.position_in_parent }}-{{ model_extract.slug }}">
{% if rendered_extract.text %}
<div class="extract-wrapper quizz" data-quizz-validate="{% trans 'Valider le Quizz' %}"
data-heading-level="h3" data-answer-url="{% url 'content:answer-quizz' content.pk content.slug %}">
{{ rendered_extract.get_text|emarkdown:is_js }}
{{ rendered_extract.text|safe }}
</div>
{% endif %}
{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion templates/tutorialv2/stats/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ <h2 class="ico-after ico-tutorials">
{% include "misc/graph.part.html" with tab_name="tab-view-graph-content" graph_title="Évolution des pages vues sur le contenu" canvas_id="view-graph" report_key="nb_hits" %}
{% include "misc/graph.part.html" with tab_name="tab-visit-time-graph-content" graph_title="Évolution du temps moyen lecture (en secondes)" canvas_id="visit-time-graph" report_key="avg_time_on_page" %}
{% include "misc/graph.part.html" with tab_name="tab-users-graph-content" graph_title="Évolution du nombre de visiteurs uniques" canvas_id="users-graph" report_key="nb_uniq_visitors" %}
{% include "misc/graph.part.html" with tab_name="tab-quizz-content" graph_title="Réponses au quizz" canvas_id="quizz-graph" metric="quizz" %}
{% include "misc/quizz.graph.part.html" with tab_name="tab-quizz-content" graph_title="Réponses au quizz" canvas_id="quizz-graph" metric="quizz" %}

{% if cumulative_stats %}
{% if display == 'global' %}
Expand Down
Loading

0 comments on commit 3ae006b

Please sign in to comment.