Skip to content

Commit

Permalink
Avoid select question text for reading comprehension #1896
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelFQC committed May 2, 2017
1 parent 3647bf3 commit c9fae5d
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 16 deletions.
2 changes: 1 addition & 1 deletion main/exercise/ReadingComprehension.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function processText($text)
$indexes = array_keys($words);

$tagEnd = '</span>';
$tagStart = $tagEnd.'<span class="text-highlight blur">';
$tagStart = $tagEnd.'<span class="text-highlight">';
$this->wordsCount = count($words);

$turns = ceil(
Expand Down
53 changes: 38 additions & 15 deletions main/template/default/exercise/reading_comprehension.tpl
Original file line number Diff line number Diff line change
@@ -1,29 +1,52 @@
<div class="question-{{ id }}">
<div id="question-{{ id }}-text" class="center-block question-text" onselectstart="return false">
<div id="question-{{ id }}" class="question-reading-comprehension-container">
<div class="question-reading-comprehension-overlay"></div>
<div id="question-{{ id }}-text" class="center-block question-reading-comprehension-text" onselectstart="return false">
{{ text }}
</div>
</div>

<style>
.question-text {
color: #FFF;
.question-reading-comprehension-container {
position: relative;
}
.question-reading-comprehension-container .question-reading-comprehension-overlay {
bottom: 0;
left: 0;
position: absolute;
right: 0;
top: 0;
}
.question-reading-comprehension-text {
text-align: justify;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.text-highlight.blur {
color:#eee; /* Old browsers don't go transparent. */
text-shadow:
0 0 3px #ddd, /* Many shadows blur out the area around the text */
5px 0 5px #ddd,
0 3px 3px #ddd,
-6px 0 6px #ddd,
0 -3px 3px #ddd;
.question-reading-comprehension-text .text-highlight {
color: transparent;
-webkit-text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
-khtml-text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
-moz-text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
-ms-text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}
.text-highlight.active {
color: rgba(0, 0, 0, 1);
.question-reading-comprehension-text .text-highlight.active {
color: #000;
-webkit-text-shadow: none;
-khtml-text-shadow: none;
-moz-text-shadow: none;
-ms-text-shadow: none;
text-shadow: none;
}
.text-highlight.border {
.question-reading-comprehension-text .text-highlight.border {
color: #bbb;
-webkit-text-shadow: none;
-khtml-text-shadow: none;
-moz-text-shadow: none;
-ms-text-shadow: none;
text-shadow: none;
}
.radio.hide-reading-answers, .question_title.hide-reading-answers {
Expand Down

0 comments on commit c9fae5d

Please sign in to comment.