Project

General

Profile

Feature #5272

Global chat should be disabled when student is passing an exam

Added by Yannick Warnier almost 7 years ago. Updated almost 7 years ago.

Status:
Bug resolved
Priority:
Urgent
Assignee:
Category:
-
Target version:
Start date:
30/07/2012
Due date:
30/07/2012
% Done:

90%

Estimated time:
1.50 h
Spent time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

There must be an exception when a student is passing an exam: the global chat must be forcibly disabled while the student is taking an exam.

Obviously, making it available will only lead to bad impact on the evaluation of students (the students will work in group).

The blocking system should be at PHP level as well, as some students are skilled with greasemonkey... (we should get some of these students to work with us :-p)

I suggest forcing the "disconnect" event when entering any exam, and adding a check to the "connect" event to make sure the student is not currently in an exercise before authorizing the effect of the connect.


Related issues

Related to Chamilo LMS - Feature #5282: Global chat and multiple exercises at the same timeNew31/07/2012

Actions

Associated revisions

Revision d1592f24 (diff)
Added by Julio Montoya almost 7 years ago

Should block global chat when taking an exercise see #5272

History

#1

Updated by Yannick Warnier almost 7 years ago

I'm trying to get my head around this one. I think the "right" thing to do would be:
  • when entering a test (clicking the "start test" button), set $_SESSION['chat_locked'] = true; + call $chat->disconnect() + add $_SESSION['current_exercises'][$c_id][$exe_id] = true;
  • on all subsequent calls (in chat.ajax.php) to $chat->connect, first check the $_SESSION['chat_locked']. If === true, then ignore the chat->connect()
  • when finishing the exam, unset($_SESSION['current_exercises'][$c_id][$exe_id]) + if (count($_SESSION['current_exercises']) == 0) { $_SESSION['chat_locked'] = false;}

The unset($_SESSION['current_exercises'][$c_id][$exe_id]) will probably won't work to remove the array element, I know arrays in PHP always are a pain in the but to clean....

The reason for the $_SESSION['current_exercises'] is that, if you start several exercises at the same time, if you finish one of the exercises, then chat_locked would be removed and you could still chat in the other exercise.

Finally, when logging out, the session should be destroyed completely so that chat_locked and current_exercises are not stuck in "locked" mode.

#2

Updated by Yannick Warnier almost 7 years ago

Actually, chat_locked and current_exercises are duplicating the functionality. It should be enough to use only current_exercises but I'm a bit worried that with thousands of users at the same time, checking an array would be longer than just checking a flag.

The chat_locked should be set in the learning paths as well (then maybe $_SESSION['current_exercises'][$c_id][$lp_id|0][$exe_id] would be more correct)

#3

Updated by Julio Montoya almost 7 years ago

oooook but the array "current_exercises" will only have the exe_id like this:

$_SESSION['current_exercises'][$exe_id]

because the attempt is unique and has all the info in the track_e_exercise (course code, session, lp id, etc, etc)

#4

Updated by Julio Montoya almost 7 years ago

not necessary to delete the session[current_exercise] when logging out there's already a session destroy there

#5

Updated by Julio Montoya almost 7 years ago

  • Status changed from Assigned to Needs testing
  • Assignee deleted (Julio Montoya)
  • % Done changed from 0 to 70
#6

Updated by Yannick Warnier almost 7 years ago

Julio A. Montoya wrote:

oooook but the array "current_exercises" will only have the exe_id like this:

[...]

because the attempt is unique and has all the info in the track_e_exercise (course code, session, lp id, etc, etc)

Is that OK even in the case of a disconnection and a restart of the same exercise (within the time limits of this exercise, so it is the same attempt in theory, but I'm not sure it is the same in the database...)?

#7

Updated by Julio Montoya almost 7 years ago

In case of a disconnection Chamilo will look for the latest attempt (the latest exe_id) so it will add the same exe_id in the array. I didn't test it using the time limits, but it should work, I delete the exe_id just when showing the result in the exercise_result.php

#8

Updated by Yannick Warnier almost 7 years ago

OK, I found a bug but it's minor. I'll log it into a new task for 1.9.2: #5282

#9

Updated by Yannick Warnier almost 7 years ago

  • Status changed from Needs testing to Bug resolved
  • Assignee set to Julio Montoya
  • % Done changed from 70 to 90

The rest is actually good. I've done pretty intensive testing with two simultaneous users and two tests. Closing.

Also available in: Atom PDF