-
Notifications
You must be signed in to change notification settings - Fork 350
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
Two column support in Perseus #766
Conversation
This commit adds a proof of concept for allowing Perseus to render only a single column when the content contains two columns. The idea is that the containing page would render two separate `ServerItemRenderer` components, one for each column. It could then control how each column is laid out. Example code: ``` <div class="column-wrapper"> <div class="left-column"> <ServerItemRenderer item={item} apiOptions={{renderColumn: "left"}} /> </div> <div class="right-column"> <ServerItemRenderer item={item} apiOptions={{renderColumn: "right"}} /> </div> </div> ```
If the question has hints, we don't want them to appear with the passage in the left column. This commit excludes hints if the calling code specifies that only the left column should be rendered.
Size Change: +76 B (0%) Total Size: 852 kB
ℹ️ View Unchanged
|
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #766 +/- ##
==========================================
+ Coverage 59.63% 60.92% +1.29%
==========================================
Files 480 482 +2
Lines 105413 105447 +34
Branches 6031 8714 +2683
==========================================
+ Hits 62860 64243 +1383
+ Misses 42553 41204 -1349
... and 43 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Closed! Discussed with the Perseus team and we decided on a different solution. Currently implemented in webapp here: https://github.com/Khan/webapp/pull/17851. May be moved into Perseus when grouped assessment items are supported in mobile. |
Summary
The Mastery-enabled Long Passage Practice project will introduce a two column layout for certain exercises, specifically long passages that have 4-5 questions associated with them. The user will see two columns with the passage on the left side and the questions on the right side.
To achieve this new UI, this PR introduces an update to the
ServerItemRenderer
to addrenderColumn
to theapiOptions
, so thatExerciseChrome
in the content library can control how to display each column.Issue: CL-1121
Test plan:
Storybook:
http://localhost:6006/?path=/story/perseus-renderers-server-item-renderer--sat-passage-item-left-column
http://localhost:6006/?path=/story/perseus-renderers-server-item-renderer--sat-passage-item-right-column