Skip to content
Snippets Groups Projects
Commit c3593208 authored by Will Billingsley's avatar Will Billingsley
Browse files

Added stage 0

parent 99f95d08
No related branches found
No related tags found
No related merge requests found
Pipeline #845 failed
module.exports = {
"require": (function(x0) {
return {}[x0]
})
}
\ No newline at end of file
...@@ -76,8 +76,8 @@ module.exports = __webpack_require__(1); ...@@ -76,8 +76,8 @@ module.exports = __webpack_require__(1);
/***/ (function(module, exports) { /***/ (function(module, exports) {
module.exports = { module.exports = {
"require": (function(x2) { "require": (function(x0) {
return {}[x2] return {}[x0]
}) })
} }
......
This diff is collapsed.
...@@ -40,14 +40,17 @@ object Stage0 { ...@@ -40,14 +40,17 @@ object Stage0 {
def submit() = { def submit() = {
import dom.ext.Ajax import dom.ext.Ajax
val data = Seq( val dataSeq = Seq(
new js.Date().toISOString(), new js.Date().toISOString(),
user, user,
names, names,
school school
).map(csvify).mkString(",") )
if (!dataSeq.exists(_.trim.isEmpty)) {
val data = dataSeq.map(csvify).mkString(",")
val url = "students" val url = "/lavamaze/students"
Ajax.post(url, data) Ajax.post(url, data)
.recoverWith { .recoverWith {
case x: Throwable => x.printStackTrace(); Future.failed(x) case x: Throwable => x.printStackTrace(); Future.failed(x)
...@@ -56,6 +59,7 @@ object Stage0 { ...@@ -56,6 +59,7 @@ object Stage0 {
reachedGoal = true reachedGoal = true
Routing.afterAttach() Routing.afterAttach()
} }
}
} }
...@@ -72,21 +76,23 @@ object Stage0 { ...@@ -72,21 +76,23 @@ object Stage0 {
card("Welcome to the maze...")( card("Welcome to the maze...")(
cardText( cardText(
<.p("First, we need to know who you are for security reasons"), <.p("First, we need to know who you are for security reasons"),
<("form")(
<.div(^.cls := "form-group", <.div(^.cls := "form-group",
<("label")("Username"), <("label")("Username *"),
<("input")(^("type") := "text", ^.cls := "form-control", ^.on("input") ==> setUser, ^("placeholder") := "The one you logged in with") <("input")(^("type") := "text", ^.cls := "form-control", ^("required") := "required", ^.on("input") ==> setUser, ^("placeholder") := "The one you logged in with")
), ),
<.div(^.cls := "form-group", <.div(^.cls := "form-group",
<("label")("Names"), <("label")("Names *"),
<("textarea")(^("rows") := "2", ^.cls := "form-control", ^.on("input") ==> setNames, ^("placeholder") := "Your real names") <("textarea")(^("rows") := "2", ^.cls := "form-control", ^("required") := "required", ^.on("input") ==> setNames, ^("placeholder") := "Your real names")
), ),
<.div(^.cls := "form-group", <.div(^.cls := "form-group",
<("label")("School"), <("label")("School *"),
<("input")(^("type") := "text", ^.cls := "form-control", ^.on("input") ==> setSchool, ^("placeholder") := "Your school") <("input")(^("type") := "text", ^.cls := "form-control", ^("required") := "required", ^.on("input") ==> setSchool, ^("placeholder") := "Your school")
), ),
<.div(^.cls := "form-group", <.div(^.cls := "form-group",
<("label")("Username"), <("label")("Team name"),
<("input")(^("type") := "text", ^.cls := "form-control", ^.on("input") ==> setTeam, ^("placeholder") := "eg, Jumping jellybeans") <("input")(^("type") := "text", ^.cls := "form-control", ^.on("input") ==> setTeam, ^("placeholder") := "eg, Jumping jellybeans")
)
), ),
<.button(^.cls := "btn btn-primary", ^.onClick --> submit, "Save") <.button(^.cls := "btn btn-primary", ^.onClick --> submit, "Save")
) )
......
...@@ -83,10 +83,12 @@ object Stage1 { ...@@ -83,10 +83,12 @@ object Stage1 {
<.p(^.cls := "congrats", s"Code: $code"), <.p(^.cls := "congrats", s"Code: $code"),
<.p("You've reached the goal. Click the run button to see it run your script. And before you move on, copy and paste the text."), <.p("You've reached the goal. Click the run button to see it run your script. And before you move on, copy and paste the text."),
<("div", "stage1")(^.cls := "btn-group", <("div", "stage1")(^.cls := "btn-group",
<.button(^.cls := "btn btn-outline-secondary", ^.onClick --> next, "Stage 0"),
<.button(^.cls := "btn btn-outline-primary", ^.onClick --> Routing.routeTo(Routing.Stage2R), "Stage 2") <.button(^.cls := "btn btn-outline-primary", ^.onClick --> Routing.routeTo(Routing.Stage2R), "Stage 2")
) )
) )
} else <("div", "stage1")(^.cls := "btn-group", } else <("div", "stage1")(^.cls := "btn-group",
<.button(^.cls := "btn btn-outline-secondary", ^.onClick --> next, "Stage 0"),
<.button(^.cls := "btn btn-outline-light", ^.onClick --> next, "Stage 2") <.button(^.cls := "btn btn-outline-light", ^.onClick --> next, "Stage 2")
) )
......
...@@ -76,8 +76,8 @@ module.exports = __webpack_require__(1); ...@@ -76,8 +76,8 @@ module.exports = __webpack_require__(1);
/***/ (function(module, exports) { /***/ (function(module, exports) {
module.exports = { module.exports = {
"require": (function(x2) { "require": (function(x0) {
return {}[x2] return {}[x0]
}) })
} }
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment