Skip to content

Commit

Permalink
another light touch
Browse files Browse the repository at this point in the history
completed navigation through the second half of the demo.
  • Loading branch information
droarty committed Nov 30, 2014
1 parent 8c8a6e6 commit 4ef4c11
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 3 deletions.
29 changes: 29 additions & 0 deletions javascript/js/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var bpControllers=angular.module('bpControllers',[]);
bpControllers.controller('NameCtrl', ['$scope','$rootScope', '$location', '$http',
function ($scope,$rootScope,$location, $http) {
var rt=$rootScope;
activateTab("#/name");
$scope.msg="";
$scope.btnMsg="Create New Student Record";
window.setTimeout(function(){$("input[ng-model='name']").focus();},500);
Expand Down Expand Up @@ -64,6 +65,7 @@ bpControllers.controller('NameCtrl', ['$scope','$rootScope', '$location', '$http
bpControllers.controller('PredictCtrl', ['$scope','$rootScope', '$location','$http',
function ($scope,$rootScope,$location,$http) {
var rt=$rootScope;
activateTab("#/predict");
//redirect to home page if we don't have a student answeo object...
if(!rt.sa) $location.path("/name");
//if we already have a prediction, draw it...
Expand Down Expand Up @@ -108,6 +110,7 @@ bpControllers.controller('PredictCtrl', ['$scope','$rootScope', '$location','$ht
bpControllers.controller('ComparePredictionCtrl', ['$scope','$rootScope', '$location','$http',
function ($scope,$rootScope, $location,$http) {
var rt=$rootScope;
activateTab("#/comparePredictions");
//redirect to home page if we don't have a student answeo object...
if(!rt.sa) $location.path("/name");
//redraw my prediction...
Expand All @@ -134,3 +137,29 @@ bpControllers.controller('ComparePredictionCtrl', ['$scope','$rootScope', '$loca
]);


/* allow student to choose information needed to solve */
bpControllers.controller('MoreInfoCtrl', ['$scope','$rootScope', '$location','$http',
function ($scope,$rootScope, $location,$http) {
activateTab("#/moreInfo");
}
]);

/* Student documents and draws solution */
bpControllers.controller('SolveItCtrl', ['$scope','$rootScope', '$location','$http',
function ($scope,$rootScope, $location,$http) {
activateTab("#/solveIt");
}
]);

/* fetch all student solutions and display */
bpControllers.controller('CompareSolutionCtrl', ['$scope','$rootScope', '$location','$http',
function ($scope,$rootScope, $location,$http) {
activateTab("#/compareSolution");
}
]);

//sets active nav link in the top nav bar...
var activateTab=function(href){
$("ul.nav li.active").removeClass("active");
$("ul.nav a[href='"+href+"']").parent().addClass("active");
}
4 changes: 4 additions & 0 deletions nbproject/private/private.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
</project-private>
2 changes: 1 addition & 1 deletion partials/comparePrediction.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ <h1>Compare your Predictions</h1>
</g>
</svg>

<div class="bpContinue"><span class="btn btn-info">Done, Go To Next Step</span></div>
<div class="bpContinue"><a class="btn btn-info" href="#/moreInfo">Done, Go To Next Step</a></div>
</div>
2 changes: 1 addition & 1 deletion partials/moreInfo.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ <h1>More Info</h1>
<li>Diameter of 30lb weight</li>
<li>... </li>
</ul>
<div class="bpContinue"><span class="btn btn-info">Done, Go To Next Step</span></div>
<div class="bpContinue"><a class="btn btn-info" href="#/solveIt">Done, Go To Next Step</a></div>
</div>
2 changes: 1 addition & 1 deletion partials/solveIt.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ <h1>Solve It</h1>
<div class="bpInstructions">
Use the space below to solve the problem and explain how you got your answer. Then click continue.
</div>
<div class="bpContinue"><span class="btn btn-info">Submit your Answer</span></div>
<div class="bpContinue"><a class="btn btn-info" href="#/compareSolution">Submit your Answer</a></div>
</div>

0 comments on commit 4ef4c11

Please sign in to comment.