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
b784cb28
Commit
b784cb28
authored
Feb 24, 2014
by
Stephen Sanchez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Quick code review changes to clean up empty files and move functions
parent
d580f825
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
32 deletions
+26
-32
apps/openassessment/xblock/assessment_mixin.py
+0
-22
apps/openassessment/xblock/grade_mixin.py
+0
-1
apps/openassessment/xblock/openassessmentblock.py
+21
-1
apps/openassessment/xblock/peer_assessment_mixin.py
+3
-5
apps/openassessment/xblock/self_assessment_mixin.py
+1
-2
apps/openassessment/xblock/submission_mixin.py
+1
-1
No files found.
apps/openassessment/xblock/assessment_mixin.py
deleted
100644 → 0
View file @
d580f825
from
django.template
import
Context
from
django.template.loader
import
get_template
from
webob
import
Response
class
AssessmentMixin
(
object
):
def
render
(
self
,
path
,
context_dict
=
None
):
"""Render an Assessment Module's HTML
Given the name of an assessment module, find it in the list of
configured modules, and ask for its rendered HTML.
"""
if
not
context_dict
:
context_dict
=
{}
context_dict
[
"xblock_trace"
]
=
self
.
get_xblock_trace
()
context_dict
[
"rubric_instructions"
]
=
self
.
rubric_instructions
context_dict
[
"rubric_criteria"
]
=
self
.
rubric_criteria
template
=
get_template
(
path
)
context
=
Context
(
context_dict
)
return
Response
(
template
.
render
(
context
),
content_type
=
'application/html'
,
charset
=
'UTF-8'
)
apps/openassessment/xblock/grade_mixin.py
deleted
100644 → 0
View file @
d580f825
__author__
=
'stephensanchez'
apps/openassessment/xblock/openassessmentblock.py
View file @
b784cb28
"""An XBlock where students can read a question and compose their response"""
import
datetime
import
pkg_resources
from
django.template.context
import
Context
from
django.template.loader
import
get_template
import
pkg_resources
from
webob
import
Response
from
xblock.core
import
XBlock
from
xblock.fields
import
List
,
Scope
,
String
...
...
@@ -272,3 +273,22 @@ class OpenAssessmentBlock(XBlock, SubmissionMixin, PeerAssessmentMixin, SelfAsse
"message"
:
"You have not started this problem"
,
}
return
grade_state
def
render
(
self
,
path
,
context_dict
=
None
):
"""Render an Assessment Module's HTML
Given the name of an assessment module, find it in the list of
configured modules, and ask for its rendered HTML.
"""
if
not
context_dict
:
context_dict
=
{}
# TODO: these shouldn't overwrite
context_dict
[
"xblock_trace"
]
=
self
.
get_xblock_trace
()
context_dict
[
"rubric_instructions"
]
=
self
.
rubric_instructions
context_dict
[
"rubric_criteria"
]
=
self
.
rubric_criteria
template
=
get_template
(
path
)
context
=
Context
(
context_dict
)
return
Response
(
template
.
render
(
context
),
content_type
=
'application/html'
,
charset
=
'UTF-8'
)
apps/openassessment/xblock/peer_assessment_mixin.py
View file @
b784cb28
from
xblock.core
import
XBlock
from
openassessment.peer
import
api
as
peer_api
from
openassessment.peer.api
import
PeerAssessmentWorkflowError
from
openassessment.xblock.assessment_mixin
import
AssessmentMixin
class
PeerAssessmentMixin
(
AssessmentMixin
):
class
PeerAssessmentMixin
(
object
):
@XBlock.json_handler
def
assess
(
self
,
data
,
suffix
=
''
):
...
...
@@ -25,6 +24,7 @@ class PeerAssessmentMixin(AssessmentMixin):
assessment_dict
)
# Temp kludge until we fix JSON serialization for datetime
assessment
[
"scored_at"
]
=
str
(
assessment
[
"scored_at"
])
...
...
@@ -37,9 +37,7 @@ class PeerAssessmentMixin(AssessmentMixin):
self
.
get_student_item_dict
(),
assessment
)}
return
super
(
PeerAssessmentMixin
,
self
)
.
render
(
'static/html/oa_peer_assessment.html'
,
context_dict
)
return
self
.
render
(
'static/html/oa_peer_assessment.html'
,
context_dict
)
def
get_peer_submission
(
self
,
student_item_dict
,
assessment
):
peer_submission
=
False
...
...
apps/openassessment/xblock/self_assessment_mixin.py
View file @
b784cb28
from
xblock.core
import
XBlock
from
openassessment.xblock.assessment_mixin
import
AssessmentMixin
class
SelfAssessmentMixin
(
AssessmentMixin
):
class
SelfAssessmentMixin
(
object
):
@XBlock.handler
def
render_self_assessment
(
self
,
data
,
suffix
=
''
):
...
...
apps/openassessment/xblock/submission_mixin.py
View file @
b784cb28
...
...
@@ -40,4 +40,4 @@ class SubmissionMixin(AssessmentMixin):
@XBlock.handler
def
render_submission
(
self
,
data
,
suffix
=
''
):
return
s
uper
(
SubmissionMixin
,
self
)
.
render
(
'static/html/oa_response.html'
)
return
s
elf
.
render
(
'static/html/oa_response.html'
)
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