Commit 115f6c3a by Diana Huang

Merge branch 'master' into tests/diana/update-oe-unit-tests

parents 71d27def 0e78d9eb
......@@ -116,9 +116,11 @@ class CapaModule(XModule):
self.grace_period = None
self.close_date = self.display_due_date
self.max_attempts = self.metadata.get('attempts', None)
if self.max_attempts is not None:
self.max_attempts = int(self.max_attempts)
max_attempts = self.metadata.get('attempts', None)
if max_attempts:
self.max_attempts = int(max_attempts)
else:
self.max_attempts = None
self.show_answer = self.metadata.get('showanswer', 'closed')
......
......@@ -655,7 +655,7 @@ class CourseDescriptor(SequenceDescriptor):
@property
def registration_end_date_text(self):
return time.strftime("%b %d, %Y", self.registration_end_date)
return time.strftime("%b %d, %Y at %H:%M UTC", self.registration_end_date)
@property
def current_test_center_exam(self):
......
......@@ -8,13 +8,13 @@ define('ElOutput', ['logme'], function (logme) {
function ElOutput(config, state) {
if ($.isPlainObject(config.functions.function)) {
processFuncObj(config.functions.function);
} else if ($.isArray(config.functions.function)) {
if ($.isPlainObject(config.functions["function"])) {
processFuncObj(config.functions["function"]);
} else if ($.isArray(config.functions["function"])) {
(function (c1) {
while (c1 < config.functions.function.length) {
if ($.isPlainObject(config.functions.function[c1])) {
processFuncObj(config.functions.function[c1]);
while (c1 < config.functions["function"].length) {
if ($.isPlainObject(config.functions["function"][c1])) {
processFuncObj(config.functions["function"][c1]);
}
c1 += 1;
......
......@@ -6,13 +6,13 @@ define('GLabelElOutput', ['logme'], function (logme) {
return GLabelElOutput;
function GLabelElOutput(config, state) {
if ($.isPlainObject(config.functions.function)) {
processFuncObj(config.functions.function);
} else if ($.isArray(config.functions.function)) {
if ($.isPlainObject(config.functions["function"])) {
processFuncObj(config.functions["function"]);
} else if ($.isArray(config.functions["function"])) {
(function (c1) {
while (c1 < config.functions.function.length) {
if ($.isPlainObject(config.functions.function[c1])) {
processFuncObj(config.functions.function[c1]);
while (c1 < config.functions["function"].length) {
if ($.isPlainObject(config.functions["function"][c1])) {
processFuncObj(config.functions["function"][c1]);
}
c1 += 1;
......
......@@ -838,33 +838,33 @@ define('Graph', ['logme'], function (logme) {
return;
}
if (typeof config.functions.function === 'string') {
if (typeof config.functions["function"] === 'string') {
// If just one function string is present.
addFunction(config.functions.function);
addFunction(config.functions["function"]);
} else if ($.isPlainObject(config.functions.function) === true) {
} else if ($.isPlainObject(config.functions["function"]) === true) {
// If a function is present, but it also has properties
// defined.
callAddFunction(config.functions.function);
callAddFunction(config.functions["function"]);
} else if ($.isArray(config.functions.function)) {
} else if ($.isArray(config.functions["function"])) {
// If more than one function is defined.
for (c1 = 0; c1 < config.functions.function.length; c1 += 1) {
for (c1 = 0; c1 < config.functions["function"].length; c1 += 1) {
// For each definition, we must check if it is a simple
// string definition, or a complex one with properties.
if (typeof config.functions.function[c1] === 'string') {
if (typeof config.functions["function"][c1] === 'string') {
// Simple string.
addFunction(config.functions.function[c1]);
addFunction(config.functions["function"][c1]);
} else if ($.isPlainObject(config.functions.function[c1])) {
} else if ($.isPlainObject(config.functions["function"][c1])) {
// Properties are present.
callAddFunction(config.functions.function[c1]);
callAddFunction(config.functions["function"][c1]);
}
}
......
......@@ -20,13 +20,17 @@ class @HTMLEditingDescriptor
theme : "advanced",
skin: 'studio',
schema: "html5",
# Necessary to preserve relative URLs to our images.
convert_urls : false,
# TODO: we should share this CSS with studio (and LMS)
content_css : "/static/css/tiny-mce.css",
# Disable h4, h5, and h6 styles as we don't have CSS for them.
formats : {
# Disable h4, h5, and h6 styles as we don't have CSS for them.
h4: {},
h5: {},
h6: {}
h6: {},
# tinyMCE does block level for code by default
code: {inline: 'code'}
},
# Disable visual aid on borderless table.
visual:false,
......@@ -50,10 +54,13 @@ class @HTMLEditingDescriptor
@setupTinyMCE: (ed) ->
ed.addButton('wrapAsCode', {
title : 'Code Block',
title : 'Code',
image : '/static/images/ico-tinymce-code.png',
onclick : () ->
ed.formatter.toggle('code')
# Without this, the dirty flag does not get set unless the user also types in text.
# Visual Editor must be marked as dirty or else we won't populate the Advanced Editor from it.
ed.isNotDirty = false
})
ed.onNodeChange.add((editor, command, e) ->
......
......@@ -3,6 +3,8 @@ metadata:
display_name: Circuit Schematic
rerandomize: never
showanswer: always
weight: ""
attempts: ""
data: |
<problem >
Please make a voltage divider that splits the provided voltage evenly.
......
......@@ -3,6 +3,8 @@ metadata:
display_name: Custom Grader
rerandomize: never
showanswer: always
weight: ""
attempts: ""
data: |
<problem>
<p>
......
......@@ -4,6 +4,8 @@ metadata:
rerandomize: never
showanswer: always
markdown: ""
weight: ""
attempts: ""
data: |
<problem>
</problem>
......
......@@ -3,6 +3,8 @@ metadata:
display_name: Formula Response
rerandomize: never
showanswer: always
weight: ""
attempts: ""
data: |
<problem>
<p>
......
......@@ -3,6 +3,8 @@ metadata:
display_name: Image Response
rerandomize: never
showanswer: always
weight: ""
attempts: ""
data: |
<problem>
<p>
......
......@@ -3,6 +3,8 @@ metadata:
display_name: Multiple Choice
rerandomize: never
showanswer: always
weight: ""
attempts: ""
markdown:
"A multiple choice problem presents radio buttons for student input. Students can only select a single
option presented. Multiple Choice questions have been the subject of many areas of research due to the early
......
......@@ -3,6 +3,8 @@ metadata:
display_name: Numerical Response
rerandomize: never
showanswer: always
weight: ""
attempts: ""
markdown:
"A numerical response problem accepts a line of text input from the
student, and evaluates the input for correctness based on its
......
......@@ -3,6 +3,8 @@ metadata:
display_name: Option Response
rerandomize: never
showanswer: always
weight: ""
attempts: ""
markdown:
"OptionResponse gives a limited set of options for students to respond with, and presents those options
in a format that encourages them to search for a specific answer rather than being immediately presented
......
......@@ -3,6 +3,8 @@ metadata:
display_name: String Response
rerandomize: never
showanswer: always
weight: ""
attempts: ""
# Note, the extra newlines are needed to make the yaml parser add blank lines instead of folding
markdown:
"A string response problem accepts a line of text input from the
......
......@@ -235,7 +235,7 @@ def index(request, course_id, chapter=None, section=None,
# Load all descendents of the section, because we're going to display it's
# html, which in general will need all of its children
section_module = get_module(request.user, request, section_descriptor.location,
student_module_cache, course.id, depth=None)
student_module_cache, course.id, position=position, depth=None)
if section_module is None:
# User may be trying to be clever and access something
# they don't have access to.
......
......@@ -62,14 +62,3 @@ class Permission(models.Model):
def __unicode__(self):
return self.name
@receiver(post_save, sender=CourseEnrollment)
def assign_default_role(sender, instance, **kwargs):
if instance.user.is_staff:
role = Role.objects.get_or_create(course_id=instance.course_id, name="Moderator")[0]
else:
role = Role.objects.get_or_create(course_id=instance.course_id, name="Student")[0]
logging.info("assign_default_role: adding %s as %s" % (instance.user, role))
instance.user.roles.add(role)
......@@ -466,7 +466,7 @@
<span class="label">Last Eligible Appointment Date:</span> <span class="value">${exam_info.last_eligible_appointment_date_text}</span>
</li>
<li>
<span class="label">Registration End Date:</span> <span class="value">${exam_info.registration_end_date_text}</span>
<span class="label">Registration Ends:</span> <span class="value">${exam_info.registration_end_date_text}</span>
</li>
</ul>
% endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment