本文整理汇总了Python中oasis.lib.Exams.get_mark_time方法的典型用法代码示例。如果您正苦于以下问题:Python Exams.get_mark_time方法的具体用法?Python Exams.get_mark_time怎么用?Python Exams.get_mark_time使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oasis.lib.Exams
的用法示例。
在下文中一共展示了Exams.get_mark_time方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: cadmin_exam_viewmarked
# 需要导入模块: from oasis.lib import Exams [as 别名]
# 或者: from oasis.lib.Exams import get_mark_time [as 别名]
def cadmin_exam_viewmarked(course_id, exam_id, student_uid):
""" Show a student's marked assessment results """
course = Courses2.get_course(course_id)
try:
exam = Exams.get_exam_struct(exam_id, course_id)
except KeyError:
exam = {}
abort(404)
results, examtotal = Assess.render_own_marked_exam(student_uid, exam_id)
if examtotal is False:
status = 0
else:
status = 1
marktime = Exams.get_mark_time(exam_id, student_uid)
firstview = Exams.get_student_start_time(exam_id, student_uid)
submittime = Exams.get_submit_time(exam_id, student_uid)
try:
datemarked = General.human_date(marktime)
except AttributeError:
datemarked = None
try:
datefirstview = General.human_date(firstview)
except AttributeError:
datefirstview = None
try:
datesubmit = General.human_date(submittime)
except AttributeError:
datesubmit = None
user = Users2.get_user(student_uid)
if submittime and firstview:
taken = submittime-firstview
takenmins = (taken.seconds/60)
else:
takenmins = None
return render_template(
"cadmin_markedresult.html",
course=course,
exam=exam,
results=results,
examtotal=examtotal,
datesubmit=datesubmit,
datemarked=datemarked,
datefirstview=datefirstview,
taken=takenmins,
user=user,
status=status
)