Code Monkey home page Code Monkey logo

judy's People

Contributors

dependabot[bot] avatar jacobian avatar obfuscurity avatar patcable avatar xzilla avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

judy's Issues

Add a guest mode

There should be an environment variable that toggles whether to require basic auth to view (but not create or score) proposed abstracts. People are often interested in seeing what talks might be given at an event.

Styling for long comments

Scoring comments introduced in #28 are awesome but I suspect long comments are going to render weird in the index view. Need to apply some styling-fu there.

Abstracts queries fail without seeded data in Scores

Because of the way Postgres handles negation with nulls (e.g. NOT IN), it's not possible to run a query like the following without a seeded entry in the Score table.

SELECT abstracts.*, speakers.full_name AS speaker, 
               speakers.email, events.name AS event_name
FROM abstracts, speakers, events, scores
WHERE ((abstracts.speaker_id = speakers.id)
    AND (abstracts.event_id = events.id)
    AND ((scores.abstract_id != abstracts.id)
        OR (scores.judge != 'jdixon')))
ORDER BY abstracts.id

Demonstration showing a successful query when at least one Score exists. Note that it works for all users regardless of whether they have a score recorded or not.

[20] pry(main)> Score.insert(:judge => 'jdixon', :count => 0, :abstract_id => 81)
=> 2
[21] pry(main)> Score.all
=> [#<Score @values={:id=>2, :judge=>"jdixon", :count=>0, :abstract_id=>81}>]
[22] pry(main)> Abstract.fetch_one_random_unscored_by_user('jdixon').id
=> 26
[23] pry(main)> Abstract.fetch_one_random_unscored_by_user('whilp').id
=> 53

Demonstration showing failed queries when no scores exist.

[26] pry(main)> Score.first.destroy
=> #<Score @values={:id=>2, :judge=>"jdixon", :count=>0, :abstract_id=>81}>
[27] pry(main)> Score.all
=> []
[28] pry(main)> Abstract.fetch_one_random_unscored_by_user('jdixon').id
=> nil
[29] pry(main)> Abstract.fetch_one_random_unscored_by_user('whilp').id
=> nil

One last time, proving that the simple existence of a Score is sufficient to workaround this issue.

[30] pry(main)> Score.insert(:judge => 'jdixon', :count => 0, :abstract_id => 81)
=> 3
[31] pry(main)> Score.all
=> [#<Score @values={:id=>3, :judge=>"jdixon", :count=>0, :abstract_id=>81}>]
[32] pry(main)> Abstract.fetch_one_random_unscored_by_user('jdixon').id
=> 4
[33] pry(main)> Abstract.fetch_one_random_unscored_by_user('whilp').id
=> 19

Master seems broken

Launching it in Heroku shows the same issue as building local.

When you create a new abstract it just goes to a blank page.

On my local build I see the error

21:48:54 web.1 | "PG::NotNullViolation: ERROR: null value in column "type" violates not-null constraint\nDETAIL: Failing row contains (2, title, body, 2, 1, null).\n"

Can you recommend a commit that is the lastest stable? Thanks!

Event management

Currently we're hardcoded to :event_id => 1 which is fine for development, but makes no damn sense in production. Need the ability to at least seed and set the name of the event somewhere.

Allow editing and deleting abstracts

There are no buttons, but also the PUT/DELETE routes need work anyways. PUT shouldn't be doing update(params) because that will cause an exception if anything is in params that doesn't have an associated method (e.g., 'splat' in my case). DELETE doesn't handle the case of abstracts which have been scored.

Stop using AJAX for score submissions

Because we're using just basic auth and not managing any tokens, there's no simple way to pass XHR with explicit credentials. Therefore, if your session expires or I happen to restart the backend service, you could theoretically click the "Save Review" button and have nothing obvious happen.

We should probably just jettison the AJAX stuff (since it's only used for this one thing anyways) and use a proper HTML form.

Tags

I'm sure this has come up before but I can't find an issue for it. Adding one now based on feedback by @bryanl.

After reviewing my first few abstracts, I wish I could see tags from the talks. e.g. logging, monitoring, *observability*

Deleting Abstracts Generates PG::ForeignKeyViolation

When trying to delete an Abstract the following error is reported

PG::ForeignKeyViolation: ERROR: update or delete on table "abstracts" violates foreign key constraint "scores_abstract_id_fkey" on table "scores"
DETAIL: Key (id)=(3) is still referenced from table "scores".

It appears that the models do not do a cascading delete.

Tag support

While Monitorama is a single track, it may be useful to tag submissions with certain keywords to help visualize the spread of topics. Have too few security talks? Have too many on Yaks? Seeing a trend of more (n) submissions over the years?

I currently have a branch up on my fork (1c190f9) that has tag/topic support but it's kinda unclean - you have to add the topics manually, rather than a type along/drop down selection thing.

Randomization should account for distribution of reviews

Judy currently returns the next abstract to review by selecting a random one from the pool of abstracts that the reviewer hasn't reviewed yet. Unfortunately this results in an uneven bell-curve distribution of reviews (quantity) across the pool of abstracts. We should weight our randomization such that abstracts with fewer reviews are preferred over those with more reviews.

def self.fetch_one_random_unscored_by_user(user)
@abstracts = Abstract.fetch_all_abstracts_unscored_by_user(user)
raise Judy::JudgingComplete if @abstracts.empty?
return @abstracts[rand(@abstracts.count).to_i]
end

Scoring comments

Multiple folks have requested a comment field for adding notes about their score on an abstract.

Add keybindings

Some ideas:

  • s: skip review
  • 1..0: score and save review (1==1, 0==10)

Ability to skip an abstract

Some users might want to skip an abstract and come back to it later. We should be able to just get by with a "Skip" button in the scoring form for now. There's always a random chance they could come right back to it again on the next click, but this seems like a reasonable first attempt.

Progress indicator

I found myself wanting the kindle progress meter as I flipped through the abstracts. Really, I wanted to know how much longer I should budget, but I can perform my own time estimation if the UI shows me my progress while reviewing an abstract.

Score distribution chart color range

Instead of category20c it would be nice to use a stepped gradient to represent the distribution so it's obvious we're looking at increasing values. This might not be the best way to visualize a distribution of scores, but I'd like to try it.

John Schulz pointed out that d3 supports this natively:

var scale = d3.scale.linear().range(["white", "red"])
d3.range(0, 1.1, .1).map(scale)

Heroku deploy requires newer ruby version

When I used the "Deploy to Heroku" button from the README page, I received the following error in the Heroku build log:

-----> Ruby app detected
-----> Compiling Ruby/Rack
Command: 'set -o pipefail; curl -L --fail --retry 5 --retry-delay 1 --connect-timeout 3 --max-time 30 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/heroku-18/ruby-2.2.7.tgz -s -o - | tar zxf - ' failed on attempt 1 of 3.
Command: 'set -o pipefail; curl -L --fail --retry 5 --retry-delay 1 --connect-timeout 3 --max-time 30 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/heroku-18/ruby-2.2.7.tgz -s -o - | tar zxf - ' failed on attempt 2 of 3.
!
! An error occurred while installing ruby-2.2.7
!
! This version of Ruby is not available on Heroku-18. The minimum supported version
! of Ruby on the Heroku-18 stack can found at:
!
! https://devcenter.heroku.com/articles/ruby-support#supported-runtimes
!
! Push rejected, failed to compile Ruby app.
! Push failed

The supported runtimes page cited above indicates at least Ruby 2.4.5 will be required. I've been able to reproduce this error locally. I am running into compile errors when I try upgrading Ruby.

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.