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
111ef30f
Commit
111ef30f
authored
Feb 20, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Render to string fix, display ETA message when student submits
parent
2f29d85e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
1 deletions
+12
-1
common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py
+5
-0
lms/djangoapps/open_ended_grading/views.py
+1
-0
lms/templates/open_ended.html
+6
-1
No files found.
common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py
View file @
111ef30f
...
@@ -663,17 +663,21 @@ class OpenEndedModule(openendedchild.OpenEndedChild):
...
@@ -663,17 +663,21 @@ class OpenEndedModule(openendedchild.OpenEndedChild):
Output: Rendered HTML
Output: Rendered HTML
"""
"""
#set context variables and render template
#set context variables and render template
eta_string
=
None
if
self
.
state
!=
self
.
INITIAL
:
if
self
.
state
!=
self
.
INITIAL
:
latest
=
self
.
latest_answer
()
latest
=
self
.
latest_answer
()
previous_answer
=
latest
if
latest
is
not
None
else
self
.
initial_display
previous_answer
=
latest
if
latest
is
not
None
else
self
.
initial_display
post_assessment
=
self
.
latest_post_assessment
(
system
)
post_assessment
=
self
.
latest_post_assessment
(
system
)
score
=
self
.
latest_score
()
score
=
self
.
latest_score
()
correct
=
'correct'
if
self
.
is_submission_correct
(
score
)
else
'incorrect'
correct
=
'correct'
if
self
.
is_submission_correct
(
score
)
else
'incorrect'
if
self
.
state
==
self
.
ASSESSING
:
eta_string
=
self
.
get_eta
()
else
:
else
:
post_assessment
=
""
post_assessment
=
""
correct
=
""
correct
=
""
previous_answer
=
self
.
initial_display
previous_answer
=
self
.
initial_display
context
=
{
context
=
{
'prompt'
:
self
.
prompt
,
'prompt'
:
self
.
prompt
,
'previous_answer'
:
previous_answer
,
'previous_answer'
:
previous_answer
,
...
@@ -686,6 +690,7 @@ class OpenEndedModule(openendedchild.OpenEndedChild):
...
@@ -686,6 +690,7 @@ class OpenEndedModule(openendedchild.OpenEndedChild):
'child_type'
:
'openended'
,
'child_type'
:
'openended'
,
'correct'
:
correct
,
'correct'
:
correct
,
'accept_file_upload'
:
self
.
accept_file_upload
,
'accept_file_upload'
:
self
.
accept_file_upload
,
'eta_message'
:
eta_string
,
}
}
html
=
system
.
render_template
(
'open_ended.html'
,
context
)
html
=
system
.
render_template
(
'open_ended.html'
,
context
)
return
html
return
html
...
...
lms/djangoapps/open_ended_grading/views.py
View file @
111ef30f
...
@@ -23,6 +23,7 @@ from xmodule.modulestore.django import modulestore
...
@@ -23,6 +23,7 @@ from xmodule.modulestore.django import modulestore
from
xmodule.modulestore
import
search
from
xmodule.modulestore
import
search
from
django.http
import
HttpResponse
,
Http404
,
HttpResponseRedirect
from
django.http
import
HttpResponse
,
Http404
,
HttpResponseRedirect
from
mitxmako.shortcuts
import
render_to_string
log
=
logging
.
getLogger
(
__name__
)
log
=
logging
.
getLogger
(
__name__
)
...
...
lms/templates/open_ended.html
View file @
111ef30f
...
@@ -15,7 +15,12 @@
...
@@ -15,7 +15,12 @@
% elif state in ['done', 'post_assessment'] and correct == 'incorrect':
% elif state in ['done', 'post_assessment'] and correct == 'incorrect':
<span
class=
"incorrect"
id=
"status_${id}"
></span>
<p>
Incorrect.
</p>
<span
class=
"incorrect"
id=
"status_${id}"
></span>
<p>
Incorrect.
</p>
% elif state == 'assessing':
% elif state == 'assessing':
<span
class=
"grading"
id=
"status_${id}"
>
Submitted for grading.
</span>
<span
class=
"grading"
id=
"status_${id}"
>
Submitted for grading.
% if eta_message is not None:
${eta_message}
% endif
</span>
% endif
% endif
% if hidden:
% if hidden:
...
...
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