-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Assignment view with approval features. #1261
Conversation
…nto review-frontend
When you get the chance, please fix the unit test errors :) |
@stephenroller is helping me out with that one on the travis side 👍 |
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.
wow the screenshots look awesome! just need the unit test fixes then approved
…nto review-frontend
…nto review-frontend
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.
awesome, just some questions/comments
with self.table_access_condition: | ||
conn = self._get_connection() | ||
c = conn.cursor() | ||
reason = "${} for {}\n".format(amount, reason) | ||
# Bonus amount is stored in a cents int in the SQL table | ||
cent_amount = int(amount * 100) |
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.
do we enforce somewhere else that bonuses are set in dollar amounts?
edit: i notice that is the case for the webapp, curious if this is still enforced elsewhere (or if that even matters for this particular function)
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.
We don't necessarily enforce it, though this call is only made from MTurkManager, and that API suggests the bonus amount is in dollars. The cent representation is only ever seen on the backend and it only exists for SQL storage reasons.
@@ -669,3 +727,39 @@ def get_all_task_pairings_for_worker(self, worker_id, task_group_id=None): | |||
(worker_id, task_group_id)) | |||
results = c.fetchall() | |||
return results | |||
|
|||
@staticmethod | |||
def get_conversation_data(task_group_id, conv_id, worker_id, is_sandbox): |
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.
for some reason, this way of returning the data seems very satisfying to me
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.
Once the data is in an organized place, it's really easy to access it. The accessors along the way make sure that if someone manually alters the folder structure there is no catastrophic failure and I can give a good reason.
@@ -543,6 +638,679 @@ class RunPanel extends React.Component { | |||
} | |||
} | |||
|
|||
class AssignmentInstructions extends React.Component { | |||
render() { | |||
let instructions = this.props.data; |
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.
is this similar to swift, where let
gives you an immutable/constant ref?
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.
let is limited in scope to the current block. I should be moving more of my var
s to be let
s, but I haven't taken the time to clean yet.
find_location = 'parlai.mturk.tasks.{}.task_config'.format(taskname) | ||
find_location_internal = \ | ||
'parlai_internal.mturk.tasks.{}.task_config'.format(taskname) | ||
try: |
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.
suppose you have two versions of a task, one internal and one external (e.g. you're extending an external task internally for a project), is there a way to specify overriding this order and using the internal task instead?
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.
Right now I haven't added any flag to do such a thing. I'm unsure how frequently we'd run into a problem like this though, as usually things that end up public aren't collecting any more data, and if you're making an extension on a task it'll have an extended name (usually).
Merging with build failures because travis is having issues binding sockets today. |
Introduces a new view to the frontend that allows viewing assignments that have been worked on and are in any completed state. This works by leveraging the directory structure established in #1253 and the database from earlier.
This was the table of info from before:
This is the new assignment view you can get to by clicking through an assignment id:
It scrapes task description instructions from the
task_config.py
file in the run's task folder (checking bothparlai
andparlai_internal
folders).It can find onboarding chats if they were saved for an assignment and knows to avoid them otherwise.
Exist:
Not exist:
It has an approval flow at the bottom that allows approving and rejecting (with reason):
The approval flow knows the current assignment state, (approved, rejected) and can override rejected HITs to acceptances.
It also has a bonus modal:
And a block modal:
Unordered list of next steps