Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
59e36476
Commit
59e36476
authored
Feb 20, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add in support for getting and displaying ETA
parent
dbe93502
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
1 deletions
+31
-1
lms/djangoapps/open_ended_grading/open_ended_grading_util.py
+13
-0
lms/djangoapps/open_ended_grading/views.py
+13
-0
lms/templates/open_ended_problems/open_ended_problems.html
+5
-1
No files found.
lms/djangoapps/open_ended_grading/open_ended_grading_util.py
0 → 100644
View file @
59e36476
def
convert_seconds_to_human_readable
(
seconds
):
if
seconds
<
60
:
human_string
=
"{0} seconds"
.
format
(
seconds
)
elif
seconds
<
60
*
60
:
human_string
=
"{0} minutes"
.
format
(
round
(
seconds
/
60
,
1
))
elif
seconds
<
(
24
*
60
*
60
):
human_string
=
"{0} hours"
.
format
(
round
(
seconds
/
(
60
*
60
),
1
))
else
:
human_string
=
"{0} days"
.
format
(
round
(
seconds
/
(
60
*
60
*
24
),
1
))
eta_string
=
"In {0}."
.
format
(
human_string
)
return
eta_string
\ No newline at end of file
lms/djangoapps/open_ended_grading/views.py
View file @
59e36476
...
...
@@ -22,6 +22,7 @@ from xmodule.modulestore.django import modulestore
from
xmodule.modulestore
import
search
from
django.http
import
HttpResponse
,
Http404
,
HttpResponseRedirect
import
open_ended_grading_util
log
=
logging
.
getLogger
(
__name__
)
...
...
@@ -150,6 +151,18 @@ def student_problem_list(request, course_id):
problem_url_parts
=
search
.
path_to_location
(
modulestore
(),
course
.
id
,
problem_list
[
i
][
'location'
])
problem_url
=
generate_problem_url
(
problem_url_parts
,
base_course_url
)
problem_list
[
i
]
.
update
({
'actual_url'
:
problem_url
})
eta_available
=
problem_list
[
i
][
'eta_available'
]
if
isinstance
(
eta_available
,
basestring
):
eta_available
=
(
eta_available
.
lower
()
==
"true"
)
eta_string
=
"N/A"
if
eta_available
:
try
:
eta_string
=
open_ended_grading_util
.
convert_seconds_to_human_readable
(
int
(
problem_list
[
i
][
'eta'
]))
except
:
#This is a student_facing_error
eta_string
=
"Error getting ETA."
problem_list
[
i
]
.
update
({
'eta_string'
:
eta_string
})
except
GradingServiceError
:
#This is a student_facing_error
...
...
lms/templates/open_ended_problems/open_ended_problems.html
View file @
59e36476
...
...
@@ -27,7 +27,8 @@
<tr>
<th>
Problem Name
</th>
<th>
Status
</th>
<th>
Type of Grading
</th>
<th>
Grader Type
</th>
<th>
ETA
</th>
</tr>
%for problem in problem_list:
<tr>
...
...
@@ -40,6 +41,9 @@
<td>
${problem['grader_type']}
</td>
<td>
${problem['eta_string']}
</td>
</tr>
%endfor
</table>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment