Skip to content

Commit

Permalink
add in the userId directory to fast_pre_entity table and also make th…
Browse files Browse the repository at this point in the history
…e entity editable on the interface #198
  • Loading branch information
YanLiang1102 committed Oct 21, 2017
1 parent 5c773cc commit 2819972
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion app/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,8 @@ module.exports = function(app) {
},{
$set:{
"status":"skip",
"taggingtime":Date.now()
"taggingtime":Date.now(),
"userid":userid
}
},function(err,rst)
{
Expand Down
11 changes: 6 additions & 5 deletions public/partials/fastcoding.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h4>Fast Arabic Actor Coding (PERSON ENTITY)</h4>
</div> -->
<div class="panel-body">
<div id="fastactor" class="row well">
<div class="col col-sm-3" id="arabicentity" data-entityid=""></div>
<input class="col col-sm-3" id="arabicentity" data-entityid=""></input>
<div class="col col-sm-2">
<button class="btn btn-primary btn-sm" id="fast-start" data-status="start"> <i class="fa fa-clock-o" aria-hidden="true" style="padding:2px"></i><strong>START</strong></button>
</div>
Expand Down Expand Up @@ -94,7 +94,7 @@ <h4>Fast Arabic Actor Coding (PERSON ENTITY)</h4>
success:function(data)
{
var result = JSON.parse(data);
$("#arabicentity").html(result.word);
$("#arabicentity").val(result.word);
$("#arabicentity").attr("data-entityid",result.entityid);
var sentences=result.sentences;
var countleft=result.countleft;
Expand All @@ -117,18 +117,19 @@ <h4>Fast Arabic Actor Coding (PERSON ENTITY)</h4>

});
$("#fast-commit").on("click",function(){
var userid=localStorage.getItem("currentid");
$.ajax({
method:"POST",
url:"/commitperentity",
//actually I am not sure why the country needs input needs to be handle specially otehrwise it will not have the value, if you continously have
//two same country as input.
data:{'entityid':$('#arabicentity').attr("data-entityid"),'timespend':(new Date()-start)/1000,"country":$($(".special").find("input")[0]).text(),"firstrole":$("#firstrole").val(),"secondrole":$("#secondrole").val(),"userid":localStorage["currentid"],"username":localStorage["currentuser"],"startdate":$("#datepicker1").val(),"enddate":$("#datepicker2").val(),"word":$("#arabicentity").text()},
data:{'entityid':$('#arabicentity').attr("data-entityid"),'timespend':(new Date()-start)/1000,"country":$($(".special").find("input")[0]).text(),"firstrole":$("#firstrole").val(),"secondrole":$("#secondrole").val(),"userid":userid,"username":localStorage["currentuser"],"startdate":$("#datepicker1").val(),"enddate":$("#datepicker2").val(),"word":$("#arabicentity").val()},
success:function(data)
{
console.log("time"+new Date()-start);
var result = JSON.parse(data);
var countleft=result.countleft;
$("#arabicentity").html(result.word);
$("#arabicentity").val(result.word);
$("#arabicentity").attr("data-entityid",result.entityid);
var sentences=result.sentences;
// console.log(sentences);
Expand Down Expand Up @@ -166,7 +167,7 @@ <h4>Fast Arabic Actor Coding (PERSON ENTITY)</h4>
//paser the data into dictionary , this needs to be called
var result = JSON.parse(data);
var countleft=result.countleft;
$("#arabicentity").html(result.word);
$("#arabicentity").val(result.word);
$("#arabicentity").attr("data-entityid",result.entityid);
var sentences=result.sentences;
// console.log(sentences);
Expand Down

0 comments on commit 2819972

Please sign in to comment.