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
bccafe6c
Commit
bccafe6c
authored
Jan 08, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add in correctness display
parent
af705ca1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
14 deletions
+26
-14
common/lib/xmodule/xmodule/combined_open_ended_module.py
+12
-4
common/lib/xmodule/xmodule/open_ended_module.py
+0
-7
common/lib/xmodule/xmodule/openendedchild.py
+11
-0
lms/templates/combined_open_ended.html
+0
-1
lms/templates/combined_open_ended_results.html
+2
-1
lms/templates/combined_open_ended_status.html
+1
-1
No files found.
common/lib/xmodule/xmodule/combined_open_ended_module.py
View file @
bccafe6c
...
...
@@ -218,11 +218,19 @@ class CombinedOpenEndedModule(XModule):
last_post_assessment
=
task
.
latest_post_assessment
(
short_feedback
=
False
)
last_post_evaluation
=
task
.
format_feedback_with_evaluation
(
last_post_assessment
)
last_post_assessment
=
last_post_evaluation
last_correctness
=
task
.
is_last_response_correct
()
max_score
=
task
.
max_score
()
state
=
task
.
state
last_response_dict
=
{
'response'
:
last_response
,
'score'
:
last_score
,
'post_assessment'
:
last_post_assessment
,
'type'
:
task_type
,
'max_score'
:
max_score
,
'state'
:
state
,
'human_state'
:
task
.
HUMAN_NAMES
[
state
]}
last_response_dict
=
{
'response'
:
last_response
,
'score'
:
last_score
,
'post_assessment'
:
last_post_assessment
,
'type'
:
task_type
,
'max_score'
:
max_score
,
'state'
:
state
,
'human_state'
:
task
.
HUMAN_NAMES
[
state
],
'correct'
:
last_correctness
}
return
last_response_dict
...
...
@@ -252,7 +260,7 @@ class CombinedOpenEndedModule(XModule):
task_number
=
int
(
get
[
'task_number'
])
self
.
update_task_states
()
response_dict
=
self
.
get_last_response
(
task_number
)
context
=
{
'results'
:
response_dict
[
'post_assessment'
]}
context
=
{
'results'
:
response_dict
[
'post_assessment'
]
,
'task_number'
:
task_number
+
1
}
html
=
render_to_string
(
'combined_open_ended_results.html'
,
context
)
return
{
'html'
:
html
,
'success'
:
True
}
...
...
common/lib/xmodule/xmodule/open_ended_module.py
View file @
bccafe6c
...
...
@@ -397,13 +397,6 @@ class OpenEndedModule(openendedchild.OpenEndedChild):
short_feedback
=
self
.
_convert_longform_feedback_to_html
(
json
.
loads
(
self
.
history
[
-
1
]
.
get
(
'post_assessment'
,
""
)))
return
short_feedback
if
feedback_dict
[
'valid'
]
else
''
def
is_submission_correct
(
self
,
score
):
correct
=
False
if
(
isinstance
(
score
,(
int
,
long
,
float
,
complex
))):
score_ratio
=
int
(
score
)
/
float
(
self
.
max_score
())
correct
=
(
score_ratio
>=
0.66
)
return
correct
def
format_feedback_with_evaluation
(
self
,
feedback
):
context
=
{
'msg'
:
feedback
,
'id'
:
"1"
,
'rows'
:
50
,
'cols'
:
50
}
html
=
render_to_string
(
'open_ended_evaluation.html'
,
context
)
...
...
common/lib/xmodule/xmodule/openendedchild.py
View file @
bccafe6c
...
...
@@ -250,5 +250,16 @@ class OpenEndedChild():
def
handle_ajax
(
self
):
pass
def
is_submission_correct
(
self
,
score
):
correct
=
False
if
(
isinstance
(
score
,(
int
,
long
,
float
,
complex
))):
score_ratio
=
int
(
score
)
/
float
(
self
.
max_score
())
correct
=
(
score_ratio
>=
0.66
)
return
correct
def
is_last_response_correct
(
self
):
score
=
self
.
get_score
()
return
self
.
is_submission_correct
(
score
)
lms/templates/combined_open_ended.html
View file @
bccafe6c
...
...
@@ -17,7 +17,6 @@
</div>
<div
class=
"result-container"
>
<h4>
Results
</h4><br/>
</div>
</section>
lms/templates/combined_open_ended_results.html
View file @
bccafe6c
<div
class=
"result-container"
>
<h4>
Results
</h4><br/>
<h4>
Results
from Step ${task_number}
</h4><br/>
${results | n}
</div>
\ No newline at end of file
lms/templates/combined_open_ended_status.html
View file @
bccafe6c
...
...
@@ -8,7 +8,7 @@
%endif
Step ${status['task_number']} (${status['human_state']}) : ${status['score']} / ${status['max_score']}
%if status['type']=="openended":
%if status['type']=="openended"
and status['state'] in ['done', 'post_assessment']
:
<div
class=
"show-results"
>
<a
href=
"#"
class=
"show-results-button"
>
Show results from step ${status['task_number']}
</a>
</div>
...
...
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