From 92a293f07e0f4fa6fcf4ee44b4bc3314c03d9723 Mon Sep 17 00:00:00 2001 From: Bridger Maxwell Date: Mon, 20 Aug 2012 13:50:28 -0400 Subject: [PATCH] Removed profile info from Profile page and renamed it to Progress. --- lms/djangoapps/courseware/views.py | 19 +- lms/templates/course_navigation.html | 2 +- lms/templates/profile.html | 293 --------------------------- lms/templates/progress.html | 89 ++++++++ lms/urls.py | 8 +- 5 files changed, 99 insertions(+), 312 deletions(-) delete mode 100644 lms/templates/profile.html create mode 100644 lms/templates/progress.html diff --git a/lms/djangoapps/courseware/views.py b/lms/djangoapps/courseware/views.py index f5a93475b9..cedd7f642a 100644 --- a/lms/djangoapps/courseware/views.py +++ b/lms/djangoapps/courseware/views.py @@ -258,11 +258,10 @@ def university_profile(request, org_id): @login_required @cache_control(no_cache=True, no_store=True, must_revalidate=True) -def profile(request, course_id, student_id=None): - """ User profile. Show username, location, etc, as well as grades . - We need to allow the user to change some of these settings. +def progress(request, course_id, student_id=None): + """ User progress. We show the grade bar and every problem score. - Course staff are allowed to see the profiles of students in their class. + Course staff are allowed to see the progress of students in their class. """ course = get_course_with_access(request.user, course_id, 'load') staff_access = has_access(request.user, course, 'staff') @@ -276,28 +275,20 @@ def profile(request, course_id, student_id=None): raise Http404 student = User.objects.get(id=int(student_id)) - user_info = UserProfile.objects.get(user=student) - student_module_cache = StudentModuleCache.cache_for_descriptor_descendents(request.user, course) course_module = get_module(request.user, request, course.location, student_module_cache, course_id=course_id) courseware_summary = grades.progress_summary(student, course_module, course.grader, student_module_cache) grade_summary = grades.grade(request.user, request, course, student_module_cache) - context = {'name': user_info.name, - 'username': student.username, - 'location': user_info.location, - 'language': user_info.language, - 'email': student.email, - 'course': course, - 'csrf': csrf(request)['csrf_token'], + context = {'course': course, 'courseware_summary': courseware_summary, 'grade_summary': grade_summary, 'staff_access': staff_access, } context.update() - return render_to_response('profile.html', context) + return render_to_response('progress.html', context) diff --git a/lms/templates/course_navigation.html b/lms/templates/course_navigation.html index 55b0d50699..3b329c4832 100644 --- a/lms/templates/course_navigation.html +++ b/lms/templates/course_navigation.html @@ -33,7 +33,7 @@ def url_class(url):
  • Wiki
  • % endif % if user.is_authenticated(): -
  • Profile
  • +
  • Progress
  • % endif % if staff_access:
  • Instructor
  • diff --git a/lms/templates/profile.html b/lms/templates/profile.html deleted file mode 100644 index ca27920a1b..0000000000 --- a/lms/templates/profile.html +++ /dev/null @@ -1,293 +0,0 @@ -<%inherit file="main.html" /> -<%namespace name='static' file='static_content.html'/> - -<%block name="headextra"> - <%static:css group='course'/> - - -<%namespace name="profile_graphs" file="profile_graphs.js"/> - -<%block name="title">Profile - edX 6.002x - -<%! - from django.core.urlresolvers import reverse -%> - -<%block name="js_extra"> - - - - - - - - -<%include file="course_navigation.html" args="active_page='profile'" /> - -
    -
    - -
    -
    -

    Course Progress

    -
    - -
    - -
      - %for chapter in courseware_summary: - %if not chapter['display_name'] == "hidden": -
    1. -

      ${ chapter['display_name'] }

      - -
        - %for section in chapter['sections']: -
      1. - <% - earned = section['section_total'].earned - total = section['section_total'].possible - percentageString = "{0:.0%}".format( float(earned)/total) if earned > 0 and total > 0 else "" - %> - -

        - ${ section['display_name'] } ${"({0:.3n}/{1:.3n}) {2}".format( float(earned), float(total), percentageString )}

        -

        - ${section['format']} - - %if 'due' in section and section['due']!="": - - due ${section['due']} - - %endif -

        - - %if len(section['scores']) > 0: -
        -

        ${ "Problem Scores: " if section['graded'] else "Practice Scores: "}

        -
          - %for score in section['scores']: -
        1. ${"{0:.3n}/{1:.3n}".format(float(score.earned),float(score.possible))}
        2. - %endfor -
        -
        - %endif - -
      2. - %endfor -
      -
    2. - %endif - %endfor -
    - -
    - - -
    -
    - - - - - - - - - - diff --git a/lms/templates/progress.html b/lms/templates/progress.html new file mode 100644 index 0000000000..6b01e5896d --- /dev/null +++ b/lms/templates/progress.html @@ -0,0 +1,89 @@ +<%inherit file="main.html" /> +<%namespace name='static' file='static_content.html'/> + +<%block name="headextra"> + <%static:css group='course'/> + + +<%namespace name="profile_graphs" file="profile_graphs.js"/> + +<%block name="title">Progress - edX 6.002x + +<%! + from django.core.urlresolvers import reverse +%> + +<%block name="js_extra"> + + + + + + +<%include file="course_navigation.html" args="active_page='progress'" /> + +
    +
    + +
    +
    +

    Course Progress

    +
    + +
    + +
      + %for chapter in courseware_summary: + %if not chapter['display_name'] == "hidden": +
    1. +

      ${ chapter['display_name'] }

      + +
        + %for section in chapter['sections']: +
      1. + <% + earned = section['section_total'].earned + total = section['section_total'].possible + percentageString = "{0:.0%}".format( float(earned)/total) if earned > 0 and total > 0 else "" + %> + +

        + ${ section['display_name'] } ${"({0:.3n}/{1:.3n}) {2}".format( float(earned), float(total), percentageString )}

        +

        + ${section['format']} + + %if 'due' in section and section['due']!="": + + due ${section['due']} + + %endif +

        + + %if len(section['scores']) > 0: +
        +

        ${ "Problem Scores: " if section['graded'] else "Practice Scores: "}

        +
          + %for score in section['scores']: +
        1. ${"{0:.3n}/{1:.3n}".format(float(score.earned),float(score.possible))}
        2. + %endfor +
        +
        + %endif + +
      2. + %endfor +
      +
    2. + %endif + %endfor +
    + +
    + + +
    +
    diff --git a/lms/urls.py b/lms/urls.py index 89ef4babc4..ce77dbaac0 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -138,11 +138,11 @@ if settings.COURSEWARE_ENABLED: 'courseware.views.index', name="courseware_chapter"), url(r'^courses/(?P[^/]+/[^/]+/[^/]+)/courseware/(?P[^/]*)/(?P
    [^/]*)/$', 'courseware.views.index', name="courseware_section"), - url(r'^courses/(?P[^/]+/[^/]+/[^/]+)/profile$', - 'courseware.views.profile', name="profile"), + url(r'^courses/(?P[^/]+/[^/]+/[^/]+)/progress$', + 'courseware.views.progress', name="progress"), # Takes optional student_id for instructor use--shows profile as that student sees it. - url(r'^courses/(?P[^/]+/[^/]+/[^/]+)/profile/(?P[^/]*)/$', - 'courseware.views.profile', name="student_profile"), + url(r'^courses/(?P[^/]+/[^/]+/[^/]+)/progress/(?P[^/]*)/$', + 'courseware.views.progress', name="student_progress"), # For the instructor url(r'^courses/(?P[^/]+/[^/]+/[^/]+)/instructor$',