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
6f73835f
Commit
6f73835f
authored
Jun 06, 2014
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused event logger config
parent
041e5e43
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
0 additions
and
65 deletions
+0
-65
openassessment/workflow/models.py
+0
-41
openassessment/workflow/test/events.py
+0
-8
openassessment/workflow/test/test_models.py
+0
-11
settings/base.py
+0
-3
settings/test.py
+0
-2
No files found.
openassessment/workflow/models.py
View file @
6f73835f
...
...
@@ -9,30 +9,16 @@ need to then generate a matching migration for it using:
./manage.py schemamigration openassessment.workflow --auto
"""
from
datetime
import
datetime
import
logging
import
importlib
from
django.conf
import
settings
from
django.db
import
models
from
django_extensions.db.fields
import
UUIDField
from
django.utils.timezone
import
now
from
model_utils
import
Choices
from
model_utils.models
import
StatusModel
,
TimeStampedModel
from
submissions
import
api
as
sub_api
logger
=
logging
.
getLogger
(
'openassessment.workflow.models'
)
# This will (hopefully soon) be replaced with calls to the event-tracking API:
# https://github.com/edx/event-tracking
if
hasattr
(
settings
,
"EDX_ORA2"
)
and
"EVENT_LOGGER"
in
settings
.
EDX_ORA2
:
func_path
=
settings
.
EDX_ORA2
[
"EVENT_LOGGER"
]
module_name
,
func_name
=
func_path
.
rsplit
(
'.'
,
1
)
emit_event
=
getattr
(
importlib
.
import_module
(
module_name
),
func_name
)
else
:
emit_event
=
lambda
event
:
logger
.
info
(
"Event: "
+
unicode
(
event
))
class
AssessmentWorkflow
(
TimeStampedModel
,
StatusModel
):
"""Tracks the open-ended assessment status of a student submission.
...
...
@@ -219,22 +205,6 @@ class AssessmentWorkflow(TimeStampedModel, StatusModel):
score
[
"points_possible"
]
)
# This should be replaced by using the event tracking API, but
# that's not quite ready yet. So we're making this temp hack.
emit_event
({
"context"
:
{
"course_id"
:
self
.
course_id
},
"event"
:
{
"submission_uuid"
:
self
.
submission_uuid
,
"points_earned"
:
score
[
"points_earned"
],
"points_possible"
:
score
[
"points_possible"
],
},
"event_source"
:
"server"
,
"event_type"
:
"openassessment.workflow.score"
,
"time"
:
datetime
.
utcnow
(),
})
class
AssessmentWorkflowStep
(
models
.
Model
):
"""An individual step in the overall workflow process.
...
...
@@ -306,14 +276,3 @@ class AssessmentWorkflowStep(models.Model):
if
step_changed
:
self
.
save
()
# Just here to record thoughts for later:
#
# class AssessmentWorkflowEvent(models.Model):
# workflow = models.ForeignKey(AssessmentWorkflow, related_name="events")
# app = models.CharField(max_length=50)
# event_type = models.CharField(max_length=255)
# event_data = models.TextField()
# description = models.TextField()
# created_at = models.DateTimeField(default=now, db_index=True)
openassessment/workflow/test/events.py
deleted
100644 → 0
View file @
041e5e43
"""
This is just a dummy event logger to test our ability to dyanmically change this
value based on configuration. All this should go away when we start using the
edx-analytics approved library (once that's ready to be used on prod).
"""
def
fake_event_logger
(
event
):
print
event
openassessment/workflow/test/test_models.py
deleted
100644 → 0
View file @
041e5e43
from
django.test
import
TestCase
from
mock
import
patch
from
nose.tools
import
raises
from
openassessment.workflow.models
import
emit_event
from
openassessment.workflow.test.events
import
fake_event_logger
class
TestEmitEvent
(
TestCase
):
def
test_emit_wired_correctly
(
self
):
self
.
assertEqual
(
emit_event
,
fake_event_logger
)
settings/base.py
View file @
6f73835f
...
...
@@ -147,9 +147,6 @@ CACHES = {
},
}
EDX_ORA2
=
{
}
# Celery configuration
# Note: Version 3.1 of Celery includes Django support, but since we're using
...
...
settings/test.py
View file @
6f73835f
...
...
@@ -37,8 +37,6 @@ TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
# Install test-specific Django apps
INSTALLED_APPS
+=
(
'django_nose'
,)
EDX_ORA2
[
"EVENT_LOGGER"
]
=
"openassessment.workflow.test.events.fake_event_logger"
# We run Celery in "always eager" mode in the test suite,
# which executes tasks synchronously instead of using the task queue.
...
...
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