Formulaire évaluation: interdit de définir des évaluations non normales immédiates

This commit is contained in:
Emmanuel Viennet 2024-05-21 20:37:40 +02:00
parent b3331bd886
commit 8e56dc2418
2 changed files with 25 additions and 0 deletions

View File

@ -367,6 +367,9 @@ def evaluation_create_form(
+ "\n".join(H) + "\n".join(H)
+ "\n" + "\n"
+ tf[1] + tf[1]
+ render_template(
"scodoc/forms/evaluation_edit.j2",
)
+ render_template( + render_template(
"scodoc/help/evaluations.j2", is_apc=is_apc, modimpl=modimpl "scodoc/help/evaluations.j2", is_apc=is_apc, modimpl=modimpl
) )

View File

@ -0,0 +1,22 @@
{# Interdit de définir des évaluations non normales "immédiates" #}
<script>
document.addEventListener('DOMContentLoaded', function() {
var evaluationTypeSelect = document.getElementById('tf_evaluation_type');
var publishIncompleteCheckbox = document.querySelector('input[type="checkbox"][name="publish_incomplete:list"]');
function updateCheckboxState() {
if (evaluationTypeSelect.value !== '0') {
publishIncompleteCheckbox.disabled = true;
publishIncompleteCheckbox.checked = false; // Ensure the checkbox is not checked
} else {
publishIncompleteCheckbox.disabled = false;
}
}
// Add event listener to select element
evaluationTypeSelect.addEventListener('change', updateCheckboxState);
// Initial call to set the correct state when the page loads
updateCheckboxState();
});
</script>