コード例 #1
0
ファイル: views_cadmin.py プロジェクト: tkanesh/oasisqe
def cadmin_top(course_id):
    """ Present top level course admin page """
    course = Courses2.get_course(course_id)
    if not course:
        abort(404)

    user_id = session['user_id']
    is_sysadmin = check_perm(user_id, -1, 'sysadmin')

    topics = Courses2.get_topics_list(course_id)
    exams = [Exams.get_exam_struct(exam_id, course_id)
             for exam_id in Courses.get_exams(course_id, prev_years=False)]

    exams.sort(key=lambda y: y['start_epoch'], reverse=True)
    groups = Courses.get_groups(course_id)
    choosegroups = [group
                    for group in Groups.all_groups()
                    if group.id not in groups]
    return render_template(
        "courseadmin_top.html",
        course=course,
        topics=topics,
        exams=exams,
        choosegroups=choosegroups,
        groups=groups,
        is_sysadmin=is_sysadmin
    )
コード例 #2
0
ファイル: views_cadmin.py プロジェクト: ehchua/oasisqe
def cadmin_top(course_id):
    """ Present top level course admin page """
    course = Courses2.get_course(course_id)
    if not course:
        abort(404)

    user_id = session['user_id']
    is_sysadmin = check_perm(user_id, -1, 'sysadmin')

    topics = Courses2.get_topics_list(course_id)
    exams = [
        Exams.get_exam_struct(exam_id, course_id)
        for exam_id in Courses.get_exams(course_id, prev_years=False)
    ]

    exams.sort(key=lambda y: y['start_epoch'], reverse=True)
    groups = Courses.get_groups(course_id)
    choosegroups = [
        group for group in Groups.all_groups() if group.id not in groups
    ]
    return render_template("courseadmin_top.html",
                           course=course,
                           topics=topics,
                           exams=exams,
                           choosegroups=choosegroups,
                           groups=groups,
                           is_sysadmin=is_sysadmin)
コード例 #3
0
ファイル: views_cadmin.py プロジェクト: jamesdoherty/oasisqe
def cadmin_config(course_id):
    """ Allow some course configuration """
    course = Courses2.get_course(course_id)
    if not course:
        abort(404)

    user_id = session["user_id"]
    is_sysadmin = check_perm(user_id, -1, "sysadmin")
    coords = [
        Users2.get_user(perm[0]) for perm in Permissions.get_course_perms(course_id) if perm[1] == 3
    ]  # course_coord
    groups = Courses.get_groups(course_id)
    choosegroups = [group for group in Groups.all_groups() if not group.id in groups]
    return render_template(
        "courseadmin_config.html",
        course=course,
        coords=coords,
        choosegroups=choosegroups,
        groups=groups,
        is_sysadmin=is_sysadmin,
    )
コード例 #4
0
ファイル: views_cadmin.py プロジェクト: ehchua/oasisqe
def cadmin_config(course_id):
    """ Allow some course configuration """
    course = Courses2.get_course(course_id)
    if not course:
        abort(404)

    user_id = session['user_id']
    is_sysadmin = check_perm(user_id, -1, 'sysadmin')
    coords = [
        Users2.get_user(perm[0])
        for perm in Permissions.get_course_perms(course_id) if perm[1] == 3
    ]  # course_coord
    groups = Courses.get_groups(course_id)
    choosegroups = [
        group for group in Groups.all_groups() if group.id not in groups
    ]
    return render_template("courseadmin_config.html",
                           course=course,
                           coords=coords,
                           choosegroups=choosegroups,
                           groups=groups,
                           is_sysadmin=is_sysadmin)