Skip to content

Commit cbada9d

Browse files
simplify next functions
1 parent 35507a8 commit cbada9d

File tree

3 files changed

+9
-21
lines changed

3 files changed

+9
-21
lines changed

go-app-ussdapp.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ go.app = function() {
571571
"state_department":
572572
$("Please enter your department name"),
573573
"state_end_registration":
574-
$("Thank you for registering. You'll soon be receiving quizzes."),
574+
$("Thank you for registering. You'll soon be receiving quizzes."),
575575

576576
"state_end_quiz":
577577
$("Thank you for completing your quiz."),
@@ -626,9 +626,7 @@ go.app = function() {
626626
self.add("state_facility_code", function(name) {
627627
return new FreeText(name, {
628628
question: questions[name],
629-
next: function(input) {
630-
return "state_gender";
631-
}
629+
next: "state_gender"
632630
});
633631
});
634632

@@ -640,19 +638,15 @@ go.app = function() {
640638
new Choice("male", $("Male")),
641639
new Choice("female", $("Female"))
642640
],
643-
next: function(input) {
644-
return "state_cadre";
645-
}
641+
next: "state_cadre"
646642
});
647643
});
648644

649645
// FreeText st-03
650646
self.add("state_cadre", function(name) {
651647
return new FreeText(name, {
652648
question: questions[name],
653-
next: function(input) {
654-
return "state_department";
655-
}
649+
next: "state_department"
656650
});
657651
});
658652

src/ussdapp.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ go.app = function() {
2929
"state_department":
3030
$("Please enter your department name"),
3131
"state_end_registration":
32-
$("Thank you for registering. You'll soon be receiving quizzes."),
32+
$("Thank you for registering. You'll soon be receiving quizzes."),
3333

3434
"state_end_quiz":
3535
$("Thank you for completing your quiz."),
@@ -84,9 +84,7 @@ go.app = function() {
8484
self.add("state_facility_code", function(name) {
8585
return new FreeText(name, {
8686
question: questions[name],
87-
next: function(input) {
88-
return "state_gender";
89-
}
87+
next: "state_gender"
9088
});
9189
});
9290

@@ -98,19 +96,15 @@ go.app = function() {
9896
new Choice("male", $("Male")),
9997
new Choice("female", $("Female"))
10098
],
101-
next: function(input) {
102-
return "state_cadre";
103-
}
99+
next: "state_cadre"
104100
});
105101
});
106102

107103
// FreeText st-03
108104
self.add("state_cadre", function(name) {
109105
return new FreeText(name, {
110106
question: questions[name],
111-
next: function(input) {
112-
return "state_department";
113-
}
107+
next: "state_department"
114108
});
115109
});
116110

test/ussdapp.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ describe("UoP TB registration app", function() {
121121
)
122122
.check.interaction({
123123
state: "state_end_registration",
124-
reply: "Thank you for registering. You'll soon be receiving quizzes."
124+
reply: "Thank you for registering. You'll soon be receiving quizzes."
125125
})
126126
.check(function(api) {
127127
go.utils.check_fixtures_used(api, [1,2,3,4,5]);

0 commit comments

Comments
 (0)