コード例 #1
0
ファイル: tests.py プロジェクト: TomyRO/wouso
def _make_question_for_today(user, text):
    category = Category(name='qotd')
    question = Question(text=text, proposed_by=user, category=category, active=1)
    question.save()
    for i in range(4):
        Answer.objects.create(question=question, correct=i==1, text='a %d'%i)
    sched = Schedule(question=question)
    sched.save()
    return question
コード例 #2
0
ファイル: tests.py プロジェクト: MathPlayer/wouso
def _make_question_for_today(user, text):
    category = Category(name='qotd')
    question = Question(text=text, proposed_by=user, category=category, active=1)
    question.save()
    for i in range(4):
        Answer.objects.create(question=question, correct=i == 1, text='a %d' % i)
    sched = Schedule(question=question)
    sched.save()
    return question
コード例 #3
0
ファイル: tests.py プロジェクト: vladfulgeanu/wouso
def _make_question_for_today(user, text):
    category = Category(name='qotd')
    question = Question(text=text,
                        proposed_by=user,
                        category=category,
                        active=1)
    question.save()
    sched = Schedule(question=question)
    sched.save()
コード例 #4
0
ファイル: views.py プロジェクト: TobyWanKenobi/wouso
def qotd_schedule(request):
    Schedule.automatic()
    return redirect('qpool_home', cat='qotd')
コード例 #5
0
ファイル: views.py プロジェクト: LucianU/wouso
def qotd_schedule(request):
    Schedule.automatic()
    return HttpResponseRedirect(reverse('wouso.interface.cpanel.views.qpool_home'))
コード例 #6
0
ファイル: tests.py プロジェクト: LucianU/wouso
def _make_question_for_today(user, text):
    category = Category(name='qotd')
    question = Question(text=text, proposed_by=user, category=category, active=1)
    question.save()
    sched = Schedule(question=question)
    sched.save()
コード例 #7
0
def qotd_schedule(request):
    Schedule.automatic()
    return HttpResponseRedirect(
        reverse('wouso.interface.cpanel.views.qpool_home'))