Skip to content

Commit 4a448c2

Browse files
committed
Added test framework and new marks for question type
1 parent 5f2c643 commit 4a448c2

19 files changed

+3315
-29146
lines changed

index.html

+6-4
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,13 @@ <h1 class="cover-heading">Ask More Questions!</h1>
4646
<p class="lead">This totally anonymous and realtime updating question moderate system permits students ask more questions in a typical class setting.
4747
Simply join a question room using a simple name (such as comp3111).</p>
4848
<p class="lead" class="col-md-2 col-md-offset-5">
49-
<form name="form" class="navbar-form navbar-left" role="search">
49+
<form name="form" ng-submit="join()" class="navbar-form navbar-left" role="search">
5050
<input type="text" name = "input" class="form-control large"
5151
ng-model="example.text"
5252
ng-pattern="example.word" required
5353
ng-trim="false"
5454
autofocus
55+
aria-describedby="sizing-addon1"
5556
placeholder="Room name">
5657
<a href="#" class="btn btn-lg btn-default"
5758
ng-hide="form.input.$error.required || form.input.$error.pattern"
@@ -83,10 +84,11 @@ <h1 class="cover-heading">Ask More Questions!</h1>
8384
<!-- Bootstrap core JavaScript
8485
================================================== -->
8586
<!-- Placed at the end of the document so the pages load faster -->
86-
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
87-
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
87+
<script src="js/lib/jquery.min.js"></script>
88+
<script src="js/lib/bootstrap.min.js"></script>
8889

89-
<script src="node_modules/angular/angular.js"></script>
90+
<!-- 1.4.2 -->
91+
<script src="js/lib/angular.min.js"></script>
9092

9193
<script>
9294
angular.module('app', [])

js/app.js

+29
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,35 @@
99
*/
1010
var todomvc = angular.module('todomvc', ['firebase', 'ngStorage']);
1111

12+
// Dummy controller for testing
13+
todomvc.
14+
controller('MyCtrl1', ['$scope', '$location', function($scope, $location) {
15+
$scope.test1 = 'EFG';
16+
17+
// Get the first sentence and rest
18+
$scope.getFirstAndRestSentence = function($string) {
19+
var head = $string;
20+
var desc = "";
21+
22+
var separators = ['.', '?', '\n'];
23+
24+
var firstIndex = -1;
25+
for (var i in separators) {
26+
var index = $string.indexOf(separators[i]);
27+
if (index == -1) continue;
28+
if (firstIndex == -1) {firstIndex = index; continue;}
29+
if (firstIndex > index) {firstIndex = index;}
30+
}
31+
32+
if (firstIndex !=-1) {
33+
head = $string.slice(0, firstIndex+1);
34+
desc = $string.slice(firstIndex+1);
35+
}
36+
return [head, desc];
37+
}
38+
39+
}]);
40+
1241
todomvc.filter('todoFilter', function ($location) {
1342
return function (input, max) {
1443
var sorted = [];

0 commit comments

Comments
 (0)