Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_tee jays angelos
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
Ramon Angelo Enriquez
widget_tee jays angelos
Commits
dcd7f9c9
Commit
dcd7f9c9
authored
Apr 01, 2022
by
Paul Angelo Sy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed how passing_score was implemented
parent
6ed2e0c2
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
23 additions
and
4 deletions
+23
-4
admin.cpython-310.pyc
...ays_angelos/assignments/__pycache__/admin.cpython-310.pyc
+0
-0
models.cpython-310.pyc
...ys_angelos/assignments/__pycache__/models.cpython-310.pyc
+0
-0
views.cpython-310.pyc
...ays_angelos/assignments/__pycache__/views.cpython-310.pyc
+0
-0
0017_assignment_passing_score.py
...s/assignments/migrations/0017_assignment_passing_score.py
+18
-0
models.py
widget_tee_jays_angelos/assignments/models.py
+4
-3
views.py
widget_tee_jays_angelos/assignments/views.py
+1
-1
db.sqlite3
widget_tee_jays_angelos/db.sqlite3
+0
-0
No files found.
widget_tee_jays_angelos/assignments/__pycache__/admin.cpython-310.pyc
View file @
dcd7f9c9
No preview for this file type
widget_tee_jays_angelos/assignments/__pycache__/models.cpython-310.pyc
View file @
dcd7f9c9
No preview for this file type
widget_tee_jays_angelos/assignments/__pycache__/views.cpython-310.pyc
View file @
dcd7f9c9
No preview for this file type
widget_tee_jays_angelos/assignments/migrations/0017_assignment_passing_score.py
0 → 100644
View file @
dcd7f9c9
# Generated by Django 3.2.12 on 2022-04-01 11:12
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'assignments'
,
'0016_assignment_max_points'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'assignment'
,
name
=
'passing_score'
,
field
=
models
.
IntegerField
(
default
=
0
),
),
]
widget_tee_jays_angelos/assignments/models.py
View file @
dcd7f9c9
...
...
@@ -14,11 +14,12 @@ class Assignment(models.Model):
name
=
models
.
CharField
(
max_length
=
50
)
description
=
models
.
CharField
(
max_length
=
500
)
max_points
=
models
.
IntegerField
(
default
=
0
)
passing_score
=
models
.
IntegerField
(
default
=
0
,
editable
=
False
)
course_code
=
models
.
ForeignKey
(
Course
,
on_delete
=
models
.
CASCADE
,
null
=
True
,
blank
=
True
)
@
property
def
get_passing
(
self
):
return
int
(
self
.
max_points
*
0.6
)
def
save
(
self
):
self
.
passing_score
=
int
(
self
.
max_points
*
0.6
)
return
super
(
Assignment
,
self
)
.
save
(
)
def
__str__
(
self
):
return
str
(
self
.
name
)
widget_tee_jays_angelos/assignments/views.py
View file @
dcd7f9c9
...
...
@@ -11,7 +11,7 @@ def index(request):
assignmentOutput
+=
(
"Assignment Name: "
+
str
(
n
.
name
)
+
"<br/>"
)
assignmentOutput
+=
(
"Description: "
+
n
.
description
+
"<br/>"
)
assignmentOutput
+=
(
"Perfect Score: "
+
str
(
n
.
max_points
)
+
"<br/>"
)
assignmentOutput
+=
(
"Passing Score: "
+
str
(
n
.
get_passing
)
+
"<br/>"
)
assignmentOutput
+=
(
"Passing Score: "
+
str
(
n
.
passing_score
)
+
"<br/>"
)
assignmentOutput
+=
(
"Course/Section: "
+
Course
.
objects
.
get
(
course_code
=
n
.
course_code
)
.
course_code
+
" "
)
assignmentOutput
+=
(
Course
.
objects
.
get
(
course_code
=
n
.
course_code
)
.
course_title
+
" "
)
assignmentOutput
+=
(
Course
.
objects
.
get
(
course_code
=
n
.
course_code
)
.
section
+
"<br/><br/>"
)
...
...
widget_tee_jays_angelos/db.sqlite3
View file @
dcd7f9c9
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