Skip to content

Commit

Permalink
More tour experiment work.
Browse files Browse the repository at this point in the history
modified:   app/assets/javascripts/angular/controllers/experiments.js
modified:   app/assets/templates/tour_experiment.html
modified:   public/experiment_assets/bird_tour.json
  • Loading branch information
Mark Cottman-Fields committed Mar 14, 2013
1 parent 4858e26 commit 3311a6e
Show file tree
Hide file tree
Showing 3 changed files with 169 additions and 158 deletions.
26 changes: 22 additions & 4 deletions app/assets/javascripts/angular/controllers/experiments.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,17 +195,35 @@
function VirtualBirdTourCtrl($scope, $resource, $routeParams, $route, $http, Media, AudioEvent, Tag) {

$scope.bigScope = $scope.$parent;
//$scope.bigScope.results.steps = angular.copy($scope.bigScope.spec.experimentSteps);
$scope.inputData = angular.copy($scope.bigScope.spec.inputData);

var stepResults;
$scope.bigScope.results.steps = angular.copy($scope.bigScope.spec.experimentSteps);

$scope.stepResults = undefined;
$scope.$watch(function () {
return $scope.bigScope.step;
}, function (newValue, oldValue) {
stepResults = $scope.bigScope.results.steps[$scope.bigScope.step - 1];
$scope.stepResults = $scope.bigScope.results.steps[$scope.bigScope.step - 1];
});

$scope.selectedTab = "instructions";

$scope.locations = angular.copy($scope.bigScope.spec.locations);

$scope.getLocation = function(name){
var found = $scope.locations.filter(function(element, index, array){ return (element.name == name); });
if(found.length == 1){
return found[0];
}
return null;
};

$scope.getMapForLocation = function(locationName, zoom){
var locationInfo = $scope.getLocation(name);
if(locationInfo){
var locationEncoded = baw.angularCopies.encodeUriQuery(locationInfo.name, true);
return "https://maps.googleapis.com/maps/api/staticmap?sensor=false&size=300x300&maptype=terrain&visible="+locationEncoded;
}
};

}]);
})();
124 changes: 59 additions & 65 deletions app/assets/templates/tour_experiment.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
margin: 5px;
cursor: default;

min-width: 241px;
min-width: 253px;
max-width: 300px;
}

Expand Down Expand Up @@ -188,86 +188,80 @@
color: #97764A;
}

/*
div.vbt_annotation div.vbt_options {
margin: 2px 0 0 0;
background-color: #d4deb8;
background: linear-gradient(#d4deb8, #adc7a5);
background: -webkit-linear-gradient(#d4deb8, #adc7a5);
background: -ms-linear-gradient(#d4deb8, #adc7a5);
background: -moz-linear-gradient(#d4deb8, #adc7a5);
background: -o-linear-gradient(#d4deb8, #adc7a5);
border-top: 1px solid #7b903c;
padding: 0;
}
div.tabPanel
{
border-top: 1px solid #7b903c;
border-bottom: 1px solid #7b903c;
width: 100%;
height: 350px;
}

div.vbt_annotation div.vbt_options audio {
height: 10px;
margin: 0;
}
ul#tabLinks
{
list-style-type: none;
padding: 0;
margin: 0;
display: block;
overflow: hidden;
}

div.vbt_annotation div.vbt_options ul {
list-style-type: none;
padding: 0;
margin: 0 auto;
}
ul#tabLinks li
{

div.vbt_annotation div.vbt_options ul li {
float: left;
margin: 3px;
font-size: 11pt;
border: 1px solid #adc7a5;
border-radius: 4px;
-webkit-border-radius: 4px;
-ms-border-radius: 4px;
-moz-border-radius: 4px;
-o-border-radius: 4px;
background-color: #f5ffd9;
background: linear-gradient(#f5ffd9, #d4deb8);
background: -webkit-linear-gradient(#f5ffd9, #d4deb8);
background: -ms-linear-gradient(#f5ffd9, #d4deb8);
background: -moz-linear-gradient(#f5ffd9, #d4deb8);
background: -o-linear-gradient(#f5ffd9, #d4deb8);
}

div.vbt_annotation div.vbt_options ul li:hover {
box-shadow: 0px 0px 8px #adc7a5;
-webkit-box-shadow: 0px 0px 8px #adc7a5;
-ms-box-shadow: 0px 0px 8px #adc7a5;
-moz-box-shadow: 0px 0px 8px #adc7a5;
-o-box-shadow: 0px 0px 8px #adc7a5;
border: 1px solid #adc7a5;
}
float:right;
margin: 0 5px 0 0;
padding: 3px 5px 3px 5px;
border: 1px solid #7a903c;
border-bottom-width: 0;

border-radius: 4px 4px 0 0 ;
-webkit-border-radius: 4px 4px 0 0;
-ms-border-radius: 4px 4px 0 0;
-moz-border-radius: 4px 4px 0 0;
-o-border-radius: 4px 4px 0 0;
}

ul#tabLinks li.tabLinkSelected
{
background-color: #7a903c;
}
ul#tabLinks li.tabLinkSelected a
{
color: #e9e7c2;
text-decoration: none;
}

div.vbt_annotation div.vbt_options ul li input, div.vbt_annotation div.vbt_options ul li button
{
padding: 1px;
}
*/
</style>

<ul>
<li><a href ng-click="selectedTab='instructions'">Instructions</a></li>
<li><a href ng-click="selectedTab='speciesInformation'">Species Information</a></li>
<li><a href ng-click="selectedTab='examples'">Examples</a></li>
<li><a href ng-click="selectedTab='maps'">Maps</a></li>
<ul id="tabLinks">
<li ng-class="{tabLinkSelected: selectedTab=='instructions'}"><a href ng-click="selectedTab='instructions'" >Instructions</a></li>
<li ng-class="{tabLinkSelected: selectedTab=='speciesInformation'}"><a href ng-click="selectedTab='speciesInformation'">Species Information</a></li>
<li ng-class="{tabLinkSelected: selectedTab=='examples'}"><a href ng-click="selectedTab='examples'">Examples</a></li>
<li ng-class="{tabLinkSelected: selectedTab=='maps'}"><a href ng-click="selectedTab='maps'">Maps</a></li>
</ul>

<div ng-show="selectedTab=='instructions'">
instructions
<div class="tabPanel" ng-show="selectedTab=='instructions'">
<p>This task involves learning about a particular animal</p>
</div>
<div ng-show="selectedTab=='speciesInformation'">
<div class="tabPanel" ng-show="selectedTab=='speciesInformation'">
speciesInformation
</div>
<div ng-show="selectedTab=='examples'">
<div class="tabPanel" ng-show="selectedTab=='examples'">
examples
</div>
<div ng-show="selectedTab=='maps'">
maps
<div class="tabPanel" ng-show="selectedTab=='maps'">
<ul>
<li>Broad current location</li>
<li>species distribution</li>
<li>Closer current location</li>
</ul>

<img src=
</div>

{{getLocation(stepResults.locationName).lat}}
{{getLocation(stepResults.locationName).long}}

<div ng-repeat="tourSteps in inputData.virtualBirdTour"></div>

Expand Down
177 changes: 88 additions & 89 deletions public/experiment_assets/bird_tour.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"speciesCommonName": 1,
"exampleAnnotationIds": [6, 7, 8],
"verifyAnnotationIds": [9644, 2, 3, 4, 5],
"backgroundImage": ""
"backgroundImagePath": ""
},
{
"template": "/assets/tour_experiment.html",
Expand All @@ -25,93 +25,92 @@
}
],
"experimentResultsPostUri": "/experiments",
"inputData": {
"locations": [
{
"name": "Peregian Beach",
"lat": -26.469932,
"long": 153.09229,
"environmentType": "Coastal Heath"
},
{
"name": "Bimblebox",
"lat": -23.556582,
"long": 146.478767,
"environmentType": "Semi-arid Woodland"
},
{
"name": "Cape Tribulation",
"lat": -16.097557,
"long": 145.453005,
"environmentType": "Rainforest"
},
{
"name": "Mt Carbine",
"lat": -16.538952,
"long": 145.121655,
"environmentType": "Open Savannah"
},
{
"name": "Samford",
"lat": -27.388907,
"long": 152.878325,
"environmentType": "Dry Sclerophyll Forest"
},
{
"name": "St Bees",
"lat": -20.913738,
"long": 149.44051,
"environmentType": "Cloud Forest"
}
],
"species": [
{
"id": 1,
"lsid": "urn:lsid:biodiversity.org.au:afd.taxon:309069cc-e7e1-454f-9de3-7113400fca49",
"commonName": "Sacred Kingfisher",
"scientificName": "Todiramphus sanctus",
"faunaImage": "http://bie.ala.org.au/repo/1013/128/1286798/smallRaw.jpg",
"distributionImage": ["http://spatial.ala.org.au/layers-service/distribution/map/png/6714",
"http://www.birdsinbackyards.net/sites/www.birdsinbackyards.net/files/styles/medium/public/factsheets/images/map/todiramphus-sanctus.gif"],
"conservationStatus": "Least Concern",
"description": "The Sacred Kingfisher is a medium sized kingfisher. It has a turquoise back, turquoise blue rump and tail, buff-white underparts and a broad cream collar. There is a broad black eye stripe extending from bill to nape of neck. Both sexes are similar, although the female is generally lighter with duller upper parts. Young birds are similar to the female, but have varying amounts of rusty-brown edging to feathers on the collar and underparts, and buff edges on the wing coverts. The voice of the Sacred Kingfisher is a loud \"ek ek ek ek\" repeated continuously throughout breeding season. Birds also give a \"kee kee kee\" in excitement and a series of chirring, scolding notes when alarmed."
}
],
"annotations": [
{
"type": "verify",
"speciesId": 1,
"id": 9644,
"dateStart": "2010-11-28",
"timeStart": 16229770,
"freqMax": 3832.91015625,
"freqMin": 2454.78515625,
"duration": 1378,
"audioMp3": "/experiment_assets/NEJB_NE465_20101014-072021.mp3",
"audioOga": "/experiment_assets/NEJB_NE465_20101014-072021.ogg",
"audioWebm": "/experiment_assets/NEJB_NE465_20101014-072021.webm",
"spectrogramImage": "",
"notes": {
"type": "verify - annotation that will be verified; example - example annotation; filler - annotation presented with those to be verified, as a decoy.",
"timeStart": "offset from midnight in milliseconds",
"duration": "in milliseconds"
}
},
{
"type": "verify",
"speciesId": 1,
"locationName": "Peregian Beach",
"id": 9644,
"dateStart": "2010-11-28",
"timeStart": 16229770,
"freqMax": 3832.91015625,
"freqMin": 2454.78515625,
"duration": 1378,
"audioMp3": "/experiment_assets/NEJB_NE465_20101014-072021.mp3",
"audioOga": "/experiment_assets/NEJB_NE465_20101014-072021.ogg",
"audioWebm": "/experiment_assets/NEJB_NE465_20101014-072021.webm",
"spectrogramImage": ""
"locations": [
{
"name": "Peregian Beach",
"lat": -26.469932,
"long": 153.09229,
"environmentType": "Coastal Heath"
},
{
"name": "Bimblebox",
"lat": -23.556582,
"long": 146.478767,
"environmentType": "Semi-arid Woodland"
},
{
"name": "Cape Tribulation",
"lat": -16.097557,
"long": 145.453005,
"environmentType": "Rainforest"
},
{
"name": "Mt Carbine",
"lat": -16.538952,
"long": 145.121655,
"environmentType": "Open Savannah"
},
{
"name": "Samford",
"lat": -27.388907,
"long": 152.878325,
"environmentType": "Dry Sclerophyll Forest"
},
{
"name": "St Bees",
"lat": -20.913738,
"long": 149.44051,
"environmentType": "Cloud Forest"
}
],
"species": [
{
"id": 1,
"lsid": "urn:lsid:biodiversity.org.au:afd.taxon:309069cc-e7e1-454f-9de3-7113400fca49",
"commonName": "Sacred Kingfisher",
"scientificName": "Todiramphus sanctus",
"faunaImage": "http://bie.ala.org.au/repo/1013/128/1286798/smallRaw.jpg",
"distributionImage": ["http://spatial.ala.org.au/layers-service/distribution/map/png/6714",
"http://www.birdsinbackyards.net/sites/www.birdsinbackyards.net/files/styles/medium/public/factsheets/images/map/todiramphus-sanctus.gif"],
"conservationStatus": "Least Concern",
"description": "The Sacred Kingfisher is a medium sized kingfisher. It has a turquoise back, turquoise blue rump and tail, buff-white underparts and a broad cream collar. There is a broad black eye stripe extending from bill to nape of neck. Both sexes are similar, although the female is generally lighter with duller upper parts. Young birds are similar to the female, but have varying amounts of rusty-brown edging to feathers on the collar and underparts, and buff edges on the wing coverts. The voice of the Sacred Kingfisher is a loud \"ek ek ek ek\" repeated continuously throughout breeding season. Birds also give a \"kee kee kee\" in excitement and a series of chirring, scolding notes when alarmed."
}
],
"annotations": [
{
"type": "verify",
"speciesId": 1,
"id": 9644,
"dateStart": "2010-11-28",
"timeStart": 16229770,
"freqMax": 3832.91015625,
"freqMin": 2454.78515625,
"duration": 1378,
"audioMp3": "/experiment_assets/NEJB_NE465_20101014-072021.mp3",
"audioOga": "/experiment_assets/NEJB_NE465_20101014-072021.ogg",
"audioWebm": "/experiment_assets/NEJB_NE465_20101014-072021.webm",
"spectrogramImage": "",
"notes": {
"type": "verify - annotation that will be verified; example - example annotation; filler - annotation presented with those to be verified, as a decoy.",
"timeStart": "offset from midnight in milliseconds",
"duration": "in milliseconds"
}
]
}
},
{
"type": "verify",
"speciesId": 1,
"locationName": "Peregian Beach",
"id": 9644,
"dateStart": "2010-11-28",
"timeStart": 16229770,
"freqMax": 3832.91015625,
"freqMin": 2454.78515625,
"duration": 1378,
"audioMp3": "/experiment_assets/NEJB_NE465_20101014-072021.mp3",
"audioOga": "/experiment_assets/NEJB_NE465_20101014-072021.ogg",
"audioWebm": "/experiment_assets/NEJB_NE465_20101014-072021.webm",
"spectrogramImage": ""
}
]

}

0 comments on commit 3311a6e

Please sign in to comment.