Corrected expId
This commit is contained in:
parent
a6594f5119
commit
dfd9b8b3d9
|
@ -1008,6 +1008,7 @@ DBReq.LastExpGetter.prototype.execute = function() {
|
||||||
' coin_7, \n' +
|
' coin_7, \n' +
|
||||||
' coin_8, \n' +
|
' coin_8, \n' +
|
||||||
' Experiment.recommendation_style AS "recommendationStyle", \n' +
|
' Experiment.recommendation_style AS "recommendationStyle", \n' +
|
||||||
|
' Experiment.id AS "expId", \n' +
|
||||||
' CoinCombination.id as "coinCombinationId" \n' +
|
' CoinCombination.id as "coinCombinationId" \n' +
|
||||||
'FROM Experiment, CoinCombination \n' +
|
'FROM Experiment, CoinCombination \n' +
|
||||||
'WHERE Experiment.coin_combination_id = CoinCombination.id \n' +
|
'WHERE Experiment.coin_combination_id = CoinCombination.id \n' +
|
||||||
|
@ -1038,6 +1039,7 @@ DBReq.LastExpGetter.prototype.execute = function() {
|
||||||
result.rows[0].coin_8
|
result.rows[0].coin_8
|
||||||
];
|
];
|
||||||
self.finalResult.coinCombinationId = result.rows[0].coinCombinationId;
|
self.finalResult.coinCombinationId = result.rows[0].coinCombinationId;
|
||||||
|
self.finalResult.expId = result.rows[0].expId;
|
||||||
self.finish();
|
self.finish();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -1049,6 +1051,7 @@ DBReq.LastExpGetter.prototype.finish = function() {
|
||||||
this.release = null;
|
this.release = null;
|
||||||
|
|
||||||
this.finishAction(
|
this.finishAction(
|
||||||
|
this.finalResult.expId,
|
||||||
this.finalResult.sceneId,
|
this.finalResult.sceneId,
|
||||||
this.finalResult.coinCombinationId,
|
this.finalResult.coinCombinationId,
|
||||||
this.finalResult.recommendationStyle,
|
this.finalResult.recommendationStyle,
|
||||||
|
|
|
@ -79,7 +79,7 @@ module.exports.play = function(req, res) {
|
||||||
|
|
||||||
req.session.experiments = req.session.experiments || [];
|
req.session.experiments = req.session.experiments || [];
|
||||||
|
|
||||||
db.getLastExp(req.session.userId, function(sceneId, coinId, recoStyle, coins) {
|
db.getLastExp(req.session.userId, function(expId, sceneId, coinId, recoStyle, coins) {
|
||||||
|
|
||||||
res.locals.scene = sceneToFunction(sceneId);
|
res.locals.scene = sceneToFunction(sceneId);
|
||||||
res.locals.recommendationStyle= recoStyle;
|
res.locals.recommendationStyle= recoStyle;
|
||||||
|
@ -91,6 +91,7 @@ module.exports.play = function(req, res) {
|
||||||
coinCombinationId : coinId
|
coinCombinationId : coinId
|
||||||
});
|
});
|
||||||
|
|
||||||
|
req.session.expId = expId;
|
||||||
req.session.save();
|
req.session.save();
|
||||||
|
|
||||||
// Prepare next experiment
|
// Prepare next experiment
|
||||||
|
|
Loading…
Reference in New Issue