Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SCODOC_R6A06
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Paul-louis Gomis
SCODOC_R6A06
Commits
d98eb7dc
Commit
d98eb7dc
authored
8 months ago
by
Emmanuel Viennet
Browse files
Options
Downloads
Patches
Plain Diff
Améliore formsemestre_list_saisies_notes
parent
6cd28853
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/scodoc/sco_undo_notes.py
+99
-46
99 additions, 46 deletions
app/scodoc/sco_undo_notes.py
app/templates/formsemestre/list_saisies_notes.j2
+25
-2
25 additions, 2 deletions
app/templates/formsemestre/list_saisies_notes.j2
sco_version.py
+1
-1
1 addition, 1 deletion
sco_version.py
with
125 additions
and
49 deletions
app/scodoc/sco_undo_notes.py
+
99
−
46
View file @
d98eb7dc
...
@@ -180,7 +180,28 @@ def evaluation_list_operations(evaluation_id: int):
...
@@ -180,7 +180,28 @@ def evaluation_list_operations(evaluation_id: int):
return
tab
.
make_page
()
return
tab
.
make_page
()
def
formsemestre_list_saisies_notes
(
formsemestre_id
,
only_modifs
=
False
,
fmt
=
"
html
"
):
def
formsemestre_list_notes_intervenants
(
formsemestre
:
FormSemestre
)
->
list
[
User
]:
"
Liste des comptes ayant saisi au moins une note dans le semestre
"
q1
=
(
User
.
query
.
join
(
NotesNotes
)
.
join
(
Evaluation
)
.
join
(
ModuleImpl
)
.
filter_by
(
formsemestre_id
=
formsemestre
.
id
)
.
distinct
()
)
q2
=
(
User
.
query
.
join
(
NotesNotesLog
)
.
join
(
Evaluation
,
Evaluation
.
id
==
NotesNotesLog
.
evaluation_id
)
.
join
(
ModuleImpl
)
.
filter_by
(
formsemestre_id
=
formsemestre
.
id
)
.
distinct
()
)
return
sorted
(
q1
.
union
(
q2
).
all
(),
key
=
lambda
x
:
x
.
sort_key
())
def
formsemestre_list_saisies_notes
(
formsemestre_id
,
only_modifs
=
False
,
user_name
:
str
|
None
=
None
,
fmt
=
"
html
"
):
"""
Table listant toutes les opérations de saisies de notes, dans toutes
"""
Table listant toutes les opérations de saisies de notes, dans toutes
les évaluations du semestre.
les évaluations du semestre.
"""
"""
...
@@ -194,15 +215,17 @@ def formsemestre_list_saisies_notes(formsemestre_id, only_modifs=False, fmt="htm
...
@@ -194,15 +215,17 @@ def formsemestre_list_saisies_notes(formsemestre_id, only_modifs=False, fmt="htm
.
filter_by
(
formsemestre_id
=
formsemestre
.
id
)
.
filter_by
(
formsemestre_id
=
formsemestre
.
id
)
.
order_by
(
model
.
date
.
desc
())
.
order_by
(
model
.
date
.
desc
())
)
)
if
user_name
:
user
=
db
.
session
.
query
(
User
).
filter_by
(
user_name
=
user_name
).
first
()
if
user
:
notes_query
=
notes_query
.
join
(
User
).
filter
(
model
.
uid
==
user
.
id
)
# Formate les notes
# Formate les notes
keep_numeric
=
fmt
in
scu
.
FORMATS_NUMERIQUES
keep_numeric
=
fmt
in
scu
.
FORMATS_NUMERIQUES
rows
=
[]
rows
=
[]
for
note
in
notes_query
:
for
note
in
notes_query
:
ens
=
User
.
get_user
(
note
.
uid
)
ens
=
User
.
get_user
(
note
.
uid
)
evaluation
=
note
.
evaluation
evaluation
=
note
.
evaluation
rows
.
append
(
row
=
{
{
"
date
"
:
note
.
date
.
strftime
(
scu
.
DATEATIME_FMT
),
"
date
"
:
note
.
date
.
strftime
(
scu
.
DATEATIME_FMT
),
"
_date_order
"
:
note
.
date
.
isoformat
(),
"
_date_order
"
:
note
.
date
.
isoformat
(),
"
code_nip
"
:
note
.
etudiant
.
code_nip
,
"
code_nip
"
:
note
.
etudiant
.
code_nip
,
...
@@ -239,7 +262,20 @@ def formsemestre_list_saisies_notes(formsemestre_id, only_modifs=False, fmt="htm
...
@@ -239,7 +262,20 @@ def formsemestre_list_saisies_notes(formsemestre_id, only_modifs=False, fmt="htm
),
),
"
user_name
"
:
ens
.
user_name
if
ens
else
""
,
"
user_name
"
:
ens
.
user_name
if
ens
else
""
,
}
}
)
if
only_modifs
:
# si c'est une modif de note, ajoute une colonne avec la nouvelle valeur
new
=
NotesNotes
.
query
.
filter_by
(
evaluation_id
=
note
.
evaluation_id
,
etudid
=
note
.
etudid
).
first
()
if
new
:
row
[
"
new_value
"
]
=
scu
.
fmt_note
(
new
.
value
,
keep_numeric
=
keep_numeric
)
row
[
"
old_date
"
]
=
row
[
"
date
"
]
row
[
"
_old_date_order
"
]
=
row
[
"
_date_order
"
]
row
[
"
date
"
]
=
new
.
date
.
strftime
(
scu
.
DATEATIME_FMT
)
row
[
"
_date_order
"
]
=
new
.
date
.
isoformat
()
rows
.
append
(
row
)
columns_ids
=
(
columns_ids
=
(
"
date
"
,
"
date
"
,
...
@@ -247,6 +283,13 @@ def formsemestre_list_saisies_notes(formsemestre_id, only_modifs=False, fmt="htm
...
@@ -247,6 +283,13 @@ def formsemestre_list_saisies_notes(formsemestre_id, only_modifs=False, fmt="htm
"
nom
"
,
"
nom
"
,
"
prenom
"
,
"
prenom
"
,
"
value
"
,
"
value
"
,
)
if
only_modifs
:
columns_ids
+=
(
"
new_value
"
,
"
old_date
"
,
)
columns_ids
+=
(
"
user_name
"
,
"
user_name
"
,
"
module
"
,
"
module
"
,
"
evaluation
"
,
"
evaluation
"
,
...
@@ -257,7 +300,8 @@ def formsemestre_list_saisies_notes(formsemestre_id, only_modifs=False, fmt="htm
...
@@ -257,7 +300,8 @@ def formsemestre_list_saisies_notes(formsemestre_id, only_modifs=False, fmt="htm
"
code_nip
"
:
"
NIP
"
,
"
code_nip
"
:
"
NIP
"
,
"
nom
"
:
"
nom
"
,
"
nom
"
:
"
nom
"
,
"
prenom
"
:
"
prenom
"
,
"
prenom
"
:
"
prenom
"
,
"
date
"
:
"
Date
"
,
"
date
"
:
"
Date modif.
"
if
only_modifs
else
"
Date saisie
"
,
"
old_date
"
:
"
Date saisie précédente
"
,
"
value
"
:
"
Note
"
,
"
value
"
:
"
Note
"
,
"
comment
"
:
"
Remarque
"
,
"
comment
"
:
"
Remarque
"
,
"
user_name
"
:
"
Enseignant
"
,
"
user_name
"
:
"
Enseignant
"
,
...
@@ -266,6 +310,9 @@ def formsemestre_list_saisies_notes(formsemestre_id, only_modifs=False, fmt="htm
...
@@ -266,6 +310,9 @@ def formsemestre_list_saisies_notes(formsemestre_id, only_modifs=False, fmt="htm
"
evaluation
"
:
"
Evaluation
"
,
"
evaluation
"
:
"
Evaluation
"
,
"
date_evaluation
"
:
"
Date éval.
"
,
"
date_evaluation
"
:
"
Date éval.
"
,
}
}
if
only_modifs
:
titles
[
"
value
"
]
=
"
Ancienne note
"
titles
[
"
new_value
"
]
=
"
Nouvelle note
"
table
=
GenTable
(
table
=
GenTable
(
titles
=
titles
,
titles
=
titles
,
columns_ids
=
columns_ids
,
columns_ids
=
columns_ids
,
...
@@ -277,13 +324,17 @@ def formsemestre_list_saisies_notes(formsemestre_id, only_modifs=False, fmt="htm
...
@@ -277,13 +324,17 @@ def formsemestre_list_saisies_notes(formsemestre_id, only_modifs=False, fmt="htm
caption
=
f
"
Saisies de notes dans
{
formsemestre
.
titre_annee
()
}
"
,
caption
=
f
"
Saisies de notes dans
{
formsemestre
.
titre_annee
()
}
"
,
preferences
=
sco_preferences
.
SemPreferences
(
formsemestre_id
),
preferences
=
sco_preferences
.
SemPreferences
(
formsemestre_id
),
base_url
=
f
"""
{
request
.
base_url
}
?formsemestre_id=
{
base_url
=
f
"""
{
request
.
base_url
}
?formsemestre_id=
{
formsemestre_id
}
&only_modifs=
{
int
(
only_modifs
)
}
"""
,
formsemestre_id
}
&only_modifs=
{
int
(
only_modifs
)
}
"""
+
(
f
"
&user_name=
{
user_name
}
"
if
user_name
else
""
),
origin
=
f
"
Généré par
{
sco_version
.
SCONAME
}
le
"
+
scu
.
timedate_human_repr
()
+
""
,
origin
=
f
"
Généré par
{
sco_version
.
SCONAME
}
le
"
+
scu
.
timedate_human_repr
()
+
""
,
table_id
=
"
formsemestre_list_saisies_notes
"
,
table_id
=
"
formsemestre_list_saisies_notes
"
,
filename
=
(
filename
=
(
f
"
modifs_notes_S
{
formsemestre
.
semestre_id
}
"
(
f
"
modifs_notes-S
{
formsemestre
.
semestre_id
}
"
if
only_modifs
if
only_modifs
else
f
"
saisies_notes_S
{
formsemestre
.
semestre_id
}
"
else
f
"
saisies_notes_S
{
formsemestre
.
semestre_id
}
"
)
+
(
"
-
"
+
user_name
if
user_name
else
""
)
),
),
)
)
if
fmt
==
"
html
"
:
if
fmt
==
"
html
"
:
...
@@ -293,6 +344,8 @@ def formsemestre_list_saisies_notes(formsemestre_id, only_modifs=False, fmt="htm
...
@@ -293,6 +344,8 @@ def formsemestre_list_saisies_notes(formsemestre_id, only_modifs=False, fmt="htm
title
=
"
Opérations de saisies de notes
"
,
title
=
"
Opérations de saisies de notes
"
,
only_modifs
=
only_modifs
,
only_modifs
=
only_modifs
,
formsemestre_id
=
formsemestre
.
id
,
formsemestre_id
=
formsemestre
.
id
,
intervenants
=
formsemestre_list_notes_intervenants
(
formsemestre
),
user_name
=
user_name
,
)
)
return
table
.
make_page
(
fmt
=
fmt
,
page_title
=
"
Opérations de saisies de notes
"
)
return
table
.
make_page
(
fmt
=
fmt
,
page_title
=
"
Opérations de saisies de notes
"
)
...
...
This diff is collapsed.
Click to expand it.
app/templates/formsemestre/list_saisies_notes.j2
+
25
−
2
View file @
d98eb7dc
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
{% block styles %}
{% block styles %}
{{super()}}
{{super()}}
<style>
<style>
.
export_xls_but
{
.
h-spaced
{
margin-left: 32px;
margin-left: 32px;
}
}
</style>
</style>
...
@@ -22,7 +22,19 @@
...
@@ -22,7 +22,19 @@
{% if only_modifs %}checked{% endif %}>
{% if only_modifs %}checked{% endif %}>
Lister uniquement les modifications
Lister uniquement les modifications
</label>
</label>
<span class="export_xls_but">{{table.xls_export_button()|safe}} excel</span>
<label class="h-spaced" for="user-select">Restreindre à un enseignant :</label>
<select id="user-select" name="user_name">
<option value="">Choisir...</option>
{% for user in intervenants %}
<option value="{{ user.user_name }}"
{% if user.user_name == user_name %}selected{% endif %}>
{{ user.get_nomplogin() }}
</option>
{% endfor %}
</select>
<span class="h-spaced">{{table.xls_export_button()|safe}} excel</span>
</form>
</form>
{{table.html()|safe}}
{{table.html()|safe}}
...
@@ -44,5 +56,16 @@
...
@@ -44,5 +56,16 @@
window.location.href = url.toString();
window.location.href = url.toString();
});
});
document.getElementById('user-select').addEventListener('change', function() {
var form = document.getElementById('filter-form');
var userName = this.value;
var url = new URL(window.location.href);
url.searchParams.set('formsemestre_id', {{formsemestre_id}});
url.searchParams.set('user_name', userName);
window.location.href = url.toString();
});
</script>
</script>
{% endblock %}
{% endblock %}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
sco_version.py
+
1
−
1
View file @
d98eb7dc
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
"
Infos sur version ScoDoc
"
"
Infos sur version ScoDoc
"
SCOVERSION
=
"
9.7.4
0
"
SCOVERSION
=
"
9.7.4
1
"
SCONAME
=
"
ScoDoc
"
SCONAME
=
"
ScoDoc
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment