Compare commits
No commits in common. "795a4c59ec75528c910049a5821280dd164d3959" and "4990a87f334815e2fa9df52c8e4666330a5011d8" have entirely different histories.
795a4c59ec
...
4990a87f33
8 changed files with 25 additions and 88 deletions
1
Pipfile
1
Pipfile
|
@ -18,7 +18,6 @@ tqdm = "*"
|
|||
serial = "*"
|
||||
pyserial = "*"
|
||||
country-converter = "*"
|
||||
svgpathtools = "*"
|
||||
|
||||
[dev-packages]
|
||||
|
||||
|
|
24
Pipfile.lock
generated
24
Pipfile.lock
generated
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"_meta": {
|
||||
"hash": {
|
||||
"sha256": "d1d2c21498d8c771cdd3233e304f260e7fe6020dfb6a1529286e85e8ead0f34f"
|
||||
"sha256": "0bb22632889d5e728609ae67e478ff7bdeb7e56b7bb0b2be0f3b5db36ca129c5"
|
||||
},
|
||||
"pipfile-spec": 6,
|
||||
"requires": {
|
||||
|
@ -244,13 +244,6 @@
|
|||
"index": "pypi",
|
||||
"version": "==7.0.0"
|
||||
},
|
||||
"pyparsing": {
|
||||
"hashes": [
|
||||
"sha256:4c830582a84fb022400b85429791bc551f1f4871c33f23e44f353119e92f969f",
|
||||
"sha256:c342dccb5250c08d45fd6f8b4a559613ca603b57498511740e65cd11a2e7dcec"
|
||||
],
|
||||
"version": "==2.4.6"
|
||||
},
|
||||
"pyserial": {
|
||||
"hashes": [
|
||||
"sha256:6e2d401fdee0eab996cf734e67773a0143b932772ca8b42451440cfed942c627",
|
||||
|
@ -334,21 +327,6 @@
|
|||
"index": "pypi",
|
||||
"version": "==1.3.12"
|
||||
},
|
||||
"svgpathtools": {
|
||||
"hashes": [
|
||||
"sha256:7f7bdafe2c03b312178460104705e1d554d8cf36c898bec41bdce9fed3504746",
|
||||
"sha256:e4b3784ae41b725fbce6a33a8981210967b16d0b557cb5d98c0ed0c81f0f89b9"
|
||||
],
|
||||
"index": "pypi",
|
||||
"version": "==1.3.3"
|
||||
},
|
||||
"svgwrite": {
|
||||
"hashes": [
|
||||
"sha256:11e47749b159ed7004721e11d380b4642a26154b8cb2f7b0102fea9c71a3dfa1",
|
||||
"sha256:50fec23dc3fd49103808f0d672124f8c573ec5899da5686df734f856b8d3b737"
|
||||
],
|
||||
"version": "==1.3.1"
|
||||
},
|
||||
"tornado": {
|
||||
"hashes": [
|
||||
"sha256:349884248c36801afa19e342a77cc4458caca694b0eda633f5878e458a44cb2c",
|
||||
|
|
|
@ -10,7 +10,6 @@ from contextlib import contextmanager
|
|||
import uuid
|
||||
import os
|
||||
import country_converter
|
||||
from svgpathtools import svg2paths
|
||||
|
||||
mainLogger = logging.getLogger("sorteerhoed")
|
||||
logger = mainLogger.getChild("store")
|
||||
|
@ -101,14 +100,6 @@ class HIT(Base):
|
|||
'turk_country': 'the Netherlands',
|
||||
'turk_country_code': 'NL'
|
||||
})
|
||||
if not values['svg_image'] or not os.path.exists(self.getSvgImagePath()):
|
||||
values['path_length'] = None
|
||||
else:
|
||||
try:
|
||||
paths, _ = svg2paths(self.getSvgImagePath())
|
||||
values['path_length'] = round(paths[0].length())
|
||||
except:
|
||||
values['path_length'] = None
|
||||
return values
|
||||
|
||||
def delete(self):
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 131 B After Width: | Height: | Size: 369 KiB |
|
@ -30,16 +30,7 @@
|
|||
<p class="descriptor">task id</p>
|
||||
<p>{{hit.hit_id}}</p>
|
||||
<p class="descriptor">task description</p>
|
||||
<p>Use the mouse to trace the image above</p>
|
||||
<div class='columns'>
|
||||
<div class='column'>
|
||||
<p class="descriptor">fee</p>
|
||||
<p>$ {{formatPrice(hit.fee)}}</p>
|
||||
</div><div class='column'>
|
||||
<p class="descriptor">amazon markup</p>
|
||||
<p>$ {{formatPrice(hit.fee*.2)}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<p>Use the mouse to draw a copy of the image above</p>
|
||||
|
||||
<!-- TASK FEE en FEE voor amazon (task fee * .2) -->
|
||||
|
||||
|
@ -67,9 +58,9 @@
|
|||
|
||||
<p class="descriptor">visiting from</p>
|
||||
<!-- {{hit.assignment.turk_browser}} / / {{hit.assignment.turk_os}} ({{hit.assignment.turk_ip}}) -->
|
||||
|
||||
<p>{{hit.assignment.turk_country}}</p>
|
||||
<p class="descriptor">system</p>
|
||||
<p>{{hit.assignment.turk_browser}} - {{hit.assignment.turk_os}}</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -80,20 +71,10 @@
|
|||
|
||||
<div class='state' v-if="hit.assignment.submit_page_at">
|
||||
<h2>worker input</h2>
|
||||
<div class="svgcrop" style="height: 110px; overflow: hidden">
|
||||
<object :data="hit.svg_image" style="margin-top: -60px" type="image/svg+xml"></object>
|
||||
</div>
|
||||
|
||||
<div class='columns'>
|
||||
<div class='column'>
|
||||
<p class="descriptor">duration</p>
|
||||
<p>{{duration(hit.assignment.submit_page_at, hit.assignment.created_at)}}</p>
|
||||
</div>
|
||||
<div class='column'v-if="hit.path_length">
|
||||
<p class="descriptor">drawing distance</p>
|
||||
<p>{{hit.path_length}} pixels</p>
|
||||
</div>
|
||||
<div class="svgcrop" style="height: 140px; overflow: hidden">
|
||||
<img :src="hit.svg_image" style="margin-top: -60px">
|
||||
</div>
|
||||
<!-- DURATION en afstand lijntekening -->
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -9,24 +9,6 @@ var app = new Vue({
|
|||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
formatPrice(value) {
|
||||
let val = (value/1).toFixed(2).replace('.', ',')
|
||||
return val.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ".")
|
||||
},
|
||||
duration(date1, date2){
|
||||
let s1 = Date.parse(date1) / 1000;
|
||||
let s2 = Date.parse(date2) / 1000;
|
||||
let interval = s1 - s2;
|
||||
let minutes = Math.floor(interval / 60);
|
||||
let seconds = interval % 60;
|
||||
let o = `${seconds}″`;
|
||||
if( minutes > 0) {
|
||||
o = `${minutes}′` + o;
|
||||
}
|
||||
return o;
|
||||
}
|
||||
}
|
||||
// watch: {
|
||||
// hits: {
|
||||
// deep: true
|
||||
|
|
|
@ -147,7 +147,7 @@ html, body{
|
|||
}
|
||||
|
||||
to {
|
||||
max-height: 600px;
|
||||
max-height: 200px;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -193,13 +193,3 @@ html, body{
|
|||
top: 5px;
|
||||
}
|
||||
*/
|
||||
|
||||
.columns{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
||||
}
|
||||
|
||||
.columns .column{
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
|
16
www/worker_specs/todo
Normal file
16
www/worker_specs/todo
Normal file
|
@ -0,0 +1,16 @@
|
|||
|
||||
server starten volgens readme
|
||||
|
||||
http://localhost:8888/draw?id=3&assignmentId=test
|
||||
|
||||
# id= moet overeenkomen met hit id in console
|
||||
|
||||
http://localhost:8888/worker_specs/index.html
|
||||
|
||||
|
||||
|
||||
TODO
|
||||
|
||||
worker_specs
|
||||
misschien svg croppen ivm veel lege ruimte
|
||||
misschien tussen digital drawing en analog drawing nog een stap? digital > glas > analog
|
Loading…
Reference in a new issue