本文整理汇总了Python中oasis.lib.Exams.get_exams_done方法的典型用法代码示例。如果您正苦于以下问题:Python Exams.get_exams_done方法的具体用法?Python Exams.get_exams_done怎么用?Python Exams.get_exams_done使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oasis.lib.Exams
的用法示例。
在下文中一共展示了Exams.get_exams_done方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setup_usersummary
# 需要导入模块: from oasis.lib import Exams [as 别名]
# 或者: from oasis.lib.Exams import get_exams_done [as 别名]
def setup_usersummary(view_id):
""" Show an account summary for the given user account. """
user_id = session['user_id']
if not check_perm(user_id, -1, "useradmin"):
flash("You do not have User Administration access.")
return redirect(url_for('setup_top'))
is_sysadmin = check_perm(user_id, -1, 'sysadmin')
user = Users2.get_user(view_id)
examids = Exams.get_exams_done(view_id)
exams = []
for examid in examids:
exam = Exams.get_exam_struct(examid)
started = General.human_date(exam['start'])
exam['started'] = started
exam['viewable'] = satisfy_perms(user_id, exam['cid'], ("viewmarks", ))
exams.append(exam)
exams.sort(key=lambda x: x['start_epoch'], reverse=True)
course_ids = Users2.get_courses(view_id)
courses = []
for course_id in course_ids:
courses.append(Courses.get_course(course_id))
user_is_admin = check_perm(view_id, 0, 'sysadmin')
return render_template(
'setup_usersummary.html',
user=user,
exams=exams,
courses=courses,
is_sysadmin=is_sysadmin,
user_is_admin=user_is_admin
)