MCPcopy Create free account
hub / github.com/codemistic/Web-Development / hello

Function hello

background.js:63–156  ·  view source on GitHub ↗
(r)

Source from the content-addressed store, hash-verified

61 }
62})
63function hello(r) {
64 if (r.result_code != "wait") {
65 badge++;
66 chrome.browserAction.setBadgeText({ text: String(badge) });
67 var s = r.result_code;
68 var n = r.time;
69 var a = r.score;
70 var e = r.signal;
71 var c = r.error_link;
72
73 var op = {
74 type: "list",
75 title: ques.qname,
76 message: "",
77 items: []
78 }
79
80 var res = { time: n, prb: ques.qname };
81 var table = "<table class='status-table' cellspacing='0' cellpadding='5' width='60%'><tr><th>Sub-Task</th><th>Task #</th><th>Result<br/>(time)</th></tr>";
82
83 switch (s) {
84 case "partial_accepted": res.verdict = "Partially Correct";
85 op.items.push({ title: "Verdict: ", message: "Partially Accepted!!" });
86 op.items.push({ title: "Score: ", message: String(a) });
87 op.items.push({ title: "Time: ", message: String(n) + "s" });
88 op.iconUrl = "/images/pcorrect_chef_128.png"; break;
89
90 case "accepted": res.verdict = "Correct";
91 op.items.push({ title: "Verdict: ", message: "Accepted!!" });
92 op.items.push({ title: "Score: ", message: String(a) });
93 op.items.push({ title: "Time: ", message: String(n) + "s" });
94 op.iconUrl = "/images/correct_chef_128.png";
95 table += "<tr class='correct'><td>1</td><td>0</td><td>AC<br>(" + n + ")</td></tr>";
96 table += "<tr><th></th><th></th><th>Total Score = 100.00%<br/></th></tr>"; break;
97
98 case "wrong": res.verdict = "Wrong"
99 op.items.push({ title: "Verdict: ", message: "Wrong!!" });
100 op.items.push({ title: "Score: ", message: String(a) });
101 op.items.push({ title: "Time: ", message: String(n) + "s" });
102 op.iconUrl = "/images/wrong_chef_128.png";
103 table += "<tr class='wrong'><td>1</td><td>0</td><td>WA<br>(" + n + ")</td></tr>";
104 table += "<tr><th></th><th></th><th>Total Score =0.00%<br/></th></tr>"; break;
105
106 case "time": res.verdict = "TLE"
107 op.items.push({ title: "Verdict: ", message: "Time Limit Exceeded!!" });
108 op.iconUrl = "/images/wrong_chef_128.png";
109 table += "<tr class='wrong'><td>1</td><td>0</td><td>TLE<br>(" + n + ")</td></tr>";
110 table += "<tr><th></th><th></th><th>Total Score = 0.00%<br/></th></tr>"; break;
111
112 case "runtime": res.verdict = "Runtime Error";
113 op.items.push({ title: "Verdict: ", message: "Runtime Error(" + e + ")!!" });
114 op.iconUrl = "/images/wrong_chef_128.png";
115 table += "<tr class='wrong'><td>1</td><td>0</td><td>RE(" + e + ")<br>(" + n + ")</td></tr>";
116 table += "<tr><th></th><th></th><th>Total Score = 0.00%<br/></th></tr>"; break;
117
118 case "compile": res.verdict = "Compilation Error";
119 op.items.push({ title: "Verdict: ", message: "Compilation Error!!" });
120 op.iconUrl = "/images/wrong_chef_128.png";

Callers

nothing calls this directly

Calls 1

createMethod · 0.45

Tested by

no test coverage detected