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
beb43c10
Commit
beb43c10
authored
Oct 10, 2014
by
dragonfi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add 'partial' as third value of completed
parent
f2123cc8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
18 deletions
+8
-18
mentoring/mentoring.py
+3
-5
mentoring/mrq.py
+1
-7
mentoring/public/js/mentoring_assessment_view.js
+4
-6
No files found.
mentoring/mentoring.py
View file @
beb43c10
...
@@ -115,7 +115,7 @@ class MentoringBlock(XBlockWithLightChildren, StepParentMixin):
...
@@ -115,7 +115,7 @@ class MentoringBlock(XBlockWithLightChildren, StepParentMixin):
score
=
sum
(
r
[
1
][
'score'
]
*
r
[
1
][
'weight'
]
for
r
in
self
.
student_results
)
/
total_child_weight
score
=
sum
(
r
[
1
][
'score'
]
*
r
[
1
][
'weight'
]
for
r
in
self
.
student_results
)
/
total_child_weight
correct
=
sum
(
1
for
r
in
self
.
student_results
if
r
[
1
][
'completed'
]
is
True
)
correct
=
sum
(
1
for
r
in
self
.
student_results
if
r
[
1
][
'completed'
]
is
True
)
incorrect
=
sum
(
1
for
r
in
self
.
student_results
if
r
[
1
][
'completed'
]
is
False
)
incorrect
=
sum
(
1
for
r
in
self
.
student_results
if
r
[
1
][
'completed'
]
is
False
)
partially_correct
=
sum
(
1
for
r
in
self
.
student_results
if
r
[
1
]
.
get
(
'partially_completed'
,
False
)
is
True
)
partially_correct
=
sum
(
1
for
r
in
self
.
student_results
if
r
[
1
]
[
'completed'
]
is
'partial'
)
return
(
score
,
int
(
round
(
score
*
100
)),
correct
,
incorrect
,
partially_correct
)
return
(
score
,
int
(
round
(
score
*
100
)),
correct
,
incorrect
,
partially_correct
)
...
@@ -217,7 +217,7 @@ class MentoringBlock(XBlockWithLightChildren, StepParentMixin):
...
@@ -217,7 +217,7 @@ class MentoringBlock(XBlockWithLightChildren, StepParentMixin):
child_result
=
child
.
submit
(
submission
)
child_result
=
child
.
submit
(
submission
)
submit_results
.
append
([
child
.
name
,
child_result
])
submit_results
.
append
([
child
.
name
,
child_result
])
child
.
save
()
child
.
save
()
completed
=
completed
and
child_result
[
'completed'
]
completed
=
completed
and
(
child_result
[
'completed'
]
is
True
)
if
self
.
max_attempts_reached
:
if
self
.
max_attempts_reached
:
message
=
self
.
get_message_html
(
'max_attempts_reached'
)
message
=
self
.
get_message_html
(
'max_attempts_reached'
)
...
@@ -257,7 +257,7 @@ class MentoringBlock(XBlockWithLightChildren, StepParentMixin):
...
@@ -257,7 +257,7 @@ class MentoringBlock(XBlockWithLightChildren, StepParentMixin):
if
not
self
.
completed
and
self
.
max_attempts
>
0
:
if
not
self
.
completed
and
self
.
max_attempts
>
0
:
self
.
num_attempts
+=
1
self
.
num_attempts
+=
1
self
.
completed
=
bool
(
completed
)
self
.
completed
=
completed
is
True
raw_score
=
self
.
score
[
0
]
raw_score
=
self
.
score
[
0
]
...
@@ -304,7 +304,6 @@ class MentoringBlock(XBlockWithLightChildren, StepParentMixin):
...
@@ -304,7 +304,6 @@ class MentoringBlock(XBlockWithLightChildren, StepParentMixin):
self
.
student_results
.
append
([
child
.
name
,
child_result
])
self
.
student_results
.
append
([
child
.
name
,
child_result
])
child
.
save
()
child
.
save
()
completed
=
child_result
[
'completed'
]
completed
=
child_result
[
'completed'
]
partially_completed
=
child_result
.
get
(
'partially_completed'
,
False
)
event_data
=
{}
event_data
=
{}
...
@@ -330,7 +329,6 @@ class MentoringBlock(XBlockWithLightChildren, StepParentMixin):
...
@@ -330,7 +329,6 @@ class MentoringBlock(XBlockWithLightChildren, StepParentMixin):
return
{
return
{
'completed'
:
completed
,
'completed'
:
completed
,
'partially_completed'
:
partially_completed
,
'attempted'
:
self
.
attempted
,
'attempted'
:
self
.
attempted
,
'max_attempts'
:
self
.
max_attempts
,
'max_attempts'
:
self
.
max_attempts
,
'num_attempts'
:
self
.
num_attempts
,
'num_attempts'
:
self
.
num_attempts
,
...
...
mentoring/mrq.py
View file @
beb43c10
...
@@ -48,8 +48,6 @@ class MRQBlock(QuestionnaireAbstractBlock):
...
@@ -48,8 +48,6 @@ class MRQBlock(QuestionnaireAbstractBlock):
def
submit
(
self
,
submissions
):
def
submit
(
self
,
submissions
):
log
.
debug
(
u'Received MRQ submissions: "
%
s"'
,
submissions
)
log
.
debug
(
u'Received MRQ submissions: "
%
s"'
,
submissions
)
completed
=
True
partially_completed
=
False
score
=
0
score
=
0
results
=
[]
results
=
[]
...
@@ -65,8 +63,6 @@ class MRQBlock(QuestionnaireAbstractBlock):
...
@@ -65,8 +63,6 @@ class MRQBlock(QuestionnaireAbstractBlock):
(
choice_selected
and
choice
.
value
in
tip
.
reject_with_defaults
)):
(
choice_selected
and
choice
.
value
in
tip
.
reject_with_defaults
)):
choice_completed
=
False
choice_completed
=
False
completed
=
completed
and
choice_completed
partially_completed
=
partially_completed
or
choice_completed
if
choice_completed
:
if
choice_completed
:
score
+=
1
score
+=
1
...
@@ -87,13 +83,11 @@ class MRQBlock(QuestionnaireAbstractBlock):
...
@@ -87,13 +83,11 @@ class MRQBlock(QuestionnaireAbstractBlock):
self
.
student_choices
=
submissions
self
.
student_choices
=
submissions
if
completed
:
completed
=
False
if
score
<=
0
else
True
if
score
>=
len
(
results
)
else
'partial'
partially_completed
=
False
result
=
{
result
=
{
'submissions'
:
submissions
,
'submissions'
:
submissions
,
'completed'
:
completed
,
'completed'
:
completed
,
'partially_completed'
:
partially_completed
,
'choices'
:
results
,
'choices'
:
results
,
'message'
:
self
.
message
,
'message'
:
self
.
message
,
'weight'
:
self
.
weight
,
'weight'
:
self
.
weight
,
...
...
mentoring/public/js/mentoring_assessment_view.js
View file @
beb43c10
...
@@ -134,13 +134,11 @@ function MentoringAssessmentView(runtime, element, mentoring) {
...
@@ -134,13 +134,11 @@ function MentoringAssessmentView(runtime, element, mentoring) {
$
(
'.attempts'
,
element
).
data
(
'max_attempts'
,
result
.
max_attempts
);
$
(
'.attempts'
,
element
).
data
(
'max_attempts'
,
result
.
max_attempts
);
$
(
'.attempts'
,
element
).
data
(
'num_attempts'
,
result
.
num_attempts
);
$
(
'.attempts'
,
element
).
data
(
'num_attempts'
,
result
.
num_attempts
);
if
(
result
.
completed
)
{
if
(
result
.
completed
===
'partial'
)
{
checkmark
.
addClass
(
'checkmark-correct icon-ok fa-check'
);
}
else
if
(
result
.
partially_completed
)
{
checkmark
.
addClass
(
'checkmark-partially-correct icon-ok fa-check'
);
checkmark
.
addClass
(
'checkmark-partially-correct icon-ok fa-check'
);
}
}
else
if
(
result
.
completed
)
{
else
{
checkmark
.
addClass
(
'checkmark-correct icon-ok fa-check'
);
}
else
{
checkmark
.
addClass
(
'checkmark-incorrect icon-exclamation fa-exclamation'
);
checkmark
.
addClass
(
'checkmark-incorrect icon-exclamation fa-exclamation'
);
}
}
...
...
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