mendicant-original / puzzlenode

Quiz application inspired by Project Euler and the Internet Problem Solving Contest (IPSC)
puzzlenode.com
81 stars 43 forks source link

Puzzles are not necessarily ordered by number #82

Closed gjp closed 12 years ago

gjp commented 12 years ago

Puzzles appeared to be ordered by number, but the number is actually just a part of the title. Puzzles are ordered by creation date.

  def index
    @puzzles = Puzzle.published(current_user).order("created_at").all

I don't know that ordering by title would make sense, but I did wonder whether puzzles ought to be given an ordinal as a separate field. Right now there's a bit of manually maintained coupling between the title and the creation date.

I'm basically just looking for comments here. If the current method is good enough, please feel free to close this.

jordanbyron commented 12 years ago

@gjp I think Puzzle#released_on would be best here. Thoughts?

gjp commented 12 years ago

released_on is a date without a time component, and I believe puzzles are released in batches on the same date. Order wouldn't be guaranteed. Still coupled, too. What are your thoughts on the puzzle number being a distinct thing used for ordering regardless of dates?

jordanbyron commented 12 years ago

released_on is a date without a time component, and I believe puzzles are released in batches on the same date.

Ahhhh excellent point. I didn't think about that.

What are your thoughts on the puzzle number being a distinct thing used for ordering regardless of dates?

I guess since those numbers are assigned by an administrator, and it really doesn't matter which puzzle is which number, I don't see the benefit of adding distinct puzzle numbers. What made you start thinking about all this?

gjp commented 12 years ago

Creating test data, prior to creating that patch which creates fake puzzles. Manually assigning sequence numbers was one of those tiny little tasks that nevertheless made me think "wait a minute, shouldn't the computer be doing this?" Probably because I lost track of what I was doing and entered two puzzle fives or some such.

Later I imported a batch of real puzzles so I could work on the submission process. Because I'd pulled data out of several different places, my batch was created in a different order than the originals. I was surprised to see them displayed out of order. I'd just assumed that if they were given sequence numbers, they'd be ordered according to sequence.

jordanbyron commented 12 years ago

Gotcha. @sandal what do you think? Do we want to promote the idea of "Puzzle # X" to a real feature or keep it as a convention?

practicingruby commented 12 years ago

@gjp, @jordanbyron : I don't want to have explicit puzzle numbers, because I'm not sure if the puzzles will always be numbered in a sensible way (or numbered at all), so I want to leave it to convention.

gjp commented 12 years ago

Ok. Should I close this as unnecessary, or should we consider ordering by something other than creation date?

jordanbyron commented 12 years ago

Closing. created_at is a sensible default