Commit 74a38303ebbdfc7abe428e3e70df4f5e4946dfa0
1 parent
9db32bd0
Exists in
master
and in
1 other branch
- show type of submission
- fix timer when there is no time limit
Showing
3 changed files
with
17 additions
and
6 deletions
Show diff stats
demo/demo.yaml
perguntations/__init__.py
perguntations/templates/test.html
| ... | ... | @@ -91,7 +91,11 @@ |
| 91 | 91 | </div> |
| 92 | 92 | <div class="row"> |
| 93 | 93 | <label for="duracao" class="col-sm-3">Duração:</label> |
| 94 | - <div class="col-sm-9" id="duracao">{{ str(t['duration'])+' minutos' if t['duration'] > 0 else chr(8734) }}</div> | |
| 94 | + <div class="col-sm-9" id="duracao">{{ str(t['duration'])+' minutos' if t['duration'] > 0 else 'sem limite' }}</div> | |
| 95 | + </div> | |
| 96 | + <div class="row"> | |
| 97 | + <label for="submissao" class="col-sm-3">Submissão:</label> | |
| 98 | + <div class="col-sm-9" id="submissao">{{ 'automática' if t['autosubmit'] else 'manual' }}</div> | |
| 95 | 99 | </div> |
| 96 | 100 | </h5> |
| 97 | 101 | </div> |
| ... | ... | @@ -147,9 +151,14 @@ |
| 147 | 151 | </script> |
| 148 | 152 | |
| 149 | 153 | <script> |
| 150 | - | |
| 151 | 154 | var finishtime = new Date().getTime() + {{ t['duration']*60*1000 }}; |
| 152 | 155 | |
| 156 | + {% if t['duration'] == 0 %} | |
| 157 | + $("#clock").html("+\u221e"); | |
| 158 | + {% else %} | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 153 | 162 | // Update the count down every 1 second |
| 154 | 163 | var x = setInterval(function() { |
| 155 | 164 | var now = new Date().getTime(); |
| ... | ... | @@ -159,8 +168,8 @@ |
| 159 | 168 | var minutes = Math.floor((distance / (1000 * 60))); |
| 160 | 169 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
| 161 | 170 | |
| 162 | - if (distance >= 1000*50) { | |
| 163 | - $("#clock").html(minutes + ":" + seconds); | |
| 171 | + if (distance >= 1000*60) { | |
| 172 | + $("#clock").html(minutes + ":" + (seconds<10?'0':'') +seconds); | |
| 164 | 173 | } |
| 165 | 174 | else if (distance >= 0) { |
| 166 | 175 | $("#navbar").removeClass('bg-dark').addClass("bg-danger"); |
| ... | ... | @@ -174,6 +183,8 @@ |
| 174 | 183 | } |
| 175 | 184 | }, 1000); |
| 176 | 185 | |
| 186 | + {% end %} | |
| 187 | + | |
| 177 | 188 | </script> |
| 178 | 189 | |
| 179 | 190 | ... | ... |