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