Skip to content

Commit c2071af

Browse files
authored
Always show statistical evaluation tab (#82)
* The stats tab is always visible for teachers * Stats are no longer cleared when the quiz is started.
1 parent dd4b48e commit c2071af

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

packages/frontend/src/actors/CurrentQuizActor.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -427,14 +427,14 @@ export class CurrentQuizActor extends StatefulActor<MessageType, Unit | boolean
427427
ChangeState: async newState => {
428428
if (newState === "STARTED") {
429429
if (["ACTIVE", "EDITING", "STOPPED"].includes(this.state.quiz.state)) {
430-
this.send(
431-
`${actorUris.QuizRunActorPrefix}${this.quiz.orElse(toId("-"))}`,
432-
QuizRunActorMessages.Clear()
433-
);
434-
this.send(
435-
`${actorUris.StatsActorPrefix}${this.quiz.orElse(toId("-"))}`,
436-
StatisticsActorMessages.Clear()
437-
);
430+
// this.send(
431+
// `${actorUris.QuizRunActorPrefix}${this.quiz.orElse(toId("-"))}`,
432+
// QuizRunActorMessages.Clear()
433+
// );
434+
// this.send(
435+
// `${actorUris.StatsActorPrefix}${this.quiz.orElse(toId("-"))}`,
436+
// StatisticsActorMessages.Clear()
437+
// );
438438
this.send(
439439
actorUris.QuizActor,
440440
QuizActorMessages.Update({

packages/frontend/src/pages/QuizPage.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ export const QuizPage: React.FC = () => {
137137
// (quizData && quizData.quizStats && (quizData.quizStats.maximumParticipants ?? 0) > 0) ||
138138
// !!quizData?.questionStats;
139139

140-
const showStatTab =
141-
mbQuiz.map(q => (q.quizStats?.maximumParticipants ?? 0) > 0).orElse(false) ||
142-
mbQuiz.map(q => !!q.questionStats).orElse(false);
140+
const showStatTab = true;
141+
// mbQuiz.map(q => (q.quizStats?.maximumParticipants ?? 0) > 0).orElse(false) ||
142+
// mbQuiz.map(q => !!q.questionStats).orElse(false);
143143

144144
// const isQuizStateEditing2 = quizData?.quiz?.state && quizData.quiz.state === "EDITING";
145145
const isQuizStateEditing = mbQuiz.flatMap(q => maybe(q.quiz?.state)).orElse("STOPPED") === "EDITING";
@@ -500,7 +500,7 @@ export const QuizPage: React.FC = () => {
500500
</Tab>
501501
{/* {showStatTab && (isQuizTeacher ? true : isQuizCompleted ) && ( */}
502502
{showStatTab &&
503-
(isUserInTeachersList ? true : isQuizCompleted && studentsCanSeeStatistics) && (
503+
(isUserInTeachersList || (isQuizCompleted && studentsCanSeeStatistics)) && (
504504
<Tab
505505
eventKey={tabRecords.statistics.value}
506506
title={i18n._(tabRecords.statistics.label)}

0 commit comments

Comments
 (0)