Skip to content
Snippets Groups Projects
Commit 1d07266c authored by Abdallah Toumji's avatar Abdallah Toumji
Browse files

Ticket 1018: Linked the js to the page to allow the user to import note

parent e3cacd9c
No related branches found
No related tags found
No related merge requests found
......@@ -56,6 +56,28 @@ function valid_note(e) {
let isSaving = false; // true si requête en cours
// Ticket 1018: Change the stored evaluation data when the user selects a different evaluation to import
let selectedImportEvaluationData = {};
function set_import_eval(e, data) {
const eval = data[e.value];
selectedImportEvaluationData = eval;
}
// Ticket 1018: Import the selected evaluation data into the form thus importing the notes
function valid_import() {
console.log('valid_import', selectedImportEvaluationData);
let noteInputs = document.querySelectorAll('#formnotes .note');
noteInputs.forEach(function (input) {
const etudid = parseInt(input.getAttribute('data-etudid'));
const note = selectedImportEvaluationData[etudid];
if (note) {
// trigger the event listener
input.value = note;
}
});
}
async function save_note(elem, v, etudid) {
let evaluation_id = document.querySelector("#formnotes_evaluation_id").getAttribute("value");
let formsemestre_id = document.querySelector("#formnotes_formsemestre_id").getAttribute("value");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment