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
63d4ac8c
Commit
63d4ac8c
authored
Jan 31, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Working on some flagging coffeescript
parent
78f9f634
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
7 deletions
+18
-7
lms/static/coffee/src/open_ended/open_ended.coffee
+15
-7
lms/templates/open_ended_problems/open_ended_flagged_problems.html
+3
-0
No files found.
lms/static/coffee/src/open_ended/open_ended.coffee
View file @
63d4ac8c
...
...
@@ -23,26 +23,34 @@ class OpenEnded
parent_tr
=
$
(
event
.
target
).
parent
().
parent
()
tr_children
=
parent_tr
.
children
()
action_type
=
"unflag"
submission_id
=
tr_children
[
4
].
innerText
student_id
=
tr_children
[
5
].
innerText
@
post
(
'take_action_on_flags'
,
{
'submission_id'
:
submission_id
,
'student_id'
:
student_id
,
'action_type'
:
action_type
},
@
handle_after_action
)
submission_id
=
tr_children
[
5
].
innerText
student_id
=
tr_children
[
6
].
innerText
callback_func
=
@
after_action_wrapper
(
$
(
event
.
target
),
action_type
)
@
post
(
'take_action_on_flags'
,
{
'submission_id'
:
submission_id
,
'student_id'
:
student_id
,
'action_type'
:
action_type
},
callback_func
)
ban
:
(
event
)
=>
event
.
preventDefault
()
parent_tr
=
$
(
event
.
target
).
parent
().
parent
()
tr_children
=
parent_tr
.
children
()
action_type
=
"ban"
submission_id
=
tr_children
[
4
].
innerText
student_id
=
tr_children
[
5
].
innerText
@
post
(
'take_action_on_flags'
,
{
'submission_id'
:
submission_id
,
'student_id'
:
student_id
,
'action_type'
:
action_type
},
@
handle_after_action
)
submission_id
=
tr_children
[
5
].
innerText
student_id
=
tr_children
[
6
].
innerText
callback_func
=
@
after_action_wrapper
(
$
(
event
.
target
),
action_type
)
@
post
(
'take_action_on_flags'
,
{
'submission_id'
:
submission_id
,
'student_id'
:
student_id
,
'action_type'
:
action_type
},
callback_func
)
post
:
(
cmd
,
data
,
callback
)
->
# if this post request fails, the error callback will catch it
$
.
post
(
@
ajax_url
+
cmd
,
data
,
callback
)
.
error
=>
callback
({
success
:
false
,
error
:
"Error occured while performing this operation"
})
after_action_wrapper
:
(
target
,
action_type
)
->
return
@
handle_after_action
handle_after_action
:
(
data
)
->
@
gentle_alert
data
.
data
tr_parent
=
target
.
parent
().
parent
()
tr_children
=
tr_parent
.
children
()
action_taken
=
tr_children
[
4
].
children
()[
0
]
action_taken
.
replaceWith
(
'<div class="action-taken">#{action_type} done for student.</div>'
)
gentle_alert
:
(
msg
)
=>
if
$
(
'.message-container'
).
length
...
...
lms/templates/open_ended_problems/open_ended_flagged_problems.html
View file @
63d4ac8c
...
...
@@ -47,6 +47,9 @@
<td>
<a
href=
"#ban"
class=
"ban-button action-button"
data-action-type=
"ban"
>
Ban
</a>
</td>
<td>
<div
class=
"action-taken"
></div>
</td>
<td
style=
"display:none;"
>
${problem['submission_id']}
</td>
...
...
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