[BD-27] [TNL-7455] [TNL-7457] Add support for True/False and Fill in the Blank problem types#11
Merged
azarembok merged 1 commit intoSep 18, 2020
Conversation
|
Thanks for the pull request, @pcockwell! I've created BLENDED-581 to keep track of it in Jira. More details are on the BD-27 project page. When this pull request is ready, tag your edX technical lead. |
Also fixes logic for Multiple Choice, and reuses multiple choice code for True/False problems to reduce code duplication
230f86b to
92c7863
Compare
0x29a
approved these changes
Sep 16, 2020
0x29a
left a comment
Contributor
There was a problem hiding this comment.
👍
Looks good to me.
- I tested that:
- Tests are passing locally for both python versions.
- Fill-in-the blank problems are being rendered correctly:

- True/false problems are being rendered correctly:

- I read through the code
-
I checked for accessibility issues - Includes documentation
-
I made sure any change in configuration variables is reflected in the corresponding client'sconfiguration-securerepository.
Comment on lines
+52
to
+57
| # Disregard any file that isn't found | ||
| try: | ||
| archive.add(file, alternative_name) | ||
| except FileNotFoundError: | ||
| print("{} was not found. Skipping".format(str(file))) | ||
| pass |
Comment on lines
+276
to
+293
| @property | ||
| def _problem_parsers_map(self): | ||
| """ | ||
| Returns: mapping between Common Cartridge profile value and function | ||
| that parses actual problem node. | ||
|
|
||
| Note: Since True/False problems in QTI are constructed identically to | ||
| QTI Multiple Choice problems, we reuse `_parse_multiple_choice_problem` | ||
| for BOOLEAN type problems | ||
| """ | ||
| return { | ||
| MULTIPLE_CHOICE: self._parse_multiple_choice_problem, | ||
| MULTIPLE_RESPONSE: self._parse_multiple_response_problem, | ||
| FILL_IN_THE_BLANK: self._parse_fib_problem, | ||
| ESSAY: self._parse_essay_problem, | ||
| BOOLEAN: self._parse_multiple_choice_problem, | ||
| PATTERN_MATCH: self._parse_pattern_match_problem, | ||
| } |
Contributor
There was a problem hiding this comment.
Thanks for refactoring this.
azarembok
approved these changes
Sep 18, 2020
Comment on lines
+276
to
+293
| @property | ||
| def _problem_parsers_map(self): | ||
| """ | ||
| Returns: mapping between Common Cartridge profile value and function | ||
| that parses actual problem node. | ||
|
|
||
| Note: Since True/False problems in QTI are constructed identically to | ||
| QTI Multiple Choice problems, we reuse `_parse_multiple_choice_problem` | ||
| for BOOLEAN type problems | ||
| """ | ||
| return { | ||
| MULTIPLE_CHOICE: self._parse_multiple_choice_problem, | ||
| MULTIPLE_RESPONSE: self._parse_multiple_response_problem, | ||
| FILL_IN_THE_BLANK: self._parse_fib_problem, | ||
| ESSAY: self._parse_essay_problem, | ||
| BOOLEAN: self._parse_multiple_choice_problem, | ||
| PATTERN_MATCH: self._parse_pattern_match_problem, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Provides conversion support for these question types:
cc.true_false.v0p1cc.fib.v0p1This PR also fixes conversion support for
cc.multiple_choice.v0p1problems, and given that the logic for parsing QTIcc.true_false.v0p1problems is identical to the logic for parsingcc.multiple_choice.v0p1problems, the code is reused. Similarly, the logic for generating OLX Multiple Choice and OLX True/False questions are identical, and code is reused there as well.JIRA tickets:
BLENDED-581
TNL-7455
TNL-7457
Dependencies: Builds directly upon #5
Testing instructions:
Note: Requires Python
3.8.Xto work on my machineUnit Tests:
make requirementsmake testManual Testing:
make requirementscc2olxCLI withmake install.imsccfile) that contains both True/False questions, and Fill in the Blank questionsoutputdirectory. Navigate to your Studio, select a course, and import the generated.tar.gzfile to overwrite the course.Reviewers