216 Commits

Author SHA1 Message Date
David Mudrák
56201bcdef MDL-54833 workshop: Enhance usability of switching to the next phase
Many users did not realize the need to switch the phase manually. This
patch adds a new explicit task to the current phase to do that.
2016-10-21 17:10:32 +02:00
David Mudrák
931bba6054 MDL-54945 workshop: Introduce workshop::check_group_membership() method
This is just a refactored code block present at two different places. We
will need the same logic in the portfolio caller class soit made sense
to implement it as a new method, rather than make another copy&paste.

As a side effect, the logic is now properly unit tested.
2016-10-11 20:23:55 +02:00
David Mudrák
21d49a3f93 MDL-55289 workshop: Include repository/lib.php to use its constants
As a result of MDL-41556 (146893d6), the repository/lib.php was included
in submission.php so that its constant FILE_INTERNAL could be used in
field options. Recent development in MDL-50794 (996f7e8) moved the
options declaration to standalone methods but we forgot to check they
work in exsubmission.php too.

This patch moves the repository/lib.php inclusion to where the
library is actually needed.

Additionally it unifies how options are set for overall feedback content
and overall feedback attachment fields.
2016-07-28 09:51:16 +02:00
Russell Smith
1fcf0ca8a5 MDL-35628 performance: Remove dirname() where possible.
dirname() is a slow function compared with __DIR__ and using
'/../'.  Moodle has a large number of legacy files that are included
each time a page loads and is not able to use an autoloader as it is
functional code.  This allows those required includes to perform as
best as possible in this situation.
2016-06-10 08:06:49 +10:00
David Mudrák
996f7e8228 MDL-50794 workshop: Improve the file type restricting implementation
This is basically a clean up and what I think improved version of the
original Mahmoud's patch.

The actual checking for allowed file extensions has been re-implemented
and is now covered by unit tests. The list of allowed extensions is now
also assed to the filemanager element's accepted_types option to prevent
picking other files (we still need the in-place validation though). The
form validation is simplified a bit. The custom validation of file size
introduced in the previous patch has been removed as not related to this
issue (also I believe it should not be done at this level).
2016-02-25 18:03:18 +01:00
M Kassaei
1a282212c1 MDL-50794 workshop: Allow restricting submitted file types
It was reported at the Open University that there have been some
problems with the formats of files submitted by students. Not all
students completed their outlines as a Word .doc (despite this being the
format of the template provided). Some formats (e.g. .pages) couldn’t be
translated by some of the reviewing students. Therefore, they were
unable to provide a review and the submitting students not receiving any
comments.

This patch allows the teacher to define list of allowed file types that
can be attached to submitted work and/or overall feedback in the
workshop.
2016-02-25 18:03:18 +01:00
David Mudrák
a81b4cab22 MDL-50673 workshop: Fix some coding style violations 2015-07-16 19:44:06 +02:00
M Kassaei
bfde810a8b MDL-50673 workshop: Display all participants during submission phase
This patch adds a new report to be displayed during the submission
phase. The report displays all participants who are supposed to submit
their work into the workshop and the status of their submission.
2015-07-16 19:21:37 +02:00
David Mudrák
f2639dca1d MDL-31936 workshop: Add more options to the course reset form
This is built upon original work by Michael Hughes. We now have separate
settings for deleting workshop submissions, assessments and for resetting the
workshop phase.
2014-10-03 10:48:38 +02:00
David Mudrák
4a44c660e5 MDL-31936 workshop: Delete attachments on record removal
The methods workshop::delete_submission() and workshop::delete_assessment() did
not delete files (embedded and attachments) associated with the given
submission or assessment. This is fixed now.

Additionally, the delete_assessment() method now cleans-up records from the
table workshop_grades, too. This internal workshop API still does not give
workshop subplugins a chance to clean up their data, should they store them in
their own tables instead of the workshop_grades one. This should be improved in
the future yet.
2014-10-03 10:47:19 +02:00
David Mudrák
84f8b00166 MDL-31936 workshop: Fix overall feedback content processing order
This is unrelated to the issue but was spotted while testing it. The order of
format_text() and file_rewrite_pluginfile_urls() was incorrect and threw
debugging message. Fixed now.
2014-10-03 10:46:32 +02:00
Michael Hughes
6f760e0107 MDL-31936 workshop: Initial implementation of the course reset support 2014-10-03 10:44:40 +02:00
Marina Glancy
ed2ecd3e35 MDL-44725 workshop: correct module generation in unittests (15) 2014-09-02 13:03:37 +01:00
sam marshall
45ab2d9ab6 MDL-44725 Availability: Replace groupmembersonly - workshop (12)
The availability restrictions that apply to user lists (group, grouping)
now apply in workshop:

* In user lists.
* When randomly allocating users (also now works as expected if you use
  group mode and a grouping with the activity).
2014-09-02 13:03:31 +01:00
Mark Nelson
02a5a4b2ff MDL-43557 events: fixed minor issues in existing events 2014-04-29 19:16:11 -07:00
Adrian Greeve
1a219fb6c9 MDL-44340 mod_workshop: Added an event call to phase switched page.
This event was missed in the previous workshop add_to_log change over. The
switch phase event has been moved into the workshop::switch_phase() method.
Also workshop::log() has been deprecated. Developers should use the event
classes to log events.
2014-04-03 13:08:27 +08:00
Sam Hemelryk
5cdcfcb988 MDL-44183 mod_workshop: unified @package use 2014-02-21 08:33:40 +13:00
Adrian Greeve
1f0132716e MDL-40921 mod_workshop: New events to replace add_to_log function calls. 2014-02-07 13:21:23 +08:00
Adrian Greeve
3263a3562d MDL-41158 mod_workshop: Workshop submission alternate name field fix. 2013-11-12 10:40:23 +08:00
Dan Poltawski
f9b5915bc0 Merge branch 'MDL-39954-master' of git://github.com/FMCorz/moodle 2013-08-13 13:23:31 +08:00
Frederic Massart
cbf4b0e6f6 MDL-39954 mod_workshop: Log method can return array of parameters 2013-08-12 17:35:29 +08:00
Frederic Massart
d0cac8b51b MDL-41100 libraries: Deprecating get_plugin_list_with_file 2013-08-09 11:59:48 +08:00
Petr Škoda
bd3b3bba9f MDL-40220 use new core_component::get_plugin_list() 2013-07-16 22:36:11 +02:00
Adrian Greeve
a327f25ef1 MDL-31776 - lib: Alternate name fields
Add support for additional name fields and flexible formating of
user names.
2013-07-09 11:45:50 +08:00
David Mudrák
d34ea7dc33 MDL-38603 Deprecate usepeerassessment setting in Workshop
There was a plan to make use of it initially when Workshop was rewritten
for Moodle 2.0. The idea was that the Workshop could be switched into a
simplified mode where teachers only make assessments (with all the
grading strategies available). But things evolved since then and now we
have Advanced grading methods available in the new Assignment module
that solves the use case well. So, having this option available is not
only confusing but - looking at the code - pretty useless.

For now, I am just hiding the setting from the settings form and the
code always considers it as if it was enabled. In the future, the field
can disappear from the database, too.
2013-04-18 23:10:10 +02:00
David Mudrák
77d746a2f5 MDL-37602 Clean up and improve the overall feedback rendering
In order to use the overall feedback in assessments of example
submissions and in the assessment form preview, significant improvements
in the rendering machinery were done.

Workshop class provides two new methods overall_feedback_content_options()
and overall_feedback_attachment_options() as they are needed at various
scripts and libraries.

Overall feedback is displayed as a part of the workshop_assessment_form
only if the form is in editable mode (not frozen). If the form is
displayed in read-only (frozen) mode, the caller is expected to render
the overall feedback and list of attachments (the editor and filemanager
elements do not support frozen mode). To do so, the renderable
workshop_assessment now loads overall feedback data and provides two new
methods get_overall_feedback_content() and
get_overall_feedback_attachments() to be used by the renderer.

Renderable workshop_submission, workshop_assessment and related classes
now accept the workshop instance as the first parameter in their
constructors. This way, these renderable classes have access to the
workshop API.

In the future, the rendering of submission files should be improved in
the same way as is done in this patch (i.e. moving the logic and data
preparation out of the renderer into the renderable classes).
2013-03-26 21:25:46 +01:00
David Mudrák
c6a793d5a2 MDL-37602 Put the overall feedback fields to the bottom of the assessment form
The assessment form can be displayed as editable or read-only (frozen).
Neither the editor element nor the filemanager element support
displaying frozen content themselves so we need to pre-format and inject
static texts.

The list of attachments should be ideally generated by the renderer and
probably improved a bit - just quick and dirty solution must be enough
for now though (2.5 coding freeze is just behind the corner...).

AMOS BEGIN
 CPY [submissionattachment,mod_workshop],[feedbackauthorattachment,mod_workshop]
AMOS END
2013-03-26 21:25:00 +01:00
David Mudrák
c3d0157b0d MDL-38215 Fix cross-db support in workshop SQL queries
The $sql used in these methods may contain multiple parts glued
together by the UNION operator. Simply appending the ORDER BY statement
to the end of the query does not work in all DBs (failure reported at
Oracle). Following the pattern already applied in MDL-30051, we wrap the
SQL into yet another SELECT statement and perform ordering there.

Credit goes to Sara Cenni for suggesting the fix.
2013-03-13 14:58:50 +01:00
David Mudrák
0001eea6dd MDL-37806 Add new workshop class method to return pending assessments
This is a simple wrapper around workshop::get_assessments_by_reviewer()
that filters assigned assessments and returns just those that were not
graded by the reviewer yet.
2013-01-31 18:21:50 +01:00
Dan Poltawski
63fc21b4e5 Merge branch 'MDL-26349-workshop-grades-display' of git://github.com/mudrd8mz/moodle 2012-11-07 16:32:43 +08:00
David Mudrák
3cb4ce45c7 MDL-26349 Display the workshop final grades to participants when the activity is closed 2012-11-07 09:08:38 +01:00
Dan Poltawski
defcb763fe Merge branch 'MDL-36209-workshop-assess-while-evaluating' of git://github.com/mudrd8mz/moodle 2012-11-07 15:30:38 +08:00
David Mudrák
4affa7242e MDL-36209 Allow teachers to assess submissions during the grading evaluation phase 2012-11-04 08:47:21 +01:00
David Mudrák
4c61fcd825 MDL-35421 Display the conclusion when the workshop is closed
There is a new task implemented for the teachers so they are expected to
provide the conclusion at the end of the assessment phase.
2012-11-01 17:36:40 +01:00
Dan Poltawski
e76cc8f4c0 Merge branch 'MDL-36135-evaluators' of git://github.com/mudrd8mz/moodle 2012-10-30 09:37:03 +08:00
David Mudrák
462b4c128c MDL-36086 Fix SQL parameters array 2012-10-20 00:25:27 +08:00
David Mudrák
4f11517667 MDL-36135 Give the grading evaluation methods control over their settings forms
From now on, the evaluator's method get_settings_form() should return a
subclass of workshop_evaluation_settings_form. The evaluation subplugins
are expected to use the define_sub() method to add their own fields into
the base form, although they can override the main define() method, too.

The former interface workshop_evaluation has been refactored into a
superclass with abstract methods which seems to be more robust.

Oh, by the way, I'm in Perth - yay!

AMOS BEGIN
 MOV [settings,workshopeval_best],[evaluationsettings,mod_workshop]
AMOS END
2012-10-20 00:17:13 +08:00
David Mudrák
a93dc3ecb7 MDL-36135 Display the workshop grading evaluation method chooser
Teachers can now choose the actual grading evaluation method to use
during the grading evaluation phase. The workshopeval_best is still used
as the default one (this may be made configurable later, although there
is no big benefit of it).
2012-10-20 00:17:13 +08:00
Tim Hunt
e451c11616 MDL-34657 workshop / user sorting: fix SQL regression. 2012-10-04 11:47:04 +01:00
Tim Hunt
9695ff811b MDL-34657 user sorting: consistent sorting everywhere.
This commit coverts everything in the codebase to use the new
users_order_by_sql function when sorting lists of users. More details in
the bug.

Note that this does not change places where users are displayed in a
sortable table, and the sort order comes from the table.
2012-09-27 12:41:42 +01:00
Ankit Agarwal
0bbe041b77 MDL-34470 workshop: Replace all instances of get_context_instance() with context_xxx::instance() in mod/workshop 2012-07-23 15:10:07 +08:00
David Mudrak
a1df59bea9 MDL-27508 workshop does not use get_users_by_capability() any more
This is a big win, we are now taking enrolment fully into account.
Also, no need to fetch big data from DB just to get their count. Should
have much better performance now.
2012-04-27 14:41:59 +02:00
David Mudrak
079219bf07 MDL-27508 introducing workshop::count_participants() 2012-04-27 14:41:59 +02:00
David Mudrak
dda42a19cd MDL-27508 workshop::prepare_grading_report_data() accepts $groupid
Workshop grades reports in all three last phases were fixed to support
the group selection. They layout of the report has been unified to be
consistent across all phases.
2012-04-27 14:41:59 +02:00
David Mudrak
8741ebb0bd MDL-27508 introducing workshop::get_participants() and workshop::is_participant()
Note how the participant is defined: it is a user that (1) can submit or
assess or both and (2) is actively enrolled in the course. This means
that usually admins or managers won't be considered as workshop
participants, for example.
2012-04-27 14:41:59 +02:00
David Mudrak
cd57f558d9 MDL-27508 introducing workshop::count_submissions() and pagination support for get_submissions() 2012-04-27 14:41:58 +02:00
David Mudrak
872ed8591e MDL-27508 workshop::get_submissions() now accepts optional $groupid 2012-04-27 14:41:58 +02:00
David Mudrak
9691e2b10e MDL-27508 workshop::get_users_with_capability_sql() supports groupmembersonly
If the method is called with $groupid set to 0 and the workshop is in
the groupmembersonly mode, a recursive call is used to populate the
fragments of SQL code that fetch users from all relevant groups. These
fragments are then concatenated using UNION statement.
2012-04-27 14:41:58 +02:00
David Mudrak
21f58287d7 MDL-27508 workshop: improved getting of potential authors and reviewers
This patch reimplements get_potential_authors() and get_potential_reviewers()
so that get_enrolled_sql() is used instead of get_users_by_capability().
This excludes non-enrolled users (or users with suspended enrolment)
from the list of potential users.

The patch also extends the returned user structure. Objects in the
returned collection are now suitable for user_picture renderer.
2012-04-27 14:41:58 +02:00
David Mudrak
9260bb3c48 MDL-26099 workshop can be switched into the assessment phase automatically 2012-04-13 04:49:46 +02:00