Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
InfoLEA
admin
Guide des Études LEA
Commits
d386d7de
Commit
d386d7de
authored
Sep 17, 2020
by
BERTHAUT Florent
Browse files
Fixed fiches order
parent
624cae44
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
input/fiches.csv
View file @
d386d7de
This diff is collapsed.
Click to expand it.
src/leaguide.js
View file @
d386d7de
...
...
@@ -126,9 +126,11 @@ function findFicheInSemester(id, sem) {
//Build a structure of fiches per specialisation/year
function
parseGuides
(
fiches
)
{
console
.
log
(
"
Building guides structure
"
);
//Go through all the fiches
for
(
let
f
of
fiches
)
{
let
guideNames
=
[];
//First decide in which guide(s) the fiche should go
if
(
f
[
"
Année
"
]
==
"
L1
"
||
f
[
"
Année
"
]
==
"
L2
"
)
{
// L1 L2
guideNames
.
push
(
f
[
"
Année
"
]
+
"
LEA
"
);
}
...
...
@@ -149,8 +151,7 @@ function parseGuides(fiches) {
else
if
(
f
[
"
Parcours
"
]
==
fullNames
.
get
(
"
TSM
"
))
{
// TSM
guideNames
.
push
(
f
[
"
Année
"
]
+
"
TSM
"
);
}
else
if
(
f
[
"
Parcours
"
]
==
"
Master LEA - Tronc commun
"
||
f
[
"
Parcours
"
]
==
"
Master LEA - Projet de l'étudiant
"
)
{
//Master LEA
else
if
(
f
[
"
Parcours
"
]
==
"
Master LEA - Tronc commun
"
)
{
guideNames
.
push
(
f
[
"
Année
"
]
+
"
LEA TCI
"
);
guideNames
.
push
(
f
[
"
Année
"
]
+
"
LEA RICI
"
);
guideNames
.
push
(
f
[
"
Année
"
]
+
"
LEA MPT
"
);
...
...
@@ -161,6 +162,12 @@ function parseGuides(fiches) {
guideNames
.
push
(
f
[
"
Année
"
]
+
"
LEA MPT Pro
"
);
guideNames
.
push
(
f
[
"
Année
"
]
+
"
LEA ANI Pro
"
);
}
else
if
(
f
[
"
Parcours
"
]
==
"
Master LEA - Projet de l'étudiant
"
)
{
guideNames
.
push
(
f
[
"
Année
"
]
+
"
LEA TCI
"
);
guideNames
.
push
(
f
[
"
Année
"
]
+
"
LEA RICI
"
);
guideNames
.
push
(
f
[
"
Année
"
]
+
"
LEA MPT
"
);
guideNames
.
push
(
f
[
"
Année
"
]
+
"
LEA ANI
"
);
}
else
if
(
f
[
"
Parcours
"
]
==
"
Master Apprentissage - Contrat Pro - Tronc commun
"
)
{
guideNames
.
push
(
f
[
"
Année
"
]
+
"
LEA TCI Pro
"
);
guideNames
.
push
(
f
[
"
Année
"
]
+
"
LEA RICI Pro
"
);
...
...
@@ -169,33 +176,32 @@ function parseGuides(fiches) {
}
else
if
(
f
[
"
Parcours
"
]
==
fullNames
.
get
(
"
ANI
"
))
{
guideNames
.
push
(
f
[
"
Année
"
]
+
"
LEA ANI
"
);
guideNames
.
push
(
f
[
"
Année
"
]
+
"
LEA ANI Pro
"
);
}
else
if
(
f
[
"
Parcours
"
]
==
fullNames
.
get
(
"
ANI
"
)
+
fullNames
.
get
(
"
Pro
"
))
{
guideNames
.
push
(
f
[
"
Année
"
]
+
"
LEA ANI Pro
"
);
}
else
if
(
f
[
"
Parcours
"
]
==
fullNames
.
get
(
"
TCI
"
))
{
guideNames
.
push
(
f
[
"
Année
"
]
+
"
LEA TCI
"
);
guideNames
.
push
(
f
[
"
Année
"
]
+
"
LEA TCI Pro
"
);
}
else
if
(
f
[
"
Parcours
"
]
==
fullNames
.
get
(
"
TCI
"
)
+
fullNames
.
get
(
"
Pro
"
))
{
guideNames
.
push
(
f
[
"
Année
"
]
+
"
LEA TCI Pro
"
);
}
else
if
(
f
[
"
Parcours
"
]
==
fullNames
.
get
(
"
RICI
"
))
{
guideNames
.
push
(
f
[
"
Année
"
]
+
"
LEA RICI
"
);
guideNames
.
push
(
f
[
"
Année
"
]
+
"
LEA RICI Pro
"
);
}
else
if
(
f
[
"
Parcours
"
]
==
fullNames
.
get
(
"
RICI
"
)
+
fullNames
.
get
(
"
Pro
"
))
{
guideNames
.
push
(
f
[
"
Année
"
]
+
"
LEA RICI Pro
"
);
}
else
if
(
f
[
"
Parcours
"
]
==
fullNames
.
get
(
"
MPT
"
))
{
guideNames
.
push
(
f
[
"
Année
"
]
+
"
LEA MPT
"
);
guideNames
.
push
(
f
[
"
Année
"
]
+
"
LEA MPT Pro
"
);
}
else
if
(
f
[
"
Parcours
"
]
==
fullNames
.
get
(
"
MPT
"
)
+
fullNames
.
get
(
"
Pro
"
))
{
guideNames
.
push
(
f
[
"
Année
"
]
+
"
LEA MPT Pro
"
);
}
//For each guide in which the fiche should be added
//make modifications
for
(
let
guideName
of
guideNames
)
{
//if year / specialisation does not already exists
if
(
!
guides
.
has
(
guideName
))
{
...
...
@@ -218,9 +224,6 @@ function parseGuides(fiches) {
let
existing
=
findFicheInSemester
(
id
,
sem
);
//if the fiche already exists
if
(
existing
>=
0
)
{
console
.
log
(
"
found previous
"
);
console
.
log
(
f
[
"
Parcours
"
]);
console
.
log
(
sem
[
existing
][
"
Parcours
"
]);
//if new one is pro, replace old one
if
(
!
sem
[
existing
][
"
Parcours
"
].
includes
(
"
Pro
"
))
{
sem
[
existing
]
=
JSON
.
parse
(
JSON
.
stringify
(
f
));
...
...
@@ -235,27 +238,53 @@ function parseGuides(fiches) {
}
//change the EC Name for co-build languages
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
"
];
/*
for(let lang of ["portugais", "suédois",
"chinois", "néerlandais", "russe"]) {
if((f["Parcours"]+"").includes(lang)) {
sem[sem.length-1]["Nom EC"]=lang[0].toUpperCase()
+lang.substr(1)+" : "
+sem[sem.length-1]["Nom EC"];
//sem[sem.length-1]["Nom UE"]+=" - "
// +lang[0].toUpperCase()
// +lang.substr(1);
}
}*/
if
((
f
[
"
Nom UE
"
]
+
""
).
includes
(
"
LV2
"
)
||
(
f
[
"
Nom UE
"
]
+
""
).
includes
(
"
langue étrangère B
"
)
||
(
f
[
"
Nom UE
"
]
+
""
).
includes
(
"
socio-culturelle
"
))
{
if
((
f
[
"
Nom EC
"
]
+
""
).
includes
(
"
Anglais
"
))
{
sem
[
sem
.
length
-
1
][
"
Nom UE
"
]
+=
"
- Anglais
"
;
}
else
{
for
(
let
lang
of
[
"
portugais
"
,
"
suédois
"
,
"
espagnol
"
,
"
allemand
"
,
"
italien
"
,
"
français
"
,
"
polonais
"
,
"
chinois
"
,
"
néerlandais
"
,
"
russe
"
])
{
if
((
f
[
"
Parcours
"
]
+
""
).
includes
(
lang
))
{
sem
[
sem
.
length
-
1
][
"
Nom UE
"
]
+=
"
-
"
+
lang
[
0
].
toUpperCase
()
+
lang
.
substr
(
1
);
}
}
}
}
else
if
((
f
[
"
Parcours
"
]
+
""
).
includes
(
"
russe
"
))
{
sem
[
sem
.
length
-
1
][
"
Nom EC
"
]
=
"
Russe :
"
+
sem
[
sem
.
length
-
1
][
"
Nom EC
"
];
//add enseignants référents to enseignants if not already there
if
(
!
(
f
[
"
Enseignant.e.s
"
]
+
""
)
.
includes
(
f
[
"
Enseignant.e référent.e
"
].
split
(
"
"
)[
0
])){
sem
[
sem
.
length
-
1
][
"
Enseignant.e.s
"
]
=
f
[
"
Enseignant.e référent.e
"
];
if
(
f
[
"
Enseignant.e.s
"
].
length
>
0
)
{
sem
[
sem
.
length
-
1
][
"
Enseignant.e.s
"
]
+=
"
,
"
+
f
[
"
Enseignant.e.s
"
];
}
}
//change UE number depending on parcours for L3
if
(
f
[
"
Année
"
]
==
"
L3
"
&&
(
guideName
==
"
L3 TCI
"
||
guideName
==
"
L3 MPT
"
))
{
...
...
@@ -277,26 +306,17 @@ function parseGuides(fiches) {
for
(
let
guideName
of
guides
.
keys
())
{
let
guid
=
guides
.
get
(
guideName
);
let
semesters
=
[];
for
(
let
semStr
of
guid
.
keys
())
{
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
))
{
return
-
1
;
}
else
if
(
a
[
"
UE
"
]
>
b
[
"
UE
"
]
||
(
a
[
"
UE
"
]
==
b
[
"
UE
"
]
&&
a
[
"
Nom EC
"
].
localeCompare
(
b
[
"
Nom EC
"
],
'
fr
'
,
{
ignorePunctuation
:
true
})
>
0
))
{
return
1
;
}
return
0
;
return
(
a
[
"
UE
"
]
+
a
[
"
Nom UE
"
]
+
a
[
"
Nom EC
"
])
.
localeCompare
(
b
[
"
UE
"
]
+
b
[
"
Nom UE
"
]
+
b
[
"
Nom EC
"
],
'
fr
'
,
{
ignorePunctuation
:
true
});
});
if
(
guideName
==
"
M1 LEA
MPT
Pro
"
)
{
if
(
guideName
==
"
M1 LEA
TCI
Pro
"
)
{
for
(
let
ue
of
sem
)
{
console
.
log
(
ue
[
"
UE
"
]
+
"
"
+
ue
[
"
Nom UE
"
]
+
"
"
+
ue
[
"
Nom EC
"
]
+
"
"
+
ue
[
"
Parcours
"
]);
...
...
@@ -349,6 +369,7 @@ function writeFilteredFicheToStr(guide, guideName, f) {
const
empty
=
/
\s
*/
;
guide
.
str
+=
"
<p>
\n
"
;
guide
.
str
+=
"
<i> Université de Lille - UFR LEA -
"
;
switch
(
guideName
)
{
case
"
L1 LEA
"
:
...
...
@@ -361,6 +382,8 @@ function writeFilteredFicheToStr(guide, guideName, f) {
}
break
;
}
guide
.
str
+=
"
- Semestre
"
+
f
[
"
Semestre
"
]
+
"
</i>
\n
"
;
guide
.
str
+=
"
</p>
\n
"
;
guide
.
str
+=
"
<p> </p>
\n
"
;
guide
.
str
+=
"
<p>
\n
"
;
//guide.str += "<span custom-style='Titre 1 Car1'>S"+f["Semestre"]+" ";
...
...
@@ -473,9 +496,14 @@ function saveToDoc(guideName) {
let
guide
=
{};
guide
.
str
=
""
;
//add all the fiches
for
(
let
sem
of
guides
.
get
(
guideName
).
values
())
{
for
(
let
f
of
sem
)
{
//add all the fiches in semester order
let
semesters
=
[];
for
(
let
sem
of
guides
.
get
(
guideName
).
keys
())
{
semesters
.
push
(
sem
);
}
semesters
.
sort
();
for
(
let
sem
of
semesters
)
{
for
(
let
f
of
guides
.
get
(
guideName
).
get
(
sem
))
{
writeFilteredFicheToStr
(
guide
,
guideName
,
f
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment