{# n'étend pas base.twig : utilisation dans ajax. javascript, css, etc. sont dans la pleine page au-delà de ce contenu #} {% if formation_id is not defined %} {% set formation_id = 0 %} {% endif %} {% if module_id is not defined %} {% set module_id = 0 %} {% endif %} {% if lecon_id is not defined %} {% set lecon_id = 0 %} {% endif %} {% if activite_id is not defined %} {% set activite_id = 0 %} {% endif %} {# paramètre fourni par vue encapsulée (dans leçon) #} {% if prefix is not defined %} {% set prefix = '0' %} {% endif %} {% if eleve_id is not defined %} {% set eleve_id = app.user.id %} {% endif %} {% set path_reponse = path('courses_reponse_submit', { 'formation_id': formation_id, 'module_id': module_id, 'lecon_id': lecon_id, 'eleve_id': eleve_id, 'activite_id': activite_id, 'id': composant.id }) %} {% set est_exercice = false %} {% if composant.type.id == 1 or composant.type.id == 2 or composant.type.id == 3 or composant.type.id == 4 or composant.type.id == 5 %} {% set est_exercice = true %} {% endif %} {% set html_submit %}
{% endset %} {% if cacher_submit_individuel is defined %} {% if cacher_submit_individuel %} {% set html_submit = '' %} {% endif %} {% endif %} {# pour bloquer un composant, utiliser ceci : #} {% set readonly = false %} {% if param_readonly is defined %} {% if param_readonly %} {% set readonly = true %} {% endif %} {% endif %} {% set class_col = 'col-12' %} {% if render_with is defined %} {% set class_col = 'col-8' %} {% endif %} {% set est_apercu = false %} {% if formation_id == '0' or formation_id == 0 %} {% set est_apercu = true %} {% endif %} {% if('' == json) %} exercice incorrect : à corriger en administration {% else %} {% if composant.type.id == 2 or composant.type.id == 3 %} {% set activite_validable = true %} {# il suffit d'un exercice pour que ce soit validable #}

{% if composant.type.id == 2 %} {% if composant.consigne|raw == "" %} Complete the following sentences by (double) clicking on the most appropriate word. {% else %} {{ composant.consigne|raw }} {% endif %} {% elseif composant.type.id == 3 %} {% if composant.consigne|raw == "" %} Fill in the blanks with the most appropriate words. {% else %} {{ composant.consigne|raw }} {% endif %} {% endif %}

{# MULTIPLE CHOICE #} {% elseif composant.type.id == 1 %} {% set activite_validable = true %} {# il suffit d'un exercice pour que ce soit validable #}

{% if composant.consigne|raw == "" %} Choose the correct answer. {% else %} {{ composant.consigne|raw }} {% endif %}

{# ASSOCATION #} {% elseif composant.type.id == 4 %} {% set activite_validable = true %} {# il suffit d'un exercice pour que ce soit validable #}

{% if composant.consigne|raw == "" %} Link the 2 corresponding elements. {% else %} {{ composant.consigne|raw }} {% endif %}

{# OPEN QUESTION #} {% elseif composant.type.id == 5 %} {% set activite_validable = true %} {# il suffit d'un exercice pour que ce soit validable #}

{% if composant.consigne|raw == "" %} {% else %} {{ composant.consigne|raw }} {% endif %}

{# TEXTE #} {% elseif composant.type.id == 8 %}

{% if composant.consigne|raw == "" %} Read the text and then answer the following questions. {% else %} {{ composant.consigne|raw }} {% endif %}

{# SON #} {% elseif composant.type.id == 10 %}

{% if composant.consigne|raw == "" %} Listen to the recording and then answer the following questions. {% else %} {{ composant.consigne|raw }} {% endif %}

{# VIDEO #} {% elseif composant.type.id == 11 %}

{% if composant.consigne|raw == "" %} Watch the video and then answer the following questions. {% else %} {{ composant.consigne|raw }} {% endif %}

{% endif %}
{# note: pas besoin de |json_encode car c'est déjà un json encodé en string #} {# GAP FILL #} {% if composant.type.id == 2 or composant.type.id == 3 %}
{% if composant.type.id == 2 %}
    {% for box in choix %}
  • {{ box|raw }}
  • {% endfor %}
{% endif %}
{% set numBox = 1 %} {% for i in range(0, json.texte|length-1, 1) %} {{ json.texte[i]|replace({'

': '
', '

': ''})|raw }} {% if i != json.texte|length-1 and composant.type.id == 2 %}

    {% set numBox = numBox + 1 %}
    {% elseif i != json.texte|length-1 and composant.type.id == 3 %} {# gapfill write: passer en tinymce inline #} {#{% with { 'full_name': prefix ~ '_' ~ activite_id ~ '_' ~ composant.id ~ '_' ~ i ~ 'question' ~ numBox, 'value': '', 'theme': 'normale', 'classes': 'form-control list-group question question' ~ numBox } %}
    {{ block('inlinetinymce_widget', "::form/fields.html.twig") }}
    {% endwith %}#} {% set numBox = numBox + 1 %} {% endif %} {% endfor %}
    {{ html_submit }} {# MULTIPLE CHOICE #} {% elseif composant.type.id == 1 %}
    {% for i in range(1, questions|length, 1) %}

    {{ i }}.

    {% include 'inlinetinymceormedia_show.html.twig' with { 'data': questions[i] } only %}
    {% set nameQuestion = "question-" ~ counter_activite ~"-"~ counter %} {% if reponses[i] is defined %}
    {% for j0 in range(1, reponses[i]|length, 1) %} {% if not loop.first %} {% set j = j0-1 %} {% set reponse_id = "rep-"~ counter_activite ~"-"~ counter ~"-"~ i ~"-"~ j %} {% if reponses[i][1] == 0 %}

    {{ range('a','z')[loop.index-2] }}

    {# #}
    {% elseif reponses[i][1] == 1 %}

    {{ range('a','z')[loop.index-2] }}


    {% elseif reponses[i][1] == 2 %}

    {{ range('a','z')[loop.index-2] }}{% if reponses[i][1] == 2 %}.{% endif %}

    {% if reponses[i][j0].media is defined and reponses[i][j0].media != '0' %} {% include 'inlinetinymceormedia_show.html.twig' with { 'data': 'media_id_'~reponses[i][j0].media } only %} {% else %} {{ reponses[i][j0].texte }} {% endif %}

    {% endif %} {% endif %} {% endfor %}
    {% endif %}
    {% endfor %}
    {{ html_submit }} {# ASSOCATION #} {% elseif composant.type.id == 4 %} {% if association is defined %}
    {% set indexAssociation = 1 %} {% for i in range(1, source|length, 1) %}
    {# jsPlumb oblige l'usage d'indexes #}
    {% include 'inlinetinymceormedia_show.html.twig' with { 'data': source[i-1] } only %}
    {% include 'inlinetinymceormedia_show.html.twig' with { 'data': target[i-1] } only %}
    {% set indexAssociation = indexAssociation+1 %} {% endfor %}
    {{ html_submit }} {% endif %} {# OPEN QUESTION #} {% elseif composant.type.id == 5 %}
    {{ json.question | raw }}
    {% if readonly == true %}

    Réponse :

    Correction :

    {% else %} {% endif %}
    {{ html_submit }} {% elseif composant.type.id == 6 %}
    {{ json.question | raw }}
    {% elseif composant.type.id == 7 %}
    {{ json.question | raw }}
    {% elseif composant.type.id == 8 %}
    {{ json.question | raw }}
    {% elseif composant.type.id == 9 %} {# DESACTIVE #}
    {{ json.question | raw }}
    {% elseif composant.type.id == 10 %} {# son #}
    {# Version ajax #}
    {% elseif composant.type.id == 11 %} {# vidéo #}
    {% elseif composant.type.id == 12 %} {# image #}
    {% elseif composant.type.id == 13 %} {# transcript #}
    {{ json.question | raw }}
    {% else %}
    type inconnu{{ composant.type.id }}
    {% endif %} {% if render_with is defined %} {% set inner_exercice_id = render_with %}
    {{ render(controller( 'CoursesBundle:Exercice:show', { 'id': inner_exercice_id, 'formation_id': formation_id, 'module_id': module_id, 'lecon_id': lecon_id, 'activite_id': activite_id, 'prefix': prefix ~ "_" ~ (counter+1), 'counter': (counter+1), 'counter_activite': counter_activite, 'render_inner': true, 'with_session_reponse': false, 'cacher_submit_individuel': true, 'param_readonly': true, } )) }}
    {% endif %} {% if est_exercice %} {% set class_succes = '' %} {% if readonly == true %} {% if composant.type.id == 5 %} {% set class_succes = 'attente' %} {% elseif session_reussi %} {% set class_succes = 'juste' %} {% else %} {% set class_succes = 'faux' %} {% endif %} {% endif %} {% if est_apercu %} {% set class_succes = 'juste' %} {% endif %}
    {% if est_apercu %}

    Solution : 

    {% else %}

    Bonne réponse !

    {% endif %}

    Mauvaise réponse !

    {% set commentaire = 'En attente de correction...' %} {% set note = '' %} {% if session_note is defined %} {% if session_note|length>0 %} {% set note = session_note %} {% set commentaire = '' %} {% endif %} {% endif %} {% if session_commentaire is defined %} {% if session_commentaire|length>0 %} {% set commentaire = session_commentaire %} {% endif %} {% endif %} {% if note != '' %}{{ note }}{% endif %}{% if note != '' and commentaire != '' %} | {% endif %}{% if commentaire != '' %}{{ commentaire }}{% endif %}

    {% if est_apercu == false %}

    Solution : 

    {% endif %}
    {% endif %}
    {% endif %} {# fin si json #}