• Resolved rnwebdesign

    (@rnwebdesign)


    Hi,

    I was testing all the functions and I think I discovered an issue: When you want to submit a score of a game that is in the past (so KickOffTimeStamp < currentTimeStamp), you will be assigned 0 points as prediction score for each user, always. However, when you change the date back to a later time in the future, it will calculate the prediction score correct again.

    So this issue will give problems when the world cup is underway, because all games’ kickofftimestamps will be in the past at that moment when you enter their final score.

    We use version 1.6

    Kind regards,
    Nielsen

    https://wordpress.org/plugins/world-cup-predictor/

Viewing 15 replies - 1 through 15 (of 17 total)
  • Thread Starter rnwebdesign

    (@rnwebdesign)

    Hi,

    I will try to make this a little bit more visible: https://www.dropbox.com/s/50pt95neb89tt27/prediction%20score%20equals%200%20when%20submitting%20score.PNG

    Here you will see that with the red arrows, which are games with a kickoff date that is in the past, everybody will get 0 as prediction score.
    I hope this will make the issue more clear.

    KR,
    Nielsen

    Plugin Author landoweb

    (@landoweb)

    If the prediction of user occur after the kickoff time of the match, this user will not earn points. It’s normal and not is a problem.

    Thread Starter rnwebdesign

    (@rnwebdesign)

    Hi,

    Yes, I understand that handy feature. But I mean something different. I can guaranty that I also tested this with predictions that were done on time.

    This is another example of what I mean, imagine:
    2.00 PM => user fills in his prediction on time
    4.00 PM => Kickoff game
    6.00 PM => Game is finished, admin can submit the final score.

    In this case, the points the user gets will always be 0, because his points are calculated when the kickoff time is in the past. But, if you edit the games’ kickofftime to a later time, the point will be calculated correctly.

    Thread Starter rnwebdesign

    (@rnwebdesign)

    Hi,

    I am guessing that when you “Assign prediction scores for completed matches”, the “Last Modified”-time of the users prediction gets reset to the current time, which is later then the kickoff time and therefor the system thinks that the prediction is done after the kickoff time and this will result in 0 points.

    I have demonstrated exactly what I have done in this picture: https://www.dropbox.com/s/x3oco2pzgdq37sn/predictionprob.jpg

    So the predictions’ “Last Modified” date should not be edited when assigning prediction scores for completed matches.

    KR,
    Nielsen

    Plugin Author landoweb

    (@landoweb)

    Just so I understand exactly the scenario you tested:

    1) You entered the “Matches” screen and launched the outcome of the match and marked the same as finished?
    2) At this instant to access the “Users rank” score screen is correct?
    3) When accessing the “Score Matches” screen and score the game, the player’s score is still correct?

    It is worth mentioning that this “Score Matches” screen rarely needs to be used. When a game ends, the end result of it should be released to edit it in the “Matches” screen and mark it as finished. The script will automatically calculate the ranking at that time.

    Thread Starter rnwebdesign

    (@rnwebdesign)

    Hi,

    When you are in step 3, it gets 0, before step 3 it is indeed correct.

    But I noticed something interesting. It seems that it calculates the right points if you enter the match results for the first time in the “Manage matches”-screen. If you then later on correct the same match result in the “Manage matches”-screen, it recalculates to 0 points. To get the right score then, you need to change the kickoff date to a future time.

    So I would suggest to try to edit a game that was already filled in the “Manage matches”-screen. You will see that the points get 0 when the last modified prediction date is after the kickoff date.

    Sorry for bothering πŸ™‚

    KR,
    Nielsen

    Plugin Author landoweb

    (@landoweb)

    I still unable to reproduce this scenario you mentioned.

    Visit our demo of the plugin:

    http://www.wcp.net.br/prediction-form/

    And throw any result for Brazil vs. Croatia.

    In my case, my prediction was 2-1 and considered the outcome of the match 2-0. I gained 12 points.

    Following modified the results for 1×0 and changed my score to 15 points.

    Record any result to be able to perform the test.

    Thread Starter rnwebdesign

    (@rnwebdesign)

    Hi,

    I (user nielsen) filled in some scores. I get 0 points for Brazil vs Croatia with a prediction of 3 – 1, but this is probably because you still need to do recalculation.

    Could you now set the kickoff time of that game between the moment I predicted and the current time? Then submit the result and everyone will get 0 points.

    That is the scenario that you will have during the real world cup. The kickoff times in this testing scenario are 2 months later but during the WC they are 2 hours in the past when filling in the score.

    KR,
    Nielsen

    Plugin Author landoweb

    (@landoweb)

    I changed the departure time to 2014-04-16 17:30:00 and there you are with 15 points.

    Thread Starter rnwebdesign

    (@rnwebdesign)

    Hi,

    I made a small video screen capture. Then you can see what I think is the problem. I am going to show you how the prediction date changes when you enter a match result, or when you “score matches”. I will also show you that this will result in 0 points.

    https://www.dropbox.com/s/6ple3btur8t6wv0/Screen%204-16-2014%20%2820-46-37%29.avi

    I recommend to download this because the dropbox player is very blurry.

    I can assure you I have done no messing with the code.

    KR,
    Nielsen

    Plugin Author landoweb

    (@landoweb)

    I’ve tested several times and all the score was assigned correctly. In this case, there is nothing that can be done to resolve your issue.

    Thread Starter rnwebdesign

    (@rnwebdesign)

    I understand, my apologies for bothering. πŸ™‚

    I am fixing this now by removing this instances of code in world-cup-predictor/admin/wcp-scoring.class.php

    p.wwhen < m.kickoff AND

    It is not the cleanest fix, but it is now more stable. I discovered that the “wwhen”-date in table “wp_wcup_prediction” was bigger then the “kickoff”-date in table “wp_wcup_match” after doing 2 updates of 1 game. Not sure if this is maybe a timezone problem. Fyi, I am in UTC+2.

    Anyway, allot of thanks for this great project and the fast replies. Respect!

    KR,
    Nielsen

    Plugin Author landoweb

    (@landoweb)

    Okay. I will assess the impact of this change in the plugin. At first, I believe that by removing this condition, the problem is that somehow someone manages to record the prediction in a game after the top of it, he would win the points normally, which would be a mistake.

    On the other hand, when updating the outcome of matches, the script updates the table with the score predictions of users, then the wwhen field changes its value really.

    Maybe I need to modify the code to this field not be changed by assigning points but only when users record the predictions.

    Plugin Author landoweb

    (@landoweb)

    In version 1.8 will be removed from the ON UPDATE CURRENT_TIMESTAMP option in the prediction table. All updates will be done via script.

    Thread Starter rnwebdesign

    (@rnwebdesign)

    Hi,

    I am afraid I still face the issue. I installed v1.8.

    I can fix this again by commenting out “p.wwhen < m.kickoff AND” in world-cup-predictor/admin/wcp-scoring.class.php

    The only way to replicate this, is to test with kickoff times that are in the past. When you have a game like that, you need to submit the endscore twice (in case you made a mistake you will have to submit the correct score once more). Then you will see that the “Prediction Last Modified” time is higher than the kickoff time, which then will result in 0 points.

    So, could you please investigate why the “wwhen”-date in wp_wcup_prediction is still updated to the current time when updating a gamescore in the “Manage matches”-screen? It should keep the timestamp of the last time the user made a prediction of that game.

    KR,
    Nielsen

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘prediction score equals 0 when submitting score’ is closed to new replies.