示例#1
0
def home():
    """
    Home page view.
    :return: HTTP Response
    """
    tags = Tag.get_all()
    return render_template('home.html', tags=tags)
示例#2
0
def index():
    id = session.get("user_id", "")
    return render_template("index.html",
                           id=id,
                           loggedin=check.logged_in(),
                           tags=Tag.get_all(),
                           pagination=Post.paginate(
                               int(request.args.get('page') or 1)))
示例#3
0
    def json_get_tags():
        # create json file of all tags
        tags = Tag.get_all()
        # list of dicytionaries
        data = []
        for tag in tags:
            data.append({"id": tag.id, "name": tag.name})

        # Qreturn "Test return"
        return json.dumps(data)
示例#4
0
    def review():
        answer = Schedule.get_answer(g.lti.get_user_id())
        if answer == None:
            return "No answers to review."

        fsession['reviewanswer'] = answer.id

        enabledtags = AnswerTag.get_tag_ids(answer.id)
        reviews = Review.get_list(answer.id)

        return render_template('reviewanswer.html', answer=answer,
                               tags=Tag.get_all(), enabledtags=enabledtags,
                               reviews=reviews)
示例#5
0
    def review():
        answer = Schedule.get_answer(g.lti.get_user_id())
        if answer == None:
            return "No answers to review."

        fsession['reviewanswer'] = answer.id

        enabledtags = AnswerTag.get_tag_ids(answer.id)
        reviews = Review.get_list(answer.id)
        question = Question.by_id(answer.questionID)
        if question is None:
            return "Question was not found."

        return render_template('reviewanswer.html', answer=answer,
                               tags=Tag.get_all(), enabledtags=enabledtags,
                               reviews=reviews, question=question)
示例#6
0
 def render(self):
     enabledtags = AnswerTag.get_tag_ids(self.answer_id)
     return render_template('assigntag.html', answer=self.answer,
                            tags=Tag.get_all(), enabledtags=enabledtags)
示例#7
0
 def render(self):
     self.taglist = Tag.get_all()
     return render_template('modifytags.html',tags=self.taglist)