Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-ora2
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-ora2
Commits
716a0e6e
Commit
716a0e6e
authored
Feb 18, 2014
by
Stephen Sanchez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updating code based on merging master.
parent
d9fcf7e7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
32 deletions
+50
-32
apps/openassessment/xblock/openassessmentblock.py
+0
-24
apps/openassessment/xblock/scenario_parser.py
+50
-8
No files found.
apps/openassessment/xblock/openassessmentblock.py
View file @
716a0e6e
...
...
@@ -433,27 +433,3 @@ class OpenAssessmentBlock(XBlock):
"message"
:
"You have not started this problem"
,
}
return
grade_state
class
EvaluationModule
():
eval_type
=
None
name
=
''
start_datetime
=
None
due_datetime
=
None
must_grade
=
1
must_be_graded_by
=
0
class
PeerEvaluation
(
EvaluationModule
):
eval_type
=
"peer-evaluation"
navigation_text
=
"Your evaluation(s) of peer responses"
url
=
"static/html/oa_peer_evaluation.html"
class
SelfEvaluation
(
EvaluationModule
):
eval_type
=
"self-evaluation"
navigation_text
=
"Your evaluation of your response"
url
=
"static/html/oa_self_evaluation.html"
apps/openassessment/xblock/scenario_parser.py
View file @
716a0e6e
# -*- coding: utf-8 -*-
"""XBlock scenario parsing routines"""
class
ScenarioParser
(
object
):
"""Utility class to capture parsing of xml from runtime scenarios."""
...
...
@@ -22,6 +23,11 @@ class ScenarioParser(object):
"""<prompt>This tells you what you should write about. There should be only one prompt.</prompt>"""
return
e
.
text
.
strip
()
def
get_title
(
self
,
e
):
"""<title>The title of this block</title>
"""
return
e
.
text
.
strip
()
def
get_rubric
(
self
,
e
):
"""<rubric>
This text is general instructions relating to this rubric.
...
...
@@ -68,14 +74,24 @@ class ScenarioParser(object):
must_grade="5"
must_be_graded_by="3" />
</evals>"""
return
[{
'type'
:
ev
.
tag
,
'name'
:
ev
.
attrib
.
get
(
'name'
,
''
),
'start_datetime'
:
ev
.
attrib
.
get
(
'start'
,
None
),
'due_datetime'
:
ev
.
attrib
.
get
(
'due'
,
None
),
# These attrs are accepted for self, ai evals, but ignored:
'must_grade'
:
int
(
ev
.
attrib
.
get
(
'must_grade'
,
1
)
if
ev
.
tag
==
'peereval'
else
1
),
'must_be_graded_by'
:
int
(
ev
.
attrib
.
get
(
'must_be_graded_by'
,
0
)
if
ev
.
tag
==
'peereval'
else
0
),
}
for
ev
in
evaluations
]
evaluation_list
=
[]
for
ev
in
evaluations
:
evaluation
=
None
type
=
ev
.
tag
if
'peer-evaluation'
==
type
:
evaluation
=
PeerEvaluation
()
elif
'self-evaluation'
==
type
:
evaluation
=
SelfEvaluation
()
if
evaluation
:
evaluation
.
name
=
ev
.
attrib
.
get
(
'name'
,
''
)
evaluation
.
start_datetime
=
ev
.
attrib
.
get
(
'start'
,
None
)
evaluation
.
due_datetime
=
ev
.
attrib
.
get
(
'due'
,
None
)
evaluation
.
must_grade
=
int
(
ev
.
attrib
.
get
(
'must_grade'
,
1
))
evaluation
.
must_be_graded_by
=
int
(
ev
.
attrib
.
get
(
'must_be_graded_by'
,
0
))
evaluation_list
.
append
(
evaluation
)
return
evaluation_list
def
parse
(
self
):
"""Instantiate xblock object from runtime XML definition."""
...
...
@@ -85,9 +101,34 @@ class ScenarioParser(object):
elif
child
.
tag
==
'rubric'
:
(
self
.
xblock
.
rubric_instructions
,
self
.
xblock
.
rubric_criteria
)
=
self
.
get_rubric
(
child
)
elif
child
.
tag
==
'title'
:
self
.
xblock
.
title
=
self
.
get_title
(
child
)
elif
child
.
tag
==
'evals'
:
self
.
xblock
.
rubric_evals
=
self
.
get_evals
(
child
)
else
:
self
.
unknown_handler
(
self
.
xblock
,
child
)
return
self
.
xblock
class
EvaluationModule
():
eval_type
=
None
name
=
''
start_datetime
=
None
due_datetime
=
None
must_grade
=
1
must_be_graded_by
=
0
class
PeerEvaluation
(
EvaluationModule
):
eval_type
=
"peer-evaluation"
navigation_text
=
"Your evaluation(s) of peer responses"
url
=
"static/html/oa_peer_evaluation.html"
class
SelfEvaluation
(
EvaluationModule
):
eval_type
=
"self-evaluation"
navigation_text
=
"Your evaluation of your response"
url
=
"static/html/oa_self_evaluation.html"
\ No newline at end of file
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