Skip to content

Commit

Permalink
Notice board
Browse files Browse the repository at this point in the history
  • Loading branch information
lazysegtree committed Jun 8, 2023
1 parent 3e87cc7 commit c824ed5
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 13 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
## Current Todo With priorities

- [x] Deploy for once.
- [ ] Add some CSS, and make the design at least look like mediocre.
- [ ] Add some CSS, and make website responsive.
- [ ] Add TLE and MLE detection mechanism.
- [x] Add some CSS, and make the design at least look like mediocre.
- [x] Add some CSS, and make website responsive.
- [x] Add TLE and MLE detection mechanism.
- [ ] Deploy Again

- [ ] Add more test cases and test problems.
Expand Down Expand Up @@ -57,6 +57,7 @@

### Implementation issues
- get_next_sub_dir() in core.py not implemented, just returns "data1" for now.
- Python version used is 3.7 (in windows_1 environment), but Python Language is visible with name Python 3.10

### Design Issues
- Problem Model does not contain memory_limit
Expand Down
2 changes: 2 additions & 0 deletions data/submissions/temp_out_data/gen_out_1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1
0 1
2 changes: 1 addition & 1 deletion data/submissions/temp_out_data/gen_out_2.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
24
6
21 changes: 14 additions & 7 deletions db_scripts/how_to_update_values.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,21 @@ see problems/backend/init_data_insert.py
$
python manage.py shell

>>>
from problems.models import Problem
# Updata a problem object

>>>
from problems.models import Problem
p1 = Problem.objects.get(pk = 1)

>>>
p1.time_limit = 5
p1.save()

# delelte all submission data

from problems.models import UserInfo, UserProblemRelation, Submission

Submission.objects.all().delete()
UserProblemRelation.objects.all().delete()

>>>
p1.save()
for userinfo in UserInfo.objects.all():
userinfo.num_problems_solved = 0
userinfo.score = 0
userinfo.save()
Binary file modified oj_django_project/db.sqlite3
Binary file not shown.
2 changes: 1 addition & 1 deletion oj_django_project/problems/backend/code_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def __init__(self):

@overrides
def get_compiler_exec_args(self, code_file_path: str, executable_file_full_path: str) -> list:
return [ self.compiler_full_path, code_file_path, "-o", executable_file_full_path]
return [ self.compiler_full_path, code_file_path, "-DONLINE_JUDGE", "-o",executable_file_full_path]

@overrides
def get_executable_path(self, executable_dir_path: str, code_file_name_without_extension: str) -> str:
Expand Down
2 changes: 1 addition & 1 deletion oj_django_project/problems/backend/configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

LINE_LENGTH_LIMIT = 100_000_000_000_000_000

COMPILATION_TIME_LIMIT = 5 # seconds
COMPILATION_TIME_LIMIT = 15 # seconds
DEFAULT_MEMORY_LIMIT = 256 * 1024 * 1024 # Bytes

COMMAND_LENGTH_LIMIT = 8191
Expand Down
4 changes: 4 additions & 0 deletions oj_django_project/problems/static/problems/styles/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ a:link, a:visited{
}


#notice-board p{
margin-left: 2vw;
}

.button-link{
background-color: var(--button_colour);
border-radius: 3px;
Expand Down
7 changes: 7 additions & 0 deletions oj_django_project/problems/templates/problems/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ <h2 class="heading2">Problemset</h2>
{% endfor %}
</tbody>
</table>

<div id="notice-board">
<h2 class="heading2">Notice Board</h2>
<p>Now you can use <span>ONLINE_JUDGE</span> macro in your c++ code.</p>
<p>Now server can detect TLE and MLE verdict.</p>
<p>Memory Limit is by default 256MB for now.</p>
</div>
</div>
{% endblock content_root %}

Expand Down

0 comments on commit c824ed5

Please sign in to comment.