Skip to content
This repository has been archived by the owner on Dec 2, 2022. It is now read-only.

Commit

Permalink
New: Quiz 'Submit all and finish' text and background with hover sett…
Browse files Browse the repository at this point in the history
…ings.
  • Loading branch information
gjb2048 committed Sep 7, 2017
1 parent 0ad14e2 commit fb642e5
Show file tree
Hide file tree
Showing 10 changed files with 241 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ New in 3.3.1.1
- FIX: Above setting for 'coursetitleposition' does not work on 'incourse' / two column content pages.
- FIX: Issue #842: Would it be possible to change a private to a protected?
- FIX: Issue #843: Add an activity or resource popup display.
- NEW: Quiz 'Submit all and finish' text and background with hover settings.

New in 3.3.1.0
==============
Expand Down
16 changes: 16 additions & 0 deletions lang/en/theme_essential.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,14 @@
$string['themestripeurlcolourdesc'] = 'Set the url colour for stripes in tables.';
$string['themestripebackgroundcolour'] = 'Stripe background colour';
$string['themestripebackgroundcolourdesc'] = 'Set the background colour for stripes in tables.';
$string['themequizsubmittextcolour'] = 'Quiz \'Submit all and finish\' text colour';
$string['themequizsubmittextcolourdesc'] = 'Set the text colour for the quiz \'Submit all and finish\' button.';
$string['themequizsubmitbackgroundcolour'] = 'Quiz \'Submit all and finish\' background colour';
$string['themequizsubmitbackgroundcolourdesc'] = 'Set the background colour for the quiz \'Submit all and finish\' button.';
$string['themequizsubmittexthovercolour'] = 'Quiz \'Submit all and finish\' text hover colour';
$string['themequizsubmittexthovercolourdesc'] = 'Set the text hover colour for the quiz \'Submit all and finish\' button.';
$string['themequizsubmitbackgroundhovercolour'] = 'Quiz \'Submit all and finish\' background hover colour';
$string['themequizsubmitbackgroundhovercolourdesc'] = 'Set the background hover colour for the quiz \'Submit all and finish\' button.';

$string['footercolor'] = 'Footer background colour';
$string['footercolordesc'] = 'Set what colour the background of the Footer box should be.';
Expand Down Expand Up @@ -414,6 +422,14 @@
$string['alternativethemestripeurlcolourdesc'] = 'Set the alternative {$a} url colour for stripes in tables.';
$string['alternativethemestripebackgroundcolour'] = 'Alternative stripe background colour {$a}';
$string['alternativethemestripebackgroundcolourdesc'] = 'Set the alternative {$a} background colour for stripes in tables.';
$string['alternativethemequizsubmittextcolour'] = 'Quiz \'Submit all and finish\' text colour {$a}';
$string['alternativethemequizsubmittextcolourdesc'] = 'Set the alternative {$a} text colour for the quiz \'Submit all and finish\' button.';
$string['alternativethemequizsubmitbackgroundcolour'] = 'Quiz \'Submit all and finish\' background colour {$a}';
$string['alternativethemequizsubmitbackgroundcolourdesc'] = 'Set the alternative {$a} background colour for the quiz \'Submit all and finish\' button.';
$string['alternativethemequizsubmittexthovercolour'] = 'Quiz \'Submit all and finish\' text hover colour {$a}';
$string['alternativethemequizsubmittexthovercolourdesc'] = 'Set the alternative {$a} text hover colour for the quiz \'Submit all and finish\' button.';
$string['alternativethemequizsubmitbackgroundhovercolour'] = 'Quiz \'Submit all and finish\' background hover colour {$a}';
$string['alternativethemequizsubmitbackgroundhovercolourdesc'] = 'Set the alternative {$a} background hover colour for the quiz \'Submit all and finish\' button.';

$string['alternativethememycoursesorderenrolbackcolour'] = 'Alternative {$a} enrolled and not accessed course background colour';
$string['alternativethememycoursesorderenrolbackcolourdesc'] = 'Set alternative {$a} background colour for enrolled but not accessed courses. For ehen \'mycoursesorder\' is set to \'Last accessed...\'.';
Expand Down
23 changes: 23 additions & 0 deletions less/essential-alternative.less
Original file line number Diff line number Diff line change
Expand Up @@ -1393,6 +1393,29 @@
}
}
}

&.path-mod-quiz .submitbtns form[action$="processattempt.php"] input[type="submit"] {
color: ~"[[setting:alternativethemequizsubmittextcolour@{index}]]";

text-shadow: none;
background-color: ~"[[setting:alternativethemequizsubmitbackgroundcolour@{index}]]";
background-image: -moz-linear-gradient(bottom, ~"[[setting:alternativethemequizsubmitbackgroundcolourimage@{index}]]", ~"[[setting:alternativethemequizsubmitbackgroundcolourrgba@{index}]]"); // FF 3.6+
background-image: -webkit-gradient(linear, 0 100%, 0 0, from(~"[[setting:alternativethemequizsubmitbackgroundcolourimage@{index}]]"), to(~"[[setting:alternativethemequizsubmitbackgroundcolourrgba@{index}]]")); // Safari 4+, Chrome 2+
background-image: -webkit-linear-gradient(bottom, ~"[[setting:alternativethemequizsubmitbackgroundcolourimage@{index}]]", ~"[[setting:alternativethemequizsubmitbackgroundcolourrgba@{index}]]"); // Safari 5.1+, Chrome 10+
background-image: -o-linear-gradient(bottom, ~"[[setting:alternativethemequizsubmitbackgroundcolourimage@{index}]]", ~"[[setting:alternativethemequizsubmitbackgroundcolourrgba@{index}]]"); // Opera 11.10
background-image: linear-gradient(to top, ~"[[setting:alternativethemequizsubmitbackgroundcolourimage@{index}]]", ~"[[setting:alternativethemequizsubmitbackgroundcolourrgba@{index}]]"); // Standard, IE10

&:hover, &:focus, &:active, &.active, &.disabled, &[disabled] {
color: ~"[[setting:alternativethemequizsubmittexthovercolour@{index}]]";
text-shadow: 0 1px 1px rgba(64, 64, 64, .75);
background-color: ~"[[setting:alternativethemequizsubmitbackgroundhovercolour@{index}]]";
background-image: -moz-linear-gradient(bottom, ~"[[setting:alternativethemequizsubmitbackgroundhovercolourimage@{index}]]", ~"[[setting:alternativethemequizsubmitbackgroundhovercolourrgba@{index}]]"); // FF 3.6+
background-image: -webkit-gradient(linear, 0 100%, 0 0, from(~"[[setting:alternativethemequizsubmitbackgroundhovercolourimage@{index}]]"), to(~"[[setting:alternativethemequizsubmitbackgroundhovercolourrgba@{index}]]")); // Safari 4+, Chrome 2+
background-image: -webkit-linear-gradient(bottom, ~"[[setting:alternativethemequizsubmitbackgroundhovercolourimage@{index}]]", ~"[[setting:alternativethemequizsubmitbackgroundhovercolourrgba@{index}]]"); // Safari 5.1+, Chrome 10+
background-image: -o-linear-gradient(bottom, ~"[[setting:alternativethemequizsubmitbackgroundhovercolourimage@{index}]]", ~"[[setting:alternativethemequizsubmitbackgroundhovercolourrgba@{index}]]"); // Opera 11.10
background-image: linear-gradient(to top, ~"[[setting:alternativethemequizsubmitbackgroundhovercolourimage@{index}]]", ~"[[setting:alternativethemequizsubmitbackgroundhovercolourrgba@{index}]]"); // Standard, IE10
}
}
}

@media (max-width: @navbarCollapseWidth) {
Expand Down
1 change: 1 addition & 0 deletions less/essential-settings.less
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
@import "essential/settings/header";
@import "essential/settings/navigation";
@import "essential/settings/print";
@import "essential/settings/quiz";
@import "essential/settings/responsive";
@import "essential/settings/tables";
@import "essential/settings/theme-admin";
Expand Down
26 changes: 26 additions & 0 deletions less/essential/settings/quiz.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* @group Quiz */

body.path-mod-quiz .submitbtns form[action$="processattempt.php"] input[type="submit"] {
color: ~"[[setting:themequizsubmittextcolour]]";

text-shadow: none;
background-color: ~"[[setting:themequizsubmitbackgroundcolour]]";
background-image: -moz-linear-gradient(bottom, ~"[[setting:themequizsubmitbackgroundcolourimage]]", ~"[[setting:themequizsubmitbackgroundcolourrgba]]"); // FF 3.6+
background-image: -webkit-gradient(linear, 0 100%, 0 0, from(~"[[setting:themequizsubmitbackgroundcolourimage]]"), to(~"[[setting:themequizsubmitbackgroundcolourrgba]]")); // Safari 4+, Chrome 2+
background-image: -webkit-linear-gradient(bottom, ~"[[setting:themequizsubmitbackgroundcolourimage]]", ~"[[setting:themequizsubmitbackgroundcolourrgba]]"); // Safari 5.1+, Chrome 10+
background-image: -o-linear-gradient(bottom, ~"[[setting:themequizsubmitbackgroundcolourimage]]", ~"[[setting:themequizsubmitbackgroundcolourrgba]]"); // Opera 11.10
background-image: linear-gradient(to top, ~"[[setting:themequizsubmitbackgroundcolourimage]]", ~"[[setting:themequizsubmitbackgroundcolourrgba]]"); // Standard, IE10

&:hover, &:focus, &:active, &.active, &.disabled, &[disabled] {
color: ~"[[setting:themequizsubmittexthovercolour]]";
text-shadow: 0 1px 1px rgba(64, 64, 64, .75);
background-color: ~"[[setting:themequizsubmitbackgroundhovercolour]]";
background-image: -moz-linear-gradient(bottom, ~"[[setting:themequizsubmitbackgroundhovercolourimage]]", ~"[[setting:themequizsubmitbackgroundhovercolourrgba]]"); // FF 3.6+
background-image: -webkit-gradient(linear, 0 100%, 0 0, from(~"[[setting:themequizsubmitbackgroundhovercolourimage]]"), to(~"[[setting:themequizsubmitbackgroundhovercolourrgba]]")); // Safari 4+, Chrome 2+
background-image: -webkit-linear-gradient(bottom, ~"[[setting:themequizsubmitbackgroundhovercolourimage]]", ~"[[setting:themequizsubmitbackgroundhovercolourrgba]]"); // Safari 5.1+, Chrome 10+
background-image: -o-linear-gradient(bottom, ~"[[setting:themequizsubmitbackgroundhovercolourimage]]", ~"[[setting:themequizsubmitbackgroundhovercolourrgba]]"); // Opera 11.10
background-image: linear-gradient(to top, ~"[[setting:themequizsubmitbackgroundhovercolourimage]]", ~"[[setting:themequizsubmitbackgroundhovercolourrgba]]"); // Standard, IE10
}
}

/* @end Quiz */
59 changes: 59 additions & 0 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,33 @@ function theme_essential_process_css($css, $theme) {
$themestripeurlcolour = \theme_essential\toolbox::get_setting('themestripeurlcolour');
$css = \theme_essential\toolbox::set_color($css, $themestripeurlcolour, '[[setting:themestripeurlcolour]]', '#25849F');

// Set the theme Quiz 'Submit all and finish' colours.
$themequizsubmittextcolour = \theme_essential\toolbox::get_setting('themequizsubmittextcolour');
$css = \theme_essential\toolbox::set_color($css, $themequizsubmittextcolour,
'[[setting:themequizsubmittextcolour]]', '#ffffff');

$themequizsubmittexthovercolour = \theme_essential\toolbox::get_setting('themequizsubmittexthovercolour');
$css = \theme_essential\toolbox::set_color($css, $themequizsubmittexthovercolour,
'[[setting:themequizsubmittexthovercolour]]', '#ffffff');

$themequizsubmitbackgroundcolour = \theme_essential\toolbox::get_setting('themequizsubmitbackgroundcolour');
$css = \theme_essential\toolbox::set_color($css, $themequizsubmitbackgroundcolour,
'[[setting:themequizsubmitbackgroundcolour]]', '#ff9a34');
$css = \theme_essential\toolbox::set_color($css, $themequizsubmitbackgroundcolour,
'[[setting:themequizsubmitbackgroundcolourimage]]', '#ff9a34');
$css = \theme_essential\toolbox::set_color($css,
\theme_essential\toolbox::hexadjust($themequizsubmitbackgroundcolour, 10),
'[[setting:themequizsubmitbackgroundcolourrgba]]', '#ff9a34', '0.25');

$themequizsubmitbackgroundhovercolour = \theme_essential\toolbox::get_setting('themequizsubmitbackgroundhovercolour');
$css = \theme_essential\toolbox::set_color($css, $themequizsubmitbackgroundhovercolour,
'[[setting:themequizsubmitbackgroundhovercolour]]', '#ffaf60');
$css = \theme_essential\toolbox::set_color($css, $themequizsubmitbackgroundhovercolour,
'[[setting:themequizsubmitbackgroundhovercolourimage]]', '#ffaf60');
$css = \theme_essential\toolbox::set_color($css,
\theme_essential\toolbox::hexadjust($themequizsubmitbackgroundhovercolour, 10),
'[[setting:themequizsubmitbackgroundhovercolourrgba]]', '#ffaf60', '0.25');

// Enrolled and not accessed course background colour.
$mycoursesorderenrolbackcolour = \theme_essential\toolbox::get_setting('mycoursesorderenrolbackcolour');
$css = \theme_essential\toolbox::set_color($css, $mycoursesorderenrolbackcolour,
Expand Down Expand Up @@ -421,6 +448,38 @@ function theme_essential_process_css($css, $theme) {
$css = \theme_essential\toolbox::set_alternativecolor($css, 'stripeurlcolour'.$alternative,
\theme_essential\toolbox::get_setting('alternativethemestripeurlcolour'.$alternative), $defaultstripeurl);

$css = \theme_essential\toolbox::set_alternativecolor($css, 'quizsubmittextcolour'.$alternative,
\theme_essential\toolbox::get_setting('alternativethemequizsubmittextcolour'.$alternative),
'#ffffff');

$css = \theme_essential\toolbox::set_alternativecolor($css, 'quizsubmittexthovercolour'.$alternative,
\theme_essential\toolbox::get_setting('alternativethemequizsubmittexthovercolour'.$alternative),
'#ffffff');

$alternativethemequizsubmitbackgroundcolour = \theme_essential\toolbox::get_setting(
'alternativethemequizsubmitbackgroundcolour'.$alternative);
$css = \theme_essential\toolbox::set_alternativecolor($css, 'quizsubmitbackgroundcolour'.$alternative,
$alternativethemequizsubmitbackgroundcolour,
'#ff9a34');
$css = \theme_essential\toolbox::set_alternativecolor($css, 'quizsubmitbackgroundcolourimage'.$alternative,
$alternativethemequizsubmitbackgroundcolour,
'#ff9a34');
$css = \theme_essential\toolbox::set_alternativecolor($css, 'quizsubmitbackgroundcolourrgba'.$alternative,
\theme_essential\toolbox::hexadjust($alternativethemequizsubmitbackgroundcolour, 10),
'#ff9a34', '0.25');

$alternativethemequizsubmitbackgroundhovercolour = \theme_essential\toolbox::get_setting(
'alternativethemequizsubmitbackgroundhovercolour'.$alternative);
$css = \theme_essential\toolbox::set_alternativecolor($css, 'quizsubmitbackgroundhovercolour'.$alternative,
$alternativethemequizsubmitbackgroundhovercolour,
'#ffaf60');
$css = \theme_essential\toolbox::set_alternativecolor($css, 'quizsubmitbackgroundhovercolourimage'.$alternative,
$alternativethemequizsubmitbackgroundhovercolour,
'#ffaf60');
$css = \theme_essential\toolbox::set_alternativecolor($css, 'quizsubmitbackgroundhovercolourrgba'.$alternative,
\theme_essential\toolbox::hexadjust($alternativethemequizsubmitbackgroundhovercolour, 10),
'#ffaf60', '0.25');

$alternativethememycoursesorderenrolbackcolour = \theme_essential\toolbox::get_setting(
'alternativethememycoursesorderenrolbackcolour'.$alternative);
$css = \theme_essential\toolbox::set_alternativecolor($css, 'mycoursesorderenrolbackcolour'.$alternative,
Expand Down
Loading

0 comments on commit fb642e5

Please sign in to comment.