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
6fcf65ef
Commit
6fcf65ef
authored
May 13, 2014
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix staff debug view
parent
484c529d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
19 deletions
+22
-19
lms/djangoapps/instructor/views/api.py
+1
-1
lms/static/js/staff_debug_actions.js
+15
-12
lms/templates/staff_problem_info.html
+6
-6
No files found.
lms/djangoapps/instructor/views/api.py
View file @
6fcf65ef
...
...
@@ -832,7 +832,7 @@ def rescore_problem(request, course_id):
try
:
module_state_key
=
UsageKey
.
from_string
(
problem_to_reset
)
except
InvalidKeyError
:
return
HttpResponseBadRequest
()
return
HttpResponseBadRequest
(
"Unable to parse problem id"
)
response_payload
=
{}
response_payload
[
'problem_to_reset'
]
=
problem_to_reset
...
...
lms/static/js/staff_debug_actions.js
View file @
6fcf65ef
...
...
@@ -22,7 +22,7 @@ var StaffDebug = (function(){
do_idash_action
=
function
(
action
){
var
pdata
=
{
'problem_to_reset'
:
action
.
location
,
'unique_student_identifier'
:
get_user
(
action
.
location
),
'unique_student_identifier'
:
get_user
(
action
.
location
Name
),
'delete_module'
:
action
.
delete_module
}
$
.
ajax
({
...
...
@@ -40,7 +40,7 @@ var StaffDebug = (function(){
{
text
:
text
},
{
interpolate
:
/
\{(
.+
?)\}
/g
}
)
$
(
"#result_"
+
action
.
location
).
html
(
html
);
$
(
"#result_"
+
action
.
location
Name
).
html
(
html
);
},
error
:
function
(
request
,
status
,
error
)
{
var
response_json
;
...
...
@@ -62,15 +62,16 @@ var StaffDebug = (function(){
{
text
:
text
},
{
interpolate
:
/
\{(
.+
?)\}
/g
}
)
$
(
"#result_"
+
action
.
location
).
html
(
html
);
$
(
"#result_"
+
action
.
location
Name
).
html
(
html
);
},
dataType
:
'json'
});
}
reset
=
function
(
locname
){
reset
=
function
(
locname
,
location
){
this
.
do_idash_action
({
location
:
locname
,
locationName
:
locname
,
location
:
location
,
method
:
'reset_student_attempts'
,
success_msg
:
gettext
(
'Successfully reset the attempts for user {user}'
),
error_msg
:
gettext
(
'Failed to reset attempts.'
),
...
...
@@ -78,9 +79,10 @@ var StaffDebug = (function(){
});
}
sdelete
=
function
(
locname
){
sdelete
=
function
(
locname
,
location
){
this
.
do_idash_action
({
location
:
locname
,
locationName
:
locname
,
location
:
location
,
method
:
'reset_student_attempts'
,
success_msg
:
gettext
(
'Successfully deleted student state for user {user}'
),
error_msg
:
gettext
(
'Failed to delete student state.'
),
...
...
@@ -88,9 +90,10 @@ var StaffDebug = (function(){
});
}
rescore
=
function
(
locname
){
rescore
=
function
(
locname
,
location
){
this
.
do_idash_action
({
location
:
locname
,
locationName
:
locname
,
location
:
location
,
method
:
'rescore_problem'
,
success_msg
:
gettext
(
'Successfully rescored problem for user {user}'
),
error_msg
:
gettext
(
'Failed to rescore problem.'
),
...
...
@@ -112,15 +115,15 @@ var StaffDebug = (function(){
// Register click handlers
$
(
document
).
ready
(
function
()
{
$
(
'#staff-debug-reset'
).
click
(
function
()
{
StaffDebug
.
reset
(
$
(
this
).
data
(
'location'
));
StaffDebug
.
reset
(
$
(
this
).
parent
().
data
(
'location-name'
),
$
(
this
).
parent
().
data
(
'location'
));
return
false
;
});
$
(
'#staff-debug-sdelete'
).
click
(
function
()
{
StaffDebug
.
sdelete
(
$
(
this
).
data
(
'location'
));
StaffDebug
.
sdelete
(
$
(
this
).
parent
().
data
(
'location-name'
),
$
(
this
).
parent
().
data
(
'location'
));
return
false
;
});
$
(
'#staff-debug-rescore'
).
click
(
function
()
{
StaffDebug
.
rescore
(
$
(
this
).
data
(
'location'
));
StaffDebug
.
rescore
(
$
(
this
).
parent
().
data
(
'location-name'
),
$
(
this
).
parent
().
data
(
'location'
));
return
false
;
});
});
lms/templates/staff_problem_info.html
View file @
6fcf65ef
...
...
@@ -61,14 +61,14 @@ ${block_content}
<label
for=
"sd_fu_${location.name}"
>
${_('Username')}:
</label>
<input
type=
"text"
id=
"sd_fu_${location.name}"
placeholder=
"${user.username}"
/>
</div>
<div>
<div
data-location=
"${unicode(location)}"
data-location-name=
"${location.name}"
>
[
<a
href=
"#"
id=
"staff-debug-reset"
data-location=
"${location.name}"
>
${_('Reset Student Attempts')}
</a>
<a
href=
"#"
id=
"staff-debug-reset"
>
${_('Reset Student Attempts')}
</a>
|
<a
href=
"#"
id=
"staff-debug-sdelete"
data-location=
"${location.name}"
>
${_('Delete Student State')}
</a>
<a
href=
"#"
id=
"staff-debug-sdelete"
>
${_('Delete Student State')}
</a>
|
<a
href=
"#"
id=
"staff-debug-rescore"
data-location=
"${location.name}"
>
${_('Rescore Student Submission')}
</a>
<a
href=
"#"
id=
"staff-debug-rescore"
>
${_('Rescore Student Submission')}
</a>
]
</div>
<div
id=
"result_${location.name}"
/>
...
...
@@ -128,7 +128,7 @@ $(function () {
null
,
%
endif
{
'location'
:
'${location}'
,
'location'
:
'${location
.to_deprecated_string()
}'
,
'xqa_key'
:
'${xqa_key}'
,
'category'
:
'${category}'
,
'user'
:
'${user}'
...
...
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