Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: QTI support is improved #233

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

myhailo-chernyshov-rg
Copy link
Contributor

Description

During the cc2olx converter usage with correct Common Cartridge course .imscc dumps some problems with CC XML processing were encountered. It caused by handling of special cases by the converter while the actual CC XML can be much more complicated. This PR is intended to solve the encountered problems.
Also, it's found out that cc2olx completely ignores the fact that both OeX "Text Problem" and CC "Fill in the blank" support regexps, so their support is added.

Steps to reproduce

Untitled quiz item

  1. Update your Common Cartridge course .imscc dump (or use the attached one
    untitled_quiz_item_dump.imscc.zip but remove .zip extention leaving .imscc): ensure you have the assessment with item that doesn't have title attribute.
    For example,
    ...
    <assessment ident="i13874147-14c5-4849-93a7-7af746fdd86d" title="Capital Cities of the World">
        ...
        <section ident="root_section">
            <item ident="ic8308415-91d6-4655-a4ba-99db7d0c68b3">
                ...
            </item>
        </section>
        ...
    </assessment>
    ...
  2. Run the cc2olx script:
    cc2olx -i path/to/imscc
  3. See a KeyError message.

Section with not root_section identifier

  1. Update your Common Cartridge course .imscc dump (or use the attached one
    section_with_not_root_section_identifier.imscc.zip but remove .zip extention leaving .imscc): ensure you have the assessment with section which ident attribute value isn't root_section.
    For example,
    ...
    <assessment ident="i13874147-14c5-4849-93a7-7af746fdd86d" title="Capital Cities of the World">
        ...
        <section ident="id747a627-25dd-4289-b850-98b134316b50">
            ...
        </section>
        ...
    </assessment>
    ...
  2. Run the cc2olx script:
    cc2olx -i path/to/imscc
  3. Explore the output OLX (or use the generated archive for course import in edX) and ensure that the problems from this section are not presented in the course.

respcondition without continue attribute

  1. Update your Common Cartridge course .imscc dump (or use the attached one respcondition_without_continue_attribute.imscc.zip but remove .zip extention leaving .imscc): ensure you have the assessment with respcondition without continue attribute.
    For example,
    ...
    <assessment ident="i13874147-14c5-4849-93a7-7af746fdd86d" title="Capital Cities of the World">
        ...
        <item ident="ic8308415-91d6-4655-a4ba-99db7d0c68b3" title="The capital city of Australia">
            ...
            <resprocessing>
                ...
                <respcondition>
                    <conditionvar>
                        <varequal respident="i44f42e88-8f56-4a80-9998-567aaacd6c53">i8a6371a5-2741-408e-9f01-8ecec5457f4f</varequal>
                    </conditionvar>
                    <setvar action="Set" varname="SCORE">100</setvar>
                </respcondition>
                ...
            </resprocessing>
            ...
        </item>
        ...
    </assessment>
    ...
  2. Run the cc2olx script:
    cc2olx -i path/to/imscc
  3. See a KeyError message.

material is not direct child of solutionmaterial

  1. Update your Common Cartridge course .imscc dump (or use the attached one material_is_not_direct_child_of_solutionmaterial.zip but remove .zip extention leaving .imscc): ensure you have the assessment with itemfeedback, itemfeedback has solution child, solution has solutionmaterial, material is not a direct child of solutionmaterial: flow_mat is a solutionmaterial child, material is a flow_mat child.
    For example,
    ...
    <assessment ident="i13874147-14c5-4849-93a7-7af746fdd86d" title="Capital Cities of the World">
        ...
        <item ident="ic8308415-91d6-4655-a4ba-99db7d0c68b3" title="The capital city of Australia">
            ...
            <itemfeedback ident="solution">
                <solution>
                    <solutionmaterial>
                        <flow_mat>
                            <material>
                                <mattext texttype="text/html"></mattext>
                            </material>
                        </flow_mat>
                    </solutionmaterial>
                </solution>
            </itemfeedback>
            <itemfeedback ident="general_fb">
                <flow_mat>
                    <material>
                        <mattext texttype="text/html"></mattext>
                    </material>
                </flow_mat>
            </itemfeedback>
            ...
        </item>
        ...
    </assessment>
    ...
  2. Run the cc2olx script:
    cc2olx -i path/to/imscc
  3. See a AttributeError message.

Fill in the blank with regexp

  1. Update your Common Cartridge course .imscc dump (or use the attached one fib_with_regexp.imscc.zip but remove .zip extention leaving .imscc): ensure you have the Fill in the blank assessment with resprocessing that contains respcondition with varsubstring in conditionvar.
    For example,
    ...
    <assessment ident="i13874147-14c5-4849-93a7-7af746fdd86d" title="Capital Cities of the World">
        ...
        <item ident="ic8308415-91d6-4655-a4ba-99db7d0c68b3" title="The largest city in Switzerland">
            ...
            <resprocessing>
                <outcomes>
                    <decvar minvalue="0" maxvalue="100" varname="SCORE" vartype="Decimal" />
                </outcomes>
                <respcondition continue="No">
                    <conditionvar>
                        <varsubstring respident="32693">Z[uü]rich</varsubstring>
                    </conditionvar>
                    <setvar action="Set" varname="SCORE">100</setvar>
                </respcondition>
                <respcondition continue="Yes">
                    <conditionvar>
                        <other />
                    </conditionvar>
                    <setvar action="Set" varname="SCORE">0</setvar>
                </respcondition>
            </resprocessing>
            ...
        </item>
        ...
    </assessment>
    ...
  2. Run the cc2olx script:
    cc2olx -i path/to/imscc
  3. See a IndexError message.

Deadline

"None"

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Nov 22, 2024
@openedx-webhooks
Copy link

openedx-webhooks commented Nov 22, 2024

Thanks for the pull request, @myhailo-chernyshov-rg!

What's next?

Please work through the following steps to get your changes ready for engineering review:

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.

🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads

🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

🔘 Let us know that your PR is ready for review:

Who will review my changes?

This repository is currently unmaintained.

To get help with finding a technical reviewer, tag the community contributions project manager for this PR in a comment and let them know that your changes are ready for review:

  1. On the right-hand side of the PR, find the Contributions project, click the caret in the top right corner to expand it, and check the "Primary PM" field for the name of your PM.
  2. Find their GitHub handle here.

Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@mphilbrick211
Copy link

Hi @myhailo-chernyshov-rg! Thanks for this contribution! It looks like you're contributing on behalf of Raccoon Gang - please have your manager reach out to [email protected] to have you added to Raccoon Gang's existing entity agreement with us. Thank you!

@mphilbrick211 mphilbrick211 added the needs test run Author's first PR to this repository, awaiting test authorization from Axim label Nov 26, 2024
@e0d
Copy link

e0d commented Dec 7, 2024

@myhailo-chernyshov-rg it looks like the coverage has dropped substantially with this PR, can you have a look?

@mphilbrick211 mphilbrick211 removed the needs test run Author's first PR to this repository, awaiting test authorization from Axim label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Status: Waiting on Author
Development

Successfully merging this pull request may close these issues.

4 participants