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