Merge branch 'master' into pmitros/dexml
This commit is contained in:
@@ -100,7 +100,7 @@ class Module(XModule):
|
||||
reset_button = False
|
||||
|
||||
# We don't need a "save" button if infinite number of attempts and non-randomized
|
||||
if self.max_attempts == None and self.rerandomize != "always":
|
||||
if self.max_attempts is None and self.rerandomize != "always":
|
||||
save_button = False
|
||||
|
||||
# Check if explanation is available, and if so, give a link
|
||||
@@ -225,7 +225,7 @@ class Module(XModule):
|
||||
''' Is the student still allowed to submit answers? '''
|
||||
if self.attempts == self.max_attempts:
|
||||
return True
|
||||
if self.close_date != None and datetime.datetime.utcnow() > self.close_date:
|
||||
if self.close_date is not None and datetime.datetime.utcnow() > self.close_date:
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
@@ -52,7 +52,7 @@ class Module(XModule):
|
||||
## Returns a set of all types of all sub-children
|
||||
child_classes = [set([i.tag for i in e.iter()]) for e in self.xmltree]
|
||||
|
||||
titles = ["\n".join([i.get("name").strip() for i in e.iter() if i.get("name") != None]) \
|
||||
titles = ["\n".join([i.get("name").strip() for i in e.iter() if i.get("name") is not None]) \
|
||||
for e in self.xmltree]
|
||||
|
||||
self.contents = self.rendered_children()
|
||||
@@ -86,7 +86,7 @@ class Module(XModule):
|
||||
|
||||
self.position = 1
|
||||
|
||||
if state != None:
|
||||
if state is not None:
|
||||
state = json.loads(state)
|
||||
if 'position' in state: self.position = int(state['position'])
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ class Module(XModule):
|
||||
self.youtube = xmltree.get('youtube')
|
||||
self.name = xmltree.get('name')
|
||||
self.position = 0
|
||||
if state != None:
|
||||
if state is not None:
|
||||
state = json.loads(state)
|
||||
if 'position' in state:
|
||||
self.position = int(float(state['position']))
|
||||
|
||||
Reference in New Issue
Block a user