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
987e5837
Commit
987e5837
authored
Sep 22, 2015
by
Tim Krones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add "Review grade" button and hide/show/enable/disable it when appropriate.
parent
8b4df834
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
problem_builder/public/js/mentoring_with_steps.js
+9
-2
problem_builder/templates/html/mentoring_with_steps.html
+1
-0
No files found.
problem_builder/public/js/mentoring_with_steps.js
View file @
987e5837
...
@@ -4,7 +4,7 @@ function MentoringWithStepsBlock(runtime, element) {
...
@@ -4,7 +4,7 @@ function MentoringWithStepsBlock(runtime, element) {
function
(
c
)
{
return
c
.
element
.
className
.
indexOf
(
'sb-step'
)
>
-
1
;
}
function
(
c
)
{
return
c
.
element
.
className
.
indexOf
(
'sb-step'
)
>
-
1
;
}
);
);
var
activeStep
=
$
(
'.mentoring'
,
element
).
data
(
'active-step'
);
var
activeStep
=
$
(
'.mentoring'
,
element
).
data
(
'active-step'
);
var
reviewStep
,
checkmark
,
submitDOM
,
nextDOM
,
tryAgainDOM
,
submitXHR
;
var
reviewStep
,
checkmark
,
submitDOM
,
nextDOM
,
reviewDOM
,
tryAgainDOM
,
submitXHR
;
function
isLastStep
()
{
function
isLastStep
()
{
return
(
activeStep
===
steps
.
length
-
1
);
return
(
activeStep
===
steps
.
length
-
1
);
...
@@ -37,6 +37,7 @@ function MentoringWithStepsBlock(runtime, element) {
...
@@ -37,6 +37,7 @@ function MentoringWithStepsBlock(runtime, element) {
if
(
nextDOM
.
is
(
':visible'
))
{
nextDOM
.
focus
();
}
if
(
nextDOM
.
is
(
':visible'
))
{
nextDOM
.
focus
();
}
if
(
isLastStep
())
{
if
(
isLastStep
())
{
reviewDOM
.
removeAttr
(
'disabled'
);
tryAgainDOM
.
removeAttr
(
'disabled'
);
tryAgainDOM
.
removeAttr
(
'disabled'
);
tryAgainDOM
.
show
();
tryAgainDOM
.
show
();
}
}
...
@@ -64,8 +65,11 @@ function MentoringWithStepsBlock(runtime, element) {
...
@@ -64,8 +65,11 @@ function MentoringWithStepsBlock(runtime, element) {
function
updateDisplay
()
{
function
updateDisplay
()
{
cleanAll
();
cleanAll
();
showActiveStep
();
showActiveStep
();
nextDOM
.
attr
(
'disabled'
,
'disabled'
);
validateXBlock
();
validateXBlock
();
nextDOM
.
attr
(
'disabled'
,
'disabled'
);
if
(
isLastStep
())
{
reviewDOM
.
show
();
}
}
}
function
showActiveStep
()
{
function
showActiveStep
()
{
...
@@ -112,6 +116,7 @@ function MentoringWithStepsBlock(runtime, element) {
...
@@ -112,6 +116,7 @@ function MentoringWithStepsBlock(runtime, element) {
submitDOM
.
show
();
submitDOM
.
show
();
if
(
!
isLastStep
())
{
if
(
!
isLastStep
())
{
nextDOM
.
show
();
nextDOM
.
show
();
reviewDOM
.
hide
();
}
}
}
}
...
@@ -137,6 +142,8 @@ function MentoringWithStepsBlock(runtime, element) {
...
@@ -137,6 +142,8 @@ function MentoringWithStepsBlock(runtime, element) {
nextDOM
.
on
(
'click'
,
updateDisplay
);
nextDOM
.
on
(
'click'
,
updateDisplay
);
nextDOM
.
show
();
nextDOM
.
show
();
reviewDOM
=
$
(
element
).
find
(
'.submit .input-review'
);
tryAgainDOM
=
$
(
element
).
find
(
'.submit .input-try-again'
);
tryAgainDOM
=
$
(
element
).
find
(
'.submit .input-try-again'
);
tryAgainDOM
.
on
(
'click'
,
tryAgain
);
tryAgainDOM
.
on
(
'click'
,
tryAgain
);
...
...
problem_builder/templates/html/mentoring_with_steps.html
View file @
987e5837
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
<span
class=
"assessment-checkmark fa icon-2x"
></span>
<span
class=
"assessment-checkmark fa icon-2x"
></span>
<input
type=
"button"
class=
"input-main"
value=
"Submit"
disabled=
"disabled"
/>
<input
type=
"button"
class=
"input-main"
value=
"Submit"
disabled=
"disabled"
/>
<input
type=
"button"
class=
"input-next"
value=
"Next Step"
disabled=
"disabled"
/>
<input
type=
"button"
class=
"input-next"
value=
"Next Step"
disabled=
"disabled"
/>
<input
type=
"button"
class=
"input-review"
value=
"Review grade"
disabled=
"disabled"
/>
<input
type=
"button"
class=
"input-try-again"
value=
"Try again"
disabled=
"disabled"
/>
<input
type=
"button"
class=
"input-try-again"
value=
"Try again"
disabled=
"disabled"
/>
</div>
</div>
</div>
</div>
...
...
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