Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Privacy
Imprint
Contact
Login methods
Sign in
Toggle navigation
Menu
Open sidebar
Tim Häuser
ARSnova Mobile
Commits
0ea10301
Commit
0ea10301
authored
May 20, 2015
by
Andreas Gärtner
Browse files
Task #15866: Seperate answer count in AudienceQuestionPanel by pi round.
parent
fdf657f3
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/main/webapp/app/controller/Questions.js
View file @
0ea10301
...
...
@@ -87,6 +87,10 @@ Ext.define("ARSnova.controller.Questions", {
question
.
getTotalAnswerCountByQuestion
.
apply
(
question
,
arguments
);
},
getAllRoundAnswerCountByQuestion
:
function
(
questionId
,
callbacks
)
{
ARSnova
.
app
.
questionModel
.
getAllRoundAnswerCountByQuestion
(
questionId
,
callbacks
);
},
listFeedbackQuestions
:
function
(
animation
)
{
ARSnova
.
app
.
mainTabPanel
.
tabPanel
.
animateActiveItem
(
ARSnova
.
app
.
mainTabPanel
.
tabPanel
.
feedbackQuestionsPanel
,
animation
||
'
slide
'
);
},
...
...
src/main/webapp/app/model/Question.js
View file @
0ea10301
...
...
@@ -351,6 +351,10 @@ Ext.define('ARSnova.model.Question', {
return
this
.
getProxy
().
getTotalAnswerCountByQuestion
(
questionId
,
callbacks
);
},
getAllRoundAnswerCountByQuestion
:
function
(
questionId
,
callbacks
)
{
return
this
.
getProxy
().
getAllRoundAnswerCountByQuestion
(
questionId
,
callbacks
);
},
getAnsweredFreetextQuestions
:
function
(
sessionKeyword
,
questionId
,
callbacks
)
{
return
this
.
getProxy
().
getAnsweredFreetextQuestions
(
sessionKeyword
,
questionId
,
callbacks
);
},
...
...
src/main/webapp/app/proxy/RestProxy.js
View file @
0ea10301
...
...
@@ -716,6 +716,14 @@ Ext.define('ARSnova.proxy.RestProxy', {
});
},
getAllRoundAnswerCountByQuestion
:
function
(
questionId
,
callbacks
)
{
this
.
arsjax
.
request
({
url
:
"
lecturerquestion/
"
+
questionId
+
"
/allroundanswercount
"
,
success
:
callbacks
.
success
,
failure
:
callbacks
.
failure
});
},
getTotalAnswerCountByQuestion
:
function
(
questionId
,
callbacks
)
{
this
.
arsjax
.
request
({
url
:
"
lecturerquestion/
"
+
questionId
+
"
/totalanswercount
"
,
...
...
src/main/webapp/app/view/LearningProgressPanel.js
View file @
0ea10301
...
...
@@ -85,7 +85,6 @@ Ext.define('ARSnova.view.LearningProgressPanel', {
var
options
=
ARSnova
.
app
.
getController
(
'
Sessions
'
).
getLearningProgressOptions
();
if
(
field
.
getValue
()
===
options
.
questionVariant
)
{
field
.
check
();
console
.
log
(
field
.
getValue
(),
options
);
}
this
.
showProgress
(
options
);
};
...
...
src/main/webapp/app/view/speaker/AudienceQuestionPanel.js
View file @
0ea10301
...
...
@@ -88,14 +88,36 @@ Ext.define('ARSnova.view.speaker.AudienceQuestionPanel', {
},
itemCls
:
'
forwardListButton
'
,
itemTpl
:
'
<tpl if="!active"><div class="isInactive buttontext noOverflow">{text:htmlEncode}</div>
'
+
'
<tpl else>
'
+
'
<tpl if="votingDisabled"><div class="isVoteInactive buttontext noOverflow">{text:htmlEncode}</div>
'
+
'
<tpl else><div class="buttontext noOverflow">{text:htmlEncode}</div></tpl>
'
+
'
</tpl>
'
+
'
<div class="x-button x-hasbadge audiencePanelListBadge">
'
+
'
<tpl if="numAnswers > 0"><span class="answersBadgeIcon badgefixed">{numAnswers}</span></tpl></div>
'
,
itemTpl
:
Ext
.
create
(
'
Ext.XTemplate
'
,
'
<tpl if="!active"><div class="isInactive buttontext noOverflow">{text:htmlEncode}</div>
'
,
'
<tpl else>
'
,
'
<tpl if="votingDisabled"><div class="isVoteInactive buttontext noOverflow">{text:htmlEncode}</div>
'
,
'
<tpl else><div class="buttontext noOverflow">{text:htmlEncode}</div></tpl>
'
,
'
</tpl>
'
,
'
<div class="x-button x-hasbadge audiencePanelListBadge">
'
,
'
<tpl if="this.hasAnswers(values.numAnswers)"><span class="answersBadgeIcon badgefixed">
'
,
'
{[this.getFormattedCount(values)]}</span>
'
,
'
</tpl></div>
'
,
{
hasAnswers
:
function
(
numAnswers
)
{
if
(
!!
numAnswers
)
{
return
numAnswers
.
reduce
(
function
(
ro
,
rt
)
{
return
ro
+
rt
;
},
0
)
>
0
;
}
return
false
;
},
getFormattedCount
:
function
(
questionObj
)
{
if
(
questionObj
.
piRound
===
2
)
{
return
questionObj
.
numAnswers
[
0
]
+
'
|
'
+
questionObj
.
numAnswers
[
1
];
}
else
{
return
questionObj
.
numAnswers
[
0
];
}
}
}
),
grouped
:
true
,
store
:
this
.
questionStore
,
...
...
@@ -373,12 +395,14 @@ Ext.define('ARSnova.view.speaker.AudienceQuestionPanel', {
getQuestionAnswers
:
function
()
{
var
me
=
this
;
var
getAnswerCount
=
function
(
questionRecord
,
promise
)
{
me
.
getController
().
get
Total
AnswerCountByQuestion
(
questionRecord
.
get
(
'
_id
'
),
{
me
.
getController
().
get
AllRound
AnswerCountByQuestion
(
questionRecord
.
get
(
'
_id
'
),
{
success
:
function
(
response
)
{
var
numAnswers
=
Ext
.
decode
(
response
.
responseText
);
questionRecord
.
set
(
'
numAnswers
'
,
numAnswers
);
promise
.
resolve
({
hasAnswers
:
numAnswers
>
0
hasAnswers
:
numAnswers
.
reduce
(
function
(
ro
,
rt
)
{
return
ro
+
rt
;
},
0
)
>
0
});
},
failure
:
function
()
{
...
...
src/main/webapp/resources/css/arsnova.css
View file @
0ea10301
...
...
@@ -98,7 +98,7 @@ code {
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
padding-right
:
40
px
;
padding-right
:
55
px
;
}
.x-item-disabled
input
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment