Skip to content

Commit 2614476

Browse files
Nicolas AlexandropoulosNicolas Alexandropoulos
authored andcommitted
mathematical notation is now recognized by mathjax, description popup should display correctly + less / css files harmonization
1 parent c06a98b commit 2614476

File tree

6 files changed

+29
-35
lines changed

6 files changed

+29
-35
lines changed

edit_matrix_form.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,8 @@ function add_matrix()
260260
$matrix[] = $builder->create_static('<td>');
261261

262262
$matrix[] = $builder->create_static('<div class="input-group">');
263-
$matrix[] = $builder->create_text("rows_shorttext[$row]", false);
264263

264+
$matrix[] = $builder->create_text("rows_shorttext[$row]", false);
265265
$question_popup = $builder->create_htmlpopup("rows_description[$row]", lang::row_long());
266266
$matrix = array_merge($matrix, $question_popup);
267267
$matrix[] = $builder->create_hidden("rowid[$row]");
@@ -272,7 +272,7 @@ function add_matrix()
272272
for ($col = 0; $col < $cols_count; $col++) {
273273
$matrix[] = $builder->create_static('<td>');
274274
$cell_content = $grading->create_cell_element($mform, $row, $col, $multiple);
275-
$cell_content = $cell_content ? $cell_content : $builder->create_static('');
275+
$cell_content = $cell_content ?: $builder->create_static('');
276276
$matrix[] = $cell_content;
277277
$matrix[] = $builder->create_static('</td>');
278278
}

renderer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ public static function matrix_header($header)
9696
if (strip_tags($description)) {
9797
$description = preg_replace('-^<p>-', '', $description);
9898
$description = preg_replace('-</p>$-', '', $description);
99-
$description = '<span class="description" >' . $description . '</span>';
99+
$description = '<span class="description" >' . format_text($description) . '</span>';
100100
} else {
101101
$description = '';
102102
}
103103

104-
return '<span class="title">' . $text . '</span>' . $description;
104+
return '<span class="title">' . format_text($text) . '</span>' . $description;
105105
}
106106

107107
protected static function checkbox($name, $checked, $readonly)

styles.css

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@
138138
min-width: 383px;
139139
padding: 0;
140140
margin-left: 0;
141+
z-index: 1;
141142
}
142143
.quedit.matrix .popup .title {
143144
display: block;
@@ -177,12 +178,6 @@
177178
background-position: 1px center;
178179
padding-left: 20px;
179180
}
180-
#id_add_rows, #id_add_cols{
181-
font-size: 22px;
182-
background-color: white;
183-
color: black;
184-
padding: 0px 5px 5px 5px;
185-
}
186181
/*
187182
mod_ND : BEGIN
188183
// TODO add .qtype_matrix_dndui selector where needed
@@ -214,7 +209,8 @@ mod_ND : BEGIN
214209
cursor: auto;
215210
opacity: 0.3;
216211
}
217-
.que.matrix.qtype_matrix_dndui .cell span.title, .que.matrix.qtype_matrix_dndui .cell.ui-droppable > span {
212+
.que.matrix.qtype_matrix_dndui .cell span.title,
213+
.que.matrix.qtype_matrix_dndui .cell.ui-droppable > span {
218214
padding: 1em 2em 1em 1em;
219215
border: 0.2em solid #999;
220216
position: relative;
@@ -252,6 +248,13 @@ body#page-question-type-matrix #page-content {
252248
body#page-question-type-matrix div#region-main {
253249
overflow-x: scroll;
254250
}
251+
#id_add_rows,
252+
#id_add_cols {
253+
font-size: 22px;
254+
background-color: white;
255+
color: black;
256+
padding: 0px 5px 5px 5px;
257+
}
255258
/*
256259
mod_ND : END
257260
*/

stylesheets/less/base.less

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
.description {
5151
display: none;
52-
position: fixed !important;
52+
position: absolute;
5353

5454
background-color: #EEEEEE;
5555
border: 1px solid @border-color;
@@ -71,7 +71,7 @@
7171
}
7272
&:hover{
7373
.description{
74-
display: inline-block;
74+
display: block;
7575
}
7676
}
7777
}
@@ -83,7 +83,7 @@
8383
}
8484
&:hover{
8585
.description{
86-
display: inline-block;
86+
display: block;
8787
}
8888
}
8989
}
@@ -190,6 +190,7 @@
190190
min-width: 383px;
191191
padding: 0;
192192
margin-left: 0;
193+
z-index: 1;
193194

194195
.title {
195196
display: block;
@@ -231,4 +232,3 @@
231232
color: #000000;
232233
}
233234
}
234-

stylesheets/less/dndui.less

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ mod_ND : BEGIN
3838
opacity: 0.3;
3939
}
4040

41-
.que.matrix.qtype_matrix_dndui .cell span {
41+
.que.matrix.qtype_matrix_dndui .cell span.title, .que.matrix.qtype_matrix_dndui .cell.ui-droppable > span {
4242
padding: 1em 2em 1em 1em;
4343
border: 0.2em solid #999;
4444
position: relative;
@@ -85,6 +85,13 @@ body#page-question-type-matrix div#region-main {
8585
overflow-x: scroll;
8686
}
8787

88+
#id_add_rows, #id_add_cols{
89+
font-size: 22px;
90+
background-color: white;
91+
color: black;
92+
padding: 0px 5px 5px 5px;
93+
}
94+
8895
/*
8996
mod_ND : END
9097
*/

stylesheets/less/pix.less

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,8 @@
22
#id_refresh_matrix {
33
background-image: url([[pix:a/refresh]]);
44
background-repeat: no-repeat;
5+
background-color: white;
6+
color: black;
57
background-position: 1px center;
68
padding-left: 20px;
7-
}
8-
9-
.pbutton.close {
10-
background-image: url([[pix:qtype_matrix|close]]);
11-
background-repeat: no-repeat;
12-
background-position: center center;
13-
vertical-align: super;
14-
width: 20px;
15-
height: 20px;
16-
color: transparent;
17-
}
18-
19-
.button.add {
20-
background-image: url([[pix:qtype_matrix|add]]);
21-
background-repeat: no-repeat;
22-
background-position: center center;
23-
display: inline-block;
24-
min-width: 25px;
25-
}
9+
}

0 commit comments

Comments
 (0)