Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cms/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ <h3 class="sr">${_("Page Actions")}</h3>
<article class="content-primary" role="main">

<div class="introduction">
<h2 class="title">${_("Welcome, {0}!".format(user.username))}</h2>
<h2 class="title">${_("Welcome, {0}!").format(user.username)}</h2>

%if len(courses) > 0:
<div class="copy">
Expand Down
195 changes: 121 additions & 74 deletions lms/djangoapps/instructor/views/legacy.py

Large diffs are not rendered by default.

82 changes: 43 additions & 39 deletions lms/static/coffee/src/staff_grading/staff_grading.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -47,36 +47,36 @@ The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for t
'''
rubric: '''
<table class="rubric"><tbody><tr><th>Purpose</th>

<td>
<input type="radio" class="score-selection" name="score-selection-0" id="score-0-0" value="0"><label for="score-0-0">No product</label>
</td>

<td>
<input type="radio" class="score-selection" name="score-selection-0" id="score-0-1" value="1"><label for="score-0-1">Unclear purpose or main idea</label>
</td>

<td>
<input type="radio" class="score-selection" name="score-selection-0" id="score-0-2" value="2"><label for="score-0-2">Communicates an identifiable purpose and/or main idea for an audience</label>
</td>

<td>
<input type="radio" class="score-selection" name="score-selection-0" id="score-0-3" value="3"><label for="score-0-3">Achieves a clear and distinct purpose for a targeted audience and communicates main ideas with effectively used techniques to introduce and represent ideas and insights</label>
</td>
</tr><tr><th>Organization</th>

<td>
<input type="radio" class="score-selection" name="score-selection-1" id="score-1-0" value="0"><label for="score-1-0">No product</label>
</td>

<td>
<input type="radio" class="score-selection" name="score-selection-1" id="score-1-1" value="1"><label for="score-1-1">Organization is unclear; introduction, body, and/or conclusion are underdeveloped, missing or confusing.</label>
</td>

<td>
<input type="radio" class="score-selection" name="score-selection-1" id="score-1-2" value="2"><label for="score-1-2">Organization is occasionally unclear; introduction, body or conclusion may be underdeveloped.</label>
</td>

<td>
<input type="radio" class="score-selection" name="score-selection-1" id="score-1-3" value="3"><label for="score-1-3">Organization is clear and easy to follow; introduction, body and conclusion are defined and aligned with purpose.</label>
</td>
Expand All @@ -98,9 +98,9 @@ The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for t
max_score: 2 + @mock_cnt % 3
ml_error_info : 'ML accuracy info: ' + @mock_cnt
else
response =
response =
success: false


else if cmd == 'save_grade'
response =
Expand All @@ -109,7 +109,7 @@ The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for t
# should get back a list of problem_ids, problem_names, num_graded, min_for_ml
else if cmd == 'get_problem_list'
@mock_cnt = 1
response =
response =
success: true
problem_list: [
{location: 'i4x://MITx/3.091x/problem/open_ended_demo1', \
Expand All @@ -123,7 +123,7 @@ The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for t
error: 'Unknown command ' + cmd

if @mock_cnt % 5 == 0
response =
response =
success: true
message: 'No more submissions'

Expand All @@ -132,7 +132,7 @@ The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for t
response =
success: false
error: 'An error for testing'

return response


Expand Down Expand Up @@ -190,7 +190,7 @@ class @StaffGrading
@question_header = $('.question-header')
@question_header.click @collapse_question
@collapse_question()

# model state
@state = state_no_data
@submission_id = null
Expand Down Expand Up @@ -266,7 +266,7 @@ class @StaffGrading

@render_view()
@scroll_to_top()

get_next_submission: (location) ->
@location = location
@list_view = false
Expand Down Expand Up @@ -296,7 +296,7 @@ class @StaffGrading
submission_id: @submission_id
location: @location
submission_flagged: @flag_submission_checkbox.is(':checked')
@gentle_alert "Grades saved. Fetching the next submission to grade."
@gentle_alert gettext("Grades saved. Fetching the next submission to grade.")
@backend.post('save_grade', data, @ajax_callback)

gentle_alert: (msg) =>
Expand Down Expand Up @@ -344,13 +344,13 @@ class @StaffGrading
# clear the problem list and breadcrumbs
@problem_list.html('''
<tr>
<th>Problem Name</th>
<th>Graded</th>
<th>Available to Grade</th>
<th>Required</th>
<th>Progress</th>
<th>''' + gettext("Problem Name") + '''</th>
<th>''' + gettext("Graded") + '''</th>
<th>''' + gettext("Available to Grade") + '''</th>
<th>''' + gettext("Required") + '''</th>
<th>''' + gettext("Progress") + '''</th>
</tr>
''')
''')
@breadcrumbs.html('')
@problem_list_container.toggle(@list_view)
if @backend.mock_backend
Expand All @@ -364,14 +364,14 @@ class @StaffGrading

# only show the grading elements when we are not in list view or the state
# is invalid
show_grading_elements = !(@list_view || @state == state_error ||
show_grading_elements = !(@list_view || @state == state_error ||
@state == state_no_data)
@prompt_wrapper.toggle(show_grading_elements)
@submission_wrapper.toggle(show_grading_elements)
@grading_wrapper.toggle(show_grading_elements)
@meta_info_wrapper.toggle(show_grading_elements)
@action_button.hide()

if @list_view
@render_list()
else
Expand Down Expand Up @@ -410,23 +410,27 @@ class @StaffGrading
show_action_button = true

problem_list_link = $('<a>').attr('href', 'javascript:void(0);')
.append("< Back to problem list")
.append("< " + gettext("Back to problem list"))
.click => @get_problem_list()

# set up the breadcrumbing
@breadcrumbs.append(problem_list_link)


if @state == state_error
@set_button_text('Try loading again')
@set_button_text(gettext('Try loading again'))
show_action_button = true

else if @state == state_grading
@ml_error_info_container.html(@ml_error_info)
available = _.template(gettext("<%= num %> available"), {num: @num_pending})
graded = _.template(gettext("<%= num %> graded"), {num: @num_graded})
needed = _.template(gettext("<%= num %> more needed to start ML"),
{num: Math.max(@min_for_ml - @num_graded, 0)})
meta_list = $("<div>")
meta_list.append("<div class='meta-info'>#{@num_pending} available | </div>")
meta_list.append("<div class='meta-info'>#{@num_graded} graded | </div>")
meta_list.append("<div class='meta-info'>#{Math.max(@min_for_ml - @num_graded, 0)} more needed to start ML </div><br/>")
.append("<div class='meta-info'>#{available}</div>")
.append("<div class='meta-info'>#{graded}</div>")
.append("<div class='meta-info'>#{needed}</div>")
@problem_meta_info.html(meta_list)

@prompt_container.html(@prompt)
Expand All @@ -437,42 +441,42 @@ class @StaffGrading
show_action_button = false

@setup_score_selection()

else if @state == state_graded
@set_button_text('Submit')
@set_button_text(gettext('Submit'))
show_action_button = false

else if @state == state_no_data
@message_container.html(@message)
@set_button_text('Re-check for submissions')
@set_button_text(gettext('Re-check for submissions'))

else
@error('System got into invalid state ' + @state)
@error(_.template(gettext('System got into invalid state: <%= state %>'), {state: @state}))

@submit_button.toggle(show_submit_button)
@action_button.toggle(show_action_button)

submit: (event) =>
event.preventDefault()

if @state == state_error
@get_next_submission(@location)
else if @state == state_graded
@submit_and_get_next()
else if @state == state_no_data
@get_next_submission(@location)
else
@error('System got into invalid state for submission: ' + @state)
@error(gettext('System got into invalid state for submission: ') + @state)

collapse_question: () =>
@prompt_container.slideToggle()
@prompt_container.toggleClass('open')
if @question_header.text() == "(Hide)"
if @question_header.text() == gettext("(Hide)")
Logger.log 'staff_grading_hide_question', {location: @location}
new_text = "(Show)"
new_text = gettext("(Show)")
else
Logger.log 'staff_grading_show_question', {location: @location}
new_text = "(Hide)"
new_text = gettext("(Hide)")
@question_header.text(new_text)

scroll_to_top: () =>
Expand Down
2 changes: 1 addition & 1 deletion lms/templates/combinedopenended/combined_open_ended.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ <h2>${display_name}</h2>
</div>
% if is_staff:
<div class="staff-info">
Staff Warning: Please note that if you submit a duplicate of text that has already been submitted for grading, it will not show up in the staff grading view. It will be given the same grade that the original received automatically, and will be returned within 30 minutes if the original is already graded, or when the original is graded if not.
${_("Staff Warning: Please note that if you submit a duplicate of text that has already been submitted for grading, it will not show up in the staff grading view. It will be given the same grade that the original received automatically, and will be returned within 30 minutes if the original is already graded, or when the original is graded if not.")}
</div>
% endif
</section>
Expand Down
12 changes: 10 additions & 2 deletions lms/templates/combinedopenended/openended/open_ended_rubric.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<%! from django.utils.translation import ugettext as _ %>
<%! from django.utils.translation import ungettext%>
<% from random import randint %>
<form class="rubric-template" id="inputtype_${id}" xmlns="http://www.w3.org/1999/html">
<div class="visibility-control visibility-control-rubric">
<div class="inner">
</div>
<span class="section-header section-header-rubric">${_("Rubric")}</span>
</div>
<p>Select the criteria you feel best represents this submission in each category.</p>
<p>${_("Select the criteria you feel best represents this submission in each category.")}</p>
<div class="rubric">
% for i in range(len(categories)):
<% category = categories[i] %>
Expand All @@ -22,7 +23,14 @@
% endif
<label class="rubric-label" for="score-${i}-${j}-${m}">
<span class="wrapper-score-selection"><input type="radio" class="score-selection" data-category="${i}" name="score-selection-${i}" id="score-${i}-${j}-${m}" value="${option['points']}"/></span>
<span class="wrappable"> ${option['points']} points : ${option['text']}</span>
<span class="wrappable">${ungettext(
"{num} point: {text}",
"{num} points: {text}",
option['points']
).format(
num=option['points'],
text=option['text']
)}</span>
</label>
</li>
% endfor
Expand Down
1 change: 1 addition & 0 deletions lms/templates/courseware/course_navigation.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## mako
<%! from django.utils.translation import ugettext as _ %>
<%page args="active_page=None" />

<%
Expand Down
2 changes: 1 addition & 1 deletion lms/templates/courseware/gradebook.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ <h1>${_("Gradebook")}</h1>
<tr>
<th>
<form class="student-search">
<input type="search" class="student-search-field" placeholder="Search students" />
<input type="search" class="student-search-field" placeholder="${_('Search students')}" />
</form>
</th>
</tr>
Expand Down
6 changes: 3 additions & 3 deletions lms/templates/courseware/progress.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ <h3><a href="${reverse('courseware_section', kwargs=dict(course_id=course.id, ch
${ section['display_name'] }
%if total > 0 or earned > 0:
<span class="sr">
${"{0:.3n} of {1:.3n} possible points".format( float(earned), float(total) )}
${_("{earned:.3n} of {total:.3n} possible points").format( earned = float(earned), total = float(total) )}
</span></a>
%endif
%if total > 0 or earned > 0:
Expand All @@ -72,7 +72,7 @@ <h3><a href="${reverse('courseware_section', kwargs=dict(course_id=course.id, ch
%if section.get('due') is not None:
<%
formatted_string = get_time_display(section['due'], course.due_date_display_format)
due_date = '' if len(formatted_string)==0 else _('due {date}'.format(date=formatted_string))
due_date = '' if len(formatted_string)==0 else _(u'due {date}').format(date=formatted_string)
%>
<em>
${due_date}
Expand All @@ -82,7 +82,7 @@ <h3><a href="${reverse('courseware_section', kwargs=dict(course_id=course.id, ch

<section class="scores">
%if len(section['scores']) > 0:
<h3> ${ "Problem Scores: " if section['graded'] else "Practice Scores: "} </h3>
<h3> ${ _("Problem Scores: ") if section['graded'] else _("Practice Scores: ")} </h3>
<ol>
%for score in section['scores']:
<li>${"{0:.3n}/{1:.3n}".format(float(score.earned),float(score.possible))}</li>
Expand Down