Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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-platform
Commits
1e736345
Commit
1e736345
authored
May 08, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Anonymize date stamps in problem solutions
parent
a0ecbca0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletions
+6
-1
fixtures/anonymize_fixtures.py
+6
-1
No files found.
fixtures/anonymize_fixtures.py
100644 → 100755
View file @
1e736345
#! /usr/bin/env python
import
sys
import
json
import
random
import
copy
from
collections
import
defaultdict
from
argparse
import
ArgumentParser
,
FileType
from
datetime
import
datetime
def
generate_user
(
user_number
):
return
{
...
...
@@ -51,7 +54,6 @@ def generate_user(user_number):
}
def
parse_args
(
args
=
sys
.
argv
[
1
:]):
parser
=
ArgumentParser
()
parser
.
add_argument
(
'-d'
,
'--data'
,
type
=
FileType
(
'r'
),
default
=
sys
.
stdin
)
...
...
@@ -59,6 +61,7 @@ def parse_args(args=sys.argv[1:]):
parser
.
add_argument
(
'count'
,
type
=
int
)
return
parser
.
parse_args
(
args
)
def
main
(
args
=
sys
.
argv
[
1
:]):
args
=
parse_args
(
args
)
...
...
@@ -79,6 +82,8 @@ def main(args=sys.argv[1:]):
sample
=
random
.
choice
(
answers
)
data
=
copy
.
deepcopy
(
sample
)
data
[
"fields"
][
"student"
]
=
student_id
+
1
data
[
"fields"
][
"created"
]
=
datetime
.
now
()
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
data
[
"fields"
][
"modified"
]
=
datetime
.
now
()
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
data
[
"pk"
]
=
out_pk
out_pk
+=
1
out_data
.
append
(
data
)
...
...
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