From a5e2b5c53a5c71282b6a6a4eb8fbaee5928b32c8 Mon Sep 17 00:00:00 2001 From: Brian Talbot Date: Fri, 15 Feb 2013 14:10:52 -0500 Subject: [PATCH] resolving merge conflict and missing Sass mixin --- .../contentstore/tests/test_contentstore.py | 6 +- cms/djangoapps/contentstore/views.py | 2 +- cms/static/img/html-icon.png | Bin 1400 -> 581 bytes cms/static/img/large-discussion-icon.png | Bin 1492 -> 737 bytes cms/static/img/large-freeform-icon.png | Bin 1193 -> 412 bytes cms/static/img/large-problem-icon.png | Bin 1522 -> 797 bytes cms/static/img/large-video-icon.png | Bin 994 -> 234 bytes cms/static/sass/_cms_mixins.scss | 7 + cms/static/sass/_reset.scss | 114 +++++++++++++ cms/static/sass/_unit.scss | 153 ++++++++++++++---- cms/templates/unit.html | 102 ++++++++---- cms/templates/widgets/problem-edit.html | 18 +-- common/lib/xmodule/xmodule/capa_module.py | 10 +- common/lib/xmodule/xmodule/html_module.py | 7 + .../js/src/videoalpha/display/html5_video.js | 9 ++ .../xmodule/xmodule/templates/html/empty.yaml | 3 +- .../templates/problem/circuitschematic.yaml | 3 +- .../templates/problem/customgrader.yaml | 4 +- .../xmodule/templates/problem/empty.yaml | 3 +- .../templates/problem/emptyadvanced.yaml | 13 ++ .../templates/problem/forumularesponse.yaml | 4 +- .../templates/problem/imageresponse.yaml | 4 +- .../templates/problem/multiplechoice.yaml | 6 - .../templates/problem/numericalresponse.yaml | 6 +- .../templates/problem/optionresponse.yaml | 16 +- .../templates/problem/string_response.yaml | 10 +- 26 files changed, 390 insertions(+), 110 deletions(-) create mode 100644 common/lib/xmodule/xmodule/templates/problem/emptyadvanced.yaml diff --git a/cms/djangoapps/contentstore/tests/test_contentstore.py b/cms/djangoapps/contentstore/tests/test_contentstore.py index 25f132ec4b..a4ce54f950 100644 --- a/cms/djangoapps/contentstore/tests/test_contentstore.py +++ b/cms/djangoapps/contentstore/tests/test_contentstore.py @@ -401,11 +401,11 @@ class ContentStoreTest(ModuleStoreTestCase): def test_capa_module(self): """Test that a problem treats markdown specially.""" - CourseFactory.create(org='MITx', course='999', display_name='Robot Super Course') + course = CourseFactory.create(org='MITx', course='999', display_name='Robot Super Course') problem_data = { 'parent_location': 'i4x://MITx/999/course/Robot_Super_Course', - 'template': 'i4x://edx/templates/problem/Empty' + 'template': 'i4x://edx/templates/problem/Blank_Common_Problem' } resp = self.client.post(reverse('clone_item'), problem_data) @@ -429,7 +429,7 @@ class TemplateTestCase(ModuleStoreTestCase): # insert a bogus template in the store bogus_template_location = Location('i4x', 'edx', 'templates', 'html', 'bogus') - source_template_location = Location('i4x', 'edx', 'templates', 'html', 'Empty') + source_template_location = Location('i4x', 'edx', 'templates', 'html', 'Blank_HTML_Page') ms.clone_item(source_template_location, bogus_template_location) diff --git a/cms/djangoapps/contentstore/views.py b/cms/djangoapps/contentstore/views.py index c1ba0f5f9a..b3bb134e3d 100644 --- a/cms/djangoapps/contentstore/views.py +++ b/cms/djangoapps/contentstore/views.py @@ -278,7 +278,7 @@ def edit_unit(request, location): template.display_name, template.location.url(), 'markdown' in template.metadata, - template.location.name == 'Empty' + 'empty' in template.metadata )) components = [ diff --git a/cms/static/img/html-icon.png b/cms/static/img/html-icon.png index e739f2fc11a7395d390d266ceb77cb1ea5b32ea5..8f576178b2208e2b9a7efd3e08f60129f93d6238 100644 GIT binary patch delta 556 zcmV+{0@MBY3dIDFB!2{RLP=Bz2nYy#2xN!=000SaNLh0L01FZT01FZU(%pXi0000S zbVXQnQ*UN;cVTj606}DLVr3vkX>w(EZ*psMAVX6&=)AIw0005MNklwxpCA5MLkIAGFp{6h)g#shuq7)PsRLbBAJIG_Xwl>bJ2##oF61j2771ih&7_ z?3u`2i~SA91%Ks7Ctv~Yf!>sCH}EBLD`I8}_zZ$Bf;IUiM^--1VbDdfrsGs(Z-1H1 zj}C%p=g1Ccz|MGML!f~pk$Fr!CO!*s0000DSr z1<%~X^wgl##FWaylc_cg49qH-ArU1JzCKpT`MG+DAT@dwxdlMo3=B5*6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4>xZMKLn}WqH5PulC;nb@Sbc{YIYLTKECIn1BASOKF0y*%cpPC0u??u3b z-DAADh=GC0&C|s(q~g|=>*u{g0!0pdoOv?-uYyeGl1;a^X}FrZa!HCz%w4p=bw^<; zx2qCU;Y61gN*x|sT>m?CPy5R(*r@PV$vjHT?a2(`pcc`#$FHj&+E~QCt37x5yIxH~ z+P&G;=l1-5eCH&a}uA2#;bJ_OZc-H-xyH2XuvFNR-RqV!1*JKR(e~aav%D#JQ#u06wABW=k9IEJUwB{OOSJjFLkz2uS;}4> z5?}q^&bqPr$J#uNg}L30Tba~C|7&Ml;_O-3ojS+Epkf8%{E#`jtr{2Y`k>MJV4=3w zx#tFrd$0YN<7wC!wPsaBuVtj&F5R?C*{dVM-hWnW%)jRQJJ=_o{mR4*wdXwso_S7G|#sBVQXaPt4m7}RL{suqn_JsVMZTq}ouP|T4>VqmK z9lLZ{%(gz8l#{dT>+e+$Taw?$-Eetu_r)=8_j-P_Rc*==n^q-WGhTV?X+ZL-M7gsW z&h2xi{Ijk~5IG!p)u80usas#U<&RtN*BrTN!9K~yg~|QnxrVeVe|mmT`;XZrrN7hzopr0LncycK`qY diff --git a/cms/static/img/large-freeform-icon.png b/cms/static/img/large-freeform-icon.png index b1d195a7ca01e951981ce49a0c85e719e642f026..0d5e454f58043ee0d6e93201427994d9f53b94f9 100644 GIT binary patch delta 385 zcmV-{0e=3e37i9vB!2{RLP=Bz2nYy#2xN!=000SaNLh0L01FZT01FZU(%pXi0000S zbVXQnQ*UN;cVTj606}DLVr3vkX>w(EZ*psMAVX6&=)AIw0003NNklk z7H?~Ey;{<+=XwT2oD-N>pM3r42E&t8XO|%V0ekfDJVSeJ7z4vdxe literal 1193 zcmeAS@N?(olHy`uVBq!ia0vp^N8U}fi7AzZCsS=07?@QuLn2Bde0{8v^Kf6`()~Xj@TAnpKdC8`Lf!&sHg;q@=(~U%$M( zT(8_%FTW^V-_X+15@d#vkuFe$ZgFK^Nn(X=Ua>OF1ees}+T7#d8#0MoBXEYLU9GXQxBrqI_HztY@Xxa#7Ppj3o=u^L<)Qdy9y zACy|0Us{w5jJPyqkW~d%&PAz-CHX}m`T04pPz=b(FUc>?$S+WE4mMNJ@J&q4%mWE% zf_3=%T6yLbmn7yTr+T{BDgn*V%gju%axyeCGIcX_adUEUH8gZJbh31Db2K+JGO~0w zFf}zdg6Vb1PcF?(%`1WFO+n~&#iP^Az7H6D#^?{Dj2SqJXRKtXT=?BDwCtM&0p7c}mfa$#mn6QP?&H%FoqqL`sV@SoV zHKB}xhZT6I4dtL zowCb5(NF$1d<*aP(aX2xb@q3d@@1kq6lJ`Z7#6ur@KE15Lu6EaAQ{;)JQL1 zSO4r+$!p;dJo$Y<0Q1!MULm2kmWTXV_*C}cqOJ~&Z7ZFYME%kAJ-aw#g@}8a?-_sR z(*LJVF1x$!PCZ{W!@B)tXY+ThcU3W&6nfLUfsw&r={LSzi}aj9g@>oBpUXO@geCwE Cd6y9Y diff --git a/cms/static/img/large-problem-icon.png b/cms/static/img/large-problem-icon.png index b962d42b148073a89b56f5535548aef6d5ff00ca..a30ab8eac880122c7cc0e9d54a86b8b80f07bc3e 100644 GIT binary patch delta 773 zcmV+g1N!{(3!Mg#B!2{RLP=Bz2nYy#2xN!=000SaNLh0L01FZT01FZU(%pXi0000S zbVXQnQ*UN;cVTj606}DLVr3vkX>w(EZ*psMAVX6&=)AIw0007)NklxfOZp;R410V;THSlYeuyL(;g3uVxuL=XND6OL{G7 z#-)(-#7iw_NW3)TN=ZrWZQ@IoacVvjnBI+X3_hFjh-fW~1DUh{fU$JXEQT|3`%O+= zz+W@b(T3@4V1H+GILA1ZF)-~J9s<`3@LG)P=6CQa3kbY2oLbiMdYnGPIp~nIW8&wF z7)$CkpH(mM)C~c!=xK#ppLDW|q<%58*aj+X7*@PJ1$alS*-HbRoNW34 zHh|l}2&Tf3oR4xE+X(Ph$!l-D2bkh)4SgNB8PLuDj3GIJ4}qgL439`oeejBH8oRjl zadNk$OG-Z4%1Y{Pb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{%|zyv-mMp_U0_x{-}#?^Uv6_t4|I;7&zY(yT{YEXb@Lz3iYblj50b$ lYj6C4^n&E*59=A28Q#q+&t7+SQ5&cf_H^}gS?83{1OTJ-KurJu diff --git a/cms/static/img/large-video-icon.png b/cms/static/img/large-video-icon.png index 392851324cfeb9daf1d4efbaff488cfb4545f3ae..f1ab048b4c4248ed8afb9a221472b45f07519502 100644 GIT binary patch delta 206 zcmaFF{)%yeNrMq>1fPyk5t`Q}{`DrEP ziAAXljw$&`sS0kHMXBZaMcKs)&cS9c_H60_s!Q>7aSZY3d^RsGM??;lWo{&v(-6{JW(v#y}-py}avx22xWz8_TS zn6^(-eV<*(!JM$G+f9<{ywCsUUmYWV%A@v1Z_GpX!zvciVf)=I(!_wq!4O{YJ@@BKS zivtl4idR9sc<|@W~P2VV53mtA)ncyb`jm#*zRbcQ7Fy^rtr`+nb__iS$V-tgd! zL55+5%O$-+*D?BC8|bJ1qt|bC=yIJDYGfX-kfs?RCTrt50%g}+MHOV)n-309hG8z< zcB(Z}GiFo^yPO&OaFOd%G{a=3Bj2>v5CL_x>UbJ^ytmH+$JW>d$q)=bj~Y&CD?syG zvsG(r%~EW3dJ1GBl@hp!m>_c3y-d4axi0;W_+R>d@EKP-(F*ehy9FScXRlg2g(@l~F0Hk({C$>Cs? zhl--a9HN+@9*J<%BW9HF!toA+jzTMNeBxja#EfPgZxD^8O3zYo{VuH+w#!5d#z&^l zLr#cO>Npz4|6N_T>m8B`I@jBiIIM2^h_9d!Zv+-?+{$gLGFcF9{Bd9gikWtmwTyed5Ue0V>;b>+gW{vo%#^A~U+I@JIG diff --git a/cms/static/sass/_cms_mixins.scss b/cms/static/sass/_cms_mixins.scss index e9bfa92298..b8d9a8ae2e 100644 --- a/cms/static/sass/_cms_mixins.scss +++ b/cms/static/sass/_cms_mixins.scss @@ -285,4 +285,11 @@ padding: 0; position: absolute; width: 1px; +} + +@mixin active { + @include linear-gradient(top, rgba(255, 255, 255, .4), rgba(255, 255, 255, 0)); + background-color: rgba(255, 255, 255, .3); + @include box-shadow(0 -1px 0 rgba(0, 0, 0, .2) inset, 0 1px 0 #fff inset); + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); } \ No newline at end of file diff --git a/cms/static/sass/_reset.scss b/cms/static/sass/_reset.scss index 6b4b653e87..ee03a0fca3 100644 --- a/cms/static/sass/_reset.scss +++ b/cms/static/sass/_reset.scss @@ -54,4 +54,118 @@ del { table { border-collapse: collapse; border-spacing: 0; +} + +/* Reset styles to remove ui-lightness jquery ui theme +from the tabs component (used in the add component problem tab menu) +*/ + +.ui-tabs { + padding: 0; + white-space: normal; +} + +.ui-corner-all, .ui-corner-bottom, .ui-corner-left, ui-corner-top, .ui-corner-br, .ui-corner-right { + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; + border-top-right-radius: 0; + border-top-left-radius: 0; +} + + +.ui-widget-content { + border: 0; + background: none; +} +.ui-widget { + font-family: 'Open Sans', sans-serif; + font-size: 16px; +} + +.ui-widget-header { + border:none; + background: none; +} + +.ui-tabs .ui-tabs-nav { + padding: 0; +} + +.ui-tabs .ui-tabs-nav li { + margin: 0; + padding: 0; + border: none; + top: 0; + margin: 0; + float: none; + border-top-left-radius: 0; + border-top-right-radius: 0; +} + +.ui-tabs-nav { + + li { + top: 0; + margin: 0; + } + a { + float: none; + font-weight: normal; + } +} + +.ui-tabs .ui-tabs-panel { + padding: 0; +} + +/* reapplying the tab styles from unit.scss after +removing jquery ui ui-lightness styling +*/ + +.problem-type-tabs { + border:none; + list-style-type: none; + width: 100%; + @include linear-gradient(top, rgba(255, 255, 255, .4), rgba(255, 255, 255, 0)); + //background-color: $lightBluishGrey; + @include box-shadow(0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 -1px 0 rgba(0, 0, 0, 0.2) inset); + + li:first-child { + margin-left: 20px; + } + li { + opacity: .8; + + &:ui-state-active { + background-color: rgba(255, 255, 255, .3); + opacity: 1; + font-weight: 400; + } + a:focus { + outline: none; + border: 0px; + } + } +/* + li { + float:left; + display:inline-block; + text-align:center; + width: auto; + //@include linear-gradient(top, rgba(255, 255, 255, .4), rgba(255, 255, 255, 0)); + //background-color: tint($lightBluishGrey, 20%); + //@include box-shadow(0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 -1px 0 rgba(0, 0, 0, 0.2) inset); + opacity:.8; + + &:hover { + opacity:1; + } + + &.current { + border: 0px; + //@include active; + opacity:1; + } + } +*/ } \ No newline at end of file diff --git a/cms/static/sass/_unit.scss b/cms/static/sass/_unit.scss index 66a0dfaaa8..b7600e4205 100644 --- a/cms/static/sass/_unit.scss +++ b/cms/static/sass/_unit.scss @@ -3,6 +3,12 @@ margin: 40px; } +//Problem Selector tab menu requirements +.js .tabs .tab { + display: none; +} +//end problem selector reqs + .main-column { clear: both; float: left; @@ -58,6 +64,7 @@ margin: 20px 40px; + .title { margin: 0 0 15px 0; color: $mediumGrey; @@ -67,22 +74,25 @@ } &.new-component-item { - padding: 20px; - border: none; - border-radius: 3px; - background: $lightGrey; + margin: 20px 0px; + border-top: 1px solid $mediumGrey; + box-shadow: 0 2px 1px rgba(182, 182, 182, 0.75) inset; + background-color: $lightGrey; + margin-bottom: 0px; + padding-bottom: 20px; .new-component-button { display: block; padding: 20px; text-align: center; - color: #6d788b; + color: #edf1f5; } h5 { - margin-bottom: 8px; + margin: 20px 0px; color: #fff; - font-weight: 700; + font-weight: 600; + font-size: 18px; } .rendered-component { @@ -92,18 +102,21 @@ } .new-component-type { + a, li { display: inline-block; } a { + border: 1px solid $mediumGrey; width: 100px; height: 100px; - margin-right: 10px; - margin-bottom: 10px; + color: #fff; + margin-right: 15px; + margin-bottom: 20px; border-radius: 8px; - font-size: 13px; + font-size: 15px; line-height: 14px; text-align: center; @include box-shadow(0 1px 1px rgba(0, 0, 0, .2), 0 1px 0 rgba(255, 255, 255, .4) inset); @@ -115,25 +128,40 @@ width: 100%; padding: 10px; @include box-sizing(border-box); + color: #fff; } } } .new-component-templates { display: none; - padding: 20px; + margin: 20px 40px 20px 40px; + border-radius: 3px; + border: 1px solid $mediumGrey; + background-color: #fff; + @include box-shadow(0 1px 1px rgba(0, 0, 0, .2), 0 1px 0 rgba(255, 255, 255, .4) inset); @include clearfix; .cancel-button { + margin: 20px 0px 10px 10px; @include white-button; } + .problem-type-tabs { + display: none; + } + // specific menu types &.new-component-problem { + padding-bottom:10px; .ss-icon, .editor-indicator { display: inline-block; } + + .problem-type-tabs { + display: inline-block; + } } } @@ -146,7 +174,6 @@ border: 1px solid $darkGreen; background: tint($green,20%); color: #fff; - @include transition(background-color .15s); &:hover { background: $brightGreen; @@ -154,19 +181,81 @@ } } - .new-component-template { - margin-bottom: 20px; + .problem-type-tabs { + list-style-type: none; + border-radius: 0; + width: 100%; + @include linear-gradient(top, rgba(255, 255, 255, .4), rgba(255, 255, 255, 0)); + background-color: $lightBluishGrey; + @include box-shadow(0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 -1px 0 rgba(0, 0, 0, 0.2) inset); - li:last-child { + li:first-child { + margin-left: 20px; + } + + li { + float:left; + display:inline-block; + text-align:center; + width: auto; + @include linear-gradient(top, rgba(255, 255, 255, .4), rgba(255, 255, 255, 0)); + background-color: tint($lightBluishGrey, 10%); + @include box-shadow(0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 -1px 0 rgba(0, 0, 0, 0.2) inset); + opacity:.8; + + &:hover { + opacity:1; + background-color: tint($lightBluishGrey, 20%); + } + + &.ui-state-active { + border: 0px; + @include active; + opacity:1; + } + } + + a{ + display: block; + padding: 15px 25px; + font-size: 15px; + line-height: 16px; + text-align: center; + color: #3c3c3c; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3); + } + } + + .new-component-template { + + a { + background: #fff; + border: 0px; + color: #3c3c3c; + @include transition (none); + + &:hover { + background: tint($green,30%); + color: #fff; + @include transition(background-color .15s); + } + } + + li { + border:none; + border-bottom: 1px dashed $lightGrey; + color: #fff; + } + + li:first-child { a { - border-radius: 0 0 3px 3px; - border-bottom: 1px solid $darkGreen; + border-top: 0px; } } li:nth-child(2) { a { - border-radius: 3px 3px 0 0; + border-radius: 0px; } } @@ -175,18 +264,20 @@ display: block; padding: 7px 20px; border-bottom: none; - font-weight: 300; + font-weight: 500; .name { float: left; .ss-icon { @include transition(opacity .15s); - position: relative; + display: inline-block; top: 1px; - font-size: 13px; margin-right: 5px; opacity: 0.5; + width: 17; + height: 21px; + vertical-align: middle; } } @@ -204,6 +295,7 @@ } &:hover { + color: #fff; .ss-icon { opacity: 1.0; @@ -217,14 +309,18 @@ // specific editor types .empty { - @include box-shadow(0 1px 3px rgba(0,0,0,0.2)); - margin-bottom: 10px; a { - border-bottom: 1px solid $darkGreen; - border-radius: 3px; - font-weight: 500; - background: $green; + line-height: 1.4; + font-weight: 400; + background: #fff; + color: #3c3c3c; + + + &:hover { + background: tint($green,30%); + color: #fff; + } } } } @@ -233,7 +329,7 @@ text-align: center; h5 { - color: $green; + color: $darkGreen; } } @@ -507,6 +603,7 @@ .edit-state-draft { .visibility, + .edit-draft-message, .view-button { display: none; diff --git a/cms/templates/unit.html b/cms/templates/unit.html index 1b500eab69..c529f5863a 100644 --- a/cms/templates/unit.html +++ b/cms/templates/unit.html @@ -14,12 +14,20 @@ state: '${unit_state}' }) }); - + + $(document).ready(function() { + $('body').addClass('js'); + + // tabs + $('.tab-group').tabs(); + }); + $('.new-component-template').each(function(){ $emptyEditor = $(this).find('.empty'); $(this).prepend($emptyEditor); }); }); + @@ -57,38 +65,66 @@ % for type, templates in sorted(component_templates.items()):
-

Select ${type} component type:

- - + % if type == "problem": +
+ + % endif +
+
    + % for name, location, has_markdown, is_empty in templates: + % if has_markdown or type != "problem": + % if is_empty: +
  • + + ${name} + +
  • + + % else: +
  • + + ${name} + +
  • + % endif + % endif + + %endfor +
+
+ % if type == "problem": +
+
    + % for name, location, has_markdown, is_empty in templates: + % if not has_markdown: + % if is_empty: +
  • + + ${name} + +
  • + + % else: +
  • + + ${name} + + +
  • + % endif + % endif + % endfor +
+
+
+ % endif Cancel
% endfor diff --git a/cms/templates/widgets/problem-edit.html b/cms/templates/widgets/problem-edit.html index 4ff9d299ab..8ca07a7928 100644 --- a/cms/templates/widgets/problem-edit.html +++ b/cms/templates/widgets/problem-edit.html @@ -1,20 +1,20 @@ <%include file="metadata-edit.html" />
- %if markdown != '' or data == '\n\n': + %if enable_markdown:
  • -
  • -
  • -
  • -
  • @@ -56,7 +56,7 @@
-
Check Multiple
+
Checkboxes
@@ -67,7 +67,7 @@
-
String Response
+
Text Input
@@ -76,7 +76,7 @@
-
Numerical Response
+
Numerical Input
@@ -85,7 +85,7 @@
-
Option Response
+
Dropdown
diff --git a/common/lib/xmodule/xmodule/capa_module.py b/common/lib/xmodule/xmodule/capa_module.py index d806ec7913..4635cc6871 100644 --- a/common/lib/xmodule/xmodule/capa_module.py +++ b/common/lib/xmodule/xmodule/capa_module.py @@ -703,15 +703,15 @@ class CapaDescriptor(RawDescriptor): def get_context(self): _context = RawDescriptor.get_context(self) - _context.update({'markdown': self.metadata.get('markdown', '')}) + _context.update({'markdown': self.metadata.get('markdown', ''), + 'enable_markdown' : 'markdown' in self.metadata}) return _context @property def editable_metadata_fields(self): - """Remove metadata from the editable fields since it has its own editor""" - subset = super(CapaDescriptor, self).editable_metadata_fields - if 'markdown' in subset: - subset.remove('markdown') + """Remove any metadata from the editable fields which have their own editor or shouldn't be edited by user.""" + subset = [field for field in super(CapaDescriptor,self).editable_metadata_fields + if field not in ['markdown', 'empty']] return subset diff --git a/common/lib/xmodule/xmodule/html_module.py b/common/lib/xmodule/xmodule/html_module.py index af1ce0ad80..456ea3cf10 100644 --- a/common/lib/xmodule/xmodule/html_module.py +++ b/common/lib/xmodule/xmodule/html_module.py @@ -172,6 +172,13 @@ class HtmlDescriptor(XmlDescriptor, EditingDescriptor): elt.set("filename", relname) return elt + @property + def editable_metadata_fields(self): + """Remove any metadata from the editable fields which have their own editor or shouldn't be edited by user.""" + subset = [field for field in super(HtmlDescriptor,self).editable_metadata_fields + if field not in ['empty']] + return subset + class AboutDescriptor(HtmlDescriptor): """ diff --git a/common/lib/xmodule/xmodule/js/src/videoalpha/display/html5_video.js b/common/lib/xmodule/xmodule/js/src/videoalpha/display/html5_video.js index acdc03932c..c3cc462ab8 100644 --- a/common/lib/xmodule/xmodule/js/src/videoalpha/display/html5_video.js +++ b/common/lib/xmodule/xmodule/js/src/videoalpha/display/html5_video.js @@ -221,6 +221,15 @@ this.HTML5Video = (function () { // and end playing at the specified end time. After it was paused, or when a seek operation happeded, // the starting time and ending time will reset to the beginning and the end of the video respectively. this.video.addEventListener('canplay', function () { + // Because firefox triggers 'canplay' event every time when 'currentTime' property + // changes, we must make sure that this block of code runs only once. Otherwise, + // this will be an endless loop ('currentTime' property is changed below). + // + // Chrome is immune to this behavior. + if (_this.playerState !== HTML5Video.PlayerState.UNSTARTED) { + return; + } + _this.playerState = HTML5Video.PlayerState.PAUSED; if (_this.start > _this.video.duration) { diff --git a/common/lib/xmodule/xmodule/templates/html/empty.yaml b/common/lib/xmodule/xmodule/templates/html/empty.yaml index 1262ed37cf..b6d867d7d6 100644 --- a/common/lib/xmodule/xmodule/templates/html/empty.yaml +++ b/common/lib/xmodule/xmodule/templates/html/empty.yaml @@ -1,6 +1,7 @@ --- metadata: - display_name: Empty + display_name: Blank HTML Page + empty: True data: | diff --git a/common/lib/xmodule/xmodule/templates/problem/circuitschematic.yaml b/common/lib/xmodule/xmodule/templates/problem/circuitschematic.yaml index f56b17b1b9..a94b824cfb 100644 --- a/common/lib/xmodule/xmodule/templates/problem/circuitschematic.yaml +++ b/common/lib/xmodule/xmodule/templates/problem/circuitschematic.yaml @@ -1,6 +1,7 @@ + --- metadata: - display_name: Circuit Schematic + display_name: Circuit Schematic Builder rerandomize: never showanswer: always weight: "" diff --git a/common/lib/xmodule/xmodule/templates/problem/customgrader.yaml b/common/lib/xmodule/xmodule/templates/problem/customgrader.yaml index 6ada6f97f3..aadbe4075a 100644 --- a/common/lib/xmodule/xmodule/templates/problem/customgrader.yaml +++ b/common/lib/xmodule/xmodule/templates/problem/customgrader.yaml @@ -1,6 +1,6 @@ --- metadata: - display_name: Custom Grader + display_name: Custom Python-Evaluated Input rerandomize: never showanswer: always weight: "" @@ -8,7 +8,7 @@ metadata: data: |

- A custom response problem accepts one or more lines of text input from the + A custom python-evaluated input problem accepts one or more lines of text input from the student, and evaluates the inputs for correctness based on evaluation using a python script embedded within the problem.

diff --git a/common/lib/xmodule/xmodule/templates/problem/empty.yaml b/common/lib/xmodule/xmodule/templates/problem/empty.yaml index 346f49609c..39c9e7671c 100644 --- a/common/lib/xmodule/xmodule/templates/problem/empty.yaml +++ b/common/lib/xmodule/xmodule/templates/problem/empty.yaml @@ -1,10 +1,11 @@ --- metadata: - display_name: Empty + display_name: Blank Common Problem rerandomize: never showanswer: always markdown: "" weight: "" + empty: True attempts: "" data: | diff --git a/common/lib/xmodule/xmodule/templates/problem/emptyadvanced.yaml b/common/lib/xmodule/xmodule/templates/problem/emptyadvanced.yaml new file mode 100644 index 0000000000..bba7b3a8ac --- /dev/null +++ b/common/lib/xmodule/xmodule/templates/problem/emptyadvanced.yaml @@ -0,0 +1,13 @@ +--- +metadata: + display_name: Blank Advanced Problem + rerandomize: never + showanswer: always + weight: "" + attempts: "" + empty: True +data: | + + + +children: [] diff --git a/common/lib/xmodule/xmodule/templates/problem/forumularesponse.yaml b/common/lib/xmodule/xmodule/templates/problem/forumularesponse.yaml index 5b30a0497d..b4c53a107b 100644 --- a/common/lib/xmodule/xmodule/templates/problem/forumularesponse.yaml +++ b/common/lib/xmodule/xmodule/templates/problem/forumularesponse.yaml @@ -1,6 +1,6 @@ --- metadata: - display_name: Formula Response + display_name: Math Expression Input rerandomize: never showanswer: always weight: "" @@ -8,7 +8,7 @@ metadata: data: |

- A formula response problem accepts a line of text representing a mathematical expression from the + A math expression input problem accepts a line of text representing a mathematical expression from the student, and evaluates the input for equivalence to a mathematical expression provided by the grader. Correctness is based on numerical sampling of the symbolic expressions.

diff --git a/common/lib/xmodule/xmodule/templates/problem/imageresponse.yaml b/common/lib/xmodule/xmodule/templates/problem/imageresponse.yaml index 069c157852..3ef619d54b 100644 --- a/common/lib/xmodule/xmodule/templates/problem/imageresponse.yaml +++ b/common/lib/xmodule/xmodule/templates/problem/imageresponse.yaml @@ -1,6 +1,6 @@ --- metadata: - display_name: Image Response + display_name: Image Mapped Input rerandomize: never showanswer: always weight: "" @@ -8,7 +8,7 @@ metadata: data: |

- An image response problem presents an image for the student. Input is + An image mapped input problem presents an image for the student. Input is given by the location of mouse clicks on the image. Correctness of input can be evaluated based on expected dimensions of a rectangle.

diff --git a/common/lib/xmodule/xmodule/templates/problem/multiplechoice.yaml b/common/lib/xmodule/xmodule/templates/problem/multiplechoice.yaml index 9e61324ae1..3a35a35199 100644 --- a/common/lib/xmodule/xmodule/templates/problem/multiplechoice.yaml +++ b/common/lib/xmodule/xmodule/templates/problem/multiplechoice.yaml @@ -26,10 +26,6 @@ metadata: ( ) The vegetable peeler - ( ) Android - - ( ) The Beatles - [explanation] The release of the iPod allowed consumers to carry their entire music library with them in a @@ -51,8 +47,6 @@ data: | Napster The iPod The vegetable peeler - Android - The Beatles diff --git a/common/lib/xmodule/xmodule/templates/problem/numericalresponse.yaml b/common/lib/xmodule/xmodule/templates/problem/numericalresponse.yaml index e0a5776222..1dc46f5f51 100644 --- a/common/lib/xmodule/xmodule/templates/problem/numericalresponse.yaml +++ b/common/lib/xmodule/xmodule/templates/problem/numericalresponse.yaml @@ -1,12 +1,12 @@ --- metadata: - display_name: Numerical Response + display_name: Numerical Input rerandomize: never showanswer: always weight: "" attempts: "" markdown: - "A numerical response problem accepts a line of text input from the + "A numerical input problem accepts a line of text input from the student, and evaluates the input for correctness based on its numerical value. @@ -45,7 +45,7 @@ metadata: data: |

- A numerical response problem accepts a line of text input from the + A numerical input problem accepts a line of text input from the student, and evaluates the input for correctness based on its numerical value.

diff --git a/common/lib/xmodule/xmodule/templates/problem/optionresponse.yaml b/common/lib/xmodule/xmodule/templates/problem/optionresponse.yaml index 1a42a5a009..f523c7fdc5 100644 --- a/common/lib/xmodule/xmodule/templates/problem/optionresponse.yaml +++ b/common/lib/xmodule/xmodule/templates/problem/optionresponse.yaml @@ -1,12 +1,12 @@ --- metadata: - display_name: Option Response + display_name: Dropdown rerandomize: never showanswer: always weight: "" attempts: "" markdown: - "OptionResponse gives a limited set of options for students to respond with, and presents those options + "Dropdown problems give a limited set of options for students to respond with, and present those options in a format that encourages them to search for a specific answer rather than being immediately presented with options from which to recognize the correct answer. @@ -14,30 +14,30 @@ metadata: The answer options and the identification of the correct answer is defined in the optioninput tag. - Translation between Option Response and __________ is extremely straightforward: + Translation between Dropdown and __________ is extremely straightforward: - [[(Multiple Choice), String Response, Numerical Response, External Response, Image Response]] + [[(Multiple Choice), Text Input, Numerical Input, External Response, Image Response]] [explanation] Multiple Choice also allows students to select from a variety of pre-written responses, although the - format makes it easier for students to read very long response options. Optionresponse also differs + format makes it easier for students to read very long response options. Dropdowns also differ slightly because students are more likely to think of an answer and then search for it rather than relying purely on recognition to answer the question. [explanation] " data: | -

OptionResponse gives a limited set of options for students to respond with, and presents those options +

Dropdown problems give a limited set of options for students to respond with, and present those options in a format that encourages them to search for a specific answer rather than being immediately presented with options from which to recognize the correct answer.

The answer options and the identification of the correct answer is defined in the optioninput tag.

-

Translation between Option Response and __________ is extremely straightforward: +

Translation between Dropdown and __________ is extremely straightforward: - +

diff --git a/common/lib/xmodule/xmodule/templates/problem/string_response.yaml b/common/lib/xmodule/xmodule/templates/problem/string_response.yaml index 1761ea8f67..c018d3f6cf 100644 --- a/common/lib/xmodule/xmodule/templates/problem/string_response.yaml +++ b/common/lib/xmodule/xmodule/templates/problem/string_response.yaml @@ -1,15 +1,15 @@ --- metadata: - display_name: String Response + display_name: Text Input 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 + "A text input problem accepts a line of text from the student, and evaluates the input for correctness based on an expected - answer within each input box. + answer. The answer is correct if it matches every character of the expected answer. This can be a problem with @@ -30,9 +30,9 @@ data: |

- A string response problem accepts a line of text input from the + A text input problem accepts a line of text from the student, and evaluates the input for correctness based on an expected - answer within each input box. + answer. The answer is correct if it matches every character of the expected answer. This can be a problem with international spelling, dates, or anything where the format of the answer is not clear.