Commit 2dcb8bc0 authored by BERTHAUT Florent's avatar BERTHAUT Florent
Browse files

Fixed UE nb for stages

parent 90f1b556
......@@ -194,18 +194,44 @@ function parseGuides(fiches) {
guid.set(f["Semestre"], []);
}
//add the fiche fill to the specialisation/year/semester
let sem = guid.get(f["Semestre"]);
sem.push(JSON.parse(JSON.stringify(f)));
//change the EC Name for co-build languages
//if(f["Année"]=="L3") {
if((f["Parcours"]+"").includes("portugais")) {
sem[sem.length-1]["Nom EC"]="Portugais : "
+sem[sem.length-1]["Nom EC"];
}
else if((f["Parcours"]+"").includes("suédois")) {
sem[sem.length-1]["Nom EC"]="Suédois : "
+sem[sem.length-1]["Nom EC"];
}
else if((f["Parcours"]+"").includes("chinois")) {
sem[sem.length-1]["Nom EC"]="Chinois : "
+sem[sem.length-1]["Nom EC"];
}
else if((f["Parcours"]+"").includes("néerlandais")) {
sem[sem.length-1]["Nom EC"]="Néerlandais : "
+sem[sem.length-1]["Nom EC"];
}
else if((f["Parcours"]+"").includes("russe")) {
sem[sem.length-1]["Nom EC"]="Russe : "
+sem[sem.length-1]["Nom EC"];
}
//}
//change UE number depending on parcours for L3
if(f["Année"]=="L3" && (guideName=="L3 TCI" || guideName=="L3 MPT")) {
if(f["Semestre"]==5 && f["UE"]==7 && f["Parcours"].split(",").length>1) { //Stages
console.log("In "+guideName);
if(f["UE"]==7 && (f["Nom UE"]+"").includes("Projet")) { //Stages
sem[sem.length-1]["UE"]=5;
console.log("Changing fiche ", sem[sem.length-1]);
}
else if(f["UE"]==4 && (f["Nom UE"]+"").includes("anglais")) {
sem[sem.length-1]["UE"]=3;
......@@ -214,34 +240,34 @@ function parseGuides(fiches) {
sem[sem.length-1]["UE"]=4;
}
else if(f["UE"]==6 && (f["Nom UE"]+"").includes("LV3")) {
sem[sem.length-1]["UE"]=5;
sem[sem.length-1]["UE"]=4;
}
}
}
}
for(let guideName of guides.keys()) {
console.log("\nGuide "+guideName);
let guid = guides.get(guideName);
for(let semStr of guid.keys()) {
console.log("Semestre "+semStr);
let sem = guid.get(semStr);
//sort according to UE/EC
sem.sort(function(a,b) {
if(a["UE"]<b["UE"]
|| (a["UE"]==b["UE"]
&& b["Nom EC"].localeCompare(a["Nom EC"], 'fr', {ignorePunctuation:true})>0)) {
&& b["Nom EC"].localeCompare(a["Nom EC"],
'fr', {ignorePunctuation:true})>0)) {
return -1;
}
else if(a["UE"]>b["UE"]
|| (a["UE"]==b["UE"]
&& a["Nom EC"].localeCompare(b["Nom EC"], 'fr', {ignorePunctuation:true})>0)) {
&& a["Nom EC"].localeCompare(b["Nom EC"],
'fr', {ignorePunctuation:true})>0)) {
return 1;
}
return 0;
});
if(guideName=="L3 TCI") {
if(guideName=="L3 MPT") {
for(let ue of sem) {
console.log(ue["UE"]+" "+ue["Nom UE"]+" "+ue["Nom EC"]);
}
......@@ -317,13 +343,6 @@ function writeFilteredFicheToStr(guide, guideName, f) {
let titleSuf = "&nbsp;: </span> ";
let fieldSuf = "</p>\n";
if(f["Année"]=="L1"
&& (f["UE"]==1 || f["UE"]==5 || f["UE"]==6 )) {
let parcSplit = f["Parcours"].split(" ");
guide.str += titlePre+ "Parcours "+parcSplit[0]+"-"+parcSplit[1]+"</span>";
guide.str += fieldSuf;
}
guide.str += titlePre+ "Enseignement" + titleSuf;
guide.str += filterField(f["Nom EC"]);
guide.str += fieldSuf;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment