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
92d41500
Commit
92d41500
authored
Dec 19, 2014
by
muzaffaryousaf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updating the create oa submissions command.
TNL-900
parent
80389526
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
openassessment/management/commands/create_oa_submissions.py
+6
-4
openassessment/management/tests/test_create_oa_submissions.py
+2
-3
No files found.
openassessment/management/commands/create_oa_submissions.py
View file @
92d41500
...
...
@@ -11,7 +11,6 @@ from openassessment.assessment.api import peer as peer_api
from
openassessment.assessment.api
import
self
as
self_api
STEPS
=
[
'peer'
,
'self'
]
SELF_ASSESSMENT_REQUIRED
=
False
# if you want to make self assessments then make this True.
class
Command
(
BaseCommand
):
...
...
@@ -35,9 +34,12 @@ class Command(BaseCommand):
NUM_OPTIONS
=
5
def
__init__
(
self
,
*
args
,
**
kwargs
):
self
.
self_assessment_required
=
kwargs
.
get
(
'self_assessment_required'
,
False
)
kwargs
=
{}
super
(
Command
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
self
.
_student_items
=
list
()
def
handle
(
self
,
*
args
,
**
options
):
"""
Execute the command.
...
...
@@ -48,7 +50,7 @@ class Command(BaseCommand):
num_submissions (int): Number of submissions to create.
percentage (int or float): Percentage for assessments to be made against submissions.
"""
if
len
(
args
)
<
3
:
if
len
(
args
)
<
4
:
raise
CommandError
(
'Usage: create_oa_submissions <COURSE_ID> <ITEM_ID> <NUM_SUBMISSIONS> <PERCENTAGE>'
)
course_id
=
unicode
(
args
[
0
])
...
...
@@ -113,9 +115,9 @@ class Command(BaseCommand):
rubric
,
self
.
NUM_PEER_ASSESSMENTS
)
assessments_created
+=
1
assessments_created
+=
1
if
SELF_ASSESSMENT_REQUIRED
:
if
self
.
self_assessment_required
:
# Create a self-assessment
print
"-- Creating self assessment"
self_api
.
create_assessment
(
...
...
openassessment/management/tests/test_create_oa_submissions.py
View file @
92d41500
...
...
@@ -14,9 +14,8 @@ class CreateSubmissionsTest(TestCase):
def
test_create_submissions
(
self
):
# Create some submissions
cmd
=
create_oa_submissions
.
Command
()
cmd
.
handle
(
"test_course"
,
"test_item"
,
"5"
)
cmd
=
create_oa_submissions
.
Command
(
**
{
'self_assessment_required'
:
True
})
cmd
.
handle
(
"test_course"
,
"test_item"
,
"5"
,
100
)
self
.
assertEqual
(
len
(
cmd
.
student_items
),
5
)
for
student_item
in
cmd
.
student_items
:
...
...
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