Skip to content

Commit

Permalink
Reorganisation of Canvas upload operations so that they are all consi…
Browse files Browse the repository at this point in the history
…dered within a single operation (instead of three of them)

Signed-off-by: Abelardo Pardo <abelardo.pardo@gmail.com>
  • Loading branch information
abelardopardo committed Dec 27, 2023
1 parent 77e68d5 commit e8b8895
Show file tree
Hide file tree
Showing 50 changed files with 334 additions and 434 deletions.
2 changes: 1 addition & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Added

- New functionality to load Canvas Course Enrollment information into a workflow
- New functionality to load Canvas Course information into a workflow

# 10.6 (2023-12-5)

Expand Down
4 changes: 2 additions & 2 deletions docs/Introduction/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ OnTask is a platform offering instructors and educational designers the capacity

Learning is complex, highly situated, and requires interacting with peers, instructors, resources, platforms, etc. This complexity can be alleviated providing learners with the right support actions such as feedback, recommendations, discussions, etc. However, all these actions become increasingly complex when the number of learners grows. The larger the number of learners, the more difficult is for instructors to provide adequate support. Typical solutions include providing generic resources or sending announcements that are only relevant to a subset of the audience.

.. sidebar:: Learner testimonials
.. important:: Learner testimonials

"its not the email itself, but what it represents: the accountability for
your learning"
Expand All @@ -20,7 +20,7 @@ The existing data is uploaded and stored in a table so that instructors and desi
:align: center
:width: 100%

.. sidebar:: Instructor testimonials
.. important:: Instructor testimonials

"A number of the participants were highly complimentary of the OnTask software tool and several of the teaching staff [...] are actively planning and preparing to use OnTask in the second semester of this academic year."

Expand Down
2 changes: 1 addition & 1 deletion docs/Tutorial/Tasks/top_menu.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ OnTask assumes that you will be working with one workflow. The first screen (the
.. figure:: /scaptures/tutorial_top_menu_bar.png
:align: center

.. sidebar:: Superuser
.. note:: Superuser

If your account has *superuser* or *admin* privileges, the top menu will include the additional option with name |bi-gear| *Admin*. This menu provides access to the pages to manage administration tasks, the connections to SQL relational databases, and the set of installed plugins. These connections are available to instructors as part of the operations to Upload/Merge data into the table.

Expand Down
47 changes: 15 additions & 32 deletions docs/Using/data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,48 +62,31 @@ OnTask is also capable of uploading the data from one sheet of a Excel file. The
In this case the file is assumed to have multiple *Sheets* and one of them
has to be selected to upload the data.

Upload Canvas Course Enrollment List
------------------------------------
Upload Canvas Course Data
-------------------------

This option connects with a previously configured instance of
`Canvas Learning Management System <https://www.canvaslms.com/>`_ and given a
Course ID, it uploads/merges the list of students enrolled in that course to
the current workflow.
Course ID, it offers the possibility to uploads/merges several data sets
such as the list of students enrolled in the course, the results from all the
quizzes in the course, or the results from all assignments.

.. figure:: /scaptures/dataops_upload_canvas_course_enrollment.png
.. figure:: /scaptures/dataops_upload_canvas_course.png
:align: center

For convenience, if there is an :ref:`attribute <details_attributes>`
defined for the workflow with name``CANVAS COURSE ID`` and with an
integer value it will be used directly by this operation. This is useful when
an OnTask Workflow corresponds to a course in Canvas throughout a long
integer value it will be used by this operation as course id. This is useful
when an OnTask Workflow corresponds to a course in Canvas throughout a long
period of time.

This operation is particularly useful to populate the table with an initial set
of rows (one per student) directly extracted from the remote platform.
of rows (one per student enrolled) directly extracted from the remote platform.
Additionally, it can be used at various points throughout a learning
experience to update the list of students (include new ones, drop those no
longer enrolled).

Upload Canvas Course Quizzes
----------------------------

This option connects with a previously configured instance of
`Canvas Learning Management System <https://www.canvaslms.com/>`_ and given a
Course ID, it uploads/merges all the results collected for all the quiz
submissions in a course.

For convenience, if there is an :ref:`attribute <details_attributes>`
defined for the workflow with name``CANVAS COURSE ID`` and with an
integer value it will be used directly by this operation. This is useful when
an OnTask Workflow corresponds to a course in Canvas throughout a long
period of time.

The operation first obtains the list of quizzes for the given course, then
invokes the API call to obtain quiz statistics, and from there, a table with
one student per row and the results to all the questions of all quizzes is
created. The operation also downloads information about the number of
attempts in a quiz and the last time a learner started and finished each quiz.
experience to update the list of students, upload quizz results, or upload
assignment results. Combining these uploads with the right options when
mering the new data sets provides a wide variety of possibilities to handle
changes during a course delivery.

.. _google_spreadsheet_file:

Expand Down Expand Up @@ -143,7 +126,7 @@ down menu to select the one to use.
Confirmation step to upload data
--------------------------------

When uploading data for the first time, the values are prepared to be assigned as the initial content of the workflow table. But before this assignment is done, the platform needs you to verify some information. Upon reading the new data, OnTask will automatically detect the data type in each column and those columns that have unique values (no repetitions) and mark them as **keys**. Key columns are very important because their values (as they are different for every row) are required for several operations. The workflow table **must have at least one key column**. If here are several columns with this property, OnTask :ref:`allows you to *unmark* some of them as non-key <details>` as long as there is always one of them wih such mark. Additionally, you may :ref:`mark any column as a key column <details>` if the values are all different. The operations to manipulate column information is described in the section :ref:`details`.
When uploading data for the first time, the values are prepared to be assigned as the initial content of the workflow table. But before this assignment is done, the platform needs you to verify some information. Upon reading the new data, OnTask will automatically detect the data type in each column and those columns that have unique values (no repetitions) and mark them as **keys**. Key columns are very important because their values (as they are different for every row) are required for several operations. The workflow table **must have at least one key column**. If here are several columns with this property, OnTask :ref:`allows you to unmark some of them as non-key <details>` as long as there is always one of them wih such mark. Additionally, you may :ref:`mark any column as a key column <details>` if the values are all different. The operations to manipulate column information is described in the section :ref:`details`.

Before finishing the upload step and storing the data in the table, OnTask also allows you to change the name of the columns or change the **Key** attribute as shown in the following figure.

Expand All @@ -157,7 +140,7 @@ After this step the data is stored and the platform shows the :ref:`table` page.
Data Merge
==========

.. sidebar:: Merge a.k.a "Join"
.. note:: Merge a.k.a "Join"

Merging is a common operation in databases and is commonly known as *join*. There are several variants of join operations depending how the differences between the key columns are handled. These same variants exist in OnTask when combining the data already existing in the table. The operation relies on the **key column** to merge the two sources.

Expand Down
2 changes: 1 addition & 1 deletion docs/Using/workflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ After logging into OnTask, the platform shows the buttons to create or import a
:align: center
:width: 100%

.. sidebar:: Going back
.. tip:: Going back

The **Workflows** link at the left corner of the top menu *closes* the workflow being manipulated and shows you the list of available workflows. The workflow is also *unlocked* so that it can be accessed by those users :ref:`sharing <details_sharing>` its access.

Expand Down
Binary file modified docs/scaptures/action_URL_on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/scaptures/action_action_in_URL.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/scaptures/action_email_report_create.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/scaptures/action_json_report_create.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/scaptures/action_personalized_canvas_email_create.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/scaptures/action_personalized_text_email.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/scaptures/api_documentation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/scaptures/dataops_datauploadmerge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/scaptures/dataops_datauploadmerge2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/scaptures/dataops_upload_canvas_course.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified docs/scaptures/logs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/scaptures/rubric_edit_table_tab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/scaptures/schedule_action_email.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/scaptures/schedule_action_json.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/scaptures/table_view_view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/scaptures/tutorial_personalized_text_URL.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/scaptures/tutorial_survey_create.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/scaptures/workflow_add_column.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/scaptures/workflow_create.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/scaptures/workflow_import.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion ontask/core/canvas_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
_canvas_api_map = {}
if settings.CANVAS_INFO_DICT:
_canvas_api_map = {
'get_course_quizzes': (requests.get, '{0}/api/v1/courses/{1}/quizzes'),
'get_course_quizzes': (
requests.get,
'{0}/api/v1/courses/{1}/quizzes',
status.HTTP_200_OK),
'get_quiz_questions': (
requests.get,
'{0}/api/v1/courses/{1}/quizzes/{2}/questions',
Expand Down
48 changes: 46 additions & 2 deletions ontask/dataops/forms/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,31 @@ class UploadCanvasForm(UploadBasic):
help_text=_('Name of the Canvas host to extract data.'),
choices=[])

upload_enrollment = forms.BooleanField(
label=_('Upload Enrolment'),
required=False,
help_text=_(
'To upload information about all enrolled students. Select this '
'option combine with any other below if you want to upload '
'data for all students regarding its activity.'))

upload_quizzes = forms.BooleanField(
label=_('Upload Quizzes'),
required=False,
help_text=_('To upload information about all quizzes in the course'))

upload_assignments = forms.BooleanField(
label=_('Upload Assignments'),
required=False,
help_text=_(
'To upload information about all assignments in the course'))

include_course_id_column = forms.BooleanField(
label=_('Include a column with the Course ID?'),
required=False,
help_text=_(
'If selected an extra column with the course ID is added.'))

def __init__(self, *args, **kwargs):
"""Modify certain field data."""
# Needed for authentication purposes
Expand All @@ -199,12 +224,31 @@ def __init__(self, *args, **kwargs):
if 'CANVAS COURSE ID' in self.workflow.attributes:
# There is an attribute with a course ID, use it and hide the
# field in the form with a fixed value and disable it.
self.fields['canvas_course_id'].widget = forms.HiddenInput()
self.fields['canvas_course_id'].initial = self.workflow.attributes[
'CANVAS COURSE ID']
self.fields['canvas_course_id'].disabled = True
self.fields['canvas_course_id'].help_text += _(
'. Value taken from the Workflow Attribute CANVAS COURSE ID')

self.order_fields([
'target_url',
'canvas_course_id',
'upload_enrollment',
'upload_quizzes',
'upload_assignments',
'include_course_id_column'])

self.order_fields(['target_url', 'canvas_course_id'])
def clean(self) -> Dict:
"""At least one of the three upload options needs to be true."""
form_data = super().clean()
if not (
form_data['upload_enrollment'] or form_data['upload_quizzes'] or form_data['upload_assignments']
):
self.add_error(
None,
_('At least one upload option needs to be selected.'),
)
return form_data


class UploadGoogleSheetForm(UploadBasic):
Expand Down
3 changes: 1 addition & 2 deletions ontask/dataops/services/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from ontask.dataops.services.sql_upload import (
ExecuteSQLUpload, load_df_from_sqlconnection)
from ontask.dataops.services.canvas_upload import (
ExecuteCanvasCourseQuizzesUpload, create_df_from_canvas_course_enrollment,
create_df_from_canvas_course_quizzes, ExecuteCanvasCourseEnrollmentsUpload)
create_df_from_canvas_course, ExecuteCanvasCourseUpload)
from ontask.dataops.services.upload_steps import (
upload_prepare_step_four, upload_step_four, upload_step_two)
Loading

0 comments on commit e8b8895

Please sign in to comment.