Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
problem-builder
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
OpenEdx
problem-builder
Commits
3e4edf40
Commit
3e4edf40
authored
Jul 06, 2015
by
Tim Krones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide results table if no data is available.
parent
b9ebeee6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
3 deletions
+27
-3
problem_builder/public/css/student_answers_dashboard.css
+3
-0
problem_builder/public/js/student_answers_dashboard.js
+24
-3
No files found.
problem_builder/public/css/student_answers_dashboard.css
View file @
3e4edf40
...
@@ -21,6 +21,9 @@
...
@@ -21,6 +21,9 @@
.data-export-field-container
{
.data-export-field-container
{
margin-bottom
:
1em
;
margin-bottom
:
1em
;
}
}
.data-export-results
{
display
:
none
;
}
.data-export-results
table
{
.data-export-results
table
{
margin-top
:
1em
;
margin-top
:
1em
;
border
:
2px
solid
gray
;
border
:
2px
solid
gray
;
...
...
problem_builder/public/js/student_answers_dashboard.js
View file @
3e4edf40
...
@@ -13,6 +13,7 @@ function StudentAnswersDashboardBlock(runtime, element) {
...
@@ -13,6 +13,7 @@ function StudentAnswersDashboardBlock(runtime, element) {
var
$blockTypes
=
$element
.
find
(
"select[name='block_types']"
);
var
$blockTypes
=
$element
.
find
(
"select[name='block_types']"
);
var
$rootBlockId
=
$element
.
find
(
"input[name='root_block_id']"
);
var
$rootBlockId
=
$element
.
find
(
"input[name='root_block_id']"
);
var
$username
=
$element
.
find
(
"input[name='username']"
);
var
$username
=
$element
.
find
(
"input[name='username']"
);
var
$resultTable
=
$element
.
find
(
'.data-export-results'
);
var
status
;
var
status
;
function
getStatus
()
{
function
getStatus
()
{
...
@@ -45,6 +46,20 @@ function StudentAnswersDashboardBlock(runtime, element) {
...
@@ -45,6 +46,20 @@ function StudentAnswersDashboardBlock(runtime, element) {
);
);
}
}
function
hideResults
()
{
$resultTable
.
hide
();
}
function
showResults
()
{
$resultTable
.
show
();
}
function
maybeShowResults
()
{
if
(
status
.
last_export_result
)
{
showResults
();
}
}
function
handleError
(
data
)
{
function
handleError
(
data
)
{
// Shim to make the XBlock JsonHandlerError response work with our format.
// Shim to make the XBlock JsonHandlerError response work with our format.
status
=
{
'last_export_result'
:
JSON
.
parse
(
data
.
responseText
),
'export_pending'
:
false
};
status
=
{
'last_export_result'
:
JSON
.
parse
(
data
.
responseText
),
'export_pending'
:
false
};
...
@@ -87,9 +102,9 @@ function StudentAnswersDashboardBlock(runtime, element) {
...
@@ -87,9 +102,9 @@ function StudentAnswersDashboardBlock(runtime, element) {
}
}
// Display results
// Display results
var
$resultTable
=
$
(
'.data-export-results table
tbody'
);
var
$resultTable
Body
=
$resultTable
.
find
(
'
tbody'
);
$resultTable
.
empty
();
$resultTable
Body
.
empty
();
_
.
each
(
status
.
last_export_result
.
display_data
,
function
(
row
)
{
_
.
each
(
status
.
last_export_result
.
display_data
,
function
(
row
)
{
...
@@ -99,9 +114,11 @@ function StudentAnswersDashboardBlock(runtime, element) {
...
@@ -99,9 +114,11 @@ function StudentAnswersDashboardBlock(runtime, element) {
tr
.
append
(
$
(
'<td>'
).
text
(
cell
));
tr
.
append
(
$
(
'<td>'
).
text
(
cell
));
});
});
$resultTable
.
append
(
tr
);
$resultTable
Body
.
append
(
tr
);
});
});
showResults
();
}
else
{
}
else
{
if
(
status
.
export_pending
)
{
if
(
status
.
export_pending
)
{
$statusArea
.
append
(
$
(
'<p>'
).
text
(
$statusArea
.
append
(
$
(
'<p>'
).
text
(
...
@@ -144,6 +161,10 @@ function StudentAnswersDashboardBlock(runtime, element) {
...
@@ -144,6 +161,10 @@ function StudentAnswersDashboardBlock(runtime, element) {
addHandler
(
$cancelButton
,
'cancel_export'
);
addHandler
(
$cancelButton
,
'cancel_export'
);
addHandler
(
$deleteButton
,
'delete_export'
);
addHandler
(
$deleteButton
,
'delete_export'
);
$startButton
.
on
(
'click'
,
hideResults
);
$cancelButton
.
on
(
'click'
,
maybeShowResults
);
$deleteButton
.
on
(
'click'
,
hideResults
);
$downloadButton
.
on
(
'click'
,
function
()
{
$downloadButton
.
on
(
'click'
,
function
()
{
window
.
location
.
href
=
status
.
download_url
;
window
.
location
.
href
=
status
.
download_url
;
});
});
...
...
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