Finish first regression test for participant response
This commit is contained in:
parent
6db487e37a
commit
587b35326b
5 changed files with 22 additions and 4 deletions
13
dist/main.bundle.js
vendored
13
dist/main.bundle.js
vendored
File diff suppressed because one or more lines are too long
|
@ -243,6 +243,9 @@ func (model *Response) Update(db *Database, args map[string]string, w http.Respo
|
|||
if !response.(*Response).IsActive() {
|
||||
return nil, errors.OutOfTime
|
||||
}
|
||||
|
||||
response.(*Response).SingleResponses = make([]*SingleResponse, 0)
|
||||
|
||||
err = renderer.Decode(response, r)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
@ -66,4 +66,8 @@ $(function () {
|
|||
|
||||
$(".karmen-ajax-delete").on("click", deleteHandler);
|
||||
|
||||
$("#reset_responses").on("click", function(eventObject) {
|
||||
$('.form-check-input').removeAttr('checked');
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
<footer class="footer text-center">
|
||||
<div class="container">
|
||||
<span class="text-center text-muted">© 2020 <a href="https://www.olimpiadi-economiaefinanza.it">Olimpiadi di Economia e Finanza 2020</a> ({{version}})
|
||||
<span class="text-center text-muted">© 2020 <a href="https://www.olimpiadi-economiaefinanza.it">Olimpiadi di Economia e Finanza</a> ({{version}})
|
||||
</span>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
{{if isResponseIn $answer.ID $.Data.AnswersIDs}}
|
||||
{{$checked = true}}
|
||||
{{end}}
|
||||
<input class="form-check-input" type="radio" name="SingleResponses.{{$id}}" id="answer_{{$answer.ID}}" value="{{$answer.ID}}" required {{if $checked}}checked{{end}}>
|
||||
<input class="form-check-input" type="radio" name="SingleResponses.{{$id}}" id="answer_{{$answer.ID}}" value="{{$answer.ID}}" {{if $isParticipant}}required{{end}} {{if $checked}}checked{{end}}>
|
||||
<label class="form-check-label {{if and $isAdmin $answer.Correct}}text-success{{end}}" for="answer_{{$answer.ID}}">
|
||||
{{$answer}}
|
||||
</label>
|
||||
|
@ -75,7 +75,7 @@
|
|||
{{- end -}}
|
||||
</dl>
|
||||
<button type="submit" class="btn btn-primary" form="{{$form}}">Salva</button>
|
||||
{{if $isAdmin}}<button id="reset_responses" type="reset" class="btn btn-outline-secondary" form="{{$form}}">Cancella risposte</button>{{end}}
|
||||
{{if $isAdmin}}<button id="reset_responses" class="btn btn-outline-secondary">Cancella risposte</button>{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue