Skip to content

Commit

Permalink
#3059 - changed TextInputAnswer to use MarkdownText component
Browse files Browse the repository at this point in the history
  • Loading branch information
rmmayo committed Jan 2, 2025
1 parent 2d338d8 commit 323d3fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ import MarkdownText from '@/common-components/utilities/markdown/MarkdownText.vu
import SelectCorrectAnswer from '@/components/quiz/testCreation/SelectCorrectAnswer.vue';
import QuestionType from '@/skills-display/components/quiz/QuestionType.js';
import SkillsOverlay from "@/components/utils/SkillsOverlay.vue";
import DateCell from "@/components/utils/table/DateCell.vue";
import SlimDateCell from "@/components/utils/table/SlimDateCell.vue";
import {useTimeUtils} from "@/common-components/utilities/UseTimeUtils.js";
import { useTimeUtils } from "@/common-components/utilities/UseTimeUtils.js";
const props = defineProps({
quizType: String,
Expand Down Expand Up @@ -114,7 +112,9 @@ const manuallyGradedInfo = computed(() => {
<Rating class="flex-initial py-3 px-4" v-model="surveyScore" :stars="numberOfStars" readonly :cancel="false"/>
</div>
<div v-if="isTextInputType" class="border-1 border-300 border-round p-3 w-full" data-cy="TextInputAnswer">
<pre>{{ answerText }}</pre>
<MarkdownText
:text="answerText"
:instance-id="`${question.id}_answer`"/>
</div>
<div v-if="manuallyGradedInfo" class="mt-3 w-full border-1 p-3 border-round surface-border" data-cy="manuallyGradedInfo">
<div class="text-xl mb-3 font-semibold">Manually Graded</div>
Expand Down
5 changes: 3 additions & 2 deletions e2e-tests/cypress/e2e/quiz/grade_quiz_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe('Grade Quizzes', () => {
cy.createQuizDef(1);
cy.createTextInputQuestionDef(1, 1)

cy.runQuizForUser(1, 1, [{selectedIndex: [0]}], true, 'My Answer')
cy.runQuizForUser(1, 1, [{selectedIndex: [0]}], true, '**My Answer**')

cy.visit('/administrator/quizzes/quiz1/grading');
cy.get('[data-cy="gradeBtn_user1"]').should('be.enabled').click()
Expand Down Expand Up @@ -100,7 +100,8 @@ describe('Grade Quizzes', () => {
cy.get('[data-cy="numQuestionsToPass"]').contains('1 / 1')

cy.get('[data-cy="questionDisplayCard-1"] [data-cy="questionDisplayText"]').contains('This is a question # 1')
cy.get('[data-cy="questionDisplayCard-1"] [data-cy="TextInputAnswer"]').contains('My Answer')
cy.get('[data-cy="questionDisplayCard-1"] [data-cy="TextInputAnswer"]').should('contain.text', 'My Answer')
cy.get('[data-cy="questionDisplayCard-1"] [data-cy="TextInputAnswer"]').should('not.contain.text', '**My Answer**')
cy.get('[data-cy="questionDisplayCard-1"] [data-cy="wrongAnswer"]').should('not.exist')

cy.get('[data-cy="questionDisplayCard-1"] [data-cy="manuallyGradedInfo"] [data-cy="grader"]').contains(defaultUser)
Expand Down

0 comments on commit 323d3fa

Please sign in to comment.