Skip to content

Commit

Permalink
Fixes for adaptive content page
Browse files Browse the repository at this point in the history
 - When a graph is used in an interactive block of type score not only
   statements of the currenbt actor are retrieved, but the score was retrieved
   from the the first statement without checking the actor
 - When creating a pie chart with area based on opinionclasses all actors were
   retrieved where this should NOT be the case.
  • Loading branch information
torinfo committed Oct 5, 2022
1 parent aa4fa9f commit c253a55
Showing 1 changed file with 12 additions and 5 deletions.
Expand Up @@ -415,9 +415,9 @@
return true;
} else {
if (
interaction.getAttribute("interactionType") !== "open" &&
interaction.getAttribute("interactionType") !== "opinion" &&
interaction.getAttribute("opinionClass") != undefined
(interaction.getAttribute("interactionType") !== "open" &&
(interaction.getAttribute("interactionType") !== "opinion"
|| interaction.getAttribute("opinionClass") == undefined))
) {
if (interaction.getAttribute("graph") === "true") {
return (
Expand Down Expand Up @@ -1458,7 +1458,7 @@
IncorrectText = "Incorrect";
}
var xertelo = interaction.getAttribute("xertelo");
//var statements = filterOwnStatements(data, xertelo);
var ownstatements = filterOwnStatements(data, xertelo);
var statements = data;
xerteurl = interaction.getAttribute("xerteurl");
xertelabel = interaction.getAttribute("label");
Expand Down Expand Up @@ -1606,7 +1606,14 @@
}
score = score / statements.length;
} else {
score = statements[0].result.score.raw;
// If a graph is also shown, statements might contain statements of other people, select the last one of the current user
if (ownstatements.length > 0) {
score = ownstatements[0].result.score.raw;
}
else
{
score = 0;
}
}
if (interaction.getAttribute("showScore") == "true") {
var txt = scoreLabelText;
Expand Down

0 comments on commit c253a55

Please sign in to comment.