コード例 #1
0
def question_export():
    exp = Question.export_course(g.lti.get_course_id())
    exp = yaml.dump(exp, default_flow_style=False)
    return Response(exp,
            mimetype="text/plain",
            headers={"Content-Disposition":
                "attachment;filename=questions_%s.yaml" %
                    g.lti.get_course_name()})
コード例 #2
0
def export_data():
    # TODO: settings (answers, etc?)
    answers = request.form.get('answers', False) == 'on'
    exp = Question.export_course(g.lti.get_course_id(), answers)
    exp = yaml.dump(exp, default_flow_style=False)
    return Response(exp,
                    mimetype="text/plain",
                    headers={"Content-Disposition":
                             "attachment;filename=questions_%s.yaml" %
                    g.lti.get_course_name()})