From raeburn at msu.edu Thu Nov 7 22:28:26 2019 From: raeburn at msu.edu (Raeburn, Stuart) Date: Fri, 8 Nov 2019 03:28:26 +0000 Subject: [LON-CAPA-users] 2 questions In-Reply-To: <0C663CCF-6784-4464-9188-CB0FD251A437@illinois.edu> References: <0C663CCF-6784-4464-9188-CB0FD251A437@illinois.edu> Message-ID: Doug, My previous answer to the first of your two questions concerned the situation where question type is set to randomizetry in a problem without parts. Note: in LON-CAPA the problem as a whole is "part 0", and the "colorful" editor includes selection of "Parameters for a part" in an "Insert" drop-down to add a new parameter tag outside any part tags, i.e., for the problem as a whole ("part 0"). If you set type to randomizetry within a problem part in Authoring Space, then the randomization behavior in both Authoring Space, and in course context is different. In both Authoring Space and in course context you will see a green notification: "New Question Variation After Every N tries", which is different to the notification: "New Problem Variation After Every N tries" displayed in course context when type = randomizetry for the problem, instead of for a part. You reported: "However, randomization does not occur, neither in the authoring space nor when published publicly". Support for question type = randomizetry was first included in LON-CAPA 2.10.0. In all versions of LON-CAPA released to date, when viewing a published resource (e.g., a URL of /res/uiuc/dmills/...) *not* included in a course, if there is a parameter setting of type = randomizetry within the problem it has no impact on the randomization in effect, as tries are used. (Note: this applies regardless of whether the resource was published public or not). It is straightforward to modify the LON-CAPA codebase so the randomization when viewing a published resource *not* in a course will take account of type=randomizetry included as a parameter in the resource itself. I have included that code change in the forthcoming 2.11.3 release. See: mail.lon-capa.org/pipermail/lon-capa-cvs/Week-of-Mon-20191104/028815.html As regards randomization not occurring in the Authoring Space (e.g., a URL of /priv/uiuc/dmills/...), that could be the result of the way randomization is implemented in the particular problem. If you are using calls to &random() in script block(s) in a single part problem then you could see a difference between behavior in Authoring Space, and behavior in course context for the same problem. I have modified the LON-CAPA codebase to make the behavior consistent between Authoring Space and course context for single part problems, and have included that code change in 2.11.3. See: mail.lon-capa.org/pipermail/lon-capa-cvs/Week-of-Mon-20191104/028820.html For now, if you plan to use type=randomizetry for multi-part problems which include script block(s) where you would typically use: &random(), you should instead use a LON-CAPA function which allows you to specify the seed, such as &random_uniform_integer. For example, to obtain two random integers, $a and $b, within a script block in place of: $a=&random(1,10,1); $b=&random(1,10,1); you could use: ($a,$b) = &random_uniform_integer (2,$external::randomseed,1,10); I have also implemented changes in the LON-CAPA codebase so the standard LON-CAPA function: &random() will use a tries-based random seed for each part's script block in a multi-part problem, in the case where type = randomizetry. See: http://bugs.loncapa.org/show_bug.cgi?id=6919 If you want to explore type=randomizetry in operation in LON-CAPA 2.11.3 with the modifications implemented for bugs 6917 and 6919, visit: testdrive.loncapa.net/adm/createaccount and request an instructor account. Note: the testdrive.loncapa.net instance is a part of the LON-CAPA network (and hence Course Coordinators and Authors will have access to the cross-institutional content repository). Account creation at testdrive.loncapa.net requires use of an institutional e-mail address, and also includes verification that the requester is faculty/staff at a post-secondary or K12 institution. That is in contrast to the older testdrive.loncapa.org instance which is standalone, and does not require verification. Stuart Raeburn LON-CAPA Academic Consortium ________________________________________ From: LON-CAPA-users on behalf of Mills, Douglas G Sent: Thursday, October 31, 2019 4:55 PM To: Discussion list for LON-CAPA users Cc: Mills, Douglas G Subject: Re: [LON-CAPA-users] 2 questions HI Stuart, I'm finding actually that IF the parameters are inserted between part tags, the green notification that it will randomize every N tries appears in the authoring space. However, randomization does not occur, neither in the authoring space nor when published publicly (which of course means that it is randomizable anyway, maybe that has an effect on the published version? I'm just using the public publication as a quick test and an easy way for a collaborator with whom I don't have a shared course for testing to have a look. It's not what we'll ultimately do with these.). If I take the same problem and remove the part tags, the green notification does not appear in the authoring space and, as you describe below, it randomizes after every submission. Doug DOUGLAS G MILLS Director of Instructional Technology Department of Chemistry University of Illinois at Urbana-Champaign Chemistry Annex Box A2 601 S. Mathews | M/C 712 Urbana, IL 61801 217.244.5739 | fax: 217.244.8029 | dmills at illinois.edu chemistry.illinois.edu Under the Illinois Freedom of Information Act any written communication to or from university employees regarding university business is a public record and may be subject to public disclosure. ?On 10/31/19, 12:47 PM, "LON-CAPA-users on behalf of Raeburn, Stuart" wrote: Doug, Answer to question 1: Authors can include parameters within a problem to cause the randomization to change after N tries, by setting the questiontype parameter to randomizetry, and the randomizeontries to N, e.g., If you use the colorful editor, and select "Parameters for a part" in an Insert drop-down list item, you can then insert these parameters by using the "Use template" drop-down list to selecting either "Question type" or "Tries before new Variation (if Qn. Type=randomizetry)". In the first case, enter a value of: randomizetry in the Default: textbox, and in the second enter the desired number of tries (e.g., 3) in the Default: textbox. If the questiontype parameter is set to randomizetry, but randomizeontries is not set, then a default value of N = 1 is used. In course context when you include a parameter within a problem itself, that parameter will be listed in the "Resource Level" default column when displaying Content Settings for that particular resource. (The resource level default can be overridden by setting a value for the same parameter in the "in Course" for Resource column in table mode, i.e., further to the right). Currently, including a randomizeontries parameter within a problem does not change the behavior when viewing in Authoring Space (N=1 applies), although the parameter you set will be in effect when viewing in course context. In addition, when the randomizetry parameter is included within a problem, the text: "New Problem Variation After Every N tries" is displayed in course context, but not when viewing in Authoring Space. I have filed a bug (6917) and have implemented code changes so viewing in Authoring Space is consistent with viewing in course context. (See bugs.loncapa.org/show_bug.cgi?id=6917 for details). Answer to question 2: If the problem is a cs or ci stringresponse type problem, then in a script block you could loop over the attempt history and retrieve the "Computer's answer" for a particular attempt via: &EXT("user.resource.$i:resource...answerstring") (you would remove the text: "INTERNAL:" from the value returned by the &EXT()), and you could retrieve the submission for that particular attempt via: &EXT("user.resource.$i:resource....submission") where $i is the transaction counter, as discussed in an earlier thread on this list (see: mail.lon-capa.org/pipermail/lon-capa-users/2018-October/005362.html). However, rendering both the instance of the question for the randomseed in effect, and the computer's answer for a responseitem that is not ci or cs stringresponse, would require implementing a change within LON-CAPA to display the output from rendering for these different targets with the current randomseed, along with an "Additional tries with new problem variation" button to proceed to access additional attempt(s) with the new randomseed. I have filed an enhancement request for this, see: bugs.loncapa.org/show_bug.cgi?id=6918 I do not know whether questiontype=randomizetry is in use by any instructors. This questiontype was originally implemented to satisfy a request from ECE instructor(s) in the uiuc domain, but I believe ECE course(s) at uiuc no longer use LON-CAPA. Aside from the use of a questiontype set to randomizetry, you could also explore (a) the use of conditional blocks within a .problem, or (b) the use of a .page containing multiple instances of the same resource, linked together by conditional links, as ways of accomplishing your goal (albeit with a potential side effect on points possible totals for a folder and/or course when using the standard gradebook). Stuart Raeburn LON-CAPA Academic Consortium ________________________________________ From: LON-CAPA-users on behalf of Mills, Douglas G Sent: Wednesday, October 30, 2019 10:31 AM To: Discussion list for LON-CAPA users Cc: Mills, Douglas G Subject: [LON-CAPA-users] 2 questions Happy Fall -- it seems to be arriving here in Champaign Urbana at least. I am wondering: (1) Is there a parameter that can be coded into a problem to refresh variables after x number of attempts? I know this can be done in the content parameters and that that is the preferred Lon-Capa approach, giving instructors greater autonomy over such decisions, but for specific problems in a specific course, the instructors are interested in after, say 3 tries, giving the student the answer to the current version of the problem and presenting a re-randomized version. Which leads to my second question: (2) If in the scenario above we randomize a problem after x number of tries, is there a way to refer to the previous randomized values so that in addition to the new version the student can be shown something like "The problem you were trying to solve was ... and the correct answer to that problem is ..." ? There are so many possibilities for creative implementations in Lon-Capa I'm pretty sure I can figure out a way of accomplishing this, but thought I'd go ahead and ask first since there are also so many ways of accessing behind-the-scenes information in Lon-Capa. Thanks all! Doug DOUGLAS G MILLS Director of Instructional Technology Department of Chemistry University of Illinois at Urbana-Champaign Chemistry Annex Box A2 601 S. Mathews | M/C 712 Urbana, IL 61801 217.244.5739 | fax: 217.244.8029 | dmills at illinois.edu chemistry.illinois.edu [/var/folders/kv/f3wpy1cs51521x5grm_qx4tw0000gn/T/com.microsoft.Outlook/WebArchiveCopyPasteTempFiles/P698ojxP4tc7j8gMqgPv+E4KQAAAABJRU5ErkJggg==] Under the Illinois Freedom of Information Act any written communication to or from university employees regarding university business is a public record and may be subject to public disclosure. _______________________________________________ LON-CAPA-users mailing list LON-CAPA-users at mail.lon-capa.org https://urldefense.com/v3/__http://mail.lon-capa.org/mailman/listinfo/lon-capa-users__;!ioFpBMP7lJU!jWkr83RsChajVKdCBOngqTK72kBLu6mUWOzvw9ZnRApY7YWmSDxTKlMMmZ7e2w$ From ABERTR at tcc.fl.edu Thu Nov 14 12:28:18 2019 From: ABERTR at tcc.fl.edu (Rex Abert) Date: Thu, 14 Nov 2019 17:28:18 +0000 Subject: [LON-CAPA-users] New Problem type for graphing Message-ID: I would like to announce to those using Lon-Capa for mathematics (Pitt, Purdue, Simon Fraser, et al), especially high school and first and second-year college math, that I have developed a suite of graphing questions for LC. These are not meant to replace Geogebra or FunctionPlot response questions. Geogebra is good at what it does. Given a function, it will graph it nicely. FunctionPlot response is great for plotting, say, experimental results and fitting a rough curve to data. I wanted LC questions that would turn it around: give the students a function to graph, and have the student plot critical features to create a graph, and have LC evaluate the correctness of the graph. These questions call on libraries written using Javascript, and I have written libraries supporting the graphing of polynomials, absolute-value functions, explonential and logarithmic functions, rational functions, and trigonometric functions. Yet to come are graphers for conic sections and piecewise-defined functions. (Maybe others?) There is probably room for improvement of these questions and libraries. For example, I paid little attention to accessibility concerns. There might be browser issues with older browsers, Microsoft browswers, or mobile devices. The interface might benefit from a little tweaking. There might yet be some unexpected bugs that pop up with certain randomizations. I welcome any feedback, constructive criticism, and/or suggestions. It is my hope that one day these might be added to LC as new question types. Perhaps some enthusiastic graduate student could be employed to do this. All the required libraries and supporting files are in /res/tccfl/abertr/Graphing/ While these files are open source, I hope that no one will grab the code and port it to other LMS platforms, such as Lumen/MyOpenMath. 1. Polynomials In its general form, given n points selected by the user, with at least one point that is not an x-intercept, a degree n-1 polynomial is fit to the points using Newton's interpolating polynomial. The instructor can specify that more points than necessary be input, for example, demand that the student select 5 points for a quadratic function (if the points are on the graph correctly, then the coefficients of higher-degree terms will be 0). This same library is used for absolute value functions, but if and when I develop a library for piecewise functions, absolute value functions might better be shifted there. For samples, see /res/tccfl/abertr/CollegeAlgebra/QuadraticFunctions/QuadraticGraph01.problem through /res/tccfl/abertr/CollegeAlgebra/QuadraticFunctions/QuadraticGraph09.problem /res/tccfl/abertr/CollegeAlgebra/LinearEquations/AbsoluteValueGraph01.problem /res/tccfl/abertr/CollegeAlgebra/LinearEquations/AbsoluteValueGraph02.problem /res/tccfl/abertr/CollegeAlgebra/LinearEquations/GraphOfALine.problem /res/tccfl/abertr/CollegeAlgebra/LinearEquations/GraphOfALine02.problem /res/tccfl/abertr/CollegeAlgebra/LinearEquations/GraphOfALine03.problem For higher-degree polynomials: /res/tccfl/abertr/Precalculus/Polynomials/DrawPolyGraph01.problem /res/tccfl/abertr/Precalculus/Polynomials/DrawPolyGraph02.problem 2. Rational Functions Given a rational function P(x)/Q(x), the student will graph the function by plotting x- and y-intercepts, vertical asymptotes, and the end behavior (horozontal asymptote or other). The numerator and denominator must be polynomials, although if they are not strictly polynomials, it might still work. The zeros of the numerator and denominator must be real. P(x) and Q(x) with imaginary roots, such as x^2 + 1, is not supported (yet?). For examples, see /res/tccfl/abertr/Precalculus/PolynomialsAndRationalFunctions/graphRationalFunction01.problem through /res/tccfl/abertr/Precalculus/PolynomialsAndRationalFunctions/graphRationalFunction07.problem 3. Exponential and Logarithmic Functions Given one of these functions, the student creates the graph by plotting at least 3 points AND the asymptote, even if the asymptote is one of the coordinate axes. Incorrect graphs made by including both a horizontal and vertical asymptote, which I've seen many students do on paper, is rather crudely supported. See /res/tccfl/abertr/Precalculus/LogarithmExponential/GraphExponential01.problem through /res/tccfl/abertr/Precalculus/LogarithmExponential/GraphExponential06.problem and /res/tccfl/abertr/Precalculus/LogarithmExponential/GraphLogarithmic01.problem through /res/tccfl/abertr/Precalculus/LogarithmExponential/GraphLogarithmic05.problem 4. Trigonometric Functions The student will select the type of graph to be drawn: sine & cosine, or tangent & cotangent, or secant & cosecant. The student will then enter 5 features for each: 5 points for a wave, two asymptotes and three points for tangent and cotangent, or 3 asymptotes and two points for secant and cosecant. The student may also select the type of scale to use for the horizontal axis, either a scale labeled with rational numbers or a scale labeled with irrational numbers (multiples of pi). The selection will be driven by the period and phase shift of the given function. For examples, /res/tccfl/abertr/Trigonometry/Graphing/DrawTrigGraph01.problem through /res/tccfl/abertr/Trigonometry/Graphing/DrawTrigGraph12.problem Best regards, Rex Abert ***Due to Florida's very broad public records law, most written communications to or from Tallahassee Community College employees regarding College business are public records, available to the public and media upon request. Therefore, this email communication and your response may be subject to public disclosure.*** From dmills at illinois.edu Fri Nov 15 17:23:39 2019 From: dmills at illinois.edu (Mills, Douglas G) Date: Fri, 15 Nov 2019 22:23:39 +0000 Subject: [LON-CAPA-users] dataresponse Message-ID: Happy Friday! I was perusing the Author's Manual yesterday and noticed for the first time the datresponse tag (p. 95 of the current version) and it seems like it could be very helpful -- quite possibly the correct Lon-Capa way of doing a number of things I've been doing in other ways... Anyway, I'm working on putting this tag to use and have added the following to an existing problem part: However, whatever is entered into the textfield disappears when the part is submitted. Am I doing something wrong? Thanks! Doug DOUGLAS G MILLS Director of Instructional Technology Department of Chemistry University of Illinois at Urbana-Champaign Chemistry Annex Box A2 601 S. Mathews | M/C 712 Urbana, IL 61801 217.244.5739 | fax: 217.244.8029 | dmills at illinois.edu chemistry.illinois.edu [/var/folders/kv/f3wpy1cs51521x5grm_qx4tw0000gn/T/com.microsoft.Outlook/WebArchiveCopyPasteTempFiles/P698ojxP4tc7j8gMqgPv+E4KQAAAABJRU5ErkJggg==] Under the Illinois Freedom of Information Act any written communication to or from university employees regarding university business is a public record and may be subject to public disclosure. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 2604 bytes Desc: image001.png URL: From dmills at illinois.edu Fri Nov 15 17:38:25 2019 From: dmills at illinois.edu (Mills, Douglas G) Date: Fri, 15 Nov 2019 22:38:25 +0000 Subject: [LON-CAPA-users] dataresponse In-Reply-To: References: Message-ID: <23AD71ED-D50E-4D27-B30D-99BC2BBFDCDE@illinois.edu> I should have added that the response for the part continues to be "some items were not submitted." I'm sure I'm doing something dumb -- missing something somewhere. Thanks! Doug DOUGLAS G MILLS Director of Instructional Technology Department of Chemistry University of Illinois at Urbana-Champaign Chemistry Annex Box A2 601 S. Mathews | M/C 712 Urbana, IL 61801 217.244.5739 | fax: 217.244.8029 | dmills at illinois.edu chemistry.illinois.edu [/var/folders/kv/f3wpy1cs51521x5grm_qx4tw0000gn/T/com.microsoft.Outlook/WebArchiveCopyPasteTempFiles/P698ojxP4tc7j8gMqgPv+E4KQAAAABJRU5ErkJggg==] Under the Illinois Freedom of Information Act any written communication to or from university employees regarding university business is a public record and may be subject to public disclosure. From: "Mills, Douglas G" Date: Friday, November 15, 2019 at 4:23 PM To: Discussion list for LON-CAPA users Cc: "Mills, Douglas G" Subject: dataresponse Happy Friday! I was perusing the Author's Manual yesterday and noticed for the first time the datresponse tag (p. 95 of the current version) and it seems like it could be very helpful -- quite possibly the correct Lon-Capa way of doing a number of things I've been doing in other ways... Anyway, I'm working on putting this tag to use and have added the following to an existing problem part: However, whatever is entered into the textfield disappears when the part is submitted. Am I doing something wrong? Thanks! Doug DOUGLAS G MILLS Director of Instructional Technology Department of Chemistry University of Illinois at Urbana-Champaign Chemistry Annex Box A2 601 S. Mathews | M/C 712 Urbana, IL 61801 217.244.5739 | fax: 217.244.8029 | dmills at illinois.edu chemistry.illinois.edu [/var/folders/kv/f3wpy1cs51521x5grm_qx4tw0000gn/T/com.microsoft.Outlook/WebArchiveCopyPasteTempFiles/P698ojxP4tc7j8gMqgPv+E4KQAAAABJRU5ErkJggg==] Under the Illinois Freedom of Information Act any written communication to or from university employees regarding university business is a public record and may be subject to public disclosure. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 2604 bytes Desc: image001.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.png Type: image/png Size: 2605 bytes Desc: image002.png URL: From dmills at illinois.edu Mon Nov 18 14:22:07 2019 From: dmills at illinois.edu (Mills, Douglas G) Date: Mon, 18 Nov 2019 19:22:07 +0000 Subject: [LON-CAPA-users] Client IP Access Control in Content Settings Message-ID: <136BB08D-02BB-483C-BB92-970F7B9AD4BF@illinois.edu> Hi All, We've been using the Client IP Access Control quite nicely for restricting access to some of our exams to a computer-based testing facility. This is set up in the Content Settings. However, we have a student who needs to take an exam in a disability testing facility. Once selecting this user to modify parameters specific to him, I'm not seeing a way to override the general IP restrictions for the rest of the class for this one user. Is there a strategy for doing that? Normally of course you would override the general setting by setting a new one at the individual user level. However, in this case, I don't want there to be any setting at the individual user level on Client IP restrictions -- the plan is to use a Slot with a password to be entered at the disability testing facility. I know that if we were using a slot for the IP restrictions we could then override with a different customized slot for this student, but that is not our case. Is there a way to override an IP restriction set in the content settings? Thanks! Doug DOUGLAS G MILLS Director of Instructional Technology Department of Chemistry University of Illinois at Urbana-Champaign Chemistry Annex Box A2 601 S. Mathews | M/C 712 Urbana, IL 61801 217.244.5739 | fax: 217.244.8029 | dmills at illinois.edu chemistry.illinois.edu [/var/folders/kv/f3wpy1cs51521x5grm_qx4tw0000gn/T/com.microsoft.Outlook/WebArchiveCopyPasteTempFiles/P698ojxP4tc7j8gMqgPv+E4KQAAAABJRU5ErkJggg==] Under the Illinois Freedom of Information Act any written communication to or from university employees regarding university business is a public record and may be subject to public disclosure. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 2604 bytes Desc: image001.png URL: From dmills at illinois.edu Mon Nov 18 15:09:02 2019 From: dmills at illinois.edu (Mills, Douglas G) Date: Mon, 18 Nov 2019 20:09:02 +0000 Subject: [LON-CAPA-users] Client IP Access Control in Content Settings In-Reply-To: <136BB08D-02BB-483C-BB92-970F7B9AD4BF@illinois.edu> References: <136BB08D-02BB-483C-BB92-970F7B9AD4BF@illinois.edu> Message-ID: Answering my own question (I think): I see that wildcards (*) can be used, so I'm guessing I should be able to for an individual student override the restrictive access IPs for the rest of the class by entering something like *.illinois.edu. I'll give that a go. Doug DOUGLAS G MILLS Director of Instructional Technology Department of Chemistry University of Illinois at Urbana-Champaign Chemistry Annex Box A2 601 S. Mathews | M/C 712 Urbana, IL 61801 217.244.5739 | fax: 217.244.8029 | dmills at illinois.edu chemistry.illinois.edu [/var/folders/kv/f3wpy1cs51521x5grm_qx4tw0000gn/T/com.microsoft.Outlook/WebArchiveCopyPasteTempFiles/P698ojxP4tc7j8gMqgPv+E4KQAAAABJRU5ErkJggg==] Under the Illinois Freedom of Information Act any written communication to or from university employees regarding university business is a public record and may be subject to public disclosure. From: "Mills, Douglas G" Date: Monday, November 18, 2019 at 1:22 PM To: Discussion list for LON-CAPA users Cc: "Mills, Douglas G" Subject: Client IP Access Control in Content Settings Hi All, We've been using the Client IP Access Control quite nicely for restricting access to some of our exams to a computer-based testing facility. This is set up in the Content Settings. However, we have a student who needs to take an exam in a disability testing facility. Once selecting this user to modify parameters specific to him, I'm not seeing a way to override the general IP restrictions for the rest of the class for this one user. Is there a strategy for doing that? Normally of course you would override the general setting by setting a new one at the individual user level. However, in this case, I don't want there to be any setting at the individual user level on Client IP restrictions -- the plan is to use a Slot with a password to be entered at the disability testing facility. I know that if we were using a slot for the IP restrictions we could then override with a different customized slot for this student, but that is not our case. Is there a way to override an IP restriction set in the content settings? Thanks! Doug DOUGLAS G MILLS Director of Instructional Technology Department of Chemistry University of Illinois at Urbana-Champaign Chemistry Annex Box A2 601 S. Mathews | M/C 712 Urbana, IL 61801 217.244.5739 | fax: 217.244.8029 | dmills at illinois.edu chemistry.illinois.edu [/var/folders/kv/f3wpy1cs51521x5grm_qx4tw0000gn/T/com.microsoft.Outlook/WebArchiveCopyPasteTempFiles/P698ojxP4tc7j8gMqgPv+E4KQAAAABJRU5ErkJggg==] Under the Illinois Freedom of Information Act any written communication to or from university employees regarding university business is a public record and may be subject to public disclosure. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 2604 bytes Desc: image001.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.png Type: image/png Size: 2605 bytes Desc: image002.png URL: From raeburn at msu.edu Mon Nov 18 15:20:02 2019 From: raeburn at msu.edu (Raeburn, Stuart) Date: Mon, 18 Nov 2019 20:20:02 +0000 Subject: [LON-CAPA-users] Client IP Access Control in Content Settings In-Reply-To: <136BB08D-02BB-483C-BB92-970F7B9AD4BF@illinois.edu> References: <136BB08D-02BB-483C-BB92-970F7B9AD4BF@illinois.edu> Message-ID: Doug, At the individual user level set the Client IP/Name Access Control (acc) parameter to: * This will allow access for that particular student from any IP address, and will override any acc parameter set at a more general level. (Instead of * you could also set the parameter to: no). Stuart Raeburn LON-CAPA Academic Consortium ________________________________________ From: LON-CAPA-users on behalf of Mills, Douglas G Sent: Monday, November 18, 2019 2:22 PM To: Discussion list for LON-CAPA users Cc: Mills, Douglas G Subject: [LON-CAPA-users] Client IP Access Control in Content Settings Hi All, We've been using the Client IP Access Control quite nicely for restricting access to some of our exams to a computer-based testing facility. This is set up in the Content Settings. However, we have a student who needs to take an exam in a disability testing facility. Once selecting this user to modify parameters specific to him, I'm not seeing a way to override the general IP restrictions for the rest of the class for this one user. Is there a strategy for doing that? Normally of course you would override the general setting by setting a new one at the individual user level. However, in this case, I don't want there to be any setting at the individual user level on Client IP restrictions -- the plan is to use a Slot with a password to be entered at the disability testing facility. I know that if we were using a slot for the IP restrictions we could then override with a different customized slot for this student, but that is not our case. Is there a way to override an IP restriction set in the content settings? Thanks! Doug DOUGLAS G MILLS Director of Instructional Technology Department of Chemistry University of Illinois at Urbana-Champaign Chemistry Annex Box A2 601 S. Mathews | M/C 712 Urbana, IL 61801 217.244.5739 | fax: 217.244.8029 | dmills at illinois.edu chemistry.illinois.edu [/var/folders/kv/f3wpy1cs51521x5grm_qx4tw0000gn/T/com.microsoft.Outlook/WebArchiveCopyPasteTempFiles/P698ojxP4tc7j8gMqgPv+E4KQAAAABJRU5ErkJggg==] Under the Illinois Freedom of Information Act any written communication to or from university employees regarding university business is a public record and may be subject to public disclosure. -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 2604 bytes Desc: image001.png URL: From dmills at illinois.edu Mon Nov 18 15:27:43 2019 From: dmills at illinois.edu (Mills, Douglas G) Date: Mon, 18 Nov 2019 20:27:43 +0000 Subject: [LON-CAPA-users] Client IP Access Control in Content Settings Message-ID: <035C9401-22D7-43C7-99CF-44981B8A8849@illinois.edu> Thank you Stuart! Doug DOUGLAS G MILLS Director of Instructional Technology Department of Chemistry University of Illinois at Urbana-Champaign Chemistry Annex Box A2 601 S. Mathews | M/C 712 Urbana, IL 61801 217.244.5739 | fax: 217.244.8029 | dmills at illinois.edu chemistry.illinois.edu Under the Illinois Freedom of Information Act any written communication to or from university employees regarding university business is a public record and may be subject to public disclosure. ?On 11/18/19, 2:22 PM, "LON-CAPA-users on behalf of Raeburn, Stuart" wrote: Doug, At the individual user level set the Client IP/Name Access Control (acc) parameter to: * This will allow access for that particular student from any IP address, and will override any acc parameter set at a more general level. (Instead of * you could also set the parameter to: no). Stuart Raeburn LON-CAPA Academic Consortium ________________________________________ From: LON-CAPA-users on behalf of Mills, Douglas G Sent: Monday, November 18, 2019 2:22 PM To: Discussion list for LON-CAPA users Cc: Mills, Douglas G Subject: [LON-CAPA-users] Client IP Access Control in Content Settings Hi All, We've been using the Client IP Access Control quite nicely for restricting access to some of our exams to a computer-based testing facility. This is set up in the Content Settings. However, we have a student who needs to take an exam in a disability testing facility. Once selecting this user to modify parameters specific to him, I'm not seeing a way to override the general IP restrictions for the rest of the class for this one user. Is there a strategy for doing that? Normally of course you would override the general setting by setting a new one at the individual user level. However, in this case, I don't want there to be any setting at the individual user level on Client IP restrictions -- the plan is to use a Slot with a password to be entered at the disability testing facility. I know that if we were using a slot for the IP restrictions we could then override with a different customized slot for this student, but that is not our case. Is there a way to override an IP restriction set in the content settings? Thanks! Doug DOUGLAS G MILLS Director of Instructional Technology Department of Chemistry University of Illinois at Urbana-Champaign Chemistry Annex Box A2 601 S. Mathews | M/C 712 Urbana, IL 61801 217.244.5739 | fax: 217.244.8029 | dmills at illinois.edu chemistry.illinois.edu [/var/folders/kv/f3wpy1cs51521x5grm_qx4tw0000gn/T/com.microsoft.Outlook/WebArchiveCopyPasteTempFiles/P698ojxP4tc7j8gMqgPv+E4KQAAAABJRU5ErkJggg==] Under the Illinois Freedom of Information Act any written communication to or from university employees regarding university business is a public record and may be subject to public disclosure. From SIMIN at engr.sc.edu Thu Nov 21 11:03:15 2019 From: SIMIN at engr.sc.edu (SIMIN, GRIGORY) Date: Thu, 21 Nov 2019 16:03:15 +0000 Subject: [LON-CAPA-users] Formula response won't recognize "pi" Message-ID: Hi all! I've found a strange issue in some problems requiring formula response. I have a simple question to enter the formula for the resonant frequency. An example of correct answer is (in other variations the formula could be a bit more complex than this one) 1/(2*pi*sqrt(L*C)) The correct solution is checked by sampling L and C values. When I am entering the answer, I can see that LON-CAPA recognizes it because it displays the formatted formula as I am entering it: [cid:image003.jpg at 01D5A05B.449F5B20] But when I press submit, I got the response: ?unable to understand formula? By experimenting with this, I found that the issue happens because of ?pi? being a part of the answer. If pi is replaced with 3.141, everything would work. But it feels weird asking students to enter 3.141 instead of pi; besides, I don?t even want to give them a hint that pi is a part of the answer. Why is this happening? Apparently LON-CAPA knows what ?pi? means because it displays it correctly. Thanks! Grigory -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image003.jpg Type: image/jpeg Size: 8375 bytes Desc: image003.jpg URL: From raeburn at msu.edu Thu Nov 21 13:26:31 2019 From: raeburn at msu.edu (Raeburn, Stuart) Date: Thu, 21 Nov 2019 18:26:31 +0000 Subject: [LON-CAPA-users] Formula response won't recognize "pi" In-Reply-To: References: Message-ID: Grigory, If you do *not* include a samples attribute in the formularesponse tag, then maxima will be used to compare the submitted formula with the expected answer. This became the default starting with LON-CAPA 2.4.0 (June 2007). However, if you include sample points in the formularesponse item, and your answer includes pi, see the example here: help.loncapa.org/fom/cache/361.html which shows how to include pi as a "variable" in the sampling points. For example, the following will grade as correct a submission of: 1/sqrt(4*pi^2*L*C)

Enter $ \frac{1}{\sqrt{4\cdot\pi^{2} \cdot L\cdot C}} $

See: loncapa.msu.edu/adm/help/Formula_Response_Sampling.hlp for additional information about the format to use for sampling points. Stuart Raeburn LON-CAPA Academic Consortium ________________________________________ From: LON-CAPA-users on behalf of SIMIN, GRIGORY Sent: Thursday, November 21, 2019 11:03 AM To: Discussion list for LON-CAPA users Subject: [LON-CAPA-users] Formula response won't recognize "pi" Hi all! I've found a strange issue in some problems requiring formula response. I have a simple question to enter the formula for the resonant frequency. An example of correct answer is (in other variations the formula could be a bit more complex than this one) 1/(2*pi*sqrt(L*C)) The correct solution is checked by sampling L and C values. When I am entering the answer, I can see that LON-CAPA recognizes it because it displays the formatted formula as I am entering it: [cid:image003.jpg at 01D5A05B.449F5B20] But when I press submit, I got the response: ?unable to understand formula? By experimenting with this, I found that the issue happens because of ?pi? being a part of the answer. If pi is replaced with 3.141, everything would work. But it feels weird asking students to enter 3.141 instead of pi; besides, I don?t even want to give them a hint that pi is a part of the answer. Why is this happening? Apparently LON-CAPA knows what ?pi? means because it displays it correctly. Thanks! Grigory -------------- next part -------------- A non-text attachment was scrubbed... Name: image003.jpg Type: image/jpeg Size: 8375 bytes Desc: image003.jpg URL: From hkng at fsu.edu Thu Nov 21 14:11:42 2019 From: hkng at fsu.edu (H. K. Ng) Date: Thu, 21 Nov 2019 19:11:42 +0000 Subject: [LON-CAPA-users] Formula response won't recognize "pi" In-Reply-To: References: Message-ID: Hi, Formularesponse using cas with maxima works great. What is formula for resonant frequency for an LC circuit?
$ \omega_{res} = $
Regards, -hk On Thu, Nov 21, 2019 at 11:05 AM SIMIN, GRIGORY > wrote: Hi all! I've found a strange issue in some problems requiring formula response. I have a simple question to enter the formula for the resonant frequency. An example of correct answer is (in other variations the formula could be a bit more complex than this one) 1/(2*pi*sqrt(L*C)) The correct solution is checked by sampling L and C values. When I am entering the answer, I can see that LON-CAPA recognizes it because it displays the formatted formula as I am entering it: [cid:16e8f5cf6cc6917eb1] But when I press submit, I got the response: ?unable to understand formula? By experimenting with this, I found that the issue happens because of ?pi? being a part of the answer. If pi is replaced with 3.141, everything would work. But it feels weird asking students to enter 3.141 instead of pi; besides, I don?t even want to give them a hint that pi is a part of the answer. Why is this happening? Apparently LON-CAPA knows what ?pi? means because it displays it correctly. Thanks! Grigory _______________________________________________ LON-CAPA-users mailing list LON-CAPA-users at mail.lon-capa.org https://urldefense.com/v3/__http://mail.lon-capa.org/mailman/listinfo/lon-capa-users__;!!PhOWcWs!npThfddABuFrPgPy2N5gLLGz_02Hs0mlKSiyGgd0QGK0jAvPgqAmVRpO7BG6$ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image003.jpg Type: image/jpeg Size: 8375 bytes Desc: image003.jpg URL: From jgray at math.sfu.ca Thu Nov 21 14:27:43 2019 From: jgray at math.sfu.ca (Justin Gray) Date: Thu, 21 Nov 2019 11:27:43 -0800 Subject: [LON-CAPA-users] Formula response won't recognize "pi" In-Reply-To: <7120db64c70c4314a1fd258eb58d1e2b@ITS-EXCHANGE04.sfu.ca> References: <7120db64c70c4314a1fd258eb58d1e2b@ITS-EXCHANGE04.sfu.ca> Message-ID: You can evaluate the answer using Maxima and allow for a tolerance using mathresponse. In Maxima, the constant pi is written as %pi. Here is a possible coding for this problem, which will accept either %pi or a numerical approximation for pi:

Enter $ \frac{1}{\sqrt{4\cdot\pi^{2} \cdot L\cdot C}} $

is(abs((RESPONSE[1])/(LONCAPALIST[1]) - 1) < 0.01);
You will probably want to give students some instruction for formatting their answer. Best, Justin -- *Justin Gray* Senior Lecturer | Department of Mathematics Simon Fraser University | SCK 10531 8888 University Dr., Burnaby, B.C. V5A 1S6 T: 778.782.4237 On Thu, Nov 21, 2019 at 11:14 AM H. K. Ng wrote: > Hi, > > Formularesponse using cas with maxima works great. > > > > > What is formula for resonant frequency for an LC circuit? >
> > $ \omega_{res} = $ > > > > >
> > Regards, > -hk > > > > > On Thu, Nov 21, 2019 at 11:05 AM SIMIN, GRIGORY wrote: > >> Hi all! >> >> I've found a strange issue in some problems requiring formula response. >> >> I have a simple question to enter the formula for the resonant frequency. >> >> An example of correct answer is (in other variations the formula could be >> a bit more complex than this one) >> >> 1/(2*pi*sqrt(L*C)) >> >> The correct solution is checked by sampling L and C values. >> >> When I am entering the answer, I can see that LON-CAPA recognizes it >> because it displays the formatted formula as I am entering it: >> >> >> >> But when I press submit, I got the response: >> >> ?unable to understand formula? >> >> >> >> By experimenting with this, I found that the issue happens because of >> ?pi? being a part of the answer. >> >> If pi is replaced with 3.141, everything would work. >> >> But it feels weird asking students to enter 3.141 instead of pi; besides, >> I don?t even want to give them a hint that pi is a part of the answer. >> >> >> >> Why is this happening? Apparently LON-CAPA knows what ?pi? means because >> it displays it correctly. >> >> >> >> Thanks! >> >> Grigory >> >> >> >> >> _______________________________________________ >> LON-CAPA-users mailing list >> LON-CAPA-users at mail.lon-capa.org >> >> https://urldefense.com/v3/__http://mail.lon-capa.org/mailman/listinfo/lon-capa-users__;!!PhOWcWs!npThfddABuFrPgPy2N5gLLGz_02Hs0mlKSiyGgd0QGK0jAvPgqAmVRpO7BG6$ >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image003.jpg Type: image/jpeg Size: 8375 bytes Desc: not available URL: From SIMIN at engr.sc.edu Thu Nov 21 14:51:33 2019 From: SIMIN at engr.sc.edu (SIMIN, GRIGORY) Date: Thu, 21 Nov 2019 19:51:33 +0000 Subject: [LON-CAPA-users] {Disarmed} RE: Formula response won't recognize "pi" In-Reply-To: References: Message-ID: hk, Great suggestion! Thank you! Grigory From: LON-CAPA-users On Behalf Of H. K. Ng Sent: Thursday, November 21, 2019 2:12 PM To: Discussion list for LON-CAPA users Subject: Re: [LON-CAPA-users] Formula response won't recognize "pi" Hi, Formularesponse using cas with maxima works great. What is formula for resonant frequency for an LC circuit?
$ \omega_{res} = $
Regards, -hk On Thu, Nov 21, 2019 at 11:05 AM SIMIN, GRIGORY > wrote: Hi all! I've found a strange issue in some problems requiring formula response. I have a simple question to enter the formula for the resonant frequency. An example of correct answer is (in other variations the formula could be a bit more complex than this one) 1/(2*pi*sqrt(L*C)) The correct solution is checked by sampling L and C values. When I am entering the answer, I can see that LON-CAPA recognizes it because it displays the formatted formula as I am entering it: [cid:image001.jpg at 01D5A07B.29C6BE90] But when I press submit, I got the response: ?unable to understand formula? By experimenting with this, I found that the issue happens because of ?pi? being a part of the answer. If pi is replaced with 3.141, everything would work. But it feels weird asking students to enter 3.141 instead of pi; besides, I don?t even want to give them a hint that pi is a part of the answer. Why is this happening? Apparently LON-CAPA knows what ?pi? means because it displays it correctly. Thanks! Grigory _______________________________________________ LON-CAPA-users mailing list LON-CAPA-users at mail.lon-capa.org https://urldefense.com/v3/__http://mail.lon-capa.org/mailman/listinfo/lon-capa-users__;!!PhOWcWs!npThfddABuFrPgPy2N5gLLGz_02Hs0mlKSiyGgd0QGK0jAvPgqAmVRpO7BG6$ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 8375 bytes Desc: image001.jpg URL: From SIMIN at engr.sc.edu Thu Nov 21 14:52:08 2019 From: SIMIN at engr.sc.edu (SIMIN, GRIGORY) Date: Thu, 21 Nov 2019 19:52:08 +0000 Subject: [LON-CAPA-users] {Disarmed} RE: Formula response won't recognize "pi" In-Reply-To: References: <7120db64c70c4314a1fd258eb58d1e2b@ITS-EXCHANGE04.sfu.ca> Message-ID: Justin, Many thanks! I will give it a try! Grigory From: LON-CAPA-users On Behalf Of Justin Gray Sent: Thursday, November 21, 2019 2:28 PM To: Discussion list for LON-CAPA users Subject: Re: [LON-CAPA-users] Formula response won't recognize "pi" You can evaluate the answer using Maxima and allow for a tolerance using mathresponse. In Maxima, the constant pi is written as %pi. Here is a possible coding for this problem, which will accept either %pi or a numerical approximation for pi:

Enter $ \frac{1}{\sqrt{4\cdot\pi^{2} \cdot L\cdot C}} $

is(abs((RESPONSE[1])/(LONCAPALIST[1]) - 1) < 0.01);
You will probably want to give students some instruction for formatting their answer. Best, Justin -- Justin Gray Senior Lecturer | Department of Mathematics Simon Fraser University | SCK 10531 8888 University Dr., Burnaby, B.C. V5A 1S6 T: 778.782.4237 [https://www.sfu.ca/content/sfu/communicators-toolkit/tools/brand-tools/on-brand-templates/email-signature/jcr:content/main_content/image_0.img.1280.high.png/1527873607206.png] On Thu, Nov 21, 2019 at 11:14 AM H. K. Ng > wrote: Hi, Formularesponse using cas with maxima works great. What is formula for resonant frequency for an LC circuit?
$ \omega_{res} = $
Regards, -hk On Thu, Nov 21, 2019 at 11:05 AM SIMIN, GRIGORY > wrote: Hi all! I've found a strange issue in some problems requiring formula response. I have a simple question to enter the formula for the resonant frequency. An example of correct answer is (in other variations the formula could be a bit more complex than this one) 1/(2*pi*sqrt(L*C)) The correct solution is checked by sampling L and C values. When I am entering the answer, I can see that LON-CAPA recognizes it because it displays the formatted formula as I am entering it: [cid:image001.jpg at 01D5A07B.3EF6C940] But when I press submit, I got the response: ?unable to understand formula? By experimenting with this, I found that the issue happens because of ?pi? being a part of the answer. If pi is replaced with 3.141, everything would work. But it feels weird asking students to enter 3.141 instead of pi; besides, I don?t even want to give them a hint that pi is a part of the answer. Why is this happening? Apparently LON-CAPA knows what ?pi? means because it displays it correctly. Thanks! Grigory _______________________________________________ LON-CAPA-users mailing list LON-CAPA-users at mail.lon-capa.org https://urldefense.com/v3/__http://mail.lon-capa.org/mailman/listinfo/lon-capa-users__;!!PhOWcWs!npThfddABuFrPgPy2N5gLLGz_02Hs0mlKSiyGgd0QGK0jAvPgqAmVRpO7BG6$ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 8375 bytes Desc: image001.jpg URL: From SIMIN at engr.sc.edu Thu Nov 21 14:53:09 2019 From: SIMIN at engr.sc.edu (SIMIN, GRIGORY) Date: Thu, 21 Nov 2019 19:53:09 +0000 Subject: [LON-CAPA-users] Formula response won't recognize "pi" In-Reply-To: References: Message-ID: Stuart, Thank you very much I did not recognize this difference! Will try this. Grigory -----Original Message----- From: LON-CAPA-users On Behalf Of Raeburn, Stuart Sent: Thursday, November 21, 2019 1:27 PM To: Discussion list for LON-CAPA users Subject: Re: [LON-CAPA-users] Formula response won't recognize "pi" Grigory, If you do *not* include a samples attribute in the formularesponse tag, then maxima will be used to compare the submitted formula with the expected answer. This became the default starting with LON-CAPA 2.4.0 (June 2007). However, if you include sample points in the formularesponse item, and your answer includes pi, see the example here: help.loncapa.org/fom/cache/361.html which shows how to include pi as a "variable" in the sampling points. For example, the following will grade as correct a submission of: 1/sqrt(4*pi^2*L*C)

Enter $ \frac{1}{\sqrt{4\cdot\pi^{2} \cdot L\cdot C}} $

See: loncapa.msu.edu/adm/help/Formula_Response_Sampling.hlp for additional information about the format to use for sampling points. Stuart Raeburn LON-CAPA Academic Consortium ________________________________________ From: LON-CAPA-users on behalf of SIMIN, GRIGORY Sent: Thursday, November 21, 2019 11:03 AM To: Discussion list for LON-CAPA users Subject: [LON-CAPA-users] Formula response won't recognize "pi" Hi all! I've found a strange issue in some problems requiring formula response. I have a simple question to enter the formula for the resonant frequency. An example of correct answer is (in other variations the formula could be a bit more complex than this one) 1/(2*pi*sqrt(L*C)) The correct solution is checked by sampling L and C values. When I am entering the answer, I can see that LON-CAPA recognizes it because it displays the formatted formula as I am entering it: [cid:image003.jpg at 01D5A05B.449F5B20] But when I press submit, I got the response: "unable to understand formula" By experimenting with this, I found that the issue happens because of "pi" being a part of the answer. If pi is replaced with 3.141, everything would work. But it feels weird asking students to enter 3.141 instead of pi; besides, I don't even want to give them a hint that pi is a part of the answer. Why is this happening? Apparently LON-CAPA knows what "pi" means because it displays it correctly. Thanks! Grigory From itayf at nospammail.net Fri Nov 22 01:11:52 2019 From: itayf at nospammail.net (Itay) Date: Fri, 22 Nov 2019 08:11:52 +0200 Subject: [LON-CAPA-users] Resetting all student data Message-ID: Hi A few years ago one of our teachers, who was considering using Lon-Capa, has manually created accounts for students outside our college, and made up their usernames [1]. Unfortunately, one of those usernames, matches the official institutional username of a new student, who just started. Granting the new student an internal, non-official, username is not an acceptable choice for me. Changing the username of the 'wild' old account is not possible, as I understand. So my guess is that my only option is to make that account *appear* as a new account for that student. I know how to change her personal details, including ID, email, etc. My question: How do I make sure she does not see/have access all the previous work done under her username? Can I delete previous work data? Or is it enough to prevent access to old courses by setting opening and closing dates? Thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmills at illinois.edu Tue Nov 26 16:55:17 2019 From: dmills at illinois.edu (Mills, Douglas G) Date: Tue, 26 Nov 2019 21:55:17 +0000 Subject: [LON-CAPA-users] How Best to Resolve Floating Point Issues? Message-ID: <1AC7AE35-632A-4D15-9FA3-DE0281E5CC10@illinois.edu> Hi All, I've run into a situation where the binary representation of base 10 numbers is catching up to us for a very small percentage of our students. To illustrate this I've created a public problem demonstrating the issue. Unlike the problems the students get this one, for the sake of demonstration, walks you through the calculations but uses the exact same numbers that one of our students had to work with resulting in a case where what should be zero is not equal to zero. What's the best way of preventing this from happening? (The source code is open also in case you want to have a look but it's pretty well spelled out in the problem itself for demonstration purposes). https://access3.lon-capa.illinois.edu/res/uiuc/dmills/scratchwork/FloatingPointIssueDemo.problem Thanks in advance and, on that topic, Happy Thanksgiving! Doug DOUGLAS G MILLS Director of Instructional Technology Department of Chemistry University of Illinois at Urbana-Champaign Chemistry Annex Box A2 601 S. Mathews | M/C 712 Urbana, IL 61801 217.244.5739 | fax: 217.244.8029 | dmills at illinois.edu chemistry.illinois.edu [/var/folders/kv/f3wpy1cs51521x5grm_qx4tw0000gn/T/com.microsoft.Outlook/WebArchiveCopyPasteTempFiles/P698ojxP4tc7j8gMqgPv+E4KQAAAABJRU5ErkJggg==] Under the Illinois Freedom of Information Act any written communication to or from university employees regarding university business is a public record and may be subject to public disclosure. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 2604 bytes Desc: image001.png URL: From raeburn at msu.edu Wed Nov 27 00:51:54 2019 From: raeburn at msu.edu (Raeburn, Stuart) Date: Wed, 27 Nov 2019 05:51:54 +0000 Subject: [LON-CAPA-users] How Best to Resolve Floating Point Issues? In-Reply-To: <1AC7AE35-632A-4D15-9FA3-DE0281E5CC10@illinois.edu> References: <1AC7AE35-632A-4D15-9FA3-DE0281E5CC10@illinois.edu> Message-ID: Doug, Borrowing from the fp_equal() subroutine used to compare whether two floating-point numbers are equal, to a particular number of decimal places, found at: http://perldoc.perl.org/perlop.html#Floating-point-Arithmetic you could test whether the values of $molt4 and $actualM rounded to the desired precision (e.g., 3 decimal places) are the same, and if so, set the $percenterror to 0, otherwise calculate $percenterror, using the method you used in your example. $precision = 3; if (&roundto($molt4,$precision) eq &roundto($actualM,$precision)) { $percenterror = 0; } else { $percenterror=abs($molt4-$actualM)*100/$actualM; } For any user supplied input you should also validate that the experimental data are reasonable. Note: you could also set an absolute tolerance for the case where the $percenterror is 0, and use a relative tolerance otherwise. (Note: any tolerance defined within the problem could be overridden within a course). if (&roundto($molt4,$precision) eq &roundto($actualM,$precision)) { $temp = 0; $percenterror = 0; $tol = 0.1; } else { $tol = '5%'; $temp = $molt4-$actualM; $percenterror=abs($molt4-$actualM)*100/$actualM; } Stuart Raeburn LON-CAPA Academic Consortium ________________________________________ From: LON-CAPA-users on behalf of Mills, Douglas G Sent: Tuesday, November 26, 2019 4:55 PM To: Discussion list for LON-CAPA users Cc: Mills, Douglas G Subject: [LON-CAPA-users] How Best to Resolve Floating Point Issues? Hi All, I've run into a situation where the binary representation of base 10 numbers is catching up to us for a very small percentage of our students. To illustrate this I've created a public problem demonstrating the issue. Unlike the problems the students get this one, for the sake of demonstration, walks you through the calculations but uses the exact same numbers that one of our students had to work with resulting in a case where what should be zero is not equal to zero. What's the best way of preventing this from happening? (The source code is open also in case you want to have a look but it's pretty well spelled out in the problem itself for demonstration purposes). https://access3.lon-capa.illinois.edu/res/uiuc/dmills/scratchwork/FloatingPointIssueDemo.problem Thanks in advance and, on that topic, Happy Thanksgiving! Doug DOUGLAS G MILLS Director of Instructional Technology Department of Chemistry University of Illinois at Urbana-Champaign Chemistry Annex Box A2 601 S. Mathews | M/C 712 Urbana, IL 61801 217.244.5739 | fax: 217.244.8029 | dmills at illinois.edu chemistry.illinois.edu [/var/folders/kv/f3wpy1cs51521x5grm_qx4tw0000gn/T/com.microsoft.Outlook/WebArchiveCopyPasteTempFiles/P698ojxP4tc7j8gMqgPv+E4KQAAAABJRU5ErkJggg==] Under the Illinois Freedom of Information Act any written communication to or from university employees regarding university business is a public record and may be subject to public disclosure. -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 2604 bytes Desc: image001.png URL: From dmills at illinois.edu Wed Nov 27 13:14:56 2019 From: dmills at illinois.edu (Mills, Douglas G) Date: Wed, 27 Nov 2019 18:14:56 +0000 Subject: [LON-CAPA-users] How Best to Resolve Floating Point Issues? In-Reply-To: References: Message-ID: <743BBAC7-BDFE-4650-A5C8-51A99DF6D6B2@illinois.edu> Thank you Stuart and Happy Thanksgiving! Doug -sent from mobile- > On Nov 26, 2019, at 11:53 PM, Raeburn, Stuart wrote: > > ?Doug, > > Borrowing from the fp_equal() subroutine used to compare whether two floating-point numbers are equal, to a particular number of decimal places, found at: > http://perldoc.perl.org/perlop.html#Floating-point-Arithmetic > > you could test whether the values of $molt4 and $actualM rounded to the desired precision (e.g., 3 decimal places) are the same, and if so, set the $percenterror to 0, otherwise calculate $percenterror, using the method you used in your example. > > $precision = 3; > if (&roundto($molt4,$precision) eq &roundto($actualM,$precision)) { > $percenterror = 0; > } else { > $percenterror=abs($molt4-$actualM)*100/$actualM; > } > > For any user supplied input you should also validate that the experimental data are reasonable. Note: you could also set an absolute tolerance for the case where the $percenterror is 0, and use a relative tolerance otherwise. (Note: any tolerance defined within the problem could be overridden within a course). > > if (&roundto($molt4,$precision) eq &roundto($actualM,$precision)) { > $temp = 0; > $percenterror = 0; > $tol = 0.1; > } else { > $tol = '5%'; > $temp = $molt4-$actualM; > $percenterror=abs($molt4-$actualM)*100/$actualM; > } > > > > > > > > Stuart Raeburn > LON-CAPA Academic Consortium > > ________________________________________ > From: LON-CAPA-users on behalf of Mills, Douglas G > Sent: Tuesday, November 26, 2019 4:55 PM > To: Discussion list for LON-CAPA users > Cc: Mills, Douglas G > Subject: [LON-CAPA-users] How Best to Resolve Floating Point Issues? > > Hi All, > > I've run into a situation where the binary representation of base 10 numbers is catching up to us for a very small percentage of our students. To illustrate this I've created a public problem demonstrating the issue. Unlike the problems the students get this one, for the sake of demonstration, walks you through the calculations but uses the exact same numbers that one of our students had to work with resulting in a case where what should be zero is not equal to zero. What's the best way of preventing this from happening? (The source code is open also in case you want to have a look but it's pretty well spelled out in the problem itself for demonstration purposes). > > https://access3.lon-capa.illinois.edu/res/uiuc/dmills/scratchwork/FloatingPointIssueDemo.problem > > Thanks in advance and, on that topic, Happy Thanksgiving! > > Doug > > DOUGLAS G MILLS > Director of Instructional Technology > > Department of Chemistry > > University of Illinois at Urbana-Champaign > Chemistry Annex Box A2 > 601 S. Mathews | M/C 712 > Urbana, IL 61801 > 217.244.5739 | fax: 217.244.8029 | dmills at illinois.edu > chemistry.illinois.edu > > [/var/folders/kv/f3wpy1cs51521x5grm_qx4tw0000gn/T/com.microsoft.Outlook/WebArchiveCopyPasteTempFiles/P698ojxP4tc7j8gMqgPv+E4KQAAAABJRU5ErkJggg==] > > Under the Illinois Freedom of Information Act any written communication to or from university employees regarding university business is a public record and may be subject to public disclosure. > > _______________________________________________ > LON-CAPA-users mailing list > LON-CAPA-users at mail.lon-capa.org > http://mail.lon-capa.org/mailman/listinfo/lon-capa-users