xowf::test_item::grading::load_grading_schemes (public)

 xowf::test_item::grading::load_grading_schemes -package_id package_id \
    -parent_id parent_id

Defined in packages/xowf/tcl/grading-procs.tcl

Load the actual grading scheme objects defined for the package_id and parent_id. It might be the case that this function is called multiple times by a single request (when e.g. multiple exams are on a single page). So we are caching the result to avoid repeated computations of the same result.

Switches:
-package_id
(required)
-parent_id
(required)

Partial Call Graph (max 5 caller/called nodes):
%3 Class ::xowf::test_item::Answer_manager Class ::xowf::test_item::Answer_manager (public) xowf::test_item::grading::load_grading_schemes xowf::test_item::grading::load_grading_schemes Class ::xowf::test_item::Answer_manager->xowf::test_item::grading::load_grading_schemes xowf::test_item::Answer_manager instproc grading_scheme xowf::test_item::Answer_manager instproc grading_scheme (public) xowf::test_item::Answer_manager instproc grading_scheme->xowf::test_item::grading::load_grading_schemes xowf::test_item::grading::grading_scheme_wf_item_id xowf::test_item::grading::grading_scheme_wf_item_id (private) xowf::test_item::grading::load_grading_schemes->xowf::test_item::grading::grading_scheme_wf_item_id

Testcases:
No testcase defined.
Source code:
    set t0 [clock clicks -microseconds]
    #
    # Load the actual grading scheme objects
    #
    set grading_info [acs::misc_cache eval xowf-grading-schemes($package_id,$parent_id) {
      #
      # First get the item_id of the edit-grading-scheme.wf
      #
      set form_item_id [grading_scheme_wf_item_id  -parent_id $parent_id  -package_id $package_id]
      #
      # Get its instances. When creating the instances, the grading
      # objects are as well created.
      #
      ::xowiki::FormPage get_form_entries  -base_item_ids $form_item_id  -form_fields {}  -publish_status ready|production  -parent_id $parent_id  -package_id $package_id  -initialize true

      set grading_info ""
      foreach gso [::xowf::test_item::grading::Grading info instances -closure] {
        dict set grading_info $gso [$gso serialize]
      }
      set grading_info
    }]

    #
    # Recreate the grading scheme objects that do not exist in the
    # current thread.
    #
    foreach gso [dict keys $grading_info] {
      if {![nsf::is object $gso]} {
        eval [dict get $grading_info $gso]
        $gso destroy_on_cleanup
      }
    }
    set t1 [clock clicks -microseconds]
    ns_log notice "??? load_grading_schemes part2 [expr {($t1-$t0)/1000.0}]ms "
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: