Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

plan

crodjer edited this page · 2 revisions
Clone this wiki locally

Plan for CodeSport

Structure


Proposed structure of codesport.

  • Category
    • Problems
      • Author (User)
      • Test Pairs
      • Submissions
        • Coder (User)
      • Language
      • Similar Submissions (Submission - M2M)
      • Tags (M2m)
      • Languages (M2M)
    • Teams
      • Coders (User) (M2M)
    • Target Groups (Auth Group) (M2M)
  • Language
    • Errors (M2M)

M2M = Many to Many, O2O = One to One

Model Definitions


Category


A coding category. Mainly to separate contests

Fields

  • Title
  • Description
  • Is Public: If the Category is open for public to participate.
  • Is Timed: If this is a timed competition
  • Is Teamed: If this is a team based contest.
  • Target Groups: The groups which can participate in this category.
  • Duration: Define time for which submissions will be accepted.

Methods

  • User can participate: If the user can participate in the category, decided according to user's group.
  • Field Validity
    • Duration is necessary iff the category is timed

Problem


A coding problem statement

Fields

  • Title, Slug
  • Summary / Breifing
  • Full Statement
  • Level: Easy, Normal, Hard
  • Marks alloted
  • Tags
  • Author
  • Languages: Programming languages which are accpted as submission for code.
  • Is Open: If the problem is open for submissions.
  • Is Public: If problem is open to users other then universal testers.
  • Test Marks Factor: Factor which calculates marks according to weightage of test pairs.

Methods

  • Marks factor calulator: Calculate marks distribution factor according to the weightage of testpairs.
  • Submissions stats: These methods calculate various submission stats (attempts, correct submissions, submission rate).
  • User can submit: If user can submit a code for the problem, calculated according to category, user group.
  • Is solved: Checks if the last submission for the problem by the user (provided) or its team was completely correct.
  • Field Validity
    • A problem can be marked open only if at least one test pair exists.

Test Pair


A test pair of input and output. A submission must give the test utput for the given test input.

Fields

  • Problem
  • Input (File)
  • Output (File)
  • Weightage: Low, Medium, High
  • Is Mandatory: If the test pair has to be passed for submissions to be given any marks
  • Is Public: Let contestants view this

Methods

  • Marks Alloted: Calculate marks alloted to test pair according to weightage and problem's marks factor.
  • Marks Obtained: Calculate marks obtained according to the time taken.
  • Field Validity:
    • A public test set is automatically mandatory to be passed
  • Override save and delete methods to calculate marks factor for problem after saving and deleting.

Tag


Tags for problem.

Fields:

  • Title
  • Wiki: A discription about the tag (inspired by stackexchage)

Submission


A code submission by a coder.

Fields

  • Problem
  • Code (File)
  • Coder (User)
  • Language
  • Process: The process which stores the current status of evaluation of submission.
  • Is Latest: If the submission is latest amongst all the submissions by the user for the problem.
  • Marks: The marks for submission after its evaluation.
  • Is correct: If the submission is completely correct (All test pairs satisfied).
  • Similar Submissions: Codes similar to this code (Implementation ideas needed), used to check plagiarism, must be updated by crons.

Methods

  • Submit: Submit the code to evaluator, through a function defined which takes the submissoin as input and returns it in a format which favours the evaluator.

Language


A programming language to define supported languages for problem and language of submitted code. Work needed to find out exact implementation. Evaluator could be written as programing language independent.

Fields

  • Title: Language name
  • Extension: The file name extentsion
  • Execution Command: The command that runs the script of compiled code. Can be provided a variable, which could be used to separate processes.
  • Is compiled
  • Compilation Command
  • Errors: Possible errors that could occur in evaluation.

Methods

  • Field Validity:
    • Compilation command required iff language is compiled.

Targeted to be implemented later

Team


A contesting team. The project will be by default be for single user categories. A possible conflict with group implementation.

Fields

  • Category
  • Coders: Users, Members of the team.

Methods

  • Field Validity:
    • A team user and category must be unique together.

Errors


A programming language error

Fields

  • Title
  • Error: The error details.
Something went wrong with that request. Please try again.