Index: openacs-4/packages/xowf/tcl/test/test-item-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/tcl/test/test-item-procs.tcl,v diff -u -r1.1.2.25 -r1.1.2.26 --- openacs-4/packages/xowf/tcl/test/test-item-procs.tcl 31 Jan 2022 11:53:01 -0000 1.1.2.25 +++ openacs-4/packages/xowf/tcl/test/test-item-procs.tcl 31 Jan 2022 12:55:44 -0000 1.1.2.26 @@ -318,27 +318,26 @@ # questions are rendered as part of the exam. ## - # - # The answer page for a student consists of a single - # question. In case randomization is activated, we can't - # be sure, which question this will be. Since every page - # has an image, check this. - # acs::test::dom_html root [dict get $d1 body] { set hrefs [$root selectNodes {//img[@class='image']/@src}] set found_one_image false - set has_raw_and_self false foreach qn {sample_mc_0 sample_st_0 sample_text_0} { if {[string match *$qn* $hrefs]} { - set has_raw_and_self [expr {$qn eq "sample_mc_0"}] set found_one_image true break } } aa_true "Images '$hrefs' were found" $found_one_image - if {$has_raw_and_self} { - aa_true "raw and self could be rendered" {[llength $hrefs] > 1} - } + + # + # The answer page for a student consists of a single + # question. In case randomization is activated, we + # can't be sure, which question this will be. Since + # every page has one image and sample_mc_0, check + # this. + # + aa_equals "Expected images on the page could be rendered." \ + [llength $hrefs] [expr {$qn eq "sample_mc_0" ? 2 : 1}] } #