Git Product home page Git Product logo

Comments (3)

xuod avatar xuod commented on July 30, 2024

I added an update_points function that receives the post_save signal from Round : when a round is saved, eg from the admin panel, it triggers this function that computes points for participants and teams (which were added a field points_so_far). Then all views should use this db field. That's a progress, but it's not perfect yet (some views still need to compute some scores).

from ipt_connect.

mhrz avatar mhrz commented on July 30, 2024

@xuod Could you please explain your improvement of yesterday?

from ipt_connect.

xuod avatar xuod commented on July 30, 2024

Some detail to the optimization :

  • Round model now does the computation of its scores (I call score the averaged grades of the jury for one round) and points (=scores * coefficients) when it is saved (I overrode the save function).
  • Team, Participant and Problem models each have an update_scores function too that computes the total points and/or the mean scores in for each role (see #19 ) and save those to the database.
  • in admin.py, I override the save and save_related functions, so that when a round is saved from the admin, it will :
  1. save the rejections and the jury grades in the database
  2. call Round.update_scores
  3. call Team.update_scores for the teams participating in the round
  4. each of these call Participant.update_scores for its participants
  5. call Problem.update_scores

from ipt_connect.

Related Issues (20)

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.