From a9f624115c0f5a08ad95c0c9fe547c777e824bed Mon Sep 17 00:00:00 2001 From: Kyle Fiedler Date: Thu, 23 Aug 2012 10:10:13 -0400 Subject: [PATCH 1/6] Added styles for hints --- .../lib/xmodule/xmodule/css/capa/display.scss | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/common/lib/xmodule/xmodule/css/capa/display.scss b/common/lib/xmodule/xmodule/css/capa/display.scss index e6ebdb316f..e7b2250f02 100644 --- a/common/lib/xmodule/xmodule/css/capa/display.scss +++ b/common/lib/xmodule/xmodule/css/capa/display.scss @@ -280,4 +280,42 @@ section.problem { @extend .blue-button; } } + + .hints { + border: 1px solid #ccc; + + h3 { + border-bottom: 1px solid #e3e3e3; + text-shadow: 0 1px 0 #fff; + padding: 9px; + background: #eee; + font-weight: bold; + font-size: em(16); + } + + div { + border-bottom: 1px solid #ddd; + + &:last-child { + border-bottom: none; + } + + p { + margin-bottom: 0; + } + + header { + a { + display: block; + padding: 9px; + background: #f3f3f3; + @include box-shadow(inset 0 0 0 1px #fff); + } + } + + section { + padding: 9px; + } + } + } } From 3be48e5012e0bdffd94f510128f5d5f035ae9555 Mon Sep 17 00:00:00 2001 From: Kyle Fiedler Date: Thu, 23 Aug 2012 16:12:09 -0400 Subject: [PATCH 2/6] Formatted new hints and testing blocks --- common/lib/capa/capa/templates/textbox.html | 67 +++++---- .../lib/xmodule/xmodule/css/capa/display.scss | 130 +++++++++++++++++- 2 files changed, 169 insertions(+), 28 deletions(-) diff --git a/common/lib/capa/capa/templates/textbox.html b/common/lib/capa/capa/templates/textbox.html index 19c43482a8..7800e6031e 100644 --- a/common/lib/capa/capa/templates/textbox.html +++ b/common/lib/capa/capa/templates/textbox.html @@ -7,26 +7,28 @@ - % if state == 'unsubmitted': - - % elif state == 'correct': - - % elif state == 'incorrect': - - % elif state == 'queued': - - - % endif - % if hidden: -
- % endif -
- -
- ${msg|n} -
+
+ % if state == 'unsubmitted': + Unanswered + % elif state == 'correct': + Correct + % elif state == 'incorrect': + Incorrect + % elif state == 'queued': + Queued + + % endif -
+ % if hidden: +
+ % endif + +

${state}

+
+ +
+ ${msg|n} +
- diff --git a/common/lib/xmodule/xmodule/css/capa/display.scss b/common/lib/xmodule/xmodule/css/capa/display.scss index e7b2250f02..cca951ce08 100644 --- a/common/lib/xmodule/xmodule/css/capa/display.scss +++ b/common/lib/xmodule/xmodule/css/capa/display.scss @@ -16,6 +16,7 @@ h2 { } } + section.problem { @media print { display: block; @@ -171,6 +172,30 @@ section.problem { top: 6px; } } + + .grader-status { + padding: 9px; + background: #F6F6F6; + border: 1px solid #ddd; + border-top: 0; + margin-bottom: 20px; + @include clearfix; + + span { + text-indent: -9999px; + overflow: hidden; + display: block; + float: left; + margin: -7px 7px 0 0; + } + + p { + line-height: 20px; + text-transform: capitalize; + margin-bottom: 0; + float: left; + } + } } ul { @@ -246,6 +271,69 @@ section.problem { } + code { + margin: 0 2px; + padding: 0px 5px; + white-space: nowrap; + border: 1px solid #EAEAEA; + background-color: #F8F8F8; + @include border-radius(3px); + font-size: .9em; + } + + pre { + background-color: #F8F8F8; + border: 1px solid #CCC; + font-size: .9em; + line-height: 1.4; + overflow: auto; + padding: 6px 10px; + @include border-radius(3px); + + > code { + margin: 0; + padding: 0; + white-space: pre; + border: none; + background: transparent; + } + } + + .CodeMirror { + border: 1px solid black; + font-size: 14px; + line-height: 18px; + resize: both; + + pre { + @include border-radius(0); + border-radius: 0; + border-width: 0; + margin: 0; + padding: 0; + background: transparent; + font-family: inherit; + font-size: inherit; + white-space: pre; + word-wrap: normal; + overflow: hidden; + resize: none; + + &.CodeMirror-cursor { + z-index: 10; + position: absolute; + visibility: hidden; + border-left: 1px solid black; + border-right: none; + width: 0; + } + } + } + + .CodeMirror-focused pre.CodeMirror-cursor { + visibility: visible; + } + hr { background: #ddd; border: none; @@ -308,7 +396,7 @@ section.problem { a { display: block; padding: 9px; - background: #f3f3f3; + background: #F6F6F6; @include box-shadow(inset 0 0 0 1px #fff); } } @@ -318,4 +406,44 @@ section.problem { } } } + + .test { + border-top: 1px solid #aaa; + padding-top: 18px; + + header { + margin-bottom: 12px; + } + + .shortform, .longform { + border: 1px solid #d3d3d3; + padding: 9px; + margin-bottom: 12px; + @include box-shadow(inset 0 0 0 1px #f3f3f3); + + p:last-of-type { + margin-bottom: 0; + } + } + + a.full { + @include position(absolute, 0 0 0px 0px); + font-size: .8em; + padding: 4px; + text-align: right; + width: 100%; + display: block; + background: #F3F3F3; + @include box-sizing(border-box); + } + + .longform { + position: relative; + padding-bottom: 20px; + } + + .longform-header { + margin-bottom: lh(); + } + } } From bc288424a4cfd808be7575519d1f9e5a13e6ed39 Mon Sep 17 00:00:00 2001 From: Kyle Fiedler Date: Thu, 30 Aug 2012 15:22:27 -0400 Subject: [PATCH 3/6] Rework styles for test results and style file upload --- .../capa/capa/templates/filesubmission.html | 19 ++++---- .../lib/xmodule/xmodule/css/capa/display.scss | 45 ++++++++++++++++--- .../xmodule/js/src/capa/display.coffee | 2 +- 3 files changed, 49 insertions(+), 17 deletions(-) diff --git a/common/lib/capa/capa/templates/filesubmission.html b/common/lib/capa/capa/templates/filesubmission.html index e9fd7c5674..630a3222dc 100644 --- a/common/lib/capa/capa/templates/filesubmission.html +++ b/common/lib/capa/capa/templates/filesubmission.html @@ -1,17 +1,18 @@
-
+
% if state == 'unsubmitted': - + Unanswered % elif state == 'correct': - + Correct % elif state == 'incorrect': - + Incorrect % elif state == 'queued': - + Queued % endif - -
- ${msg|n} -
+

${state}

+ + +
+
${msg|n}
diff --git a/common/lib/xmodule/xmodule/css/capa/display.scss b/common/lib/xmodule/xmodule/css/capa/display.scss index cca951ce08..16c8de41ac 100644 --- a/common/lib/xmodule/xmodule/css/capa/display.scss +++ b/common/lib/xmodule/xmodule/css/capa/display.scss @@ -195,9 +195,31 @@ section.problem { margin-bottom: 0; float: left; } + + &.file { + background: #FFF; + margin-top: 20px; + padding: 20px 0 0 0; + + border: { + top: 1px solid #eee; + right: 0; + bottom: 0; + left: 0; + } + + p.debug { + display: none; + } + + input { + float: left; + } + } } } + ul { list-style: disc outside none; margin-bottom: lh(); @@ -408,18 +430,27 @@ section.problem { } .test { - border-top: 1px solid #aaa; padding-top: 18px; header { margin-bottom: 12px; + + h3 { + font-size: 0.9em; + font-weight: bold; + font-style: normal; + text-transform: uppercase; + color: #AAA; + } } - .shortform, .longform { - border: 1px solid #d3d3d3; + .longform, .shortform { + border: 1px solid #ddd; padding: 9px; - margin-bottom: 12px; - @include box-shadow(inset 0 0 0 1px #f3f3f3); + margin-bottom: 10px; + background: #FFF; + @include box-shadow(inset 0 0 0 1px #eee); + @include border-radius(3px); p:last-of-type { margin-bottom: 0; @@ -427,7 +458,7 @@ section.problem { } a.full { - @include position(absolute, 0 0 0px 0px); + @include position(absolute, 0 0 1px 0px); font-size: .8em; padding: 4px; text-align: right; @@ -443,7 +474,7 @@ section.problem { } .longform-header { - margin-bottom: lh(); + margin-bottom: .6em; } } } diff --git a/common/lib/xmodule/xmodule/js/src/capa/display.coffee b/common/lib/xmodule/xmodule/js/src/capa/display.coffee index 0ea6cffb58..24363735ae 100644 --- a/common/lib/xmodule/xmodule/js/src/capa/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/capa/display.coffee @@ -264,7 +264,7 @@ class @Problem alert_elem = "
" + msg + "
" @el.find('.action').after(alert_elem) @el.find('.capa_alert').animate(opacity: 0, 500).animate(opacity: 1, 500) - + save: => Logger.log 'problem_save', @answers $.postWithPrefix "#{@url}/problem_save", @answers, (response) => From 1939b001e4c194b39a8717a4e0b85d4874ac1aa0 Mon Sep 17 00:00:00 2001 From: Kyle Fiedler Date: Thu, 30 Aug 2012 16:24:02 -0400 Subject: [PATCH 4/6] Added better animation in --- common/lib/xmodule/xmodule/css/capa/display.scss | 9 +++++++++ common/lib/xmodule/xmodule/js/src/capa/display.coffee | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/css/capa/display.scss b/common/lib/xmodule/xmodule/css/capa/display.scss index 16c8de41ac..e171d35513 100644 --- a/common/lib/xmodule/xmodule/css/capa/display.scss +++ b/common/lib/xmodule/xmodule/css/capa/display.scss @@ -391,6 +391,15 @@ section.problem { } } + div.capa_alert { + padding: 8px 12px; + border: 1px solid #EBE8BF; + border-radius: 3px; + background: #FFFCDD; + font-size: 0.9em; + margin-top: 10px; + } + .hints { border: 1px solid #ccc; diff --git a/common/lib/xmodule/xmodule/js/src/capa/display.coffee b/common/lib/xmodule/xmodule/js/src/capa/display.coffee index 24363735ae..098b79d9cf 100644 --- a/common/lib/xmodule/xmodule/js/src/capa/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/capa/display.coffee @@ -263,7 +263,7 @@ class @Problem @el.find('.capa_alert').remove() alert_elem = "
" + msg + "
" @el.find('.action').after(alert_elem) - @el.find('.capa_alert').animate(opacity: 0, 500).animate(opacity: 1, 500) + @el.find('.capa_alert').css(opacity: 0).animate(opacity: 1, 700) save: => Logger.log 'problem_save', @answers From e6f9f8d9b0b6fc6b8a3b7d8f0abd8296b225ff6c Mon Sep 17 00:00:00 2001 From: Kyle Fiedler Date: Fri, 31 Aug 2012 11:15:06 -0400 Subject: [PATCH 5/6] Add js to the problem and move around that css and js to accomodate Tonys new HTML Structure --- .../lib/xmodule/xmodule/css/capa/display.scss | 36 +++++++++---------- lms/templates/problem.html | 24 +++++++++++++ 2 files changed, 40 insertions(+), 20 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/capa/display.scss b/common/lib/xmodule/xmodule/css/capa/display.scss index e171d35513..a368167448 100644 --- a/common/lib/xmodule/xmodule/css/capa/display.scss +++ b/common/lib/xmodule/xmodule/css/capa/display.scss @@ -453,37 +453,33 @@ section.problem { } } - .longform, .shortform { + > section { border: 1px solid #ddd; - padding: 9px; + padding: 9px 9px 20px; margin-bottom: 10px; background: #FFF; + position: relative; @include box-shadow(inset 0 0 0 1px #eee); @include border-radius(3px); p:last-of-type { margin-bottom: 0; } - } - a.full { - @include position(absolute, 0 0 1px 0px); - font-size: .8em; - padding: 4px; - text-align: right; - width: 100%; - display: block; - background: #F3F3F3; - @include box-sizing(border-box); - } + .shortform { + margin-bottom: .6em; + } - .longform { - position: relative; - padding-bottom: 20px; - } - - .longform-header { - margin-bottom: .6em; + a.full { + @include position(absolute, 0 0 1px 0px); + font-size: .8em; + padding: 4px; + text-align: right; + width: 100%; + display: block; + background: #F3F3F3; + @include box-sizing(border-box); + } } } } diff --git a/lms/templates/problem.html b/lms/templates/problem.html index ed49b3bd5d..65b8193df9 100644 --- a/lms/templates/problem.html +++ b/lms/templates/problem.html @@ -32,3 +32,27 @@ +<%block name="js_extra"> + + From 440539c081b1686aaeca6855d043e97e1c9295b4 Mon Sep 17 00:00:00 2001 From: Kyle Fiedler Date: Fri, 31 Aug 2012 13:27:32 -0400 Subject: [PATCH 6/6] Removed js from textbox --- common/lib/capa/capa/templates/textbox.html | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/common/lib/capa/capa/templates/textbox.html b/common/lib/capa/capa/templates/textbox.html index 7800e6031e..271d7795e0 100644 --- a/common/lib/capa/capa/templates/textbox.html +++ b/common/lib/capa/capa/templates/textbox.html @@ -45,25 +45,6 @@ indentWithTabs: true, smartIndent: false }); - - // this should be brought back into problems - $('.longform-body').hide(); - $('.longform-header').append('See full output'); - - $('.full').click(function() { - $(this).parent().siblings().slideToggle(); - $(this).parent().parent().toggleClass('open'); - var text = $(this).text() == 'See full output' ? 'Hide output' : 'See full output'; - $(this).text(text); - return false; - }); - - $('.collapsible section').hide() - $('.collapsible header a').click(function() { - $(this).parent().siblings().slideToggle(); - $(this).parent().parent().toggleClass('open'); - return false - }); });