Portfolios: deleting an artifact

Portfolios: deleting an artifact

by Maureen Sheehan -
Number of replies: 6

Does anyone know how to delete an artifact from the Moodle portfolio? If a student adds a file and then later changes his mind about wanting it to be included, how would he delete it form the portfolio? 

Thanks, Maureen

Average of ratings: -
In reply to Maureen Sheehan

Re: Portfolios: deleting an artifact

by Matt Oquist -
Hi Maureen,

Which portfolio system/method are you talking about? Can you just describe more about what you're doing?
In reply to Matt Oquist

Re: Portfolios: deleting an artifact

by Maureen Sheehan -

Hi Matt,

I just looked at it again and found it to be fairly simple. I'm talking about when I'm logged in as a student and want to delete an artifact that I no longer think is "portfolio worthy". Last week, I couldn't do it and then we upgraded so I'm not sure if that made the difference or if it was just me, but it's no longer a problem. 

I think it's possible for a teacher to 'Lock" files so a student can't delete unless the teacher has given permission ( a good idea) but I'm still playing around with this. Thanks for your response.

Maureen

In reply to Maureen Sheehan

Re: Portfolios: deleting an artifact

by Matt Oquist -
I'm glad you got it figured out, and at least the upgrade seems not to have broken anything. wink
Good luck!
In reply to Maureen Sheehan

Re: Portfolios: deleting an artifact

by Ong Mr -

Hi Maureen,

When I use the student account to create a 2 new portfolio call demo109 and demo110, I found that i could not delete any of the portfolio. I relogin as admin and also cannot delete.

Do you also have the same problem?

Best Regards

David

In reply to Ong Mr

fixed

by Matt Oquist -
if (!$this->portfolio_heap->locked) {
filter_debug("$routine: error: cannot delete locked heap", $this->portfolio_heap);
return false;
}

Anybody see anything suspicious there? blush

Actually, delete_self_db() had the same logic error. Ai ai ai ai.

The fix is in CVS.

How to get the fix:
  1. Download http://download.moodle.org/patches/portfolio.zip (to be sure you're getting the fix, you can check portfolio/version.php and it should be 2007032900). (Yeah, I know. This file is computationally useless and I should switch to a single version.txt file for the whole system...)
  2. The only file that has changed is portfolio/portfolio_heap.class.php, so you can just grab it out of the .zip archive and copy it into place.
...or you can just follow the normal upgrade instructions, which are overkill in this case but will copy the appropriate new file into the appropriate place. Do what you like.
In reply to Matt Oquist

Re: fixed

by Ong Mr -

Hi Matt,

I managed to download the latest portfolio patch.

I can delete the artifacts now, but i still could not delete the portfolio.

Any idea whats wrong?

Best Regards

Ong B.L