Mô-đun có điều kiện
Mô-đun có điều kiện kiểm soát nội dung mà người học nhìn thấy sau khi phản hồi mà họ thực hiện đáp ứng một điều kiện nhất định. Ví dụ: những người học trả lời “Có” cho một câu hỏi thăm dò sẽ thấy một khối văn bản khác với những người học trả lời “Không” cho cùng một câu hỏi.
Định dạng mô tả
Thẻ chính của đầu vào mô-đun có điều kiện là có điều kiện.
_< điều kiện> ... </conditional>_
có điều kiện có thể bao gồm bất kỳ số lượng thẻ Xmodule nào (html, video, thăm dò ý kiến, v.v.) hoặc thẻ hiển thị.
Thẻ có điều kiện
Vùng chứa chính cho một trường hợp duy nhất của mô-đun có điều kiện. Các thuộc tính sau có thể được chỉ định cho thẻ này.
sources - location id of required modules, separated by ';'
[message | ""] - message for case, where one or more are not passed. Here you can use variable {link}, which generate link to required module.
[submitted] - map to `is_submitted` module method.
(pressing RESET button makes this function to return False.)
[correct] - map to `is_correct` module method
[attempted] - map to `is_attempted` module method
[poll_answer] - map to `poll_answer` module attribute
[voted] - map to `voted` module attribute
Các trường hợp mẫu
Ví dụ: có điều kiện phụ thuộc vào cuộc thăm dò
<conditional sources="i4x://MITx/0.000x/poll_question/first_real_poll_seq_with_reset" poll_answer="man"
message="{link} must be answered for this to become visible.">
<html>
<h3>You see this because your vote value for "First question" was "man"</h3>
</html>
</conditional>
Ví dụ: có điều kiện phụ thuộc vào cuộc thăm dò ý kiến (sử dụng thẻ <show>)
<conditional sources="i4x://MITx/0.000x/poll_question/first_real_poll_seq_with_reset" poll_answer="man"
message="{link} must be answered for this to become visible.">
<html>
<show sources="i4x://MITx/0.000x/problem/test_1; i4x://MITx/0.000x/Video/Avi_resources; i4x://MITx/0.000x/problem/test_1"/>
</html>
</conditional>
Ví dụ về điều kiện phụ thuộc vào vấn đề
<conditional sources="i4x://MITx/0.000x/problem/Conditional:lec27_Q1" attempted="True">
<html display_name="HTML for attempted problem">You see this because "lec27_Q1" was attempted.</html>
</conditional>
<conditional sources="i4x://MITx/0.000x/problem/Conditional:lec27_Q1" attempted="False">
<html display_name="HTML for not attempted problem">You see this because "lec27_Q1" was not attempted.</html>
</conditional>