Each problem has a header, one or more problem parts, and a high-level solution. There are many types of problem parts you can use in your problems. Some parts are auto-graded. Others require you to view and grade student answers manually.
Some parts offer the option to require students to show their work. If you select this checkbox, you can then choose the text label that appears and the size of the field where the students show their work.
|Problem Part||Auto-Graded||Show Student Work Option|
|Choice Labels||Yes/No or True/False|
|No. Rows||Size of the field where the students enter their answers.|
The File Upload part allows the student to upload a file as part of a problem. For example, and student might need to draw a picture and take a picture of it.
|Question||Enter the question here.|
|Label||Label next to the upload button|
|Max. Size (kb)||Maximum size of the file to be uploaded|
|File Type||File types that are acceptable to be uploaded|
The Short Answer part allows the student to manually enter a short answer. The student's answer must match the correct answer exactly to be graded as correct.
|Validate Answer As||Text, number, or 3-digit non-negative number|
|Length (pixels)||Maximum length in pixels allowed for the student answer.|
A hotspot is an area on a computer screen that can be selected to activate a function. The Hotspot Interaction part allows students to select one or more hotspots on an image as the possible answer to the question.
|Image||Image you want to use|
|Selection Type||One or more hotspots that represent the correct answer|
|Hotspots||You can create, move, and delete hotspots (rectangles or ovals) on the image as well as select the correct answer(s).|
The Multiple Answer part provides multiple answers and allows the students to select zero to many of them. You can add or delete answers and select which answers are correct using the checkboxes next to the each answer.
|Layout||New line displays the choices on a separate line per choice. Inline and wrap displays the choices on the same line and wraps as needed.|
The Multiple Choice part provides multiple answers and allows the students to select one of them.
|Layout||New line displays the choices as a separate line per choice. Inline and wrap displays the choices on the same line and wraps as needed.|
The Select Point part gives students the opportunity to demonstrate their knowledge by selecting an invisibly-defined portion of an image (region on a map, person in a line-up, etc.). Similar to Hotspot Interaction parts, you create the hotspots and the correct answer, but students don’t see the hotspots. They have to create their own select points to submit the answer. The answer is graded as correct if the select points are within or overlaps the correct hotspots.
|Image||Image you want to use|
|Hotspot||You can create, move, and delete hotspots (rectangles or ovals) on the image as well as select the correct answer(s).|
|No. Answers||Number of points a student can select as answers|
|No. Correct||Number of points a student must get correct in order for their answer to be considered correct.|
The Table part is a container part. It doesn’t specifically ask the students any questions. It provides a layout for problem parts in a table structure. You can add problem parts and insert them into the table.
You can specify whether you want your table structured by a selected number of rows or a selected number columns.
With a row-based structure, problem parts are displayed left-to-right with a fixed number of columns. If the number of parts exceeds the number of columns, new rows will be created as needed.
With a column-based structure, parts are displayed top-to bottom with a fixed number of rows. If the number of parts exceeds the number of rows, new columns will be created as needed.
|Layout||Whether you want problem parts displayed in a row-based or column-based structure.|
|No. Rows/Columns||Number of rows or columns you want in your table, depending on the layout you chose.|
|Edit Headers||Text, if any, you want for the table, row, and column headers.|
The Text/video part allows you to embed text or graphics within a problem. Docking the information part creates a split-view and displays the part to the left or right.
|Information||Text or video|
|Dock||Whether to dock the information|
The WeBWorK problem part allows you to author WeBWorK problems in Edfinity. All WeBWorK problems are read from text files that are written in a language called PG (problem generation). Edfinity fully supports problems written in PG and PGML (problem generation markup language).
|Source code||PG or PGML source code|
|Upload file to embed||Upload graphic files to embed within your problem.|
|Use equation editor||By default, the graphical equation editor is turned on for WeBWorK problem parts. The editor lets students type in complex equations using a graphical editor. For more information, see Using the graphic equation editor.|
The Code Correctness problem part evaluates the behavior of short computer programs written by students. You write tests that checks the program output given an input (or no input). You can use your solution code to create comparison values to use when evaluating values created by student code.
Each test in your TestCase can be given point values. Your can write your tests by hand or use the built-in test generator to create test templates for you.
|Language||What programming language the student code, solution code, and tests will use.|
|Question||Instructions for the student to follow when writing programs.|
|Tests||The code that checks student programs. Your code must create a class named Testcase with a base class of EdfinityTestCase.|
|Solution code||Optional. Instructor-written code that can be revealed to students and can be used to validate student responses.|
|Student code template||Optional. Code that is provided to student when starting their work. It might contain basic declarations, helpful comments, etc.|
Working with Files
Student code can read and write files from the /tmp directory. If you want to provide a file for students to read in, you can do it as follows:
class TestCase(EdfinityTestCase): def test_1(self): text_file = open("/tmp/sample.txt", "w") n = text_file.write("This is a test") text_file.close() self.assertEqual(self.student().stdout.getvalue(), "This is a test\n", "Read from file")
Corresponding student code would be similar to this:
f = open("/tmp/sample.txt","r") string = f.read() f.close() print(string)