Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Abdallah Toumji
R6A06
Commits
e3cacd9c
Commit
e3cacd9c
authored
3 months ago
by
Abdallah Toumji
Browse files
Options
Downloads
Patches
Plain Diff
Ticket 1018 : Added a selector in the "saisie note" page to import notes from another evaluation
parent
479df931
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/scodoc/sco_saisie_notes.py
+57
-0
57 additions, 0 deletions
app/scodoc/sco_saisie_notes.py
with
57 additions
and
0 deletions
app/scodoc/sco_saisie_notes.py
+
57
−
0
View file @
e3cacd9c
...
@@ -997,6 +997,63 @@ def _form_saisie_notes(
...
@@ -997,6 +997,63 @@ def _form_saisie_notes(
method
=
"
GET
"
,
method
=
"
GET
"
,
)
)
H
.
append
(
tf
.
getform
())
# check and init
H
.
append
(
tf
.
getform
())
# check and init
# Ticket 1018: Import notes from another evaluation
# Add a select element to import notes from another evaluation
# On selection change, the notes will be imported
formsemestre
=
FormSemestre
.
get_formsemestre
(
formsemestre_id
)
evaluations
=
formsemestre
.
get_evaluations
()
rows
=
{}
# Create a dictionary with the notes of each evaluation for each student
for
e
in
evaluations
:
notes
=
sco_evaluation_db
.
do_evaluation_get_all_notes
(
e
.
id
)
for
id
,
note
in
notes
.
items
():
if
e
.
id
not
in
rows
:
rows
[
e
.
id
]
=
{}
rows
[
e
.
id
][
id
]
=
note
[
'
value
'
]
if
len
(
evaluations
)
>
1
:
H
.
append
(
f
'
<select data-etudid=
"
{
etudid
}
"
class=
"
note_noteImporteur
"
onchange=
"
set_import_eval(this,
{
rows
}
)
"
>
'
)
# Add the default option "Sélectionner une évaluation à importer"
H
.
append
(
'
<option value=
"
x
"
disabled selected>Sélectionner une évaluation à importer</option>
'
)
for
i
in
evaluations
:
# Skip the current evaluation
if
i
.
id
==
evaluation
.
id
:
continue
# Add the others evaluations
H
.
append
(
f
'
<option value=
"
{
i
.
id
}
"
>
{
"
todo titre module
"
}
-
{
i
.
description
}
</option>
'
)
H
.
append
(
'
</select>
'
)
H
.
append
(
"""
<script>
window.onload = function() {
// Get the select element
const selectElement = document.querySelector(
'
.note_noteImporteur
'
);
// Reset the selection to the default option
if (selectElement) {
selectElement.value =
""
; // This will select the
"
Sélectionner une évaluation à importer
"
option
}
}
</script>
"""
)
H
.
append
(
f
"""
<button class=
"
btn btn-primary
"
onclick=
"
valid_import()
"
id=
"
import_notes
"
>Importer les notes</button>
"""
)
else
:
# Span if there is only one evaluation
H
.
append
(
'
<span class=
"
noteImporteur
"
>
'
)
envir
=
"
span
"
item
=
"
span
"
H
.
append
(
"
</br>
"
)
H
.
append
(
"
</br>
"
)
H
.
append
(
H
.
append
(
f
"""
<a href=
"
{
url_for
(
"
notes.moduleimpl_status
"
,
scodoc_dept
=
g
.
scodoc_dept
,
f
"""
<a href=
"
{
url_for
(
"
notes.moduleimpl_status
"
,
scodoc_dept
=
g
.
scodoc_dept
,
moduleimpl_id
=
modimpl
.
id
)
moduleimpl_id
=
modimpl
.
id
)
...
...
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