Moodle

[Patch] Provide a button to remove a section of a course with all it's modules

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Duplicate
  • Affects Version/s: 1.9.3, 1.9.4, 1.9.5, 1.9.6
  • Fix Version/s: None
  • Component/s: Course
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE

Description

I am still working on a project for Federal University of Santa Catarina, in Brasil.
Some teachers need a way to clear their course, particularly after restoring a backup.
This patch includes a link on the right side of each section (in topics and weeks course formats), using ajax or not, to remove the section and all the modules on it.

  1. mdl18197-195.diff
    18/May/09 10:19 PM
    10 kB
    Daniel Neis
  2. mdl18197-195-v2.diff
    21/May/09 1:12 AM
    9 kB
    Daniel Neis
  3. patch_delete_section
    10/Feb/09 1:15 AM
    14 kB
    Daniel Neis
  4. remove_modules.diff
    15/Jun/09 8:30 PM
    3 kB
    Daniel Neis

Issue Links

Activity

Hide
Daniel Neis added a comment -

here is the patch to 1.9.5 version

Show
Daniel Neis added a comment - here is the patch to 1.9.5 version
Hide
Pedro Henrique Dias added a comment -

Daniel, eu também trabalho com o Moodle aqui na PUC do Rio Grande do Sul. Testei a sua implementação e ela está funcionando corretamente. Agradeço, pois aqui também temos esse problema, de alguns professores quererem deletar um tópico/semana inteira.
Uma observação que eu gostaria de fazer é a seguinte, quando o tópico/semana, possuem arquivos dentro dela e eu clico em "excluir o tópico" e depois confirmo apertando no "sim" aparece uma mensagem lá em cima dizendo que o arquivo "tal" não pode ser removido, porém ele volta para a tela principal do curso com o tópico deletado. Então eu não entendi o porque daquela mensagem. Será que eu fiz alguma coisa errada na hora de dar o ugrade no meu código? Agradeço a sua atenção.

Show
Pedro Henrique Dias added a comment - Daniel, eu também trabalho com o Moodle aqui na PUC do Rio Grande do Sul. Testei a sua implementação e ela está funcionando corretamente. Agradeço, pois aqui também temos esse problema, de alguns professores quererem deletar um tópico/semana inteira. Uma observação que eu gostaria de fazer é a seguinte, quando o tópico/semana, possuem arquivos dentro dela e eu clico em "excluir o tópico" e depois confirmo apertando no "sim" aparece uma mensagem lá em cima dizendo que o arquivo "tal" não pode ser removido, porém ele volta para a tela principal do curso com o tópico deletado. Então eu não entendi o porque daquela mensagem. Será que eu fiz alguma coisa errada na hora de dar o ugrade no meu código? Agradeço a sua atenção.
Hide
Daniel Neis added a comment -

Olá, Pedro
legal saber que vocês aí da PUC do Rio Grande do Sul também usam o Moodle e ainda se arriscam a usar nossas modificações, hehehe.
Realmente eu constatei um probleminha na hora de remover a sessão, ele me dizia que alguns módulos não podiam ser removidos, mas não comentava nada sobre arquivos.
Vou adicionar um segundo patch corrigido, aí você pode aplicá-lo.
Se você preferir usar o git para controlar essas modificações, eu mantenho um branch para este código em git://dyck-devel.tns.ufsc.br/MOODLE/source/daniel.git , o nome do branch é mdl18197. Você pode acessá-lo via web no seguinte endereço: http://dyck-devel.tns.ufsc.br/git?p=MOODLE/source/daniel.git;a=shortlog;h=refs/heads/mdl18197

Obrigado pelo retorno. =o)
A propósito, eu vou participar do FISL, que será na PUC de Porto Alegre, agora dos dias 24 a 27 de junho, talvez possamos nos encontrar por lá para trocar umas idéias.

Show
Daniel Neis added a comment - Olá, Pedro legal saber que vocês aí da PUC do Rio Grande do Sul também usam o Moodle e ainda se arriscam a usar nossas modificações, hehehe. Realmente eu constatei um probleminha na hora de remover a sessão, ele me dizia que alguns módulos não podiam ser removidos, mas não comentava nada sobre arquivos. Vou adicionar um segundo patch corrigido, aí você pode aplicá-lo. Se você preferir usar o git para controlar essas modificações, eu mantenho um branch para este código em git://dyck-devel.tns.ufsc.br/MOODLE/source/daniel.git , o nome do branch é mdl18197. Você pode acessá-lo via web no seguinte endereço: http://dyck-devel.tns.ufsc.br/git?p=MOODLE/source/daniel.git;a=shortlog;h=refs/heads/mdl18197 Obrigado pelo retorno. =o) A propósito, eu vou participar do FISL, que será na PUC de Porto Alegre, agora dos dias 24 a 27 de junho, talvez possamos nos encontrar por lá para trocar umas idéias.
Hide
Daniel Neis added a comment -

this patch is a correct reimplementation of the module delete part. this should now work without warnings

Show
Daniel Neis added a comment - this patch is a correct reimplementation of the module delete part. this should now work without warnings
Hide
Pedro Henrique Dias added a comment -

Daniel, fiz o download da tua versão para 1.9.5 e realmente o erro está corrigido, agora não aparece mais a mensagem que não pode excluir os ítens. Fiz o upgrade no meu Moodle local e está funcionando, aparentemente, sem erros. Estamos cogitando a possibilidade de fazer o upgrade para a versão 1.9.5 no Moodle geral da PUC(http://moodle.pucrs.br), que atualmente está na 1.9.3.

Show
Pedro Henrique Dias added a comment - Daniel, fiz o download da tua versão para 1.9.5 e realmente o erro está corrigido, agora não aparece mais a mensagem que não pode excluir os ítens. Fiz o upgrade no meu Moodle local e está funcionando, aparentemente, sem erros. Estamos cogitando a possibilidade de fazer o upgrade para a versão 1.9.5 no Moodle geral da PUC(http://moodle.pucrs.br), que atualmente está na 1.9.3.
Hide
Daniel Neis added a comment -

This patch (remove_modules.diff) corrects the module delete function. This should now fully remove the modules.

Show
Daniel Neis added a comment - This patch (remove_modules.diff) corrects the module delete function. This should now fully remove the modules.
Hide
Paul Ericson added a comment -

I don't understand these four patches.

<Question 1>
They aren't listed in chronological order:

1. May 21, 09
2. May 18, 09
3. Feb 10, 09
4. Jun 15, 09

Q1: So do I apply them in chronological order or listed order?
=================
<Question 2>
Two of the patches attempt to create the files deletesection.php and deletesctionlib.php.

Q2: So I take it that I do not apply mdl18197-195.diff at all?
=================
<Question 3>
When I attempt to apply mdl18197-195-v2.diff I get no errors, but then when I attempt to apply patch_delete_section I get these errors:

C:\Inetpub\wwwroot\moodle>patch --dry-run -p0 < patch_delete_section
patching file lib/ajax/ajaxcourse.js
patching file lib/ajax/ajaxlib.php
patching file lib/ajax/section_classes.js
patching file lang/en_utf8/moodle.php
Hunk #1 FAILED at 385.
1 out of 1 hunk FAILED – saving rejects to file lang/en_utf8/moodle.php.rej
patching file course/rest.php
Reversed (or previously applied) patch detected! Assume -R? [n]

Q3: So can you confirm one of two situations:
1. I don't understand these patches and am applying them in the wrong order.
(If this is the case, can you please tell me the order the patches need to be applied?)
2. The patches are not clean and I'll have to use "patch -b" and clean up the merge by hand.
(If this is the case, can you please post a clean set of patches?)

Sincerely,

Paul

Show
Paul Ericson added a comment - I don't understand these four patches. <Question 1> They aren't listed in chronological order: 1. May 21, 09 2. May 18, 09 3. Feb 10, 09 4. Jun 15, 09 Q1: So do I apply them in chronological order or listed order? ================= <Question 2> Two of the patches attempt to create the files deletesection.php and deletesctionlib.php. Q2: So I take it that I do not apply mdl18197-195.diff at all? ================= <Question 3> When I attempt to apply mdl18197-195-v2.diff I get no errors, but then when I attempt to apply patch_delete_section I get these errors: C:\Inetpub\wwwroot\moodle>patch --dry-run -p0 < patch_delete_section patching file lib/ajax/ajaxcourse.js patching file lib/ajax/ajaxlib.php patching file lib/ajax/section_classes.js patching file lang/en_utf8/moodle.php Hunk #1 FAILED at 385. 1 out of 1 hunk FAILED – saving rejects to file lang/en_utf8/moodle.php.rej patching file course/rest.php Reversed (or previously applied) patch detected! Assume -R? [n] Q3: So can you confirm one of two situations: 1. I don't understand these patches and am applying them in the wrong order. (If this is the case, can you please tell me the order the patches need to be applied?) 2. The patches are not clean and I'll have to use "patch -b" and clean up the merge by hand. (If this is the case, can you please post a clean set of patches?) Sincerely, Paul
Hide
Daniel Neis added a comment -

Hello,

sorry for the problematic patches.
The correct patches to install are:

  • first, mdl18197-195-v2.diff
  • and then, remove_modules.diff

i don't know how to remove files from an issue, so the old ones are still there.

if you find problems with this order, please comment here that i will try to answer soon

Show
Daniel Neis added a comment - Hello, sorry for the problematic patches. The correct patches to install are:
  • first, mdl18197-195-v2.diff
  • and then, remove_modules.diff
i don't know how to remove files from an issue, so the old ones are still there. if you find problems with this order, please comment here that i will try to answer soon
Hide
Anthony Borrow added a comment -

Daniel - What you may want to do is simply mark this issue as being a duplicate and ask the folks who have voted for it to vote for MDL-10405 instead. Alternatively, you can simply comment on MDL-10405 if you have not already that a patch for MDL-10405 is available at MDL-18197. You may want to do some combination of both but since MDL-10405 has more votes it is likely to get attended to before MDL-18197. Peace - Anthony

Show
Anthony Borrow added a comment - Daniel - What you may want to do is simply mark this issue as being a duplicate and ask the folks who have voted for it to vote for MDL-10405 instead. Alternatively, you can simply comment on MDL-10405 if you have not already that a patch for MDL-10405 is available at MDL-18197. You may want to do some combination of both but since MDL-10405 has more votes it is likely to get attended to before MDL-18197. Peace - Anthony
Hide
Daniel Neis added a comment -

This issue will be resolved by 10405, i will post the correct patches there.

Show
Daniel Neis added a comment - This issue will be resolved by 10405, i will post the correct patches there.
Hide
Anthony Borrow added a comment -

Daniel - As requested I am resolving this as a duplicate. Peace - Anthony

Show
Anthony Borrow added a comment - Daniel - As requested I am resolving this as a duplicate. Peace - Anthony

People

Vote (3)
Watch (4)

Dates

  • Created:
    Updated:
    Resolved: