• RE: Handling input errors via startup codes

    Hi @steen. Do you have a minimal example of a math app that you want this for. I think this is possible if you deal with everything as strings and use try/catch. We had some luck parsing maple errors a few weeks ago so that might be useful to you, but I need to understand the exact use case a little more.

    posted in Question Creation
  • RE: Sketch graph where student defines axis

    @Grapheur If you are grading manually would a scanned document(i.e. file upload) question type work? If this is not what you are looking for, please could you provide more details on how the students would enter information into the graph?

    posted in Question Creation
  • RE: Laplace questions

    @Metahofzicht There are a few questions in this course module for Intro to Control Systems. IntroToControlSystems.zip

    posted in Content Sharing
  • (Relatively) Efficient Generation of Invertible 3x3 Matrices

    The following code generates a matrix by creating two non-zero random vectors, forcing them to be linearly independent, and then taking the cross product to calculate a third vector. It then finds a random permutation of these three vectors within a matrix, and may also transpose the matrix at random.

    nonZeroVec := overload(
        [ proc(v::Vector) option overload;
            local dim:=LinearAlgebra:-Dimension(v);
            if LinearAlgebra:-Equal(v,LinearAlgebra:-ZeroVector(dim)) then 
        proc(l::list) option overload;
              local i; for i from 1 to numelems(l) do nonZeroVec(l[i]) od:
        end ]
    nonSing3 := proc()
        local a,b,num1,num2,c,trans,M:
        #Generate Random Column Vectors:
        a:=LinearAlgebra:-RandomVector(3, generator = -4..4):
        b:=LinearAlgebra:-RandomVector(3, generator = -4..4):
        #Check for zero vectors:
        #Ensure Linear Independance:
        while LinearAlgebra:-Equal(abs(a/norm(a)),abs(b/norm(b))) do
            num1:=rand(0..1)(): num2:=rand(0..1)():
            b(1):=(-1)^num1 *rand(1..2)()+b(1):
            b(2):=(-1)^(num2*(1-num1)) *rand(1..2)()+b(2):
            b(3):=(-1)^((1-num2)*(1-num1)) *rand(1..2)() +b(3):
        M:=Matrix( combinat:-permute(convert([a,b,c],list))[rand(1..6)()] ):
        M:=M*(1-trans) + LinearAlgebra:-Transpose(M)*trans:
        return M;
    end proc:
    posted in Quick Code Snippets
  • RE: How to import Geogebra files, Cabri files into Mobius

    I have found success using iframes and the geogebra materials system. You can embed any of the apps on geogebra.org/materials and you can upload your own. To find the embed code, choose an app on geogebra.org/materials, click the share icon in the top corner of the page and choose the embed tab. It should look something like the screenshot below

    Below is an example embedding code.

    <iframe scrolling="no" title="Dot Plot Tool" src="https://www.geogebra.org/material/iframe/id/HD6hhQ75/width/1024/height/390/border/888888/smb/false/stb/false/stbh/false/ai/false/asb/false/sri/false/rc/false/ld/false/sdz/false/ctl/false" width="1024px" height="390px" style="border:0px;"> </iframe>

    To get this into Möbius you need to switch to source view in the question text area of the question designer. You can paste this code into the question where you want the geogebra app to display. You will need to preview the question to see it working.

    posted in Question Creation
  • Grading Code: Check if the rows of a matrix form a basis of a 2 dimensional vector space
    # Checks if input is a basis of some 2d vector space
    # Takes:    mat        (matrix with rows as basis vectors)
    #           ans1, ans2 (some correct basis vectors)
    mat  := Matrix([[1,1],[0,3]]):
    ans1 := Matrix([1,1]):
    ans2 := Matrix([0,3]):
    isMultiple := proc(vec1, vec2):
        matCheck := LinearAlgebra:-Transpose(Matrix([[vec1], [vec2]])):
        ans := 0:
        if evalb(LinearAlgebra:-Determinant(matCheck) = 0) then:
            ans := 1:
        end if:
    end proc:
    result := "unknown":
    dim := LinearAlgebra:-Dimension(mat):
    if (evalb(dim[1] <> 2) or evalb(dim[2] <> 2)) then:
        result := 0:
        v1 := mat[1, 1..2]:
        v2 := mat[2, 1..2]:
        if evalb(isMultiple(v1,v2) = 0) then:
            if evalb(isMultiple(v1, ans1) = 1) then:
                if evalb(isMultiple(v2, ans2) = 1) then:
                    result := "1":
                    result := "0":
                end if:
            elif evalb(isMultiple(v2, ans1) = 1) then:
                if evalb(isMultiple(v1, ans2) = 1) then:
                    result := "1":
                    result := "0":
                end if:
                result := "0":
            end if:
            result := "0":
        end if:
    end if:
    posted in Quick Code Snippets
  • RE: Using JS from github in HTML questions.

    @mschneider did you manage to get this working. If not, let me know and I'll help you fix it.

    posted in Question Creation
  • RE: How to distinguish "No Answer" and wrong answers in gradebooks

    @hig3 Hi, it shouldn't grade the rest of the assignment incorrectly if a student doesn't enter an answer. Can you share some screenshots of what you are seeing?

    posted in Course Administration