Signing up to multiple sessions in Facetoface 2.0

Signing up to multiple sessions in Facetoface 2.0

by Jason Hollowell -
Number of replies: 26
Picture of Particularly helpful Moodlers

Alastair,

This is a wonderful contribution! Thanks for all of your hard work. I have successfully installed the latest version on Moodle 2.2.1+ and have, thus far, had no issues.

I have one request that may be a big one but I wanted to propose it here to see if others would be interested as well as to see if I could get some feedback on how difficult it would be to include.

What we would really like (benefit from) is the ability to format sessions in a csv file (via Excel etc.) and then upload those sessions in bulk. This would make it very easy for us to generate many sessions at once. As it is now, it does require quite a bit of time to set up the sessions if you are, for example, attempting to set up ten sessions a week (40+ sessions a month). It isn't impossible for us to use the plugin (mod) as it is but this capability would be the icing on the cake for us. big grin

Sincerely

Jason

Average of ratings: -
In reply to Jason Hollowell

Re: Official Facetoface 2.0

by Jason Hollowell -
Picture of Particularly helpful Moodlers

Alastair,

Oops, I just realized as I was experimenting that I overlooked a feature of face-to-face that is going to cause a problem for us.

We need to be able to allow users (students) to register for multiple face-to-face sessions within each face-to-face instance. I didn't realize that this wasn't possible until I tried to do it. mixed

I'm fiddling around with the code to see if I can bypass the multiple registration check but haven't been successful. Is it possible to remove (comment out) this feature to allow multiple registrations without causing problems somewhere?

Jason

In reply to Jason Hollowell

Re: Official Facetoface 2.0

by Jason Hollowell -
Picture of Particularly helpful Moodlers

Alastair,

Just a followup on my previous post. I managed to comment out two sections in signup.php (attached) and users (students) can now register for more than one face-to-face session. The registration appears without any problem when logged in as admin/teacher etc. and exports to Excel etc.

The issue I have now is the display to the user (student) when he/she clicks on the Face-to-face activity. The session that was first signed up to shows up as "Booked" but the other session that he/she registered for still shows "Booking opened" and no options under "Status". I'm having a little trouble determining where this display comes from as it doesn't seem to be in view.php.

Any help you can provide will be appreciated.

Sincerely

Jason

In reply to Jason Hollowell

Re: Official Facetoface 2.0

by Alastair Munro -

Hi Jason,

As you may be aware, Moodle 2 uses renderers. There is a function in renderer.php (in the face-to-face module) called print_session_list_table you should be able to find the line in there that prints the status column (around line 100). Hope this helps.

Cheers,
Alastair

In reply to Alastair Munro

Re: Official Facetoface 2.0

by Jason Hollowell -
Picture of Particularly helpful Moodlers

Alastair,

Thanks so much for the assistance. I'm really not a programmer and had just started to feel a little comfortable with Moodle 1.9 when big changes came with 2.0. My experimentations are hacking at the lowest level but they do help me to learn about the architecture of Moodle. I am just barely familiar with the renderers so your point in the right direction will help me a lot.

Thanks again and thanks for this great contribution to the Moodle community.

Jason

In reply to Jason Hollowell

Re: Official Facetoface 2.0

by Jason Hollowell -
Picture of Particularly helpful Moodlers

Alastair,

Well, like I said in my previous message, my skills are limited. blush

I see where the test/condition is for the status display but I can't understand how it is working (or isn't working). In the following code,

elseif ($bookedsession && $session->id == $bookedsession->sessionid) {
                $signupstatus = facetoface_get_status($bookedsession->statuscode);

                $status = get_string('status_'.$signupstatus, 'facetoface');
                $isbookedsession = true;
            }

isbookedsession is set to true if the condition is met but it is only being met for one of the two bookings that I have been able to successfully make with the adjustments I made. I can see the booking when logged in as admin/teacher and I can also verify the booking when I look at the database tables directly but it isn't showing up in the status menu and I can figure out why sad

Does this test (elseif) need to be nested in a foreach statement so that it is run through for each session instance? It seemed like the foreach at the very beginning of the function would accomplish that requirement but...

Sorry, I'm sure my ignorance is shining through here.

Jason

In reply to Jason Hollowell

Re: Official Facetoface 2.0

by Jason Hollowell -
Picture of Particularly helpful Moodlers

Alastair,

I am sorry for being such a pest here. I managed to get it working with a foreach loop around the //Status section in renderer.php from around line 100 to 125.

Just documenting my progress here. I guess ideally it would be nice to be able to have this as a module setting (allow users to book more than one session per face-to-face activity - or something like that) but I'm pretty sure that is beyond me so I'll be satisfied with what I have accomplished thus far smile

Jason

In reply to Jason Hollowell

Re: Official Facetoface 2.0

by Jason Hollowell -
Picture of Particularly helpful Moodlers

Ha! I'm clueless! I'm going to continue to document my ignorant adventure here tongueout

I added a foreach statement and thought I'd figured it out as both of the bookings that I'd made as a student appeared (when logged in as that student) as booked. Yeah!, I thought but the problem however, is that when I cancel one of the bookings, it doesn't show up as being cancelled to the student.

Additionally, when the student is only booked to one session, the session that appears as being booked (from the capacity count) is the last one in the set (last meaning the one that is furthest in the future) even though a different session is the one that was booked (and it does show up that way in the database - the correct way I mean)...? Why did my adjustment throw off the capacity counter...?

Poking around more, I guess I still don't understand the bit of code I pasted here earlier.

elseif ($bookedsession && $session->id == $bookedsession->sessionid) {
                $signupstatus = facetoface_get_status($bookedsession->statuscode);

                $status = get_string('status_'.$signupstatus, 'facetoface');
                $isbookedsession = true;
            }

This doesn't appear to be checking the signup_status table in the db...? But if that's true, why and how can it be determining if the user is signed up or not?? Or, maybe it is just not looking at the superceded field because the original design was to only allow one signup per session so superceded wouldn't need to be checked in that event...?

Back to the drawing board sad

Jason

In reply to Jason Hollowell

Re: Official Facetoface 2.0

by Jason Hollowell -
Picture of Particularly helpful Moodlers

I see here that a hack that makes Face-to-Face function exactly as I want it to (and am trying to get it to) was performed successfully. The problem is that it was on an old version for Moodle 1.8, I think.

Any possibility this hack and be hacked smile (modified) to work on the current version?

I have it allow for registration to multiple session without any issues (per investigation of the db tables) but the display isn't working and the logic of the code is beyond me. sad

Jason

In reply to Jason Hollowell

Re: Official Facetoface 2.0

by Amir Elion -

Hi Jason,

We might have some developer time to help on this and are interested in promoting a solution for 2.x. Can you share what you have accomplished so far and what you think still needs doing?

In reply to Amir Elion

Re: Official Facetoface 2.0

by Jason Hollowell -
Picture of Particularly helpful Moodlers

Amir,

It would be great to have some help as I have very low level skills with the object oriented programming used on Moodle 2.x.

Basically what I have done (successfully) so far is summed up in a post earlier in this thread (here). I commented out some code and am now able to sign up for multiple sessions within one Face-to-Face activity. From the administrator/teacher perspective, everything looks ok. When logged in as admin I can see the student that has signed up for multiple sessions and can export the information to Excel spreadsheets.

The problem is how it appears to the student. When I log in as the student, it appears that only one session has been signed up for. Additionally, the "Seats available" numbers are incorrect. I've been trying to adjust renderer.php and I'm pretty sure I know where it needs to be adjusted (I think) but I can't figure out what needs to be done. My previous posts list the code that I think is where adjustment needs to be made but again, I'm not sure.

Jason

In reply to Amir Elion

Re: Official Facetoface 2.0

by Jason Hollowell -
Picture of Particularly helpful Moodlers

Amir,

Sorry, I may have summarized the situation too vaguely. We are very interested in (and in need of) getting this to work such that multiple sessions can be reserved and that everything appears correctly to not only the teacher/admin but also to the students. Currently, we don't have a need for the gradebook integration so that portion can be pushed forward to a later update. Do you have the time and resources to work on this? And, is funding required to get this feature added (adjustment made) to the Face-to-face module?

Jason

In reply to Jason Hollowell

Re: Official Facetoface 2.0

by Jason Hollowell -
Picture of Particularly helpful Moodlers

Here is a screenshot of the students' view after making a reservation for two sessions in one face-to-face activity. This is accompished by viewing the face-to-face session from the calendar. If I can get the second session to show up as booked and get the options to appear correctly (as they do for the first session) it will be a big jump forward.

Any help will be appreciated

Jason

P.S. The first session capacity is 5 and the second is 10. The 4 and 9 that appear reflect the spot taken by the student who reserved for each of the sessions but the display (controlled by renderer.php?) is not recognizing the multiple sessions.

In reply to Jason Hollowell

Re: Official Facetoface 2.0

by Jason Hollowell -
Picture of Particularly helpful Moodlers

When I log in as admin to see the bookings, I can see that both sessions have been booked as shown in the attached screenshot and when I click on Attendees or export the excel file I see that the same user has successfully booked for both sessions.

Jason

In reply to Jason Hollowell

Re: Official Facetoface 2.0

by Jason Hollowell -
Picture of Particularly helpful Moodlers

If I put a foreach statement around the code I pasted several times earlier (see below), I can get the booking to show up as booked. The problem is that if I delete the booking, it still shows up as booked. sad (see screenshot) And I can't figure out why. I've tried to reverse engineer it to see what the condition is testing by changing every value I could think of in the database directly but nothing makes it change....? I'm still lost but not giving up yet. smile

Jason

Here is the original code with the foreach I added:

// Status
            $status  = get_string('bookingopen', 'facetoface');
            foreach ($sessions as $session) { // I added this
            if ($session->datetimeknown && facetoface_has_session_started($session, $timenow) && facetoface_is_session_in_progress($session, $timenow)) {
                $status = get_string('sessioninprogress', 'facetoface');
                $sessionstarted = true;
            }
            elseif ($session->datetimeknown && facetoface_has_session_started($session, $timenow)) {
                $status = get_string('sessionover', 'facetoface');
                $sessionstarted = true;
            }
            elseif ($bookedsession && $session->id == $bookedsession->sessionid) {
                $signupstatus = facetoface_get_status($bookedsession->statuscode);

                $status = get_string('status_'.$signupstatus, 'facetoface');
                $isbookedsession = true;
            }
            elseif ($signupcount >= $session->capacity) {
                $status = get_string('bookingfull', 'facetoface');
                $sessionfull = true;
            }
            } // I added this
            $sessionrow[] = $status;

Attachment facetoface-doublecancelled.jpg
In reply to Jason Hollowell

Re: Official Facetoface 2.0

by Amir Elion -

Hi Jason,

Thanks for the info you provided.

We need something along these lines for a current project. Hopefully we will get to work on this next week. Our adjutment will be focused on getting the functionality required for this project, which is to allow users to be signed up to more then one session, and display all sessions they are listed to to them - which I think is what you're looking for. We'll also look at email notofication and deletion use cases to make sure they fit the solution.

If other requirements are needed, we may consider adding that to the work but if it is not covered by our project let me know if it can be funded from another source.

Amir

In reply to Amir Elion

Re: Official Facetoface 2.0

by Jason Hollowell -
Picture of Particularly helpful Moodlers

Amir,

Just a quick check in here. I stepped away from this for a couple of weeks but am still very much in need of the abilities that I described earlier (namely, the ability to make multiple reservations for one user within one instance of Face-to-face). I'm curious as to whether you've had any success and if I can help by testing or something?

Sincerely

Jason

In reply to Jason Hollowell

Re: Official Facetoface 2.0

by Amir Elion -

Hi Jason,

We were able to address most of this, but there are some issues that need work - mostly around how to handle grades and attendance in cases of multiple session sign-up.

We are communicating with Alastair as to how to advance. I will update.

In reply to Amir Elion

Re: Official Facetoface 2.0

by Jason Hollowell -
Picture of Particularly helpful Moodlers

Amir,

Thank you very much for the update. The gradebook integration is not crucial for me at the moment but I understand that it will be for some. Attendance at sessions, on the other hand, is something that we really need to be able to record but as I mentioned in an earlier post, the very crude hack that I was able to make did not impair the ability to take attendance after a session had passed. I suspect that the difficulty is in having the attendance reflected in the gradebook?

At any rate, I'm anxious to see the modified version and, as I mentioned, am happy to help with any testing efforts if you need any help.

Sincerely

Jason

In reply to Jason Hollowell

Re: Official Facetoface 2.0

by Amir Elion -

Hi Jason,

The source of the difficulty is that the way it was originaly built in the face to face module is that attendance and grade are actually the same field, e.g. if you mark someone as fully attended they get a 100 on that field, partially attended 50 and did not attend 0.

We have an initial solution for this, by calculating an average score based on this attendance for the entire activity if a user is signed up to more than one session. This will be up for review soon by Alastair, I hope.

Amir

In reply to Amir Elion

Re: Official Facetoface 2.0

by Jason Hollowell -
Picture of Particularly helpful Moodlers

Amir,

Thanks, I see. It sounds like the solution you have developed will be workable. I don't actually need the feature at the moment but would it be possible to simply add a field to the attendance portion of the face-to-face module that is used for a grade and have that grade pushed to the gradebook instead of the attendance value? That would incorporate quite a bit of flexibility in terms of grading options for various users. Just an idea. smile

Jason

P.S. Oh, wait, I see. There is only one value per face-to-face activity but now with multiple sessions per activity this poses a problem. Sorry, I didn't quite get it when I posted the message above.

It's too bad each session can't have it's own grade....maybe that starts to push the original design specs of this module though...?

In reply to Jason Hollowell

Re: Official Facetoface 2.0

by Amir Elion -

Hi Jaosn,

In principal these things would be possible, but as you noticed, they may require some structural changes to the data, and obviously more work, and more decision regarding upgrade approaches.

It also requires that an agreed solution is reached and that it fits most of the users, and also that the module maintainer sees it fit to implement the chosen approach.

In any case, being open code, others can always make their own variations on the module regarding grades management and any other aspects. For now, we've opted to go for a quicker solution that fit the current structure.

We have done other modifications for clients in the past, for instrance the ability to mark attendance for each date in a session, and along with that the ability to choose that grade be set automatically according to percentage of participation in multiple dates, or manually by the teacher.

Amir

Average of ratings: Useful (1)
In reply to Amir Elion

Re: Official Facetoface 2.0

by Jason Hollowell -
Picture of Particularly helpful Moodlers

Amir,

Thanks. Yes, I think I understand the issues involved. Any idea when your adaptation (multiple sessions) might be available? Or, would it be possible to get a copy for testing?

Regards

Jason

In reply to Amir Elion

Re: Official Facetoface 2.0

by Jason Hollowell -
Picture of Particularly helpful Moodlers

Amir,

Just checking back here to see if a copy of your face-to-face modification is available yet. I'm anxious to try it out.

Sincerely

Jason

In reply to Jason Hollowell

Re: Official Facetoface 2.0

by prafful garg -

Dear Jason,

please suggest when will the changes be incorporated or what changes do i need to make to allow signup for diferent sessions in face to face module. That would be a great help for me...

In reply to Amir Elion

Re: Official Facetoface 2.0

by Brad Carroll -

I see that this is on an older version of Moodle but I haven't seen any updates for 2.8. Has there been any progress on this? It would really help to have the capability to allow multiple registrations for a couple of reasons:

1. staff may want to retake a session

2. staff may want to register onto a waitlist but also register into a later session, hoping for a cancellation in the earlier session.

In reply to Brad Carroll

Re: Official Facetoface 2.0

by Jason Hollowell -
Picture of Particularly helpful Moodlers

Brad,

Sorry, I didn't notice your message here as I was on a long hiatus from Moodle...well, using Moodle but not on Moodle.org for quite some time.

At any rate, I finally got the multiple session version and then promptly hacked in quite a bit to add features we needed. I've just posted a question (here) about finally resolving a little bug that we've been dealing with for a few years now. Once it's all cleaned up, maybe I should make the variant version of Face to face available here? Are you still in need of something like this?

Regards

Jason