Пример #1
0
 def show(self, id):
     attempt = Session.query(Attempt).get(int(id))
     if attempt and attempt.is_attempted:
         c.attempt = attempt
         return render('/admin/results/show.html')
     else:
         redirect(url(controller='results', action='index'))
Пример #2
0
 def show(self, id):
     attempt = Session.query(Attempt).get(int(id))
     if attempt and attempt.is_attempted:
         c.attempt = attempt
         return render('/admin/results/show.html')
     else:
         redirect(url(controller='results', action='index'))
Пример #3
0
 def test(self, id):
     attempt = Session.query(Attempt).get(int(id))
     if attempt and not attempt.is_attempted:
         c.attempt_id = attempt.id
         c.test = json.loads(attempt.test)
         return render('/attempt/test.html')
     else:
         redirect(url(controller='attempt', action='index'))
Пример #4
0
 def login(self):
     """
     This is where the login form should be rendered.
     Without the login counter, we won't be able to tell if the user has
     tried to log in with wrong credentials
     """
     identity = request.environ.get('repoze.who.identity')
     came_from = str(request.GET.get('came_from', '')) or url(controller='tests', action='index')
     if identity:
         redirect(url(came_from))
     else:
         c.came_from = came_from
         c.login_counter = request.environ['repoze.who.logins'] + 1
         return render('/admin/account/login.html')
Пример #5
0
 def index(self):
     c.message = request.params.get('message')
     if not hasattr(c, 'message'):
         c.message = u""
     c.tests = Session.query(TestSuite).all()
     return render('/attempt/index.html')
Пример #6
0
 def change_password(self):
     return render('/admin/account/change_password.html')
Пример #7
0
 def index(self):
     c.attempts = Session.query(Attempt).order_by(desc(Attempt.date)).all()
     return render('/admin/results/index.html')
Пример #8
0
 def index(self):
     c.attempts = Session.query(Attempt).order_by(desc(Attempt.date)).all()
     return render('/admin/results/index.html')