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
c2f64465
Commit
c2f64465
authored
Jan 31, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix HTML return
parent
d8b94f91
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
12 deletions
+30
-12
common/lib/xmodule/xmodule/js/src/peergrading/peer_grading.coffee
+15
-1
common/lib/xmodule/xmodule/peer_grading_module.py
+12
-8
lms/templates/peer_grading/peer_grading.html
+2
-2
lms/templates/peer_grading/peer_grading_problem.html
+1
-1
No files found.
common/lib/xmodule/xmodule/js/src/peergrading/peer_grading.coffee
View file @
c2f64465
...
...
@@ -4,12 +4,18 @@
# becomes more sophisticated
class
PeerGrading
constructor
:
()
->
@
peer_grading_container
=
$
(
'.peer-grading'
)
@
peer_grading_outer_container
=
$
(
'.peer-grading-container'
)
@
ajax_url
=
peer_grading_container
.
data
(
'ajax-url'
)
@
error_container
=
$
(
'.error-container'
)
@
error_container
.
toggle
(
not
@
error_container
.
is
(
':empty'
))
@
message_container
=
$
(
'.message-container'
)
@
message_container
.
toggle
(
not
@
message_container
.
is
(
':empty'
))
@
problem_button
=
$
(
'.problem-button'
)
@
problem_button
.
click
show_results
@
problem_list
=
$
(
'.problem-list'
)
@
construct_progress_bar
()
...
...
@@ -22,6 +28,14 @@ class PeerGrading
bar_max
=
parseInt
(
problem
.
data
(
'required'
))
+
bar_value
progress_bar
.
progressbar
({
value
:
bar_value
,
max
:
bar_max
})
)
show_results
:
(
event
)
=>
location_to_fetch
=
$
(
event
.
target
).
data
(
'location'
)
data
=
{
'location'
:
location_to_fetch
}
$
.
postWithPrefix
"
#{
@
ajax_url
}
problem"
,
data
,
(
response
)
=>
if
response
.
success
@
peer_grading_outer_container
.
after
(
response
.
html
).
remove
()
else
@
gentle_alert
response
.
error
$
(
document
).
ready
(()
->
new
PeerGrading
())
common/lib/xmodule/xmodule/peer_grading_module.py
View file @
c2f64465
...
...
@@ -74,6 +74,10 @@ class PeerGradingModule(XModule):
if
isinstance
(
self
.
use_for_single_location
,
basestring
):
self
.
use_for_single_location
=
(
self
.
use_for_single_location
in
TRUE_DICT
)
self
.
ajax_url
=
self
.
system
.
ajax_url
if
not
self
.
ajax_url
.
endswith
(
"/"
):
self
.
ajax_url
=
self
.
ajax_url
+
"/"
def
_err_response
(
self
,
msg
):
"""
Return a HttpResponse with a json dump with success=False, and the given error message.
...
...
@@ -108,11 +112,10 @@ class PeerGradingModule(XModule):
handlers
=
{
'get_next_submission'
:
self
.
get_next_submission
,
'show_calibration_essay'
:
self
.
show_calibration_essay
,
'save_post_assessment'
:
self
.
message_post
,
'is_student_calibrated'
:
self
.
is_student_calibrated
,
'save_grade'
:
self
.
save_grade
,
'save_calibration_essay'
:
self
.
save_calibration_essay
,
'
show_
problem'
:
self
.
peer_grading_problem
,
'problem'
:
self
.
peer_grading_problem
,
}
if
dispatch
not
in
handlers
:
...
...
@@ -357,9 +360,8 @@ class PeerGradingModule(XModule):
error_text
=
"Could not get problem list"
success
=
False
ajax_url
=
self
.
system
.
ajax_url
return
self
.
system
.
render_template
(
'peer_grading/peer_grading.html'
,
{
ajax_url
=
self
.
ajax_url
html
=
self
.
system
.
render_template
(
'peer_grading/peer_grading.html'
,
{
'course_id'
:
self
.
system
.
course_id
,
'ajax_url'
:
ajax_url
,
'success'
:
success
,
...
...
@@ -368,6 +370,7 @@ class PeerGradingModule(XModule):
# Checked above
'staff_access'
:
False
,
})
return
html
def
peer_grading_problem
(
self
,
get
=
None
):
'''
...
...
@@ -380,9 +383,8 @@ class PeerGradingModule(XModule):
else
:
problem_location
=
self
.
system
.
location
ajax_url
=
self
.
system
.
ajax_url
return
self
.
system
.
render_template
(
'peer_grading/peer_grading_problem.html'
,
{
ajax_url
=
self
.
ajax_url
html
=
self
.
system
.
render_template
(
'peer_grading/peer_grading_problem.html'
,
{
'view_html'
:
''
,
'problem_location'
:
problem_location
,
'course_id'
:
self
.
system
.
course_id
,
...
...
@@ -390,6 +392,8 @@ class PeerGradingModule(XModule):
# Checked above
'staff_access'
:
False
,
})
return
{
'html'
:
html
,
'success'
:
True
}
class
PeerGradingDescriptor
(
XmlDescriptor
,
EditingDescriptor
):
"""
Module for adding combined open ended questions
...
...
lms/templates/peer_grading/peer_grading.html
View file @
c2f64465
<section
class=
"container"
>
<section
class=
"container
peer-grading-container
"
>
<div
class=
"peer-grading"
data-ajax_url=
"${ajax_url}"
>
<div
class=
"error-container"
>
${error_text}
</div>
<h1>
Peer Grading
</h1>
...
...
@@ -22,7 +22,7 @@
%for problem in problem_list:
<tr
data-graded=
"${problem['num_graded']}"
data-required=
"${problem['num_required']}"
>
<td
class=
"problem-name"
>
<a
href=
"
${ajax_url}problem?location=${problem['location']}
"
>
${problem['problem_name']}
</a>
<a
href=
"
#problem"
data-location=
"${problem['location']}"
class=
"problem-button
"
>
${problem['problem_name']}
</a>
</td>
<td>
${problem['num_graded']}
...
...
lms/templates/peer_grading/peer_grading_problem.html
View file @
c2f64465
<section
class=
"container"
>
<section
class=
"container
peer-grading-container
"
>
<div
class=
"peer-grading"
data-ajax_url=
"${ajax_url}"
data-location=
"${problem_location}"
>
<div
class=
"error-container"
></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