Skip to content

Old (Closed) Issues

Joe Cridge edited this page Apr 25, 2016 · 1 revision

X1 Team start times

  • Phone in time is calculated automatically given start time and section type.
  • Same for end time.

Closing this issue since it’s a duplicate of X29.

X2 Team scoring

  • Checkbox for each checkpoint on the course, tick all checkpoints visited upon return.
  • Record actual finish time (needs to be entered manually since not necessarily saved straight away).
  • Same for phone in time.
  • Seniors have bonuses based on checkpoints visited.
  • Everyone has time-based bonuses (down to minute).

  • Everyone

    • Score for each checkpoint visited (may be different for each section).
    • 30 pt bonus calling on time, less 1 pt for every minute either side.
    • 30 pt bonus for being back on time, less 1 pt for every minute late.
  • Seniors only

    1. Visiting checkpoints 40 and 43: 15 pts.
    2. 5, 7, and 51: 20 pts.
    3. 27, 38, 71: 20pts.
    4. Visiting 15/25 checkpoints: 15 pts.
    5. Visiting 22/25 checkpoints: additional 15 pts.
  • Disqualified if

    • Don’t visit all compulsory checkpoints (currently one for each section).
    • More than 30 minutes late.
    • Forget to phone in.

This is my interpretation of the scoring based on the rules:

  1. Teams start with 0 points. [Implicit]
  2. Teams gain the points value of every checkpoint they visit. [Implicit]
  3. Teams gain additional bonuses specific to the Challenge. [Implicit]
  4. Teams receive [30 - (phone_in_time.to_i - target_phone_in_time.to_i) / 60).abs, 0].max points for phoning in (i.e. 30 points if within 1 minute of target time, 29 if within 2 minutes, … , 1 point if within 30 minutes, 0 points otherwise). [Rule 6]
  5. Teams are disqualified if they don't phone in at all. [Rule 6]
  6. Teams are disqualified if they don't visit the compulsory checkpoint(s). [Rule 7]
  7. Teams receive (finish_time > target_finish_time && -[(finish_time.to_i - target_finish_time.to_i) / 60), 30].min) || 0 points. (E.g. 0 points if finish early or on time or up to 1 minute later than target time, -1 points if up to 2 minutes late, … , -29 points if up to 30 minutes late, -30 points if any later). [Rule 11]
  8. Teams are disqualified if (finish_time.to_i - target_finish_in_time.to_i) / 60) >= 30, i.e. if finish 30 or more minutes later than target time. [Rule 11]

Is this right?


Also, are the teams told what they need to do to get the bonus points?

  1. Teams start with 60 as long as they phone in and finish
  2. Correct
  3. *Senior Section teams receive bonuses but Correct
  4. 30 points for on time, 29 for 1 minute early/late, 28 for 2 minutes early/late
  5. Correct
  6. Correct
  7. 30 points if finish on time or early, -1 for 1 minute late, -2 for two minutes late...
  8. Correct

The bonuses are specified on the sheet they receive.

  1. So ignoring all checkpoint-related points, if a team phones in on time and finishes on time, they will have 120 points?
  2. Yeah, that's what I meant. Each section has its own instance of the Challenge class, so a junior section just doesn't have any bonuses defined. Incidentally, are you using junior/senior to denote 5-hour/8-hour or to denote Scouts/Explorers?
  3. Okay, so if the target phone-in time is 21:10, then 21:10 ≤ t < 21:11 scores 30, 21:09 ≤ t < 21:10 and 21:11 ≤ t < 21:12 score 29, … , 22:41 ≤ t < 22:42 and 21:39 ≤ t < 21:40 score 1, and t < 22:41 and t ≥ 21:40 score 0.
  4. Do you mean 29, 28, … rather than -1, -2, … ? So if target finish time is 23:40, then t < 23:41 scores 30, 23:41 ≤ t < 23:42 scores 29, … , 00:09 ≤ t < 00:10 scores 1, and t ≥ 00:10 scores 0 (and disqualification).
  1. Where has 120 come from? Teams start with 60 (so 30 for the phone in which can be taken away and same for finish)
  2. Hmm, Junior/Senior for 5/8hour
  3. Correct (I think) - if target phone-in time is 21:10 and they meet this time the 30 points stand, if they phone in at 21:09 or 21:11 then will get 29 points
  4. Correct

The 120 is from starting with 60, receiving (up to) 30 for phoning in on time, and receiving (up to) 30 for finishing on time. I assumed that wasn't what you meant.

The rules state that the phone-in points are bonuses but the finish time points are deductions, so I think we should either have:

  • All teams start with 0 points, with +30, +29, +28, etc points for phoning in on time, and 0, -1, -2, etc points for finish time; or
  • As above, but with all teams starting with 30 points. That way no-one can get negative points.

They start with 60 but those 60 points are taken away if necessary (with late phone-in or finish)? Sorry if I'm not making sense.

Nah I get it now 😝. I'm gonna go with the second bullet point, it's numerically the same as what you're saying but semantically truer to the rules.

Option 2 but start with 60? 😆

That will mean that everyone this year has a bonus 30 points compared to previous years…

X3 Checkpoints index PDF

  • Punch grid of all checkpoints chosen for the year (for all sections so only need to print one type of sheet)
  • Organisers' master list for the year: all chosen checkpoints (number, section, grid ref, description, score for each section) and compulsory checkpoint(s)
  • Team sheets for juniors/seniors (team number, team name; and space for actual start time, etc.)

I've started to use Prawn for this however I haven't got any dynamic data loaded onto the PDF.

I've updated the server so that the Download as PDF button works to some extent (see X34).

The PDF is defined in app/views/checkpoints/index.pdf.prawn. At the moment it renders the first 20 checkpoints as provided by will_paginate. Can you try and work out how to access the checkpoints from the other pages and print them?

The list could benefit from some formatting as well, either by using a grid layout (see http://prawnpdf.org/manual.pdf) or by prawn-table.

So, I can get it to output page 1 OR page 2 depending on which page you're currently viewing, but not all in one list XD

Just merged and X36 and deployed: checkpoints.pdf.


Re comment on X36:

I can't see anything wrong with your syntax but I haven't read the prawn-rails docs. Does it still throw an error if you comment out lines 34–36?

Not sure what the difference was, but got it working 👍

Awesome, does it display all 73 points?

I don't have all 73 checkpoints on localhost but here is what it looks like now:

screen shot 2015-10-03 at 22 42 00

Only thing is I can't work out table headers at the minute!

Great, what I meant was does it display more than 20 or is it just the page you're looking at?

If it's only one page at a time, can you rebase against master and see if it displays all of them?

How do I do that? 😟

$ git checkout master
$ git pull origin master
$ git checkout prawn-dan
$ git rebase master

Stash or commit any unstaged changes first though.

Thanks. Shows all of them on my localhost 👍

Yay :D

Now next question, how do I put to master?

$ git push origin prawn-dan

then click Compare and Pull Request in the yellow box on the repo code page, merge, click to delete the merged branch on origin, then back on your machine:

$ git checkout master
$ git pull origin master
$ git branch -d prawn-dan

Can you try and add headers first though? You're not really supposed to commit changes to master that remove functionality :stuck_out_tongue_winking_eye:

Closed via X38.


For reference: screen shot 2015-10-03 at 23 22 56

Just thought - what happens if they checkpoints go over the page?

This is awesome 👍


I'm hoping that the table will just wrap the description.

Ah I see. Can I deploy, or is that for you to do?

Go for it, process is here.

Damn - it worked but for some reason the headers aren't there!

You're PR says in the title that headers haven't been added. Did you definitely push all your commits up?


Also could you make the grid reference column a bit smaller so that there's more hspace for the descriptions? 😉

It's live now. Is that better Sir? 😉

One is happy now :P

X4 What happens if you phone in more than half an hour early/late?

Disqualified after 30mins either side, however could be lenient depending on conditions (ie phone signal, weather, team location).

X5 Results page

Lists teams by number of points scored once they have completed.

Display sections separately, with disqualified and non-competitive teams (i.e. younger but have a leader) displayed separately at the bottom of each section.

X6 Sort out hosting

Have you had any luck with Capistrano?

Not yet, haven't had time tonight - hopefully tomorrow! I'm worried about all the fail2ban emails - had about 25! Are you around this weekend if I can't get it up and running?

Okay, no worries. Let me know when you do cause it would be handy to have a production database with some real data to test with.


With the fail2ban, the only explanation I can think of is that whoever had the IP address last before DO assigned it to you still has some kind of cron job trying to connect to it. I'd definitely try closing port 22 with ufw and configuring ssh on another port. If that doesn't stop it, maybe back up and destroy the droplet, wait an hour or so, and then spin it up again with a new IP address.

Closing now that we've got deploy working 👍

X8 On course option for Teams

Add a boolean option to the Teams model that states whether they are on the course or not.

X9 On course option for Teams

Add a boolean option to the Teams model that states whether they are on the course or not.

Can you expand on this? XD

screen shot 2015-09-29 at 19 21 11

Just a confirmation that the team is out and about...does that make more sense?

Can we just infer that when we replace their planned start time with their actual one? (I.e. rather than making a new column especially for it).

The control room might not realise that the time has been updated to the actual start time?

We can display the status of each team on the home page, but we don't need a database column to do that.

Okay cool - how do you propose to do that?

We can probably just add some conditional ERB to the view.

X10 Use AJAX for the clock

It's a bit dubious to call client-time the official time.

What do you mean? Everyone goes by this clock. It will be used at the start point and the control room...

Well when you use client-side js all you're doing is asking the operating system what time it thinks it is. If you view the app on a computer that doesn't sync itself to a time server then the time on the page in your browser will be different to the time on the page in someone else's browser.

Could we use server time rather than client time?

Yeah, hence the AJAX :P

Doh sorry - being a doughnut!


Merging into X59.

X11 Use AJAX to autoupdate the home page

…or failing that fall back on http-equiv


On the old system, I had a separate PHP file that retrieved the current time and then loaded that into the page - refreshing with javascript which seemed to work well. Do you think this would work with Ruby?

PHP and Rails don't really mix but AJAX and Rails do (PHP basically needs its own version of Unicorn to run).


But the idea should be exactly the same with AJAX, we just make a controller which responds with the server time in JSON.

I didn't mean use PHP, but instead of the PHP tag getting the date, use Ruby :stuck_out_tongue_closed_eyes:

Okay XD. I think we're on the same page then :)


Merging into X59.

X12 Download as PDF for teams index

Print button for home page start times. I know there is one already there but hasn't been tested. Is a priority for when start times go live (5th).

Ideally, would this be a Print button or a Save as PDF button? If we do it as a PDF we could eliminate a lot of the clutter that you get when you print a web page.

Yeap, ideally PDF but I never got Prawn working with dynamic data - unless you can? :) I thought print page would be a quick workaround? Priorities :)

Okay, I'm being ambitious so I'll see what I can do :)

X15 Think about making this repo public?

When we have a production database running we can purge checkpoints.csv from the repo and then there's nothing left in here that needs to be kept hidden (production secrets have already been removed).

Pros:

  • Frees up a private repo for each of us (I've already got five 😭)
  • Makes deploying with Capistrano easier
  • All the green squares
  • Open source is gooooooooooooood

Cons:

  • Provided we've designed the app well there shouldn't be any

We'd need to add a license file.

What do you think?


If I add slap a GPL in the repo can we make it public? The extra clicks between by fork and your fork are driving me nuts XD

Yeah sure :)

Yay :)

X19 Domain name

Can you contact whoever owns chippingsodburyscouts.org.uk and ask them to add an A-record pointing a subdomain like challenge to 178.62.20.90?

Already done 👍

You can also use sc.danielswaine.co.uk

I'm fine with just using the IP address haha, I meant so that it was pointed at by the club website for other people to use 😝

IP address has been updated on challenge.chippingsodburyscouts.org.uk so hopefully will update itself shortly.

Awesome :D

Still hasn't updated, Internal Server Error 500

Yeah I noticed that. It's still pointing at 79.170.44.140

Is it?? What's that address?

That's the IP address for the rest of the club website (i.e. it's still being served by Apache on their server).

Hmm, maybe it hasn’t propagated yet.

Has it been 48 hours?

Pretty sure it hasn't yet...

No need to worry yet then :P


Surely it's been 48 hours by now? XD

I know 😟 I might have to get him to contact 123-reg

Yeah can you ask him?

One step ahead of you 😉


123-Reg have said that as the hosting is not with them, you would need to login to the hosting control panel and point to IP address...

Yeah, he should be able to access the hosting control panel by logging into his 123-ref account. He doesn't need to do change anything on the server.

The hosting isn't done through 123-reg, it's done through Heart Internet I'm pretty sure - I think this is the problem?

Hosting won't affect DNS. If the website uses 123-reg nameservers then he needs to log into 123-reg and add an A record. If he's using Heart Internet's nameservers then he needs to find their host records panel and add an A record there.

I don't know what the problem is then because 123-Reg is pushing it onto the hosting provider...

Just checked, DNS has been transferred away from 123-reg so it's not their problem.

From Heart Internet's site:

To point a subdomain to an IP address:

  1. Log into your Domain Control Panel
  2. Click ‘DNS Management’
  3. Under ‘Create New A/AAAA/CNAME records’, enter in the subdomain (without the .your-domain.com attached) and the IP address it should point to
  4. Click ‘Update DNS’
  5. The subdomain will now point to that IP address

Due to DNS propagation, pointing your subdomain to an IP address will take approximately 24 hours to work as expected.

What he doesn't need to do is alter anything under Web Tools section of his eXtend Control Panel. That won't have any effect.

He doesn't have access to DNS as it's shared hosting, so just going to use my link.

Ah that's lame, rule 1 of the internet is never to transfer your domain to your host :P


Can I add a credit to both of us in the site footer or something? I'm not a huge fan of the implication that you wrote the whole thing :stuck_out_tongue_closed_eyes:

I've added one 😄

X22 Mobile issue

image

Requires meta viewport tag I believe.

Can you take a look at this?

Bootstrap is mobile first so I assume that the cause is somewhere in app/assets/stylesheets/main.scss.

<meta name="viewport" content="width=device-width, initial-scale=1.0">

Would this work if added to the head section?

I don't really know much about viewports haha, have you given it a go?

Well, the thing is it works fine resizing in a browser but I can't upload the line to the live server to test in mobile 😝

Chrome devtools? Press Cmd-Alt-I and select device emulation

Ah never used that before! Just tried it but didn't work, not sure why :worried:

Might be worth trying on server, I've always put that line in and works perfectly.

Bootstrap applies a lot of styles for mobiles which might be overriding your viewport directive?

I'll add it in now to test but if it didn't work in devtools then it's not likely to work in production either.


It's live now…

image

That's a bit better 😄

Just sent a PR

X23 Cannot change email address without filling in password boxes

X26 Checkpoints aren't working on the server

😢


Works fine now, just migrated the wrong database 😆

X29 Team model with calculated times

Is it possible for start times to be finished by Sunday evening? Saves rushing on Monday as a lot of other things need to be sorted that night too.

And auto calculate phone-in/finish?

Yes, I'm pretty confident this will be done by then, it's my next job.

👍 Thanks Joe


Please can the start times be ordered by section

I'll see what I can do :)


Will update logged in home page now and then close this issue.

X62 Weird portrait display on mobiles

image

May be due to the bullets in the message box? Then should be wrapped in an ul for a start XD


Actually it looks like the tables might not be wrapped in proper Bootstrap containers now that they're in partials. Compared to everything else they seem to exceed col-xs-12.


I've tried mobile specific classes in X67 but that didn't seem to help. I think that the menu icon must be the cause.


Ignore that, it's definitely the tables!

X69 No sign out option on mobile

Apparently I don't know how to scroll XD

X102 Bonus Table on PDF

Currently the bonuses are not shown on the Goal Checkpoint PDF.