Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/upload-results' int…
Browse files Browse the repository at this point in the history
…o dev

Conflicts:
	app/controllers/Api/search/apiController.php
	app/controllers/JobsController2.php
	app/controllers/MediaController.php
	app/controllers/UserController.php
	app/controllers/preprocess/TextController.php
	app/filters.php
	app/models/BatchCreator.php
	app/models/Entity.php
	app/models/Queues/UpdateUnits.php
	app/models/Template.php
	app/models/preprocess/CSVresultMapper.php
	app/routes.php
	app/softwareComponents/FileUploader.php
	app/softwareComponents/TextSentencePreprocessor.php
	app/views/job2/tabs/submit.blade.php
	app/views/media/search/layouts/hb-job.blade.php
	app/views/media/search/pages/jobs.blade.php
  • Loading branch information
Bouncer committed Oct 18, 2015
2 parents c27c084 + d73a8a6 commit acea6d9
Show file tree
Hide file tree
Showing 100 changed files with 4,653 additions and 5,978 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,5 +1,6 @@
#
/app/lib/getAPIS/keys.py
/app/lib/**.pyc
/app/config/database.php
/app/config/config.php
/app/config/packages/crowdtruth/
Expand Down
3 changes: 3 additions & 0 deletions app/assets/javascripts/handlebars.swag.js
Expand Up @@ -776,6 +776,9 @@ Swag.addHelper('ifequal', function (val1, val2, fn, elseFn) {
return Utils.err('{{gt}} takes two arguments (string|number, string|number).');
}
});




Swag.addHelper('gradualColors', function(currentValue, maxValue, options) {
// console.log(currentValue);
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/visualizations/jobsBarChartGraph.js
Expand Up @@ -763,7 +763,7 @@ function jobsBarChartGraph(workerUpdateFunction, jobsUpdateFunction, annotations
} else {
sortStr = '&sort[' + 'created_at' + ']=1'
}
// matchCriteria = 'match[documentType][]=job';
// matchCriteria = 'match[type][]=job';
drawBarChart(matchStr,sortStr);
}

Expand Down
@@ -1,6 +1,6 @@
function unitsAnnotationDetails(category, categoryName, openModal) {

var urlBase = "/api/analytics/piegraph/?match[documentType][]=workerunit&";
var urlBase = "/api/analytics/piegraph/?match[type][]=workerunit&";
var annotationDivs = [];
var queryField = 'unit_id';
var categoryPrefix = 'in';
Expand Down Expand Up @@ -67,7 +67,7 @@ function unitsAnnotationDetails(category, categoryName, openModal) {
activeSelectedType = type;
var unitList = {};

var annotationsURL = '/api/v1/?field[documentType][]=job&'
var annotationsURL = '/api/v1/?field[type][]=job&'
for (var indexUnits in currentSelection) {
annotationsURL += '&field[_id][]=' + currentSelection[indexUnits];
}
Expand Down Expand Up @@ -426,7 +426,7 @@ function unitsAnnotationDetails(category, categoryName, openModal) {

//get the list of workers for this units
$.getJSON(annotationsURL, function (data) {
var urlJobsInfo = '/api/v1/?field[documentType]=job&'
var urlJobsInfo = '/api/v1/?field[type]=job&'

for (var dataIter in data){
var fieldID = data[dataIter]['_id'];
Expand Down Expand Up @@ -783,7 +783,7 @@ function unitsAnnotationDetails(category, categoryName, openModal) {
activeSelectedType = "";
currentSelection = selectedUnits;
currentSelectionInfo = selectedInfo
urlBase = "/api/analytics/piegraph/?match[documentType][]=workerunit&";
urlBase = "/api/analytics/piegraph/?match[type][]=workerunit&";
//create the series data
for (var indexUnits in selectedUnits) {
urlBase += 'match[' + queryField + '][]=' + selectedUnits[indexUnits] + '&';
Expand Down
8 changes: 4 additions & 4 deletions app/assets/javascripts/visualizations/unitsDetails.js
Expand Up @@ -7,7 +7,7 @@ function unitsDetails(category, categoryName, openModal, modalName) {
categoryPrefix = 'in'
}

var urlBase = "/api/analytics/piegraph/?match[documentType][]=workerunit&";
var urlBase = "/api/analytics/piegraph/?match[type][]=workerunit&";

var infoFields = [
{field: 'domain', name: 'domain'},
Expand Down Expand Up @@ -611,7 +611,7 @@ function unitsDetails(category, categoryName, openModal, modalName) {
for (var indexUnits in currentSelection) {
urlUnitInfo += 'match[' + queryField + '][]=' + currentSelection[indexUnits] + '&';
}
urlUnitInfo += 'match[documentType][]=workerunit&project[unit_id]=unit_id&push[unit_id]=unit_id' +
urlUnitInfo += 'match[type][]=workerunit&project[unit_id]=unit_id&push[unit_id]=unit_id' +
'&metrics[]=avg_clarity&metrics[]=domain&metrics[]=format';
$.getJSON(urlUnitInfo, function (data) {
for (var iterData in data) {
Expand All @@ -620,7 +620,7 @@ function unitsDetails(category, categoryName, openModal, modalName) {

if (queryField == 'job_id') {
//get the metrics for jobs
var urlJobsInfo = '/api/v1/?field[documentType]=job&only[]=metrics.units.withoutSpam&&only[]=metrics.units.withSpam&';
var urlJobsInfo = '/api/v1/?field[type]=job&only[]=metrics.units.withoutSpam&&only[]=metrics.units.withSpam&';

for (var indexUnits in currentSelection) {
urlJobsInfo += 'field[_id][]=' + currentSelection[indexUnits] + '&';
Expand Down Expand Up @@ -746,7 +746,7 @@ function unitsDetails(category, categoryName, openModal, modalName) {
currentSelection = selectedUnits;
currentSelectionInfo = selectedInfo
seriesBase = [];
urlBase = "/api/analytics/piegraph/?match[documentType][]=workerunit&";
urlBase = "/api/analytics/piegraph/?match[type][]=workerunit&";
//create the series data
for (var indexUnits in selectedUnits) {
urlBase += 'match[' + queryField + '][]=' + selectedUnits[indexUnits] + '&';
Expand Down
10 changes: 5 additions & 5 deletions app/assets/javascripts/visualizations/unitsJobDetails.js
Expand Up @@ -23,7 +23,7 @@ function unitsJobDetails(category , categoryName, openModal) {
metricSuffix: ".avg"}
}

var urlBase = "/api/analytics/piegraph/?match[documentType][]=workerunit&";
var urlBase = "/api/analytics/piegraph/?match[type][]=workerunit&";
var currentSelection = [];
var jobSelection = [];
var currentSelectionInfo = {};
Expand Down Expand Up @@ -140,7 +140,7 @@ function unitsJobDetails(category , categoryName, openModal) {
}

var newSeries = {};
var urlJobsInfo = '/api/v1/?field[documentType]=job&';
var urlJobsInfo = '/api/v1/?field[type]=job&';
for (var iterCateg in categories) {
urlJobsInfo += 'field[_id][]=' + categories[iterCateg] + '&';
}
Expand Down Expand Up @@ -221,7 +221,7 @@ function unitsJobDetails(category , categoryName, openModal) {
for (var indexUnits in currentSelection) {
urlUnitInfo += 'match['+ queryField + '][]=' + currentSelection[indexUnits] + '&';
}
urlUnitInfo += 'match[documentType][]=workerunit&project[job_id]=job_id&push[job_id]=job_id' +
urlUnitInfo += 'match[type][]=workerunit&project[job_id]=job_id&push[job_id]=job_id' +
'&metrics[]=type&metrics[]=softwareAgent_id&'
for (var indexMetric in querySettings['metricFields']) {
urlUnitInfo += 'metrics[]=metrics.' + querySettings['aggName'] + '.mean.' + querySettings['metricFields'][indexMetric] + '&';
Expand Down Expand Up @@ -777,7 +777,7 @@ function unitsJobDetails(category , categoryName, openModal) {
currentSelection = selectedUnits;
currentSelectionInfo = selectedInfo
seriesBase = [];
urlBase = "/api/analytics/piegraph/?match[documentType][]=workerunit&";
urlBase = "/api/analytics/piegraph/?match[type][]=workerunit&";
//create the series data
for (var indexUnits in selectedUnits) {
urlBase += 'match['+ queryField + '][]=' + selectedUnits[indexUnits] + '&';
Expand Down Expand Up @@ -806,7 +806,7 @@ function unitsJobDetails(category , categoryName, openModal) {
pieChartOptions[platformID] = {};
pieChartOptions[platformID]['all'] = data[platformIter]['content'];
//get the jobs by category
var urlType = "/api/analytics/piegraph/?match[documentType][]=job&";
var urlType = "/api/analytics/piegraph/?match[type][]=job&";
for (var jobIter in data[platformIter]['content']) {
urlType += 'match[_id][]='+data[platformIter]['content'][jobIter] + '&';
}
Expand Down
8 changes: 4 additions & 4 deletions app/assets/javascripts/visualizations/unitsWorkerDetails.js
Expand Up @@ -6,7 +6,7 @@ function unitsWorkerDetails(category, categoryName, openModal, updateSelection)
queryField = 'job_id'
var categoryPrefix = 'in'
}
var urlBase = "/api/analytics/piegraph/?match[documentType][]=workerunit&";
var urlBase = "/api/analytics/piegraph/?match[type][]=workerunit&";

var querySettings = { metricFields:['avg_cosine','avg_agreement'],
metricName:['avg worker cosine across jobs','avg worker agreement across jobs'], metricSuffix: "",
Expand Down Expand Up @@ -616,7 +616,7 @@ function unitsWorkerDetails(category, categoryName, openModal, updateSelection)
for (var indexUnits in currentSelection) {
urlWorkerInfo += 'match['+ queryField + '][]=' + currentSelection[indexUnits] + '&';
}
urlWorkerInfo += 'match[documentType][]=workerunit&project[crowdAgent_id]=crowdAgent_id&push[crowdAgent_id]=crowdAgent_id' +
urlWorkerInfo += 'match[type][]=workerunit&project[crowdAgent_id]=crowdAgent_id&push[crowdAgent_id]=crowdAgent_id' +
'&metrics[]=avg_agreement&metrics[]=avg_cosine'+
'&metrics[]=flagged&metrics[]=cfWorkerTrust&metrics[]=softwareAgent_id';
$.getJSON(urlWorkerInfo, function (data) {
Expand All @@ -627,7 +627,7 @@ function unitsWorkerDetails(category, categoryName, openModal, updateSelection)

if (queryField == 'job_id') {
//get the metrics for jobs
var urlJobsInfo = '/api/v1/?field[documentType]=job&only[]=metrics.workers.withFilter&only[]=metrics.workers.withoutFilter&';
var urlJobsInfo = '/api/v1/?field[type]=job&only[]=metrics.workers.withFilter&only[]=metrics.workers.withoutFilter&';
for (var indexUnits in currentSelection) {
urlJobsInfo += 'field[_id][]=' + currentSelection[indexUnits] + '&';
}
Expand Down Expand Up @@ -776,7 +776,7 @@ function unitsWorkerDetails(category, categoryName, openModal, updateSelection)
currentSelection = selectedUnits;
currentSelectionInfo = selectedInfo
seriesBase = [];
urlBase = "/api/analytics/piegraph/?match[documentType][]=workerunit&";
urlBase = "/api/analytics/piegraph/?match[type][]=workerunit&";
//create the series data
for (var indexUnits in selectedUnits) {
urlBase += 'match[' + queryField + '][]=' + selectedUnits[indexUnits] + '&';
Expand Down
11 changes: 7 additions & 4 deletions app/assets/stylesheets/jobs.css
@@ -1,15 +1,18 @@
.status-running {
.currentstatus {
text-transform: capitalize;
}
.status-running {
color: #8ec549;
}
.status-unordered {
text-transform: capitalize;
color: #808080;
}
.status-paused {
text-transform: capitalize;
color: #9e9e00;
}
.status-finished {
text-transform: capitalize;
}

.status-imported {
color: #9e0000;
}
2 changes: 1 addition & 1 deletion app/config/auth.php
Expand Up @@ -28,7 +28,7 @@
|
*/

'model' => '\MongoDB\UserAgent',
'model' => '\UserAgent',

/*
|--------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion app/config/packages/cartalyst/sentry/config.php
Expand Up @@ -122,7 +122,7 @@

//'model' => 'Cartalyst\Sentry\Users\Eloquent\User',
//'model' => 'Jenssegers\Mongodb\Sentry\User',
'model' => '\MongoDB\UserAgent',
'model' => '\UserAgent',

/*
|--------------------------------------------------------------------------
Expand Down
8 changes: 1 addition & 7 deletions app/controllers/AnalyticsController.php
Expand Up @@ -2,12 +2,6 @@

use crowdwatson\MechanicalTurkService;

use \MongoDB\Repository as Repository;
use \MongoDB\Entity as Entity;
use \MongoDB\Activity as Activity;
use \MongoDB\SoftwareAgent as SoftwareAgent;
use \MongoDB\CrowdAgent as CrowdAgent;

class AnalyticsController extends BaseController {

public $restful = true;
Expand All @@ -27,7 +21,7 @@ public function anyView(){
for ($iter = 0; $iter < count($jobArray); ++$iter) {

$jobID = $jobArray[$iter];
$jobsInfo[$jobID] = \MongoDB\Entity::find($jobID);
$jobsInfo[$jobID] = Entity::find($jobID);
$color = AnalyticsController::$colorList[$iter%count(AnalyticsController::$colorList)];
$jobsInfo[$jobID]['color'] = $color;
$colors[$jobID] = $color;
Expand Down
7 changes: 1 addition & 6 deletions app/controllers/Api/actions/apiController.php
Expand Up @@ -6,12 +6,7 @@
use \Response as Response;
use \Auth as Auth;

use \MongoDB\Repository as Repository;
use \MongoDB\Entity as Entity;
use \MongoDB\Activity as Activity;
use \MongoDB\SoftwareAgent as SoftwareAgent;
use \MongoDB\CrowdAgent as CrowdAgent;
use \Job;
use \Entity as Entity;
use \Exception;

class apiController extends BaseController {
Expand Down

0 comments on commit acea6d9

Please sign in to comment.