예제 #1
0
파일: results.py 프로젝트: Kentzo/BZD-tests
 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
파일: account.py 프로젝트: Kentzo/BZD-tests
 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
파일: account.py 프로젝트: Kentzo/BZD-tests
 def change_password(self):
     return render('/admin/account/change_password.html')
예제 #7
0
파일: results.py 프로젝트: Kentzo/BZD-tests
 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')