summaryrefslogtreecommitdiff
path: root/alarm/node_modules/pronote-api/src/fetch/pronote/marks.js
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2023-01-10 14:54:04 +0100
committerMinteck <contact@minteck.org>2023-01-10 14:54:04 +0100
commit99c1d9af689e5325f3cf535c4007b3aeb8325229 (patch)
treee663b3c2ebdbd67c818ac0c5147f0ce1d2463cda /alarm/node_modules/pronote-api/src/fetch/pronote/marks.js
parent9871b03912fc28ad38b4037ebf26a78aa937baba (diff)
downloadpluralconnect-99c1d9af689e5325f3cf535c4007b3aeb8325229.tar.gz
pluralconnect-99c1d9af689e5325f3cf535c4007b3aeb8325229.tar.bz2
pluralconnect-99c1d9af689e5325f3cf535c4007b3aeb8325229.zip
Update - This is an automated commit
Diffstat (limited to 'alarm/node_modules/pronote-api/src/fetch/pronote/marks.js')
-rw-r--r--alarm/node_modules/pronote-api/src/fetch/pronote/marks.js71
1 files changed, 0 insertions, 71 deletions
diff --git a/alarm/node_modules/pronote-api/src/fetch/pronote/marks.js b/alarm/node_modules/pronote-api/src/fetch/pronote/marks.js
deleted file mode 100644
index dcb7644..0000000
--- a/alarm/node_modules/pronote-api/src/fetch/pronote/marks.js
+++ /dev/null
@@ -1,71 +0,0 @@
-const parse = require('../../data/types');
-const { toPronote } = require('../../data/objects');
-
-const navigate = require('./navigate');
-
-const PAGE_NAME = 'DernieresNotes';
-const TAB_ID = 198;
-const ACCOUNTS = ['student', 'parent'];
-
-async function getMarks(session, user, period)
-{
- const marks = await navigate(session, user, PAGE_NAME, TAB_ID, ACCOUNTS, {
- Periode: period.name ? toPronote(period) : period
- });
-
- if (!marks) {
- return null;
- }
-
- const result = {};
-
- if (marks.moyGenerale) {
- result.studentAverage = parse(marks.moyGenerale);
- result.studentAverageScale = parse(marks.baremeMoyGenerale);
- result.defaultStudentAverageScale = parse(marks.baremeMoyGeneraleParDefaut);
- }
-
- if (marks.moyGeneraleClasse) {
- result.studentClassAverage = parse(marks.moyGeneraleClasse);
- }
-
- return {
- ...result,
- subjects: marks.avecDetailService && parse(marks.listeServices, ({
- ordre, estServiceEnGroupe,
- moyEleve, baremeMoyEleve, baremeMoyEleveParDefaut, moyClasse, moyMax, moyMin,
- couleur
- }) => ({
- position: ordre,
- isGroupSubject: estServiceEnGroupe,
- studentAverage: parse(moyEleve),
- studentAverageScale: parse(baremeMoyEleve),
- defaultStudentAverageScale: parse(baremeMoyEleveParDefaut),
- studentClassAverage: parse(moyClasse),
- maxAverage: parse(moyMax),
- minAverage: parse(moyMin),
- color: couleur
- })) || [],
- marks: marks.avecDetailDevoir && parse(marks.listeDevoirs, ({
- note, bareme, baremeParDefaut, date, service, periode, moyenne, estEnGroupe, noteMax, noteMin,
- commentaire, coefficient
- }) => ({
- subject: parse(service, ({ couleur }) => ({
- color: couleur
- })),
- title: commentaire,
- value: parse(note),
- scale: parse(bareme),
- average: parse(moyenne),
- defaultScale: parse(baremeParDefaut),
- coefficient,
- min: parse(noteMin) || -1,
- max: parse(noteMax) || -1,
- date: parse(date),
- period: parse(periode),
- isGroupMark: estEnGroupe
- })) || []
- };
-}
-
-module.exports = getMarks;