Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_Alipins
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Angelico Ruiz T. Teaño
widget_Alipins
Commits
9bdd23fa
Commit
9bdd23fa
authored
Apr 02, 2022
by
Angelico Ruiz T. Teaño
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added passing_score attribute to assignment model
parent
0dc6ebcc
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
2 deletions
+26
-2
admin.py
widget_alipins/assignments/admin.py
+1
-1
0003_assignment_passing_score.py
...s/assignments/migrations/0003_assignment_passing_score.py
+18
-0
models.py
widget_alipins/assignments/models.py
+7
-1
db.sqlite3
widget_alipins/db.sqlite3
+0
-0
No files found.
widget_alipins/assignments/admin.py
View file @
9bdd23fa
...
@@ -6,6 +6,6 @@ from .models import Assignment
...
@@ -6,6 +6,6 @@ from .models import Assignment
class
AssignmentAdmin
(
admin
.
ModelAdmin
):
class
AssignmentAdmin
(
admin
.
ModelAdmin
):
model
=
Assignment
model
=
Assignment
search_fields
=
[
'name'
,
'description'
]
search_fields
=
[
'name'
,
'description'
]
list_display
=
(
'name'
,
'description'
,
'max_points'
)
list_display
=
(
'name'
,
'description'
,
'
passing_score'
,
'
max_points'
)
admin
.
site
.
register
(
Assignment
,
AssignmentAdmin
)
admin
.
site
.
register
(
Assignment
,
AssignmentAdmin
)
\ No newline at end of file
widget_alipins/assignments/migrations/0003_assignment_passing_score.py
0 → 100644
View file @
9bdd23fa
# Generated by Django 4.0.3 on 2022-04-02 09:34
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'assignments'
,
'0002_alter_assignment_description'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'assignment'
,
name
=
'passing_score'
,
field
=
models
.
IntegerField
(
default
=
0
,
editable
=
False
),
),
]
widget_alipins/assignments/models.py
View file @
9bdd23fa
...
@@ -5,6 +5,12 @@ class Assignment(models.Model):
...
@@ -5,6 +5,12 @@ class Assignment(models.Model):
name
=
models
.
CharField
(
max_length
=
50
)
name
=
models
.
CharField
(
max_length
=
50
)
description
=
models
.
TextField
(
max_length
=
1500
)
description
=
models
.
TextField
(
max_length
=
1500
)
max_points
=
models
.
IntegerField
(
default
=
0
)
max_points
=
models
.
IntegerField
(
default
=
0
)
passing_score
=
models
.
IntegerField
(
default
=
0
,
editable
=
False
)
def
__str__
(
self
):
def
__str__
(
self
):
return
self
.
name
return
self
.
name
# Overrides save method to update passing_score value to 60% of max_points
def
save
(
self
,
*
args
,
**
kwargs
):
self
.
passing_score
=
int
(
self
.
max_points
*
0.6
)
return
super
()
.
save
(
*
args
,
**
kwargs
)
\ No newline at end of file
widget_alipins/db.sqlite3
View file @
9bdd23fa
No preview for this file type
Write
Preview
Markdown
is supported
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