Commit 8a235ada authored by Andreas Gärtner's avatar Andreas Gärtner

Merge branch 'master' of git@git.thm.de:arsnova/arsnova-mobile.git

parents 16de79a3 f2ef7fea
......@@ -239,6 +239,11 @@ Ext.define('ARSnova.WebSocket', {
this.socket.emit("readInterposedQuestion", question.getData());
},
readFreetextAnswer: function (answer) {
console.debug("Socket.IO.emit: readFreetextAnswer", answer._id);
this.socket.emit("readFreetextAnswer", answer._id);
},
setLearningProgressOptions: function (data) {
console.debug("Socket.IO.emit: setLearningProgressOptions", data);
this.socket.emit("setLearningProgressOptions", data);
......
......@@ -308,6 +308,11 @@ Ext.define("ARSnova.controller.Questions", {
answer: options.answer
});
if (ARSnova.app.isSessionOwner && options.answer.read === false) {
options.answer.read = true;
ARSnova.app.socket.readFreetextAnswer(options.answer);
}
mainTabPanel.animateActiveItem(freetextDetailAnswerPanel, {
type: 'slide',
direction: 'left',
......
......@@ -155,11 +155,23 @@ Ext.define('ARSnova.view.FreetextAnswerPanel', {
},
itemCls: 'forwardListButton',
itemTpl: [
// Display unread answers for teachers only
itemTpl: Ext.create('Ext.XTemplate',
'<div class="search-item noOverflow">',
'<span style="color:gray">{formattedTime}</span><span style="padding-left:30px">{answerSubject:htmlEncode}</span>',
'</div>'
],
'<span style="color:gray">{formattedTime}</span>',
'<tpl if="read === true || this.isStudent()">',
'<span style="padding-left:30px">{answerSubject:htmlEncode}</span>',
'</tpl>',
'<tpl if="read === false && !this.isStudent()">',
'<span class="thm-red" style="padding-left:30px">{answerSubject:htmlEncode}</span>',
'</tpl>',
'</div>',
{
isStudent: function () {
return ARSnova.app.isSessionOwner !== true;
}
}
),
grouped: true,
deferEmptyText: false,
......
......@@ -47,7 +47,8 @@ Ext.define('FreetextAnswer', {
'sessionId',
'type',
'_rev',
'answerThumbnailImage'
'answerThumbnailImage',
'read'
]
}
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment