diff --git a/anatomy/templates/anatomy/mark2.html b/anatomy/templates/anatomy/mark2.html index 877a2bf6..6de0d9c1 100644 --- a/anatomy/templates/anatomy/mark2.html +++ b/anatomy/templates/anatomy/mark2.html @@ -14,6 +14,7 @@ {% if request.user.is_superuser %} Admin Edit {% endif %} + Classic mark
{{ question.question_type }}
{% if question.structure %} @@ -42,12 +43,11 @@
{% if question_details.current > 1 %} - Previous + {% endif %} {% if question_details.current < question_details.total %} - Next - Classic mark + {% endif %}
@@ -272,6 +272,31 @@ initMark2(); }); + // Ensure the hidden marked_answers field is updated before any form submit + const postForm = document.querySelector('form.post-form'); + if (postForm) { + postForm.addEventListener('submit', function(e){ + try { updateMarkedAnswersField(); } catch (err) { /* still submit */ } + }); + } + + // Copy-to-clipboard handler for dropdown items + document.addEventListener('click', function(e){ + const btn = e.target.closest('.copy-to-clipboard'); + if (!btn) return; + const text = btn.getAttribute('data-text'); + if (!text) return; + try { + navigator.clipboard.writeText(text); + // simple visual feedback: change the button text briefly + const prev = btn.textContent; + btn.textContent = 'Copied'; + setTimeout(function(){ btn.textContent = prev; }, 1200); + } catch (err) { + console.warn('copy failed', err); + } + }); + })(); {% endblock %} diff --git a/anatomy/templates/anatomy/partials/mark2_exam_marked_fragment.html b/anatomy/templates/anatomy/partials/mark2_exam_marked_fragment.html index 23d1512f..93cfdbed 100644 --- a/anatomy/templates/anatomy/partials/mark2_exam_marked_fragment.html +++ b/anatomy/templates/anatomy/partials/mark2_exam_marked_fragment.html @@ -19,15 +19,15 @@
{{ it.answer }}
{% if it.mark == 'correct' %} - 2 + 2 {% elif it.mark == 'half-correct' %} - 1 + 1 {% elif it.mark == 'incorrect' %} - 0 + 0 {% else %} - - + - {% endif %} - {{ it.count }} + {{ it.count }}
{% endfor %} diff --git a/anatomy/templates/anatomy/partials/mark2_marked_list_fragment.html b/anatomy/templates/anatomy/partials/mark2_marked_list_fragment.html index af1ea860..aedaa27b 100644 --- a/anatomy/templates/anatomy/partials/mark2_marked_list_fragment.html +++ b/anatomy/templates/anatomy/partials/mark2_marked_list_fragment.html @@ -1,10 +1,52 @@ {% comment %}Renders only the list items for already-marked answers (used as a partial){% endcomment %} {% for answer in correct_answers %} -
  • {{ answer }}
  • + {% with answer_url=answer|urlencode:'' %} +
  • +
    +
    + + +
    +
    +
    {{ answer }}
    +
  • + {% endwith %} {% endfor %} {% for answer in half_mark_answers %} -
  • {{ answer }}
  • + {% with answer_url=answer|urlencode:'' %} +
  • +
    +
    + + +
    +
    +
    {{ answer }}
    +
  • + {% endwith %} {% endfor %} {% for answer in incorrect_answers %} -
  • {{ answer }}
  • + {% with answer_url=answer|urlencode:'' %} +
  • +
    +
    + + +
    +
    +
    {{ answer }}
    +
  • + {% endwith %} {% endfor %} diff --git a/anatomy/templates/anatomy/partials/mark2_unmarked_list_fragment.html b/anatomy/templates/anatomy/partials/mark2_unmarked_list_fragment.html index fcb015e3..9285dd20 100644 --- a/anatomy/templates/anatomy/partials/mark2_unmarked_list_fragment.html +++ b/anatomy/templates/anatomy/partials/mark2_unmarked_list_fragment.html @@ -1,8 +1,34 @@ {% comment %}Renders only the list items for unmarked answers (used as a partial){% endcomment %} {% for answer in user_answers %} - {% if answer in answer_suggest_incorrect %} -
  • {{ answer }}
  • - {% else %} -
  • {{ answer }}
  • - {% endif %} + {% with answer_url=answer|urlencode:'' %} + {% if answer in answer_suggest_incorrect %} +
  • +
    +
    + + +
    +
    +
    {{ answer }}
    +
  • + {% else %} +
  • +
    +
    + + +
    +
    +
    {{ answer }}
    +
  • + {% endif %} + {% endwith %} {% endfor %}