Hello World
//cards
function Cards (from = 0, to = 0) {
const data = ‘1. How is body water distributed?\nBody water is divided into two main compartments:\n■ Intracellular, comprising two thirds of total body fluid.\n■ Extracellular, comprising one third of total body fluid. \nThe extracellular compartment is further divided into an interstitial compartment containing 75% of the extracellular fluid and an intravascular compartment, which contains 25% of the extracellular fluid.\n*2. What is edema?\nEdema is accumulation of fluid in the interstitial spaces and the body cavities.\n*3. How is edema classified according to the distribution of the fluid?\nEdema can be localized or generalized.\n■ Localized edema: Typically, this involves one organ or part of the body. Clinically important\nexamples of localized edema are brain edema, lung edema, or accumulation of fluid in the\nthoracic cavity (hydrothorax) or abdominal cavity (ascites).\n■ Generalized edema: When edema involves the entire body, it is called anasarca.\n*4. How are various forms of edema classified according to their pathogenesis?\nMain causes of edema are:\n■ Increased intravascular (hydrostatic) pressure\n■ Increased permeability of vessel wall\n■ Decreased oncotic pressure of the plasma\n■ Sodium retention in the kidneys\n■ Obstruction of lymph flow\n*5. What is hydrostatic edema?\nHydrostatic edema results from increased intravascular pressure owing to:\n■ Impaired venous return: Increased central venous pressure caused by heart failure leads to\ngeneralized edema, which is, however, more pronounced in the lower extremities. Obstruction of veins by thrombi may lead to localized edema (e.g., edema of the calf as a result of thrombosis of popliteal veins).\n■ Increased influx of arterial blood: Arterial dilatation owing to heat or in the course of inflammation may cause or contribute to the formation of edema.\n*6. What are the common causes of increased vascular permeability that lead to edema?\nThe most common cause of increased vascular permeability is inflammation. Inflammatory edema results from the action of mediators such as histamine, complement fragments (C3a and C5a), bradykinin, platelet-activating factor (PAF), and leukotrienes.\n*7. What is oncotic edema?\nOncotic pressure of the plasma is primarily maintained by albumin. Reduced concentration of albumin in plasma (hypoalbuminemia) may result from:\n■ Decreased protein synthesis: Most plasma proteins are synthesized in the liver.\nHypoalbuminemia, as seen in end-stage liver disease, is the most important cause of\ngeneralized edema caused by reduced protein synthesis in chronic liver disease.\n■ Increased protein loss: Loss of proteins may occur through the kidneys in nephrotic\nsyndrome or in the stool in protein-losing enteropathy.\n■ Inadequate protein intake: Low-protein diet, as in kwashiorkor, a malnutrition disease\nthat occurs in African children on a protein-deficient diet, may result in generalized edema.\n*8. How does sodium retention cause edema?\nRetention of sodium plays a major role in the pathogenesis of cardiac edema. Heart failure is accompanied by reduced perfusion of the kidneys, which stimulates the juxtaglomerular apparatus to secrete renin. Renin activates the angiotensin system, resulting in an increased secretion of aldosterone from the adrenal cortex. Aldosterone acts on the distal convoluted tubules of the kidney, stimulating them to retain sodium. Retention of sodium is accompanied by water retention, which expands the intravascular volume, leading to increased hydrostatic pressure and hydrostatic edema.\n*9. What is lymphedema?\nLymphedema results from obstruction of lymphatics and an impaired clearance of lymph from the interstitial spaces. Typically, this is a localized form of edema involving parts of the body, as in:\n■ Elephantiasis, a term used to denote massive leg edema caused by obstruction of inguinal\nlymph nodes by filarial worms in filariasis\n■ Edema of the arm that develops following surgical dissection of axillary lymph nodes involved\nby breast cancer; this surgical procedure may disrupt the normal lymph flow\n*10. What is the difference between transudate and exudate?\nTransudate is an ultrafiltrate of plasma that contains few, if any, cells and does not contain large plasma proteins, such as fibrinogen. Transudate results from increased hydrostatic or reduced oncotic pressure. Exudate, on the other hand, is a sign of inflammation and is typically a consequence of increased vascular permeability. Vascular changes permit diapedesis of white blood cells and the passage of large-molecular-weight proteins of the plasma. Accordingly, transudate resembles serum, whereas exudate resembles cell-rich plasma. Transudates do not coagulate, whereas exudates do.\n*11. What is pitting edema?\nPitting edema is a clinical term used for subcutaneous leg edema typically found in patients suffering from heart failure. The name refers to the ‘‘pit’’ that can be induced by pressing the skin over the shin.\n*12. What is the pathogenesis of pulmonary edema?\nPulmonary edema is most often caused by increased pulmonary venous pressure secondary to left-heart failure. In adult respiratory distress syndrome, shock, or infections (pneumonia), pulmonary edema is caused by increased permeability of pulmonary capillaries. Pulmonary edema may also occur in generalized edema caused by hypoalbuminemia of end-stage liver disease or nephrotic syndrome.\n*13. What is the pathogenesis of ascites of cirrhosis?\nAscites, a common feature of cirrhosis (end-stage liver disease), represents a transudate that develops owing to:\n■ Hypoalbuminemia: This results from reduced synthesis of albumin in the damaged liver.\n■ Portal hypertension: This results from impeded blood flow through the fibrotic liver.\n■ Impaired lymph drainage: Normally a liter or more lymph flows through the liver, and in cirrhosis this lymph flow is diverted so that the lymph is not drained into the major lymphatics but enters the abdominal cavity.\n■ Increased retention of sodium and water: Kidneys retain water and salt because of compensatory hyperaldosteronism. After the fluid begins accumulating in the abdominal cavity, the water in the intravascular compartment is reduced, providing a signal\nfor the activation of the renin–angiotensin system. Ultimately, this will cause secondary hyperaldosteronism and retention of sodium and water in the kidney.\n*14. What are the causes of brain edema?\nMost acute and many chronic brain injuries can cause brain edema. Brain edema typically accompanies:\n■ Infection (encephalitis or meningitis)\n■ Brain infarcts and hemorrhage\n■ Cranial or cerebral trauma\n■ Cerebral tumors\n*15. What is the difference between active hyperemia and congestion?\nIn hyperemia, which is an active process, the increased blood influx into the tissues\nresults from dilatation of arterioles. Typically this occurs in inflammation. Adrenergic stimuli cause dilatation of arterioles of the face during blushing. Increased blood flow through the muscles during exercise is another example of active hyperemia.\nCongestion, also known as passive hyperemia, results from stagnation of blood in the capillaries caused by impeded outflow of blood on the venous end. Obstruction of\nveins with thrombi or backward pressure caused by heart failure is typically accompanied by congestion.\n*16. What is the color of hyperemic and congested tissues?\nHyperemic tissues contain increased amounts of oxygenated blood, and therefore such tissues appear bright red. In contrast, congested tissues contain increased amounts of deoxygenated venous blood and therefore appear dusky red or bluish. Hyperemic tissues are warm, whereas the congested tissues are clammy and cold. Hyperemia is an active process involving dilatation of arterioles, whereas congestion refers to passive stagnation of blood in the veins.\n*17. How does acute congestion differ from chronic passive congestion?\nIn acute congestion, the blood is inside the dilated veins and capillaries. Such an accumulation of blood may pass without serious consequences, but if it occurs rapidly, the ensuing\nhypoxia and mechanical compression of tissue around the dilated blood vessels may cause necrosis. In chronic passive congestion, there is invariably ischemia accompanied by loss\nof parenchymal cells, which are usually replaced by fibrosis.\n*18. How does congestion affect the liver?\nAcute congestion leads to centrilobular stasis of blood that fills the central vein and the sinusoids around it. If the congestion develops suddenly and a large amount of blood is retained in the liver, the centrilobular hepatocytes will undergo necrosis. In chronic passive congestion, the hepatocytes die off and are replaced by fibrous tissue. The cut surface of the liver in\nsuch cases has the appearance of a nutmeg. The fibrosis may progress, and the nutmeg liver may transform into cardiac cirrhosis.\n*19. How does chronic passive congestion affect the lungs?\nChronic passive congestion of the lungs is typically a consequence of left heart failure. It is accompanied by extravasation of red blood cells (RBCs) into the alveolar spaces. These RBCs fall apart and are taken up by macrophages, which can be expectorated as ‘‘heart failure cells.’’ Macrophages also enter the interstitial spaces, where they may die or stimulate fibroblasts to produce collagen. On gross examination at autopsy, such lungs appear brownish red, due to hemosiderin, and fibrotic, due to the deposition of collagen. The technical term\nfor these changes is brown induration of the lungs.\n*20. How does chronic passive congestion affect the legs?\nProlonged stagnation of blood leads to dilatation of veins (varicose veins) and capillaries. RBCs leak out of the capillaries and die in the interstitial tissues of the subcutis. Hemosiderin formed from hemoglobin accounts for the brownish discoloration of the skin. Chronic ischemia of the skin impedes healing of minor traumatic injuries, and ulcers form. Such stasis ulcers tend to heal slowly or not at all.\n*21. What is hemorrhage?\nHemorrhage (bleeding) is escape of blood from blood vessels or the heart. Hemorrhages can be classified according to the site of origin:\n■ Cardiac: These are usually caused by penetrating wounds or rupture of ventricle as a result of\nmyocardial infarction.\n■ Arterial: These are usually caused by trauma or rupture of an aneurysm.\n■ Capillary: These are usually caused by trauma or surgery, but they may also occur in a variety of diseases characterized by weakness of vessel walls (e.g., Ehlers–Danlos syndrome and vitamin C deficiency) or platelet disorders (e.g., idiopathic thrombocytopenic purpura).\n■ Venous: These are commonly caused by trauma or surgery.\n*22. What are the differences between petechiae, purpura, and ecchymoses?\nAll three terms refer to hemorrhages into the skin and mucosae. Pinpoint hemorrhages smaller than 1 mm are called petechiae; those measuring 1 mm to 1 cm in diameter are called purpura; and those larger than 1 cm are called ecchymoses. This classification is arbitrary and has survived only by tradition. Note that petechiae often become confluent and become purpura or ecchymoses. To complicate matters, the term purpura is also used for several diseases characterized by widespread cutaneous hemorrhages (e.g., thrombotic thrombocytopenic purpura and Henoch–Scho ̈nlein purpura).\n*23. What is the color of a hematoma?\nHematoma is a grossly visible accumulation of extravasated blood in the tissue. First it is red, and then as the blood is deoxygenated, it becomes dusky and bluish red. As the RBCs fall apart, biliverdin forms, and the hematoma will appear greenish. Bilirubin formed from biliverdin will give it a yellow hue. After that, the remnants of the RBC may be resorbed and the tissue resumes its normal color, or the iron portion of heme pigment is taken up by macrophages and degraded into hemosiderin, which gives the tissues a brownish color.\n*24. How are hemorrhages into body cavities named?\nHemorrhage can occur into any of the preexisting body cavities. Such hemorrhages are named by combining the prefixes hem or hemato (from Greek haima, ‘‘blood’’) and the anatomic site involved. Accordingly, most of these terms are self-explanatory. For example, terms such\nas hematopericardium, hematothorax, and hemarthrosis can be easily understood as denoting bleeding into the pericardial, pleural, or intraarticular space, respectively. Other terms are not\nso intuitively obvious. For example, hematocephalus denotes accumulation of blood in the ventricles of the brain. Hematocolpos signifies accumulation of blood in a vagina occluded by an imperforate hymen.\n*25. What is hematuria?\nHematuria is appearance of blood in urine. It may be classified as microscopic (i.e., detectable by microscopic examination of urine) or macroscopic if visible to the naked eye. Hematuria may be a sign of kidney or urinary tract disease.\n*26. What is hematemesis?\nHematemesis is vomiting of blood. Typically, it is a sign of esophageal and gastric hemorrhage. Common causes of hematemesis are ruptured esophageal varices and peptic ulcer of the stomach and duodenum.\n*27. What is hematochezia?\nHematochezia is bleeding through the rectum. It is typically caused by diseases of the large intestine.\n*28. What is melena?\nMelena or black blood presenting as ‘‘coffee-ground’’ material in the stool is a sign of upper gastrointestinal bleeding. Such blood is partially digested by hydrochloric acid of the\ngastric juice and transformed into a black pigment called hematein. This pigment is not digested in the intestines and is passed in the feces.\n*29. What is the difference between epistaxis and hemoptysis?\nEpistaxis is bleeding from the nose. Hemoptysis is bleeding from the lungs; literally it means ‘‘spitting of blood.’’\n*30. What is the difference between menorrhagia and metrorrhagia?\nMenorrhagia is heavy menstrual bleeding. Metrorrhagia occurs at any time and is not related to menstrual bleeding. The term menometrorrhagia is used for a heavy menstrual bleeding\nthat does not stop after a few days.\n*31. How is hemostasis related to thrombosis?\nBoth processes are based on the coagulation of blood. Hemostasis (‘‘stopping of hemorrhage’’) is the physiologic process designed to stop the bleeding from ruptured blood vessels. Thrombosis is a pathologic form of coagulation of circulating blood inside intact vascular spaces. Factors that predispose to thrombosis are found in the vessel wall, in the blood, or can be related to altered blood flow (so-called Virchow’s triad).\n*32. What are the main components of the hemostatic process?\nBoth hemostasis and thrombosis depend on the interaction of numerous components, which can be grouped as related to the:\n■ Vessel wall ■ Platelets\n■ Coagulation proteins of the plasma\n*33. How does endothelium of blood vessels act on the coagulation of blood?\nEndothelial cells have both procoagulant and anticoagulant properties, and according to the needs of the body, they may either promote blood clotting or inhibit it.\n*34. How does endothelium prevent blood clotting?\nAnticoagulant functions of endothelial cells include:\n■ Inhibition of platelet aggregation: Endothelial cells secrete prostacyclin (PGI2) and nitric\noxide (NO), which dilatate blood vessels, thus increasing the blood flow and reducing\nthe chance of adhesion of platelets to the vessel wall. Prostacyclin also directly inhibits the aggregation of platelets.\n■ Inhibition of platelet antithrombin activity: This is mostly accomplished by thrombomodulin, which captures thrombin and submits it for degradation by the anticoagulant protein C.\n■ Fibrinolysis: Endothelium secretes plasminogen activator, which generates plasmin from plasminogen. Plasmin lyses fibrin and prevents the growth of the clot.\n*35. How does endothelium promote blood clotting?\nEndothelial cells promote blood clotting through several mechanisms that are counterbalanced by the anticlotting forces. Procoagulant mechanisms include release of:\n■ von Willebrand factor from Weibel–Palade granules in the cytoplasm of endothelial cells:\nThis factor mediates the binding of platelets to surfaces and also serves as a carrier for\nthe coagulation factor VIII.\n■ Thromboplastin (tissue factor, F III): This promotes the extrinsic pathway of the coagulation\ncascade.\n■ Inhibitors of plasminogen activator (PAI).\n*36. What are the essential components of platelets?\nPlatelets are derived from the fragmentation of the cytoplasm of megakaryocytes. Platelets have the following components that are essential for their participation in hemostasis and thrombosis:\n■ Granules (alpha granules and delta granules or dense bodies): These granules contain a number of ready-made biologically active substances, including coagulation factors such\nas fibrinogen, mediators of inflammation such as histamine, and growth factors such as\nplatelet-derived growth factor (PDGF).\n■ Cytoskeleton: This is composed of tubulin, actin, and myosin filaments that allow the rapid\nextrusion of granules from the cytoplasm. Microfilaments and microtubules also mediate\nthe change of the shape of platelets and account for the ‘‘clot retraction.’’\n■ Adhesion molecules and receptors: These glycoproteins are expressed on the cell\nmembrane of activated platelets, allowing them to adhere to fibrinogen and von Willebrand\nfactor and also each other.\n■ Phospholipids: These cell components (e.g., platelet factor 3) act with and calcium stored\nin dense granules as cofactors in the coagulation cascade.\n*37. What happens after activation of platelets?\nActivation of platelets is followed by four phases of clot formation. These phases, which partially overlap one another, include:\n■ Adhesion of platelets to the surface of the vessel wall\n■ Release of chemical mediators stored in granules\n■ Aggregation with other platelets to form the primary hemostatic plug\n■ Contraction and formation of the secondary hemostatic plug composed of firmly aggregated\nplatelets and fibrin\n*38. What is the role of coagulation proteins in hemostasis and thrombosis?\nCoagulation factors are a group of plasma proteins that are activated by acting upon each other in a sequence known as the extrinsic and intrinsic pathway. These proteins lead to activation of thrombin, which plays a crucial role in the polymerization of fibrinogen into fibrin. Fibrin formed at the end of the coagulation cascade represents the meshwork skeleton of the clot and also serves as the glue that holds together platelets and other components of the clot. Deficiency of coagulation factors results in bleeding disorders.\n*39. What is the difference between the intrinsic and the extrinsic coagulation pathway?\nThe intrinsic pathway is so called because it can be activated by pouring the blood into a test tube without adding any extrinsic material. The coagulation cascade is activated by the binding of Hageman factor (F XII) to negatively charged glass. The extrinsic pathway is activated by adding tissue factor, which activates factor VII.\nThe mnemonic TEEN helps in remembering that the activation of factor X through the intrinsic pathway involves factors twelve, eleven, eight, and nine.\n*40. How is the coagulation activated in vivo?\nThe intrinsic pathway is activated by exposure to collagen or basement membranes denuded of endothelial cells or disrupted vessel walls. It can be activated by plasma proteins such as prekallikrein and platelets. The extrinsic pathway is activated by tissue factor (i.e., a number of thromboplastins released from damaged tissue).\n*41. Which events occur in the common pathway of the coagulation cascade?\n■ The intrinsic and the extrinsic pathway converge, activating factor X.\n■ Activated factor X forms interact with factor V, platelet factor 3, and calcium to form the\nprothrombin complex.\n■ The prothrombin complex cleaves a portion of the prothrombin molecule leading to the\nformation of enzymatically active thrombin.\n■ Thrombin is an enzyme that cleaves fibrinogen into fibrin monomers and fibrinopeptides\nA and B.\n■ Under the influence of factor XIII, fibrin monomers polymerize into insoluble\nfibrin strands.\n*42. Which plasma coagulation factors are vitamin K dependent?\nFactors II (prothrombin), VII, IX, and X—proteins synthesized in the liver—cannot participate in the coagulation cascade and cannot interact with calcium and platelet factor 3 unless carboxylated in the presence of vitamin K. Anticoagulant proteins C and S are also vitamin K dependent.\n*43. What are the main natural anticoagulants?\n■ Antithrombins: These serine protease inhibitors block the action of thrombin and other serine proteases (activated factors IX, X, XI, and XII).\n■ Proteins C and S: These proteins inhibit factors VIII and V, thus blocking the intrinsic and extrinsic pathway.\n■ Plasmin: This is formed from plasminogen; it acts on fibrin, cleaving it into fibrin degradation products D, E, X, and Y.\n*44. Is heparin an important anticoagulant?\nHeparin is a potent anticoagulant drug widely used in the treatment of coagulation disorders. Heparin combines with antithrombin III to form a complex that inhibits\nthe action of thrombin. Heparin is stored in the granules of mast cells and basophils\nand may be released during the degranulation of these cells. It is, however, not\nnormally present in the circulating plasma. Endothelial cells express on their surface heparin-like molecules that bind antithrombin III and have the same anticoagulant activity as heparin.\n*45. What is thrombosis?\nThrombosis is a pathologic process characterized by intravascular clotting in a\nliving person. Clots formed in circulating blood inside the blood vessels or cardiac chambers are called thrombi. Postmortem clots or coagula formed in a test tube are not called thrombi.\n*46. What is Virchow’s triad?\nIn 1845 Rudolf Virchow, the famous German pathologist, suggested that three factors promote thrombosis:\n■ Changes in the vessel wall\n■ Changes of blood flow\n■ Changes in the composition of blood\n*47. Why does the vessel wall predispose to thrombosis?\nThere are two main reasons:\n■ Damaged endothelial cells produce or release procoagulant substances (e.g., thromboplastin,\nvon Willebrand factor, PAF, and inhibitor of plasminogen activator), whereas the production of anticoagulant substances (e.g., thrombomodulin, antithrombin III, NO, and plasminogen activator) is reduced.\n■ Loss of endothelial cells exposes the underlying basement membrane or collagen in the wall of the blood vessels, allowing the binding of platelets to these structures. Binding of platelets to these surfaces, mediated by von Willebrand factor, leads to formation of platelet aggregates and initiates the formation of thrombi.\n*48. What are the common and important causes of endothelial cell injury or loss that initiate thrombosis?\n■ Hemodynamic injury (e.g., as a result of high blood pressure)\n■ Atherosclerosis\n■ Infection (e.g., thrombophlebitis)\n■ Autoimmune diseases (e.g., polyarteritis nodosa)\n■ Metabolic disorders (e.g., hyperlipidemia and homocystinemia)\n■ Trauma or surgery\n*49. Which changes in the blood flow predispose to thrombosis?\nThere are two principal changes in the blood flow that predispose to thrombosis:\n■ Stasis, typically found in dilated veins\n■ Turbulent flow, typically encountered in abnormally dilated heart chambers that are not\ncontracting regularly (e.g., atrial fibrillation) or arterial aneurysms\n*50. How do hemodynamic changes promote thrombosis?\nAltered blood flow may cause endothelial cell injury or increase the coagulability of the blood. Several mechanisms may play a role, such as the following:\n■ Turbulent flow may mechanically damage the endothelial cells.\n■ Turbulent flow or stasis may activate endothelial cells and stimulate them to secrete\nprocoagulants at the expense of anticoagulant substances.\n■ Stasis or turbulent flow may bring platelets and leukocytes in contact with the endothelial\ncells and facilitate their attachment.\n■ Stasis may reduce the inflow of fresh blood that contains natural anticoagulants.\n■ Stasis may retard the removal of small platelet aggregates that would have floated away in\nnormal circulation, thus allowing the buildup of the thrombus.\n*51. What are the common causes of hemodynamic changes that promote thrombosis?\n■ Venous thrombi are most often a complication of varicose veins.\n■ Arterial thrombi develop in aortic aneurysms and overulcerated atherosclerotic plaques.\n■ Cardiac thrombi develop in irregularly contracting hearts (e.g., atrial fibrillation), over the\ndamaged endocardium (e.g., mural thrombi over a myocardial infarct), and in an infected cardiac valve (e.g., bacterial endocarditis).\n*52. How does changed composition of blood contribute to thrombosis?\nIncreased concentration of coagulation proteins or reduced concentration of natural anticoagulants lead to hypercoagulability of the blood. These hypercoagulable states fall into two large groups:\n■ Hereditary hypercoagulable states: These genetic diseases (also known as thrombophilias)\ninclude congenital deficiency of antithrombin III, protein C, or protein S and mutation of the gene-encoding factor V (called factor V Leiden). Approximately 5% to 10% of all people have some genetic defect predisposing them to thrombosis.\n■ Acquired hypercoagulable states: Increased coagulability of the blood may be encountered in many conditions. For example, tissue damage results in an increased release of thromboplastin and other procoagulants. Tumor cells may enter the circulation and initiate thrombosis. Bacteria and other pathogens may have the same effect. In chronic infections, the liver may increase the production of fibrinogen (one of the so-called acute-phase reactants) and reduce production of anticoagulants. Disseminated intravascular coagulation (DIC) is commonly encountered in many forms of shock. An increased tendency for thrombosis is encountered in obese people and those who smoke, although the exact pathogenesis of these hypercoagulable states is not known.\n*53. How do immune mechanisms cause thrombosis?\nThrombi form in many immune diseases and can also develop in response to exogenous antigens:\n■ Polyarteritis nodosa: This type III hypersensitivity reaction is characterized by fibrinoid\nnecrosis of the wall of small- and medium-sized arteries. Thrombi readily form over such inflammatory lesions because of local accumulation of thromboplastin from damaged tissue and other procoagulant substances released from the inflammatory cells.\n■ Systemic lupus erythematosus (SLE): This type III hypersensitivity reaction leads to the deposition of immune complexes in many sites. Among others, it damages glomeruli, which often contain microthrombi. Libman–Sacks endocarditis, a common feature of SLE, presents with thrombi on the mitral valve. These thrombi accumulate at the site of endocardial injury caused by immune mechanisms.\n■ Antiphospholipid antibodies: A common finding in a variety of clinical conditions\n(e.g., strokes and infarcts), these antibodies are detectable by their reactivity with cardiolipin, a phospholipid antigen used in the Wasserman reaction for syphilis. These antibodies bind to the phospholipids of platelets (PF3), promoting formation of thrombi.\n■ Heparin-induced thrombocytopenia: This form of low platelet count is found in approximately 5% of patients treated for prolonged periods of time for increased coagulability of blood\nwith heparin. The exogenous heparin apparently induces formation of antibodies that bind to heparin platelet factor 4 complex and destroy platelets. These antibodies also cross-react with heparin-like substances on endothelial cells, causing endothelial cell injury and thus promoting thrombosis.\n*54. What are the most important clinical conditions complicated by thrombosis?\n■ Deep vein thrombosis (DVT): Also known as phlebothrombosis, it most often involves the deep leg veins. It is the most common form of clinically diagnosed thrombosis. DVT may be related to varicose dilatation of calf veins, but often its causes are not apparent.\n■ Prolonged immobility and rest: Lying in bed or sitting a long time in an airplane predispose to thrombosis.\n■ Tissue damage: Conditions that cause massive tissue destruction, such as crush trauma, burns, or surgery, are commonly complicated by thrombosis. Prolonged bed rest after such incidents may cause stasis of the blood and increase the risk for thrombosis.\n■ Pregnancy and obstetrical complications: Generally speaking, pregnancy predisposes to thrombosis. Oral contraceptives and steroid hormones increase the risk for thrombosis as well.\n■ Circulatory disturbances: Major circulatory disturbances such as myocardial infarction and\nstroke, are important risk factors.\n■ Tumors: Thrombosis is related to the release of thromboplastin, which promotes coagulation.\nA mnemonic to remember common causes of thrombosis is THROMBI:\nTissue damage (trauma, fractures, burns, and surgery)\nHereditary conditions (factor V Leyden, deficiency of antithrombin, and protein C or S) Rest (prolonged bed rest after surgery or in old age)\nObstetrics (normal pregnancy, eclampsia, and abruptio placentae)\nMalignancy\nBlood flow disturbances (varicose veins, myocardial infarct, aneurysms, and apoplexy) Immune mechanisms (SLE, anti-phospholipid antibody, and polyarteritis nodosa)\n*55. What are the macroscopic features of thrombi?\nLarge thrombi formed in the veins, arteries, and heart of a living person have typical features that distinguish them from postmortem clots:\n■ Lines of Zahn: Thrombi form by the deposition of platelets and fibrin, which forms a white\nlayer. RBCs deposit on this layer, forming a red layer on which a new layer of fibrin and\nplatelets is deposited. These alternating white and red lines are called lines of Zahn.\n■ Friability: Thrombi are held together with fibrin that does not permeate all layers\nuniformly but leaves cleavage lines between the white and red layers. Most thrombi will crumble along cleavage lines when bent or compressed with the finger. The friability\nof thrombi accounts for the fact that they may detach and embolize.\n■ Attachment: Thrombi are attached to the surface of the vessel or heart chamber in which they were formed.\n■ Molding: Thrombi formed inside veins typically retain the shape of the vessel in which they were formed and appear like casts of these veins and their tributaries. Veins filled with thrombi appear expanded and may be palpated during physical examination. At autopsy, such veins appear completely filled and widened.\n*56. What is the appearance of postmortem clots?\nPostmortem clots form from the blood that does not circulate. Owing to the forces of\ngravity, the RBCs sediment and separate from plasma. Accordingly, the postmortem clots consist of a lower red part (colloquially described as resembling ‘‘currant jelly’’) and a yellow part (known as ‘‘chicken fat’’). Postmortem thrombi are pliable and do not appear friable like the premortem thrombi. Such clots do not fill or expand the blood vessels in which they are found. Postmortem thrombi can be easily removed from the blood vessels at autopsy.\n*57. What is the appearance of clots formed in a test tube?\nClots formed in test tubes are red and resemble the currant jelly part of the postmortem clots. The lower red part is covered with a very thin ‘‘buffy coat’’ composed of white blood cells and platelets.\n*58. What are mural thrombi?\nMural (literally, ‘‘formed on the wall’’) are thrombi attached to the endothelial surface\nof aorta, large veins, or the endocardium of the heart chambers. Similar thrombi found on cardiac valves are called valvular thrombi. Valvular thrombi are also called vegetations.\n*59. What are occlusive thrombi?\nOcclusive thrombi are found in smaller arteries, veins, and capillaries. They fill and thus completely occlude the lumen of these vessels.\n*60. What are the possible outcomes of thrombosis?\n■ Resolution: Fibrinolysis mediated by plasmin accounts for the dissolution of most thrombi. Because the endothelial cells lining the veins produce more plasminogen activator, venous thrombi are lyzed more readily than cardiac and arterial thrombi.\n■ Propagation: Thrombi that do not resolve by fibrinolysis tend to ‘‘grow’’ because of the deposition of additional platelets, fibrin, and red blood cells. Such growth is typically accompanied by the formation of a downstream ‘‘tail.’’\n■ Embolization: Thrombi may detach from the vessel wall and give rise to emboli carried downstream by the blood. Large thrombi may form fragments, which also may embolize.\n■ Organization: Ingrowth of granulation tissue from the vessel wall forms a firm link between the thrombus and the vessel wall. As in a healing wound, granulation tissue will slowly transform into a fibrous scar. A small ‘‘bump’’ inside the vessel may be the only residue of such an organized thrombus.\n■ Recanalization: The blood vessels in the granulation tissue organizing the thrombus may fuse into larger channels that bridge the thrombus, allowing the resumption of blood flow.\n*61. What are the possible complications of thrombosis?\n■ Infarction: Occlusive thrombi may completely interrupt the blood flow through an artery, causing ischemic necrosis of the tissue supplied by that vessel. This is a typical complication of arterial thrombosis (e.g., coronary artery thrombosis).\n■ Edema and obstruction of venous outflow: This is typically seen in venous thrombosis.\n■ Emboli: Thromboemboli are a common complication of thrombosis, regardless of whether\nthe thrombi are venous, arterial, or cardiac.\n■ Infection: Thrombi are a fertile soil for bacteria and are easily infected.\n■ Inflammation of the vessel wall: Organization of infected venous thrombi elicits an\ninflammation in the vessel wall. This thrombophlebitis is associated with redness, swelling, and pain of tissues around a cordlike thrombosed vein.\n*62. What is migratory thrombophlebitis?\nMigratory thrombophlebitis is a feature of Trousseau syndrome associated with pancreatic and gastric carcinoma. It presents with the appearance of thrombi in superficial veins. These thrombi disappear spontaneously and reappear at some other site. Thrombi form because of the entry of thromboplastin released from the cancer cells into the circulation.\n*63. What are emboli?\nEmboli are particulate, fluid, or gaseous material carried by the bloodstream from the site of their origin or entry into the circulation to other parts of the body. Emboli are classified according to the material from which they are formed:\n■ Thromboemboli\n■ Air (gas) emboli\n■ Fat emboli\n■ Bone marrow emboli\n■ Tumor emboli\n■ Cholesterol emboli\n■ Foreign body emboli\n■ Amniotic fluid emboli\n*64. What are the most common and clinically most important emboli?\nThromboemboli represent the most common and most important emboli. Thromboemboli are classified according to how they are carried by blood:\n■ Venous: These originate in the veins and are carried by venous blood into the lungs.\n■ Arterial: These emboli originate in the heart or aorta and large arteries and are carried by\n arterial blood into various organs, such as the brain, kidney, and spleen.\n■ Paradoxical: These emboli originate as venous emboli, but instead of reaching the lungs, they cross through a foramen ovale or some right-to-left shunt in the heart and thus reach the arterial circulation.\n*65. What are pulmonary emboli?\nPulmonary embolism (PE) is most often caused by venous thromboemboli originating in the veins of the lower extremities. Depending on the size of the thromboemboli and the extent of embolization, PE may present in several forms:\n■ Occlusion of the main pulmonary artery or its main branches may cause sudden death. Such\na saddle embolus typically prevents influx of blood into the lungs.\n■ Occlusion of the branches of the pulmonary artery will cause infarcts. The lungs have dual\ncirculation, and in normal circumstances the occlusion of pulmonary artery branches may be compensated by an influx of blood from the bronchial arteries. However, if PE is associated with heart failure and atherosclerosis of the aorta (a condition that prevents the compensatory blood supply through the bronchial arteries), ischemic necrosis of lung parenchyma will develop. When the blood from the bronchial arteries finally reaches the ischemic area, it will perfuse blood vessels that are necrotic and will leak into the alveolar spaces. Accordingly, pulmonary infarcts appear as red, airless, triangular areas.\n■ Nonocclusive emboli in branches of the pulmonary artery do not produce ischemia and may be clinically unrecognized. Over time, these thrombi become organized. This process narrows the lumen of pulmonary artery branches and over time may lead to pulmonary hypertension.\n*66. Where do arterial emboli lodge most often?\nArterial emboli may occlude any artery. Which artery will be occluded depends on the size\nof the thrombus. Large thrombi occlude large arteries, such as those of the legs and arms and those of celiac, mesenteric, renal, splenic, or cerebral arteries. Smaller emboli reach the branches of these arteries in various organs.\n*67. What are septic thromboemboli?\nSeptic emboli result from infected thrombi, such as valvular vegetations in bacterial endocarditis. Infarct caused by such emboli becomes infected by bacteria and transforms into an abscess.\n*68. What is air embolism?\nAir embolism is caused by entry of atmospheric air into the circulation or by the appearance of intravascular nitrogen bubbles as a result of decompression. Air bubbles may occlude blood vessels or cause DIC. DIC is triggered by platelets that tend to adhere to nitrogen bubbles and become activated to initiate the coagulation cascade.\n*69. Can air embolism kill?\nSmall amounts of air are innocuous, but if more than 150 mL is injected, death can occur. The injected air fills the right ventricle, not allowing the influx of venous blood. Blood entering the right ventricle is transformed into a foamy air–fluid mixture that also obstructs the blood flow, rapidly causing death.\n*70. How does air enter into the circulation?\nAir typically enters the venous blood during various procedures:\n■ Trauma or surgery on the neck accompanied by a tear in the wall of the jugular vein or\nthe superior vena cava may lead to negative pressure in the thorax, which plays an important\nrole in sucking the air into the venous blood.\n■ Childbirth or abortion may allow the entry of air into uterine veins.\n■ The cubital vein may serve as the entry point during blood transfusions given under positive\npressure.\n*71. What is decompression sickness?\nDecompression sickness (caisson disease) is a form of gas embolism resulting from the appearance of nitrogen bubbles in the blood. Nitrogen is physically dissolved in the blood and is kept in the solution by normal atmospheric pressure. Decompression, as typically seen in divers who come to the surface from deep waters too fast or in pressurized caisson chambers, will allow nitrogen to come out of the solution in the form of gaseous bubbles. These gas bubbles occlude small blood vessels or initiate DIC. Occlusion of the small blood vessels in the joints, bones, and soft tissues causes painful muscle contractures (‘‘the bends’’). Occlusion\nof pulmonary vessels causes shortness of breath (‘‘the chokes’’). Severe ischemic necrosis may cause widespread infarcts and even death.\n*72. What is fat embolism?\nFat embolism results from the entry of fat globules into the circulation. In most instances, the cause of fat embolism is fracture of long bones. Fat cells in the bone marrow rupture as a result of trauma, releasing their contents into the venous blood. Trauma of subcutaneous or breast fat cells usually does not cause fat embolism.\n*73. How does fat embolism present clinically?\nSymptoms of fat embolism appear 1 to 3 days after fracture of long bones of the extremities. These symptoms are related to ischemia caused by the occlusion of capillaries by fat globules. During the first 2 days, the patient typically has shortness of breath, which is caused by the occlusion of pulmonary capillaries. Small globules that are filtered through the lungs cause microscopic foci of necrosis accompanied by minute pericapillary hemorrhages that occur in both hemispheres. These microscopic infarcts present as mental, sensory,\nor motor disturbances. Fat globules also induce DIC, which may aggravate the already precarious condition of most patients. Approximately 10% of patients with fat embolism die.\n*74. What are the autopsy findings in lethal fat embolism?\nFat globules filling the capillaries can be demonstrated in frozen sections of the lung, brain, and other organs. In the brain, the capillaries occluded with fat globules are surrounded by a ring of hemorrhage infiltrating the microscopic perivascular infarcts.\n*75. What is bone marrow embolism?\nEntry of bone marrow particles into the circulation may occur upon fracture of bones that contain hematopoietic bone marrow. Typically, it occurs during cardiopulmonary resuscitation of people who have had a cardiac arrest. Compression of the chest during this procedure\nmay fracture the ribs, which allows the entry of bone marrow in the circulation. Bone marrow particles are carried by venous blood to the lungs, where they occlude small branches of the pulmonary artery. These emboli are of no clinical significance and are a sign of a vigorous resuscitation.\n*76. What is tumor embolism?\nTumor cells may enter the circulation by migrating through capillary walls but also through the walls of larger vessels during surgery. Circulating tumor cells may be found in many tumor patients, but in only a minority of these patients will cells ultimately form emboli. Tumor cell emboli usually do not cause infarcts. Arrested tumor cells grow out of the vessel and form secondary tumor nodules. Tumor emboli are essential for the hematogenous dissemination of tumors and the formation of distant metastases.\n*77. What are cholesterol emboli?\nCholesterol emboli result from the entry of cholesterol crystals from atherosclerotic lesions into the arterial bloodstream. Typically this occurs during catheterization of the aorta or a surgical procedure, but it may also be caused by spontaneous rupture of an atheroma. These crystals occlude capillaries causing microscopic infarcts. Cholesterol crystals occluding retinal arteries can cause loss of vision. Brain infarcts are usually microscopic and associated\nwith so-called transient ischemic attacks characterized by mental, sensory, or motor deficiencies. Massive occlusion of renal arterioles and glomerular capillaries may result in acute renal failure.\n*78. What is foreign body embolism?\nForeign bodies entering the circulation may be carried to distant parts of the body by the circulation. Examples of such emboli are cotton, wool, or cloth fibers entering the blood flow during surgery, crystals of talc or starch injected by intravenous drug abusers, and bullets.\n*79. What is amniotic fluid embolism?\nAmniotic fluid may enter into the uterine veins during childbirth. Fortunately, it is very rare (1:80,000 deliveries), but if it occurs, it is lethal in 80% of cases.\nAmniotic fluid contains lanugo hairs, vernix, and even meconium, which may occlude the pulmonary artery branches and cause sudden death. At autopsy of deceased women, all these particulate substances may be found in pulmonary capillaries. Amniotic fluid contains tissue debris that is highly thrombogenic. These substances may induce DIC, and in these cases, women die in shock. At autopsy, all major organs contain microscopic thrombi in small blood vessels.\n*80. What is DIC?\nDIC is a form of microangiopathic thrombosis characterized by consumptive coagulopathy. Translated into colloquial English, this means that DIC represents a clotting disorder characterized by formation of thrombi in small blood vessels (arterioles, capillaries, and venules). Formation of these microthrombi consumes the platelets (resulting in thrombocytopenia) and leads to a depletion of fibrin (hypofibrinogenemia) and other coagulation proteins. Loss of coagulation proteins leads to bleeding, which cannot be stopped. This vicious cycle of thrombosis and bleeding, typical of DIC, cannot be interrupted easily.\n*81. What are common causes of DIC?\nDIC can be triggered by many mechanisms, including:\n■ Infections: This is most often caused by gram-negative sepsis, but it may be caused by\nfungal infections, meningococcemia, and many other infections.\n■ Neoplasms: Most often the underlying causes are carcinomas of the gastrointestinal tract\nand promyelocytic leukemia.\n■ Massive tissue injury: The best-known examples are traffic trauma, burns, and extensive\nsurgery.\n■ Shock: Any form of shock can result in DIC.\n■ Obstetric complications: DIC is typically a complication of amniotic fluid embolism,\neclampsia, and abruptio placentae, it but may occur in many other pregnancy-related conditions.\n*82. What is the pathogenesis of DIC?\nIntravascular coagulation can be initiated by three often interrelated pathways:\n■ Activation of Hageman factor initiating the intrinsic coagulation cascade\n■ Thromboplastins activating the extrinsic coagulation pathway\n■ Endothelial cell injury\nFor example, massive tissue injury will release or activate enzymes that act on the Hageman factor and may injure or activate the endothelial cells. At the same time, tissue injury will release thromboplastins, which activate the extrinsic coagulation pathway. Lipopolysaccharides of gram-negative bacteria can also activate Hageman factor, act as thromboplastins, and injure endothelial cells.\n*83. What are the pathologic findings in DIC?\nThe most prominent findings are numerous fibrin thrombi in small vessels. These microthrombi are easily found in the heart, brain, glomeruli of the kidneys, and other sites. Microthrombi cause microscopic infarcts. Most patients die before such foci of ischemic necrosis become histologically apparent.\n*84. What is Waterhouse–Friderichsen syndrome?\nThis syndrome represents a DIC caused by Neisseria meningitidis. Typically it presents with purpura of the skin and hemorrhagic infarction of the adrenals.\n*85. What are the laboratory findings in DIC?\n■ All bleeding tests (prothrombin [PT] and activated partial thromboplastin time [aPTT]) are prolonged.\n■ Thrombocytopenia occurs.\n■ Fibrin degradation products appear in urine.\n*86. What is the difference between an infarct and infarction?\nAn infarct is an area of ischemic necrosis. Infarction is the process that leads to this ischemic necrosis.\n*87. What are the causes of infarction?\nInfarction results from sudden reduction of blood supply to an area. Infarcts can be classified pathogenetically:\n■ Arterial: This is caused by obstruction of an artery.\n■ Venous: This is caused by obstruction of venous blood outflow.\n■ Hypotensive: This is caused by hypoperfusion of tissues by arterial blood that typically occurs in shock and is related to hypotension.\n*88. What is the difference between red and white infarcts?\nAccording to their gross appearance at autopsy, infarcts can be classified as pale or red. Pale infarcts (meaning paler than the normal tissue) reflect ischemia that has evolved\nowing to the obstruction of a nutrient artery or hypoperfusion of tissue in hypotension. Such infarcts develop in solid organs supplied by anatomically or functionally terminal arteries, as typically found in the heart, kidneys, and spleen. Terminal arteries in these organs do not have functioning anastomoses, and the occlusion of an arterial branch will deprive the tissue of blood and cause a pale infarct.\nRed infarcts are suffused with blood and appear dark or bluish red. They occur in the following:\n■ Venous infarcts result from obstruction of vein. The blood cannot exit from the infarcted area, and therefore the area appears congested.\n■ Organs with double blood supply, such as the lungs, receive venous blood through the pulmonary artery and arterial blood through the bronchial arteries originating from the thoracic aorta. Obstruction of the branches of the pulmonary artery will cause an infarct, and the ischemic area will subsequently be flooded by blood from nutrient (bronchial) arteries. Similar events account for the red color of infarcts in the liver, which receives blood from the portal vein and the hepatic artery.\n■ Organs with well-developed anastomoses, such as the brain, receive blood from the branches of carotid and basilar arteries. Likewise small intestines receive the arterial blood from the arcuate internastomozing branches of the mesenteric arteries.\n*89. What is a septic infarct?\nSeptic infarcts result from arterial obstruction with infected (septic) thromboemboli. Bacteria enter the ischemic area from the infected thrombus and transform the infarct into an abscess.\n*90. Is gangrene related to infarction?\nGangrene is a term used to denote two forms of infarcts:\n■ Dry gangrene: This is characterized by mummification of the infarcted tissues and typically\noccurs on lower extremities. The leg, foot, or toes appear black and dry, like Egyptian mummies.\n■ Wet gangrene: This represents moist infected infarcts developing in parts of the body that\nnormally contain saprophytic bacteria. Typically this occurs on the infarcted feet or toes of diabetics. Arterial or venous infarcts of the large intestines, which normally contain saprophytic bacteria, also appear gangrenous.\n*91. What is the fate of patients with infarcts?\nThe outcome of infarcts depends on the tissue and organ affected:\n■ Fibrosis: In the heart infarct, cardiac myocytes are replaced by fibrous tissue (scar).\n■ Resorption: In the cerebral infarct, the necrotic tissue becomes liquefied and is resorbed. The\nresulting empty space (pseudocyst) is filled with fluid.\n■ Regeneration: Infarcted liver cells are replaced by regenerating hepatocytes.\n*92. What is shock?\nShock is a condition caused by hypoperfusion of tissue with blood. It may be classified as:\n■ Cardiogenic: This typically occurs in heart failure and could be caused by ‘‘pump failure’’ as\nin infarction or an occlusion of ostia caused by valvular disease in endocarditis.\n■ Hypovolemic: This type of shock typically follows massive bleeding or any other form of fluid\nloss.\n■ Distributive: Also known as hypotensive shock, this results from peripheral vasodilatation as\nin massive sepsis or anaphylactic shock.\nCommon to all these conditions is a circulatory collapse resulting from a disproportion between the volume of the circulating blood and the vascular space that it is supposed to fill. Ensuing tissue hypoxia or anoxia leads to multiple organ failure.\n*93. What are the causes of cardiogenic shock?\n■ Pump failure (ejection fraction 100 beats/min)\n■ Skin pallor as a result of constriction of arterioles\n■ Reduced urine production\n*100. What are the features of decompensated but still reversible shock?\nThis stage evolves after the compensatory mechanisms of early shock have failed. It is characterized by:\n■ Hypotension: Both the systolic and diastolic pressure and the cardiac output drop.\n■ Tachypnea and dyspnea (shortness of breath): The lungs are trying to compensate for\nhypoxia. Pulmonary edema slowly develops, further impairing oxygenation.\n■ Oliguria (urine volume <500 mL/day): This develops because of massive constriction of\nrenal arterioles and reduced glomerular filtration rate.\n■ Acidosis: Low pH of the blood is the consequence of decreased renal and pulmonary\nfunctions and anaerobic glycolysis in tissue favored by anoxia. Acidosis is partially metabolic and partially respiratory and is marked by an increased accumulation of lactic acid (product of anaerobic glycolysis).\n*101. What are the features of irreversible shock?\nComplete circulatory collapse and marked hypoperfusion of vital organs lead to DIC, a loss of vital functions, and multiple organ failure. Clinical signs are:\n■ Marked hypotension and extreme tachycardia (filiform pulse)\n■ Respiratory distress not responding to oxygen therapy and assisted ventilation with a respirator\n■ Loss of consciousness progressing to coma\n■ Gastrointestinal bleeding\n■ Anuria, with elevated blood urea nitrogen (BUN) and creatinine in blood\n■ Severe acidosis\n■ Laboratory signs of DIC (prolonged PT, aPPT, thrombocytopenia, and microangiopathic\nhemolytic anemia)\n'
if (from == 0 && to == 0) {
return data.split("*")
} else {
from = from – 1;
return data.split("*").slice(from, to);
}
}
//number to index number
function indexify (num){
return num – 1
}
function moveElement(array, fromIndex, toIndex) {
const element = array.splice(fromIndex, 1)[0];
array.splice(toIndex, 0, element);
return array;
}
String.prototype.animate = function (ele) {
const text = this.split("
“);
const progress = “” + text[0] + “
” + text[1] + ““;
console.log(progress);
const card = text[2];
let i = 0;
const interval = setInterval( () => {
let char = card[i];
if (char === “”)
}
ele.innerHTML = progress + “
” + card.slice(0, i);
ele.innerHTML += “ █ “
i++;
if (i > card.length) {
clearInterval(interval);
}
}, 1);
}
//prgress bar
function textProgressBar(dsc, progress, total) {
const progressBarLength = 20;
const progressBarFull = Math.round(progress / total * progressBarLength);
const progressBarEmpty = progressBarLength – progressBarFull;
const progressBar = “[” + “█”.repeat(progressBarFull) + “░”.repeat(progressBarEmpty) + “]”;
const percentage = Math.round(progress / total * 100);
const text = `${dsc}: ${progress}/${total} (${percentage}%)`;
return `${text}\n${progressBar}`;
}
//card
function theCard (numQs, fromCards, round) {
numQs = indexify(numQs);
const totalRounds = Math.ceil(numberOfCards(Cards())/10);
const card = fromCards[numQs].split(“?”);
const currentTotalCards = numberOfCards(fromCards);
const progress = textProgressBar(‘Card’, numQs+1, currentTotalCards) + “
” + textProgressBar(‘Round’, round, totalRounds);
const q = progress + “
” + card[0]+”?”;
const a = progress + “
” + card[1];
return {qstn: q, ansr: a, ansrIsVisible: 0};
}
//number of cards
function numberOfCards (fromCards) {
return fromCards.length;
}
function learn() {
showCards();
//showNextCard
}
function round (num = 1) {
let numOfCards = numberOfCards(Cards());
const rounds = Math.ceil(numOfCards/10);
num = num-1;
if (num !== rounds) {
return [(num * 10 + 1), (num * 10 + 10)];
} else {
return [(num * 10 + 1), numOfCards];
}
}
function showCards() {
let ele = document.getElementById(“learn”);
let cardNum = 1;
let r = 1;
let cards = Cards(round()[0], round()[1]);
let card = theCard(cardNum, cards, r);
let totalCards = numberOfCards(cards);
//presenting first card
//ele.innerHTML = card.qstn;
card.qstn.animate(ele);
const totalRounds = Math.ceil(numberOfCards(Cards())/10);
let toBeMemorized = [];
const enterKeyCod = 13;
const upKeyCod = 38;
const downKeyCod = 40;
const leftKeyCod = 37;
const rightKeyCod = 39;
function enterKey() {
if (card.ansrIsVisible == 0) {
//ele.innerHTML = card.ansr;
card.ansr.animate(ele, r);
card.ansrIsVisible = 1
} else {
//ele.innerHTML = card.qstn;
card.qstn.animate(ele);
card.ansrIsVisible = 0
}
}
function rightKey () {
console.log(“\ncard number: ” + cardNum);
console.log(“total cards: ” + totalCards);
if (cardNum == totalCards) {
//last card. else -> last & final card
if (totalCards > 1) {
cardNum = 1;
card = theCard(cardNum, cards, r);
//ele.innerHTML = card.qstn;
card.qstn.animate(ele);
} else {
if (r==totalRounds) {return};
r++;
cardNum = 1;
cards = Cards(round(r)[0], round(r)[1]);
totalCards = numberOfCards(cards);
card = theCard(cardNum, cards, r);
//ele.innerHTML = card.qstn;
card.qstn.animate(ele);
}
} else {
cardNum++;
card = theCard(cardNum, cards, r);
//ele.innerHTML = card.qstn;
card.qstn.animate(ele);
}
}
function leftKey () {
if (cardNum == 1) {
if (r==1) {return};
r–;
console.log(r);
cardNum = 10;
cards = Cards(round(r)[0], round(r)[1]);
card = theCard(cardNum, cards, r);
//ele.innerHTML = card.qstn;
card.qstn.animate(ele);
} else {
cardNum = cardNum-1;
card = theCard(cardNum, cards, r);
//ele.innerHTML = card.qstn;
card.qstn.animate(ele);
}
}
//adding event listener to keys
document.addEventListener(‘keydown’, (e) => {
if (e.keyCode == enterKeyCod) {
enterKey();
}
if (e.keyCode == rightKeyCod) {
rightKey();
}
if (e.keyCode == leftKeyCod) {
leftKey();
}
if (e.keyCode == upKeyCod) {
if (totalCards == 1) {
rightKey()
} else {
totalCards–;
cards.splice(indexify(cardNum), 1);
if (indexify(cardNum) == totalCards) { cardNum = indexify(cardNum) };
card = theCard(cardNum, cards, r);
//ele.innerHTML = card.qstn;
card.qstn.animate(ele);
}
}
if (e.keyCode == downKeyCod) {
cardNum = indexify(cardNum);
cards = moveElement(cards, cardNum, indexify(cards.length));
rightKey();
}
});
}
learn(2);