Skip to content

Commit

Permalink
basic instruction page
Browse files Browse the repository at this point in the history
  • Loading branch information
root authored and root committed Jul 10, 2023
1 parent 832ff0c commit ba4f7b8
Show file tree
Hide file tree
Showing 5 changed files with 218 additions and 2 deletions.
181 changes: 181 additions & 0 deletions src/components/InstructionPage.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
<template>
<div class="">
<h1 class="text-3xl font-bold m-3 text-center">Instructions</h1>
<h4 class="text-lg font-bold m-6 ">Test Paper Overview</h4>
<!-- Table -->
<div class="w-1/2 m-4 gap-0">
<!-- row-1 -->
<div class="grid grid-cols-2">
<div class=" font-semibold col-span-1 border-1 border-black p-1 pl-2">
Test Name
</div>
<div class="col-span-1 border-1 border-l-0 border-black p-1 pl-2">
{{ $props.title }}
</div>
</div>
<!-- row-2 -->
<div class="grid grid-cols-2">
<div class=" font-semibold col-span-1 border-1 border-t-0 border-black p-1 pl-2">
Test Purpose
</div>
<div class="col-span-1 border-1 border-l-0 border-t-0 border-black p-1 pl-2">
{{ $props.test_purpose }}
</div>
</div>
<!-- row-3 -->
<div class="grid grid-cols-2">
<div class=" font-semibold col-span-1 border-1 border-t-0 border-black p-1 pl-2">
Duration
</div>
<div class="col-span-1 border-1 border-l-0 border-t-0 border-black p-1 pl-2">
{{ ($props.quizTimeLimit)/60 }} min
</div>
</div>
<!-- row-4 -->
<div class="grid grid-cols-2">
<div class=" font-semibold col-span-1 border-1 border-t-0 border-black p-1 pl-2">
Total Marks
</div>
<div class="col-span-1 border-1 border-l-0 border-t-0 border-black p-1 pl-2">
{{ $props.maxMarks }}
</div>
</div>
<!-- row-5 -->
<div class="grid grid-cols-2">
<div class=" font-semibold col-span-1 border-1 border-t-0 border-black p-1 pl-2">
No. of Questions
</div>
<div class="col-span-1 border-1 border-l-0 border-t-0 border-black p-1 pl-2">
{{ $props.maxQuestionsAllowedToAttempt }}
</div>
</div>
<!-- row-6 -->
<div class="grid grid-cols-2">
<div class=" font-semibold col-span-1 border-1 border-t-0 border-black p-1 pl-2">
Subjects
</div>
<div class="col-span-1 border-1 border-l-0 border-t-0 border-black p-1 pl-2">
{{ $props.subject }}
</div>
</div>
<!-- row-7 -->
<div class="grid grid-cols-2">
<div class=" font-semibold col-span-1 border-1 border-t-0 border-black p-1 pl-2">
Type of Questions
</div>
<div class="col-span-1 border-1 border-l-0 border-t-0 border-black p-1 pl-2">
{{ $props.questionType }}
</div>
</div>
<!-- row-8 -->
<div class="grid grid-cols-2">
<div class=" font-semibold col-span-1 border-1 border-t-0 border-black p-1 pl-2">
Marking Scheme
</div>
<div class="col-span-1 border-1 border-l-0 border-t-0 border-black p-1 pl-2">
{{ $props.markingScheme }}
</div>
</div>
<!-- row-9 -->
<div class="grid grid-cols-2">
<div class=" font-semibold col-span-1 border-1 border-t-0 border-black p-1 pl-2">
Quiz Type
</div>
<div class="col-span-1 border-1 border-l-0 border-t-0 border-black p-1 pl-2">
{{ $props.quiz_type }}
</div>
</div>
</div>
<!-- Test Paper Pattern(if FST) -->
<h4 class="text-lg font-bold m-6">General Instructions</h4>
<div class="w-1/2 ml-10">
<ol class="text-justify">
<li>The countdown timer in the top right corner of screen will display the remaining time available for you to complete the examination. When the timer reaches zero, the examination will end by itself. You will not be required to end or submit your examination.</li>
<li>You can click on the "=" button on the top left corner of the page to expand the Question Palette </li>
<li>The Question Palette will show the status of each question using one of the following symbols:
<ol class="ml-7 m-2 list-[lower-alpha]">
<li>You have not visited the question yet.</li>
<li>You have not answered the question.</li>
<li>You have answered the question.</li>
</ol>
</li>
<li>To view the Instructions again, click on the “Instructions” button at the top of the Question Palette. </li>
<li>You can click on the “X” button to the right of the Question Palette to collapse it.</li>
</ol>
</div>
<h4 class="text-lg font-bold m-6">Answering a Question:</h4>
<div class="w-1/2 ml-10">
<ol class="text-justify">
<li>Procedure for answering a multiple choice type question:
<ol class="ml-7 m-2 list-[lower-alpha] text-justify">
<li>To select you answer, click on the button of one of the options.</li>
<li>To deselect your chosen answer, click on the button of the chosen option again or click on the <span><b>Clear Response</b></span> button</li>
<li>To change your chosen answer, click on the button of another option</li>
<li>To save your answer, you <b>MUST</b> click on the Save & Next button.</li>
</ol>
</li>
<li>To change your answer to a question that has already been answered, first select that question for answering and then follow the procedure for answering that type of question.</li>
</ol>
</div>
<div class="w-1/2 mt-5 flex items-center-top">
<p class="text-red-950 text-lg mt-3 ml-7">!</p>
<p class="list-[none] text-justify bg-pink bg-opacity-25 p-3 pt-4 ml-3">Note that selecting an option does NOT save your answer to the current question. Click on <b>Save & Next</b> to save your answer for the current question and then go to the next question.</p>
</div>
<div class="w-1/2 flex items-center-top ml-4 mt-5">
<input type="checkbox" class="mr-2">
<p class="ml-2 text-justify">I have read and understood the instructions. All computer hardware allotted to me are in proper working condition. I declare that I am not in possession of / not wearing / not carrying any prohibited gadget like mobile phone, bluetooth devices etc. /any prohibited material with me into the Examination Hall. I agree that in case of not adhering to the instructions, I shall be liable to be debarred from this Test and/or to disciplinary action, which may include ban from future Tests / Examinations. </p>
</div>

<button></button>
</div>
</template>

<script lang="ts">
import { defineComponent, PropType } from "vue";
import { quizType, quizTitleType, testPurpose } from "../types";
export default defineComponent({
name: "InstructionPage",
props: {
title: {
type: [null, String] as PropType<quizTitleType>,
required: true,
},
subject: {
type: String,
required: true,
},
maxQuestionsAllowedToAttempt: {
type: Number,
required: true,
},
quiz_type: {
type: [null, String] as PropType<quizType>,
required: true
},
maxMarks: {
type: Number,
required: true
},
quizTimeLimit: {
type: Number,
required: true
},
markingScheme: {
required: true,
type: Array
},
questionType: {
required: true,
type: Array
},
test_purpose: {
type: [null, String] as PropType<testPurpose>,
required: true
}
},
mounted() {
console.log(this.test_purpose)
console.log(this.title)
},
})
</script>

Check warning on line 181 in src/components/InstructionPage.vue

View check run for this annotation

Codecov / codecov/patch

src/components/InstructionPage.vue#L2-L181

Added lines #L2 - L181 were not covered by tests
9 changes: 9 additions & 0 deletions src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ const routes = [
requiresAuth: false,
},
},
{
path: "/instruction",
name: "Instruction",
component: () =>
import(/* webpackChunkName: "about" */ "@/components/InstructionPage.vue"),
meta: {
requiresAuth: false,
},
},

Check warning on line 23 in src/router/index.ts

View check run for this annotation

Codecov / codecov/patch

src/router/index.ts#L15-L23

Added lines #L15 - L23 were not covered by tests
{
path: "/forms/jnvenablereports",
name: "FormResults",
Expand Down
4 changes: 3 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

type language = "en" | "hi";
export type quizType = "assessment" | "homework" | "omr-assessment";
export type testPurpose = "Full Syllabus Test" | "Major Test" | "Part Test" | "Chapter Test" | "Hiring Test" | "Evaluation Test";
export type quizTitleType = string | null;
export type textAreaValueType = string | number | null;
export type isFirstSessionType = boolean | null;
Expand Down Expand Up @@ -76,6 +77,7 @@ export interface QuizMetadata {
chapter?: string;
topic?: string;
omr_mode: boolean;
test_purpose: testPurpose;
}

export interface QuestionBucket {
Expand Down Expand Up @@ -119,7 +121,7 @@ interface PartialMarkRule {
marks: number;
}

interface MarkingScheme {
export interface MarkingScheme {
correct: number;
wrong: number;
skipped: number;
Expand Down
22 changes: 21 additions & 1 deletion src/views/Player.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@
data-test="modal"
></QuestionModal>

<InstructionPage
:title="title"
:quiz_type="metadata.quiz_type"
:quizTimeLimit="quizTimeLimit?.max"
:markingScheme="markingScheme"
:maxMarks="maxMarks"
:maxQuestionsAllowedToAttempt="maxQuestionsAllowedToAttempt"
:subject="metadata.subject"
:questionType="questionType"
:test_purpose="metadata.test_purpose"
></InstructionPage>

Check warning on line 86 in src/views/Player.vue

View check run for this annotation

Codecov / codecov/patch

src/views/Player.vue#L75-L86

Added lines #L75 - L86 were not covered by tests
<Scorecard
id="scorecardmodal"
class="absolute z-10"
Expand All @@ -98,6 +110,7 @@
import QuestionModal from "../components/Questions/QuestionModal.vue";
import OmrModal from "../components/Omr/OmrModal.vue"
import Splash from "../components/Splash.vue";
import InstructionPage from "@/components/InstructionPage.vue";

Check warning on line 113 in src/views/Player.vue

View check run for this annotation

Codecov / codecov/patch

src/views/Player.vue#L113

Added line #L113 was not covered by tests
import Scorecard from "../components/Scorecard.vue";
import { resetConfetti, isQuestionAnswerCorrect, isQuestionFetched, createQuestionBuckets } from "../services/Functional/Utilities";
import QuizAPIService from "../services/API/Quiz";
Expand All @@ -122,6 +135,9 @@ import {
questionSetPalette,
TimeLimit,
eventType,
questionType,
MarkingScheme,
testPurpose,

Check warning on line 140 in src/views/Player.vue

View check run for this annotation

Codecov / codecov/patch

src/views/Player.vue#L138-L140

Added lines #L138 - L140 were not covered by tests
} from "../types";
import BaseIcon from "../components/UI/Icons/BaseIcon.vue";
import OrganizationAPIService from "../services/API/Organization";
Expand All @@ -133,7 +149,8 @@ export default defineComponent({
QuestionModal,
Scorecard,
BaseIcon,
OmrModal
OmrModal,
InstructionPage

Check warning on line 153 in src/views/Player.vue

View check run for this annotation

Codecov / codecov/patch

src/views/Player.vue#L152-L153

Added lines #L152 - L153 were not covered by tests
},
props: {
quizId: {
Expand All @@ -157,9 +174,12 @@ export default defineComponent({
currentQuestionIndex: -1 as number,
title: null as quizTitleType,
metadata: {} as QuizMetadata,
questionType: [] as questionType[],

Check warning on line 177 in src/views/Player.vue

View check run for this annotation

Codecov / codecov/patch

src/views/Player.vue#L177

Added line #L177 was not covered by tests
questions: [] as Question[],
responses: [] as SubmittedResponse[], // holds the responses to each item submitted by the viewer
questionSets: [] as QuestionSet[],
markingScheme: [] as MarkingScheme[],
test_purpose: [] as testPurpose[],

Check warning on line 182 in src/views/Player.vue

View check run for this annotation

Codecov / codecov/patch

src/views/Player.vue#L181-L182

Added lines #L181 - L182 were not covered by tests
maxQuestionsAllowedToAttempt: 0,
qsetCumulativeLengths: [] as number[],
currentQsetIndex: 0,
Expand Down
4 changes: 4 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module.exports = {
"primary-hover": "#db7506",
"back-color": "#F78000",
"share-color": "#10B981",
pink: "#E8ADAA",
},
borderWidth: {
1: "1px",
Expand All @@ -26,6 +27,9 @@ module.exports = {
custom: "870px", // Custom breakpoint at 870px
...defaultTheme.screens,
},
listStyleType: {
exclamation: "!",
},
},
plugins: [],
// disabling preflight plugin because one type of default causes problems in the cms question text html code
Expand Down

0 comments on commit ba4f7b8

Please sign in to comment.