Skip to content

Commit

Permalink
test the test
Browse files Browse the repository at this point in the history
  • Loading branch information
pbberlin committed Dec 29, 2023
1 parent ccd895d commit befabba
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 119 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ If you have created your survey `myquest` you need to restart the application.

* `v=123`- show q.Version - setting the version at login. Later requests have no effect.
`LoginWithoutID()` and `LoginByHash()` pass the value of this param on
and store it into `LogintT.Attrs["version"]`
and store it into `LogintT.Attrs["version"]`;
example `kneb1/main.go`

* `show-version=true` - show q.Version

Expand Down
56 changes: 32 additions & 24 deletions app-bucket/responses/kneb1-2023-06.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
]
},
"closing_time": "0001-01-01T00:00:00Z",
"md_5": "5de4df3a7fa18c435a437ba78b28fd5cbd291fb861b263beef6450b0864eb0d9",
"md_5": "9d87dc6bf0ae81acd4f38eb2bc1f53f9f0b1110c8b16cb5b39a1317c0970ed90",
"lang_codes": [
"de"
],
Expand Down Expand Up @@ -15610,7 +15610,7 @@
"de": "Treatment:\u003cbr\u003eGiving advice",
"en": "todo"
},
"navigation_condition": "kneb_t2b",
"navigation_condition": "kneb_t2a",
"style": {
"desktop": {
"grid_container_style": {},
Expand Down Expand Up @@ -20048,8 +20048,8 @@
{
"type": "textblock",
"label": {
"de": "\u003cb\u003eX5.\u003c/b\u003e \u0026nbsp; \n\t\t\t\tHaben Sie während Ihrer Schul- oder Berufsausbil\u0026shy;dung an Vorlesungen,\n\t\t\t\tKursen oder Fortbil\u0026shy;dungen zum Thema Finanzen oder dem Umgang mit Geld teilgenommen?\n\t\t\t",
"en": "\u003cb\u003eX5.\u003c/b\u003e \u0026nbsp; todo"
"de": "\u003c!-- X5. --\u003e\n\t\t\t\tHaben Sie während Ihrer Schul- oder Berufsausbil\u0026shy;dung an Vorlesungen,\n\t\t\t\tKursen oder Fortbil\u0026shy;dungen zum Thema Finanzen oder dem Umgang mit Geld teilgenommen?\n\t\t\t",
"en": "\u003c!-- X5. --\u003etodo"
},
"col_span": 9,
"col_span_label": 1
Expand Down Expand Up @@ -20976,8 +20976,8 @@
{
"type": "textblock",
"label": {
"de": "\u003cb\u003eB4.\u003c/b\u003e \u0026nbsp; \n\t\t\t\t\tHaben Sie selbst schon einmal einer anderen Person finanzielle Ratschläge gegeben?\n\t\t\t\t",
"en": "\u003cb\u003eB4.\u003c/b\u003e \u0026nbsp; todo"
"de": "\u003c!-- B4. --\u003e\n\t\t\t\t\tHaben Sie selbst schon einmal einer anderen Person finanzielle Ratschläge gegeben?\n\t\t\t\t",
"en": "\u003c!-- B4. --\u003etodo"
},
"col_span": 9,
"col_span_label": 1
Expand Down Expand Up @@ -22022,8 +22022,8 @@
{
"type": "textblock",
"label": {
"de": "\u003cb\u003ea)\u003c/b\u003e \u0026nbsp; \n\t\t\t\t\talltägliche Einkäufe (z.B. Lebensmitteleinkäufe)\n\t\t\t\t",
"en": "\u003cb\u003ea)\u003c/b\u003e \u0026nbsp; todo"
"de": "\u003c!-- a) --\u003e\n\t\t\t\t\talltägliche Einkäufe (z.B. Lebensmitteleinkäufe)\n\t\t\t\t",
"en": "\u003c!-- a) --\u003etodo"
},
"col_span": 9,
"col_span_label": 1
Expand Down Expand Up @@ -22143,8 +22143,8 @@
{
"type": "textblock",
"label": {
"de": "\u003cb\u003eb)\u003c/b\u003e \u0026nbsp; \n\t\t\t\t\tgrö\u0026shy;ßere Anschaffungen (z.B. Möbel, Auto)\n\t\t\t\t",
"en": "\u003cb\u003eb)\u003c/b\u003e \u0026nbsp; todo"
"de": "\u003c!-- b) --\u003e\n\t\t\t\t\tgrö\u0026shy;ßere Anschaffungen (z.B. Möbel, Auto)\n\t\t\t\t",
"en": "\u003c!-- b) --\u003etodo"
},
"col_span": 9,
"col_span_label": 1
Expand Down Expand Up @@ -22264,8 +22264,8 @@
{
"type": "textblock",
"label": {
"de": "\u003cb\u003ec)\u003c/b\u003e \u0026nbsp; \n\t\t\t\t\tEssensplanung und -zubereitung\n\t\t\t\t",
"en": "\u003cb\u003ec)\u003c/b\u003e \u0026nbsp; todo"
"de": "\u003c!-- c) --\u003e\n\t\t\t\t\tEssensplanung und -zubereitung\n\t\t\t\t",
"en": "\u003c!-- c) --\u003etodo"
},
"col_span": 9,
"col_span_label": 1
Expand Down Expand Up @@ -22385,8 +22385,8 @@
{
"type": "textblock",
"label": {
"de": "\u003cb\u003ed)\u003c/b\u003e \u0026nbsp; \n\t\t\t\t\tEntscheidungen über Spar- und Finanzanlagen\n\t\t\t\t",
"en": "\u003cb\u003ed)\u003c/b\u003e \u0026nbsp; todo"
"de": "\u003c!-- d) --\u003e\n\t\t\t\t\tEntscheidungen über Spar- und Finanzanlagen\n\t\t\t\t",
"en": "\u003c!-- d) --\u003etodo"
},
"col_span": 9,
"col_span_label": 1
Expand Down Expand Up @@ -23745,8 +23745,8 @@
{
"type": "textblock",
"label": {
"de": "\u003cb\u003ea)\u003c/b\u003e \u0026nbsp; \n\t\t\t\t\tPrivate Lebensversi\u0026shy;cherungen\n\n\t\t\t\t\t\u003csmall\u003e\n\t\t\t\t\tz.B. klassische und fondsgebundene Kapitallebensversi\u0026shy;cherungen,\n\t\t\t\t\t\t\u003ci\u003enicht\u003c/i\u003e reine Risikolebensversi\u0026shy;cherungen\n\t\t\t\t\t\toder Direktversi\u0026shy;cherungen über den Arbeitgeber\n\t\t\t\t\t\u003c/small\u003e\n\n\t\t\t\t",
"en": "\u003cb\u003ea)\u003c/b\u003e \u0026nbsp; todo"
"de": "\u003c!-- a) --\u003e\n\t\t\t\t\tPrivate Lebensversi\u0026shy;cherungen\n\n\t\t\t\t\t\u003csmall\u003e\n\t\t\t\t\tz.B. klassische und fondsgebundene Kapitallebensversi\u0026shy;cherungen,\n\t\t\t\t\t\t\u003ci\u003enicht\u003c/i\u003e reine Risikolebensversi\u0026shy;cherungen\n\t\t\t\t\t\toder Direktversi\u0026shy;cherungen über den Arbeitgeber\n\t\t\t\t\t\u003c/small\u003e\n\n\t\t\t\t",
"en": "\u003c!-- a) --\u003etodo"
},
"col_span": 9,
"col_span_label": 1
Expand Down Expand Up @@ -23846,8 +23846,8 @@
{
"type": "textblock",
"label": {
"de": "\u003cb\u003eb)\u003c/b\u003e \u0026nbsp; \n\t\t\t\t\tBetriebliche Lebensversi\u0026shy;cherungen\n\t\t\t\t\t\u003cbr\u003e\n\t\t\t\t\t\u003csmall\u003e\n\t\t\t\t\t(z. B. Direktversi\u0026shy;cherungen)\n\t\t\t\t\t\u003c/small\u003e\n\n\t\t\t\t",
"en": "\u003cb\u003eb)\u003c/b\u003e \u0026nbsp; todo"
"de": "\u003c!-- b) --\u003e\n\t\t\t\t\tBetriebliche Lebensversi\u0026shy;cherungen\n\t\t\t\t\t\u003cbr\u003e\n\t\t\t\t\t\u003csmall\u003e\n\t\t\t\t\t(z. B. Direktversi\u0026shy;cherungen)\n\t\t\t\t\t\u003c/small\u003e\n\n\t\t\t\t",
"en": "\u003c!-- b) --\u003etodo"
},
"col_span": 9,
"col_span_label": 1
Expand Down Expand Up @@ -23947,8 +23947,8 @@
{
"type": "textblock",
"label": {
"de": "\u003cb\u003ec)\u003c/b\u003e \u0026nbsp; \n\t\t\t\t\tSonstige betriebliche Altersvorsorge\n\t\t\t\t\t\u003csmall\u003e\n\t\t\t\t\t(z. B. Betriebsrenten aus Pensions- oder Un\u0026shy;terstützungskassen und betriebliche Direktzusagen sowie Zusatzversorgung im öffentlichen Dienst; auch aus früheren Beschäftigungsverhältnissen)\n\t\t\t\t\t\u003c/small\u003e\n\n\t\t\t\t",
"en": "\u003cb\u003ec)\u003c/b\u003e \u0026nbsp; todo"
"de": "\u003c!-- c) --\u003e\n\t\t\t\t\tSonstige betriebliche Altersvorsorge\n\t\t\t\t\t\u003csmall\u003e\n\t\t\t\t\t(z. B. Betriebsrenten aus Pensions- oder Un\u0026shy;terstützungskassen und betriebliche Direktzusagen sowie Zusatzversorgung im öffentlichen Dienst; auch aus früheren Beschäftigungsverhältnissen)\n\t\t\t\t\t\u003c/small\u003e\n\n\t\t\t\t",
"en": "\u003c!-- c) --\u003etodo"
},
"col_span": 9,
"col_span_label": 1
Expand Down Expand Up @@ -24048,8 +24048,8 @@
{
"type": "textblock",
"label": {
"de": "\u003cb\u003ed)\u003c/b\u003e \u0026nbsp; \n\t\t\t\t\tStaatlich geförderte private Altersvorsorge („Riester- Rente“)\n\t\t\t\t\t\u003csmall\u003e\n\t\t\t\t\t(staatlich geförderte und zertifizierte Sparanlagen, auch „Rürup-“ bzw. Basisrenten)\n\t\t\t\t\t\u003c/small\u003e\n\n\t\t\t\t",
"en": "\u003cb\u003ed)\u003c/b\u003e \u0026nbsp; todo"
"de": "\u003c!-- d) --\u003e\n\t\t\t\t\tStaatlich geförderte private Altersvorsorge („Riester- Rente“)\n\t\t\t\t\t\u003csmall\u003e\n\t\t\t\t\t(staatlich geförderte und zertifizierte Sparanlagen, auch „Rürup-“ bzw. Basisrenten)\n\t\t\t\t\t\u003c/small\u003e\n\n\t\t\t\t",
"en": "\u003c!-- d) --\u003etodo"
},
"col_span": 9,
"col_span_label": 1
Expand Down Expand Up @@ -24149,8 +24149,8 @@
{
"type": "textblock",
"label": {
"de": "\u003cb\u003ee)\u003c/b\u003e \u0026nbsp; \n\t\t\t\t\tPrivate Rentenversi\u0026shy;cherungen\n\t\t\t\t\t\u003csmall\u003e\n\t\t\t\t\t(z.B. private Rentenversi\u0026shy;cherungsverträge, die \u003cu\u003e\u003ci\u003enicht\u003c/i\u003e\u003c/u\u003e staatlich gefördert werden bzw. abgeschlossen wurden, \n\t\t\t\t\t\tbevor es solche Fördermöglichkeiten gab)\n\t\t\t\t\t\u003c/small\u003e\n\t\t\t\t",
"en": "\u003cb\u003ee)\u003c/b\u003e \u0026nbsp; todo"
"de": "\u003c!-- e) --\u003e\n\t\t\t\t\tPrivate Rentenversi\u0026shy;cherungen\n\t\t\t\t\t\u003csmall\u003e\n\t\t\t\t\t(z.B. private Rentenversi\u0026shy;cherungsverträge, die \u003cu\u003e\u003ci\u003enicht\u003c/i\u003e\u003c/u\u003e staatlich gefördert werden bzw. abgeschlossen wurden, \n\t\t\t\t\t\tbevor es solche Fördermöglichkeiten gab)\n\t\t\t\t\t\u003c/small\u003e\n\t\t\t\t",
"en": "\u003c!-- e) --\u003etodo"
},
"col_span": 9,
"col_span_label": 1
Expand Down Expand Up @@ -24520,13 +24520,21 @@
"de": "\u003c!-- Z2. --\u003e\n\t\t\t\t\t\tGibt es noch irgendetwas, was Sie uns zu diesem Fragebogen \n\t\t\t\t\t\toder Thema mitteilen möchten?\n\t\t\t\t\t",
"en": "\u003c!-- Z2. --\u003e\n\t\t\t\t\t\ttodo\n\t\t\t\t\t"
},
"col_span": 1,
"col_span_label": 1
},
{
"name": "qz2_comment",
"type": "textarea",
"max_chars": 300,
"col_span": 1,
"col_span_control": 1
},
{
"type": "dyn-textblock",
"col_span": 1,
"col_span_label": 1,
"dynamic_func": "PermaLink"
}
],
"style": {
Expand Down
2 changes: 1 addition & 1 deletion app-bucket/templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@

{{if exists . "Q"}}
{{if ne (.Req.Form.Get "show-version") ""}}
winword datei : -R{{addInt .Q.Version 1}}_....docx-
version: {{addInt .Q.Version 0}} (zero indexed)
{{end}}
{{end}}

Expand Down
9 changes: 3 additions & 6 deletions cmd/server/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,9 @@ func TestSystem(t *testing.T) {
if surveyID == "peu2018-or-special-survey-name" {
//
}
if surveyID == "kneb1" {
continue
}
if surveyID == "kneb" {
continue
}
// if surveyID == "kneb1" {
// continue
// }

// if surveyID != "pds" {
// continue
Expand Down
Empty file added git
Empty file.
2 changes: 1 addition & 1 deletion pkg/generators/kneb1/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func twoAnswers(
{
inp := gr.AddInput()
inp.Type = "textblock"
inp.Label = lbl.Outline(outlineNumber)
inp.Label = lbl.OutlineHid(outlineNumber)
inp.ColSpan = gr.Cols
inp.ColSpanLabel = 1
inp.ColSpanControl = 0
Expand Down
94 changes: 13 additions & 81 deletions pkg/generators/kneb1/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -1533,29 +1533,6 @@ func Create(s qst.SurveyT) (*qst.QuestionnaireT, error) {
}
}

/*
// gr 1
{
gr := page.AddGroup()
gr.Cols = 3
gr.BottomVSpacers = 3
{
inp := gr.AddInput()
inp.Type = "textblock"
inp.Label = trl.S{
"de": `
Certainty equivalent experiment<br>
Siehe Menkhoff und Sakha (2016, 2017) Appendix A.3.<br>
todo
`,
"en": `todo`,
}.OutlineHid("P7.")
inp.ColSpan = gr.Cols
inp.ColSpanLabel = 1
}
}
*/
}

vorsorgeplanung8x7(&q, 0, 1)
Expand Down Expand Up @@ -1747,24 +1724,6 @@ func Create(s qst.SurveyT) (*qst.QuestionnaireT, error) {

}

/*
// page 7-5
{
page := q.AddPage()
page.Label = trl.S{
"de": "",
"en": "",
}
page.SuppressInProgressbar = true
page.WidthMax("42rem")
page.WidthMax("48rem")
howSicher(*qst.WrapPageT(page), "qfl3a_free", "FL3a.")
}
*/

/*
// page 7-7
{
Expand All @@ -1775,53 +1734,15 @@ func Create(s qst.SurveyT) (*qst.QuestionnaireT, error) {
"en": "",
}
page.SuppressInProgressbar = true
page.WidthMax("42rem")
page.WidthMax("48rem")
howSicher(*qst.WrapPageT(page), "qfl4a_free", "FL4a.")
}
*/

/*
*/

/*
// page 7-9
{
page := q.AddPage()
page.Label = trl.S{
"de": "",
"en": "",
}
page.SuppressInProgressbar = true
page.WidthMax("42rem")
page.WidthMax("48rem")
howSicher(*qst.WrapPageT(page), "qfl5a_free", "FL5a.")
}
*/

/*
// page 7-11
{
page := q.AddPage()
page.Label = trl.S{
"de": "",
"en": "",
}
page.SuppressInProgressbar = true
page.WidthMax("42rem")
page.WidthMax("48rem")
howSicher(*qst.WrapPageT(page), "qfl6a_free", "FL6a.")
}
*/

//
// experiment sequence
//
// page chart introduction 1 neutral
{
Expand Down Expand Up @@ -2654,7 +2575,7 @@ func Create(s qst.SurveyT) (*qst.QuestionnaireT, error) {
{
page := q.AddPage()

page.NavigationCondition = "kneb_t2b"
page.NavigationCondition = "kneb_t2a"

page.Label = trl.S{
"de": "Treatment: Giving advice",
Expand Down Expand Up @@ -3866,16 +3787,27 @@ func Create(s qst.SurveyT) (*qst.QuestionnaireT, error) {
`,
}.OutlineHid("Z2.")
inp.ColSpanLabel = 1
inp.ColSpan = gr.Cols
}
{
inp := gr.AddInput()
inp.Type = "textarea"
inp.Name = "qz2_comment"
inp.MaxChars = 300
inp.ColSpan = gr.Cols
inp.ColSpanLabel = 0
inp.ColSpanControl = 1
}

{
inp := gr.AddInput()
inp.Type = "dyn-textblock"
inp.DynamicFunc = "PermaLink"
inp.ColSpan = gr.Cols
inp.ColSpanControl = 0
inp.ColSpanLabel = 1
}

}

//
Expand Down
6 changes: 4 additions & 2 deletions pkg/qst/funcs-dynamic.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ func LinkBack(q *QuestionnaireT, inp *inputT, paramSet string) (string, error) {
return ret, nil
}

// PersonalLink is only a reminder, does not contain the personal link
// PersonalLink is only a reminder, does not contain the personal link;
// see PermaLink
func PersonalLink(q *QuestionnaireT, inp *inputT, paramSet string) (string, error) {
closed := !q.ClosingTime.IsZero()
ret := ""
Expand All @@ -166,7 +167,8 @@ func PersonalLink(q *QuestionnaireT, inp *inputT, paramSet string) (string, erro
return ret, nil
}

// PermaLink returns the perma link
// PermaLink returns the perma link;
// only possible if the initial login was accomplished via direct login.
func PermaLink(q *QuestionnaireT, inp *inputT, paramSet string) (string, error) {
closed := !q.ClosingTime.IsZero()
ret := ""
Expand Down
6 changes: 3 additions & 3 deletions pkg/qst/funcs-navigation.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var naviFuncs = map[string]func(*QuestionnaireT, int) bool{
"pds_ac2": pdsAssetClass2,
"pds_ac3": pdsAssetClass3,

"kneb_t1a": knebTreatment1NeurtraVsFinance_A,
"kneb_t1a": knebTreatment1NeutraVsFinance_A,
"kneb_t1b": knebTreatment1NeurtraVsFinance_B,
"kneb_t2a": knebTreatment2AdviceNoOrYes_A,
"kneb_t2b": knebTreatment2AdviceNoOrYes_B,
Expand Down Expand Up @@ -128,14 +128,14 @@ func pdsAssetClass(q *QuestionnaireT, pageIdx int, acIdx int) bool {

//
//
func knebTreatment1NeurtraVsFinance_A(q *QuestionnaireT, pageIdx int) bool {
func knebTreatment1NeutraVsFinance_A(q *QuestionnaireT, pageIdx int) bool {
if q.Version()%2 == 0 {
return true
}
return false
}
func knebTreatment1NeurtraVsFinance_B(q *QuestionnaireT, pageIdx int) bool {
return !knebTreatment1NeurtraVsFinance_A(q, pageIdx)
return !knebTreatment1NeutraVsFinance_A(q, pageIdx)
}

// 1000,1001 => 500 => 0 => false
Expand Down

0 comments on commit befabba

Please sign in to comment.