Skip to content

Commit

Permalink
Toggle view (#91)
Browse files Browse the repository at this point in the history
* Adding new visualization option for student progress

* Fixing username list

* removing conflict
  • Loading branch information
mfstabile authored and zMendes committed Sep 2, 2023
1 parent 3bb08f3 commit 973f032
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 11 additions & 3 deletions backend/app/dashboard/static/dashboard-progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ function createHandsontable(data, columns_list) {

function updateHandsontable(data, columns_list) {
data = filterStudentsInClass(data);

ret = generateMatrix(data, columns_list)
usernames = ret[0]
zvals = ret[1]
data_h[0]['x'] = columns_list.slice(1);
data_h[0]['y'] = usernames;
data_h[0]['z'] = zvals;
Plotly.redraw('chart');

ret = generateMatrix(data, columns_list)
zvals = ret[1]
Expand Down Expand Up @@ -167,7 +175,6 @@ function generateMatrix(tableData, columns){
});
zvals.push(studentvals)
});
console.log(usernames)
return [usernames.reverse(), zvals.reverse()]
}

Expand Down Expand Up @@ -210,7 +217,8 @@ document.addEventListener("DOMContentLoaded", function () {

createHandsontable(tableData, columns);

ret = generateMatrix(tableData, columns)
data = filterStudentsInClass(tableData);
ret = generateMatrix(data, columns)
usernames = ret[0]
zvals = ret[1]
data_h = [
Expand Down Expand Up @@ -238,7 +246,7 @@ document.addEventListener("DOMContentLoaded", function () {
},
xaxis: {showticklabels: false, ticks: "", side:"top"},
showlegend: false,
height: usernames.length * 20,
height: Math.max(400, usernames.length * 25),
autosize: true
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ <h1>Class Progress</h1>
{% endfor %}
</datalist>
</div>
<button onclick="toggleVisibility()" class="btn btn-secondary">Alternar visualização</button>
<button onclick="toggleVisibility()" class="btn btn-secondary">Toggle visualization</button>
</div>
{% endif %}

Expand Down

0 comments on commit 973f032

Please sign in to comment.