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
ceb7b631
Commit
ceb7b631
authored
Apr 04, 2014
by
Filippo Valsorda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add grading to the mentoring XBlock
parent
544ccade
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
1 deletions
+11
-1
mentoring/answer.py
+1
-0
mentoring/mcq.py
+1
-0
mentoring/mentoring.py
+7
-0
mentoring/mrq.py
+2
-1
No files found.
mentoring/answer.py
View file @
ceb7b631
...
...
@@ -104,6 +104,7 @@ class AnswerBlock(LightChild):
return
{
'student_input'
:
self
.
student_input
,
'completed'
:
self
.
completed
,
'score'
:
1
if
self
.
completed
else
0
,
}
@property
...
...
mentoring/mcq.py
View file @
ceb7b631
...
...
@@ -81,6 +81,7 @@ class MCQBlock(QuestionnaireAbstractBlock):
'submission'
:
submission
,
'completed'
:
completed
,
'tips'
:
tips
,
'score'
:
1
if
completed
else
0
,
}
log
.
debug
(
u'MCQ submission result:
%
s'
,
result
)
return
result
...
...
mentoring/mentoring.py
View file @
ceb7b631
...
...
@@ -69,6 +69,7 @@ class MentoringBlock(XBlockWithLightChildren):
display_submit
=
Boolean
(
help
=
"Allow to submit current block?"
,
default
=
True
,
scope
=
Scope
.
content
)
xml_content
=
String
(
help
=
"XML content"
,
default
=
''
,
scope
=
Scope
.
content
)
icon_class
=
'problem'
has_score
=
True
def
student_view
(
self
,
context
):
fragment
,
named_children
=
self
.
get_children_fragment
(
context
,
view_name
=
'mentoring_view'
,
...
...
@@ -136,6 +137,12 @@ class MentoringBlock(XBlockWithLightChildren):
elif
completed
and
self
.
next_step
==
self
.
url_name
:
self
.
next_step
=
self
.
followed_by
score
=
sum
(
r
[
1
][
'score'
]
for
r
in
submit_results
)
/
float
(
len
(
submit_results
))
self
.
runtime
.
publish
(
self
,
'grade'
,
{
'value'
:
score
,
'max_value'
:
1
,
})
self
.
completed
=
bool
(
completed
)
return
{
'submitResults'
:
submit_results
,
...
...
mentoring/mrq.py
View file @
ceb7b631
...
...
@@ -103,7 +103,8 @@ class MRQBlock(QuestionnaireAbstractBlock):
'choices'
:
results
,
'message'
:
self
.
message
,
'max_attempts'
:
self
.
max_attempts
,
'num_attempts'
:
self
.
num_attempts
'num_attempts'
:
self
.
num_attempts
,
'score'
:
sum
(
1.0
for
r
in
results
if
r
[
'completed'
])
/
len
(
results
),
}
log
.
debug
(
u'MRQ submissions result:
%
s'
,
result
)
...
...
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