Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
grady
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
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
Jan Maximilian Michal
grady
Merge requests
!244
Resolve "Make exam a many to many field on StudentInfo model"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Make exam a many to many field on StudentInfo model"
233-make-exam-a-many-to-many-field-on-studentinfo-model
into
master
Overview
2
Commits
119
Pipelines
64
Changes
7
Merged
Jakob Dieterle
requested to merge
233-make-exam-a-many-to-many-field-on-studentinfo-model
into
master
4 years ago
Overview
2
Commits
119
Pipelines
64
Changes
7
Expand
Closes
#233 (closed)
Edited
4 years ago
by
Thilo Wischmeyer
0
0
Merge request reports
Viewing commit
ee86991a
Show latest version
7 files
+
43
−
56
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
7
Search (e.g. *.vue) (Ctrl+P)
ee86991a
removed class-method in StudentInfo, working on fix in StudentJsonExport
· ee86991a
Jakob Dieterle
authored
4 years ago
core/models/student_info.py
+
0
−
26
Options
@@ -99,32 +99,6 @@ class StudentInfo(models.Model):
exam_info
.
save
()
self
.
exams
.
add
(
exam_info
)
@classmethod
def
get_annotated_score_submission_list
(
cls
)
->
QuerySet
:
"""
Can be used to quickly annotate a user with the necessary
information on the overall score of a student and if he does not need
any more correction.
A student is done if
* module type was pass_only and student has enough points
* every submission got accepted feedback
Returns
-------
QuerySet
the annotated QuerySet as described above.
"""
return
cls
.
objects
.
annotate
(
overall_score
=
Coalesce
(
Sum
(
'
submissions__feedback__score
'
),
Value
(
0
)),
).
annotate
(
done
=
Case
(
When
(
exam__pass_score__lt
=
F
(
'
overall_score
'
),
then
=
Value
(
1
)),
default
=
Value
(
0
),
output_field
=
BooleanField
()
)
).
order_by
(
'
user__username
'
)
def
disable
(
self
):
"""
The student won
'
t be able to login in anymore, but his current
session can be continued until s/he logs out.
Loading