View · Search · Index

Weblog

Showing 631 - 640 of 698 Postings (summary)

Testing with TCLWebtest

Created by OpenACS community, last modified by Ryan Gallimore 10 Apr 2010, at 06:49 PM

Testing with TCLWebtest

by Simon Carstensen and Joel Aufrecht

Tclwebtest is primarily for testing user interface and acceptance testing.

API testing is only part of testing your package - it doesn't test the code in our adp/tcl pairs. For this, we can use TCLWebtest (see sourceforge). TCLWebtest provides a library of functions (see command reference) that make it easy to call a page through HTTP, examine the results, and drive forms. TCLwebtest's functions overlap slightly with acs-automated-testing; see the example provided for one approach on integrating them.

TCLWebtest must be installed for to work. Since automated testing uses it, it should be part of every OpenACS installation. Note that TCLwebtest is installed automatically by Malte's install script.

Forum Posts:

Command Reference:

  • http://tclwebtest.sourceforge.net/doc/api_public.html 

Articles:

  • Automated Testing Best Practices see: https://openacs.org/doc/automated-testing-best-practices.html
  • testing packages for release en:Package_Testing_Process_

Tools:

  • Webtest-Recorder Firefox extension (TwtR) see http://www.km.co.at/km/twtr This module is a plugin for Firefox. It is used to generate/edit a tclwebtest script which can be used later for regression testing without the need of a browser. There is a certain overlap of the application range between selenium and TwtR. This plugin was developed by Åsmund Realfsen for regression/load testing of the assessment module.

Here are some guidelines on how to write automated tests with TCLWebtest. It is a joy to work with automated testing once you get the hang of it. We will use the "myfirstpackage" as an example.

Create the directory that will contain the test script and edit the script file. The directory location and file name are standards which are recognized by the automated testing package:

[$OPENACS_SERVICE_NAME www]$ mkdir /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/myfirstpackage/tcl/test
[$OPENACS_SERVICE_NAME www]$ cd /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/myfirstpackage/tcl/test

[$OPENACS_SERVICE_NAME test]$ emacs myfirstpackages-procs.tcl

Write the tests. This is obviously the big step :) The script should first call ad_library like any normal -procs.tcl file:

ad_library {
    ...
}

To create a test case you call aa_register_case test_case_name.. Once you've created the test case you start writing the needed logic. We'll use the tutorial package, "myfirstpackage," as an example. Let's say you just wrote an API for adding and deleting notes in the notes packages and wanted to test that. You'd probably want to write a test that first creates a note, then verifies that it was inserted, then perhaps deletes it again, and finally verifies that it is gone.

Naturally this means you'll be adding a lot of bogus data to the database, which you're not really interested in having there. To avoid this I usually do two things. I always put all my test code inside a call to aa_run_with_teardown which basically means that all the inserts, deletes, and updates will be rolled back once the test has been executed. A very useful feature. Instead of inserting bogus data like: set name "Simon", I tend to generate a random script in order avoid inserting a value that's already in the database:

set name [ad_generate_random_string]

Here's how the test case looks so far:

aa_register_case mfp_basic_test {
    My test
} {
    aa_run_with_teardown \
       -rollback \
       -test_code  {

       }
}

Now look at the actual test code. That's the code that goes inside -test_code {}. We want to implement test case API-001, "Given an object id from API-001, invoke mfp::note::get. Proc should return the specific word in the title."

      set name [ad_generate_random_string]
      set new_id [mfp::note::add -title $name]
      aa_true "Note add succeeded" [exists_and_not_null new_id]

To test our simple case, we must load the test file into the system (just as with the /tcl file in the basic tutorial, since the file didn't exist when the system started, the system doesn't know about it.) To make this file take effect, go to the APM and choose "Reload changed" for "MyFirstPackage". Since we'll be changing it frequently, select "watch this file" on the next page. This will cause the system to check this file every time any page is requested, which is bad for production systems but convenient for developing. We can also add some aa_register_case flags to make it easier to run the test. The -procs flag, which indicates which procs are tested by this test case, makes it easier to find procs in your package that aren't tested at all. The -cats flag, setting categories, makes it easier to control which tests to run. The smoke test setting means that this is a basic test case that can and should be run any time you are doing any test. (a definition of "smoke test")

Once the file is loaded, go to ACS Automated Testing and click on myfirstpackage. You should see your test case. Run it and examine the results.

Example

Now we can add the rest of the API tests, including a test with deliberately bad data. The complete test looks like:

ad_library {
    Test cases for my first package.
}

aa_register_case \
    -cats {smoke api} \
    -procs {mfp::note::add mfp::note::get mfp::note::delete} \
    mfp_basic_test \
    {
        A simple test that adds, retrieves, and deletes a record.
    } {
        aa_run_with_teardown \
            -rollback \
            -test_code  {
                set name [ad_generate_random_string]
                set new_id [mfp::note::add -title $name]
                aa_true "Note add succeeded" [exists_and_not_null new_id]
                
                mfp::note::get -item_id $new_id -array note_array
                aa_true "Note contains correct title" [string equal $note_array(title) $name]
                
                mfp::note::delete -item_id $new_id
                
                set get_again [catch {mfp::note::get -item_id $new_id -array note_array}]
                aa_false "After deleting a note, retrieving it fails" [expr $get_again == 0]
            }
    }

aa_register_case \
    -cats {api} \
    -procs {mfp::note::add mfp::note::get mfp::note::delete} \
    mfp_bad_data_test \
    {
        A simple test that adds, retrieves, and deletes a record, using some tricky data.
    } {
        aa_run_with_teardown \
            -rollback \
            -test_code  {
                set name {-Bad [BAD] \077 { $Bad}} 
                append name [ad_generate_random_string]
                set new_id [mfp::note::add -title $name]
                aa_true "Note add succeeded" [exists_and_not_null new_id]
                
                mfp::note::get -item_id $new_id -array note_array
                aa_true "Note contains correct title" [string equal $note_array(title) $name]
                aa_log "Title is $name"
                mfp::note::delete -item_id $new_id
                
                set get_again [catch {mfp::note::get -item_id $new_id -array note_array}]
                aa_false "After deleting a note, retrieving it fails" [expr $get_again == 0]
            }
    }


aa_register_case \
    -cats {web smoke} \
    -libraries tclwebtest \
    mfp_web_basic_test \
    {
        A simple tclwebtest test case for the tutorial demo package.
        
        @author Peter Marklund
    } {
        # we need to get a user_id here so that it's available throughout
        # this proc
        set user_id [db_nextval acs_object_id_seq]

        set note_title [ad_generate_random_string]

        # NOTE: Never use the aa_run_with_teardown with the rollback switch
        # when running Tclwebtest tests since this will put the test code in
        # a transaction and changes won't be visible across HTTP requests.
        
        aa_run_with_teardown -test_code {
            
            #-------------------------------------------------------------
            # Login
            #-------------------------------------------------------------
            
            # Make a site-wide admin user for this test
            # We use an admin to avoid permission issues
            array set user_info [twt::user::create -admin -user_id $user_id]
            
            # Login the user
            twt::user::login $user_info(email) $user_info(password)
            
            #-------------------------------------------------------------
            # New Note
            #-------------------------------------------------------------
            
            # Request note-edit page
            set package_uri [apm_package_url_from_key myfirstpackage]
            set edit_uri "${package_uri}note-edit"
            aa_log "[twt::server_url]$edit_uri"
            twt::do_request "[twt::server_url]$edit_uri"
            
            # Submit a new note

            tclwebtest::form find ~n note
            tclwebtest::field find ~n title
            tclwebtest::field fill $note_title
            tclwebtest::form submit
            
            #-------------------------------------------------------------
            # Retrieve note
            #-------------------------------------------------------------
            
            # Request index page and verify that note is in listing
            tclwebtest::do_request $package_uri                 
            aa_true "New note with title \"$note_title\" is found in index page" \
                [string match "*${note_title}*" [tclwebtest::response body]]
            
            #-------------------------------------------------------------
            # Delete Note
            #-------------------------------------------------------------
            # Delete all notes

            # Three options to delete the note
            # 1) go directly to the database to get the id
            # 2) require an API function that takes name and returns ID
            # 3) screen-scrape for the ID
            # all options are problematic.  We'll do #1 in this example:

            set note_id [db_string get_note_id_from_name " 
                select item_id 
                  from cr_items 
                 where name = :note_title  
                   and content_type = 'mfp_note'
            " -default 0]

            aa_log "Deleting note with id $note_id"

            set delete_uri "${package_uri}note-delete?item_id=${note_id}"
            twt::do_request $delete_uri
            
            # Request index page and verify that note is in listing
            tclwebtest::do_request $package_uri                 
            aa_true "Note with title \"$note_title\" is not found in index page after deletion." \
                ![string match "*${note_title}*" [tclwebtest::response body]]
            
        } -teardown_code {
            
            twt::user::delete -user_id $user_id
        }
    }


.LRN Meetings

Created by Alvaro Rodriguez, last modified by Alvaro Rodriguez 10 Mar 2010, at 04:41 AM

Next Meeting: 2010-03-10 18:00 CET/CEST Convert to your local time

Agenda

  • .LRN 2.6 Release

Previous Meetings


2008

Community Metrics in OpenACS

Created by Michael Steigman, last modified by Michael Steigman 09 Dec 2009, at 06:09 PM

What can we provide now?


* WIKI

new pages this week
average: new pages per month
page edits this week
average: page edits per month
average: editors per page

* FORUMS

new threads this week
posts this week
average: new threads per month
average: posts per month
average: forum notification subscriptions per month
ratio: posts per thread (monthly?)

example queries:

hub=# select to_char(r.publish_date, 'YYYY-MM') as month, count(*) from cr_items i join cr_revisions r on (i.item_id = r.item_id) where parent_id = '2239905' group by month order by month desc;
  month  | count
---------+-------
 2009-10 |   123
 2009-09 |   394
 2009-08 |   410
 2009-07 |   671
 2009-06 |   158
 2009-05 |     4
 2009-03 |     8
 2009-01 |     4
 2008-12 |    56
(9 rows)

hub=# select to_char(o.creation_date, 'YYYY-MM') as month, count(*) from cr_items i join acs_objects o on (i.item_id = o.object_id) where parent_id = '2239905' group by month order by month desc;
  month  | count
---------+-------
 2009-10 |     2
 2009-09 |    31
 2009-08 |    38
 2009-07 |    71
 2009-06 |    39
 2009-05 |     2
 2009-03 |     4
 2009-01 |     1
 2008-12 |    12
(9 rows)

hub=# select max(count) from (select count(distinct creation_user) as count from cr_items i join cr_revisions r on (i.item_id = r.item_id) join acs_object\
s o on (o.context_id = r.item_id) where parent_id = '2239905' group by i.item_id) a;
 max
-----
   7
(1 row)

hub=# select avg(count) from (select count(distinct creation_user) as count from cr_items i join cr_revisions r on (i.item_id = r.item_id) join acs_object\
s o on (o.context_id = r.item_id) where parent_id = '2239905' group by i.item_id) a;
        avg
--------------------
 1.4900000000000000
(1 row)

hub=# select count(distinct creation_user), i.item_id from cr_items i join cr_revisions r on (i.item_id = r.item_id) join acs_objects o on (o.context_id =\
 r.item_id) where parent_id = '2239905' group by i.item_id;
 count | item_id
-------+---------
     2 | 2239907
     1 | 2240099
     1 | 2240101
     2 | 2240276
     1 | 2240751
     1 | 2240763
     1 | 2240769
     7 | 2240772
     1 | 2248445
     1 | 2249069
     1 | 2249119
     1 | 2249149
...
     2 | 2714595
     1 | 2716420
     1 | 2721530
     1 | 2722191
     2 | 2724344
     1 | 2731842
     1 | 2752093
(200 rows)

What could we provide in the future?


average: # new/departed group members per day/month/year
average: visit length of group members
2 day answer rate for new threads
average: uploads/downloads per month
average: first answer time for threads
ratio: page view per post (lurk)
etc.

Site Wide File Upload

Created by Dave Bauer, last modified by Dave Bauer 02 Nov 2009, at 09:00 PM

Spec for File Management Overhaul on Hub

Michael Steigman (09/25/09) Updated 11/2/2009

User interface mockups

Big Picture

File management in OpenACS is a complicated affair at the moment. There are
several ways to upload and link to files and this has led to duplicate files, broken links
throughout content blocks and “embedded” files in rich text that are difficult to manage
(among many other issues). We are aiming to unify the file upload, linking and
management model and UI across the site, in order to make it simple to upload, update,
share, reference and delete files.

Organization of Files

To help users in a community or on a site collaborate, weʼd like to allow them to
organize and view files in ways that are intuitive. Taking from OS X, Google, Zoho, Windows et.
al., we envision a series of organizational areas in the files UI corresponding to different
filtering criteria.
Places - within a community, default “places” will include all applications and any other
subfolders the admin wishes to include. All users will see these places.
Views - the views area will include some basic views which should cover a lot of
scenarios (search for in OS Xʼs finder) and will expand with custom views created and
saved on the advanced tab.
Favorites (or bookmarks?) - this organizational area will display folders and files in the
personal file area which the user has marked as interesting anywhere on the site.
Shared - implied by the title, this area shows up in the personal file space and shows
files shared by and to you.

Upload and Linking Mechanisms

We want to allow users to link to/attach/upload files to any type of content and present a
consistent UI when doing this. The easiest way to do this would be to provide the same
interface users normally browse by, as OS X does. The WYSIWYG editor will have to
replicate this environment in a plugin setting. Apps that donʼt use the richtext widget
should be able to “include” a version of the browsing interface that allows for single (and
multiple?) file selection.
Much like hard links in Unix, we envision multiple links to each files. The links should be
viewable at the fileʼs canonical location (visible in the mockups). When no more links to
a file exist, the file can be deleted (think callbacks on link removal). Storing a checksum
for the file upon upload so that we can determine if it already exists within the
community would be beneficial.

Metadata Requirements

We need to be able to map from link to destination file. Within this link, we need to
capture some information - the object weʼre linking from being the primary bit of
information. If this link were to be an instance of a dedicated object type, it could also be
permissioned (i.e., a proxy). It could also point to a particular revision, which would
enable a learning module to point at a stable revision and prevent teaching material
from moving beneath a module author. These do not need to be part of the initial
implementation but should be considered.

Navigation and Page Requirements

We should provide an generic overview page (detailed in the mockups) that describes
the files attached to a piece of content. We need to be able to generate navigation for
content such as wiki pages or forum posts that include a link to the overview page if files
are attached. We also need a single, permanent page to display information about a file (File View in the
mockups).

Shared Folders

Referece Google Docs Shared Folders Feature http://docs.google.com/support/bin/answer.py?hl=en&answer=158074
Reference Zoho Document Management http://www.zoho.com/online-document-management/share-documents-collaborate.html

Use Cases

Upload File From Subsite/Group Files tab

User clicks "Add File" link or button from "Subsite->Files" page.
User sees upload dialog and chooses a file from their computer to upload.
File is added to subsite default folder.
Creation_user is the uploading user.
Parent_id is the default folder for the subsite.
Permissions are inherited from context_id,  all members of subsite can view this file.
Context_id is the default folder for the subsite.

Upload file as attachment to Forums Message (or wiki page, etc.)

(note forums post workflow is not addressed)
User chooses to attach a file to a forum message.
User sees upload dialog and chooses a file from their computer to upload.
File is added to subsite default folder.
Creation_user is the uploading user.
Parent_id is the related object, ie: forum_message
Permissions are inherited from context_id, all members who can see the forum post can see the attached file.
Context_id is the parent_id.

Attach existing file from subsite folder as attachment to Forums Message (or wiki page, etc.)

User chooses to attach a file to a forum message.
User sees file chooser dialog (embedded filter view of subsite files).
User chooses existing file.
Acs_data_link created between forums_message and the uploaded file.

Upload file to personal folder

User browsers to their "workspace" (blah) and chooses Files.
This shows the My Files view.
User chooses Add File.
File is added to user default folder (child of user object).
Parent_id is the user default folder.
Context_id is the parent_id.
Permissions are inherited from the context_id.
Noone else can see or manage these files except the user.

Attach Existing file from personal folder to a forums message etc.

User chooses to attach file to a forums message.
User sees file chooser dialog (embedded filter view of subsite files).
Somehow the user chooses to list My Files and sees a list of all files this user has created.
Use chooses file from personal folder.
User sees message that they will share this file with the group/subsite/community with a checkbox to acknowlege.
A cr_symlink is created (this is the manifestation of "share" in this case.) in the subsite default folder.
Acs_data_link created between symlink and the forums message.
Permissions, parent_id, context_id of original file do not change!
Parent_id of symlink is default folder.
Context_id of symlink is parent_id.
Permissions are inherited from context_id, all members of the subsite can view the symlink (which resolves to the file) as long as it is being shared (the symlink exists.)


View subsite files

User sees a list of files in the subsite folder or any subfolders, that they have permission to see (by default all of them.)
Shows filename/title, description, updated date/time, tags, creation user???
User sees list of Places (packages in the subsite.) Each place filters files that have acs_data_link to objects owned by that package.
User can search filenames(titles/descriptions/tags) using the Search Within feature. Just like google docs. Does not search file contents??
Clicking on a file name opens it but there should be an obvious place to view file information (permissions, revisions, links)
Clicking on a folder shows files/folders in that folder.
User can sort by name or date (asc/desc options, perhaps arrow next to name/date sort option?)
What do we do with pagination? How does search/sort affect pagination?

Experimental!! Sharing a Folder

User creates a folder or chooses an existing folder to share.
Symlink is created in group or target users folders to the shared folder depending on sharing level.
Permissions are granted on the ORIGINAL folder based on the sharing settings. NOTE: how do we do this without screwing something up? That is the sharers are not allowed to DELETE or ADMIN the original folder. But we want to simplify dealing with the items IN that folder.

Educational Wiki (Eduwiki) Tool

Created by Hector Amado, last modified by Hector Amado 07 Oct 2009, at 11:34 PM

Educational Wiki  (Eduwiki)

Description


The Educational Wiki (Eduwiki) Package is a Wiki tool based on xowiki, Eduwiki aims to be a simple tool for Wiki pages creation in the educational context.
This package lets the teacher to easily define Eduwiki Activities,  there are three Eduwiki Types activities:  Teacher Wiki,  Group Wiki and Student Wiki.
Teacher Wiki activity is a single Wiki Activity managed by the Teacher,  Teacher may set permissions to the students to read and write Wiki pages.
Group Wiki activity creates a Wiki per Group, Teacher may set permissions to read and write Wiki pages by other groups members.
Student Wiki type creates individual Wiki pages per student,  each student can edit an create Wiki pages, teacher may set permissions to the rest of students to view and edit student Wiki pages.


How to Install


Eduwiki package works on: Postgresql 8.2.x+

Requires:
dotlrn 2.4.1
xowiki 0.116
xotcl-core 0.106
ajaxhelper 0.87d


Installation process:


1. Get the following packages from HEAD:  eduwiki,  eduwiki-portlet,  dotlrn-eduwiki
2. Save packages to packages dir in your .LRN installation
3. Browse to Package Manager to install new packages (eduwiki,  eduwiki-portlet,  dotlrn-eduwiki)
4. Restart the server
5. Activate the applet in a course


Release Notes


Name: Educational Wiki (eduwiki)
Version:  0.1d3 (July 2009)
Developed by:  Hector Amado (Galileo University)
Designed by: Rocael Hernández, Byron Linares (Galileo University)
Requirements by: Daniel Contreras, Rocael Hernández (Galileo University)

Provides a simple interface to create Wiki Activities,  Teacher may set permissions to read, write and create Wiki Pages.
Provides a simple interface to create Wiki Pages (a no-brainer 1 click), and easily include and manipulate web assets such as flash, videos, images, etc.

The package is an OO extension of xowiki,  leaves xowiki package unmodified, is based in XOWiki, since it is a very well maintained tool,  and have many of the desired features such as: easy content tool (plus the advantage that a wiki tools is becoming more and more common), directories, versioning, basic template management, variables, multi-language support.
It provides portlets for .LRN


Technical specs


The Educational Wiki (eduwiki) Package is an OO extension of xowiki.  It's based on Policy ::xowiki::policy3, to set permissions per pages.

A new proc was created to manage Eduwiki Activities, eduwiki::set_eduwiki_permissions,  this proc set permissions to new pages based
on the activity definition.


To-Do


Start and end date editing functionality
Integration with evaluation package

Consortium activities organization (DRAFT)

Created by Rocael Hernández Rizzardini, last modified by Rocael Hernández Rizzardini 22 Sep 2009, at 05:40 PM

DOCUMENT STATUS: A draft that HAS NOT YET been endorsed by the OpenACS OCT, the .LRN Board, or the .LRN Leadership Team (Honchos)


These areas and list of activities has been summarized of a discussion over the lists. The aim is to have a more integrated set of activities created and provided by the different working groups (board, leadership team, oct).

Consortium investment in .LRN:

  • Create a budget for the next 12 months / year, has to include also all administrative costs. (Alvaro can prepare a preliminary budget).
  • Figure out the priorities for technical development (QA, new releases, etc.), documentation & tutorials, marketing.

Some areas to invest in that have been already formulated:

  1. Bug-fixes: #3 & #4: prioritize technical tasks is OCT and leadership authority
  2. QA testing for releases
  3. Release Management
  4. See original proposed set of jobs: https://docs.google.com/Doc?docid=0AUeGYMa72ygGZGhjbnc0bm1fN2R3czdxeGZ0&hl=en

Documentation:

  1. Tutorials for basic areas of openacs technical development.
  2. Update on installation process for official documentation (already on creation process, a plan about how to address it will be posted soon, so approval is give to proceed with it)


Marketing:

  1. Training on .LRN usage.
  2. Users help section
  3. A demo-course of .LRN (already on creation process)
  4. All these actions (and probably new ones) towards getting more users.


The Consortium investment process:

  1. The priorities has to be agreed at the Leadership Team / OCT. Any formulated item will require a description clear enough to be able to justify a given investment.
  2. Figure out which investment channels we can have:
    • There is the initial Jobs small - incentives.
    • Some other people argue for better rates, that can lead us to monthly contract: directly contract monthly time in a yearly basis for some developers (at lets say open source rates, not as small as in the jobs): for instance one or two experienced community recognized developers, and one newbie (which is not expensive) that will do the bee-work.
    • Other possible paths? such as posting for a job and people make an offer and from there negotiate a give amount. Different people might require different amounts.
    • We might contract either an individual or an organization (Institution or a company)
  3. Assign a given priority / task to the interested developer / party.
  4. OCT / Leadership Team review and approved the work finished
  5. Consortium pays.


Oracle support:

At this point we cannot guarantee oracle support for .LRN.
There are specific donations to Oracle, such from UCLA.
Additionally, UNED & Bergen use oracle and has given their donation, so a part of that funds should go to Oracle support.
Also, since UNED has an active group of developers supporting their installation, we should ask them to test Oracle as well.


Increase community participation:

  • Consortium will request active and committed technical developer participation in the Leadership Team to the institutions that might have technical developers. (nominate an active developer for open-source with lets say 10-20 hours a week). Additionally, to be able to contribute better the best scenario will be to have this institutions to have their .LRN installations up-to-date, and have mechanisms that allow them to separate their code from what the official distribution is, that as well will let them influence more directly into the official distribution.
  • Improve communication from OCT & Leadership Team:
    • post the meeting minutes in time (the day after at the latest)
    • get the IRC logger back and have a usable page to access logs
    • move technical discussion to forums
    • Improve communication with the board.
    • Others?


Community growth:

  • Create means to get new developers:  any ideas?
    • Emma: That won't happen alone. The main issue is "getting new users" and
      it's a marketing matter.



dotlrn.org:

  • git will be replaced with cvs checkout from the cvs.openacs.org
  • update content
  • The technical management is assigned to the Leadership Team.
    • Leadership team can assume the technical management BUT ONLY ONCE the
      site is a CVS checkout from the openacs.org tree



The new tutorial:

  • Has to have a place, where it links and download it.
  • It can be included on the distribution file and in the documentation.
  • With which tool we'll produce future tutorials and based on which templates still need to be settled. Maybe a comparison chart will help to make the decision.
  • A tutorial has not the same format and purpose of a traditional documentation (format as how is structured, organized and designed, and not to which is the document type).
  • Has to reflect any engineering standard that it might come across within its examples. While understanding that the tutorial is not to explain the engineering standards. The engineering standards has to be clearly defined with examples if necessary in the engineering standards section of the standard documentation (including the accessibility ones). The better explained, the easier to follow them!
  • It can be exported to different formats but its mandatory format is html.
  • As for documentation: we see in the repository no major changes in the documentation itself over the last years, so probably we need good review and really involve people to update on it, since none of the members of the groups seems to be doing maintenance over them.







Time/Topics Planner for dotLRN Courses

Created by Alvaro Rodriguez, last modified by Alvaro Rodriguez 01 Sep 2009, at 04:12 PM

Introduction

.LRN Blocks View is an additional View to .LRN Communities or Classes.

The Blocks View works by integrating all kinds of activities or resources of a community to a simple interface where everything is treated by the object id no matter what the object type is, and creating a new behavior to the activities according to the object type.

The new interface becomes the Community Home and is organized by blocks, there are currently 2 formats for the blocks:
  • Weekly Format
    • Each block represents a week, the weeks start to count the day the community starts, this value is set in the Course Settings of the Blocks View.
    • The current weeks is highlighted.
  • Topics Format
    • Each block represents a topic, all the activities and resources in this block are related to the topic, in this format the start date of the community is not relevant.
    • This format lets the teacher selects the current topic and highlights that topic automatically until it is deselected or another topic is selected, only one topic can be selected at a time.

This option is available for all communities inside the dotlrn-admin-portlet, there's a link to enable/disable this view, when the view is enabled a default empty block is created inside the community (this initial block it is always shown on top with no format) and it automatically mounts the packages needed (evaluation, assessment, forums, content, xowiki, chat) on the community.

Course Settings


In the Course Settings of the Blocks View we can set:
  • the number of blocks, if the number of blocks selected is greater than the current blocks, the extra blocks needed are created, if the number of blocks selected is lower than the current blocks the rest of the blocks are simply not displayed but never deleted.
  • the start date, this is used to set the start day for the weekly format.
  • the format, weekly or topics.

Blocks Basics


To add objects to a block there is a section inside each block where we can select the type of activity/resource we want to add and it lead us to the specific interface of that object type to create a new object or we can go to choose an existing activity from an interface showing all the available activities.

Each block has the following options:
  • Add a summary, this is a small text that we can add to be shown on top of the block to describe the block's content.
  • Show/Hide, we can choose which blocks we want to make available for students.
  • Move, the blocks can be ordered by using a drag n drop option to move them or doing a manual move by moving the block one position at a time.

Blocks Objects Basics


Each object inside a block has the following options:
  • Show/Hide, we can choose which object we want to make available for students.
  • Move, the objects can be ordered inside the same block or moved to a different block by using the drag n drop option.
  • Indent, the objects can be indent right or left, this is just for visual purposes and it has no side effect on the behavior of the objects.
  • Edit, this link lead us to the specific edit interface depending on the object type.
  • Delete, this link deletes the reference of the object with the block and if the object is not referenced by another block it deletes the object as well.

Technical Specs


The relations between all the packages integrated with blocks are handled by using callbacks, this callbacks are declared in the blocks context and the implemented in each package context.

The callbacks used are:
Specific callbacks: These callbacks need to be implemented for each package  because it must return the url for different actions on an specific object type.
  1. search::url
  2. planner::edit_url
  3. planner::delete_url
Standard callbacks: These callbacks are implemented once because there's no difference in the code needed for all packages.*
  1. planner::extend_form
  2. planner::insert_object

* The only package with a different implementation for the standard callbacks is the file-storage, the objects of the file-storage cannot be treated only with the object_id because there are different types of objects (url, file or folder) and to be able to choose a file we might need to navigate inside some folders, so in this case the value for the block id is passed in the cookies and the cookies are validated by the parameter return_url.

A New Package


A new package was created based on xowiki called "pages" to accomplish the integration of xowiki with the blocks view, xowiki is not a usual package so it was not possible to add the callbacks in the same way as the rest of the packages, a lot of procs needed to be changed and to avoid adding too much code to xowiki we created an independent package.  This package requires xowiki as it uses all the xowiki classes and procs.

This package works just like xowiki but using a different policy to let the users only work with ::xowiki::Page and ::xowiki::PlainPage, adding new pages can be handled only from the blocks interface because it needs a block to associate the page with. The package has a callback "after-mount" to set the permissions to not inherit from parent and only swa can admin that package.

Navigation Bar


The blocks view provides a navigation bar in the master section (only inside of the community), this bar show all the objects inside the blocks on that community and you can go to any object on any block. If you're inside an object page, the navigation focuses on that object (this is done by sending a parameter to the master with the object_id) and enables the navigation to the next and previous object (if possible).

Scalability


This .LRN Planner went through scalability tests because it has it's own data model which links objects from all the other resources tables, if this is used as every single course home organizer it could become slow know that needs to get specific information from different tables for every object. 

The solution for this matter was to group all the activities of a course for a specific type, get the information by groups and leave it in aolserver's cache, this involves a lot of extra code to keep the cache up-to-date, this is completely handled to make the planner a powerful solution for every course in .LRN.

Project Documentation

This paper was presented in the 7th OpenACS/.LRN Conference, you can check out the conference paper.

How to Install

Works on:
Postgresql 8.2.x +
Oracle 9i +

Requires:
dotlrn 2.4.1
xowiki 0.106.1
xotcl-core 0.100
ajaxhelper 0.87d

Installation process:

  1. Get the following packages from branch oacs-5-4: dotlrn-all, xowiki, xotcl-core
  2. Get the following packages from HEAD: planner, pages, ajaxhelper
  3. Move to the planner-patch folder in the planner package folder and run the script.sh, this will patch all the files from other packages to integrate them with the planner new features
    1. To run the script:
      • /$path_to_planner_patch/$  sh script.sh
  4. Install dotlrn, then install xowiki, xotcl-core, planner, pages and ajaxhelper
  5. Restart the server
  6. Activate the Planner View in a course admin portlet

Release Notes

Name: .LRN Planner
Version: 1.0b (July 2009)
Developed by: Alvaro Rodriguez (Viaro Networks)

  • Full integration with dotlrn resources: evaluation, assessment, forums, file-storage, HTML and Text Pages (using the Pages package)
  • Use of aolserver cache to assure scalability
  • Weeks and topics formats available
  • Provides a completely independent course home
This is how the Planner View looks.

Technical Specs

The planner works by linking activities by calling the callbacks that have been added to other packages in the add forms to be able to link the resources from those packages to the planner blocks. The callbacks extend the form of a new object to receive the page_id to be linked to and inserts the objects to the page once it has been created in the submit section of the form.

Each callback is defined and implemented in the planner-procs, in the following way:
ad_proc -public -callback "callback_name" -impl planner
if a package needs a different implementation of a callback it should be done in the package callbacks procs in the following way:
ad_proc -public -callback "callback_name" -impl $package_key
This callbacks are used inside the page that has the form for creating/editing new in the following way:
callback -catch -impl planner "callback_name" -params...

To add a new package to the activities available in the planner, the callbacks should be added to the file(s) where the objects are created, i.e. forum-new, task-add-edit, etc.
  1. A new parameter called block_id needs to be added to the ad_page_contract
  2. The following callback should be added in a place where the form can be extended
    • callback -catch -impl planner planner::extend_form -name $form_name -block_id $block_id
  3. The following callback should be added in the submit section of the form after the object has been created
    • callback -catch -impl planner planner::insert_object -name $object_name -block_id $block_id -object_id $object_id
  4. The activity should be added to the index, select-activity and get-activities pages in the planner package, check out the existing activities sections to figure out the right way to include 
  5. Depending on the activity, other lines of code need to be added to keep the consistency with the use of aolserver's cache, to keep it up-to-date with objects add/edit/delete actions.

The script added to the package to patch the rest of the packages was generated with diff between the packages from clean oacs-5-4 and modified oacs-5-4:
diff -crNB ~/oacs-5-4/packages/$package_name ~/custom-oacs-5-4/packages/$package_name

This work was done in collaboration with Innova - UNED.

News Item

Created by , last modified by Victor Guerra 11 Mar 2009, at 03:44 PM

@image_url@ @_text@
@detail_link@

Workshop Announcement

Created by Gustaf Neumann, last modified by Victor Guerra 11 Mar 2009, at 03:44 PM

@event@

Abstract: @_text@
@detail_link@

Talk Announcement

Created by Gustaf Neumann, last modified by Victor Guerra 11 Mar 2009, at 03:44 PM

@event@

Abstract: @_text@
@detail_link@

Next Page
previous December 2026
Sun Mon Tue Wed Thu Fri Sat
29 30 1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31 1 2

Popular tags

17 , 5.10 , 5.10.0 , 5.10.1 , 5.9.0 , 5.9.1 , ad_form , ADP , ajax , aolserver , asynchronous , Azure , bgdelivery , bootstrap , bugtracker , CentOS , COMET , compatibility , conference , CSP , CSRF , cvs , debian , docker , docker-compose , emacs , engineering-standards , exec , fedora , FreeBSD
No registered users in community xowiki
in last 30 minutes
Contributors

OpenACS.org