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
0c928066
Commit
0c928066
authored
Mar 11, 2013
by
Brian Talbot
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into fix/btalbot/studio-sasscleanup
parents
a496cc0a
aceb6660
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
55 additions
and
17 deletions
+55
-17
cms/djangoapps/contentstore/tests/test_contentstore.py
+31
-0
cms/djangoapps/contentstore/views.py
+11
-0
common/lib/capa/capa/calc.py
+1
-1
common/lib/capa/capa/tests/test_responsetypes.py
+9
-0
jenkins/quality.sh
+0
-16
jenkins/test.sh
+3
-0
No files found.
cms/djangoapps/contentstore/tests/test_contentstore.py
View file @
0c928066
...
...
@@ -103,6 +103,37 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
self
.
assertEqual
(
reverse_tabs
,
course_tabs
)
def
test_delete
(
self
):
import_from_xml
(
modulestore
(),
'common/test/data/'
,
[
'full'
])
ms
=
modulestore
(
'direct'
)
course
=
ms
.
get_item
(
Location
([
'i4x'
,
'edX'
,
'full'
,
'course'
,
'6.002_Spring_2012'
,
None
]))
sequential
=
ms
.
get_item
(
Location
([
'i4x'
,
'edX'
,
'full'
,
'sequential'
,
'Administrivia_and_Circuit_Elements'
,
None
]))
chapter
=
ms
.
get_item
(
Location
([
'i4x'
,
'edX'
,
'full'
,
'chapter'
,
'Week_1'
,
None
]))
# make sure the parent no longer points to the child object which was deleted
self
.
assertTrue
(
sequential
.
location
.
url
()
in
chapter
.
definition
[
'children'
])
resp
=
self
.
client
.
post
(
reverse
(
'delete_item'
),
json
.
dumps
({
'id'
:
sequential
.
location
.
url
(),
'delete_children'
:
'true'
}),
"application/json"
)
bFound
=
False
try
:
sequential
=
ms
.
get_item
(
Location
([
'i4x'
,
'edX'
,
'full'
,
'sequential'
,
'Administrivia_and_Circuit_Elements'
,
None
]))
bFound
=
True
except
ItemNotFoundError
:
pass
self
.
assertFalse
(
bFound
)
chapter
=
ms
.
get_item
(
Location
([
'i4x'
,
'edX'
,
'full'
,
'chapter'
,
'Week_1'
,
None
]))
# make sure the parent no longer points to the child object which was deleted
self
.
assertFalse
(
sequential
.
location
.
url
()
in
chapter
.
definition
[
'children'
])
def
test_about_overrides
(
self
):
'''
This test case verifies that a course can use specialized override for about data, e.g. /about/Fall_2012/effort.html
...
...
cms/djangoapps/contentstore/views.py
View file @
0c928066
...
...
@@ -636,6 +636,17 @@ def delete_item(request):
if
item
.
location
.
revision
is
None
and
item
.
location
.
category
==
'vertical'
and
delete_all_versions
:
modulestore
(
'direct'
)
.
delete_item
(
item
.
location
)
# cdodge: we need to remove our parent's pointer to us so that it is no longer dangling
parent_locs
=
modulestore
(
'direct'
)
.
get_parent_locations
(
item_loc
,
None
)
for
parent_loc
in
parent_locs
:
parent
=
modulestore
(
'direct'
)
.
get_item
(
parent_loc
)
item_url
=
item_loc
.
url
()
if
item_url
in
parent
.
definition
[
"children"
]:
parent
.
definition
[
"children"
]
.
remove
(
item_url
)
modulestore
(
'direct'
)
.
update_children
(
parent
.
location
,
parent
.
definition
[
"children"
])
return
HttpResponse
()
...
...
common/lib/capa/capa/calc.py
View file @
0c928066
...
...
@@ -183,7 +183,7 @@ def evaluator(variables, functions, string, cs=False):
# 0.33k or -17
number
=
(
Optional
(
minus
|
plus
)
+
inner_number
+
Optional
(
CaselessLiteral
(
"E"
)
+
Optional
(
"-"
)
+
number_part
)
+
Optional
(
CaselessLiteral
(
"E"
)
+
Optional
(
(
plus
|
minus
)
)
+
number_part
)
+
Optional
(
number_suffix
))
number
=
number
.
setParseAction
(
number_parse_action
)
# Convert to number
...
...
common/lib/capa/capa/tests/test_responsetypes.py
View file @
0c928066
...
...
@@ -642,6 +642,15 @@ class NumericalResponseTest(ResponseTest):
incorrect_responses
=
[
""
,
"2.11"
,
"1.89"
,
"0"
]
self
.
assert_multiple_grade
(
problem
,
correct_responses
,
incorrect_responses
)
def
test_exponential_answer
(
self
):
problem
=
self
.
build_problem
(
question_text
=
"What 5 * 10?"
,
explanation
=
"The answer is 50"
,
answer
=
"5e+1"
)
correct_responses
=
[
"50"
,
"50.0"
,
"5e1"
,
"5e+1"
,
"50e0"
,
"500e-1"
]
incorrect_responses
=
[
""
,
"3.9"
,
"4.1"
,
"0"
,
"5.01e1"
]
self
.
assert_multiple_grade
(
problem
,
correct_responses
,
incorrect_responses
)
class
CustomResponseTest
(
ResponseTest
):
from
response_xml_factory
import
CustomResponseXMLFactory
...
...
jenkins/quality.sh
deleted
100755 → 0
View file @
a496cc0a
#! /bin/bash
set
-e
set
-x
git remote prune origin
# Reset the submodule, in case it changed
git submodule foreach
'git reset --hard HEAD'
# Set the IO encoding to UTF-8 so that askbot will start
export
PYTHONIOENCODING
=
UTF-8
rake clobber
rake pep8
||
echo
"pep8 failed, continuing"
rake pylint
||
echo
"pylint failed, continuing"
jenkins/test.sh
View file @
0c928066
...
...
@@ -38,6 +38,9 @@ pip install -q -r test-requirements.txt
yes w | pip install
-q
-r
requirements.txt
rake clobber
rake pep8
rake pylint
TESTS_FAILED
=
0
rake test_cms[false]
||
TESTS_FAILED
=
1
rake test_lms[false]
||
TESTS_FAILED
=
1
...
...
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