|
4 | 4 | .. _assessment-security: |
5 | 5 |
|
6 | 6 | Assessment Security |
7 | | -=================== |
| 7 | +==================== |
8 | 8 |
|
9 | | -Data for assessments is stored in individual files in the ``.guides/assessments`` folder. |
10 | | -Other folders automatically created in the ``.guides`` directory are: ``.guides/img`` and ``.guides/content``. |
11 | | -Student assignments only receive the ``.guides`` folder and the ``.guides/img`` folder. If you have not provided student access to the file tree in the :ref:`page layout <page>`, the ``.guides`` folder will not be visible. |
| 9 | +File Organization |
| 10 | +----------------- |
| 11 | + |
| 12 | +Assessment data is stored in individual files within the ``.guides/assessments`` folder. The ``.guides`` directory automatically contains the following subdirectories: |
| 13 | + |
| 14 | +- ``.guides/assessments`` - Assessment configuration files |
| 15 | +- ``.guides/img`` - Image assets |
| 16 | +- ``.guides/content`` - Content files |
| 17 | + |
| 18 | +Student Workspace Limitations |
| 19 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 20 | + |
| 21 | +When students receive an assignment, they only get access to: |
| 22 | + |
| 23 | +- The ``.guides`` folder |
| 24 | +- The ``.guides/img`` folder |
| 25 | + |
| 26 | +If you have not enabled student access to the file tree in the :ref:`page layout <page>`, the ``.guides`` folder will not be visible to them. |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | +Using the .guides Folder |
| 31 | +------------------------ |
12 | 32 |
|
13 | 33 |
|
14 | | -The ``.guides`` folder is a good place to store bash files or data files because they can't be easily deleted by the student via the file tree. Keep in mind though, if students have access to the terminal they can use it to view any files in their Linux container, including the ``.guides`` folder. |
| 34 | +Benefits and Considerations |
| 35 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
15 | 36 |
|
16 | | -Files that are stored in the ``.guides`` folder can be updated even if students have already started an assignment. |
17 | | -When you publish an assignment that students have already started, pre-existing files in the student workspace ``\home\codio\workspace`` will not be updated in order to make sure student work is not overwritten. |
18 | | -More information on this topic may be found on the :ref:`modify assignments <modify-assignments>` page. |
| 37 | +The ``.guides`` folder provides a secure location for storing bash scripts and data files, as students cannot easily delete them through the file tree interface. However, be aware that students with terminal access can view any files in their Linux container, including contents of the ``.guides`` folder. |
19 | 38 |
|
20 | | -Blocking student access to the terminal |
| 39 | +Updating Published Assignments |
| 40 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 41 | + |
| 42 | +Files stored in the ``.guides`` folder can be updated even after students have started an assignment. When you republish an assignment that students have already begun: |
| 43 | + |
| 44 | +- Files in ``.guides`` **will be updated**. |
| 45 | +- Pre-existing files in the student workspace (``/home/codio/workspace``) **will not be updated** to prevent overwriting student work. |
| 46 | + |
| 47 | +For more information, see the :ref:`modify assignments <modify-assignments>` page. |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | +Blocking Student Access to the Terminal |
21 | 52 | --------------------------------------- |
22 | 53 |
|
23 | | -The :ref:`terminal <terminal>` can be accessed from the file tree, the menu or by using the key combination (Shift+Alt+T on a PC, Shift+Option+T on a Mac). If you want to block all student access to the terminal you need to hide the file tree in the page layout, :ref:`customize the IDE menu<custom-ide>` and block the keyboard short cut in :ref:`project preferences<project-prefs>`. |
24 | 54 |
|
25 | | -The Secure folder |
| 55 | +The :ref:`terminal <terminal>` can be accessed through multiple methods: |
| 56 | + |
| 57 | +- From the file tree |
| 58 | +- From the menu |
| 59 | +- Via keyboard shortcuts (Shift+Alt+T on PC, Shift+Option+T on Mac) |
| 60 | + |
| 61 | +To completely block student access to the terminal, you must: |
| 62 | + |
| 63 | +1. Hide the file tree in the page layout |
| 64 | +2. :ref:`Customize the IDE menu <custom-ide>` to remove terminal access |
| 65 | +3. Block the keyboard shortcut in :ref:`project preferences <project-prefs>` |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | +The Secure Folder |
26 | 70 | ----------------- |
27 | 71 |
|
28 | | -If you are creating your own testing scripts or unit tests you can create a folder named ``.guides\secure`` to safely store test files. The secure directory is not copied over to the student version of the assignment. |
29 | | -When a student runs a code test that references a file in the ``.guides\secure`` folder, an **ephemeral** container is created that is a combination of the student workspace and the ``.guides\secure`` folder the instructor created. |
30 | | -This container is referred to as **ephemeral** because it only exists during the execution of the assessment. If you open a student project to view their work, you will not have access to the secure folder because it does not exist in the student environment. |
| 72 | +Overview |
| 73 | +~~~~~~~~ |
| 74 | + |
| 75 | +The ``.guides/secure`` folder provides a protected location for storing testing scripts and unit tests. This folder offers enhanced security because it is **not copied** to the student version of the assignment. |
| 76 | + |
| 77 | +How It Works |
| 78 | +~~~~~~~~~~~~ |
| 79 | + |
| 80 | +When a student runs a code test that references files in ``.guides/secure``, an **ephemeral container** is created that combines: |
| 81 | + |
| 82 | +- The student workspace |
| 83 | +- The instructor's ``.guides/secure`` folder |
| 84 | + |
| 85 | +This container is called "ephemeral" because it only exists during assessment execution. If you open a student project to review their work, you will not see the secure folder—it does not exist in the student environment. |
| 86 | + |
| 87 | +Important Limitations |
| 88 | +~~~~~~~~~~~~~~~~~~~~~ |
| 89 | + |
| 90 | + |
| 91 | +**Do not write to the secure folder** during test execution, as changes will not persist. All output must be conveyed through: |
| 92 | + |
| 93 | +- Standard output (stdout) |
| 94 | +- The feedback buffer (described in individual assessment documentation) |
| 95 | + |
| 96 | +Assessment Types Supporting Secure Folder |
| 97 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 98 | + |
| 99 | +The following assessment types can access the secure folder: |
| 100 | + |
| 101 | +- :ref:`Advanced Code Test <advanced-code-test>` |
| 102 | +- :ref:`Free Text Autograde <free-text-autograde>` |
| 103 | +- :ref:`Assignment Level Scripts <auto-grade-scripts>` |
| 104 | + |
| 105 | +Using Secure Folder with Standard Code Tests |
| 106 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 107 | + |
| 108 | +:ref:`Standard Code Tests <standard-code-test>` do not have access to the secure folder by default. However, you can force a Standard Code Test to run in an **ephemeral container** by including a file path with ``.guides/secure`` in the **Command** field on the **Execution** tab. |
| 109 | + |
| 110 | +Implementation Methods |
| 111 | +~~~~~~~~~~~~~~~~~~~~~~ |
| 112 | + |
| 113 | +You can trigger ephemeral container creation by: |
31 | 114 |
|
32 | | -Your test should not write any information to the ``.guides\secure`` folder because it does not persist. |
33 | | -All output should conveyed using either stdout or the feedback buffer that is described in the individual assessesment types that can use the secure folder, :ref:`Advanced Code Test <advanced-code-test>`, :ref:`Free Text Autograde <free-text-autograde>` and :ref:`Assignment Level Scripts <auto-grade-scripts>`. |
| 115 | +- Passing a secure folder file name as a parameter |
| 116 | +- Including the file name on the command line (it will be ignored by your program, but signals Codio to mount the secure folder) |
34 | 117 |
|
35 | | -Standard code tests do not have access to the secure folder by default but you *can* force a :ref:`Standard Code Test <standard-code-test>` to run in an **ephemeral** container by including a file name with the ``.guides\secure`` path in the **Command** portion on the **Execution** tab. |
36 | | -This could be done if you are passing a file name as a parameter or if you have no command line parameters, you can put the file name on the command line and it will be ignored by your program but Codio will run the test in a container with the Secure folder mounted. Then you can specify a file in ``.guides\secure`` as an input parameter. |
| 118 | +Once the ephemeral container is created, you can specify files in ``.guides/secure`` as input parameters for your tests. |
0 commit comments