Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

16
LINES

< > BotCompany Repo | #1005401 // Test loading questions & answers from Smart Console using safeLoadConcepts [works]

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (2277L/15K/49K).

!752

p {
  Map<Long, O> concepts = safeLoadConcepts("#1005320");
  print("Number of concepts: " + l(concepts));
  for (O ua : valuesOfType(concepts, "main$UserAnswer")) {
    long id = getLong(ua, "id");
    S a = getString(ua, "text");
    O ulRef = getOpt(ua, "userLine");
    O ul = getOptDyn(ulRef, "value");
    bool solvable = getBool(ua, "solvable");
    print("id=" + id + ", ulRef=" + dynamicClassName(ulRef) + ", " + struct(dynFields(ulRef) )+ ", ul=" + ul);
    S q = getString(ul, "text");
    print((solvable ? "! " : "") + quote(q) + " => " + quote(a));
  }
}

Author comment

Began life as a copy of #1005077

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1005401
Snippet name: Test loading questions & answers from Smart Console using safeLoadConcepts [works]
Eternal ID of this version: #1005401/1
Text MD5: 37f03e295c0a1ff978ede03e8add66e8
Transpilation MD5: 1f2bd2bdc3c1c3bfbe12d209a4e9f271
Author: stefan
Category: javax / concepts
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-11-14 16:12:21
Source code size: 589 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 545 / 645
Referenced in: #1005406 - solvableSmartQuestions - get solvable questions (and answers) from Smart Console as MultiMap
#1005409 - Print solvableSmartQuestions [testing]