oneleft Posted April 25, 2002 Posted April 25, 2002 I've just been designated the takeover person on a project for a woman who decided to leave without much notice. I'm pretty good at FM but ain't never touched CDML before yesterday (well, I'd looked at it awhile back but nothing beyond that). The last two days I've been frantically doing my best to grab this but, alas, the gray cells ain't what they used to be. I would pay $100 for some phone questions and answers if anyone is interested, money tranferrable through PayPal. I'm on a bit of a deadline and this is kickin my sorry behind and I need some sleep dammit! Would prefer someone that doesn't live in the far reaches of Mongolia to keep the phone cost down. If interested email me at [email protected] and we'll work out the arrangements. I'm on the east coast so be sure to let me know where you are and best time to call. Rick
Garry Claridge Posted April 25, 2002 Posted April 25, 2002 Some of us in outer/upper Mongolia can help in the mean time if you have any questions. All the best. Garry
oneleft Posted April 25, 2002 Author Posted April 25, 2002 Hi Garry, Thanks. Jeesh where to begin. This is for an online course the company is putting up for all employees to read, basically reminding them of company policy, etc. Basically it's this: one db that a user will login to, the first time creating a record, each subsequent time do a search for their name if they don't finish it in one setting. It has first name, last name, employee id and 7 fields for each section to mark completed. After logging in they are taken to the main course window where there is a list of the 7 sections they must read to complete the course, each section having mutiple pages to click through. After they complete each course a "Completed" will be put next to that list item to indicate it on the main course window. Once all are finished they will be sent an email. Here's what I've managed to get done (some of which the lady before me was working on) They go to the Login screen, either enter new or search. From there they are taken to the result page which says welcome "name". They then click on continue to be taken to the main course window with the list of 7 courses. This all works great. So I've got the first file, the format file, the error file all working for new record and search. What I'm not grasping is the next part. The main course file will have 7 fields, the "Completed" for each one. Does this have a FM form? If so what goes in it? The 7 fields should not be editable by the user, they should just show the word "Completed" next to each section once it's completed. Each section has many pages but only the last page concerns me because there I have to edit the database to mark section completed after they click on the continue button, return them to the main course window and mark that section completed. How do I know it's on the right person? I think I'm most confused with the overall picture of this part. Sorry to be such a dunce but it's a lot to try to learn in a very short time. Let me know where you are and maybe we can do that phone thing if you're interested. Thanks, Rick
Garry Claridge Posted April 25, 2002 Posted April 25, 2002 Rick, Let's assume the main course screen looks like this: ID: xxxxxx Name: xxxxxxxxxxxxxxxxx Course 1: Completed Course 2: Not Completed [Do Course] Course 3: Not Completed [Do Course] etc The cdml/html can look like this: <body> ID: [FMP-Field: employee_id] Name: [FMP-Field: fname] [FMP-Field: lname]<br> Course 1: [FMP-If: course1 .eq. completed]Completed[FMP-Else]Not Completed [<a href="courseware">Do Course</a>][/FMP-If]<br> etc </body> When each course is completed a form can be sent to FMP which looks like this: <form action="FMPro" method="post"> <input type="hidden" name="-db" value="training.fp5"> <input type="hidden" name="-lay" value="cgi"> <input type="hidden" name="-format" value="main.html"> <input type="hidden" name="-recid" value="[FMP-CurrentToken]"> <input type="hidden" name="coursex" value="Completed"> <input type="submit" name="-edit" value="Finished"> The trick here is to pass the RecID along from the main course screen to the end of the course so that the '-edit' action can be used. The main course page can contain a token assignment; e.g. <input type="hidden" name="-token" value="[FMP-CurrentRecID]"> or, you can use some Javascript to do this. Hope this makes sense so far. I will add some more as I get the time. All the best. Garry
oneleft Posted April 25, 2002 Author Posted April 25, 2002 Hi Garry, Still having problems. So... The new file has a -format to RecAdded file with the -new. The search has -format to Found file with the -find. Both display the employee name successfully after execution. Then either of these files have to go to the Main course file. Let's use the Found file. I put in a Form in the Found file with the -format to Main course file with -view (since I'm not finding or adding or editing) and I cant' see the name or employee id in the Main course file. Do I have to pass a -token (which I don't pretend to understand) to the Main course file? The Main course has no Form, just the ID: [FMP-Field: employee_id] and also the name. Any insights? Thanks, Rick
oneleft Posted April 25, 2002 Author Posted April 25, 2002 Garry, I can see the current token with the following but the field name does not show. The token shows correctly for the record found. I created a new main_menu to play with and this is all it is: <HTML> <HEAD> <META NAME=GENERATOR CONTENT="Claris Home Page 3.0"> <X-CLARIS-WINDOW TOP=54 BOTTOM=608 LEFT=16 RIGHT=814> <X-CLARIS-TAGVIEW MODE=minimal> </HEAD> <BODY BGCOLOR="#FFFFFF"> <P><INPUT TYPE=text NAME="-token" VALUE="[FMP-CurrentToken]" SIZE=30></P> <P><FONT SIZE="+1" COLOR="#000000"><FONT SIZE="-1">Name: [FMP-FIELD: lastname] </FONT></FONT></P> </BODY> </HTML> With this I see the token (the current recid), Name: and nothing else. Thanks, Rick
Garry Claridge Posted April 25, 2002 Posted April 25, 2002 Rick, I would use the '-find' tag instead of the '-view' tag for the main page. Use it with this: <input type="hidden" name="employee_id" value="[FMP-Field: employee_id]"> Now you will be able to display the details. Hope this helps. Garry
oneleft Posted April 25, 2002 Author Posted April 25, 2002 Sorry Garry, don't understand. You say use it with <input type="hidden" name="employee_id" value="[FMP-Field: employee_id]">. From the Found file I'm going to the Main file, where does this go? What am I finding? Thanks, Rick
oneleft Posted April 25, 2002 Author Posted April 25, 2002 I put <input type="hidden" name="employee_id" value="[FMP-Field: employee_id]"> on the Main page, changed the Found page to -find from -view. It always displays the same name even though it displays the correct id. I think I'm just going to shoot myself and get this over with!
Garry Claridge Posted April 25, 2002 Posted April 25, 2002 Rick, You will need to 're-find' the record if you move from one file to the other. Hence, going from the found file to the main file you will need to use find agin to use the data. You may want to use the found file as your main file. This will avoid any double-handling. You would use the '-find' something like this, if going from the found file to the main file: <input type="hidden" name="employee_id" value="[FMP-Field: employee_id]"> <input type="submit" name="-find" value="Show Main Page"> Garry
oneleft Posted April 25, 2002 Author Posted April 25, 2002 Ok, I thought that was what the -token was doing, passing that recid to the main file from the found file. The token does show the correct recid in Main when I find different people, it just doesn't show the correct name in Main. Geesh, am I just thick or missing something or what? I've coded in Fortran, Cobol, C++ so I gotta think I'm missing the picture here! Or just getting old. Sigh. You wouldn't want to earn that $100 and let me give you a ring would ya? I'm getting desparate here...
Garry Claridge Posted April 25, 2002 Posted April 25, 2002 Rick, The token is used to the pass the RecID along so that it can be used with the '-edit' tag once the employee has finished the course. The '-edit' will record the completion of that course. You can certainly call, or I can call you. (phone +61 418 366 590) All the best. Garry
evildan Posted April 26, 2002 Posted April 26, 2002 Another alternative, which might create some rebuild, is to use cookies. Simply create a cookie for each of the sections (or pages) upon completion. Having the user login could be the trigger to test for an existing cookie then depending on the test result direct the user to the begining or to the page they left off with automatically. I realize this might be adding more fuel to the fire, but I thought I'd mention it as an alternative. I find the use of cookies great, that way you're not always having to worry about is the token having the correct value, or if the token passed, etc. Here's an overview of what I'm talking about. Login --> Check database user profile --> Database returns record --> Place a cookie for each of the courses completed (see code below), one for the record ID and one for user profile ID# (or unique number of some kind) --> Use cookie values throughout the rest of the site. Setting the Cookies: [fmp-setcookie: courseA=field: courseADone, expires=43200] [fmp-setcookie: courseB=field: courseBDone, expires=43200] [fmp-setcookie: courseC=field: courseCDone, expires=43200] [fmp-setcookie: profileRecID=currentrecid, expires=43200] [fmp-setcookie: profileID=field: profileID, expires=43200] This way your users finish a course all of the information you have is already stored on their computer. Now you can do tests to see if they have compleated a course on any CDML page. Your Progress: [fmp-if: cookie: courseA .eq. "YES"] Course A (Done)[fmp-else]Course A (Not Done) [/fmp-if] [fmp-if: cookie: courseB .eq. "YES"] Course B (Done)[fmp-else]Course B (Not Done) [/fmp-if] [fmp-if: cookie: courseC .eq. "YES"] Course C (Done)[fmp-else]Course C (Not Done) [/fmp-if] You can simply edit anyone's record with one generic line of code at the end of each course. &courseADone=YES&-edit]http://domain.com/fmpro?-db=Students.fp5&-lay=cgi&-format=CourseB.html&-recid=[fmp-cookie:profileRecID]&courseADone=YES&-edit This is assuming that you have a liniar navigation... meaning you have to get to page 4 by going through 1, 2 and 3 first. And be sure to re-set the cookies at the begining of the course to update their progress. The use of the cookies will ONLY act as a variable keeper throughout the process. If a user switches browsers, they will have to login again, which will then place a new batch of cookies on their computer. The database still needs to be updated at the end of every course. Use cookies responsibly, be sure to remove them at the end of a session, if possible. This is just an idea, it seems to be a bit more simplified then what I was reading, but I am by no means saying it's better, it's just a different idea that I thought might make us look at the problem in a different way.
Recommended Posts
This topic is 8275 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now