Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_jenicaesports
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
Christianneil Emmanuel Ocampo
midterm_jenicaesports
Commits
2dfd98ab
Commit
2dfd98ab
authored
May 10, 2023
by
Ciella
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix: string displays
parent
60c980e6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
5 deletions
+11
-5
models.py
widget_jenicaesports/assignments/models.py
+8
-2
assignment-details.html
...assignments/templates/assignments/assignment-details.html
+2
-2
assignments.html
...sports/assignments/templates/assignments/assignments.html
+1
-1
No files found.
widget_jenicaesports/assignments/models.py
View file @
2dfd98ab
...
@@ -7,9 +7,12 @@ class Course(models.Model):
...
@@ -7,9 +7,12 @@ class Course(models.Model):
title
=
models
.
CharField
(
max_length
=
255
)
title
=
models
.
CharField
(
max_length
=
255
)
section
=
models
.
CharField
(
max_length
=
3
)
section
=
models
.
CharField
(
max_length
=
3
)
def
__str__
(
self
):
def
format_course
(
self
):
return
'{} {} - {}'
.
format
(
self
.
code
,
self
.
title
,
self
.
section
)
return
'{} {} - {}'
.
format
(
self
.
code
,
self
.
title
,
self
.
section
)
def
__str__
(
self
):
return
'{}-{}'
.
format
(
self
.
code
,
self
.
section
)
class
Assignment
(
models
.
Model
):
class
Assignment
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
255
)
name
=
models
.
CharField
(
max_length
=
255
)
...
@@ -22,8 +25,11 @@ class Assignment(models.Model):
...
@@ -22,8 +25,11 @@ class Assignment(models.Model):
self
.
passing_score
=
int
((
self
.
perfect_score
)
*
(
0.60
))
self
.
passing_score
=
int
((
self
.
perfect_score
)
*
(
0.60
))
super
(
Assignment
,
self
)
.
save
(
*
args
,
**
kwargs
)
super
(
Assignment
,
self
)
.
save
(
*
args
,
**
kwargs
)
def
__str__
(
self
):
def
format_assignment
(
self
):
return
'{}'
.
format
(
self
.
name
)
return
'{}'
.
format
(
self
.
name
)
def
__str__
(
self
):
return
'{} {}: {}'
.
format
(
self
.
course
.
code
,
self
.
course
.
section
,
self
.
name
)
def
get_absolute_url
(
self
):
def
get_absolute_url
(
self
):
return
reverse
(
'assignments:assignment-details'
,
kwargs
=
{
'pk'
:
self
.
pk
})
return
reverse
(
'assignments:assignment-details'
,
kwargs
=
{
'pk'
:
self
.
pk
})
\ No newline at end of file
widget_jenicaesports/assignments/templates/assignments/assignment-details.html
View file @
2dfd98ab
...
@@ -20,11 +20,11 @@
...
@@ -20,11 +20,11 @@
</div>
</div>
<div
class=
"col-9 text-center"
>
<div
class=
"col-9 text-center"
>
<div
class=
"row p-5 text-center"
style=
"background-color:#e3e4e6"
>
<div
class=
"row p-5 text-center"
style=
"background-color:#e3e4e6"
>
<h1
class=
"display-3"
style=
"font-size:50px; color:#052c65"
>
{{ object }}
</h1>
<h1
class=
"display-3"
style=
"font-size:50px; color:#052c65"
>
{{ object
.name
}}
</h1>
</div>
</div>
<br>
<br>
<div
class=
"row p-2"
style=
"background-color:#e3e4e6"
>
<div
class=
"row p-2"
style=
"background-color:#e3e4e6"
>
<h5
class=
"display-3"
style=
"font-size:25px"
>
{{ object.course }}
</h5>
<h5
class=
"display-3"
style=
"font-size:25px"
>
{{ object.course
.format_course
}}
</h5>
</div>
</div>
<br>
<br>
<div
class=
"row"
>
<div
class=
"row"
>
...
...
widget_jenicaesports/assignments/templates/assignments/assignments.html
View file @
2dfd98ab
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
<br>
<br>
{% for task in tasks %}
{% for task in tasks %}
<a
href=
"{{ task.get_absolute_url }}"
class=
"link-dark; display-3"
style=
"font-size:18px; color:#052c65"
>
<a
href=
"{{ task.get_absolute_url }}"
class=
"link-dark; display-3"
style=
"font-size:18px; color:#052c65"
>
{{ task }}
</a>
{{ task
.format_assignment
}}
</a>
<br>
<br>
{% endfor %}
{% endfor %}
<br><br>
<br><br>
...
...
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