Skip to content

Commit

Permalink
Merge pull request #53 from NicoAlexH/dev
Browse files Browse the repository at this point in the history
mathematical notation is now recognized by mathjax, description popup…
  • Loading branch information
ndunand authored Aug 18, 2021
2 parents c06a98b + 2614476 commit 3456a10
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 35 deletions.
4 changes: 2 additions & 2 deletions edit_matrix_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ function add_matrix()
$matrix[] = $builder->create_static('<td>');

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

$matrix[] = $builder->create_text("rows_shorttext[$row]", false);
$question_popup = $builder->create_htmlpopup("rows_description[$row]", lang::row_long());
$matrix = array_merge($matrix, $question_popup);
$matrix[] = $builder->create_hidden("rowid[$row]");
Expand All @@ -272,7 +272,7 @@ function add_matrix()
for ($col = 0; $col < $cols_count; $col++) {
$matrix[] = $builder->create_static('<td>');
$cell_content = $grading->create_cell_element($mform, $row, $col, $multiple);
$cell_content = $cell_content ? $cell_content : $builder->create_static('');
$cell_content = $cell_content ?: $builder->create_static('');
$matrix[] = $cell_content;
$matrix[] = $builder->create_static('</td>');
}
Expand Down
4 changes: 2 additions & 2 deletions renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ public static function matrix_header($header)
if (strip_tags($description)) {
$description = preg_replace('-^<p>-', '', $description);
$description = preg_replace('-</p>$-', '', $description);
$description = '<span class="description" >' . $description . '</span>';
$description = '<span class="description" >' . format_text($description) . '</span>';
} else {
$description = '';
}

return '<span class="title">' . $text . '</span>' . $description;
return '<span class="title">' . format_text($text) . '</span>' . $description;
}

protected static function checkbox($name, $checked, $readonly)
Expand Down
17 changes: 10 additions & 7 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
min-width: 383px;
padding: 0;
margin-left: 0;
z-index: 1;
}
.quedit.matrix .popup .title {
display: block;
Expand Down Expand Up @@ -177,12 +178,6 @@
background-position: 1px center;
padding-left: 20px;
}
#id_add_rows, #id_add_cols{
font-size: 22px;
background-color: white;
color: black;
padding: 0px 5px 5px 5px;
}
/*
mod_ND : BEGIN
// TODO add .qtype_matrix_dndui selector where needed
Expand Down Expand Up @@ -214,7 +209,8 @@ mod_ND : BEGIN
cursor: auto;
opacity: 0.3;
}
.que.matrix.qtype_matrix_dndui .cell span.title, .que.matrix.qtype_matrix_dndui .cell.ui-droppable > span {
.que.matrix.qtype_matrix_dndui .cell span.title,
.que.matrix.qtype_matrix_dndui .cell.ui-droppable > span {
padding: 1em 2em 1em 1em;
border: 0.2em solid #999;
position: relative;
Expand Down Expand Up @@ -252,6 +248,13 @@ body#page-question-type-matrix #page-content {
body#page-question-type-matrix div#region-main {
overflow-x: scroll;
}
#id_add_rows,
#id_add_cols {
font-size: 22px;
background-color: white;
color: black;
padding: 0px 5px 5px 5px;
}
/*
mod_ND : END
*/
8 changes: 4 additions & 4 deletions stylesheets/less/base.less
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

.description {
display: none;
position: fixed !important;
position: absolute;

background-color: #EEEEEE;
border: 1px solid @border-color;
Expand All @@ -71,7 +71,7 @@
}
&:hover{
.description{
display: inline-block;
display: block;
}
}
}
Expand All @@ -83,7 +83,7 @@
}
&:hover{
.description{
display: inline-block;
display: block;
}
}
}
Expand Down Expand Up @@ -190,6 +190,7 @@
min-width: 383px;
padding: 0;
margin-left: 0;
z-index: 1;

.title {
display: block;
Expand Down Expand Up @@ -231,4 +232,3 @@
color: #000000;
}
}

9 changes: 8 additions & 1 deletion stylesheets/less/dndui.less
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ mod_ND : BEGIN
opacity: 0.3;
}

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

#id_add_rows, #id_add_cols{
font-size: 22px;
background-color: white;
color: black;
padding: 0px 5px 5px 5px;
}

/*
mod_ND : END
*/
22 changes: 3 additions & 19 deletions stylesheets/less/pix.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,8 @@
#id_refresh_matrix {
background-image: url([[pix:a/refresh]]);
background-repeat: no-repeat;
background-color: white;
color: black;
background-position: 1px center;
padding-left: 20px;
}

.pbutton.close {
background-image: url([[pix:qtype_matrix|close]]);
background-repeat: no-repeat;
background-position: center center;
vertical-align: super;
width: 20px;
height: 20px;
color: transparent;
}

.button.add {
background-image: url([[pix:qtype_matrix|add]]);
background-repeat: no-repeat;
background-position: center center;
display: inline-block;
min-width: 25px;
}
}

0 comments on commit 3456a10

Please sign in to comment.