This commit is contained in:
Emmanuel Viennet 2023-03-22 21:57:40 +01:00
parent 01308561d3
commit 8af5c3ffa0

View File

@ -16,7 +16,7 @@ function is_valid_note(v) {
var note_min = parseFloat($("#eval_note_min").text());
var note_max = parseFloat($("#eval_note_max").text());
if (!v.match("^-?[0-9.]*$")) {
if (!v.match("^-?[0-9]*.?[0-9]*$")) {
return (v == "ABS") || (v == "EXC") || (v == "SUPR") || (v == "ATT") || (v == "DEM");
} else {
var x = parseFloat(v);
@ -51,9 +51,9 @@ function save_note(elem, v, etudid) {
'comment': document.getElementById('formnotes_comment').value
},
function (result) {
if (result['nbchanged'] > 0) {
sco_message("enregistré");
elem.className = "note_saved";
if (result['nbchanged'] > 0) {
// il y avait une decision de jury ?
if (result.existing_decisions[0] == etudid) {
if (v != $(elem).attr('data-orig-value')) {
@ -66,8 +66,12 @@ function save_note(elem, v, etudid) {
if (result['history_menu']) {
$("#hist_" + etudid).html(result['history_menu']);
}
$(elem).attr('data-last-saved-value', v);
} else {
$('#sco_msg').html("").show();
sco_message("valeur non enregistrée");
}
$(elem).attr('data-last-saved-value', v)
}
);
}
@ -123,6 +127,6 @@ function paste_text(e) {
}
}
function masquer_DEM(){
function masquer_DEM() {
document.querySelector("body").classList.toggle("masquer_DEM");
}