From 5dd6cc6fb12993e00c2ec2ee3b0bae47da7ab9cd Mon Sep 17 00:00:00 2001 From: Jonas Date: Tue, 17 Nov 2020 08:29:12 +0100 Subject: [PATCH] adding css --- game.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/game.go b/game.go index 7a2d986..8538c48 100644 --- a/game.go +++ b/game.go @@ -35,12 +35,14 @@ func requestHandler(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "text/html") i := rand.Intn(len(phrases.Phrases)) fmt.Fprintf(w, ` - %s + +

¿subjuntivo o indicativo?

%s
+ Pon la palabra en la forma adecuada:
- +
`, phrases.Phrases[i].Phrase, i) } func answerHandler(w http.ResponseWriter, r *http.Request) { @@ -50,7 +52,7 @@ func answerHandler(w http.ResponseWriter, r *http.Request) { log.Fatal(err) } p := phrases.Phrases[i] - pageContent := "" + p.Phrase + "

¿subjuntivo o indicativo?

" + p.Phrase + "
tu respuesta estaba " if r.FormValue("answer") == p.Answer { - pageContent += "correcta!. Buen hecho
=i { j++ } - pageContent+= "
frase nueva: " + phrases.Phrases[j].Phrase + `
+ pageContent+= "

frase nueva: " + phrases.Phrases[j].Phrase + `
@@ -76,9 +78,6 @@ func answerHandler(w http.ResponseWriter, r *http.Request) { } func main() { ParseJSON() -/* for _, phrase := range phrases.Phrases { - fmt.Println(phrase.Phrase) - }*/ http.HandleFunc("/", requestHandler) http.HandleFunc("/answer/", answerHandler) log.Fatal(http.ListenAndServe(":8080", nil))