Commit da9dd50b8802273dcc26ff735c569b8e1a9cfd58
1 parent
29ec441a
Exists in
master
and in
1 other branch
- changed navbar to include logo on the left and time centered.
Showing
5 changed files
with
75 additions
and
57 deletions
Show diff stats
BUGS.md
| 1 | 1 | |
| 2 | 2 | # BUGS |
| 3 | 3 | |
| 4 | +- config/logger.yaml ainda é do cherrypy... | |
| 5 | +- servir imagens das perguntas | |
| 6 | +- hints nao funciona | |
| 4 | 7 | - fazer renderer para formulas com mathjax serverside (mathjax-node). |
| 5 | 8 | - fazer renderer para imagens, com links /file?ref=xpto;name=zzz.jpg |
| 6 | 9 | - fazer renderer para linguagem assembly mips? |
| 7 | -- servir imagens das perguntas | |
| 8 | -- hints nao funciona | |
| 9 | -- uniformizar question.py com a de aprendizations... | |
| 10 | 10 | - permitir eliminar teste a decorrer |
| 11 | 11 | - eventos unfocus? |
| 12 | 12 | - servidor nao esta a lidar com eventos scroll/resize. ignorar? |
| ... | ... | @@ -39,6 +39,7 @@ |
| 39 | 39 | |
| 40 | 40 | # FIXED |
| 41 | 41 | |
| 42 | +- uniformizar question.py com a de aprendizations... | |
| 42 | 43 | - qual a diferenca entre md_to_html e md_to_html_review, parece desnecessario haver dois. |
| 43 | 44 | - converter markdown para mistune. |
| 44 | 45 | - como alterar configuracao para mostrar logs de debug? | ... | ... |
serve.py
| ... | ... | @@ -321,10 +321,10 @@ class AdminHandler(BaseHandler): |
| 321 | 321 | def main(): |
| 322 | 322 | # --- Commandline argument parsing |
| 323 | 323 | argparser = argparse.ArgumentParser(description='Server for online tests. Enrolled students and tests have to be previously configured. Please read the documentation included with this software before running the server.') |
| 324 | - argparser.add_argument('--debug', action='store_true', | |
| 325 | - help='Show datastructures when rendering questions') | |
| 326 | - argparser.add_argument('--allow-all', action='store_true', help='Students are initially allowed to login (can be denied later)') | |
| 327 | 324 | argparser.add_argument('testfile', type=str, nargs='+', help='test/exam in YAML format.') # FIXME only one exam supported at the moment |
| 325 | + argparser.add_argument('--allow-all', action='store_true', help='Students are initially allowed to login (can be denied later)') | |
| 326 | + argparser.add_argument('--debug', action='store_true', | |
| 327 | + help='Enable debug messages.') | |
| 328 | 328 | arg = argparser.parse_args() |
| 329 | 329 | |
| 330 | 330 | # --- Setup logging |
| ... | ... | @@ -347,14 +347,14 @@ def main(): |
| 347 | 347 | } |
| 348 | 348 | |
| 349 | 349 | try: |
| 350 | - app = App(config) | |
| 350 | + testapp = App(config) | |
| 351 | 351 | except AppException: |
| 352 | 352 | logging.critical('Failed to start application.') |
| 353 | 353 | sys.exit(1) |
| 354 | 354 | |
| 355 | 355 | # --- create web application |
| 356 | 356 | try: |
| 357 | - webapp = WebApplication(app, debug=arg.debug) | |
| 357 | + webapp = WebApplication(testapp, debug=arg.debug) | |
| 358 | 358 | except Exception as e: |
| 359 | 359 | logging.critical('Can\'t start application.') |
| 360 | 360 | raise e | ... | ... |
templates/admin.html
| ... | ... | @@ -22,7 +22,7 @@ |
| 22 | 22 | </head> |
| 23 | 23 | <!-- ===================================================================== --> |
| 24 | 24 | <body> |
| 25 | -<nav class="navbar navbar-expand-sm fixed-top navbar-dark bg-primary"> | |
| 25 | +<nav class="navbar navbar-expand-sm fixed-top navbar-dark bg-danger"> | |
| 26 | 26 | <a class="navbar-brand" href="#">Admin</a> |
| 27 | 27 | <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation"> |
| 28 | 28 | <span class="navbar-toggler-icon"></span> |
| ... | ... | @@ -38,7 +38,7 @@ |
| 38 | 38 | <!-- right --> |
| 39 | 39 | <ul class="navbar-nav"> |
| 40 | 40 | <li class="nav-item dropdown"> |
| 41 | - <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownAluno" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | |
| 41 | + <a class="nav-link dropdown-toggle active" href="#" id="navbarDropdownAluno" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | |
| 42 | 42 | Aluno |
| 43 | 43 | </a> |
| 44 | 44 | <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownAluno"> | ... | ... |
templates/login.html
| 1 | 1 | <!DOCTYPE html> |
| 2 | 2 | <html lang="en"> |
| 3 | - <head> | |
| 4 | - <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
| 5 | - <meta charset="utf-8"> | |
| 6 | - | |
| 7 | - <link rel="icon" href="/static/favicon.ico"> | |
| 8 | - <link rel="stylesheet" href="/static/bootstrap/css/bootstrap.min.css"> | |
| 9 | - | |
| 10 | - <title>Teste</title> | |
| 11 | - </head> | |
| 12 | -<!-- ===================================================================== --> | |
| 13 | - <body> | |
| 14 | - <div class="container-fluid"> | |
| 15 | - <div class="card bg-light border-secondary mb-3"> | |
| 16 | - <div class="card-body"> | |
| 17 | - <div class="row"> | |
| 18 | - | |
| 19 | - <div class="col-sm-4"> | |
| 20 | - <img src="/static/logo_horizontal.png" class="img-responsive" width="60%"> | |
| 21 | - </div> | |
| 22 | - | |
| 23 | - <div class="col-sm-8"> | |
| 3 | +<head> | |
| 4 | + <title>Teste</title> | |
| 5 | + <link rel="icon" href="/static/favicon.ico"> | |
| 6 | + | |
| 7 | + <meta charset="utf-8"> | |
| 8 | + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
| 9 | + | |
| 10 | + <link rel="stylesheet" href="/static/bootstrap/css/bootstrap.min.css"> | |
| 11 | + | |
| 12 | +</head> | |
| 13 | +<!-- =================================================================== --> | |
| 14 | +<body> | |
| 15 | + <div class="container-fluid"> | |
| 16 | + <div class="card bg-light border-secondary mb-3"> | |
| 17 | + <div class="card-body"> | |
| 18 | + <div class="row"> | |
| 19 | + | |
| 20 | + <div class="col-sm-4"> | |
| 21 | + <img src="/static/logo_horizontal.png" class="img-responsive" width="60%"> | |
| 22 | + </div> | |
| 23 | + | |
| 24 | + <div class="col-sm-8"> | |
| 24 | 25 | <h4>Identificação:</h4> |
| 25 | - <form method="post" action="/login" class="form-signin"> | |
| 26 | - {% module xsrf_form_html() %} | |
| 27 | - <div class="form-group"> | |
| 28 | - <input type="text" name="uid" class="form-control" placeholder="Número" required autofocus> | |
| 29 | - <input type="password" name="pw" class="form-control" placeholder="Password" required> | |
| 30 | - <p> {{ error }} </p> | |
| 31 | - </div> | |
| 32 | - <button class="btn btn-primary" type="submit"> | |
| 33 | - <i class="fa fa-sign-in" aria-hidden="true"></i> Entrar | |
| 34 | - </button> | |
| 35 | - </form> | |
| 36 | - </div> | |
| 26 | + | |
| 27 | + <form method="post" action="/login" class="form-signin"> | |
| 28 | + {% module xsrf_form_html() %} | |
| 29 | + <div class="form-group"> | |
| 30 | + <input type="text" name="uid" class="form-control" placeholder="Número" required autofocus> | |
| 31 | + <input type="password" name="pw" class="form-control" placeholder="Password" required> | |
| 32 | + <p> {{ error }} </p> | |
| 33 | + </div> | |
| 34 | + <button class="btn btn-primary" type="submit"> | |
| 35 | + <i class="fa fa-sign-in" aria-hidden="true"></i> Entrar | |
| 36 | + </button> | |
| 37 | + </form> | |
| 37 | 38 | </div> |
| 38 | 39 | </div> |
| 39 | 40 | </div> |
| 40 | - </div> <!-- container --> | |
| 41 | + </div> | |
| 42 | + </div> <!-- container --> | |
| 41 | 43 | |
| 42 | 44 | <!-- Scripts --> |
| 43 | - <script src="/static/js/jquery.min.js"></script> | |
| 44 | - <script src="/static/popper/umd/popper.min.js"></script> | |
| 45 | - <script src="/static/bootstrap/js/bootstrap.min.js"></script> | |
| 45 | + <script src="/static/js/jquery.min.js"></script> | |
| 46 | + <script src="/static/popper/umd/popper.min.js"></script> | |
| 47 | + <script src="/static/bootstrap/js/bootstrap.min.js"></script> | |
| 46 | 48 | |
| 47 | - </body> | |
| 49 | +</body> | |
| 48 | 50 | </html> | ... | ... |
templates/test.html
| ... | ... | @@ -30,25 +30,40 @@ |
| 30 | 30 | |
| 31 | 31 | <nav class="navbar navbar-expand-sm fixed-top navbar-dark bg-dark"> |
| 32 | 32 | <a class="navbar-brand" href="#"> |
| 33 | - <!-- <i class="fa fa-clock-o" aria-hidden="true"></i> --> | |
| 34 | - <span id="clock"> --:-- </span> | |
| 33 | + <img src="/static/logo_navbar.png" height="30" alt=""> | |
| 35 | 34 | </a> |
| 36 | 35 | <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarText" aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation"> |
| 37 | 36 | <span class="navbar-toggler-icon"></span> |
| 38 | 37 | </button> |
| 39 | 38 | |
| 40 | 39 | <div class="collapse navbar-collapse" id="navbarText"> |
| 41 | - <ul class="navbar-nav mr-auto"> | |
| 40 | + <ul class="nav navbar-nav"> | |
| 41 | + <li class="nav-item"></li> | |
| 42 | 42 | </ul> |
| 43 | 43 | |
| 44 | - <span class="navbar-text"> | |
| 45 | - <i class="fa fa-user" aria-hidden="true"></i> | |
| 46 | - <span id="name">{{ escape(t['student']['name']) }}</span> | |
| 47 | - (<span id="number">{{ escape(t['student']['number']) }}</span>) | |
| 48 | - <span class="caret"></span> | |
| 49 | - </span> | |
| 44 | + <ul class="nav navbar-nav mx-auto"> | |
| 45 | + <li class="nav-item"><h5> | |
| 46 | + <span class="navbar-text" id="clock"> --:-- </span> | |
| 47 | + </h5> | |
| 48 | + </li> | |
| 49 | + </ul> | |
| 50 | + | |
| 51 | + <ul class="nav navbar-nav"> | |
| 52 | + <li class="nav-item"> | |
| 53 | + <span class="navbar-text"> | |
| 54 | + <i class="fa fa-user" aria-hidden="true"></i> | |
| 55 | + <span id="name">{{ escape(t['student']['name']) }}</span> | |
| 56 | + (<span id="number">{{ escape(t['student']['number']) }}</span>) | |
| 57 | + <span class="caret"></span> | |
| 58 | + </span> | |
| 59 | + </li> | |
| 60 | + </ul> | |
| 50 | 61 | </div> |
| 51 | 62 | </nav> |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | +<!-- ===================================================================== --> | |
| 52 | 67 | <div class="container"> |
| 53 | 68 | |
| 54 | 69 | <div class="jumbotron"> | ... | ... |