예제 #1
0
def journal_and_reflections(request,course_id, chapter_id=''):
    course = get_course_with_access(request.user, course_id, 'load')
    content=[]
    chapters = get_chaper_for_course(request,course,chapter_id)
    if chapter_id != '':
        content = get_module_combinedopenended(request,course,chapter_id,"False")
    return render_to_response('portfolio/journal_and_reflections.html', {'course':course, 'csrf': csrf(request)['csrf_token'],
        'content':content,'chapters':chapters,'chapter_id':chapter_id,'xqa_server': settings.MITX_FEATURES.get('USE_XQA_SERVER', 'http://*****:*****@content-qa.mitx.mit.edu/xqa')})
def journal_and_reflections(request,course_id, user_id, chapter_id=''):
    portfolio_user = get_portfolio_user(request,user_id)
    course = get_course_with_access(portfolio_user, course_id, 'load')
    content=[]
    chapters = get_chaper_for_course(request,course,chapter_id,portfolio_user)
    if chapter_id != '':
        content = get_module_combinedopenended(request,course,chapter_id,portfolio_user)
    paginator = Paginator(content, 5)
    try:
        page = int(request.GET.get('page', '1'))
    except ValueError:
        page = 1
    try:
        contacts = paginator.page(page)
    except (EmptyPage, InvalidPage):
        contacts = paginator.page(paginator.num_pages)
    return render_to_response('portfolio/journal_and_reflections.html', {'curr_user':portfolio_user,'course':course, 'csrf': csrf(request)['csrf_token'],
        'content':contacts,'portfolio_user_id':portfolio_user.id,'portfolio_user':portfolio_user,'chapters':chapters,'chapter_id':chapter_id,'xqa_server': settings.MITX_FEATURES.get('USE_XQA_SERVER', 'http://*****:*****@content-qa.mitx.mit.edu/xqa')})
예제 #3
0
def uploads(request,course_id):
    course = get_course_with_access(request.user, course_id, 'load')
    content = get_module_combinedopenended(request,course,course_id,"True")
    return render_to_response('portfolio/uploads.html', {'course':course, 'csrf': csrf(request)['csrf_token'],
        'content':content,'xqa_server': settings.MITX_FEATURES.get('USE_XQA_SERVER', 'http://*****:*****@content-qa.mitx.mit.edu/xqa')})