[LON-CAPA-users] How to automatically display solution for a problem?

Mills, Douglas G dmills at illinois.edu
Tue Mar 6 18:02:14 EST 2018


Hi Itay,

I may be wrong about this and there may be an easier way -- hopefully someone will point that out -- but back to your original question then, the way that occurs to me would be conditional sequences. I'll share an example here in case that will help you assess if this is the right approach for what you want to do and perhaps provide a bit of guidance on how this works.  If you end up with specific instrucitons on how to do this perhaps you can reply to me off-list for more detail.

We make extensive use of conditional sequences in our lab courses to prevent students from accessing the postlab if they have not correctly entered their data into the Lon-Capa lab. Below is a graphic representation of what that looks like for one of our prelab -- lab -- postlab sequences. This screenshot comes from the "advanced editor" interface for creating the sequence.  The three "Res" blocks correspond to the prelab problem, the lab problem, and the postlab problem. The conditional references the lab problem (mapalias "inlab9") to see if all of the answers there have been answered correctly and if not, blocks access to the postlab problem. It looks like this:

(((&EXT('user.resource.resource.210.11.awarddetail','inlab9') eq 'APPROX_ANS') || (&EXT('user.resource.resource.210.11.awarddetail','inlab9') eq 'EXACT_ANS')) && ((&EXT('user.resource.resource.220.21.awarddetail','inlab9') eq 'APPROX_ANS') || (&EXT('user.resource.resource.220.21.awarddetail','inlab9') eq 'EXACT_ANS')) && ((&EXT('user.resource.resource.220.22.awarddetail','inlab9') eq 'APPROX_ANS') || (&EXT('user.resource.resource.220.22.awarddetail','inlab9') eq 'EXACT_ANS')) && ((&EXT('user.resource.resource.220.23.awarddetail','inlab9') eq 'APPROX_ANS') || (&EXT('user.resource.resource.220.23.awarddetail','inlab9') eq 'EXACT_ANS')) && ((&EXT('user.resource.resource.220.24.awarddetail','inlab9') eq 'APPROX_ANS') || (&EXT('user.resource.resource.220.24.awarddetail','inlab9') eq 'EXACT_ANS'))) || (&EXT('user.resource.resource.210.solved','inlab9') eq 'excused')

(The last line of the conditional provides a way for the instructor to allow access to the postlab for a student with an excused absence from the lab.)

Your conditional may be quite a bit simpler being focused solely on whether or not the problem has its answer available.  I have not done that in a sequence before, but I have referenced it within a problem  and it looks like this: $external::datestatus eq 'SHOW_ANSWER'  I am NOT sure how (or if it's possible) to use that type of reference with a mapalias and hope someone else can help with that?

The one other thing I'll  point out about my sequence below is the path from the lab directly to Finish. That provides a path so as to not conditionally hide everything else in the course (as I once did when I first started working with sequences).

In your case, if I understand correctly, your sequence would contain two resources: the problem and the solution and the conditional would come between them and would verify that the answer was available for the problem before giving access to the solution.  I imagine that you could have a string of problem and solution pairs if you provided also a direct path from problem to problem so that all the problems were unconditionally available while each solution had a conditional path from its respective problem.

My very long .02.  If that seems like a viable approach for what you want to do, I'll be happy to answer additional questions off-list.

Doug



[cid:image001.png at 01D3B56C.DFD6FB60]




Douglas Mills
Director of Instructional Technology
Department of Chemistry
University of Illinois


From: LON-CAPA-users <lon-capa-users-bounces at mail.lon-capa.org> on behalf of Itay <itayf at nospammail.net>
Reply-To: Discussion list for LON-CAPA users <lon-capa-users at mail.lon-capa.org>
Date: Monday, March 5, 2018 at 3:37 PM
To: Discussion list for LON-CAPA users <lon-capa-users at mail.lon-capa.org>
Subject: Re: [LON-CAPA-users] How to automatically display solution for a problem?

Doug, Lucas, and Justin,

Thank you very much for your reply.
This is exactly what I wanted, and will employ, for problems that I code.

What can be done for problems that others have authored?

Thanks
Itay


On Mon, 5 Mar 2018, at 23:08, Justin Gray wrote:
Here is a sample problem that uses a block for after solved:

<problem><startouttext />Enter the correct answer 42 to see the hidden text or image:<endouttext />
<numericalresponse answer="42">


    <textline readonly="no" spellcheck="none" />

</numericalresponse>

<solved>
    <img encrypturl="no" /><startouttext /><p>Hooray!</p><endouttext />
</solved>
</problem>

Note that the solution could be, for example, a text/HTML block or an image.

Justin


Justin Gray | Senior Lecturer
Department of Mathematics | Simon Fraser University
8888 University Drive, Burnaby | V5A 1S6 | Canada
Tel: +1 778.782.4237

[cid:image002.png at 01D3B56C.DFD6FB60]

On Mon, Mar 5, 2018 at 1:03 PM, Mills, Douglas G <dmills at illinois.edu<mailto:dmills at illinois.edu>> wrote:

HI Itay,



There these very handy "Blocks" you can insert in your problem code and I think the "postanswerdate" block will do what you want, but I'm including all four that can be found from the Insert menu on the "colorful" editor.  I would describe these as predefined conditionals so the postanswerdate pair, for example, will only display what is within the opening and closing tags after the answer has become available.  If you put your link to a solution PDF inside a pair of postanswerdate tags, that should do what you're looking for. The others work analogously I believe.



            <postanswerdate></postanswerdate>

            <preduedate></preduedate>

            <solved></solved>

            <notsolved></notsolved>







Doug



Douglas Mills

Director of Instructional Technology

Department of Chemistry

University of Illinois





From: LON-CAPA-users <lon-capa-users-bounces at mail.lon-capa.org<mailto:lon-capa-users-bounces at mail.lon-capa.org>> on behalf of Itay <itayf at nospammail.net<mailto:itayf at nospammail.net>>
Reply-To: Discussion list for LON-CAPA users <lon-capa-users at mail.lon-capa.org<mailto:lon-capa-users at mail.lon-capa.org>>
Date: Monday, March 5, 2018 at 2:34 PM
To: Discussion list for LON-CAPA users <lon-capa-users at mail.lon-capa.org<mailto:lon-capa-users at mail.lon-capa.org>>
Subject: [LON-CAPA-users] How to automatically display solution for a problem?



Hi



I failed to find a solution to this seemingly simple and universal issue.

Conditional sequences might be the mechanism I am looking for, but I could not find enough details and examples of implementation.



Assume I prepared and published a problem  'some.problem', and a corresponding solution 'solution.pdf'.

I imported the problem into a course and set the parameters duedate and answerdate.



I am looking for a mechanism that will allow me

(1) to include a reference to the 'solution.pdf' inside 'some.problem'; and

(2) will display 'solution.pdf' to the students only when 'answerdate' is reached and the answer for 'some.problem' is displayed.

And I would like to achieve this for every problem inside a folder and/or a course.



I would appreciate any hints on how to achieve that.



Thanks in advance,

Itay





_______________________________________________
LON-CAPA-users mailing list
LON-CAPA-users at mail.lon-capa.org<mailto:LON-CAPA-users at mail.lon-capa.org>
http://mail.lon-capa.org/mailman/listinfo/lon-capa-users

_______________________________________________
LON-CAPA-users mailing list
LON-CAPA-users at mail.lon-capa.org<mailto:LON-CAPA-users at mail.lon-capa.org>
http://mail.lon-capa.org/mailman/listinfo/lon-capa-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.lon-capa.org/pipermail/lon-capa-users/attachments/20180306/1d6ddbdc/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 26865 bytes
Desc: image001.png
URL: <http://mail.lon-capa.org/pipermail/lon-capa-users/attachments/20180306/1d6ddbdc/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 8544 bytes
Desc: image002.png
URL: <http://mail.lon-capa.org/pipermail/lon-capa-users/attachments/20180306/1d6ddbdc/attachment-0003.png>


More information about the LON-CAPA-users mailing list