New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Feature/154 move ratings to three point grading scale #161
WIP: Feature/154 move ratings to three point grading scale #161
Conversation
Is there a reason to keep |
Yes and no. >0 doesn’t mean rated on time because the rating is set to 3 when the other party didn’t rate. As the whole process is spread out over multiple steps we need to keep track of it. However we could use a rating of 4 (meaning rating 3 and late) instead of a separate variable and then handle it in ‘finalizeTask’. That would save on storage but make the code a lot less clear. I will check if it’s feasible later if you think its better. |
Since we're no longer doing rating deductions do we still need to |
I'm not anywhere near my computer today but I'll check once I get the chance. I think if |
8e0e937
to
2ba895c
Compare
@area @elenadimitrova I've removed I'm still fixing up the tests, but maybe you can already see if this is still as intended. |
contracts/ColonyTask.sol
Outdated
int reputation = SafeMath.mulInt(int(payout), (int(rating)*2 - 50)) / divider; | ||
|
||
uint8 rating = (roleId == EVALUATOR) ? 3 : role.rating; | ||
int reputation = SafeMath.mulInt(int(payout), (int(ratingMultiplicator[rating - 1]))) / 10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In cases where rating is 0
, reputation will be 0
here right? Shouldn't the correct missing ratings be set before we calculate reputation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, thanks, I just need to move line 280 below the reputation penalty I think. Will change it soon.
contracts/ColonyTask.sol
Outdated
|
||
// If rating is 0 at this point, we assign the highest possible rating and give | ||
// a reputation penalty to the user who didn't submit a rating on time. | ||
if (rating == 0 && roleId == MANAGER) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic that follows here isn't very clear to me and I think there's an issue in that you are penalising the skill reputation of the worker (if they haven't submitted) but then you are also awarding them the full reputation (line 301).
The rules are: everyone earns domain reputation, worker earns skill reputation. Evaluator and worker get penalised on domain and domain and skill reputation respectively if they don't rate on time.
c85b69b
to
cbc5053
Compare
The logic in finalizeTask is getting quite complex so I’m trying to be as explicit as possible. I am still having issues with:
|
Still to do:
|
Now done by #228. Thanks for your input on this though, @sekl - I know that @kronosapiens looked through your PR for anything that he'd missed, and some of the issues you brought up here now live on in #232 |
Yes, your work on this was a great reference @sekl 🙇 |
Awesome, glad it got done 👍 |
Closes #154
rating
to find out if they have been rated or not by comparing with 0, I've removed theirrated
attribute and am handling all this logic infinalizeTask
instead.finalizeTask
, for each role, I keep track of the submitted rating, as it can be 0, and set the role.rating accordingly (to 3 if necessary). Then I award reputation based on the received rating. Only after that is done do I assign reputation penalties if necessary, and lastly I moved the worker's payout reduction (in case they didn't submit a rating) to the end because all the reputation updates depend on it.Still WIP: