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
588a307d
Commit
588a307d
authored
Jul 22, 2013
by
Miles Steele
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add dangerous button confirmation popup
parent
02b7757d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
17 deletions
+18
-17
lms/static/coffee/src/instructor_dashboard/student_admin.coffee
+15
-16
lms/static/sass/course/instructor/_instructor_2.scss
+3
-1
No files found.
lms/static/coffee/src/instructor_dashboard/student_admin.coffee
View file @
588a307d
...
...
@@ -7,6 +7,12 @@ plantTimeout = -> window.InstructorDashboard.util.plantTimeout.apply this, argum
plantInterval
=
->
window
.
InstructorDashboard
.
util
.
plantInterval
.
apply
this
,
arguments
std_ajax_err
=
->
window
.
InstructorDashboard
.
util
.
std_ajax_err
.
apply
this
,
arguments
# wrap window.confirm
# display `msg`
# run `ok` or `cancel` depending on response
confirm_then
=
({
msg
,
ok
,
cancel
})
->
if
window
.
confirm
msg
then
ok
?
()
else
cancel
?
()
# get jquery element and assert its existance
find_and_assert
=
(
$root
,
selector
)
->
item
=
$root
.
find
selector
...
...
@@ -156,7 +162,9 @@ class StudentAdmin
error
:
std_ajax_err
=>
@
$request_response_error_single
.
text
"Error resetting problem attempts."
# delete state for student on problem
@
$btn_delete_state_single
.
click
=>
@
$btn_delete_state_single
.
click
=>
confirm_then
msg
:
"Delete student '
#{
@
$field_student_select
.
val
()
}
's state on problem '
#{
@
$field_problem_select_single
.
val
()
}
'?"
ok
:
=>
send_data
=
student_email
:
@
$field_student_select
.
val
()
problem_to_reset
:
@
$field_problem_select_single
.
val
()
...
...
@@ -202,7 +210,9 @@ class StudentAdmin
error
:
std_ajax_err
=>
@
$request_response_error_single
.
text
"Error getting task history for student+problem"
# start task to reset attempts on problem for all students
@
$btn_reset_attempts_all
.
click
=>
@
$btn_reset_attempts_all
.
click
=>
confirm_then
msg
:
"Reset attempts for all students on problem '
#{
@
$field_problem_select_all
.
val
()
}
'?"
ok
:
=>
send_data
=
all_students
:
true
problem_to_reset
:
@
$field_problem_select_all
.
val
()
...
...
@@ -215,20 +225,9 @@ class StudentAdmin
error
:
std_ajax_err
=>
@
$request_response_error_all
.
text
"Error starting a task to reset attempts for all students on this problem."
# start task to rescore problem for all students
@
$btn_reset_attempts_all
.
click
=>
send_data
=
all_students
:
true
problem_to_reset
:
@
$field_problem_select_all
.
val
()
$
.
ajax
dataType
:
'json'
url
:
@
$btn_reset_attempts_all
.
data
'endpoint'
data
:
send_data
success
:
@
clear_errors_then
->
console
.
log
'started reset attempts task'
error
:
std_ajax_err
=>
@
$request_response_error_all
.
text
"Error starting a task to reset attempts on this problem for all students."
# start task to rescore problem for all students
@
$btn_rescore_problem_all
.
click
=>
@
$btn_rescore_problem_all
.
click
=>
confirm_then
msg
:
"Rescore problem '
#{
@
$field_problem_select_all
.
val
()
}
' for all students?"
ok
:
=>
send_data
=
all_students
:
true
problem_to_reset
:
@
$field_problem_select_all
.
val
()
...
...
lms/static/sass/course/instructor/_instructor_2.scss
View file @
588a307d
...
...
@@ -63,7 +63,9 @@
@include
idashbutton
(
#eee
);
&
.molly-guard
{
@include
idashbutton
(
$danger-red
);
// @include idashbutton($danger-red);
// @include idashbutton($black);
// border: 2px solid $danger-red;
}
}
...
...
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