Skip to content

Commit c2a1a21

Browse files
committed
hints: both OSU/default
1 parent 44d1da4 commit c2a1a21

File tree

4 files changed

+125
-5
lines changed

4 files changed

+125
-5
lines changed

global.css

Lines changed: 81 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,85 @@
88
* - be renamed xmHtmlStyle.css (to sync with xmPreamble.tex and xmPrintStyle.sty)
99
* - become (almost) empty by default, because the ximeraServer default settings will becom English again
1010
*/
11+
12+
/* Fixes for expandables (hints/solution/...) */
13+
14+
.btn-reveal-hint {
15+
float: none;
16+
clear: none;
17+
margin-top: 0em;
18+
display: block;
19+
margin-left: auto;
20+
z-index: 1;
21+
position: relative;
22+
}
23+
1124

25+
.xmhint, .xmoplossing, .xmuitkomst {
26+
background-color: #1D8DB0;
27+
color: white;
28+
font-family: sans-serif;
29+
font-weight: normal;
30+
font-size: smaller;
31+
margin: 1px !important;
32+
margin-left: auto !important;
33+
display: block;
34+
/* max-width: max-content; */
35+
max-width: 10em !important;
36+
line-height: 1;
37+
text-align: center;
38+
white-space: nowrap;
39+
vertical-align: middle;
40+
user-select: none;
41+
border: 1px solid transparent;
42+
padding: 0px !important;
43+
font-size: 1rem;
44+
transition: all 0.2s ease-in-out;
45+
counter-increment: hint_number;
46+
}
47+
48+
/* increase specificity with double classes ;) */
49+
div.xmhint-content.ui-accordion-content {
50+
background-color: #00000000; /* transparent; overwrites .ui-widget-content ... */
51+
border: 1px solid #005000;
52+
border-top: 1px solid #005000 !important;
53+
border-left: 3px solid #005000;
54+
color: #005000;
55+
margin-top: 0rem;
56+
padding: 2px 3rem;
57+
overflow: visible; /* set to auto for .ui-accordion .ui-accordion-content in <style> */
58+
}
59+
60+
div.xmhint-content::before {
61+
content: "Hint: ";
62+
font-weight: bold;
63+
margin-left: -3rem; /* Hack, see padding above ... */
64+
}
65+
66+
67+
68+
div.xmoplossing-content.ui-accordion-content, div.xmuitkomst-content.ui-accordion-content {
69+
background-color: #00000000; /* transparent; overwrites .ui-widget-content ... */
70+
background-color: white;
71+
border: 1px solid black;
72+
border-left: 3px solid black;
73+
color: black;
74+
margin-top: 0rem;
75+
padding: 5px;
76+
}
77+
/*
78+
@counter-style notfirst {
79+
system: alphabetic;
80+
symbols: " " "2" "3" "4" "5" "6" "7" "8" "9" "0";
81+
}
82+
83+
.example, .exercise, .question {
84+
counter-reset: hint_number;
85+
}
86+
*/
87+
88+
/* Fixes for language ?? */
89+
1290

1391
.xmhint::before {
1492
content: "Show hint" counter(hint_number, notfirst);
@@ -216,4 +294,6 @@ e.g. use "P1", "Problem 1", "Prob 1", "Exciting Problem 1", etc.
216294
/*
217295
.outcomeHead:hover + .outcomeContent {
218296
display: block;
219-
} */
297+
} */
298+
299+

testXourses/hintsTest.tex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
\documentclass{xourse}
22

3-
\title{Hints Test}
3+
\title{Tests: hints}
44

55

66
\begin{document}
77
\maketitle
88

99
\activity{testFiles/hintsBase}
10+
\activity{testFiles/hintsBaseOSU}
1011

1112

1213
\end{document}

testXourses/testFiles/hintsBase.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
\def\xmNotHintAsExpandable{1}% Required to get OSU style hints.
2-
\def\xmNotExpandableAsAccordion{1}% Required to get OSU style hints.
1+
%% \def\xmNotHintAsExpandable{1}% Required to get OSU style hints.
2+
%% \def\xmNotExpandableAsAccordion{1}% Required to get OSU style hints.
33
\documentclass{ximera}
4-
\title{Hints - Base Useage}
4+
\title{Hints - Base Usage}
55

66
%\input{preamble.tex}% Only add a preamble file if it is actually necessary for the demo/test.
77
\begin{document}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
\def\xmNotHintAsExpandable{1}% Required to get OSU style hints.
2+
\def\xmNotExpandableAsAccordion{1}% Required to get OSU style hints.
3+
\documentclass{ximera}
4+
\title{Hints - Base Usage (OSU style)}
5+
6+
%\input{preamble.tex}% Only add a preamble file if it is actually necessary for the demo/test.
7+
\begin{document}
8+
\begin{abstract}
9+
A demo/test set for hints base usage.
10+
\end{abstract}
11+
\maketitle
12+
13+
{{\Huge \bfseries Last Updated: \today}} \\
14+
%%
15+
16+
\section{Basic Usage}
17+
The hints environment is an environment that hides the content in an expandable box that cannot be expanded for
18+
the first 10 seconds of the page load - to be used inside a problem environment to provide hints.
19+
20+
If you want to have multiple hints, you should have one after the other, \textbf{not} nest them.
21+
22+
\section{Intended Outcome of Test}
23+
24+
Below should be a problem that says ``What is the answer'' with a ``hint'' button above and to the right of the text (inside the problem)
25+
that, when clicked, will show the countdown until it can be opened. Once opened, it should say ``The answer is 4.''.
26+
27+
\section{Start of Test/Demo Area}
28+
29+
\begin{problem}
30+
\begin{hint}
31+
The answer is 4.
32+
\end{hint}
33+
What is the answer? $\answer{4}$.
34+
\end{problem}
35+
36+
\hrulefill
37+
38+
39+
\end{document}

0 commit comments

Comments
 (0)