Skip to content

Commit d4f56f8

Browse files
author
aryan
committed
some ui changes in exercise cards and question SHortcode to solve question
1 parent 2399a2f commit d4f56f8

6 files changed

Lines changed: 164 additions & 99 deletions

File tree

content/exercises/graded-assignments/mathematics-1/W1GA1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Mathematics Graded Assignment Week - 1
2+
title: 🪨 Mathematics Graded Assignment Week 1 😶
33
weight: 1
44
tags:
55
- mathematics

content/exercises/graded-assignments/statistics-1/week-4-questions.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,33 +17,30 @@ series:
1717

1818
| Dealer's Location | OnePlus | BBK Electronics |
1919
| :-- | :-- | :-- |
20-
| Chennai | a | b |
21-
| Punjab | c | d |
22-
| Chennai | e | f |
23-
| Punjab | g | h |
24-
| Chennai | i | j |
25-
| Punjab | k | l |
26-
| Chennai | m | n |
20+
| Chennai | {{< qna/input name="a" value="2" >}} | {{< qna/input name="b" value="2" >}} |
21+
| Punjab | {{< qna/input name="c" value="2" >}} | {{< qna/input name="d" value="2" >}} |
22+
| Chennai | {{< qna/input name="e" value="2" >}} | {{< qna/input name="f" value="2" >}} |
23+
| Punjab | {{< qna/input name="g" value="2" >}} | {{< qna/input name="h" value="2" >}} |
24+
| Chennai | {{< qna/input name="i" value="2" >}} | {{< qna/input name="j" value="2" >}} |
25+
| Punjab | {{< qna/input name="k" value="2" >}} | {{< qna/input name="l" value="2" >}} |
26+
| Chennai | {{< qna/input name="m" value="2" >}} | {{< qna/input name="n" value="2" >}} |
2727

2828

2929
#### 1. What is the population standard deviation of sales of OnePlus? (Enter the answer correct to 2 decimal accuracy)
3030

31-
{{< qna/input name="a" value="2" >}}
32-
{{< qna/input name="b" value="3" >}}
33-
34-
3531
**Solution:**
3632
Let $m_x$ and $\sigma_x$ be the mean and population standard deviation of sales of OnePlus respectively.
3733

3834
$$
3935
m_x = \frac{a+c+e+g+i+k+m}{7}
4036
$$
4137

38+
{{< qna/formula label="mean" value="((a+b+c+d+e+f+g+h+i+j+k+l+m+n))/7" >}}
39+
4240
$$
4341
\sigma_x^2 = \frac{(a - m_x)^2 + (c - m_x)^2 + (e - m_x)^2 + (g - m_x)^2 + (i - m_x)^2 + (k - m_x)^2 + (m - m_x)^2}{7}
4442
$$
4543

46-
{{< qna/formula value="Math.pow(2,a)" >}}
4744
{{< qna/result >}}
4845
Therefore, Population standard deviation of sales of OnePlus = $\sqrt{\sigma_x^2}$
4946

Lines changed: 122 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,115 @@
1-
21
<div class="question-card hx-mb-10 question-mathjax hextra-scrollbar">
2+
<a href="{{ .RelPermalink }}">
3+
<div class="question-header mona-sans">
4+
<h3>
5+
<a
6+
style="color: inherit; text-decoration: none"
7+
class="question-card-title hx-block hx-font-semibold hx-text-xl"
8+
href="{{ .RelPermalink }}"
9+
>
10+
{{ .Title }}
11+
</a>
12+
</h3>
13+
</div>
314
<a href="{{ .RelPermalink }}">
4-
<div class="question-header mona-sans fireship-tag tag-cloud-functions">
5-
<h3>
6-
<a
7-
style="color: inherit; text-decoration: none"
8-
class="question-card-title hx-block hx-font-semibold hx-text-xl"
9-
href="{{ .RelPermalink }}"
10-
>
11-
{{ .Title }}
12-
</a>
13-
</h3>
14-
</div>
15-
<div class="question-content">
16-
<p
17-
class="blog-card-description mona-sans hx-opacity-100 hx-mt-2 hx-leading-7 mathjax"
15+
<div class="question-content">
16+
<p
17+
class="question-card-description mona-sans hx-opacity-100 hx-mt-2 hx-leading-7 mathjax"
18+
>
19+
{{- partial "utils/page-description" . -}}
20+
</p>
21+
{{/* {{- if site.Params.blog.list.displayTags -}} {{with .GetTerms
22+
"categories"}}
23+
<p class="blog-card-tags hx-opacity-100 hx-text-sm hx-leading-7">
24+
{{- range . }}
25+
<a
26+
class="blog-card-tag mona-sans hx-inline-block hx-mr-2"
27+
href="{{.RelPermalink}}"
28+
>#{{ .Name }}</a
1829
>
19-
{{- partial "utils/page-description" . -}}
20-
</p>
21-
{{/* {{- if site.Params.blog.list.displayTags -}} {{with .GetTerms
22-
"categories"}}
23-
<p class="blog-card-tags hx-opacity-100 hx-text-sm hx-leading-7">
24-
{{- range . }}
25-
<a
26-
class="blog-card-tag mona-sans hx-inline-block hx-mr-2"
27-
href="{{.RelPermalink}}"
28-
>#{{ .Name }}</a
29-
>
30-
{{ end -}}
31-
</p> */}}
32-
</p>
33-
{{- if site.Params.blog.list.displayTags -}} {{with .GetTerms
34-
"categories"}}
35-
<p class="hx-opacity-100 hx-text-sm hx-leading-7 hx-mt-2">
36-
{{- range . }}
37-
<a
38-
class="fireship-tag tag-md tag-stripe mona-sans hx-inline-block hx-mr-2"
39-
href="{{.RelPermalink}}"
40-
>{{ .Name }}</a
41-
>
42-
{{ end -}}
43-
</p>
44-
{{ end -}} {{- end -}}
45-
</div>
30+
{{ end -}}
31+
</p>
32+
*/}}
33+
</div>
4634
</a>
35+
<div class="question-tags">
36+
{{- if site.Params.blog.list.displayTags -}} {{with .GetTerms
37+
"categories"}}
38+
<p class="hx-opacity-100 hx-text-sm hx-leading-7 hx-mt-2">
39+
{{- range . }}
40+
<a
41+
class="mona-sans hx-inline-block hx-mr-2"
42+
href="{{.RelPermalink}}"
43+
>{{ .Name }}</a
44+
>
45+
{{ end -}}
46+
</p>
47+
{{ end -}} {{- end -}}
4748
</div>
48-
49+
</a>
50+
</div>
4951

5052
<style>
51-
.question-tag {
52-
margin-top: 0.5rem;
53-
color: #001824;
54-
border: #001824 2px solid;
55-
border-radius: 25px;
56-
padding: 2px 6px;
57-
font-size: 0.7rem;
58-
text-decoration: none;
59-
}
6053
.question-card {
61-
border: 4px solid #242121;
54+
border: 3px solid #333333;
6255
border-radius: 12px;
6356

6457
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
6558
}
59+
.question-card:hover {
60+
.question-card h3 {
61+
color: #0969da;
62+
text-decoration: underline;
63+
}
64+
}
6665
.question-header {
6766
display: block;
6867
overflow: hidden;
69-
border-radius: 8px 8px 8px 8px;
70-
padding: 20px;
68+
border-radius: 10px 10px 0px 0px;
69+
padding: 16px;
70+
71+
color: #001824;
72+
border-bottom: 3px solid #333333;
73+
74+
75+
}
76+
.question-card-title {
77+
font-weight: 700;
7178
}
7279
.question-card h3 {
7380
margin: 0;
7481
font-size: 1.2rem;
82+
83+
overflow: hidden;
84+
display: -webkit-box;
85+
-webkit-box-orient: vertical;
86+
-webkit-line-clamp: 1;
7587
}
7688
.question-content {
77-
padding: 0 20px 20px 20px;
89+
padding: 16px;
90+
padding-top: 0;
91+
}
92+
.question-card-description {
93+
overflow: hidden;
94+
display: -webkit-box;
95+
-webkit-box-orient: vertical;
96+
-webkit-line-clamp: 4;
97+
color: #303030;
98+
font-weight: 600;
99+
}
100+
.question-tags {
101+
padding: 0 16px 16px 16px;
102+
color: #1a1a1a;
103+
color: #0969da;
104+
border-top: 0px solid #333333;
105+
text-transform: capitalize;
106+
}
107+
.gradient-text {
108+
background: linear-gradient(90deg, #ff7e5f, #feb47b);
109+
-webkit-background-clip: text;
110+
-webkit-text-fill-color: transparent;
111+
margin: 0 0.25rem;
112+
list-style-type: decimal-leading-zero;
78113
}
79114
@media (max-width: 600px) {
80115
.question-header {
@@ -121,11 +156,10 @@ <h3>
121156
color: #b3e5fc;
122157
}
123158
}
124-
125-
126159
</style>
127160

128-
{{/* <script>
161+
{{/*
162+
<script>
129163
window.MathJax = {
130164
tex: {
131165
inlineMath: [
@@ -141,34 +175,41 @@ <h3>
141175
skipHtmlTags: ["script", "noscript", "style", "textarea", "pre"],
142176
},
143177
};
144-
</script> */}}
145-
146-
{{/* MathJax */}}
147-
{{/* <script
178+
</script>
179+
*/}} {{/* MathJax */}} {{/*
180+
<script
148181
type="text/javascript"
149182
async
150183
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
151-
></script> */}}
152-
153-
184+
></script>
185+
*/}}
154186

155187
<script>
156-
window.MathJax = {
157-
tex: {
158-
inlineMath: [['$', '$'], ['\\(', '\\)']],
159-
displayMath: [['$$', '$$'], ['\\[', '\\]']]
160-
},
161-
options: {
162-
enableMenu: false,
163-
elements: document.querySelectorAll('.mathjax')
164-
}
165-
};
188+
window.MathJax = {
189+
tex: {
190+
inlineMath: [
191+
["$", "$"],
192+
["\\(", "\\)"],
193+
],
194+
displayMath: [
195+
["$$", "$$"],
196+
["\\[", "\\]"],
197+
],
198+
},
199+
options: {
200+
enableMenu: false,
201+
elements: document.querySelectorAll(".mathjax"),
202+
},
203+
};
166204
</script>
167-
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js" async></script>
205+
<script
206+
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
207+
async
208+
></script>
168209
<script>
169-
document.addEventListener("DOMContentLoaded", function() {
170-
document.querySelectorAll('.mathjax').forEach(el => {
171-
el.addEventListener('contextmenu', e => e.preventDefault());
210+
document.addEventListener("DOMContentLoaded", function () {
211+
document.querySelectorAll(".mathjax").forEach((el) => {
212+
el.addEventListener("contextmenu", (e) => e.preventDefault());
213+
});
172214
});
173-
});
174215
</script>

layouts/shortcodes/plotly.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@
3232
title: "{{ $title }}",
3333
xaxis: {title: "{{ $xlabel }}"},
3434
yaxis: {title: "{{ $ylabel }}"}
35-
}, {responsive: true});
35+
}, {
36+
responsive: true,
37+
displayModeBar: false // Hides the modebar (menu tools)
38+
});
3639
})();
3740
</script>
3841

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
{{ $wrapper := .Parent.Get "wrapperId" }}
22
<div>
3-
<label class="calc-label" for="formula-{{ $wrapper }}">Formula:</label>
3+
<label class="calc-label" for="formula-{{ $wrapper }}">{{ .Get "label" | default "Formula:" }} =</label>
44
<input class="calc-formula" type="text" id="formula-{{ $wrapper }}" data-calc-formula value="{{ .Get "value" | default "a + b" }}">
5-
</div>
5+
</div>
6+
7+
{{/* <div>
8+
<label class="calc-label" for="formula-{{ $wrapper }}">Formula:</label>
9+
<span class="calc-formula" id="formula-{{ $wrapper }}" data-calc-formula>
10+
{{ .Get "value" | default "a + b" }}
11+
</span>
12+
</div> */}}
13+
14+
{{/* <div>
15+
<label class="calc-label" for="formula-{{ $wrapper }}">
16+
{{ .Get "label" | default "Formula:" }} =
17+
</label>
18+
<p class="calc-formula" id="formula-{{ $wrapper }}" data-calc-formula>
19+
{{ .Get "value" | default "a + b" }}
20+
</p>
21+
</div> */}}

layouts/shortcodes/qna/input.html

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
{{ $wrapper := .Parent.Get "wrapperId" }}
2-
<div>
2+
{{/* <div>
33
<label class="calc-label" for="input-{{ $wrapper }}-{{ .Get "name" }}">{{ .Get "name" | title }}:</label>
44
<input class="calc-input" type="number" id="input-{{ $wrapper }}-{{ .Get "name" }}" data-calc-var="{{ .Get "name" }}" value="{{ .Get "value" | default "0" }}">
5-
</div>
5+
</div> */}}
6+
{{/* <p>
7+
<label class="calc-label" for="input-{{ $wrapper }}-{{ .Get "name" }}">{{ .Get "name" | title }}:</label>
8+
<input class="calc-input" type="number" id="input-{{ $wrapper }}-{{ .Get "name" }}" data-calc-var="{{ .Get "name" }}" value="{{ .Get "value" | default "0" }}">
9+
</p> */}}
10+
11+
{{/* <label class="calc-label" for="input-{{ $wrapper }}-{{ .Get "name" }}">{{ .Get "name" | title }}:</label> */}}
12+
{{/* <input class="calc-input" type="number" id="input-{{ $wrapper }}-{{ .Get "name" }}" data-calc-var="{{ .Get "name" }}" value="{{ .Get "value" | default "0" }}"> */}}
13+
<input class="calc-input" type="number" id="input-{{ $wrapper }}-{{ .Get "name" }}" data-calc-var="{{ .Get "name" }}" value="{{ .Get "value" | default "0" }}">

0 commit comments

Comments
 (0)