Author an algorithmic question
Algorithmic questions have variables calculated and inserted into the question algorithm.
These variables are either regenerated (with random values according to defined ranges and conditions) or recalculated each time the question appears in an activity.
Algorithmic questions are typically used in generating multiple question permutations from a single question template.
Depending on how the variables are defined, students will see new, randomly-determined values each time a new attempt is launched (even if a student is launching a subsequent attempt at the same activity).
As well, when multiple students launch the same activity, each student will be shown different values for the same algorithmic question of the activity.
The variable data that's created for a particular student's attempt persists throughout the activity session—even when the student navigates between questions—until the student's attempt is submitted for grading.
Algorithmic variables can be added to questions using the Question Editor in 2 ways:
Algorithmic functions — Use Möbius's pre-defined algorithmic functions to create and edit algorithmic command lines (check out View available functions for algorithmic questions).
Algorithm Designer — Create algorithmic command lines without directly using algorithmic syntax (check out Create question algorithms using the Algorithm Designer).
Once an algorithmic variable is defined, it can also be referenced by other parts of the algorithmic question:
Answer field
Hints
Content feedback
To author an algorithmic question
Algorithmic questions are authored the same way any non-algorithmic question is authored from the Question Editor.
The static question (a question where the variables have fixed, defined values) is generally authored first, and then the algorithmic variable(s) can be inserted after.
To author an algorithmic question from the Question Editor:
Author a static question using the Question Editor as you normally would. Check out Author a question for reminders of this process.
Click expand to expand the Algorithm pane of the Question Editor.
The Algorithm Editor is revealed.
You can now define algorithmic command lines.
Check out View available functions for algorithmic questions to manually enter algorithmic syntax.
Check out Create question algorithms using the Algorithm Designer to create algorithmic commands without directly using algorithmic syntax.
After creating your algorithm in step 4, navigate back to the Question Text pane and replace the fixed values in the question with the variable names that you defined in your algorithm. Example — The
5in the static question of5*x+3=0is replaced with$mwhich is defined by the function$m=range(1,20,1);.
Click Save to save your changes to the question.
Your question is now an algorithmic question and can be incorporated into your activities. Algorithmic questions are added to activities the same way any other type of content is imported or added. Check out Import lesson content or Import assignment questions.
Use the algorithmic variable
After the algorithmic variable is defined, you can apply it to other parts of a question:
Answer field
Hints
Content feedback
Answer field
While authoring a question and defining the correct response, you can include the algorithmic variable in the answer field to give the correct answer, or include it in other fields of the student response component:
Hints
While authoring a hint, simply include the algorithmic variable in the hint text. When the hint is viewed, the algorithmic variable will update to represent the value being viewed in the question.
Content feedback
While authoring content feedback, simply include the algorithmic variable in the content feedback text. When the content feedback is viewed, the algorithmic variable will update to represent the value being viewed in the question.
