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
d3cd85d8
Commit
d3cd85d8
authored
Sep 05, 2012
by
kimth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #627 from MITx/feature/kfiedler/problems
Style changes to problems
parents
d0fcbdda
7c8838a6
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
16 deletions
+37
-16
common/lib/capa/capa/inputtypes.py
+2
-2
common/lib/capa/capa/responsetypes.py
+4
-4
common/lib/capa/capa/templates/optioninput.html
+0
-1
common/lib/xmodule/xmodule/capa_module.py
+2
-2
common/lib/xmodule/xmodule/css/capa/display.scss
+24
-2
lms/djangoapps/lms_migration/migrate.py
+4
-4
lms/templates/portal/course_about.html
+1
-1
No files found.
common/lib/capa/capa/inputtypes.py
View file @
d3cd85d8
...
...
@@ -470,9 +470,9 @@ def math(element, value, status, render_template, msg=''):
xhtml
=
etree
.
XML
(
html
)
except
Exception
as
err
:
if
False
:
# TODO needs to be self.system.DEBUG - but can't access system
msg
=
"<html><font color='red'><p>Error
%
s</p>"
%
str
(
err
)
.
replace
(
'<'
,
'<'
)
msg
=
'<html><div class="inline-error"><p>Error
%
s</p>'
%
str
(
err
)
.
replace
(
'<'
,
'<'
)
msg
+=
'<p>Failed to construct math expression from <pre>
%
s</pre></p>'
%
html
.
replace
(
'<'
,
'<'
)
msg
+=
"</
font
></html>"
msg
+=
"</
div
></html>"
log
.
error
(
msg
)
return
etree
.
XML
(
msg
)
else
:
...
...
common/lib/capa/capa/responsetypes.py
View file @
d3cd85d8
...
...
@@ -886,7 +886,7 @@ def sympy_check2():
if
len
(
idset
)
==
1
and
not
submission
[
0
]:
# default to no error message on empty answer (to be consistent with other responsetypes)
# but allow author to still have the old behavior by setting empty_answer_err attribute
msg
=
'<
font color="red">No answer entered!</font
>'
if
self
.
xml
.
get
(
'empty_answer_err'
)
else
''
msg
=
'<
span class="inline-error">No answer entered!</span
>'
if
self
.
xml
.
get
(
'empty_answer_err'
)
else
''
return
CorrectMap
(
idset
[
0
],
'incorrect'
,
msg
=
msg
)
# NOTE: correct = 'unknown' could be dangerous. Inputtypes such as textline are not expecting 'unknown's
...
...
@@ -1223,7 +1223,7 @@ class CodeResponse(LoncapaResponse):
return
oldcmap
def
get_answers
(
self
):
anshtml
=
'<
font color="blue"><span class="code-answer"><br/><pre>
%
s</pre><br/></span></font
>'
%
self
.
answer
anshtml
=
'<
span class="code-answer"><pre><code>
%
s</code></pre></span
>'
%
self
.
answer
return
{
self
.
answer_id
:
anshtml
}
def
get_initial_display
(
self
):
...
...
@@ -1400,7 +1400,7 @@ main()
log
.
error
(
'Error
%
s'
%
err
)
if
self
.
system
.
DEBUG
:
cmap
.
set_dict
(
dict
(
zip
(
sorted
(
self
.
answer_ids
),
[
'incorrect'
]
*
len
(
idset
))))
cmap
.
set_property
(
self
.
answer_ids
[
0
],
'msg'
,
'<
font color="red" size="+2">
%
s</font
>'
%
str
(
err
)
.
replace
(
'<'
,
'<'
))
cmap
.
set_property
(
self
.
answer_ids
[
0
],
'msg'
,
'<
span class="inline-error">
%
s</span
>'
%
str
(
err
)
.
replace
(
'<'
,
'<'
))
return
cmap
ad
=
rxml
.
find
(
'awarddetail'
)
.
text
...
...
@@ -1429,7 +1429,7 @@ main()
except
Exception
as
err
:
log
.
error
(
'Error
%
s'
%
err
)
if
self
.
system
.
DEBUG
:
msg
=
'<
font color=red size=+2>
%
s</font
>'
%
str
(
err
)
.
replace
(
'<'
,
'<'
)
msg
=
'<
span class="inline-error">
%
s</span
>'
%
str
(
err
)
.
replace
(
'<'
,
'<'
)
exans
=
[
''
]
*
len
(
self
.
answer_ids
)
exans
[
0
]
=
msg
...
...
common/lib/capa/capa/templates/optioninput.html
View file @
d3cd85d8
<form
class=
"option-input"
>
<select
name=
"input_${id}"
id=
"input_${id}"
>
<option
value=
"option_${id}_dummy_default"
>
</option>
% for option_id, option_description in options:
...
...
common/lib/xmodule/xmodule/capa_module.py
View file @
d3cd85d8
...
...
@@ -155,8 +155,8 @@ class CapaModule(XModule):
msg
=
'<p>
%
s</p>'
%
msg
.
replace
(
'<'
,
'<'
)
msg
+=
'<p><pre>
%
s</pre></p>'
%
traceback
.
format_exc
()
.
replace
(
'<'
,
'<'
)
# create a dummy problem with error message instead of failing
problem_text
=
(
'<problem><text><
font color="red" size="+2
">'
'Problem
%
s has an error:</
font
>
%
s</text></problem>'
%
problem_text
=
(
'<problem><text><
span class="inline-error
">'
'Problem
%
s has an error:</
span
>
%
s</text></problem>'
%
(
self
.
location
.
url
(),
msg
))
self
.
lcp
=
LoncapaProblem
(
problem_text
,
self
.
location
.
html_id
(),
...
...
common/lib/xmodule/xmodule/css/capa/display.scss
View file @
d3cd85d8
...
...
@@ -16,6 +16,9 @@ h2 {
}
}
.inline-error
{
color
:
darken
(
$error-red
,
10%
);
}
section
.problem
{
@media
print
{
...
...
@@ -134,11 +137,19 @@ section.problem {
div
.equation
{
clear
:
both
;
padding
:
6px
;
background
:
#eee
;
margin-top
:
3px
;
span
{
margin-bottom
:
0
;
&
.math
{
padding
:
6px
;
background
:
#f1f1f1
;
border
:
1px
solid
#e3e3e3
;
@include
inline-block
;
@include
border-radius
(
4px
);
min-width
:
300px
;
}
}
}
...
...
@@ -226,6 +237,15 @@ section.problem {
}
}
form
.option-input
{
margin
:
-10px
0
20px
;
padding-bottom
:
20px
;
border-bottom
:
1px
solid
#e3e3e3
;
select
{
margin-right
:
flex-gutter
();
}
}
ul
{
list-style
:
disc
outside
none
;
...
...
@@ -393,6 +413,8 @@ section.problem {
}
section
.action
{
margin-top
:
20px
;
input
.save
{
@extend
.blue-button
;
}
...
...
lms/djangoapps/lms_migration/migrate.py
View file @
d3cd85d8
...
...
@@ -70,9 +70,9 @@ def manage_modulestores(request,reload_dir=None):
if
reload_dir
is
not
None
:
if
reload_dir
not
in
def_ms
.
courses
:
html
+=
"<h2><font color='red'>Error: '
%
s' is not a valid course directory</font></h2>"
%
reload_dir
html
+=
'<h2 class="inline-error">Error: "
%
s" is not a valid course directory</h2>'
%
reload_dir
else
:
html
+=
"<h2><font color='blue'>Reloaded course directory '
%
s'</font></h2>"
%
reload_dir
html
+=
'<h2>Reloaded course directory "
%
s"</h2>'
%
reload_dir
def_ms
.
try_load_course
(
reload_dir
)
#----------------------------------------
...
...
@@ -179,9 +179,9 @@ def gitreload(request, reload_dir=None):
if
reload_dir
is
not
None
:
def_ms
=
modulestore
()
if
reload_dir
not
in
def_ms
.
courses
:
html
+=
"<h2><font color='red'>Error: '
%
s' is not a valid course directory</font></h2>"
%
reload_dir
html
+=
'<h2 class="inline-error">Error: "
%
s" is not a valid course directory</font></h2>'
%
reload_dir
else
:
html
+=
"<h2>
<font color='blue'>Reloaded course directory '
%
s'</font>
</h2>"
%
reload_dir
html
+=
"<h2>
Reloaded course directory '
%
s'
</h2>"
%
reload_dir
def_ms
.
try_load_course
(
reload_dir
)
track
.
views
.
server_track
(
request
,
'reloaded
%
s'
%
reload_dir
,
{},
page
=
'migrate'
)
...
...
lms/templates/portal/course_about.html
View file @
d3cd85d8
...
...
@@ -21,7 +21,7 @@
if
(
json
.
success
)
{
location
.
href
=
"${reverse('dashboard')}"
;
}
else
{
$
(
'#register_message'
).
html
(
"<p><font color='red'>"
+
json
.
error
+
"</font>
</p>"
);
$
(
'#register_message'
).
html
(
'<p class="inline-error">'
+
json
.
error
+
"
</p>"
);
}
});
})(
this
)
...
...
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