Skip to content

Commit ff2c21b

Browse files
committed
Merge pull request #493 from dpalou/MOBILE-1600
MOBILE-1600 quiz: Show question if text is empty
2 parents 7980e67 + 91202a1 commit ff2c21b

File tree

14 files changed

+14
-15
lines changed

14 files changed

+14
-15
lines changed

www/addons/qtype/ddimageortext/directive.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ angular.module('mm.addons.qtype_ddimageortext')
4343

4444
ddarea = questionEl.querySelector('.ddarea');
4545
question.text = $mmUtil.getContentsOfElement(questionEl, '.qtext');
46-
if (!ddarea || !question.text) {
46+
if (!ddarea || typeof question.text == 'undefined') {
4747
log.warn('Aborting because of an error parsing question.', question.name);
4848
return self.showDirectiveError(scope);
4949
}

www/addons/qtype/ddimageortext/template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<section class="list mma-qtype-ddimageortext-container" ng-if="question.text">
1+
<section class="list mma-qtype-ddimageortext-container" ng-if="question.text || question.text === ''">
22
<mm-loading hide-until="question.loaded"></mm-loading>
33
<!-- Content is outside the mm-loading to let the script calculate drag items position -->
44
<div ng-class="{invisible: !question.loaded}" class="item item-text-wrap">

www/addons/qtype/ddmarker/directive.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ angular.module('mm.addons.qtype_ddmarker')
4444
ddarea = questionEl.querySelector('.ddarea');
4545
ddform = questionEl.querySelector('.ddform');
4646
question.text = $mmUtil.getContentsOfElement(questionEl, '.qtext');
47-
if (!ddarea || !ddform || !question.text) {
47+
if (!ddarea || !ddform || typeof question.text == 'undefined') {
4848
log.warn('Aborting because of an error parsing question.', question.name);
4949
return self.showDirectiveError(scope);
5050
}

www/addons/qtype/ddmarker/template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<section class="list mma-qtype-ddmarker-container" ng-if="question.text">
1+
<section class="list mma-qtype-ddmarker-container" ng-if="question.text || question.text === ''">
22
<mm-loading hide-until="question.loaded"></mm-loading>
33
<!-- Content is outside the mm-loading to let the script calculate drag items position -->
44
<div ng-class="{invisible: !question.loaded}" class="item item-text-wrap">

www/addons/qtype/ddwtos/directive.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ angular.module('mm.addons.qtype_ddwtos')
5858
question.answers = answersEl.outerHTML;
5959

6060
question.text = $mmUtil.getContentsOfElement(questionEl, '.qtext');
61-
if (!question.text) {
61+
if (typeof question.text == 'undefined') {
6262
log.warn('Aborting because of an error parsing question.', question.name);
6363
return self.showDirectiveError(scope);
6464
}

www/addons/qtype/ddwtos/template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<section class="list mma-qtype-ddwtos-container" ng-if="question.text">
1+
<section class="list mma-qtype-ddwtos-container" ng-if="question.text || question.text === ''">
22
<div class="item item-text-wrap">
33
<p ng-if="!question.readonly" class="item-howto item item-icon-left"><i class="icon ion-information"></i> {{ 'mm.question.howtodraganddrop' | translate }}</p>
44
<p><mm-format-text watch="true" class="mm-content-with-float">{{ question.text }}</mm-format-text></p>

www/addons/qtype/description/template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<section class="list" ng-if="question.text">
1+
<section class="list" ng-if="question.text || question.text === ''">
22
<!-- "Seen" hidden input -->
33
<input ng-if="seenInput" type="hidden" name="{{seenInput.name}}" value="{{seenInput.value}}" >
44
<div class="item item-text-wrap">

www/addons/qtype/essay/template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<section class="list" ng-if="question.text">
1+
<section class="list" ng-if="question.text || question.text === ''">
22
<div class="item item-text-wrap">
33
<p><mm-format-text watch="true" class="mm-content-with-float">{{ question.text }}</mm-format-text></p>
44
</div>

www/addons/qtype/gapselect/template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<section class="list mma-qtype-gapselect-container" ng-if="question.text">
1+
<section class="list mma-qtype-gapselect-container" ng-if="question.text || question.text === ''">
22
<div class="item item-text-wrap">
33
<p><mm-format-text watch="true" class="mm-content-with-float">{{ question.text }}</mm-format-text></p>
44
</div>

www/addons/qtype/multianswer/template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<section class="list mma-qtype-multianswer-container" ng-if="question.text">
1+
<section class="list mma-qtype-multianswer-container" ng-if="question.text || question.text === ''">
22
<div class="item item-text-wrap">
33
<p><mm-format-text watch="true" class="mm-content-with-float">{{ question.text }}</mm-format-text></p>
44
</div>

0 commit comments

Comments
 (0)