# Question item

Source: https://ecosphere.dev/docs/data/question-item (Ecosphere 1.5). Install `vue-ecosphere` for Vue 3 or `react-ecosphere` for React 18.2+/19: same components, props, markup and stylesheet.

A question as it appears in a paper or a marked script: number, question, marks, and what hangs off it.

`import { EcoQuestionItem } from "vue-ecosphere"`

## In a paper, with its provenance

Vue (vue-ecosphere):

```vue
<EcoQuestionItem
  :number="3"
  :marks="5"
  question="A solid cylinder of mass 4 kg and radius 0.2 m rolls without slipping down a 30° incline. Find its linear acceleration and the frictional force acting on it."
  :sources="['NCERT Physics 11 · ch 7.4', 'Board 2023 · Q14']"
  tag="Apply"
/>
```

React (react-ecosphere):

```tsx
<EcoQuestionItem
  number={3}
  marks={5}
  question="A solid cylinder of mass 4 kg and radius 0.2 m rolls without slipping down a 30° incline. Find its linear acceleration and the frictional force acting on it."
  sources={["NCERT Physics 11 · ch 7.4", "Board 2023 · Q14"]}
  tag="Apply"
/>
```

## In a marked script, with its mark scheme

Vue (vue-ecosphere):

```vue
<EcoQuestionItem
  :number="4"
  :marks="3"
  question="State the condition for rolling without slipping and explain why static friction does no work in this case."
  :steps="[
    { label: 'Rolling condition stated · v = Rω', score: '1 / 1' },
    { label: 'Point of contact identified as instantaneously at rest', score: '1 / 1' },
    { label: 'No displacement at the point of application', met: false, score: '0 / 1' },
  ]"
/>
```

React (react-ecosphere):

```tsx
<EcoQuestionItem
  number={4}
  marks={3}
  question="State the condition for rolling without slipping and explain why static friction does no work in this case."
  steps={[
    { label: "Rolling condition stated · v = Rω", score: "1 / 1" },
    { label: "Point of contact identified as instantaneously at rest", score: "1 / 1" },
    { label: "No displacement at the point of application", met: false, score: "0 / 1" },
  ]}
/>
```

## API

Vue (vue-ecosphere):

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `number` | `number \| string` | — | In a fixed 20px column; everything beneath indents to clear it. |
| `question` | `string` | — | The question prose; the default slot overrides it. |
| `marks` | `number \| string` | — | A number renders as “5 marks”, in tabular figures at the end of the top row. |
| `sources` | `string[]` | — | cite chips: where the question came from. An unattributed question is one a teacher has to verify. |
| `tag` | `string` | — | A neutral badge after the sources (“Apply”). |
| `steps` | `EcoChecklistStep[]` | — | The mark scheme as Checklist steps, one per criterion with the marks awarded. |
| `#footer` | `—` | — | Anything else that hangs off the question. |

React (react-ecosphere):

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `number` | `number \| string` | — | In a fixed 20px column; everything beneath indents to clear it. |
| `question` | `string` | — | The question prose; children override it. |
| `marks` | `number \| string` | — | A number renders as “5 marks”, in tabular figures at the end of the top row. |
| `sources` | `string[]` | — | cite chips: where the question came from. An unattributed question is one a teacher has to verify. |
| `tag` | `string` | — | A neutral badge after the sources (“Apply”). |
| `steps` | `EcoChecklistStep[]` | — | The mark scheme as Checklist steps, one per criterion with the marks awarded. |
| `footer` | `ReactNode` | — | Anything else that hangs off the question. |
