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'))
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'))
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')
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')
def change_password(self): return render('/admin/account/change_password.html')
def index(self): c.attempts = Session.query(Attempt).order_by(desc(Attempt.date)).all() return render('/admin/results/index.html')