Graphic content

We will see how to insert function or geometric construction graphs in the questions. For this, we will create a question in which the student will have to identify if a certain graph and algebraic expression match.

This is, besides, a simple example where we can see the use of the random function applied to a list instead of being applied to two numerical values. In this case, the function will return one element from the list chosen by chance.

  1. Create a True/False question.
     
  2. Name it as you wish.
     
  3. Go to the WIRIS cas session and insert the instructions explained in the following paragraph:



    Let us summarize what we did:

    The question posed to the student is whether the p graph corresponds to the h function (this happens approximately half of the times). r is the value of the correct answer to this question, i.e., the solution.
    1. The first line is the definition of the f() function, which chooses a random function among the possible entries. In this case, the possible entries are several functions. In WIRIS, the := symbol is used to define functions or expressions without evaluating them immediately. Thus, every time we write f(), the function will be re-evaluated, obtaining different results. 
       
    2. Four variables are defined
      1. g is an evaluation of f(). It will be, then, one of the preset functions.
      2. h will be equal to g or to any other, so that the probability of g=h is the same as the probability that g≠h.
      3. p is the graph of g.
      4. r verifies whether g and h are equal or different.
         
  4. In the Answer field we must indicate which variable has the value of the answer to the question; in this case, r. We must observe that this variable will always be Boolean, i. e., with true or false values.


     
  5. Return to the start of the page if you wish to edit the text of the question.



    We defined the p variable as a graph, but we indicate it with the same syntax as the rest. Observe that the variables in graph type can be inserted also in the student feedback and the answer fields of the Multiple choice and Matching questions. In the question view, #p will become an image with the corresponding graph.
     

Now we can save and preview the question.