Bouncing back for review after incorporating all feedback.
What is the expected functionality of a blank filling -- is there one exact correct answer? Or is a near match acceptable?
If we do drag-n-drop, that simplifies grading. Is it maybe worth starting from a drag-n-drop mindset, which could then be expanded into other purposes beyond fill-in-the-blanks, like sorting, matching, and sequencing?
@graber do you mean we should create a new ecosystem module for lms_answer_plugins?
Documentation for configuring the course cards added at https://www.drupal.org/docs/extending-drupal/contributed-modules/contrib... →
@garchris can you create a feature request for a Fill in the Blanks plugin in the Drupal LMS issue queue → ? I'm also interested in that being included.
To clarify the architectural changes:
StartLinkFieldItemList
was both building and rendering the start_link component. That led to context-dependent fatal errors when a form was rebuilt via an AJAX call (like adding a lesson to a new course), and when displaying a start_link component from within a views plugin like our new
So the building and rendering responsibilities were separated:
StartLinkFieldItemList
now only calculates the component props and stores them as a serialized string. It gets its context directly from the entity it is attached to.
A new field formatter LmsComponentFormatter
calls the field's view() method, which takes the serialized props, unserializes them, and builds the component render array.
CourseStartLink
no longer needs the getRenderable()
method. Attributes were added for styling of each of the start_link statuses.
Latest changes from 1.0.x included, and hard dependency on media module removed.
The start_link component needed to be refactored to work in all contexts.
Can we start off by adding *_vid
fields to CourseStatus
, LessonStatus
, and Answer
entities and run an initial update hook, then transition to Entity Reference Revisions when we're ready to migrate the Course.lessons
and Lesson.activities
fields? Seems like that could make the updates less monolithic.
Drupal Commerce has a similar need...I’m not sure if they solve this by revisions.
Turns out Commerce copies the current product data into an order item. Same need but not really a transferable solution.
I think [the revision checkbox] is a bit too subtle to expect course authors to understand the implications of or get right all the time even if they do
The revision checkbox could have explicit instructions marked "IMPORTANT". Or we could alter the form to have two submit buttons, one for a minor live update, the other for a new version. Either way I agree it's hard to make it foolproof. Needs good documentation.
something like adding a lesson at the end of a course where no-one has reached it yet, you might want everyone to take that lesson
The "Freshest Unaccessed Content" feature would address this. It adds some complexity to the lock-in timing, but seems worthwhile for long courses.
We could make a global setting so the site owner can choose if students take the course / lesson versions from the moment of starting or current
If set to "current" then we'd lose consistency with evaluation & revisits, unless we associate revision lists with uid
. The revision schema updates add a BC layer, so not sure if this would add more complication than it's worth.
@moshe weitzman thanks for the feedback, much appreciated.
The thinking is that for something like a typo, teachers/admins can submit an edit and not create a new revision, in which case the change will be pushed live to current students.
Revisions shouldn't proliferate too badly since it will be a conscious choice to make a new one, and we can implement processes to safely delete old unused revisions.
I'll check out the Commerce approach, thanks for that tip!
Done in 📌 [PP-1] Convert course navigation block to SDC Active -- does this need more attention / features?
Duplicate of 📌 Add start link block plugin Active ?
Added a course card SDC in a responsive grid view, plus a views plugin that allows site builders to optionally display fields of their choice in the SDC that they've added to their Course group. Includes options for assigning fields to course card background, description, and two custom fields.
Notes:
- May depend on 📌 [PP-1] Convert course navigation block to SDC Active to be merged first to avoid conflicts.
- Includes an update hook that overwrites the existing
/courses
view, or adds it if not present. - It would be good to coordinate release with a documentation update explaining the view options.
ob3ron → changed the visibility of the branch 3518648-display-course-listings to hidden.
Addressed all feedback; should be good to go!
Updated BlockBuilder to depend on TrainingManager as the single source of truth for activity access.
Also added a progress bar and a few other tweaks to the navigation block.
Add reference to lesson-level Backwards Navigation setting.
Add a note that Free Navigation overrides Backwards Navigation
Sorry about the accidental test changes, not sure how that happened!
Added additional caching improvements and testing. Should be ready for review.
This is a lot more clear to see with 📌 [PP-1] Convert course navigation block to SDC Active
It seems to me that if a course that has Free Navigation turned off, there are two ways to handle backwards navigation:
Option A: disallow any course navigation, including backwards nav, until the course is finished and graded; or
Option B: allow backwards navigation, but when visiting a previous question, forwards nav should also be allowed up to the highest answered question +1.
Not really sure which of those two options makes the most sense, or even if that needs to be a sub-setting of the Free Navigation setting so course creators can decide based on their individual context.
Will do additional code cleanup and optimization, meanwhile any feedback on the looks and function is welcome.
WIP commit - includes a number of navigation improvements:
- adds single-directory components (SDC) for layout and styling.
- displays all but the current lesson as collapsed accordion lists, for compactness and better visual progress display.
- removes the link url from activities that are not available to visit, based on the course-level Free Navigation setting, or if the user is revisiting a completed course.
- improves the course navigation caching/placeholder logic, with appropriate cache lifetimes based on per-user and per-lesson display options.
- adds styling to each activity to indicate current / answered / unanswered activities.
- adds activity scores on course revisit.
@btriest start_link
is one of the new SDC components, it may be that you need to clear all caches and see if that gets rid of the error.
We can just separate the results link from the status indicator and have them next to each other.
Simplified code examples and added references to Drupal docs
I was thinking just to set up a basic SDC card component, possibly with a default generic course image. Then site builders can customize in their theme or through UI Suite. It can live in a course_card
directory under /components
.
Not sure if you were implementing Workspaces yet, but I tried editing lessons and courses in a Staging workspace and on saving them got an error: Return value must be of type int, false returned.
A small "nice to have" when throwing an error trying to unpublish a lesson/activity, would be to list the courses/lessons that it is being used in. Currently the error message says, eg: "This activity cannot be unpublished as it is a part of at least one published lesson" but there is no easy way to find out what lesson(s) it is in.
Sorry, I didn't see your video at first -- it looks like a permissions issue. Check that the account that you're logged into has the necessary permissions:
- User role permissions: admin/people/permissions -- check "Administer LMS" permission
- Group permissions: admin/group/types/manage/lms_course/permissions -- admin should have all permissions
You need to be in the course's admin view in the Students tab:
LMS menu > Courses > click on the course's name > click on the Students tab
Then you can select students with the checkboxes, and in the Action dropdown select 'Reset course progress'. Then click 'Apply to selected items'
Ok after much flailing on my part 😅 it is now passing testing. Remember to clear caches for the new components to be discovered.
WIP: Works but failing testing, investigating...
I've found a few other components that can be targeted for SDC conversion. Here's my suggested order of operations:
- Set up SDC and convert simple components, see
📌
Set up SDC and convert simple components
Active
- Lesson Timer
- Admin Toolbar icon
- Course Status Indicator
- Start Link field
- Course Results display
- Courses Listing (use cards)
- Activity-Answer display (cards with defined regions)
- Course Navigation - see 📌 [PP-1] Convert course navigation block to SDC Active
Removing "PP-1" as 📌 Update legacy themes Active has landed, and adding as a child issue of 📌 Improve general appearance Active
Improve class management instructions and overall formatting