Git Product home page Git Product logo

cse_hub's Introduction

CSE-HUB

Based on php version ย  Website under development. Can be accessed here

Idea :

To have a website that caters all needs that a CSE UG has.

What works ?
  • adding problems (login_required)
  • adding testcase (for now we can only add one test case at a time, also only author of a problem can add testcase for the problem)
  • login/logout
  • adding solution (checks if user is logged in or not)
  • evaluation of solution
  • updation of table for problems upon adding solution by the user(successful/total submissions), ie. each problem stores count of AC/ WA to itself
  • adding predefined tags to problems
  • We've got a discussion forum with comments functioning !!
  • User can now edit profile !! (but currently we don't store anything editable)
  • Now user can see/download all submited codes. How cool is that !!
  • User Registration, Now user can SignUp, so no need to go to admin section to create user.(will be implementing verification soon).
  • We've got a good editor built ! It can do a lot of things (see details here)
What lacks ?
  • Only mode of submission is through file upload
  • No work is done for creating a contest
  • frontend for various pages
  • Editing of: problem/ added testcase
Mapped urls :
  • admin/
  • ''
  • profile/<username>
  • profile/<username>/edit
  • problems/add
  • problems/display/<int:problem_id>
  • problems/add/testcase
  • problems/submit/<int:problem_id>
  • submit/<int:id>/
  • submissions/<str:username>/
  • submissions/<str:username>/view/<int:id>/
  • submissions/download/<int:id>/
  • problems
  • login
  • logout
  • forum
  • forum/post/<int:post_id>/
  • editor/
Installation :
  1. Using docker: check here

  2. Manual :

  • create a virtual environment and activate it (google it)
  • Install dependencies into it pip3 install -r requirements.txt or python -m pip install -r requirements.txt.
  • Check out to develop branch.
  • Make sure if you are using virtual environment, you have all dependencies installed (mentioned in requirements.txt). python3 manage.py migrate --run-syncdb read here (p.s. all migration files are being ignored, see .gitignore) , python3 manage.py makemigrations and python3 manage.py migrate. This will update database with tables as we describe in models.py. Then python3 manage.py runserver and play around testing what all has been developed. use python3 manage.py createsuperuser to create admin credentials and then go to localhost:8080/admin after python3 manage.py runserver to log-in as admin. Create some user accounts/ profile pages/ question tags etc and play along with them, logging in from localhost:8080 (you may use credentials of user you just created, but make sure you've created his/her profile as well from admin pannel).
Make sure you create tags before adding questions.
ER diagram Entity Relationship Diagram Execution flow
Screenshots : user profile proble statement submission code new post code editor

Further Reading :

cse_hub's People

Contributors

dependabot[bot] avatar harshraj22 avatar janhavidadhania avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

abhiisshheekk

cse_hub's Issues

Fix Evaluation Error

Improving speed by introducing multiprocessing, introduced a bug.
The evaluation isn't happening properly as the dictionary passed, isn't getting filled. And thus remains empty even after every evaluation. Check it out.

Add features to editor

Add more features to editor.
See #57 for more references.
A few things to be implemented:

  • UI updates
  • Find and Replace (Read Documentation)
  • Button to clear code
  • Button to download code as file

Add comments

Add comments wherever required to make code easily understandable.

Add Designs

  • All pages look little empty. Add creativity to them. Use bootstrap.

  • Even in forum app, Whole object is passed, extract whatever data is required and make nice looking UI. Fontawesome and bootstrap4 is alredy included in index.html

Fix testcase add procedure

Currently anyone can add testcase to any problem. Ideally only author of a problem should be able to add testcase for the problem.

View Solutions

User should be able to view all submitted solutions. Currently it shows only list of submitted solutions and not the code. It is being stored on disk, but not linked to the profile. It needs to be done in order to claim the completion of first phase of our project.

Auto Delete Files

Once a model is deleted, all the saved files related to the user should also be deleted. Currently only database related entries are deleted.
use Django-cleanup for this automatic garbage collection. Add to requirements.txt as well pip freeze > requirements.txt.

Solution submission method

Currently the only mode of submiission is file-upload.

  • Implement feature where user can paste code and evaluate using that as well.
  • link code written in code editor to submit using this way directly

Link Editor

Link the editor mapped.

  1. On problems page, add a button code on left of submit button
  2. Add option code on dropdown list of problems in header.

Set Memory Limit

  • Some good way needs to be found to limit the memory usage by a solution (some inbuilt way using python rather than copy-paste shell scripts from stackoverflow).
  • A simple buggy program like the following causes server to crash completely.
  • The programme should be terminated if it tries to use more memory than specified.
#include <bits/stdc++.h>
using namespace std;

const int N = 1e7;

void solve(){
    vector<int> v(N);
    solve();
}

int main(){
    solve();
    return 0;
}

Running User sumbitted codes in containarized environment might help. Google about docker.

Convert problem tags into links

Tags in problem page (e.g bruteforce, dp etc). They need to be clickable links that queries for all problems related to that tag. Use Codechef as a reference. !

Limit User's Access

Currently any user can view/ download any other user's solution. this can create problems if contest is held on this platform. A user shouldn't be allowed to view/ download/ access other user's codes while contest.

Update profile page

Make profile page (profile.html) look more appealing. Decorate using bootstrap and other data.

Sort Problems

The website needs a feature to sort the problems based on accuracy / Successful submissions. Almost all problem solving website has this feature.

view other's profile

Currently profile link in the navbar redirects user to his/her own profile. Need some mechanism to view others profiles.

Add E-R model

Create Entity-Relationship model and add it to the readme.

Verdict evaluation

The verdict of evaluation upon submission of code isn't shown directly. Rather a message is shown saying code submitted. Update it to show the verdict of evaluation.
(something similar to codechef) (use different colours for different verdict)

Verify Database Queries

Fetching data from database seems taking long time. Cross check all database queries and if possible speed up them.

P.S. It might also be due to CDN dependencies taking time to load bootstrap.

Display TLE in profile

The chart in profile page currently shows only AC and NON-AC. TLE is not even stored on database. Make some arrangements to store TLE as well and display on the profile page.

Reduce dependency on internet

Remove CDN imports (most of them are from index.html) and have a local copy of everything e.g. fontawesome.

  • fontawesome
  • Code editor
  • Bootstrap

Add a discussion forum

Add a discussion forum (an separate app) with the following features supported :

  • Creating post.
  • Commenting on post (@login_required)
  • The post should be able to hold images as well (resize image so that large images don't take too long to load).
  • Like posts (many to many field with profile)
  • Add the form in forms.py of the forum app

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.